Compare commits
554 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fe1a493211 | |||
| 3125c8577d | |||
| 02cdd5c0f8 | |||
| 55d57690f1 | |||
| 0f49c8dcb2 | |||
| 85dd95cf77 | |||
| 15d8e1dc21 | |||
| 99a56222da | |||
| 3bec282dbd | |||
| 3d5661096c | |||
| dfb49e339d | |||
| b493c0ea47 | |||
| 64b6038f92 | |||
| fbd5c5120f | |||
| 46ae2cb6c1 | |||
| d83d611b18 | |||
| e53d23d7d7 | |||
| 401165fe0c | |||
| a728a94caa | |||
| 833169b3a0 | |||
| 79a1ef7d8f | |||
| 41051db37b | |||
| 99d4f31d38 | |||
| 2c884b70b7 | |||
| 0cb7bbf192 | |||
| a306a8119f | |||
| 88edab5b45 | |||
| b0474f1dd9 | |||
| 344dd6b155 | |||
| bf2f7f86fa | |||
| 58e287d115 | |||
| d34d447b68 | |||
| a03ed0e26d | |||
| f4b0928c2d | |||
| bc49236ccc | |||
| 3a07fe7c22 | |||
| ac847ac715 | |||
| ec2dcfddbb | |||
| 9badc94845 | |||
| 65f63fecc1 | |||
| 62cc164059 | |||
| 560f485326 | |||
| 5898cc5bae | |||
| 1035ddac56 | |||
| ce0f796b84 | |||
| 1b3a6936a2 | |||
| bf73135721 | |||
| 1b468cb8aa | |||
| 05a7299c0e | |||
| fb06d7e38e | |||
| 0b1a337f52 | |||
| 891ec4e4e3 | |||
| 64428fc074 | |||
| 9a10195600 | |||
| 0d52712c3d | |||
| 5597592ff5 | |||
| dea8296e5b | |||
| bcb16ef822 | |||
| ce0ec9e236 | |||
| 9e359134a1 | |||
| be9ad03abe | |||
| dbe744f6e2 | |||
| 9084e6ce9b | |||
| a4a5a1a42b | |||
| f9da93dbe2 | |||
| a0919bdff6 | |||
| 573f424452 | |||
| 4a159ba118 | |||
| 0d6c5bb4e2 | |||
| 6616bdba33 | |||
| 7a6a6fcbb6 | |||
| 11f9e9b044 | |||
| 399aa3b28a | |||
| a9e4925167 | |||
| 3eadd82c6b | |||
| 779274575b | |||
| 5f28b0237a | |||
| 29a09c1fc0 | |||
| 7465bc2c20 | |||
| 36656fda3d | |||
| 0245e863c8 | |||
| af44a9cfa5 | |||
| 22ca266765 | |||
| 12aa017c9f | |||
| bb6401e096 | |||
| 6cff97469a | |||
| 75100306fe | |||
| da3078ed52 | |||
| 70bbfe664b | |||
| 3f81217fad | |||
| 3d7d3eb428 | |||
| 7f05dc489b | |||
| 70e0dd2d23 | |||
| 654e43a7ed | |||
| 4f36d52ec3 | |||
| 174d0d2dff | |||
| f7db7b7771 | |||
| d0176ea39d | |||
| 42b9c97d31 | |||
| 0e08ed3d80 | |||
| 665b330286 | |||
| f36e7b9170 | |||
| 7815e65261 | |||
| eddae97983 | |||
| e96148194d | |||
| c668929a24 | |||
| e5a0f4f5fc | |||
| efd6f46383 | |||
| 61c59d9c1d | |||
| 727a9d994d | |||
| f836ed2531 | |||
| 5b572a82a3 | |||
| a1b7e1cd95 | |||
| 9df2b90f56 | |||
| 183d88cfb6 | |||
| 472dba30ed | |||
| d8fc6477d7 | |||
| 2a204d5482 | |||
| db9796ddfd | |||
| d629b74d98 | |||
| 421842272a | |||
| c4d72905bf | |||
| f497c3d195 | |||
| 86e4dd21af | |||
| c8ffc289d9 | |||
| 5879c83284 | |||
| 8041171b33 | |||
| 1e416130db | |||
| 2e318dccc1 | |||
| 02f8dbe592 | |||
| 18586182a1 | |||
| 0d93784f95 | |||
| 9225f94c4b | |||
| 69317c5bdc | |||
| ada2d70c01 | |||
| 5271a6bef6 | |||
| 6937336a09 | |||
| 9ba47b4b7b | |||
| bb1fba7555 | |||
| e87ac08817 | |||
| cc60980341 | |||
| 6fe01d0c4c | |||
| 29d60b8e6a | |||
| 0e2f464666 | |||
| 1e42266075 | |||
| aa3dcfb2e1 | |||
| 9be555c4f5 | |||
| 8899a047d4 | |||
| 6c93d9b187 | |||
| a5c1c8d953 | |||
| 80147f664b | |||
| 7ae0a8d974 | |||
| 549f85c80f | |||
| 4df63cf4f3 | |||
| 6466795448 | |||
| 4373b57677 | |||
| 97e891fee0 | |||
| cd346002ea | |||
| 48577cde2f | |||
| 0a4891fcf0 | |||
| 91e1935e1d | |||
| 8fe7018793 | |||
| 85e1d7e344 | |||
| ca5bbacc2e | |||
| b48254406d | |||
| 49ca29e905 | |||
| e10fef2660 | |||
| fddbb9b66e | |||
| 48867ed3ab | |||
| 75d3e89442 | |||
| ba824058ef | |||
| fe508c8c46 | |||
| 73a5b07661 | |||
| bbe399a2b0 | |||
| 786336804e | |||
| 869dab48ef | |||
| b62baf4ec1 | |||
| cf9d1521d8 | |||
| 6df693c448 | |||
| 64f732195e | |||
| 034950f993 | |||
| 309f243ea1 | |||
| 9294975522 | |||
| 50bd84a168 | |||
| 7ce3496b77 | |||
| 6aca595636 | |||
| eaffe5d5d0 | |||
| 39868b1498 | |||
| f11b29f1e7 | |||
| ad169e0261 | |||
| 6bc7f34a38 | |||
| ce4eb73bfa | |||
| 6864b4cb77 | |||
| 72ad366ad3 | |||
| c113d0c078 | |||
| 82e676d99f | |||
| f11331b2f1 | |||
| 9934fd8da4 | |||
| d745a537bf | |||
| 4e3c936503 | |||
| 0e295d01c3 | |||
| b9a10e2861 | |||
| d76004af71 | |||
| 0fbae0aeff | |||
| 63a3c9ce83 | |||
| 656907543a | |||
| 52507c33cf | |||
| 862343d802 | |||
| c1503a89a5 | |||
| 87588dd9ff | |||
| c3ec244c89 | |||
| 38b526762a | |||
| 41ebb5fbc1 | |||
| 0a589fd44a | |||
| 430aef4b59 | |||
| 66e61339b1 | |||
| 90f1ec41a4 | |||
| 289715b159 | |||
| b904a829b6 | |||
| e184561762 | |||
| 34bc3a8786 | |||
| efc05efebd | |||
| 9fe51b2a58 | |||
| 631d35bcc2 | |||
| 003e90151e | |||
| 4bc19a1621 | |||
| ea6d11a47e | |||
| 041f615cc3 | |||
| cfb03e5e10 | |||
| 5220440e86 | |||
| 9915f79681 | |||
| 2e67897926 | |||
| 1a6a672c6e | |||
| 1420cc346d | |||
| 6b15ae6041 | |||
| 6ae80231b2 | |||
| 8d1a7de32f | |||
| 66ee37fbf4 | |||
| cfc4c1b7d1 | |||
| 9eb9501c27 | |||
| e3455c28eb | |||
| 08119fe298 | |||
| bbb0b30dd3 | |||
| 2242193f11 | |||
| 3623623cf9 | |||
| e75984a2fb | |||
| 2577136447 | |||
| 1fa1cd881b | |||
| 63be68e1cb | |||
| 88c47b4995 | |||
| baea51cfa6 | |||
| c6b23e89cf | |||
| 6f84b0e9c8 | |||
| 1d25fe6892 | |||
| c4b48cd144 | |||
| fb4e0aebd6 | |||
| 91ccce062e | |||
| 1f0e952ff2 | |||
| ce4275cf9b | |||
| 15b83ced14 | |||
| e2649f122f | |||
| 0d9a96fec4 | |||
| 0e0507520b | |||
| 65339366d3 | |||
| 4f9118a1d5 | |||
| 8f2516eefb | |||
| 6e4ed79c88 | |||
| 5ce0418131 | |||
| 426d8e1244 | |||
| 972743058e | |||
| 8b8d0183dc | |||
| fb2a029e97 | |||
| 896ddc7d95 | |||
| 3ba84d959e | |||
| 3c045dd60e | |||
| 76483e6dcc | |||
| 9203aaf140 | |||
| 0c1817ada1 | |||
| 3bb1276271 | |||
| d3d9fdc0e5 | |||
| 760b7f6c45 | |||
| 77ca9c37ca | |||
| 1e359e31ed | |||
| f237b9feee | |||
| 4167abcb5d | |||
| 852cc06c85 | |||
| 4a0081feb3 | |||
| 7c446ad0d4 | |||
| a882494f03 | |||
| d31c4b5a04 | |||
| 961a7d09cc | |||
| a8488328b1 | |||
| 3cca66df9c | |||
| 6bf503fa56 | |||
| e88397d209 | |||
| cdc7c6fcc8 | |||
| 5754d6d866 | |||
| b9f793cefd | |||
| 4ebce62921 | |||
| 03368b302f | |||
| 3390d77e28 | |||
| c0783b62c0 | |||
| 85daa2c5c6 | |||
| 429f5c9d25 | |||
| c154f4ff95 | |||
| 1f33664599 | |||
| cc462f60ec | |||
| 4864d12d0c | |||
| 121f9b26c3 | |||
| 414d9cfeee | |||
| a6f984b406 | |||
| b02d2011a8 | |||
| 60e424c882 | |||
| 81703b0fb5 | |||
| 534b3efa0a | |||
| 500be67439 | |||
| bbd352bd57 | |||
| 558b1a2fef | |||
| 216a5a7f12 | |||
| 7fecf688bc | |||
| ef5fdd8cc6 | |||
| bc931e3286 | |||
| 48d9ef8f54 | |||
| 0dc01eca8c | |||
| 111151a177 | |||
| 56bfe6f4b7 | |||
| 01f0eb9ad3 | |||
| 02635807ce | |||
| 2ffc396f29 | |||
| 77ff4c53b8 | |||
| f2a49988ce | |||
| 867851b81f | |||
| 5c155ac7a5 | |||
| bec9d1c8df | |||
| bf9af6d93a | |||
| e92cb8cf50 | |||
| 5b13bec33a | |||
| 65f8821e60 | |||
| dff6200ce2 | |||
| 1d39ccd924 | |||
| 28a1a88128 | |||
| 610cecce12 | |||
| 5604226901 | |||
| f27670da66 | |||
| fc3c19c664 | |||
| 6b12a2813a | |||
| ba2a9304e8 | |||
| a6d2c98a5f | |||
| 4ce0965553 | |||
| eae6dc4a8e | |||
| 6a4cc8e537 | |||
| f1278dca9f | |||
| 30ef8f84ff | |||
| 604e5a7a45 | |||
| 3ec6d263b8 | |||
| 48a0aff91d | |||
| a1078197fd | |||
| 2d2a71f7aa | |||
| f2a278fad5 | |||
| 945fb8717c | |||
| 98187feda4 | |||
| 9dd1992a9d | |||
| 0c82c42f3d | |||
| 9297879774 | |||
| d34fed2e2a | |||
| 26e586237e | |||
| f59a9cdb42 | |||
| 7d1c1f6c8a | |||
| 25e2a8e1d8 | |||
| 6229d096e5 | |||
| 8c2a5290ad | |||
| e7023ea88a | |||
| 6123fb57e9 | |||
| 5aa64b9cac | |||
| 17985eaec5 | |||
| 4a11e36f85 | |||
| a07d79a8d3 | |||
| 048d40185d | |||
| 5f9800a0a7 | |||
| f3ff95bdd8 | |||
| 71b302bc49 | |||
| 63cfb2e00b | |||
| 8d219e56bc | |||
| 9197a1028f | |||
| 4b6effe849 | |||
| f0057aaa80 | |||
| 6d118a94d0 | |||
| 2d5dab5647 | |||
| 6593010f65 | |||
| d3f694525e | |||
| 77c424a53d | |||
| 896c715e35 | |||
| 961d3586a7 | |||
| 2341889e69 | |||
| 3b9071cf27 | |||
| e7706a3320 | |||
| 0b782a2f7f | |||
| 6c7a79387a | |||
| 264620c744 | |||
| b89568dcc5 | |||
| fde46d6ee8 | |||
| b7d9331f0e | |||
| 1b13e37ec2 | |||
| 41e4d297e8 | |||
| d84342b076 | |||
| 95eeae244b | |||
| ed11fbce92 | |||
| e6c0a0b36e | |||
| ce9e9e0d89 | |||
| 103a676163 | |||
| 0f54780d9b | |||
| 5e84be1a7d | |||
| 455dae4bfe | |||
| 667f926d1c | |||
| 46e2920f70 | |||
| f2a534bf12 | |||
| 3082cb5195 | |||
| 83ed711d3c | |||
| e0356c30ca | |||
| 10008230eb | |||
| d32278ed01 | |||
| 0b137f41e2 | |||
| 836a69685b | |||
| 5de49c9ea3 | |||
| 6965fc78ba | |||
| d1be6c2495 | |||
| e4461f93d5 | |||
| d017d8e9e7 | |||
| 34fefcd0f6 | |||
| 008a8c7168 | |||
| db84792f9f | |||
| f3d206f725 | |||
| 656b0ce32d | |||
| 905969f542 | |||
| c3cddc3b96 | |||
| b1239433ae | |||
| 598c2d2478 | |||
| 145474f398 | |||
| d4125b58f9 | |||
| 4adbd15346 | |||
| 29f3336462 | |||
| dd45b3d00f | |||
| d91f3ba421 | |||
| f8d6dccdf8 | |||
| faaf1fdac9 | |||
| 96784e037d | |||
| e0435ccc26 | |||
| 7b66953776 | |||
| 778835199f | |||
| 220b44fe17 | |||
| 11ba494e4c | |||
| cfc41552e7 | |||
| 00a2844d66 | |||
| 4c469946fe | |||
| 10b91f71d1 | |||
| 51d60f9b43 | |||
| cbfc6ec8ed | |||
| 73ad3cb092 | |||
| eedac55a7d | |||
| 34f46c045a | |||
| 9d467c8df1 | |||
| 9613d2dd8c | |||
| e3dd9042b1 | |||
| cf24fa4ca0 | |||
| 23b3545c8d | |||
| c5b4dccdf4 | |||
| 5bc28643d3 | |||
| 59d480bd8d | |||
| e8d775f806 | |||
| f68d704b60 | |||
| 31b1be9154 | |||
| ce8344e9ad | |||
| 89476c57dd | |||
| 20548378ed | |||
| bd8397897e | |||
| 16cc6fed3c | |||
| 5e09a7498b | |||
| 6a9e86bb5c | |||
| bd938c930f | |||
| edf7ef8641 | |||
| b4a9b406c2 | |||
| 1ef454e8c1 | |||
| 844a2019a9 | |||
| d965824092 | |||
| cb1091cae1 | |||
| 9ae3a8d6d2 | |||
| 1a95b1fff0 | |||
| b6c9531d22 | |||
| a9e4a158fe | |||
| ff0ea074ab | |||
| 91b24b6363 | |||
| 24403e3f19 | |||
| 3ada410bc9 | |||
| 2a1889d012 | |||
| 21d9026dbb | |||
| b3cb4f8037 | |||
| 279466a85d | |||
| e70fc391b8 | |||
| 687befe638 | |||
| 32497ce2a2 | |||
| d1b0ceea22 | |||
| e29266e8a5 | |||
| 3c641d4ec2 | |||
| 04d0248a5a | |||
| 02ab786074 | |||
| 17fd766fa5 | |||
| de777b9164 | |||
| 1825798f2a | |||
| 508526c98d | |||
| 550aa7d162 | |||
| 7a9d91ec88 | |||
| b9b9aa5782 | |||
| d45205e37d | |||
| d4e507bab8 | |||
| 9b53c7b81b | |||
| 30d756a5f6 | |||
| e40de5b395 | |||
| 206c17b1e2 | |||
| 6a70bb518f | |||
| 66aa8548f7 | |||
| a5c6b3d272 | |||
| 60004ef651 | |||
| 0e14818262 | |||
| 542bf4520b | |||
| 5133c85054 | |||
| abf4ba7df9 | |||
| 2cebf15b79 | |||
| 3390833f0c | |||
| 12feb5896f | |||
| 71a7b595ad | |||
| b5ded5174e | |||
| 2044110d76 | |||
| 4110bf69a1 | |||
| 60f612a532 | |||
| 05888905a8 | |||
| d755f8f5c3 | |||
| f7fa2e2942 | |||
| ad20c88c20 | |||
| 70a7c5ce02 | |||
| 8a24790a12 | |||
| 697f856843 | |||
| 1ad3a206d0 | |||
| 26ccf90eb1 | |||
| a11e93caa4 | |||
| 547cd77748 | |||
| df87cf35fc | |||
| 9e39cceb5a | |||
| 315d6e4196 | |||
| 57a2bff506 | |||
| 23c981d632 | |||
| ccd8ecee09 | |||
| c3ad6d91cf | |||
| fbe0af0831 | |||
| 72df35f1fa |
@@ -1,36 +0,0 @@
|
||||
subproject libs/graph/build ;
|
||||
|
||||
SOURCES = graphviz_graph_lex graphviz_digraph_lex
|
||||
graphviz_graph_parser graphviz_digraph_parser ;
|
||||
|
||||
GRAPHVIZ_DEFS(graphviz_graph_parser) =
|
||||
GRAPHVIZ_GRAPH=boost::GraphvizGraph
|
||||
GRAPHVIZ_DIRECTED=0
|
||||
;
|
||||
GRAPHVIZ_DEFS(graphviz_digraph_parser) =
|
||||
GRAPHVIZ_GRAPH=boost::GraphvizDigraph
|
||||
GRAPHVIZ_DIRECTED=1
|
||||
;
|
||||
|
||||
{
|
||||
|
||||
rule bgl-lib-file
|
||||
{
|
||||
local objects source defs ;
|
||||
defs = $(DEFINES) ;
|
||||
for source in $(>)
|
||||
{
|
||||
DEFINES = $(defs) $(GRAPHVIZ_DEFS($(source:B))) ;
|
||||
objects += [ Objects $(source) ] ;
|
||||
}
|
||||
LibraryFromObjects $(<) : $(objects) ;
|
||||
}
|
||||
local gGENERATOR_FUNCTION(LIB) = bgl-lib-file ;
|
||||
|
||||
lib bgl-viz
|
||||
: ../src/$(SOURCES).cpp
|
||||
: <sysinclude>$(BOOST_ROOT)
|
||||
: debug <inlining>on #inlining prevents linker name clashes due to truncation!
|
||||
;
|
||||
|
||||
}
|
||||
@@ -1,25 +1,50 @@
|
||||
# Copyright (c) 2002 Trustees of Indiana University
|
||||
#
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
project boost/graph
|
||||
: requirements <include>../src
|
||||
: source-location ../src
|
||||
;
|
||||
|
||||
lib libbgl-viz
|
||||
: graphviz_graph_lex
|
||||
graphviz_digraph_lex
|
||||
graphviz_graph_parser
|
||||
graphviz_digraph_parser
|
||||
;
|
||||
if [ modules.peek : GRAPHVIZ_PARSER ]
|
||||
{
|
||||
lib boost_graph
|
||||
:
|
||||
graphviz_graph_lex
|
||||
graphviz_digraph_lex
|
||||
graphviz_graph_parser
|
||||
graphviz_digraph_parser
|
||||
: <define>YY_NO_UNISTD_H
|
||||
;
|
||||
|
||||
obj graphviz_graph_lex : graphviz_lex.ll
|
||||
: <flex.prefix>bgl_undir_ <define>GRAPHVIZ_DIRECTED=0
|
||||
<implicit-dependency>graphviz_graph_parser ;
|
||||
obj graphviz_graph_parser : graphviz_parser.yy
|
||||
: <bison.prefix>bgl_undir_ <define>GRAPHVIZ_DIRECTED=0 ;
|
||||
|
||||
|
||||
obj graphviz_digraph_lex : graphviz_lex.ll
|
||||
: <flex.prefix>bgl_dir_ <define>GRAPHVIZ_DIRECTED=1
|
||||
<implicit-dependency>graphviz_digraph_parser ;
|
||||
obj graphviz_digraph_parser : graphviz_parser.yy
|
||||
: <bison.prefix>bgl_dir_ <define>GRAPHVIZ_DIRECTED=1 ;
|
||||
obj graphviz_graph_lex : graphviz_lex.ll
|
||||
: <flex.prefix>bgl_undir_ <define>GRAPHVIZ_DIRECTED=0
|
||||
<implicit-dependency>graphviz_graph_parser ;
|
||||
obj graphviz_graph_parser : graphviz_parser.yy
|
||||
: <bison.prefix>bgl_undir_ <define>GRAPHVIZ_DIRECTED=0 ;
|
||||
|
||||
|
||||
obj graphviz_digraph_lex : graphviz_lex.ll
|
||||
: <flex.prefix>bgl_dir_ <define>GRAPHVIZ_DIRECTED=1
|
||||
<implicit-dependency>graphviz_digraph_parser ;
|
||||
obj graphviz_digraph_parser : graphviz_parser.yy
|
||||
: <bison.prefix>bgl_dir_ <define>GRAPHVIZ_DIRECTED=1 ;
|
||||
}
|
||||
else
|
||||
{
|
||||
lib boost_graph
|
||||
:
|
||||
read_graphviz_spirit.cpp
|
||||
:
|
||||
<define>BOOST_GRAPH_NO_LIB=1
|
||||
<link>shared:<define>BOOST_GRAPH_DYN_LINK=1
|
||||
# # Intel compiler ICEs if we turn optimization on
|
||||
<toolset>intel-vc71-win-9.1:<optimization>off
|
||||
# Without these flags, MSVC 7.1 and 8.0 crash
|
||||
<toolset>msvc-7.1:<cxxflags>-GR-
|
||||
<toolset>msvc-8.0:<cxxflags>-GR-
|
||||
;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- Copyright (c) 2004 Kris Beevers
|
||||
--
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: AStarHeuristic</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1>AStar Heuristic Concept</H1>
|
||||
|
||||
This concept defines the interface for the heuristic function of an A*
|
||||
search, which is responsible for estimating the remaining cost from
|
||||
some vertex to a goal. The user can create a class that matches this
|
||||
interface, and then pass objects of the class into <a
|
||||
href="./astar_search.html"><tt>astar_search()</tt></a> to guide the
|
||||
order of vertex examination of the search. The heuristic instance
|
||||
must incorporate any necessary information about goal vertices in the
|
||||
graph.
|
||||
|
||||
For further discussion of the use of heuristics in an A* search, see
|
||||
the documentation of <a
|
||||
href="./astar_search.html">astar_search()</a>.
|
||||
|
||||
<h3>Refinement of</h3>
|
||||
|
||||
<a href="http://www.sgi.com/tech/stl/UnaryFunction.html">Unary
|
||||
Function</a> (must take a single argument -- a graph vertex -- and
|
||||
return a cost value) and <a
|
||||
href="../../utility/CopyConstructible.html">Copy Constructible</a>
|
||||
(copying a heuristic should be a lightweight operation).
|
||||
|
||||
|
||||
<h3>Notation</h3>
|
||||
|
||||
<Table>
|
||||
<TR>
|
||||
<TD><tt>H</tt></TD>
|
||||
<TD>A type that is a model of AStar Heuristic.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><tt>h</tt></TD>
|
||||
<TD>An object of type <tt>H</tt>.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><tt>G</tt></TD>
|
||||
<TD>A type that is a model of Graph.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><tt>g</tt></TD>
|
||||
<TD>An object of type <tt>G</tt>.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><tt>u</tt></TD>
|
||||
<TD>An object of type <tt>boost::graph_traits<G>::vertex_descriptor</tt>.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><tt>CostType</tt></TD>
|
||||
<TD>A type that can be used with the <tt>compare</tt> and
|
||||
<tt>combine</tt> functions passed to A*.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><tt>c</tt></TD>
|
||||
<TD>An object of type <tt>CostType</tt>.</TD>
|
||||
</TR>
|
||||
|
||||
</table>
|
||||
|
||||
<h3>Associated Types</h3>
|
||||
|
||||
none
|
||||
<p>
|
||||
|
||||
<h3>Valid Expressions</h3>
|
||||
|
||||
<table border>
|
||||
<tr>
|
||||
<th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Call Heuristic</td>
|
||||
<td><tt>CostType c = h(u)</tt></td>
|
||||
<td><tt>CostType</tt></td>
|
||||
<td>
|
||||
Called for the target of every out edge of a vertex being examined.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<h3>Models</h3>
|
||||
|
||||
<ul>
|
||||
<li><a href="./astar_heuristic.html"><tt>astar_heuristic</tt></a>
|
||||
</ul>
|
||||
|
||||
<h3>Concept Checking Class</h3>
|
||||
|
||||
<pre>
|
||||
template <class Heuristic, class Graph>
|
||||
struct AStarHeuristicConcept {
|
||||
void constraints()
|
||||
{
|
||||
function_requires< CopyConstructibleConcept<Heuristic> >();
|
||||
h(u);
|
||||
}
|
||||
Heuristic h;
|
||||
typename graph_traits<Graph>::vertex_descriptor u;
|
||||
};
|
||||
</pre>
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2004</TD><TD>
|
||||
<A HREF="http://www.cs.rpi.edu/~beevek/">Kristopher Beevers</A>,
|
||||
Rensselaer Polytechnic Institute (<A
|
||||
HREF="mailto:beevek@cs.rpi.edu">beevek@cs.rpi.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -0,0 +1,213 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- Copyright (c) 2004 Kris Beevers
|
||||
--
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: AStarVisitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1>AStar Visitor Concept</H1>
|
||||
|
||||
This concept defines the visitor interface for <a
|
||||
href="./astar_search.html"><tt>astar_search()</tt></a>. Users can
|
||||
define a class with the AStar Visitor interface and pass an object of
|
||||
the class to <tt>astar_search()</tt>, thereby augmenting the actions
|
||||
taken during the graph search.
|
||||
|
||||
<h3>Refinement of</h3>
|
||||
|
||||
<a href="../../utility/CopyConstructible.html">Copy Constructible</a>
|
||||
(copying a visitor should be a lightweight operation).
|
||||
|
||||
|
||||
<h3>Notation</h3>
|
||||
|
||||
<Table>
|
||||
<TR>
|
||||
<TD><tt>V</tt></TD>
|
||||
<TD>A type that is a model of AStar Visitor.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><tt>vis</tt></TD>
|
||||
<TD>An object of type <tt>V</tt>.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><tt>G</tt></TD>
|
||||
<TD>A type that is a model of Graph.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><tt>g</tt></TD>
|
||||
<TD>An object of type <tt>G</tt>.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><tt>e</tt></TD>
|
||||
<TD>An object of type <tt>boost::graph_traits<G>::edge_descriptor</tt>.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><tt>s,u,v</tt></TD>
|
||||
<TD>An object of type <tt>boost::graph_traits<G>::vertex_descriptor</tt>.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><tt>d</tt></TD>
|
||||
<TD>An object of type <tt>DistanceMap</tt>.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><tt>WeightMap</tt></TD>
|
||||
<TD>A type that is a model of <a
|
||||
href="../../property_map/ReadablePropertyMap.html">Readable Property
|
||||
Map</a>.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><tt>w</tt></TD>
|
||||
<TD>An object of type <tt>WeightMap</tt>.</TD>
|
||||
</TR>
|
||||
|
||||
</table>
|
||||
|
||||
<h3>Associated Types</h3>
|
||||
|
||||
none
|
||||
<p>
|
||||
|
||||
<h3>Valid Expressions</h3>
|
||||
|
||||
<table border>
|
||||
<tr>
|
||||
<th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Initialize Vertex</td>
|
||||
<td><tt>vis.initialize_vertex(u, g)</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This is invoked on each vertex of the graph when it is first
|
||||
initialized (i.e., when its property maps are initialized).
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Discover Vertex</td>
|
||||
<td><tt>vis.discover_vertex(u, g)</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This is invoked when a vertex is first discovered and is added to the
|
||||
OPEN list.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Examine Vertex</td>
|
||||
<td><tt>vis.examine_vertex(u, g)</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This is invoked on a vertex as it is popped from the queue (i.e. it
|
||||
has the lowest cost on the OPEN list). This happens immediately before
|
||||
<tt>examine_edge()</tt> is invoked on each of the out-edges of vertex
|
||||
<tt>u</tt>.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Examine Edge</td>
|
||||
<td><tt>vis.examine_edge(e, g)</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This is invoked on every out-edge of each vertex after it is
|
||||
examined.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td>Edge Relaxed</td>
|
||||
<td><tt>vis.edge_relaxed(e, g)</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
Upon examination, if the following condition holds then the edge is
|
||||
relaxed (the distance of its target vertex is reduced) and this method
|
||||
is invoked:
|
||||
<blockquote>
|
||||
<pre>
|
||||
tie(u, s) = incident(e, g);
|
||||
D d_u = get(d, u), d_v = get(d, s);
|
||||
W w_e = get(w, e);
|
||||
assert(compare(combine(d_u, w_e), d_s));
|
||||
</pre>
|
||||
</blockquote>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Edge Not Relaxed</td>
|
||||
<td><tt>vis.edge_not_relaxed(e, g)</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
Upon examination, if an edge is not relaxed (see above), then this
|
||||
method is invoked.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Black Target</td>
|
||||
<td><tt>vis.black_target(e, g)</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This is invoked when a vertex that is on the CLOSED list is
|
||||
``rediscovered'' via a more efficient path, and is re-added to the
|
||||
OPEN list.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Finish Vertex</td>
|
||||
<td><tt>vis.finish_vertex(u, g)</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This is invoked on a vertex when it is added to the CLOSED list, which
|
||||
happens after all of its out edges have been examined.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<h3>Models</h3>
|
||||
|
||||
<ul>
|
||||
<li><a href="./astar_visitor.html"><tt>astar_visitor</tt></a>
|
||||
</ul>
|
||||
|
||||
|
||||
<h3>See also</h3>
|
||||
|
||||
<a href="./visitor_concepts.html">Visitor concepts</a>
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2004</TD><TD>
|
||||
<A HREF="http://www.cs.rpi.edu/~beevek/">Kristopher Beevers</A>,
|
||||
Rensselaer Polytechnic Institute (<A
|
||||
HREF="mailto:beevek@cs.rpi.edu">beevek@cs.rpi.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>AdjacencyGraph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>AdjacencyMatrix</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
@@ -69,6 +65,11 @@ consisting of the edge descriptor if the edge was found.
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<H3>Complexity guarantees</H3>
|
||||
|
||||
The <TT>edge()</TT> function must return in constant time.
|
||||
|
||||
|
||||
<H3>Models</H3>
|
||||
|
||||
<a href="./adjacency_matrix.html"><tt>adjacency_matrix</tt></a>
|
||||
|
||||
@@ -2,24 +2,20 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: BFSVisitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1>BFS Visitor Concept</H1>
|
||||
<H1><img src="figs/python.gif" alt="(Python)"/>BFS Visitor Concept</H1>
|
||||
|
||||
This concept defines the visitor interface for <a
|
||||
href="./breadth_first_search.html"><tt>breadth_first_search()</tt></a>.
|
||||
@@ -180,6 +176,27 @@ search tree and all of the adjacent vertices have been discovered
|
||||
<li><a href="./bfs_visitor.html"><tt>bfs_visitor</tt></a>
|
||||
</ul>
|
||||
|
||||
<a name="python"></a><h3>Python</h3>
|
||||
To implement a model of the <tt>BFSVisitor</tt> concept in Python,
|
||||
create a new class that derives from the <tt>BFSVisitor</tt> type of
|
||||
the graph, which will be
|
||||
named <tt><i>GraphType</i>.BFSVisitor</tt>. The events and syntax are
|
||||
the same as with visitors in C++. Here is an example for the
|
||||
Python <tt>bgl.Graph</tt> graph type:
|
||||
|
||||
<pre>
|
||||
class count_tree_edges_bfs_visitor(bgl.Graph.BFSVisitor):
|
||||
def __init__(self, name_map):
|
||||
bgl.Graph.BFSVisitor.__init__(self)
|
||||
self.name_map = name_map
|
||||
|
||||
def tree_edge(self, e, g):
|
||||
(u, v) = (g.source(e), g.target(e))
|
||||
print "Tree edge ",
|
||||
print self.name_map[u],
|
||||
print " -> ",
|
||||
print self.name_map[v]
|
||||
</pre>
|
||||
|
||||
<h3>See also</h3>
|
||||
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>BasicMatrix</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,24 +2,20 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Bellman Ford Visitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1>Bellman Ford Visitor Concept</H1>
|
||||
<H1><img src="figs/python.gif" alt="(Python)"/>Bellman Ford Visitor Concept</H1>
|
||||
|
||||
This concept defines the visitor interface for <a
|
||||
href="./bellman_ford_shortest.html"><tt>bellman_ford_shortest_paths()</tt></a>.
|
||||
@@ -79,16 +75,6 @@ none
|
||||
<th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Initialize Vertex</td>
|
||||
<td><tt>vis.initialize_vertex(s, g)</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This is invoked on every vertex of the graph before the start of the
|
||||
graph search.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Examine Edge</td>
|
||||
<td><tt>vis.examine_edge(e, g)</tt></td>
|
||||
@@ -156,6 +142,29 @@ when there is a negative cycle in the graph.
|
||||
<li><a href="./bellman_visitor.html"><tt>bellman_visitor</tt></a>
|
||||
</ul>
|
||||
|
||||
<a name="python"></a>
|
||||
<h3>Python</h3>
|
||||
|
||||
To implement a model of the <tt>BellmanFordVisitor</tt> concept in Python,
|
||||
create a new class that derives from the <tt>BellmanFordVisitor</tt> type of
|
||||
the graph, which will be
|
||||
named <tt><i>GraphType</i>.BellmanFordVisitor</tt>. The events and syntax are
|
||||
the same as with visitors in C++. Here is an example for the
|
||||
Python <tt>bgl.Graph</tt> graph type:
|
||||
|
||||
<pre>
|
||||
class count_tree_edges_bellman_ford_visitor(bgl.Graph.BellmanFordVisitor):
|
||||
def __init__(self, name_map):
|
||||
bgl.Graph.BellmanFordVisitor.__init__(self)
|
||||
self.name_map = name_map
|
||||
|
||||
def edge_relaxed(self, e, g):
|
||||
(u, v) = (g.source(e), g.target(e))
|
||||
print "Relaxed edge ",
|
||||
print self.name_map[u],
|
||||
print " -> ",
|
||||
print self.name_map[v]
|
||||
</pre>
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Bidirectional</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,20 +2,16 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Buffer</Title>
|
||||
</HEAD>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
@@ -78,7 +74,7 @@ For a type to model the Buffer concept it must have the following members.
|
||||
Precondition: <tt>empty()</tt> is <tt>false</tt>.</td>
|
||||
</tr>
|
||||
|
||||
<tr> <td> <tt>void size() const</tt> </td>
|
||||
<tr> <td> <tt>size_type size() const</tt> </td>
|
||||
<td> Returns the number of objects in the Buffer.
|
||||
Invariant: <tt>size() >= 0</tt>. </td>
|
||||
</tr>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: ColorValue Concept</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,28 +2,24 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>DFS Visitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1>DFS Visitor Concept</H1>
|
||||
<H1><img src="figs/python.gif" alt="(Python)"/>DFS Visitor Concept</H1>
|
||||
|
||||
This concept defines the visitor interface for <a
|
||||
href="./depth_first_search.html"><tt>depth_first_search()</tt></a>.
|
||||
Users can define a class with the DFS Visitor interface and pass and
|
||||
Users can define a class with the DFS Visitor interface and pass an
|
||||
object of the class to <tt>depth_first_search()</tt>, thereby
|
||||
augmenting the actions taken during the graph search.
|
||||
|
||||
@@ -174,6 +170,29 @@ all the out-edges of <tt>u</tt> have been examined.
|
||||
<li><a href="./dfs_visitor.html"><tt>dfs_visitor</tt></a>
|
||||
</ul>
|
||||
|
||||
<a name="python"></a>
|
||||
<h3>Python</h3>
|
||||
|
||||
To implement a model of the <tt>DFSVisitor</tt> concept in Python,
|
||||
create a new class that derives from the <tt>DFSVisitor</tt> type of
|
||||
the graph, which will be
|
||||
named <tt><i>GraphType</i>.DFSVisitor</tt>. The events and syntax are
|
||||
the same as with visitors in C++. Here is an example for the
|
||||
Python <tt>bgl.Graph</tt> graph type:
|
||||
|
||||
<pre>
|
||||
class count_tree_edges_dfs_visitor(bgl.Graph.DFSVisitor):
|
||||
def __init__(self, name_map):
|
||||
bgl.Graph.DFSVisitor.__init__(self)
|
||||
self.name_map = name_map
|
||||
|
||||
def tree_edge(self, e, g):
|
||||
(u, v) = (g.source(e), g.target(e))
|
||||
print "Tree edge ",
|
||||
print self.name_map[u],
|
||||
print " -> ",
|
||||
print self.name_map[v]
|
||||
</pre>
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
|
||||
@@ -2,24 +2,20 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Dijkstra Visitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1>Dijkstra Visitor Concept</H1>
|
||||
<H1><img src="figs/python.gif" alt="(Python)"/>Dijkstra Visitor Concept</H1>
|
||||
|
||||
This concept defines the visitor interface for <a
|
||||
href="./dijkstra_shortest_paths.html"><tt>dijkstra_shortest_paths()</tt></a>
|
||||
@@ -184,6 +180,30 @@ search tree and all of the adjacent vertices have been discovered
|
||||
<li><a href="./dijkstra_visitor.html"><tt>dijkstra_visitor</tt></a>
|
||||
</ul>
|
||||
|
||||
<a name="python"></a>
|
||||
<h3>Python</h3>
|
||||
|
||||
To implement a model of the <tt>DijkstraVisitor</tt> concept in Python,
|
||||
create a new class that derives from the <tt>DijkstraVisitor</tt> type of
|
||||
the graph, which will be
|
||||
named <tt><i>GraphType</i>.DijkstraVisitor</tt>. The events and syntax are
|
||||
the same as with visitors in C++. Here is an example for the
|
||||
Python <tt>bgl.Graph</tt> graph type:
|
||||
|
||||
<pre>
|
||||
class count_tree_edges_dijkstra_visitor(bgl.Graph.DijkstraVisitor):
|
||||
def __init__(self, name_map):
|
||||
bgl.Graph.DijkstraVisitor.__init__(self)
|
||||
self.name_map = name_map
|
||||
|
||||
def edge_relaxed(self, e, g):
|
||||
(u, v) = (g.source(e), g.target(e))
|
||||
print "Relaxed edge ",
|
||||
print self.name_map[u],
|
||||
print " -> ",
|
||||
print self.name_map[v]
|
||||
</pre>
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>EdgeListGraph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2001
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Edge Mutable Graph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: EventVisitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: EventVisitorList</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Graph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
@@ -26,8 +22,7 @@ Graph
|
||||
<P>
|
||||
The Graph concept contains a few requirements that are common to all
|
||||
the graph concepts. These include some associated types for
|
||||
<tt>vertex_descriptor</tt>, <tt>edge_descriptor</tt>, etc., and the
|
||||
<tt>num_vertices()</tt> and <tt>num_edges()</tt> functions. One should
|
||||
<tt>vertex_descriptor</tt>, <tt>edge_descriptor</tt>, etc. One should
|
||||
note that a model of Graph is <B>not</B> required to be a model of <a
|
||||
href="http://www.sgi.com/tech/stl/Assignable.html">Assignable</a>,
|
||||
so algorithms should pass graph objects by reference.
|
||||
@@ -75,7 +70,7 @@ and <a href="http://www.sgi.com/tech/stl/EqualityComparable.html">Equality Compa
|
||||
|
||||
<tr>
|
||||
<td><pre>boost::graph_traits<G>::directed_category</pre>
|
||||
The choices are <TT>directed_tag</TT> and <TT>undirected_tag</TT>.
|
||||
This type shall be convertible to <TT>directed_tag</TT> or <TT>undirected_tag</TT>.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -106,7 +101,7 @@ graph can be visited. The choices are <TT>incidence_graph_tag</TT>,
|
||||
<tr>
|
||||
<td><pre>boost::graph_traits<G>::null_vertex()</pre></td></TD>
|
||||
<td>
|
||||
Returns a special <tt>vertex_descriptor</tt> object which does not refer to
|
||||
Returns a special <tt>boost::graph_traits<G>::vertex_descriptor</tt> object which does not refer to
|
||||
any vertex of graph object which type is <tt>G</tt>.
|
||||
<td>
|
||||
</tr>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>IncidenceGraph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
@@ -169,13 +165,13 @@ Therefore, the extra requirement is added that the out-edge connecting
|
||||
function_requires< GraphConcept<G> >();
|
||||
function_requires< MultiPassInputIteratorConcept<out_edge_iterator> >();
|
||||
|
||||
p = out_edges(v, g);
|
||||
p = out_edges(u, g);
|
||||
e = *p.first;
|
||||
u = source(e, g);
|
||||
v = target(e, g);
|
||||
}
|
||||
void const_constraints(const G& g) {
|
||||
p = out_edges(v, g);
|
||||
p = out_edges(u, g);
|
||||
e = *p.first;
|
||||
u = source(e, g);
|
||||
v = target(e, g);
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>IteratorConstructibleGraph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
# Copyright (c) 2002 Trustees of Indiana University
|
||||
#
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
DVIPS = dvips
|
||||
|
||||
LATEX = latex
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2001
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Monoid</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>MutableGraph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>MutablePropertyGraph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
@@ -97,14 +93,14 @@ the value of the properties can be given.
|
||||
<tr>
|
||||
<TD><TT>add_edge(u, v, ep, g)</TT></TD>
|
||||
<TD>Inserts the edge <i>(u,v)</i> into the graph, and
|
||||
copies object <TT>ep</TT> into the property property for that edge.<br>
|
||||
copies object <TT>ep</TT> into the property for that edge.<br>
|
||||
Return type: <TT>std::pair<edge_descriptor, bool></TT></TD>
|
||||
</TR>
|
||||
|
||||
<tr>
|
||||
<TD><TT>add_vertex(vp, g)</TT></TD>
|
||||
<TD>
|
||||
Add a new vertex to the graph and copy <TT>vp</TT> into the property
|
||||
Add a new vertex to the graph and copy <TT>vp</TT> into the
|
||||
property for the new vertex. The <TT>vertex_descriptor</TT> for the new
|
||||
vertex is returned.<br>
|
||||
Return type: <TT>vertex_descriptor</TT>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>PropertyGraph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Property</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>VertexAndEdgeListGraph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>VertexListGraph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2001
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Vertex Mutable Graph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Acknowledgements</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
<html>
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
|
||||
@@ -9,7 +16,7 @@
|
||||
|
||||
<body bgcolor="#FFFFFF" text="#000000">
|
||||
|
||||
<img src="../../../c++boost.gif" alt="c++boost.gif (8819 bytes)"
|
||||
<img src="../../../boost.png" alt="boost.png (6897 bytes)"
|
||||
align="center" width="277" height="86">
|
||||
|
||||
<h1>Adjacency Iterator Adaptor</h1>
|
||||
@@ -35,7 +42,7 @@ namespace boost {
|
||||
template <class Graph, class VertexDescriptor, class OutEdgeIter>
|
||||
class adjacency_iterator_generator {
|
||||
public:
|
||||
typedef <a href="../../utility/iterator_adaptors.htm#iterator_adaptor">iterator_adaptor</a><...> type;
|
||||
typedef <a href="../../iterator/doc/iterator_adaptor.html">iterator_adaptor</a><...> type;
|
||||
};
|
||||
}
|
||||
</pre>
|
||||
@@ -113,7 +120,7 @@ concept, except that the <tt>reference</tt> type is the same as the <tt>value_ty
|
||||
so <tt>operator*()</tt> returns by-value. In addition it has the following constructor:
|
||||
|
||||
<pre>
|
||||
adjacency_iterator_generator::type(const OutEdgeIter& it)
|
||||
adjacency_iterator_generator::type(const OutEdgeIter& it, const Graph* g)
|
||||
</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Jeremy Siek makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Adjacency List</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
@@ -75,7 +71,7 @@ representation of an undirected graph.
|
||||
<TABLE>
|
||||
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 2:</STRONG> Adjacency List Representation of an Undirected Graph.</CAPTION>
|
||||
<TR><TD><IMG SRC="./figs/undir-adj-matrix-graph2.gif" width="260" height="240"></TD>
|
||||
<TD><IMG SRC="./figs/undir-adj-list2.gif" width="62" height="122"></TD></TR>
|
||||
<TD><IMG SRC="./figs/undir-adj-list.gif" width="62" height="122"></TD></TR>
|
||||
</TABLE>
|
||||
</DIV><P></P>
|
||||
|
||||
@@ -141,7 +137,7 @@ shows how to represent a family tree with a graph.
|
||||
<TR><TD><TT>EdgeList</TT></TD>
|
||||
<TD>The selector for the container used to represent the
|
||||
edge-list for the graph.</TD>
|
||||
<TD><TT>vecS</TT></TD>
|
||||
<TD><TT>listS</TT></TD>
|
||||
</TR>
|
||||
|
||||
</TABLE>
|
||||
@@ -153,15 +149,18 @@ shows how to represent a family tree with a graph.
|
||||
<a href="./VertexAndEdgeListGraph.html">VertexAndEdgeListGraph</a>,
|
||||
<a href="./MutablePropertyGraph.html">MutablePropertyGraph</a>,
|
||||
<a href="../../utility/CopyConstructible.html">CopyConstructible</a>,
|
||||
and <a href="../../utility/Assignable.html">Assignable</a>.
|
||||
<a href="../../utility/Assignable.html">Assignable</a>,
|
||||
and <a href="../../serialization/doc/index.html">Serializable</a>.
|
||||
|
||||
|
||||
<P>
|
||||
|
||||
<H3>Where Defined</H3>
|
||||
|
||||
<P>
|
||||
<a href="../../../boost/graph/adjacency_list.hpp"><TT>boost/graph/adjacency_list.hpp</TT></a>
|
||||
|
||||
<a href="../../../boost/graph/adjacency_list.hpp"><TT>boost/graph/adjacency_list.hpp</TT></a><br><br>
|
||||
Also, the serialization functionality is in
|
||||
<a href="../../../boost/graph/adj_list_serialize.hpp"><tt>boost/graph/adj_list_serialize.hpp</tt></a>.
|
||||
<P>
|
||||
|
||||
<H2>Vertex and Edge Properties</H2>
|
||||
@@ -177,7 +176,10 @@ HREF="./using_adjacency_list.html#sec:adjacency-list-properties">Internal
|
||||
Properties </A>. The property maps are objects that implement the
|
||||
interface defined in Section <A
|
||||
HREF="../../property_map/property_map.html">Property Map
|
||||
Concepts</A>. The property maps obtained from the
|
||||
Concepts</A> or may be <a href="bundles.html">bundled properties</a>,
|
||||
which have a more succinct syntax. The types of all property values
|
||||
must be Copy Constructible, Assignable, and Default Constructible.
|
||||
The property maps obtained from the
|
||||
<TT>adjacency_list</TT> class are models of the <a
|
||||
href="../../property_map/LvaluePropertyMap.html">Lvalue Property
|
||||
Map</a> concept. If the <TT>adjacency_list</TT> is const,
|
||||
@@ -413,6 +415,13 @@ The <tt>adjacency_iterator</tt> models the same iterator concept
|
||||
as <tt>out_edge_iterator</tt>.
|
||||
<hr>
|
||||
|
||||
<tt>adjacency_list::inv_adjacency_iterator</tt>
|
||||
<br><br>
|
||||
The type for the iterators returned by <TT>inv_adjacent_vertices()</TT>.
|
||||
The <tt>inv_adjacency_iterator</tt> models the same iterator concept
|
||||
as <tt>out_edge_iterator</tt>.
|
||||
<hr>
|
||||
|
||||
<tt>graph_traits<adjacency_list>::directed_category</tt><br>
|
||||
and<br>
|
||||
<tt>adjacency_list_traits<OutEdgeList, VertexList, Directed>::directed_category</tt>
|
||||
@@ -473,6 +482,30 @@ The property value type for the graph property specified by the
|
||||
|
||||
<hr>
|
||||
|
||||
<tt>adjacency_list::out_edge_list_selector</tt>
|
||||
<br><br>
|
||||
The type <tt>OutEdgeListS</tt>.
|
||||
|
||||
<hr>
|
||||
|
||||
<tt>adjacency_list::vertex_list_selector</tt>
|
||||
<br><br>
|
||||
The type <tt>VertexListS</tt>.
|
||||
|
||||
<hr>
|
||||
|
||||
<tt>adjacency_list::directed_selector</tt>
|
||||
<br><br>
|
||||
The type <tt>DirectedS</tt>.
|
||||
|
||||
<hr>
|
||||
|
||||
<tt>adjacency_list::edge_list_selector</tt>
|
||||
<br><br>
|
||||
The type <tt>EdgeListS</tt>.
|
||||
|
||||
<hr>
|
||||
|
||||
<H2>Member Functions</H2>
|
||||
|
||||
<hr>
|
||||
@@ -596,7 +629,21 @@ std::pair<adjacency_iterator, adjacency_iterator>
|
||||
adjacent_vertices(vertex_descriptor u, const adjacency_list& g)
|
||||
</pre>
|
||||
Returns an iterator-range providing access to the vertices adjacent to
|
||||
vertex <tt>u</tt> in graph <tt>g</tt>.
|
||||
vertex <tt>u</tt> in graph <tt>g</tt>. For example, if <tt>u -> v</tt>
|
||||
is an edge in the graph, then <tt>v</tt> will be in this iterator-range.
|
||||
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
std::pair<inv_adjacency_iterator, inv_adjacency_iterator>
|
||||
inv_adjacent_vertices(vertex_descriptor u, const adjacency_list& g)
|
||||
</pre>
|
||||
|
||||
Returns an iterator-range providing access to the vertices in graph
|
||||
<tt>g</tt> to which <tt>u</tt> is adjacent. (<tt>inv</tt> is for
|
||||
inverse.) For example, if <tt>v -> u</tt> is an edge in the graph,
|
||||
then <tt>v</tt> will be in this iterator range. This function is only
|
||||
available for bidirectional and undirected <tt>adjacency_list</tt>'s.
|
||||
|
||||
<hr>
|
||||
|
||||
@@ -723,10 +770,8 @@ add_edge(vertex_descriptor u, vertex_descriptor v,
|
||||
Adds edge <i>(u,v)</i> to the graph and returns the edge descriptor
|
||||
for the new edge. For graphs that do not allow parallel edges, if the
|
||||
edge is already in the graph then a duplicate will not be added and
|
||||
the <TT>bool</TT> flag will be <TT>false</TT>. Also, if <i>u</i> and
|
||||
<i>v</i> are descriptors for the same vertex (creating a self loop)
|
||||
and the graph is undirected, then the edge will not be added and the
|
||||
flag will be <TT>false</TT>. When the flag is <TT>false</TT>, the
|
||||
the <TT>bool</TT> flag will be <TT>false</TT>. When the flag is
|
||||
<TT>false</TT>, the
|
||||
returned edge descriptor points to the already existing edge.
|
||||
|
||||
<p>
|
||||
@@ -1007,9 +1052,35 @@ attached to the graph object <tt>g</tt>. The <tt>graph_property</tt>
|
||||
traits class is defined in <a
|
||||
href="../../../boost/graph/adjacency_list.hpp"><tt>boost/graph/adjacency_list.hpp</tt></a>.
|
||||
|
||||
<!-- add the shortcut property functions -->
|
||||
|
||||
<hr>
|
||||
|
||||
<!-- add the shortcut property functions -->
|
||||
|
||||
|
||||
<h4><a name="serialization">Serialization</a></h4>
|
||||
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
template<class <a href="../../serialization/doc/archives.html#saving_interface">SavingArchive</a>>
|
||||
SavingArchive& operator<<(SavingArchive& ar, const adjacency_list& graph);
|
||||
</pre>
|
||||
Serializes the graph into the archive. Requires the vertex and edge properties of the
|
||||
graph to be <a href="../../serialization/doc/index.html">Serializable</a>.
|
||||
<br>
|
||||
Include <a href="../../../boost/graph/adj_list_serialize.hpp"><tt>boost/graph/adj_list_serialize.hpp</tt></a>.
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
template<class <a href="../../serialization/doc/archives.html#loading_interface">LoadingArchive</a>>
|
||||
LoadingArchive& operator>>(LoadingArchive& ar, const adjacency_list& graph);
|
||||
</pre>
|
||||
Reads the graph from the archive. Requires the vertex and edge properties of the
|
||||
graph to be <a href="../../serialization/doc/index.html">Serializable</a>.
|
||||
<br>
|
||||
Include <a href="../../../boost/graph/adj_list_serialize.hpp"><tt>boost/graph/adj_list_serialize.hpp</tt></a>.
|
||||
<hr>
|
||||
|
||||
|
||||
<h3>See Also</h3>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Graph Traits</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Jeremy Siek makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Adjacency Matrix</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
@@ -40,7 +36,7 @@ representation of a graph.
|
||||
<TABLE>
|
||||
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 1:</STRONG> Adjacency Matrix Representation of a Directed Graph.</CAPTION>
|
||||
<TR><TD><IMG SRC="./figs/adj-matrix-graph3.gif" width="386" height="284"></TD>
|
||||
<TD><IMG SRC="./figs/adj-matrix2.gif" width="135" height="136"></TD></TR>
|
||||
<TD><IMG SRC="./figs/adj-matrix.gif" width="135" height="136"></TD></TR>
|
||||
</TABLE>
|
||||
</DIV><P></P>
|
||||
|
||||
@@ -59,8 +55,13 @@ graphs (where <i>E</i> is much smaller than <i>V<sup>2</sup></i>).
|
||||
|
||||
The <tt>adjacency_matrix</tt> class extends the traditional
|
||||
data-structure by allowing objects to be attached to vertices and
|
||||
edges via the the property template parameters. See Section XXX for an
|
||||
explanation of how to use internal properties.
|
||||
edges using the same property template parameters supported by <a
|
||||
href="adjacency_list.html"><tt>adjacency_list</tt></a>. These may be
|
||||
<a href="bundles.html">bundled properties</a> or standard (backward-compatible)
|
||||
<a
|
||||
href="using_adjacency_list.html#sec:adjacency-list-properties">interior
|
||||
properties</a>. The types of all property values must be
|
||||
Copy Constructible, Assignable and Default Constructible.
|
||||
|
||||
In the case of an undirected graph, the
|
||||
<tt>adjacency_matrix</tt>. class does not use a full <i>V x V</i>
|
||||
@@ -204,7 +205,10 @@ The output is:
|
||||
|
||||
<h3>Model Of</h3>
|
||||
|
||||
<a href="./VertexAndEdgeListGraph.html">VertexAndEdgeListGraph</a>, <a
|
||||
<a href="./VertexAndEdgeListGraph.html">VertexAndEdgeListGraph</a>,
|
||||
<a href="./IncidenceGraph.html">Incidence Graph</a>,
|
||||
<a href="./BidirectionalGraph.html">Bidirectional Graph</a>,
|
||||
<a
|
||||
href="./AdjacencyMatrix.html">AdjacencyMatrix</a>, <a
|
||||
href="./MutablePropertyGraph.html">MutablePropertyGraph</a>,
|
||||
<a href="../../utility/CopyConstructible.html">CopyConstructible</a>,
|
||||
@@ -250,6 +254,13 @@ The type for the edge descriptors associated with the
|
||||
iterator models <a href="../../utility/MultiPassInputIterator.html">MultiPassInputIterator</a>. <br>
|
||||
(Required by <a href="IncidenceGraph.html">IncidenceGraph</a>.)
|
||||
|
||||
<hr>
|
||||
<tt>graph_traits<adjacency_matrix>::in_edge_iterator</tt>
|
||||
<br><br>
|
||||
The type for the iterators returned by <tt>in_edges()</tt>. This
|
||||
iterator models <a href="../../utility/MultiPassInputIterator.html">MultiPassInputIterator</a>. <br>
|
||||
(Required by <a href="BidirectionalGraph.html">BidirectionalGraph</a>.)
|
||||
|
||||
<hr>
|
||||
<tt>graph_traits<adjacency_matrix>::adjacency_iterator</tt>
|
||||
<br><br>
|
||||
@@ -356,15 +367,15 @@ adjacency_matrix(EdgeIterator first, EdgeIterator last,
|
||||
std::pair<vertex_iterator, vertex_iterator>
|
||||
vertices(const adjacency_matrix& g)
|
||||
</pre>
|
||||
Returns an iterator-range providing access to the vertex set of graph <tt>g</i>.<br>
|
||||
Returns an iterator-range providing access to the vertex set of graph <tt>g</tt>.<br>
|
||||
(Required by <a href="VertexListGraph.html">VertexListGraph</a>.)
|
||||
|
||||
<hr>
|
||||
<pre>
|
||||
std::pair<edge_iterator, edge_iterator>
|
||||
edges(const adjacency_matrix& g)
|
||||
edges(const adjacency_matrix& g);
|
||||
</pre>
|
||||
Returns an iterator-range providing access to the edge set of graph <tt>g</i>.<br>
|
||||
Returns an iterator-range providing access to the edge set of graph <tt>g</tt>.<br>
|
||||
(Required by <a href="EdgeListGraph.html">EdgeListGraph</a>.)
|
||||
|
||||
<hr>
|
||||
@@ -373,7 +384,7 @@ std::pair<adjacency_iterator, adjacency_iterator>
|
||||
adjacent_vertices(vertex_descriptor v, const adjacency_matrix& g)
|
||||
</pre>
|
||||
Returns an iterator-range providing access to the vertices adjacent to
|
||||
vertex <tt>v</i> in graph <tt>g</i>.<br>
|
||||
vertex <tt>v</tt> in graph <tt>g</tt>.<br>
|
||||
(Required by <a href="AdjacencyGraph.html">AdjacencyGraph</a>.)
|
||||
|
||||
<hr>
|
||||
@@ -382,9 +393,9 @@ std::pair<out_edge_iterator, out_edge_iterator>
|
||||
out_edges(vertex_descriptor v, const adjacency_matrix& g)
|
||||
</pre>
|
||||
Returns an iterator-range providing access to the out-edges of
|
||||
vertex <tt>v</i> in graph <tt>g</i>. If the graph is undirected,
|
||||
this iterator-range provides access to all edge incident on
|
||||
vertex <tt>v</i>. <br>
|
||||
vertex <tt>v</tt> in graph <tt>g</tt>. If the graph is undirected,
|
||||
this iterator-range provides access to all edges incident on
|
||||
vertex <tt>v</tt>. <br>
|
||||
(Required by <a href="IncidenceGraph.html">IncidenceGraph</a>.)
|
||||
|
||||
<hr>
|
||||
@@ -392,7 +403,7 @@ vertex <tt>v</i>. <br>
|
||||
vertex_descriptor
|
||||
source(edge_descriptor e, const adjacency_matrix& g)
|
||||
</pre>
|
||||
Returns the source vertex of edge <tt>e</i>.<br>
|
||||
Returns the source vertex of edge <tt>e</tt>.<br>
|
||||
(Required by <a href="IncidenceGraph.html">IncidenceGraph</a>.)
|
||||
|
||||
<hr>
|
||||
@@ -400,7 +411,7 @@ Returns the source vertex of edge <tt>e</i>.<br>
|
||||
vertex_descriptor
|
||||
target(edge_descriptor e, const adjacency_matrix& g)
|
||||
</pre>
|
||||
Returns the target vertex of edge <tt>e</i>.<br>
|
||||
Returns the target vertex of edge <tt>e</tt>.<br>
|
||||
(Required by <a href="IncidenceGraph.html">IncidenceGraph</a>.)
|
||||
|
||||
<hr>
|
||||
@@ -408,15 +419,35 @@ Returns the target vertex of edge <tt>e</i>.<br>
|
||||
degree_size_type
|
||||
out_degree(vertex_descriptor u, const adjacency_matrix& g)
|
||||
</pre>
|
||||
Returns the number of edges leaving vertex <tt>u</i>.<br>
|
||||
Returns the number of edges leaving vertex <tt>u</tt>.<br>
|
||||
(Required by <a href="IncidenceGraph.html">IncidenceGraph</a>.)
|
||||
<hr>
|
||||
|
||||
<hr>
|
||||
<pre>
|
||||
std::pair<in_edge_iterator, in_edge_iterator>
|
||||
in_edges(vertex_descriptor v, const adjacency_matrix& g)
|
||||
</pre>
|
||||
Returns an iterator-range providing access to the in-edges of
|
||||
vertex <tt>v</tt> in graph <tt>g</tt>. If the graph is undirected,
|
||||
this iterator-range provides access to all edges incident on
|
||||
vertex <tt>v</tt>. <br>
|
||||
(Required by <a href="BidirectionalGraph.html">BidirectionalGraph</a>.)
|
||||
|
||||
<hr>
|
||||
<pre>
|
||||
degree_size_type
|
||||
in_degree(vertex_descriptor u, const adjacency_matrix& g)
|
||||
</pre>
|
||||
Returns the number of edges entering vertex <tt>u</tt>.<br>
|
||||
(Required by <a href="BidirectionalGraph.html">BidirectionalGraph</a>.)
|
||||
<hr>
|
||||
|
||||
<hr>
|
||||
<pre>
|
||||
vertices_size_type num_vertices(const adjacency_matrix& g)
|
||||
</pre>
|
||||
Returns the number of vertices in the graph <tt>g</i>.<br>
|
||||
Returns the number of vertices in the graph <tt>g</tt>.<br>
|
||||
(Required by <a href="VertexListGraph.html">VertexListGraph</a>.)
|
||||
|
||||
<hr>
|
||||
@@ -438,7 +469,7 @@ std::pair<edge_descriptor, bool>
|
||||
edge(vertex_descriptor u, vertex_descriptor v,
|
||||
const adjacency_matrix& g)
|
||||
</pre>
|
||||
Returns the edge connecting vertex <tt>u</i> to vertex <tt>v</i> in graph <tt>g</i>.<br>
|
||||
Returns the edge connecting vertex <tt>u</tt> to vertex <tt>v</tt> in graph <tt>g</tt>.<br>
|
||||
(Required by <a href="AdjacencyMatrix.html">AdjacencyMatrix</a>.)
|
||||
|
||||
<hr>
|
||||
@@ -447,7 +478,7 @@ std::pair<edge_descriptor, bool>
|
||||
add_edge(vertex_descriptor u, vertex_descriptor v,
|
||||
adjacency_matrix& g)
|
||||
</pre>
|
||||
Adds edge <tt>(u,v)</i> to the graph and returns the edge descriptor for
|
||||
Adds edge <tt>(u,v)</tt> to the graph and returns the edge descriptor for
|
||||
the new edge. If the edge is already in the graph then a duplicate
|
||||
will not be added and the <tt>bool</tt> flag will be <tt>false</tt>.
|
||||
This operation does not invalidate any of the graph's iterators
|
||||
@@ -461,7 +492,7 @@ add_edge(vertex_descriptor u, vertex_descriptor v,
|
||||
const EdgeProperty& p,
|
||||
adjacency_matrix& g)
|
||||
</pre>
|
||||
Adds edge <tt>(u,v)</i> to the graph and attaches <tt>p</tt> as the
|
||||
Adds edge <tt>(u,v)</tt> to the graph and attaches <tt>p</tt> as the
|
||||
value of the edge's internal property storage. Also see the previous
|
||||
<tt>add_edge()</tt> member function for more details.
|
||||
|
||||
@@ -470,7 +501,7 @@ value of the edge's internal property storage. Also see the previous
|
||||
void remove_edge(vertex_descriptor u, vertex_descriptor v,
|
||||
adjacency_matrix& g)
|
||||
</pre>
|
||||
Removes the edge <tt>(u,v)</i> from the graph. <br>
|
||||
Removes the edge <tt>(u,v)</tt> from the graph. <br>
|
||||
(Required by <a href="MutableGraph.html">MutableGraph</a>.)
|
||||
|
||||
<hr>
|
||||
@@ -485,7 +516,7 @@ to calling <tt>remove_edge(source(e, g), target(e, g), g)</tt>.<br>
|
||||
<pre>
|
||||
void clear_vertex(vertex_descriptor u, adjacency_matrix& g)
|
||||
</pre>
|
||||
Removes all edges to and from vertex <tt>u</i>. The vertex still appears
|
||||
Removes all edges to and from vertex <tt>u</tt>. The vertex still appears
|
||||
in the vertex set of the graph.<br>
|
||||
(Required by <a href="MutableGraph.html">MutableGraph</a>.)
|
||||
|
||||
@@ -509,7 +540,7 @@ argument.<br>
|
||||
<pre>
|
||||
template <typename Property, typename X>
|
||||
typename property_traits<
|
||||
typenamae property_map<adjacency_matrix, Property>::const_type
|
||||
typename property_map<adjacency_matrix, Property>::const_type
|
||||
>::value_type
|
||||
get(Property, const adjacency_matrix& g, X x)
|
||||
</pre>
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- Copyright (c) 2004 Kris Beevers
|
||||
--
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: astar_heuristic</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1>
|
||||
<pre>
|
||||
astar_heuristic<Graph, CostType>
|
||||
</pre>
|
||||
</H1>
|
||||
|
||||
This class is a default implementation of the <a
|
||||
href="./AStarHeuristic.html">AStarHeuristic</a> concept. It
|
||||
implements a "zero" heuristic -- a heuristic function that returns a
|
||||
cost of zero regardless of the vertex it is passed.
|
||||
|
||||
<h3>Model of</h3>
|
||||
|
||||
<a href="./AStarHeuristic.html">AStarHeuristic</a>
|
||||
|
||||
<H3>Template Parameters</H3>
|
||||
|
||||
<P>
|
||||
<TABLE border>
|
||||
<TR>
|
||||
<th>Parameter</th><th>Description</th><th>Default</th>
|
||||
</tr>
|
||||
|
||||
<TR><TD><TT>Graph</TT></TD>
|
||||
<TD>
|
||||
The type of the graph being searched.
|
||||
</TD>
|
||||
<TD></TD>
|
||||
</TR>
|
||||
|
||||
<TR><TD><TT>CostType</TT></TD>
|
||||
<TD>
|
||||
A type that can be used with the <tt>compare</tt> and
|
||||
<tt>combine</tt> functions passed to A*. Typically an integer or
|
||||
floating point type.
|
||||
</TD>
|
||||
<TD></TD>
|
||||
</TR>
|
||||
|
||||
</table>
|
||||
|
||||
<H3>Where Defined</H3>
|
||||
|
||||
<P>
|
||||
<a href="../../../boost/graph/astar_search.hpp">
|
||||
<TT>boost/graph/astar_search.hpp</TT></a>
|
||||
|
||||
<h3>Member Functions</h3>
|
||||
|
||||
This class implements the single member function required by <a
|
||||
href="./AStarHeuristic.html">AStarHeuristic</a>:
|
||||
|
||||
<table border>
|
||||
<tr>
|
||||
<th>Function</th><th>Description</th>
|
||||
</tr>
|
||||
|
||||
<tr><td><tt>
|
||||
CostType operator()(graph_traits<Graph>::vertex_descriptor u);
|
||||
</tt></td><td>
|
||||
Called for the target of every out edge of a vertex being examined.
|
||||
Returns the cost, estimated by the heuristic, from vertex <tt>u</tt>
|
||||
to a goal.
|
||||
</td></tr>
|
||||
|
||||
</table>
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2004</TD><TD>
|
||||
<A HREF="http://www.cs.rpi.edu/~beevek/">Kristopher Beevers</A>,
|
||||
Rensselaer Polytechnic Institute (<A
|
||||
HREF="mailto:beevek@cs.rpi.edu">beevek@cs.rpi.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -0,0 +1,477 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- Copyright (c) 2004 Kris Beevers
|
||||
--
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: A* Heuristic Search</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1><A NAME="sec:astar"></A>
|
||||
<TT>astar_search</TT>
|
||||
</H1>
|
||||
|
||||
|
||||
<P>
|
||||
<PRE>
|
||||
<i>// Named parameter interface</i>
|
||||
template <typename VertexListGraph,
|
||||
typename AStarHeuristic,
|
||||
typename P, typename T, typename R>
|
||||
void
|
||||
astar_search
|
||||
(VertexListGraph &g,
|
||||
typename graph_traits<VertexListGraph>::vertex_descriptor s,
|
||||
<a href="AStarHeuristic.html">AStarHeuristic</a> h, const bgl_named_params<P, T, R>& params);
|
||||
|
||||
<i>// Non-named parameter interface</i>
|
||||
template <typename VertexListGraph, typename AStarHeuristic,
|
||||
typename <a href="AStarVisitor.html">AStarVisitor</a>, typename PredecessorMap,
|
||||
typename CostMap, typename DistanceMap,
|
||||
typename WeightMap, typename VertexIndexMap,
|
||||
typename ColorMap,
|
||||
typename <a href="http://www.sgi.com/tech/stl/BinaryPredicate.html">CompareFunction</a>, typename <a href="http://www.sgi.com/tech/stl/BinaryFunction.html">CombineFunction</a>,
|
||||
typename CostInf, typename CostZero>
|
||||
inline void
|
||||
astar_search
|
||||
(VertexListGraph &g,
|
||||
typename graph_traits<VertexListGraph>::vertex_descriptor s,
|
||||
AStarHeuristic h, AStarVisitor vis,
|
||||
PredecessorMap predecessor, CostMap cost,
|
||||
DistanceMap distance, WeightMap weight,
|
||||
VertexIndexMap index_map, ColorMap color,
|
||||
CompareFunction compare, CombineFunction combine,
|
||||
CostInf inf, CostZero zero);
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
This algorithm implements a heuristic search on a weighted, directed
|
||||
or undirected graph for the case where all edge weights are
|
||||
non-negative.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
The A* algorithm is a <i>heuristic graph search algorithm</i>: an A*
|
||||
search is "guided" by a <i>heuristic function</i>. A heuristic
|
||||
function <i>h(v)</i> is one which estimates the cost from a non-goal
|
||||
state (<i>v</i>) in the graph to some goal state, <i>g</i>.
|
||||
Intuitively, A* follows paths (through the graph) to the goal that are
|
||||
estimated by the heuristic function to be the best paths. Unlike
|
||||
best-first search, A* takes into account the known cost from the start
|
||||
of the search to <i>v</i>; the paths A* takes are guided by a function
|
||||
<i>f(v) = g(v) + h(v)</i>, where <i>h(v)</i> is the heuristic
|
||||
function, and <i>g(v)</i> (sometimes denoted <i>c(s, v)</i>) is the
|
||||
known cost from the start to <i>v</i>. Clearly, the efficiency of A*
|
||||
is highly dependent on the heuristic function with which it is used.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
The A* algorithm is very similar to Dijkstra's Shortest Paths
|
||||
algorithm. This implementation finds all the shortest paths from the
|
||||
start vertex to every other vertex by creating a search tree,
|
||||
examining vertices according to their remaining cost to some goal, as
|
||||
estimated by a heuristic function. Most commonly, A* is used to find
|
||||
some specific goal vertex or vertices in a graph, after which the
|
||||
search is terminated.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
A* is particularly useful for searching <i>implicit</i> graphs.
|
||||
Implicit graphs are graphs that are not completely known at the
|
||||
beginning of the search. Upon visiting a vertex, its neighbors are
|
||||
"generated" and added to the search. Implicit graphs are particularly
|
||||
useful for searching large state spaces -- in gameplaying scenarios
|
||||
(e.g. chess), for example -- in which it may not be possible to store
|
||||
the entire graph. Implicit searches can be performed with this
|
||||
implementation of A* by creating special visitors that generate
|
||||
neighbors of newly-expanded vertices.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
This implementation of A* is based on an OPEN/CLOSED list formulation
|
||||
of the algorithm. Vertices on the OPEN list have been ``discovered''
|
||||
by the algorithm, but not ``expanded'' (we have not discovered their
|
||||
adjacent vertices). Vertices on the CLOSED list have been completely
|
||||
examined by our search (we have expanded them and added their children
|
||||
to the OPEN list). Vertices that are on neither list have not been
|
||||
encountered in any context so far in our search. A major advantage of
|
||||
this formulation of the A* algorithm over other approaches is that it
|
||||
avoids ``cycles'' in the state space; the search will not become
|
||||
trapped by loops in the graph. The OPEN/CLOSED lists are implemented
|
||||
using BGL's vertex coloring mechanisms. Vertices in OPEN are colored
|
||||
gray, vertices in CLOSED are colored black, and undiscovered vertices
|
||||
are colored white.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
The criteria for expanding a vertex on the OPEN list is that it has
|
||||
the lowest <i>f(v) = g(v) + h(v)</i> value of all vertices on OPEN.
|
||||
Cost information about vertices is stored in a property map.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
The following is the pseudocode for the A* heuristic search algorithm.
|
||||
In the pseudocode, <i>h</i> is the heuristic function, <i>w</i> is the
|
||||
edge weight, <i>d</i> is the distance of a vertex from <i>s</i>, and
|
||||
<i>Q</i> is a priority queue, sorted by <i>f</i>, the estimated cost
|
||||
to the goal of the path through a vertex. <i>p</i> is a predecessor
|
||||
map. The visitor event points for the algorithm are indicated by the
|
||||
labels on the right.
|
||||
</P>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<pre>
|
||||
A*(<i>G</i>, <i>s</i>, <i>h</i>)
|
||||
<b>for</b> each vertex <i>u in V</i>
|
||||
<i>d[u] := f[u] := infinity</i>
|
||||
<i>color[u] :=</i> WHITE
|
||||
<i>p[u] := u</i>
|
||||
<b>end for</b>
|
||||
<i>color[s] :=</i> GRAY
|
||||
<i>d[s] := 0</i>
|
||||
<i>f[s] := h(s)</i>
|
||||
INSERT(<i>Q, s</i>)
|
||||
<b>while</b> (<i>Q != Ø</i>)
|
||||
<i>u :=</i> EXTRACT-MIN(<i>Q</i>)
|
||||
<b>for</b> each vertex <i>v in Adj[u]</i>
|
||||
<b>if</b> (<i>w(u,v) + d[u] < d[v]</i>)
|
||||
<i>d[v] := w(u,v) + d[u]</i>
|
||||
<i>f[v] := d[v] + h(v)</i>
|
||||
<i>p[v] := u</i>
|
||||
<b>if</b> (<i>color[v] =</i> WHITE)
|
||||
<i>color[v] :=</i> GRAY
|
||||
INSERT(<i>Q, v</i>)
|
||||
<b>else if</b> (<i>color[v] =</i> BLACK)
|
||||
<i>color[v] :=</i> GRAY
|
||||
INSERT(<i>Q, v</i>)
|
||||
<b>end if</b>
|
||||
<b>else</b>
|
||||
<i>...</i>
|
||||
<b>end for</b>
|
||||
<i>color[u] :=</i> BLACK
|
||||
<b>end while</b>
|
||||
</pre>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<pre>
|
||||
|
||||
initialize vertex <i>u</i>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
discover vertex <i>s</i>
|
||||
|
||||
examine vertex <i>u</i>
|
||||
examine edge <i>(u,v)</i>
|
||||
|
||||
edge <i>(u,v)</i> relaxed
|
||||
|
||||
|
||||
|
||||
|
||||
discover vertex <i>v</i>
|
||||
|
||||
|
||||
reopen vertex <i>v</i>
|
||||
|
||||
|
||||
edge <i>(u,v)</i> not relaxed
|
||||
|
||||
finish vertex <i>u</i>
|
||||
</pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>Where Defined</h3>
|
||||
|
||||
<a href="../../../boost/graph/astar_search.hpp"><tt>boost/graph/astar_search.hpp</tt></a>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
|
||||
IN: <tt>VertexListGraph& g</tt>
|
||||
<blockquote>
|
||||
The graph object on which the algorithm will be applied. The type
|
||||
<tt>VertexListGraph</tt> must be a model of the <a
|
||||
href="VertexListGraph.html">
|
||||
Vertex List Graph</a> concept.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_descriptor s</tt>
|
||||
<blockquote>
|
||||
The start vertex for the search. All distances will be calculated
|
||||
from this vertex, and the shortest paths tree (recorded in the
|
||||
predecessor map) will be rooted at this vertex.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>AStarHeuristic h</tt>
|
||||
<blockquote>
|
||||
The heuristic function that guides the search. The type
|
||||
<tt>AStarHeuristic</tt> must be a model of the <a href="AStarHeuristic.html">AStarHeuristic</a>
|
||||
concept.
|
||||
</blockquote>
|
||||
|
||||
<h3>Named Parameters</h3>
|
||||
|
||||
IN: <tt>weight_map(WeightMap w_map)</tt>
|
||||
<blockquote>
|
||||
The weight or ``length'' of each edge in the graph. The weights
|
||||
must all be non-negative; the algorithm will throw a <a
|
||||
href="./exception.html#negative_edge"><tt>negative_edge</tt></a>
|
||||
exception if one of the edges is negative. The type
|
||||
<tt>WeightMap</tt> must be a model of <a
|
||||
href="../../property_map/ReadablePropertyMap.html"><tt>Readable
|
||||
Property Map</tt></a>. The edge descriptor type of the graph needs
|
||||
to be usable as the key type for the weight map. The value type
|
||||
for this map must be the same as the value type of the distance
|
||||
map.<br>
|
||||
<b>Default:</b> <tt>get(edge\_weight, g)</tt>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
<blockquote>
|
||||
This maps each vertex to an integer in the range <tt>[0,
|
||||
num_vertices(g))</tt>. This is necessary for efficient updates of
|
||||
the heap data structure when an edge is relaxed. The type
|
||||
<tt>VertexIndexMap</tt> must be a model of <a
|
||||
href="../../property_map/ReadablePropertyMap.html"><tt>Readable
|
||||
Property Map</tt></a>. The value type of the map must be an integer
|
||||
type. The vertex descriptor type of the graph needs to be usable as
|
||||
the key type of the map.<br>
|
||||
|
||||
<b>Default:</b> <tt>get(vertex_index, g)</tt>.
|
||||
Note: if you use this default, make sure your graph has
|
||||
an internal <tt>vertex_index</tt> property. For example,
|
||||
<tt>adjacenty_list</tt> with <tt>VertexList=listS</tt> does
|
||||
not have an internal <tt>vertex_index</tt> property.
|
||||
</blockquote>
|
||||
|
||||
OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
|
||||
<blockquote>
|
||||
|
||||
The predecessor map records the edges in the minimum spanning tree.
|
||||
Upon completion of the algorithm, the edges <tt>(p[u],u)</tt> for
|
||||
all <tt>u</tt> in <tt>V</tt> are in the minimum spanning tree. If
|
||||
<tt>p[u] = u</tt> then <tt>u</tt> is either the start vertex or a
|
||||
vertex that is not reachable from the start. The
|
||||
<tt>PredecessorMap</tt> type must be a <a
|
||||
href="../../property_map/ReadWritePropertyMap.html"><tt>Read/Write
|
||||
Property Map</tt></a> with key and vertex types the same as the
|
||||
vertex descriptor type of the graph.<br>
|
||||
|
||||
<b>Default:</b> <tt>dummy_property_map</tt>
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>distance_map(DistanceMap d_map)</tt>
|
||||
<blockquote>
|
||||
|
||||
The shortest path weight from the start vertex <tt>s</tt> to each
|
||||
vertex in the graph <tt>g</tt> is recorded in this property map.
|
||||
The shortest path weight is the sum of the edge weights along the
|
||||
shortest path. The type <tt>DistanceMap</tt> must be a model of <a
|
||||
href="../../property_map/ReadWritePropertyMap.html"><tt>Read/Write
|
||||
Property Map</tt></a>. The vertex descriptor type of the graph
|
||||
needs to be usable as the key type of the distance map. The value
|
||||
type of the distance map is the element type of a <a
|
||||
href="./Monoid.html"><tt>Monoid</tt></a> formed with the
|
||||
<tt>combine</tt> function object and the zero object for the
|
||||
identity element. Also the distance value type must have a <a
|
||||
href="http://www.sgi.com/tech/stl/StrictWeakOrdering.html"><tt>StrictWeakOrdering</tt></a>
|
||||
provided by the <tt>compare</tt> function object.<br>
|
||||
|
||||
<b>Default:</b> <tt>iterator_property_map</tt> created from a
|
||||
<tt>std::vector</tt> with the same value type as the
|
||||
<tt>WeightMap</tt>, and of size <tt>num_vertices(g)</tt>, and using
|
||||
the <tt>i_map</tt> for the index map.
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>rank_map(CostMap c_map)</tt>
|
||||
<blockquote>
|
||||
|
||||
The <i>f</i>-value for each vertex. The <i>f</i>-value is defined
|
||||
as the sum of the cost to get to a vertex from the start vertex, and
|
||||
the estimated cost (as returned by the heuristic function
|
||||
<tt>h</tt>) from the vertex to a goal. The type <tt>CostMap</tt>
|
||||
must be a model of <a
|
||||
href="../../property_map/ReadWritePropertyMap.html"><tt>Read/Write
|
||||
Property Map</tt></a>. The vertex descriptor type of the graph
|
||||
needs to be usable as the key type of the distance map. The value
|
||||
type of the distance map is the element type of a <a
|
||||
href="./Monoid.html"><tt>Monoid</tt></a> formed with the
|
||||
<tt>combine</tt> function object and the zero object for the
|
||||
identity element. Also the distance value type must have a <a
|
||||
href="http://www.sgi.com/tech/stl/StrictWeakOrdering.html"><tt>StrictWeakOrdering</tt></a>
|
||||
provided by the <tt>compare</tt> function object. The value type
|
||||
for this map must be the same as the value type for the distance
|
||||
map.<br>
|
||||
|
||||
<b>Default:</b> <tt>iterator_property_map</tt> created from a
|
||||
<tt>std::vector</tt> with the same value type as the
|
||||
<tt>WeightMap</tt>, and of size <tt>num_vertices(g)</tt>, and using
|
||||
the <tt>i_map</tt> for the index map.
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>color_map(ColorMap c_map)</tt>
|
||||
<blockquote>
|
||||
|
||||
This is used during the execution of the algorithm to mark the
|
||||
vertices, indicating whether they are on the OPEN or CLOSED lists.
|
||||
The vertices start out white and become gray when they are inserted
|
||||
into the OPEN list. They then turn black when they are examined and
|
||||
placed on the CLOSED list. At the end of the algorithm, vertices
|
||||
reachable from the source vertex will have been colored black. All
|
||||
other vertices will still be white. The type <tt>ColorMap</tt> must
|
||||
be a model of <a
|
||||
href="../../property_map/ReadWritePropertyMap.html"><tt>Read/Write
|
||||
Property Map</tt></a>. A vertex descriptor must be usable as the
|
||||
key type of the map, and the value type of the map must be a model
|
||||
of <a href="./ColorValue.html"><tt>Color Value</tt></a>.<br>
|
||||
|
||||
<b>Default:</b> <tt>iterator_property_map</tt> created from a
|
||||
<tt>std::vector</tt> of value type <tt>default_color_type</tt>, with
|
||||
size <tt>num_vertices(g)</tt>, and using the <tt>i_map</tt> for the
|
||||
index map.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_compare(CompareFunction cmp)</tt>
|
||||
<blockquote>
|
||||
|
||||
This function is use to compare distances to determine which vertex
|
||||
is closer to the start vertex, and to compare <i>f</i>-values to
|
||||
determine which vertex on the OPEN list to examine next. The
|
||||
<tt>CompareFunction</tt> type must be a model of <a
|
||||
href="http://www.sgi.com/tech/stl/BinaryPredicate.html"><tt>Binary
|
||||
Predicate</tt></a> and have argument types that match the value type
|
||||
of the <tt>DistanceMap</tt> property map.<br>
|
||||
|
||||
<b>Default:</b> <tt>std::less<D></tt> with <tt>D = typename
|
||||
property_traits<DistanceMap>::value_type</tt>.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_combine(CombineFunction cmb)</tt>
|
||||
<blockquote>
|
||||
|
||||
This function is used to combine distances to compute the distance
|
||||
of a path, and to combine distance and heuristic values to compute
|
||||
the <i>f</i>-value of a vertex. The <tt>CombineFunction</tt> type
|
||||
must be a model of <a
|
||||
href="http://www.sgi.com/tech/stl/BinaryFunction.html"><tt>Binary
|
||||
Function</tt></a>. Both argument types of the binary function must
|
||||
match the value type of the <tt>DistanceMap</tt> property map (which
|
||||
is the same as that of the <tt>WeightMap</tt> and <tt>CostMap</tt>
|
||||
property maps). The result type must be the same type as the
|
||||
distance value type.<br>
|
||||
|
||||
<b>Default:</b> <tt>std::plus<D></tt> with <tt>D = typename
|
||||
property_traits<DistanceMap>::value_type</tt>.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_inf(D inf)</tt>
|
||||
<blockquote>
|
||||
|
||||
The <tt>inf</tt> object must be the greatest value of any <tt>D</tt>
|
||||
object. That is, <tt>compare(d, inf) == true</tt> for any <tt>d !=
|
||||
inf</tt>. The type <tt>D</tt> is the value type of the
|
||||
<tt>DistanceMap</tt>.<br>
|
||||
|
||||
<b>Default:</b> <tt>std::numeric_limits<D>::max()</tt>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_zero(D zero)</tt>
|
||||
<blockquote>
|
||||
|
||||
The <tt>zero</tt> value must be the identity element for the <a
|
||||
href="./Monoid.html"><tt>Monoid</tt></a> formed by the distance
|
||||
values and the <tt>combine</tt> function object. The type
|
||||
<tt>D</tt> is the value type of the <tt>DistanceMap</tt>.<br>
|
||||
|
||||
<b>Default</b>: <tt>D()</tt> with <tt>D = typename
|
||||
property_traits<DistanceMap>::value_type</tt>.
|
||||
</blockquote>
|
||||
|
||||
OUT: <tt>visitor(AStarVisitor v)</tt>
|
||||
<blockquote>
|
||||
|
||||
Use this to specify actions that you would like to happen during
|
||||
certain event points within the algorithm. The type
|
||||
<tt>AStarVisitor</tt> must be a model of the <a
|
||||
href="AStarVisitor.html"><tt>AStarVisitor</tt></a> concept. The
|
||||
visitor object is passed by value <a href="#1">[1]</a>.<br>
|
||||
|
||||
<b>Default:</b> <tt>astar_visitor<null_visitor></tt>
|
||||
</blockquote>
|
||||
|
||||
<H3>Complexity</H3>
|
||||
|
||||
<P>
|
||||
The time complexity is <i>O((E + V) log V)</i>.
|
||||
|
||||
<h3>Visitor Event Points</h3>
|
||||
|
||||
<ul>
|
||||
<li><b><tt>vis.initialize_vertex(u, g)</tt></b>
|
||||
is invoked on each vertex in the graph before the start of the
|
||||
algorithm.
|
||||
<li><b><tt>vis.discover_vertex(v, g)</tt></b>
|
||||
is invoked when a vertex is first discovered and is added to the
|
||||
OPEN list.
|
||||
<li><b><tt>vis.examine_vertex(u, g)</tt></b>
|
||||
is invoked when a vertex is popped from
|
||||
the queue (i.e., it has the lowest cost on the OPEN list).
|
||||
<li><b><tt>vis.examine_edge(e, g)</tt></b>
|
||||
is invoked on each out-edge of a vertex immediately after it is
|
||||
examined.
|
||||
<li><b><tt>vis.edge_relaxed(e, g)</tt></b>
|
||||
is invoked on edge <i>(u,v)</i> if <i>d[u] + w(u,v) < d[v]</i>.
|
||||
<li><b><tt>vis.edge_not_relaxed(e, g)</tt></b>
|
||||
is invoked if the edge is not relaxed (see above).
|
||||
<li><b><tt>vis.black_target(u, g)</tt></b>
|
||||
is invoked when a vertex that is on the CLOSED list is
|
||||
"rediscovered" via a more efficient path, and is re-added to the
|
||||
OPEN list.
|
||||
<li><b><tt>vis.finish_vertex(u, g)</tt></b>
|
||||
is invoked on a vertex when it is added to the CLOSED list, which
|
||||
happens after all of its out edges have been examined.
|
||||
</ul>
|
||||
|
||||
<H3>Example</H3>
|
||||
|
||||
<P>
|
||||
See <a href="../example/astar-cities.cpp">
|
||||
<TT>example/astar-cities.cpp</TT></a> for an example of
|
||||
using A* search.
|
||||
|
||||
<H3>Notes</H3>
|
||||
|
||||
<a name="1">[1]</a> Since the visitor parameter is passed by value, if
|
||||
your visitor contains state then any changes to the state during the
|
||||
algorithm will be made to a copy of the visitor object, not the
|
||||
visitor object passed in. Therefore you may want the visitor to hold
|
||||
this state by pointer or reference.
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2004</TD><TD>
|
||||
<A HREF="http://www.cs.rpi.edu/~beevek/">Kristopher Beevers</A>,
|
||||
Rensselaer Polytechnic Institute (<A
|
||||
HREF="mailto:beevek@cs.rpi.edu">beevek@cs.rpi.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -0,0 +1,108 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- Copyright (c) 2004 Kris Beevers
|
||||
--
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: astar_visitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1>
|
||||
<pre>
|
||||
astar_visitor<EventVisitorList>
|
||||
</pre>
|
||||
</H1>
|
||||
|
||||
This class is an adapter that converts a list of <a
|
||||
href="./EventVisitor.html">EventVisitor</a>'s (constructed using
|
||||
<tt>std::pair</tt>) into a <a
|
||||
href="./AStarVisitor.html">AStarVisitor</a>.
|
||||
|
||||
|
||||
<h3>Example</h3>
|
||||
|
||||
See the example for <a href="./EventVisitor.html">EventVisitor</a>.
|
||||
|
||||
<h3>Model of</h3>
|
||||
|
||||
<a href="./AStarVisitor.html">AStarVisitor</a>
|
||||
|
||||
<H3>Template Parameters</H3>
|
||||
|
||||
<P>
|
||||
<TABLE border>
|
||||
<TR>
|
||||
<th>Parameter</th><th>Description</th><th>Default</th>
|
||||
</tr>
|
||||
|
||||
<TR><TD><TT>EventVisitorList</TT></TD>
|
||||
<TD>
|
||||
A list of <a href="./EventVisitor.html">EventVisitor</a>'s created
|
||||
with <tt>std::pair</tt>.
|
||||
</TD>
|
||||
<TD><TT><a href="./null_visitor.html"><tt>null_visitor</tt></a></TT></TD>
|
||||
</TR>
|
||||
|
||||
</table>
|
||||
|
||||
<H3>Where Defined</H3>
|
||||
|
||||
<P>
|
||||
<a href="../../../boost/graph/astar_search.hpp">
|
||||
<TT>boost/graph/astar_search.hpp</TT></a>
|
||||
|
||||
<h3>Member Functions</h3>
|
||||
|
||||
This class implements all of the member functions required by <a
|
||||
href="./AStarVisitor.html">AStarVisitor</a>. In each function the
|
||||
appropriate event is dispatched to the <a
|
||||
href="./EventVisitor.html">EventVisitor</a>'s in the
|
||||
EventVisitorList.
|
||||
|
||||
<h3>Non-Member Functions</h3>
|
||||
|
||||
<table border>
|
||||
<tr>
|
||||
<th>Function</th><th>Description</th>
|
||||
</tr>
|
||||
|
||||
<tr><td><tt>
|
||||
template <class EventVisitorList><br>
|
||||
astar_visitor<EventVisitorList><br>
|
||||
make_astar_visitor(EventVisitorList ev_list);
|
||||
</tt></td><td>
|
||||
Returns the event visitor list adapted to be an A* visitor.
|
||||
</td></tr>
|
||||
|
||||
</table>
|
||||
|
||||
<h3>See Also</h3>
|
||||
|
||||
<a href="./visitor_concepts.html">Visitor concepts</a>
|
||||
<p>
|
||||
The following are event visitors: <a
|
||||
href="./predecessor_recorder.html"><tt>predecessor_recorder</tt></a>,
|
||||
<a href="./distance_recorder.html"><tt>distance_recorder</tt></a>,
|
||||
<a href="./time_stamper.html"><tt>time_stamper</tt></a>,
|
||||
and <a href="./property_writer.html"><tt>property_writer</tt></a>.
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2004</TD><TD>
|
||||
<A HREF="http://www.cs.rpi.edu/~beevek/">Kristopher Beevers</A>,
|
||||
Rensselaer Polytechnic Institute (<A
|
||||
HREF="mailto:beevek@cs.rpi.edu">beevek@cs.rpi.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Bandwidth</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<!--
|
||||
-- Copyright (c) 2004 Trustees of Indiana University
|
||||
--
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta name="generator" content=
|
||||
"HTML Tidy for Mac OS X (vers 12 April 2005), see www.w3.org">
|
||||
<meta http-equiv="Content-Type" content=
|
||||
"text/html; charset=us-ascii">
|
||||
<title>Function betweenness_centrality_clustering</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="titlepage"></div>
|
||||
<div class="refnamediv">
|
||||
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<h1><img src="figs/python.gif" alt="(Python)"/><span class="refentrytitle">Function
|
||||
betweenness_centrality_clustering</span></h1>
|
||||
<p>boost::betweenness_centrality_clustering — Graph
|
||||
clustering based on edge betweenness centrality.</p>
|
||||
</div>
|
||||
<h2 xmlns:rev=
|
||||
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class=
|
||||
"refsynopsisdiv-title">Synopsis</h2>
|
||||
<div xmlns:rev=
|
||||
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class=
|
||||
"refsynopsisdiv">
|
||||
<pre class="synopsis">
|
||||
<span class="bold"><b>template</b></span><<span class=
|
||||
"bold"><b>typename</b></span> MutableGraph, <span class=
|
||||
"bold"><b>typename</b></span> Done, <span class=
|
||||
"bold"><b>typename</b></span> EdgeCentralityMap,
|
||||
<span class=
|
||||
"bold"><b>typename</b></span> VertexIndexMap>
|
||||
<span class="type"><span class=
|
||||
"bold"><b>void</b></span></span> betweenness_centrality_clustering(MutableGraph & g, Done done,
|
||||
EdgeCentralityMap edge_centrality,
|
||||
VertexIndexMap vertex_index);
|
||||
<span class="bold"><b>template</b></span><<span class=
|
||||
"bold"><b>typename</b></span> MutableGraph, <span class=
|
||||
"bold"><b>typename</b></span> Done, <span class=
|
||||
"bold"><b>typename</b></span> EdgeCentralityMap>
|
||||
<span class="type"><span class=
|
||||
"bold"><b>void</b></span></span> betweenness_centrality_clustering(MutableGraph & g, Done done,
|
||||
EdgeCentralityMap edge_centrality);
|
||||
<span class="bold"><b>template</b></span><<span class=
|
||||
"bold"><b>typename</b></span> MutableGraph, <span class=
|
||||
"bold"><b>typename</b></span> Done>
|
||||
<span class="type"><span class=
|
||||
"bold"><b>void</b></span></span> betweenness_centrality_clustering(MutableGraph & g, Done done);
|
||||
</pre></div>
|
||||
<div class="refsect1" lang="en"><a name="id822306" id=
|
||||
"id822306"></a>
|
||||
<h2>Description</h2>
|
||||
<p>This algorithm implements graph clustering based on edge
|
||||
betweenness centrality. It is an iterative algorithm, where in each
|
||||
step it compute the edge betweenness centrality (via <a href=
|
||||
"betweenness_centrality.html">brandes_betweenness_centrality</a>) and
|
||||
removes the edge with the maximum betweenness centrality. The
|
||||
<tt class="computeroutput">done</tt> function object determines
|
||||
when the algorithm terminates (the edge found when the algorithm
|
||||
terminates will not be removed).</p>
|
||||
|
||||
<h2>Parameters</h2>
|
||||
IN: <tt>const Graph& g</tt>
|
||||
<blockquote>
|
||||
The graph object on which the algorithm will be applied. The type
|
||||
<tt>Graph</tt> must be a model of <a
|
||||
href="VertexListGraph.html">Vertex List Graph</a> and <a
|
||||
href="IncidenceGraph.html">Incidence Graph</a>. When an edge
|
||||
centrality map is supplied, it must also model <a
|
||||
href="EdgeListGraph.html">Edge List Graph</a> and <a
|
||||
href="MutableGraph.html">MutableGraph</a>.<br>
|
||||
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>Done done</tt>
|
||||
<blockquote>
|
||||
The function object that indicates termination of the algorithm.
|
||||
It must be a ternary function object thats accepts the maximum
|
||||
centrality, the descriptor of the edge that will be removed, and
|
||||
the graph <tt class="computeroutput">g</tt>.<br>
|
||||
<b>Python</b>: Any callable Python object will suffice.
|
||||
</blockquote>
|
||||
|
||||
OUT/UTIL: <tt>EdgeCentralityMap edge_centrality_map</tt>
|
||||
<blockquote>
|
||||
This property map is used to accumulate the betweenness centrality
|
||||
of each edge, and is a secondary form of output for the
|
||||
algorithm. The type <tt>EdgeCentralityMap</tt> must be a model of <a
|
||||
href="../../property_map/ReadWritePropertyMap.html">Read/Write
|
||||
Property Map</a>, with the graph's edge descriptor type as its key
|
||||
type. The value type of this property map should be the same as the
|
||||
value type of the <tt>CentralityMap</tt> property map.<br>
|
||||
|
||||
<b>Default:</b> a <tt>dummy_property_map</tt>, which requires no
|
||||
work to compute and returns no answer.<br>
|
||||
<b>Python</b>: The color map must be a <tt>edge_double_map</tt> for
|
||||
the graph.<br>
|
||||
<b>Python default</b>: <tt>graph.get_edge_double_map("centrality")</tt>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>VertexIndexMap vertex_index</tt>
|
||||
<blockquote>
|
||||
This maps each vertex to an integer in the range <tt>[0,
|
||||
num_vertices(g))</tt>. This is necessary for efficient updates of the
|
||||
heap data structure when an edge is relaxed. The type
|
||||
<tt>VertexIndexMap</tt> must be a model of
|
||||
<a href="../../property_map/ReadablePropertyMap.html">Readable Property Map</a>. The value type of the map must be an
|
||||
integer type. The vertex descriptor type of the graph needs to be
|
||||
usable as the key type of the map.<br>
|
||||
<b>Default:</b> <tt>get(vertex_index, g)</tt>.
|
||||
Note: if you use this default, make sure your graph has
|
||||
an internal <tt>vertex_index</tt> property. For example,
|
||||
<tt>adjacenty_list</tt> with <tt>VertexList=listS</tt> does
|
||||
not have an internal <tt>vertex_index</tt> property.<br>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
<table xmlns:rev=
|
||||
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width=
|
||||
"100%">
|
||||
<tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<h3>Where Defined</h3>
|
||||
<<a href=
|
||||
"../../../boost/graph/bc_clustering.hpp">boost/graph/bc_clustering.hpp</a>>
|
||||
<hr>
|
||||
<table>
|
||||
<tr valign="top">
|
||||
<td nowrap>Copyright © 2004</td>
|
||||
<td><a href="../../../people/doug_gregor.html">Douglas Gregor</a>,
|
||||
Indiana University (dgregor@cs.indiana.edu)<br>
|
||||
<a href="http://www.osl.iu.edu/~lums">Andrew Lumsdaine</a>, Indiana
|
||||
University (<a href=
|
||||
"mailto:lums@osl.iu.edu">lums@osl.iu.edu</a>)</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,25 +2,21 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Bellman Ford Shortest Paths</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
|
||||
<H1><A NAME="sec:bellman-ford"></A>
|
||||
<H1><A NAME="sec:bellman-ford"></A><img src="figs/python.gif" alt="(Python)"/>
|
||||
<TT>bellman_ford_shortest_paths</TT>
|
||||
</H1>
|
||||
|
||||
@@ -28,8 +24,12 @@
|
||||
<PRE>
|
||||
<i>// named paramter version</i>
|
||||
template <class <a href="./EdgeListGraph.html">EdgeListGraph</a>, class Size, class P, class T, class R>
|
||||
bool bellman_ford_shortest_paths(EdgeListGraph& g, Size N,
|
||||
const bgl_named_params<P, T, R>& params = <i>all defaults</i>)
|
||||
bool bellman_ford_shortest_paths(const EdgeListGraph& g, Size N,
|
||||
const bgl_named_params<P, T, R>& params = <i>all defaults</i>);
|
||||
|
||||
template <class <a href="./VertexAndEdgeListGraph.html">VertexAndEdgeListGraph</a>, class P, class T, class R>
|
||||
bool bellman_ford_shortest_paths(const VertexAndEdgeListGraph& g,
|
||||
const bgl_named_params<P, T, R>& params = <i>all defaults</i>);
|
||||
|
||||
<i>// non-named parameter version</i>
|
||||
template <class <a href="./EdgeListGraph.html">EdgeListGraph</a>, class Size, class WeightMap,
|
||||
@@ -61,7 +61,8 @@ search provides an even more efficient alternative.
|
||||
<p>
|
||||
Before calling the <tt>bellman_ford_shortest_paths()</tt> function,
|
||||
the user must assign the source vertex a distance of zero and all
|
||||
other vertices a distance of infinity. The Bellman-Ford algorithm
|
||||
other vertices a distance of infinity <i>unless</i> you are providing
|
||||
a starting vertex. The Bellman-Ford algorithm
|
||||
proceeds by looping through all of the edges in the graph, applying
|
||||
the relaxation operation to each edge. In the following pseudo-code,
|
||||
<i>v</i> is a vertex adjacent to <i>u</i>, <i>w</i> maps edges to
|
||||
@@ -113,6 +114,7 @@ otherwise.
|
||||
<td valign="top">
|
||||
<pre>
|
||||
BELLMAN-FORD(<i>G</i>)
|
||||
<i>// Optional initialization</i>
|
||||
<b>for</b> each vertex <i>u in V</i>
|
||||
<i>d[u] := infinity</i>
|
||||
<i>p[u] := u</i>
|
||||
@@ -134,7 +136,8 @@ BELLMAN-FORD(<i>G</i>)
|
||||
<td valign="top">
|
||||
<pre>
|
||||
|
||||
initialize vertex <i>u</i>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -175,13 +178,20 @@ algorithm's event points.
|
||||
IN: <tt>EdgeListGraph& g</tt>
|
||||
<blockquote>
|
||||
A directed or undirected graph whose type must be a model of
|
||||
<a href="./EdgeListGraph.html">Edge List Graph</a>.
|
||||
<a href="./EdgeListGraph.html">Edge List Graph</a>. If a root vertex is
|
||||
provided, then the graph must also model
|
||||
<a href="./VertexListGraph.html">Vertex List Graph</a>.<br>
|
||||
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>Size N</tt>
|
||||
<blockquote>
|
||||
The number of vertices in the graph. The type <tt>Size</tt> must
|
||||
be an integer type.
|
||||
be an integer type.<br>
|
||||
<b>Default:</b> <tt>num_vertices(g)</tt>.<br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
|
||||
@@ -195,7 +205,10 @@ IN: <tt>weight_map(WeightMap w)</tt>
|
||||
Map</a>. The key type for this property map must be the edge
|
||||
descriptor of the graph. The value type for the weight map must be
|
||||
<i>Addable</i> with the distance map's value type. <br>
|
||||
<b>Default:</b> <tt>get(edge_weight, g)</tt>
|
||||
<b>Default:</b> <tt>get(edge_weight, g)</tt><br>
|
||||
|
||||
<b>Python</b>: Must be an <tt>edge_double_map</tt> for the graph.<br>
|
||||
<b>Python default</b>: <tt>graph.get_edge_double_map("weight")</tt>
|
||||
</blockquote>
|
||||
|
||||
OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
|
||||
@@ -209,7 +222,9 @@ OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
|
||||
href="../../property_map/ReadWritePropertyMap.html">Read/Write
|
||||
Property Map</a> which key and vertex types the same as the vertex
|
||||
descriptor type of the graph.<br>
|
||||
<b>Default:</b> <tt>dummy_property_map</tt>
|
||||
<b>Default:</b> <tt>dummy_property_map</tt><br>
|
||||
|
||||
<b>Python</b>: Must be a <tt>vertex_vertex_map</tt> for the graph.<br>
|
||||
</blockquote>
|
||||
|
||||
IN/OUT: <tt>distance_map(DistanceMap d)</tt>
|
||||
@@ -223,7 +238,19 @@ IN/OUT: <tt>distance_map(DistanceMap d)</tt>
|
||||
distance map must be <a
|
||||
href="http://www.sgi.com/tech/stl/LessThanComparable.html"> Less
|
||||
Than Comparable</a>.<br> <b>Default:</b> <tt>get(vertex_distance,
|
||||
g)</tt>
|
||||
g)</tt><br>
|
||||
<b>Python</b>: Must be a <tt>vertex_double_map</tt> for the graph.<br>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>root_vertex(Vertex s)</tt>
|
||||
<blockquote>
|
||||
The starting (or "root") vertex from which shortest paths will be
|
||||
computed. When provided, the distance map need not be initialized
|
||||
(the algorithm will perform the initialization itself). However, the
|
||||
graph must model <a href="./VertexListGraph.html">Vertex List
|
||||
Graph</a> when this parameter is provided.<br>
|
||||
<b>Default:</b> None; if omitted, the user must initialize the
|
||||
distance map.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>visitor(BellmanFordVisitor v)</tt>
|
||||
@@ -233,7 +260,13 @@ IN: <tt>visitor(BellmanFordVisitor v)</tt>
|
||||
The visitor object is passed by value <a
|
||||
href="#1">[1]</a>.
|
||||
<br>
|
||||
<b>Default:</b> <tt>bellman_visitor<null_visitor></tt>
|
||||
<b>Default:</b> <tt>bellman_visitor<null_visitor></tt><br>
|
||||
|
||||
<b>Python</b>: The parameter should be an object that derives from
|
||||
the <a
|
||||
href="BellmanFordVisitor.html#python"><tt>BellmanFordVisitor</tt></a> type
|
||||
of the graph.
|
||||
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_combine(BinaryFunction combine)</tt>
|
||||
@@ -244,7 +277,9 @@ IN: <tt>distance_combine(BinaryFunction combine)</tt>
|
||||
type. The result type must be the same as the distance map's value
|
||||
type.<br>
|
||||
<b>Default:</b><tt>std::plus<D></tt>
|
||||
with <tt>D=typename property_traits<DistanceMap>::value_type</tt>.
|
||||
with <tt>D=typename property_traits<DistanceMap>::value_type</tt>.<br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_compare(BinaryPredicate compare)</tt>
|
||||
@@ -253,7 +288,9 @@ IN: <tt>distance_compare(BinaryPredicate compare)</tt>
|
||||
that compares distances in the relaxation step. The argument types
|
||||
must match the distance map's value type.<br>
|
||||
<b>Default:</b> <tt>std::less<D></tt>
|
||||
with <tt>D=typename property_traits<DistanceMap>::value_type</tt>.
|
||||
with <tt>D=typename property_traits<DistanceMap>::value_type</tt>.<br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
<P>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: bellman_visitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -0,0 +1,307 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<!--
|
||||
-- Copyright (c) 2004 Trustees of Indiana University
|
||||
--
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<title>Boost Graph Library: Brandes' Betweenness Centrality</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<h1><img src="figs/python.gif" alt="(Python)"/><tt>brandes_betweenness_centrality</tt></h1>
|
||||
|
||||
<p>
|
||||
<pre>
|
||||
<em>// named parameter versions</em>
|
||||
template<typename Graph, typename Param, typename Tag, typename Rest>
|
||||
void
|
||||
brandes_betweenness_centrality(const Graph& g,
|
||||
const bgl_named_params<Param,Tag,Rest>& params);
|
||||
|
||||
template<typename Graph, typename CentralityMap>
|
||||
void
|
||||
brandes_betweenness_centrality(const Graph& g, CentralityMap centrality_map);
|
||||
|
||||
template<typename Graph, typename CentralityMap, typename EdgeCentralityMap>
|
||||
void
|
||||
brandes_betweenness_centrality(const Graph& g, CentralityMap centrality_map,
|
||||
EdgeCentralityMap edge_centrality);
|
||||
|
||||
<em>// non-named parameter versions</em>
|
||||
template<typename Graph, typename CentralityMap, typename EdgeCentralityMap,
|
||||
typename IncomingMap, typename DistanceMap, typename DependencyMap,
|
||||
typename PathCountMap, typename VertexIndexMap>
|
||||
void
|
||||
brandes_betweenness_centrality(const Graph& g, CentralityMap centrality_map,
|
||||
EdgeCentralityMap edge_centrality,
|
||||
IncomingMap incoming,
|
||||
DistanceMap distance, DependencyMap dependency,
|
||||
PathCountMap path_count,
|
||||
VertexIndexMap vertex_index);
|
||||
|
||||
template<typename Graph, typename CentralityMap, typename EdgeCentralityMap,
|
||||
typename IncomingMap, typename DistanceMap, typename DependencyMap,
|
||||
typename PathCountMap, typename VertexIndexMap, typename WeightMap>
|
||||
void
|
||||
brandes_betweenness_centrality(const Graph& g, CentralityMap centrality_map,
|
||||
EdgeCentralityMap edge_centrality,
|
||||
IncomingMap incoming,
|
||||
DistanceMap distance, DependencyMap dependency,
|
||||
PathCountMap path_count,
|
||||
VertexIndexMap vertex_index,
|
||||
WeightMap weight_map);
|
||||
|
||||
<em>// helper functions</em>
|
||||
template<typename Graph, typename CentralityMap>
|
||||
void
|
||||
relative_betweenness_centrality(const Graph& g, CentralityMap centrality_map);
|
||||
|
||||
template<typename Graph, typename CentralityMap>
|
||||
typename property_traits<CentralityMap>::value_type
|
||||
central_point_dominance(const Graph& g, CentralityMap centrality_map);
|
||||
</pre>
|
||||
|
||||
<p>This algorithm [<a href="bibliography.html#brandes01">54</a>]
|
||||
computes the <em>betweenness centrality</em> [<a
|
||||
href="bibliography.html#freeman77">55</a>,<a
|
||||
href="bibliography.html#anthonisse71">56</a>] of each vertex or each
|
||||
edge in the graph. The betweenness centrality of a vertex <em>v</em>
|
||||
is defined by
|
||||
|
||||
<p><img src="figs/betweenness_centrality.gif">,
|
||||
|
||||
<p>where <img src="figs/sigma_st.gif"> is the number of shortest paths from
|
||||
vertex <em>s</em> to vertex <em>t</em> and <img src="figs/sigma_stv.gif">
|
||||
is the number of shortest paths from vertex <em>s</em> to vertex
|
||||
<em>t</em> that pass through vertex <em>v</em>.
|
||||
|
||||
<!-- \sum_{s \neq v \neq t}\frac{\sigma_{st}(v)}{\sigma_{st}} -->
|
||||
|
||||
<p>The edge betweenness centrality indicates for each edge the
|
||||
betweenness centrality that was contributed to the target(s) of the
|
||||
edge (plural for undirected graphs). Similar to (vertex) betweenness
|
||||
centrality, edge betweenness centrality can be used to determine the
|
||||
edges through which most shortest paths must pass. A single invocation
|
||||
of this algorithm can compute either the vertex or edge centrality (or
|
||||
both).</p>
|
||||
|
||||
<p>This algorithm can operate either on weighted graphs (if a suitable
|
||||
edge weight map is supplied) or unweighted graphs (if no edge weight
|
||||
map is supplied). The result is the absolute betweenness centrality;
|
||||
to convert to the relative betweenness centrality, which scales each
|
||||
absolute centrality by <img src="figs/rel_betweenness_centrality.gif">
|
||||
(where <em>n</em> is the number of vertices in the graph), use
|
||||
<tt>relative_betweenness_centrality</tt>. Given the relative
|
||||
betweenness centrality, one can compute the <em>central point
|
||||
dominance</em> [<a href="bibliography.html#freeman77">55</a>], which is a measure of the maximum "betweenness" of any
|
||||
point in the graph: it will be 0 for complete graphs and
|
||||
1 for "wheel" graphs (in which there is a central vertex that all
|
||||
paths include; see <a href="#Fig1">Fig. 1</a>). Let <img src="figs/v_star.gif"> be the vertex with the largest relative betweenness centrality; then, the central point dominance is defined as:
|
||||
|
||||
<p><img src="figs/central_point_dominance.gif">
|
||||
|
||||
<!-- C_B' = \frac{\sum_{v \in V} C_B(v^*) - C_B'(v)}{n-1} -->
|
||||
|
||||
<p><a name="Fig1">
|
||||
<table border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Fig. 1: A wheel graph, where every path travels through the central node. <br>The central point dominance of this graph is 1.</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center"><img src="figs/wheel_graph.gif"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3>Where Defined</h3>
|
||||
<a href="../../../boost/graph/betweenness_centrality.hpp"><tt>boost/graph/betweenness_centrality.hpp</tt></a>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
IN: <tt>const Graph& g</tt>
|
||||
<blockquote>
|
||||
The graph object on which the algorithm will be applied. The type
|
||||
<tt>Graph</tt> must be a model of <a
|
||||
href="VertexListGraph.html">Vertex List Graph</a> and <a
|
||||
href="IncidenceGraph.html">Incidence Graph</a>. When an edge
|
||||
centrality map is supplied, it must also model <a
|
||||
href="EdgeListGraph.html">Edge List Graph</a>.<br>
|
||||
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
</blockquote>
|
||||
|
||||
UTIL: <tt>IncomingMap incoming</tt>
|
||||
<blockquote>
|
||||
This property map records the set of edges incoming to each vertex that comprise a shortest path from a particular source vertex through this vertex, and is used internally by the algorithm.The <tt>IncomingMap</tt> type must be a <a
|
||||
href="../../property_map/LvaluePropertyMap.html">Lvalue Property
|
||||
Map</a> whose key type is the same as the vertex descriptor type of
|
||||
the graph and whose value type is a Sequence (e.g., an
|
||||
<tt>std::vector</tt>) containing edge descriptors.<br>
|
||||
|
||||
<b>Default:</b> <a
|
||||
href="../../property_map/iterator_property_map.html">
|
||||
<tt>iterator_property_map</tt></a> created from a
|
||||
<tt>std::vector</tt> of <tt>std::vector<Edge></tt>, where
|
||||
<tt>Edge</tt> is the edge descriptor type of the graph.<br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
UTIL: <tt>DistanceMap distance_map</tt>
|
||||
<blockquote>
|
||||
The shortest path weight from each source vertex <tt>s</tt> to each
|
||||
vertex in the graph <tt>g</tt> is recorded in this property map, but
|
||||
the result is only used internally. The type <tt>DistanceMap</tt>
|
||||
must be a model of <a
|
||||
href="../../property_map/ReadWritePropertyMap.html">Read/Write
|
||||
Property Map</a>. The vertex descriptor type of the graph needs to
|
||||
be usable as the key type of the distance map. The value type of the
|
||||
distance map is the element type of a <a
|
||||
href="./Monoid.html">Monoid</a>.<br>
|
||||
|
||||
<b>Default:</b> <a
|
||||
href="../../property_map/iterator_property_map.html">
|
||||
<tt>iterator_property_map</tt></a> created from a
|
||||
<tt>std::vector</tt> of the <tt>WeightMap</tt>'s value type (or the
|
||||
<tt>vertices_size_type</tt> of the graph when no weight map exists)
|
||||
of size <tt>num_vertices(g)</tt> and using the <tt>vertex_index</tt> for
|
||||
the index map.<br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
UTIL: <tt>DependencyMap dependency</tt>
|
||||
<blockquote>
|
||||
Property map used internally to accumulate partial betweenness
|
||||
centrality results. The type <tt>DependencyMap</tt> must be a model
|
||||
of <a href="../../property_map/ReadWritePropertyMap.html">Read/Write
|
||||
Property Map</a>. The vertex descriptor type of the graph needs to
|
||||
be usable as the key type of the dependency map. The value type of
|
||||
the dependency map must be compatible with the value type of the
|
||||
centrality map.<br>
|
||||
|
||||
<b>Default:</b> <a
|
||||
href="../../property_map/iterator_property_map.html">
|
||||
<tt>iterator_property_map</tt></a> created from a
|
||||
<tt>std::vector</tt> of the <tt>CentralityMap</tt>'s value type of
|
||||
size <tt>num_vertices(g)</tt> and using the <tt>vertex_index</tt>
|
||||
for the index map.<br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
UTIL: <tt>PathCountMap path_count</tt>
|
||||
<blockquote>
|
||||
Property map used internally to accumulate the number of paths that
|
||||
pass through each particular vertex. The type <tt>PathCountMap</tt>
|
||||
must be a model of <a
|
||||
href="../../property_map/ReadWritePropertyMap.html">Read/Write
|
||||
Property Map</a>. The vertex descriptor type of the graph needs to
|
||||
be usable as the key type of the dependency map. The value type of
|
||||
the dependency map must be an integral type large enough to store
|
||||
the number of paths in the graph.<br>
|
||||
|
||||
<b>Default:</b> <a
|
||||
href="../../property_map/iterator_property_map.html">
|
||||
<tt>iterator_property_map</tt></a> created from a
|
||||
<tt>std::vector</tt> of the <tt>degree_size_type</tt> of the graph of
|
||||
size <tt>num_vertices(g)</tt> and using the <tt>vertex_index</tt>
|
||||
for the index map.<br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
<h3>Named parameters</h3>
|
||||
OUT/UTIL: <tt>CentralityMap centrality_map</tt>
|
||||
<blockquote>
|
||||
This property map is used to accumulate the betweenness centrality
|
||||
of each vertex, and is the primary output of the algorithm. The type
|
||||
<tt>CentralityMap</tt> must be a model of <a
|
||||
href="../../property_map/ReadWritePropertyMap.html">Read/Write
|
||||
Property Map</a>, with the graph's vertex descriptor type as its key
|
||||
type. The value type of this property map should be a floating-point
|
||||
or rational type.<br>
|
||||
|
||||
<b>Default:</b> a <tt>dummy_property_map</tt>, which requires no
|
||||
work to compute and returns no answer.<br>
|
||||
<b>Python</b>: The color map must be a <tt>vertex_double_map</tt> for
|
||||
the graph.<br>
|
||||
<b>Python default</b>: <tt>graph.get_vertex_double_map("centrality")</tt>
|
||||
</blockquote>
|
||||
|
||||
OUT/UTIL: <tt>EdgeCentralityMap edge_centrality_map</tt>
|
||||
<blockquote>
|
||||
This property map is used to accumulate the betweenness centrality
|
||||
of each edge, and is a secondary form of output for the
|
||||
algorithm. The type <tt>EdgeCentralityMap</tt> must be a model of <a
|
||||
href="../../property_map/ReadWritePropertyMap.html">Read/Write
|
||||
Property Map</a>, with the graph's edge descriptor type as its key
|
||||
type. The value type of this property map should be the same as the
|
||||
value type of the <tt>CentralityMap</tt> property map.<br>
|
||||
|
||||
<b>Default:</b> a <tt>dummy_property_map</tt>, which requires no
|
||||
work to compute and returns no answer.<br>
|
||||
<b>Python</b>: The color map must be a <tt>edge_double_map</tt> for
|
||||
the graph.<br>
|
||||
<b>Python default</b>: <tt>graph.get_edge_double_map("centrality")</tt>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_index_map(VertexIndexMap vertex_index)</tt>
|
||||
<blockquote>
|
||||
This maps each vertex to an integer in the range <tt>[0,
|
||||
num_vertices(g))</tt>. This is necessary for efficient updates of the
|
||||
heap data structure when an edge is relaxed. The type
|
||||
<tt>VertexIndexMap</tt> must be a model of
|
||||
<a href="../../property_map/ReadablePropertyMap.html">Readable Property Map</a>. The value type of the map must be an
|
||||
integer type. The vertex descriptor type of the graph needs to be
|
||||
usable as the key type of the map.<br>
|
||||
<b>Default:</b> <tt>get(vertex_index, g)</tt>.
|
||||
Note: if you use this default, make sure your graph has
|
||||
an internal <tt>vertex_index</tt> property. For example,
|
||||
<tt>adjacenty_list</tt> with <tt>VertexList=listS</tt> does
|
||||
not have an internal <tt>vertex_index</tt> property.<br>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>weight_map(WeightMap w_map)</tt>
|
||||
<blockquote>
|
||||
The weight or ``length'' of each edge in the graph. The weights
|
||||
must all be non-negative, and the algorithm will throw a
|
||||
<a href="./exception.html#negative_edge"><tt>negative_edge</tt></a>
|
||||
exception is one of the edges is negative.
|
||||
The type <tt>WeightMap</tt> must be a model of
|
||||
<a href="../../property_map/ReadablePropertyMap.html">Readable Property Map</a>. The edge descriptor type of
|
||||
the graph needs to be usable as the key type for the weight
|
||||
map. The value type for this map must be
|
||||
the same as the value type of the distance map.<br>
|
||||
<b>Default:</b> All edge weights are assumed to be equivalent.
|
||||
<b>Python</b>: If supplied, must be an <tt>edge_double_map</tt> for the graph.
|
||||
</blockquote>
|
||||
|
||||
<h3>Complexity</h3>
|
||||
The time complexity is <em>O(VE)</em> for unweighted graphs and
|
||||
<em>O(VE + V(V+E) log V)</em> for weighted graphs. The space complexity
|
||||
is <em>O(VE)</em>.
|
||||
|
||||
<hr>
|
||||
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2004</TD><TD>
|
||||
<A HREF="../../../people/doug_gregor.html">Douglas Gregor</A>, Indiana University (dgregor@cs.indiana.edu</A>)<br>
|
||||
<A HREF=http://www.osl.iu.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
<!-- Created: Fri Jun 4 16:42:50 EST 2004 -->
|
||||
<!-- hhmts start -->Last modified: Tue Mar 1 14:14:51 EST 2005 <!-- hhmts end -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: bfs_visitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Jeremy Siek makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Named Parameters</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Bibliography</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
@@ -332,8 +328,81 @@ Automata, Languages and Programming, 376-386, 1986
|
||||
<EM>A Transitive Closure Algorithm</EM><br>
|
||||
BIT, 10, 1970, pp. 76-94.
|
||||
|
||||
</DL>
|
||||
<p></p><dt><a name="brandes01">54</a>
|
||||
<dd>Ulrik Brandes<br>
|
||||
<em><a href="http://ella.slis.indiana.edu/~katy/L579/brandes.pdf">A
|
||||
Faster Algorithm for Betweenness Centrality</a></em><br>
|
||||
Journal of Mathematical Sociology 25 (2):163-177, 2001.
|
||||
|
||||
<p></p><dt><a name="freeman77">55</a>
|
||||
<dd>Lindon C. Freeman<br>
|
||||
<em>A Set of Measures of Centrality Based on Betweenness</em><br>
|
||||
Sociometry 40, pp. 35-41, 1977.
|
||||
|
||||
<p></p><dt><a name="anthonisse71">56</a>
|
||||
<dd>J.M. Anthonisse<br>
|
||||
<em>The rush in a directed graph.</em><br>
|
||||
Technical Report BN9/71, Stichting Mahtematisch Centrum, Amsterdam, 1971.
|
||||
|
||||
<p></p><dt><a name="kamada89">57</a>
|
||||
<dd>T. Kamada and S. Kawai<br>
|
||||
<em>An algorithm for drawing general undirected graphs.</em><br>
|
||||
Information Processing Letters, 31, pp. 7-15, 1989.
|
||||
|
||||
<p></p><dt><a name="fruchterman91">58</a>
|
||||
<dd>T. Fruchterman and E. Reingold<br>
|
||||
<em>Graph drawing by force-directed placement.</em><br>
|
||||
Software--Practice & Experience, 21 (11), pp. 1129-1164, 1991.
|
||||
|
||||
<p></p><dt><a name="coleman83">59</a>
|
||||
<dd>Thomas F. Coleman and Jorge J. More<br>
|
||||
<em>Estimation of sparse Jacobian
|
||||
matrices and graph coloring problems.</em><br>
|
||||
Journal of Numerical Analasis V20, pp. 187-209, 1983.
|
||||
|
||||
<p></p><dt><a name="gursoy00">60</a>
|
||||
<dd>Attila Gürsoy and Murat Atun<br>
|
||||
<em>Neighborhood Preserving Load Balancing: A Self-Organizing Approach</em>
|
||||
<br>
|
||||
Euro-Par Parallel Processing, LNCS 1900, pp. 324-41, 2000.
|
||||
|
||||
<p></p><dt><a name="driscoll88">61</a>
|
||||
<dd>James R. Driscoll, Harold N. Gabow, Ruth Shrairman, and Robert E. Tarjan<br>
|
||||
<em>Relaxed Heaps: An alternative for Fibonacci Heaps with applications to parallel computation.</em><br>
|
||||
Communications of the ACM, 31 (11), pp. 1343-1354, November 1988.
|
||||
|
||||
<p></p><dt><a name="king70">62</a>
|
||||
<dd>King, I. P.<br>
|
||||
<em>An automatic reordering scheme for simultaneous equations derived from network analysis.</em><br>
|
||||
Int. J. Numer. Methods Engrg. 2, pp. 523-533, 1970.
|
||||
|
||||
<p></p><dt><a name="palmer2000">63</a>
|
||||
<dd>C. Palmer and J. Steffan<br>
|
||||
<em>Generating Network Topologies That Obey Power Laws</em><br>
|
||||
Proceedings of GLOBECOM. November, 2000.
|
||||
|
||||
<p></p><dt><a name="edmonds65">64</a>
|
||||
<dd>J. Edmonds<br>
|
||||
<em>Paths, trees, and flowers</em><br>
|
||||
Canadian Journal of Mathematics 17 (1965), pp. 449-467.
|
||||
|
||||
<p></p><dt><a name="lengauer-tarjan79">65</a>
|
||||
<dd>Thomas Lengauer and Robert Endre Tarjan<br>
|
||||
<em>A fast algorithm for finding dominators in a flowgraph</em><br>
|
||||
ACM Transactions on Programming Language and Systems, 1(1):121-141, 1979.
|
||||
|
||||
<p></p><dt><a name="muchnick97">66</a>
|
||||
<dd>Steven S. Muchnick<br>
|
||||
<em>Advanced Compiler Design and Implementation</em><br>
|
||||
Morgan Kaufmann Publishers, San Fransisco, 1997.
|
||||
|
||||
<p></p><dt><a name="appel98">67</a>
|
||||
<dd>Andrew W. Appel<br>
|
||||
<em>Modern Compiler Implementation in JAVA</em><br>
|
||||
Cambridge University Press, 1998.
|
||||
|
||||
</dl>
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
|
||||
@@ -0,0 +1,254 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- Copyright 2001-2004 The Trustees of Indiana University.
|
||||
--
|
||||
-- Use, modification and distribution is subject to the Boost Software
|
||||
-- License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
--
|
||||
-- Authors: Douglas Gregor
|
||||
-- Jeremy Siek
|
||||
-- Andrew Lumsdaine
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Biconnected Components and Articulation Points</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<h1>
|
||||
<TT>
|
||||
<img src="figs/python.gif" alt="(Python)"/>
|
||||
<A NAME="sec:biconnected-components">biconnected_components
|
||||
</A>
|
||||
</TT>
|
||||
and
|
||||
<tt>articulation_points</tt>
|
||||
</h1>
|
||||
|
||||
<PRE>
|
||||
<i>// named parameter version</i>
|
||||
template <typename Graph, typename ComponentMap, typename OutputIterator,
|
||||
typename P, typename T, typename R>
|
||||
std::pair<std::size_t, OutputIterator>
|
||||
biconnected_components(const Graph& g, ComponentMap comp, OutputIterator out,
|
||||
const bgl_named_params<P, T, R>& params)
|
||||
|
||||
template <typename Graph, typename ComponentMap,
|
||||
typename P, typename T, typename R>
|
||||
std::size_t
|
||||
biconnected_components(const Graph& g, ComponentMap comp,
|
||||
const bgl_named_params<P, T, R>& params)
|
||||
|
||||
template <typename Graph, typename OutputIterator,
|
||||
typename P, typename T, typename R>
|
||||
OutputIterator articulation_points(const Graph& g, OutputIterator out,
|
||||
const bgl_named_params<P, T, R>& params)
|
||||
|
||||
<i>// non-named parameter version</i>
|
||||
template <typename Graph, typename ComponentMap, typename OutputIterator,
|
||||
typename DiscoverTimeMap, typename LowPointMap>
|
||||
std::pair<std::size_t, OutputIterator>
|
||||
biconnected_components(const Graph& g, ComponentMap comp, OutputIterator out,
|
||||
DiscoverTimeMap discover_time, LowPointMap lowpt);
|
||||
|
||||
template <typename Graph, typename ComponentMap, typename OutputIterator>
|
||||
std::pair<std::size_t, OutputIterator>
|
||||
biconnected_components(const Graph& g, ComponentMap comp, OutputIterator out);
|
||||
|
||||
template <typename Graph, typename ComponentMap>
|
||||
std::size_t biconnected_components(const Graph& g, ComponentMap comp);
|
||||
<a name="sec:articulation_points">
|
||||
template <typename Graph, typename OutputIterator>
|
||||
OutputIterator articulation_points(const Graph& g, OutputIterator out);
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
A connected graph is <i>biconnected</i> if the removal of any single
|
||||
vertex (and all edges incident on that vertex) can not disconnect the
|
||||
graph. More generally, the biconnected components of a graph are the
|
||||
maximal subsets of vertices such that the removal of a vertex from a
|
||||
particular component will not disconnect the component. Unlike
|
||||
connected components, vertices may belong to multiple biconnected
|
||||
components: those vertices that belong to more than one biconnected
|
||||
component are called <em>articulation points</em> or, equivalently,
|
||||
<em>cut vertices</em>. Articulation points are vertices whose removal
|
||||
would increase the number of connected components in the graph. Thus,
|
||||
a graph without articulation points is biconnected. The following
|
||||
figure illustrates the articulation points and biconnected components
|
||||
of a small graph:
|
||||
|
||||
<p><center><img src="figs/biconnected.png"></center>
|
||||
|
||||
<p>Vertices can be present in multiple biconnected components, but each
|
||||
edge can only be contained in a single biconnected component. The
|
||||
output of the <tt>biconnected_components</tt> algorithm records the
|
||||
biconnected component number of each edge in the property map
|
||||
<tt>comp</tt>. Articulation points will be emitted to the (optional)
|
||||
output iterator argument to <tt>biconnected_components</tt>, or can be
|
||||
computed without the use of a biconnected component number map via
|
||||
<tt>articulation_points</tt>. These functions return the number of
|
||||
biconnected components, the articulation point output iterator, or a
|
||||
pair of these quantities, depending on what information was
|
||||
recorded.
|
||||
|
||||
<p>The algorithm implemented is due to Tarjan [<a href="bibliography.html#tarjan72:dfs_and_linear_algo">41</a>].
|
||||
|
||||
<H3>Where Defined</H3>
|
||||
|
||||
<P>
|
||||
<a href="../../../boost/graph/biconnected_components.hpp"><TT>boost/graph/biconnected_components.hpp</TT></a>
|
||||
|
||||
|
||||
<h3>Parameters</h3>
|
||||
|
||||
IN: <tt>const Graph& g</tt>
|
||||
<blockquote>
|
||||
An undirected graph. The graph type must be a model of <a
|
||||
href="VertexListGraph.html">Vertex List Graph</a> and <a
|
||||
href="IncidenceGraph.html">Incidence Graph</a>.<br>
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
</blockquote>
|
||||
|
||||
OUT: <tt>ComponentMap c</tt>
|
||||
<blockquote>
|
||||
The algorithm computes how many biconnected components are in the graph,
|
||||
and assigning each component an integer label. The algorithm then
|
||||
records which component each edge in the graph belongs to by
|
||||
recording the component number in the component property map. The
|
||||
<tt>ComponentMap</tt> type must be a model of <a
|
||||
href="../../property_map/WritablePropertyMap.html">Writable Property
|
||||
Map</a>. The value type shouch be an integer type, preferably the same
|
||||
as the <tt>edges_size_type</tt> of the graph. The key type must be
|
||||
the graph's edge descriptor type.<br>
|
||||
<b>Default</b>: <tt>dummy_property_map</tt>.<br>
|
||||
<b>Python</b>: Must be an <tt>edge_int_map</tt> for the graph.<br>
|
||||
<b>Python default</b>: <tt>graph.get_edge_int_map("bicomponent")</tt>
|
||||
</blockquote>
|
||||
|
||||
OUT: <tt>OutputIterator out</tt>
|
||||
<blockquote>
|
||||
The algorithm writes articulation points via this output
|
||||
iterator and returns the resulting iterator.<br>
|
||||
<b>Default</b>: a dummy iterator that ignores values written to it.<br>
|
||||
|
||||
<b>Python</b>: this parameter is not used in Python. Instead, both
|
||||
algorithms return a Python <tt>list</tt> containing the articulation
|
||||
points.
|
||||
</blockquote>
|
||||
|
||||
<h3>Named Parameters</h3>
|
||||
|
||||
IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
<blockquote>
|
||||
This maps each vertex to an integer in the range <tt>[0,
|
||||
num_vertices(g))</tt>. The type
|
||||
<tt>VertexIndexMap</tt> must be a model of
|
||||
<a href="../../property_map/ReadablePropertyMap.html">Readable Property Map</a>. The value type of the map must be an
|
||||
integer type. The vertex descriptor type of the graph needs to be
|
||||
usable as the key type of the map.<br>
|
||||
<b>Default:</b> <tt>get(vertex_index, g)</tt><br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>discover_time_map(DiscoverTimeMap discover_time)</tt>
|
||||
<blockquote>
|
||||
The discovery time of each vertex in the depth-first search. The
|
||||
type <tt>DiscoverTimeMap</tt> must be a model of <a
|
||||
href="../../property_map/ReadWritePropertyMap.html">Read/Write
|
||||
Property Map</a>. The value type of the map must be an integer
|
||||
type. The vertex descriptor type of the graph needs to be usable as
|
||||
the key type of the map.<br>
|
||||
<b>Default</b>: an <a
|
||||
href="../../property_map/iterator_property_map.html">
|
||||
</tt>iterator_property_map</tt></a> created from a
|
||||
<tt>std::vector</tt> of <tt>vertices_size_type</tt> of size
|
||||
<tt>num_vertices(g)</tt> and using <tt>get(vertex_index, g)</tt> for
|
||||
the index map.<br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>lowpoint_map(LowPointMap lowpt)</tt>
|
||||
<blockquote>
|
||||
The low point of each vertex in the depth-first search, which is the
|
||||
smallest vertex reachable from a given vertex with at most one back
|
||||
edge. The type <tt>LowPointMap</tt> must be a model of <a
|
||||
href="../../property_map/ReadWritePropertyMap.html">Read/Write
|
||||
Property Map</a>. The value type of the map must be an integer
|
||||
type. The vertex descriptor type of the graph needs to be usable as
|
||||
the key type of the map.<br>
|
||||
<b>Default</b>: an <a
|
||||
href="../../property_map/iterator_property_map.html">
|
||||
</tt>iterator_property_map</tt></a> created from a
|
||||
<tt>std::vector</tt> of <tt>vertices_size_type</tt> of size
|
||||
<tt>num_vertices(g)</tt> and using <tt>get(vertex_index, g)</tt> for
|
||||
the index map.<br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
|
||||
<blockquote>
|
||||
The predecessor map records the depth first search tree.
|
||||
The <tt>PredecessorMap</tt> type
|
||||
must be a <a
|
||||
href="../../property_map/ReadWritePropertyMap.html">Read/Write
|
||||
Property Map</a> whose key and value types are the same as the vertex
|
||||
descriptor type of the graph.<br>
|
||||
<b>Default:</b> an <a
|
||||
href="../../property_map/iterator_property_map.html">
|
||||
</tt>iterator_property_map</tt></a> created from a
|
||||
<tt>std::vector</tt> of <tt>vertex_descriptor</tt> of size
|
||||
<tt>num_vertices(g)</tt> and using <tt>get(vertex_index, g)</tt> for
|
||||
the index map.<br>
|
||||
|
||||
<b>Python</b>: Must be a <tt>vertex_vertex_map</tt> for the graph.<br>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>visitor(DFSVisitor vis)</tt>
|
||||
<blockquote>
|
||||
A visitor object that is invoked inside the algorithm at the
|
||||
event-points specified by the <a href="./DFSVisitor.html">DFS
|
||||
Visitor</a> concept. The visitor object is passed by value <a
|
||||
href="#1">[1]</a>. <br> <b>Default:</b>
|
||||
<tt>dfs_visitor<null_visitor></tt><br>
|
||||
|
||||
<b>Python</b>: The parameter should be an object that derives from
|
||||
the <a href="DFSVisitor.html#python"><tt>DFSVisitor</tt></a> type of
|
||||
the graph.
|
||||
</blockquote>
|
||||
|
||||
<H3>Complexity</H3>
|
||||
|
||||
<P>
|
||||
The time complexity for the biconnected components and articulation
|
||||
points algorithms
|
||||
<i>O(V + E)</i>.
|
||||
|
||||
<P>
|
||||
|
||||
<H3>Example</H3>
|
||||
|
||||
<P> The file <a
|
||||
href="../example/biconnected_components.cpp"><tt>examples/biconnected_components.cpp</tt></a>
|
||||
contains an example of calculating the biconnected components and
|
||||
articulation points of an undirected graph.
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000-2004</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Indiana
|
||||
University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<a href="../../../people/doug_gregor.html">Doug Gregor</a>, Indiana University
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -2,30 +2,27 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000, 2001
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Breadth-First Search</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1><A NAME="sec:bfs">
|
||||
<img src="figs/python.gif" alt="(Python)"/>
|
||||
<TT>breadth_first_search</TT>
|
||||
</H1>
|
||||
|
||||
<P>
|
||||
<PRE>
|
||||
<i>// named paramter version</i>
|
||||
<i>// named parameter version</i>
|
||||
template <class Graph, class P, class T, class R>
|
||||
void breadth_first_search(Graph& G,
|
||||
typename graph_traits<Graph>::vertex_descriptor s,
|
||||
@@ -157,12 +154,16 @@ IN: <tt>Graph& g</tt>
|
||||
<blockquote>
|
||||
A directed or undirected graph. The graph type must
|
||||
be a model of <a href="./VertexListGraph.html">Vertex List Graph</a>
|
||||
and <a href="./IncidenceGraph.html">Incidence Graph</a>.
|
||||
and <a href="./IncidenceGraph.html">Incidence Graph</a>.<br>
|
||||
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_descriptor s</tt>
|
||||
<blockquote>
|
||||
The source vertex where the search is started.
|
||||
The source vertex where the search is started.<br>
|
||||
|
||||
<b>Python</b>: The parameter is named <tt>root_vertex</tt>.
|
||||
</blockquote>
|
||||
|
||||
|
||||
@@ -174,7 +175,11 @@ IN: <tt>visitor(BFSVisitor vis)</tt>
|
||||
event-points specified by the <a href="BFSVisitor.html">BFS
|
||||
Visitor</a> concept. The visitor object is passed by value <a
|
||||
href="#1">[1]</a>.<br> <b>Default:</b>
|
||||
<tt>bfs_visitor<null_visitor></tt>
|
||||
<tt>bfs_visitor<null_visitor></tt> <br>
|
||||
|
||||
<b>Python</b>: The parameter should be an object that derives from
|
||||
the <a href="BFSVisitor.html#python"><tt>BFSVisitor</tt></a> type of the graph.
|
||||
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>color_map(ColorMap color)</tt>
|
||||
@@ -198,7 +203,10 @@ UTIL/OUT: <tt>color_map(ColorMap color)</tt>
|
||||
</tt>iterator_property_map</tt></a> created from a
|
||||
<tt>std::vector</tt> of <tt>default_color_type</tt> of size
|
||||
<tt>num_vertices(g)</tt> and using the <tt>i_map</tt> for the index
|
||||
map.
|
||||
map.<br>
|
||||
|
||||
<b>Python</b>: The color map must be a <tt>vertex_color_map</tt> for
|
||||
the graph.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
@@ -212,7 +220,13 @@ IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
vertex descriptor type of the graph needs to be usable as the key
|
||||
type of the map.<br>
|
||||
|
||||
<b>Default:</b> <tt>get(vertex_index, g)</tt>
|
||||
<b>Default:</b> <tt>get(vertex_index, g)</tt>.
|
||||
Note: if you use this default, make sure your graph has
|
||||
an internal <tt>vertex_index</tt> property. For example,
|
||||
<tt>adjacenty_list</tt> with <tt>VertexList=listS</tt> does
|
||||
not have an internal <tt>vertex_index</tt> property.<br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
UTIL: <tt>buffer(Buffer& Q)</tt>
|
||||
@@ -224,8 +238,12 @@ UTIL: <tt>buffer(Buffer& Q)</tt>
|
||||
For example Dijkstra's algorithm can be implemented
|
||||
using a priority queue. The type <tt>Buffer</tt> must be a model of
|
||||
<a href="./Buffer.html">Buffer</a>.<br> The <tt>value_type</tt>
|
||||
of the buffer must be the <tt>vertex_descriptor</tt> type for the graph.
|
||||
<b>Default:</b> <tt>boost::queue</tt>
|
||||
of the buffer must be the <tt>vertex_descriptor</tt> type for the graph.<br>
|
||||
<b>Default:</b> <tt>boost::queue</tt><br>
|
||||
|
||||
<b>Python</b>: The buffer must derive from the <a
|
||||
href="./Buffer.html">Buffer</a> type for the graph.
|
||||
|
||||
</blockquote>
|
||||
|
||||
|
||||
|
||||
@@ -2,24 +2,20 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000, 2001
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Breadth-First Visit</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1><A NAME="sec:bfv">
|
||||
<H1><A NAME="sec:bfv"><img src="figs/python.gif" alt="(Python)"/>
|
||||
<TT>breadth_first_visit</TT>
|
||||
</H1>
|
||||
|
||||
@@ -60,12 +56,16 @@ only reaches a small portion of the graph.
|
||||
IN: <tt>IncidenceGraph& g</tt>
|
||||
<blockquote>
|
||||
A directed or undirected graph. The graph type must
|
||||
be a model of <a href="./IncidenceGraph.html">Incidence Graph</a>.
|
||||
be a model of <a href="./IncidenceGraph.html">Incidence Graph</a>.<br>
|
||||
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_descriptor s</tt>
|
||||
<blockquote>
|
||||
The source vertex where the search is started.
|
||||
The source vertex where the search is started.<br>
|
||||
|
||||
<b>Python</b>: The parameter is named <tt>root_vertex</tt>.
|
||||
</blockquote>
|
||||
|
||||
|
||||
@@ -77,7 +77,10 @@ IN: <tt>visitor(BFSVisitor vis)</tt>
|
||||
event-points specified by the <a href="BFSVisitor.html">BFS
|
||||
Visitor</a> concept. The visitor object is passed by value <a
|
||||
href="#1">[1]</a>.<br> <b>Default:</b>
|
||||
<tt>bfs_visitor<null_visitor></tt>
|
||||
<tt>bfs_visitor<null_visitor></tt><br>
|
||||
|
||||
<b>Python</b>: The parameter should be an object that derives from
|
||||
the <a href="BFSVisitor.html#python"><tt>BFSVisitor</tt></a> type of the graph.
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>color_map(ColorMap color)</tt>
|
||||
@@ -88,7 +91,10 @@ UTIL/OUT: <tt>color_map(ColorMap color)</tt>
|
||||
Property Map</a> and its key type must be the graph's vertex
|
||||
descriptor type and the value type of the color map must model
|
||||
<a href="./ColorValue.html">ColorValue</a>.<br>
|
||||
<b>Default:</b> <tt>get(vertex_color, g)</tt>
|
||||
<b>Default:</b> <tt>get(vertex_color, g)</tt><br>
|
||||
|
||||
<b>Python</b>: The color map must be a <tt>vertex_color_map</tt> for
|
||||
the graph.
|
||||
</blockquote>
|
||||
|
||||
UTIL: <tt>buffer(Buffer& Q)</tt>
|
||||
@@ -100,7 +106,10 @@ UTIL: <tt>buffer(Buffer& Q)</tt>
|
||||
For example Dijkstra's algorithm can be implemented
|
||||
using a priority queue. The type <tt>Buffer</tt> must be a model of
|
||||
<a href="./Buffer.html">Buffer</a>.<br>
|
||||
<b>Default:</b> <tt>boost::queue</tt>
|
||||
<b>Default:</b> <tt>boost::queue</tt><br>
|
||||
|
||||
<b>Python</b>: The buffer must derive from the <a
|
||||
href="./Buffer.html">Buffer</a> type for the graph.
|
||||
</blockquote>
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<!--
|
||||
-- Copyright Doug Gregor 2004. Use, modification and
|
||||
-- distribution is subject to the Boost Software License, Version
|
||||
-- 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
-- For more information, see http://www.boost.org
|
||||
-->
|
||||
<head>
|
||||
<title>Bundled Properties</title>
|
||||
</head>
|
||||
|
||||
<body BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86"/>
|
||||
<h1>Bundled Properties</h1>
|
||||
|
||||
<p>Class templates <code><a
|
||||
href="adjacency_list.html">adjacency_list</a></code> and
|
||||
<code><a href="adjacency_matrix.html">adjacency_matrix</a></code> support
|
||||
the introduction of named properties via <a
|
||||
href="using_adjacency_list.html#sec:adjacency-list-properties">internal
|
||||
properties</a>. However, this method is cumbersome in many uses,
|
||||
where it would be more intuitive to just specify a structure or
|
||||
class that contains internal properties for edges or
|
||||
vertices. Bundled properties allow one to use
|
||||
<code>adjacency_list</code> and <code>adjacency_matrix</code> in this
|
||||
manner, providing a simple
|
||||
way to introduce and access any number of internal properties
|
||||
for vertices and edges.</p>
|
||||
|
||||
<p>One can introduce bundled properties into an
|
||||
either graph type by providing a user-defined class
|
||||
type for the <code>VertexProperties</code> or
|
||||
<code>EdgeProperties</code> template arguments. The user-defined
|
||||
class may alternatively be placed at the end of a
|
||||
<code>property</code> list, replacing the (implicit)
|
||||
<code>boost::no_property</code> argument.</p>
|
||||
|
||||
<h2>Example: Route planning</h2>
|
||||
<p>Consider the implementation of a simple route planner that
|
||||
should find the shortest directions from one city to another
|
||||
via a set of highways. The vertices of the graph are cities,
|
||||
and we may wish to store several bits of information about the
|
||||
city within each vertex:</p>
|
||||
<pre>
|
||||
struct City
|
||||
{
|
||||
string name;
|
||||
int population;
|
||||
vector<int> zipcodes;
|
||||
};
|
||||
</pre>
|
||||
|
||||
<p>The edges in the graph represent highways, which also have
|
||||
several interesting attributes:</p>
|
||||
|
||||
<pre>
|
||||
struct Highway
|
||||
{
|
||||
string name;
|
||||
double miles;
|
||||
int speed_limit;
|
||||
int lanes;
|
||||
bool divided;
|
||||
};
|
||||
</pre>
|
||||
|
||||
<p>Without bundled properties, translating this example directly
|
||||
into an instantiation of <code>adjacency_list</code> would
|
||||
involve several custom properties and would result in a type
|
||||
like this:</p>
|
||||
<pre>
|
||||
typedef boost::adjacency_list<
|
||||
boost::listS, boost::vecS, boost::bidirectionalS,
|
||||
// Vertex properties
|
||||
boost::property<boost::vertex_name_t, std::string,
|
||||
boost::property<population_t, int,
|
||||
boost::property<zipcodes_t, std::vector<int> > > >,
|
||||
// Edge properties
|
||||
boost::property<boost::edge_name_t, std::string,
|
||||
boost::property<boost::edge_length_t, double,
|
||||
boost::property<edge_speed_limit_t, int,
|
||||
boost::property<edge_lanes_t, int,
|
||||
boost::property<edge_divided, bool> > > > > >
|
||||
Map;
|
||||
</pre>
|
||||
|
||||
<p>With bundled properties, we can directly use the
|
||||
<code>City</code> and <code>Highway</code> structures:</p>
|
||||
<pre>
|
||||
typedef boost::adjacency_list<
|
||||
boost::listS, boost::vecS, boost::bidirectionalS,
|
||||
City, Highway> Map;
|
||||
</pre>
|
||||
|
||||
<h2>Accessing bundled properties</h2>
|
||||
<p>To access a bundled property for a particular edge or vertex,
|
||||
subscript your graph with the descriptor of the edge or vertex
|
||||
whose bundled property you wish to access. For instance:</p>
|
||||
<pre>
|
||||
Map map; // load the map
|
||||
Map::vertex_descriptor v = *vertices(map).first;
|
||||
map[v].name = "Troy";
|
||||
map[v].population = 49170;
|
||||
map[v].zipcodes.push_back(12180);
|
||||
Map::edge_descriptor e = *out_edges(v, map).first;
|
||||
map[e].name = "I-87";
|
||||
map[e].miles = 10;
|
||||
map[e].speed_limit = 65;
|
||||
map[e].lanes = 4;
|
||||
map[e].divided = true;
|
||||
</pre>
|
||||
|
||||
<h2>Properties maps from bundled properties</h2>
|
||||
<p>Often one needs to create a property map from an internal
|
||||
property for use in a generic algorithm. For instance, using the
|
||||
graph without bundled properties we might invoke <a
|
||||
href="dijkstra_shortest_paths.html">Dijkstra's shortest
|
||||
paths</a> algorithm like this:</p>
|
||||
<pre>
|
||||
vector<double> distances(num_vertices(map));
|
||||
dijkstra_shortest_paths(map, from,
|
||||
weight_map(get(edge_length, map))
|
||||
.distance_map(make_iterator_property_map(distances.begin(),
|
||||
get(vertex_index, map))));
|
||||
</pre>
|
||||
|
||||
<p>With bundled properties, we can just pass a <em>member pointer</em>
|
||||
as the property for <code>get</code>. The equivalent example
|
||||
using bundled properties is:</p>
|
||||
<pre>
|
||||
vector<double> distances(num_vertices(map));
|
||||
dijkstra_shortest_paths(map, from,
|
||||
weight_map(get(<font color="#ff0000">&Highway::miles</font>, map))
|
||||
.distance_map(make_iterator_property_map(distances.begin(),
|
||||
get(vertex_index, map))));
|
||||
</pre>
|
||||
|
||||
<p>The type of the returned property map is <code>property_map<Map, int Highway::*>::type</code>
|
||||
or <code>property_map<Map, int Highway::*>::const_type</code>, depending on whether the graph
|
||||
<code>map</code> is non-constant or constant.
|
||||
|
||||
<p> You may also access the entire vertex or edge bundle as a property map
|
||||
using the <code>vertex_bundle</code> or <code>edge_bundle</code> properties,
|
||||
respectively. For instance, the property map returned by <code>get(vertex_bundle, map)</code> is
|
||||
an <a href="../../property_map/LvaluePropertyMap.html">Lvalue Property Map</a> providing access to the
|
||||
<code>City</code> values stored in each vertex.
|
||||
|
||||
<h2>Getting the type of bundled properties</h2>
|
||||
|
||||
<p>To get the type of the vertex or edge bundle for a given graph
|
||||
type <tt>Graph</tt>, you can use the trait
|
||||
classes <tt>vertex_bundle_type</tt>
|
||||
and <tt>edge_bundle_type</tt>. The
|
||||
type <tt>vertex_bundle_type<Graph>::type</tt> will be the
|
||||
type bundled with vertices (or <tt>no_vertex_bundle</tt> if the
|
||||
graph supports bundles but no vertex bundle
|
||||
exists). Likewise, <tt>edge_bundle_type<Graph>::type</tt>
|
||||
will be the type bundled with edges (or <tt>no_edge_bundle</tt> if
|
||||
no edge bundle exists).</p>
|
||||
|
||||
<h2>Compatibility</h2> <p>Bundled properties will only work
|
||||
properly on compilers that support class template partial
|
||||
specialization.</p>
|
||||
|
||||
<hr>
|
||||
Copyright © 2004 <a href="../../../people/doug_gregor.html">Doug Gregor</a>.
|
||||
<address><a href="mailto:gregod@cs.rpi.edu"></a></address>
|
||||
<!-- Created: Fri May 7 09:59:21 EDT 2004 -->
|
||||
<!-- hhmts start -->
|
||||
Last modified: Fri May 7 10:56:01 EDT 2004
|
||||
<!-- hhmts end -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Challenge</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
@@ -26,9 +22,9 @@
|
||||
<ul>
|
||||
|
||||
<li>Dynamic graph algorithms such as described in <a
|
||||
href="http://citeseer.nj.nec.com/eppstein99dynamic.html">Dynamic Graph
|
||||
href="http://citeseer.ist.psu.edu/eppstein99dynamic.html">Dynamic Graph
|
||||
Algorithms</a> and <a
|
||||
href="http://citeseer.nj.nec.com/alberts98software.html">A Software
|
||||
href="http://citeseer.ist.psu.edu/alberts98software.html">A Software
|
||||
Library of Dynamic Graph Algorithms</a>.
|
||||
|
||||
<li>Polish up code/docs for pending items and champion the formal
|
||||
@@ -62,8 +58,6 @@ polygons.</li>
|
||||
according to a user defined comparison object.</li>
|
||||
</ul>
|
||||
|
||||
<li>Floyd-Warshall algorithm.</li>
|
||||
|
||||
<li>Rewrite the Qhull algorithm using the Boost Graph Library (this is
|
||||
high difficulty challenge). Or, for a more manageable challenge,
|
||||
write an interface for Qhull with the BGL. <a
|
||||
@@ -95,19 +89,23 @@ It is currently difficult to use from a C++ program.
|
||||
<li>Modularize the tests in test/graph.cpp to apply to particular
|
||||
concepts. Make sure there are run-time tests for every BGL concept.</li>
|
||||
|
||||
<li>Write tests for the BGL algorithms. Currently the examples
|
||||
are used as a sanity check, but they do not constitute a real test. </li>
|
||||
<li>Write tests for the BGL algorithms. There are a few, but
|
||||
more are needed. The example provide a sanity check but do not
|
||||
provide full coverage.</li>
|
||||
|
||||
<li>Write up the examples from Knuth's <i>Stanford GraphBase</i> using
|
||||
the BGL. The file <a
|
||||
href="../example/miles_span.cpp"><tt>examples/miles_span.cpp</tt></a>
|
||||
is a start.
|
||||
is a start.</li>
|
||||
|
||||
<li>Create a class to support sub-graph views of a graph, where a
|
||||
sub-graph behaves just like a graph, but shares vertex and edge
|
||||
properties with the original graph. Perhaps even support sub-graphs
|
||||
of sub-graphs, etc.
|
||||
<li>Further testing of the <tt>subgraph</tt> class and add more
|
||||
features.</li>
|
||||
|
||||
<li>Implement a minimum-cost maximum-flow algorithm.</li>
|
||||
|
||||
<li>Make the <tt>type</tt> of all (internal) property maps convertible to the <tt>const_type</tt> of the property maps.<li>
|
||||
|
||||
<li>Add static functions to <tt>adjacency_list</tt> to return the per-vertex, per-edge, and per-graph overhead.</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<html><!--
|
||||
-- Copyright (c) 2004 Trustees of Indiana University
|
||||
--
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Function template circle_graph_layout</title></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table cellpadding="2" width="100%"><td valign="top"><img src="../../../boost.png" alt="boost.png (6897 bytes)" width="277" height="86"></td><td align="center"><a href="../../../index.htm">Home</a></td><td align="center"><a href="../../libraries.htm">Libraries</a></td><td align="center"><a href="../../../people/people.htm">People</a></td><td align="center"><a href="../../../more/faq.htm">FAQ</a></td><td align="center"><a href="../../../more/index.htm">More</a></td></table><hr><div class="refentry" lang="en"><a name="id103562-bb"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><img src="figs/python.gif" alt="(Python)"/><span class="refentrytitle">Function template circle_graph_layout</span></h2><p>boost::circle_graph_layout — Layout the graph with the vertices at the points of a regular n-polygon. </p></div><h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2><div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
|
||||
<span class="bold"><b>template</b></span><<span class="bold"><b>typename</b></span> VertexListGraph, <span class="bold"><b>typename</b></span> PositionMap, <span class="bold"><b>typename</b></span> Radius>
|
||||
<span class="type"><span class="bold"><b>void</b></span></span> circle_graph_layout(<span class="bold"><b>const</b></span> VertexListGraph & g, PositionMap position,
|
||||
Radius radius);</pre></div><div class="refsect1" lang="en"><a name="id821794"></a><h2>Where Defined</h2><a href="../../../boost/graph/circle_layout.hpp">boost/graph/circle_layout.hpp</a><h2>Description</h2><p>The distance from the center of the polygon to each point is determined by the <tt class="computeroutput">radius</tt> parameter. The <tt class="computeroutput">position</tt> parameter must be an Lvalue Property Map whose value type is a class type containing <tt class="computeroutput">x</tt> and <tt class="computeroutput">y</tt> members that will be set to the <tt class="computeroutput">x</tt> and <tt class="computeroutput">y</tt> coordinates.
|
||||
|
||||
<h2>Parameters</h2>
|
||||
IN: <tt>const VertexListGraph& g</tt>
|
||||
<blockquote>
|
||||
The graph object on which the algorithm will be applied. The type
|
||||
<tt>VertexListGraph</tt> must be a model of <a
|
||||
href="VertexListGraph.html">Vertex List Graph</a>.<br>
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
</blockquote>
|
||||
|
||||
OUT: <tt>PositionMap position</tt>
|
||||
<blockquote>
|
||||
This property map is used to store the position of each vertex. The
|
||||
type <tt>PositionMap</tt> must be a model of <a
|
||||
href="../../property_map/WritablePropertyMap.html">Writable Property
|
||||
Map</a>, with the graph's edge descriptor type as its key type. The
|
||||
value type of this property map should be assignable from the
|
||||
type <tt>Radius</tt>. <br>
|
||||
|
||||
<b>Python</b>: The position map must be a <tt>vertex_point2d_map</tt> for
|
||||
the graph.<br>
|
||||
<b>Python default</b>: <tt>graph.get_vertex_point2d_map("position")</tt>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>Radius radius</tt>
|
||||
<blockquote>
|
||||
This is the radius of the circle on which points will be layed
|
||||
out. It must be compatible with <tt>double</tt>.<br>
|
||||
</blockquote>
|
||||
|
||||
</p></div></div><table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr><td align="left"></td><td align="right"><small></small></td></tr></table><hr>
|
||||
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2004</TD><TD>
|
||||
<A HREF="../../../people/doug_gregor.html">Douglas Gregor</A>, Indiana University (dgregor -at- cs.indiana.edu</A>)<br>
|
||||
<A HREF=http://www.osl.iu.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Indiana University (lums -at- osl.iu.edu)
|
||||
</TD></TR></TABLE>
|
||||
</body></html>
|
||||
@@ -0,0 +1,720 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<!--
|
||||
-- Copyright (c) 2005 Trustees of Indiana University
|
||||
--
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<title>Compressed Sparse Row Graph</title>
|
||||
|
||||
<STYLE TYPE="text/css">
|
||||
<!--
|
||||
.indent
|
||||
{
|
||||
padding-left: 50pt;
|
||||
padding-right: 50pt;
|
||||
}
|
||||
-->
|
||||
</STYLE>
|
||||
|
||||
<script language="JavaScript" type="text/JavaScript">
|
||||
<!--
|
||||
function address(host, user) {
|
||||
var atchar = '@';
|
||||
var thingy = user+atchar+host;
|
||||
thingy = '<a hre' + 'f=' + "mai" + "lto:" + thingy + '>' + user+atchar+host + '</a>';
|
||||
document.write(thingy);
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86"></img>
|
||||
<h1>Compressed Sparse Row Graph</h1>
|
||||
|
||||
<p>The class template <code>compressed_sparse_row_graph</code> is
|
||||
a graph class that uses the compact Compressed Sparse Row (CSR)
|
||||
format to store directed graphs. While CSR graphs have much less
|
||||
overhead than many other graph formats (e.g., <a
|
||||
href="adjacency_list.html"><code>adjacency_list</code></a>), they
|
||||
do not provide any mutability: one cannot add or remove vertices
|
||||
or edges from a CSR graph. Use this format in high-performance
|
||||
applications or for very large graphs that you do not need to
|
||||
change.</p>
|
||||
|
||||
<p>The CSR format stores vertices and edges in separate arrays,
|
||||
with the indices into these arrays corresponding to the identifier
|
||||
for the vertex or edge, respectively. The edge array is sorted by
|
||||
the source of each edge, but contains only the targets for the
|
||||
edges. The vertex array stores offsets into the edge array,
|
||||
providing the offset of the first edge outgoing from each
|
||||
vertex. Iteration over the out-edges for the <i>i</i><sup>th</sup>
|
||||
vertex in the graph is achieved by
|
||||
visiting <tt>edge_array[vertex_array[i]]</tt>, <tt>edge_array[vertex_array[i]+1]</tt>,
|
||||
..., <tt>edge_array[vertex_array[i+1]]</tt>. This format minimizes
|
||||
memory use to <i>O(n + m)</i>, where <i>n</i> and <i>m</i> are the
|
||||
number of vertices and edges, respectively. The constants
|
||||
multiplied by <i>n</i> and <i>m</i> are based on the size of the
|
||||
integers needed to represent indices into the edge and vertex
|
||||
arrays, respectively, which can be controlled using
|
||||
the <a href="#template-parms">template parameters</a>.</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="#synopsis">Synopsis</a></li>
|
||||
<li><a href="#where">Where Defined</a></li>
|
||||
<li><a href="#models">Models</a></li>
|
||||
<li><a href="#template-parms">Template parameters</a></li>
|
||||
<li><a href="#properties">Properties</a></li>
|
||||
<li><a href="#member-functions">Member functions</a>
|
||||
<ul>
|
||||
<li><a href="#constructors">Constructors</a></li>
|
||||
<li><a href="#mutators">Mutators</a></li>
|
||||
<li><a href="#property-access">Property access</a></li>
|
||||
</ul></li>
|
||||
|
||||
<li><a href="#non-members">Non-member functions</a>
|
||||
<ul>
|
||||
<li><a href="#vertex-access">Vertex access</a></li>
|
||||
<li><a href="#edge-access">Edge access</a></li>
|
||||
<li><a href="#property-map-accessors">Property map accessors</a></li>
|
||||
<li><a href="#incremental-construction-functions">Incremental construction functions</a></li>
|
||||
</ul></li>
|
||||
|
||||
<li><a href="#example">Example</a></li>
|
||||
</ul>
|
||||
|
||||
<a name="synopsis"></a><h2>Synopsis</h2>
|
||||
|
||||
<pre>
|
||||
namespace boost {
|
||||
|
||||
template<typename <a href="#Directed">Directed</a> = directedS, typename <a href="#VertexProperty">VertexProperty</a> = void,
|
||||
typename <a href="#EdgeProperty">EdgeProperty</a> = void, typename <a href="#GraphProperty">GraphProperty</a> = no_property,
|
||||
typename <a href="#Vertex">Vertex</a> = std::size_t, typename <a href="#EdgeIndex">EdgeIndex</a> = Vertex>
|
||||
class compressed_sparse_row_graph
|
||||
{
|
||||
public:
|
||||
<i>// <a href="#constructors">Graph constructors</a></i>
|
||||
<a href="#default-const">compressed_sparse_row_graph</a>();
|
||||
|
||||
template<typename InputIterator>
|
||||
<a href="#edge-const">compressed_sparse_row_graph</a>(InputIterator edge_begin, InputIterator edge_end,
|
||||
vertices_size_type numverts,
|
||||
edges_size_type numedges = 0,
|
||||
const GraphProperty& prop = GraphProperty());
|
||||
|
||||
template<typename InputIterator, typename EdgePropertyIterator>
|
||||
<a href="#edge-prop-const">compressed_sparse_row_graph</a>(InputIterator edge_begin, InputIterator edge_end,
|
||||
EdgePropertyIterator ep_iter,
|
||||
vertices_size_type numverts,
|
||||
edges_size_type numedges = 0,
|
||||
const GraphProperty& prop = GraphProperty());
|
||||
|
||||
template<typename Graph, typename VertexIndexMap>
|
||||
<a href="#graph-const">compressed_sparse_row_graph</a>(const Graph& g, const VertexIndexMap& vi,
|
||||
vertices_size_type numverts,
|
||||
edges_size_type numedges);
|
||||
|
||||
template<typename Graph, typename VertexIndexMap>
|
||||
compressed_sparse_row_graph(const Graph& g, const VertexIndexMap& vi);
|
||||
|
||||
template<typename Graph>
|
||||
explicit <a href="#graph-const">compressed_sparse_row_graph</a>(const Graph& g);
|
||||
|
||||
<i>// <a href="#mutators">Graph mutators</a></i>
|
||||
template<typename Graph, typename VertexIndexMap>
|
||||
void <a href="#assign">assign</a>(const Graph& g, const VertexIndexMap& vi,
|
||||
vertices_size_type numverts, edges_size_type numedges);
|
||||
|
||||
template<typename Graph, typename VertexIndexMap>
|
||||
void <a href="#assign">assign</a>(const Graph& g, const VertexIndexMap& vi);
|
||||
|
||||
template<typename Graph>
|
||||
void <a href="#assign">assign</a>(const Graph& g);
|
||||
|
||||
<i>// <a href="#property-access">Property Access</a></i>
|
||||
VertexProperty& <a href="#vertex-subscript">operator[]</a>(vertex_descriptor v);
|
||||
const VertexProperty& <a href="#vertex-subscript">operator[]</a>(vertex_descriptor v) const;
|
||||
EdgeProperty& <a href="#edge-subscript">operator[]</a>(edge_descriptor v);
|
||||
const EdgeProperty& <a href="#edge-subscript">operator[]</a>(edge_descriptor v) const;
|
||||
};
|
||||
|
||||
<i>// <a href="IncidenceGraph.html">Incidence Graph requirements</a></i>
|
||||
vertex_descriptor source(edge_descriptor, const compressed_sparse_row_graph&);
|
||||
vertex_descriptor target(edge_descriptor, const compressed_sparse_row_graph&);
|
||||
std::pair<out_edge_iterator, out_edge_iterator>
|
||||
out_edges(vertex_descriptor, const compressed_sparse_row_graph&);
|
||||
degree_size_type out_degree(vertex_descriptor v, const compressed_sparse_row_graph&);
|
||||
|
||||
<i>// <a href="AdjacencyGraph.html">Adjacency Graph requirements</a></i>
|
||||
std::pair<adjacency_iterator, adjacency_iterator>
|
||||
adjacent_vertices(vertex_descriptor, const compressed_sparse_row_graph&);
|
||||
|
||||
<i>// <a href="VertexListGraph.html">Vertex List Graph requirements</a></i>
|
||||
std::pair<vertex_iterator, vertex_iterator> vertices(const compressed_sparse_row_graph&);
|
||||
vertices_size_type num_vertices(const compressed_sparse_row_graph&);
|
||||
|
||||
<i>// <a href="EdgeListGraph.html">Edge List Graph requirements</a></i>
|
||||
std::pair<edge_iterator, edge_iterator> edges(const compressed_sparse_row_graph&);
|
||||
edges_size_type num_edges(const compressed_sparse_row_graph&);
|
||||
|
||||
<i>// <a href="#vertex-access">Vertex access</a></i>
|
||||
vertex_descriptor <a href="#vertex">vertex</a>(vertices_size_type i, const compressed_sparse_row_graph&);
|
||||
|
||||
<i>// <a href="#edge-access">Edge access</a></i>
|
||||
std::pair<out_edge_iterator, out_edge_iterator>
|
||||
<a href="#edge_range">edge_range</a>(vertex_descriptor u, vertex_descriptor v, const compressed_sparse_row_graph&);
|
||||
std::pair<edge_descriptor, bool>
|
||||
<a href="#edge">edge</a>(vertex_descriptor u, vertex_descriptor v, const compressed_sparse_row_graph&);
|
||||
edge_descriptor <a href="#edge_from_index">edge_from_index</a>(edges_size_type i, const compressed_sparse_row_graph&);
|
||||
|
||||
<i>// <a href="#property-map-accessors">Property map accessors</a></i>
|
||||
template<typename <a href="./PropertyTag.html">PropertyTag</a>>
|
||||
property_map<compressed_sparse_row_graph, PropertyTag>::type
|
||||
<a href="#get">get</a>(PropertyTag, compressed_sparse_row_graph& g)
|
||||
|
||||
template<typename <a href="./PropertyTag.html">PropertyTag</a>>
|
||||
property_map<compressed_sparse_row_graph, Tag>::const_type
|
||||
<a href="#get">get</a>(PropertyTag, const compressed_sparse_row_graph& g)
|
||||
|
||||
template<typename <a href="./PropertyTag.html">PropertyTag</a>, class X>
|
||||
typename property_traits<property_map<compressed_sparse_row_graph, PropertyTag>::const_type>::value_type
|
||||
<a href="#get-x">get</a>(PropertyTag, const compressed_sparse_row_graph& g, X x)
|
||||
|
||||
template<typename <a href="./PropertyTag.html">PropertyTag</a>, class X, class Value>
|
||||
void <a href="#put-x">put</a>(PropertyTag, const compressed_sparse_row_graph& g, X x, const Value& value);
|
||||
|
||||
template<typename <a href="./PropertyTag.html#GraphPropertyTag">GraphPropertyTag</a>>
|
||||
typename graph_property<compressed_sparse_row_graph, GraphPropertyTag>::type&
|
||||
<a href="#get_property">get_property</a>(compressed_sparse_row_graph& g, GraphPropertyTag);
|
||||
|
||||
template<typename <a href="./PropertyTag.html#GraphPropertyTag">GraphPropertyTag</a>>
|
||||
typename graph_property<compressed_sparse_row_graph, GraphPropertyTag>::type const &
|
||||
<a href="#get_property">get_property</a>(const compressed_sparse_row_graph& g, GraphPropertyTag);
|
||||
|
||||
template<typename <a href="./PropertyTag.html#GraphPropertyTag">GraphPropertyTag</a>>
|
||||
void <a href="#set_property">set_property</a>(const compressed_sparse_row_graph& g, GraphPropertyTag,
|
||||
const typename graph_property<compressed_sparse_row_graph, GraphPropertyTag>::type& value);
|
||||
|
||||
<i>// <a href="#incremental-construction-functions">Incremental construction functions</a></i>
|
||||
template<typename Graph>
|
||||
vertex_descriptor <a href=#add_vertex">add_vertex</a>(compressed_sparse_row_graph& g);
|
||||
|
||||
template<typename Graph>
|
||||
vertex_descriptor <a href=#add_vertices">add_vertices</a>(vertices_size_type count, compressed_sparse_row_graph& g);
|
||||
|
||||
template<typename Graph>
|
||||
edge_descriptor <a href=#add_edge">add_vertices</a>(vertex_descriptor src, vertex_descriptor tgt, compressed_sparse_row_graph& g);
|
||||
|
||||
} <i>// end namespace boost</i>
|
||||
</pre>
|
||||
|
||||
<a name="where"></a><h2>Where Defined</h2>
|
||||
<p><code><<a href="../../../boost/graph/compressed_sparse_row_graph.hpp">boost/graph/compressed_sparse_row_graph.hpp</a>></code></p>
|
||||
|
||||
<a name="models"></a><h2>Models</h2>
|
||||
|
||||
<p>The <tt>compressed_sparse_row_graph</tt> class template models
|
||||
(i.e., implements the requirements of) many of the
|
||||
BGL <a href="graph_concepts.html">graph concepts</a>, allowing it
|
||||
to be used with most of the BGL algorithms. In particular, it
|
||||
models the following specific graph concepts:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="Graph.html">Graph</a></li>
|
||||
<li><a href="IncidenceGraph.html">IncidenceGraph</a></li>
|
||||
<li><a href="AdjacencyGraph.html">AdjacencyGraph</a></li>
|
||||
<li><a href="VertexListGraph.html">VertexListGraph</a></li>
|
||||
<li><a href="EdgeListGraph.html">EdgeListGraph</a></li>
|
||||
<li><a href="PropertyGraph.html">PropertyGraph</a></li>
|
||||
</ul>
|
||||
|
||||
<a name="template-parms"></a><h2>Template Parameters</h2>
|
||||
|
||||
<p>The <tt>compressed_sparse_row_graph</tt> class has several
|
||||
template parameters that can customize the layout in memory and
|
||||
what properties are attached to the graph itself. All
|
||||
parameters have defaults, so users interested only in the
|
||||
structure of a graph can use the
|
||||
type <tt>compressed_sparse_row_graph<></tt> and ignore
|
||||
the parameters.</p>
|
||||
|
||||
<b>Parameters</b>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<a name="Directed"></a><code>Directed</code>
|
||||
<blockquote>
|
||||
A selector that determines whether the graph will be directed,
|
||||
bidirectional or undirected. At this time, the CSR graph type
|
||||
only supports directed graphs, so this value must
|
||||
be <code>boost::directedS</code>.<br>
|
||||
<b>Default</b>: <code>boost::directedS</code>
|
||||
</blockquote>
|
||||
|
||||
<a name="VertexProperty"></a><code>VertexProperty</code>
|
||||
<blockquote>
|
||||
A class type that will be
|
||||
attached to each vertex in the graph. If this value
|
||||
is <code>void</code>, no properties will be attached to
|
||||
the vertices of the graph.<br>
|
||||
<b>Default</b>: <code>void</code>
|
||||
</blockquote>
|
||||
|
||||
<a name="EdgeProperty"></a><code>EdgeProperty</code>
|
||||
<blockquote>
|
||||
A class type that will be attached to each edge in the graph. If
|
||||
this value is <code>void</code>, no properties will be
|
||||
attached to the edges of the graph.<br>
|
||||
<b>Default</b>: <code>void</code>
|
||||
</blockquote>
|
||||
|
||||
<a name="GraphProperty"></a><code>GraphProperty</code>
|
||||
<blockquote>
|
||||
A nested set
|
||||
of <code>property</code> templates that describe the
|
||||
properties of the graph itself. If this value
|
||||
is <code>no_property</code>, no properties will be attached to
|
||||
the graph.<br>
|
||||
<b>Default</b>: <code>no_property</code>
|
||||
</blockquote>
|
||||
|
||||
<a name="Vertex"></a><code>Vertex</code>
|
||||
<blockquote>
|
||||
An unsigned integral type that will be
|
||||
used as both the index into the array of vertices and as the
|
||||
vertex descriptor itself. Larger types permit the CSR graph to
|
||||
store more vertices; smaller types reduce the storage required
|
||||
per vertex.<br>
|
||||
<b>Default</b>: <code>std::size_t</code>
|
||||
</blockquote>
|
||||
|
||||
<a name="EdgeIndex"></a><code>EdgeIndex</code>
|
||||
<blockquote>
|
||||
An unsigned integral type that will be used as the index into
|
||||
the array of edges. As with the <code>Vertex</code> parameter,
|
||||
larger types permit more edges whereas smaller types reduce
|
||||
the amount of storage needed per
|
||||
edge. The <code>EdgeIndex</code> type shall not be smaller
|
||||
than the <code>Vertex</code> type, but it may be larger. For
|
||||
instance, <code>Vertex</code> may be a 16-bit integer
|
||||
(allowing 32,767 vertices in the graph)
|
||||
whereas <code>EdgeIndex</code> could then be a 32-bit integer
|
||||
to allow a complete graph to be stored in the CSR format.<br>
|
||||
<b>Default</b>: <code>Vertex</code>
|
||||
</blockquote>
|
||||
|
||||
<a name="properties"></a><h2>Interior Properties</h2>
|
||||
|
||||
<p> The <tt>compressed_sparse_row_graph</tt> allows properties to
|
||||
be attached to its vertices, edges, or to the graph itself by way
|
||||
of its <a href="#template-parms">template parameters</a>. These
|
||||
properties may be accessed via
|
||||
the <a href="#property-access">member</a>
|
||||
and <a href="#property-map-accessors">non-member</a> property
|
||||
access functions, using the <a href="bundles.html">bundled
|
||||
properties</a> scheme.</p>
|
||||
|
||||
<p>The CSR graph provides two kinds of built-in
|
||||
properties: <tt>vertex_index</tt>, which maps from vertices to
|
||||
values in <tt>[0, n)</tt> and <tt>edge_index</tt>, which maps
|
||||
from edges to values in <tt>[0, m)</tt>, where <tt>n</tt>
|
||||
and <tt>m</tt> are the number of vertices and edges in the graph,
|
||||
respectively. </p>
|
||||
|
||||
<a name="member-functions"></a><h2>Member Functions</h2>
|
||||
|
||||
<a name="constructors"></a><h3>Constructors</h3>
|
||||
<pre><a name="default-const"></a>
|
||||
compressed_sparse_row_graph();
|
||||
</pre>
|
||||
<p class="indent">Constructs a graph with no vertices or edges.</p>
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<pre><a name="edge-const"></a>
|
||||
template<typename InputIterator>
|
||||
compressed_sparse_row_graph(InputIterator edge_begin, InputIterator edge_end,
|
||||
vertices_size_type numverts,
|
||||
edges_size_type numedges = 0,
|
||||
const GraphProperty& prop = GraphProperty());
|
||||
</pre>
|
||||
|
||||
<p class="indent">
|
||||
Constructs a graph with <code>numverts</code> vertices whose
|
||||
edges are specified by the iterator range <code>[edge_begin,
|
||||
edge_end)</code>. The <tt>InputIterator</tt> must be a model of
|
||||
<a
|
||||
href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
|
||||
whose <code>value_type</code> is an <code>std::pair</code> of
|
||||
integer values. These integer values are the source and target
|
||||
vertices for the edges, and must fall within the range <code>[0,
|
||||
numverts)</code>. The edges in <code>[edge_begin,
|
||||
edge_end)</code> must be sorted so that all edges originating
|
||||
from vertex <i>i</i> preceed any edges originating from all
|
||||
vertices <i>j</i> where <i>j > i</i>.
|
||||
</p>
|
||||
|
||||
<p class="indent">
|
||||
The value <code>numedges</code>, if provided, tells how many
|
||||
edges are in the range <code>[edge_begin, edge_end)</code> and
|
||||
will be used to preallocate data structures to save both memory
|
||||
and time during construction.
|
||||
</p>
|
||||
|
||||
<p class="indent">
|
||||
The value <code>prop</code> will be used to initialize the graph
|
||||
property.
|
||||
</p>
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<pre><a name="edge-prop-const"></a>
|
||||
template<typename InputIterator, typename EdgePropertyIterator>
|
||||
compressed_sparse_row_graph(InputIterator edge_begin, InputIterator edge_end,
|
||||
EdgePropertyIterator ep_iter,
|
||||
vertices_size_type numverts,
|
||||
edges_size_type numedges = 0,
|
||||
const GraphProperty& prop = GraphProperty());
|
||||
</pre>
|
||||
<p class="indent">
|
||||
This constructor constructs a graph with <code>numverts</code>
|
||||
vertices and the edges provided in the iterator range
|
||||
<code>[edge_begin, edge_end)</code>. Its semantics are identical
|
||||
to the <a href="#edge-const">edge range constructor</a>, except
|
||||
that edge properties are also initialized. The type
|
||||
<tt>EdgePropertyIterator</tt> must be a model of the <a
|
||||
href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
|
||||
concept whose <tt>value_type</tt> is convertible to
|
||||
<tt>EdgeProperty</tt>. The iterator range <tt>[ep_iter, ep_ter +
|
||||
m)</tt> will be used to initialize the properties on the edges
|
||||
of the graph, where <tt>m</tt> is distance from
|
||||
<tt>edge_begin</tt> to <tt>edge_end</tt>.
|
||||
</p>
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<pre><a name="#graph-const"></a>
|
||||
template<typename Graph, typename VertexIndexMap>
|
||||
compressed_sparse_row_graph(const Graph& g, const VertexIndexMap& vi,
|
||||
vertices_size_type numverts,
|
||||
edges_size_type numedges);
|
||||
|
||||
template<typename Graph, typename VertexIndexMap>
|
||||
compressed_sparse_row_graph(const Graph& g, const VertexIndexMap& vi);
|
||||
|
||||
template<typename Graph>
|
||||
explicit compressed_sparse_row_graph(const Graph& g);
|
||||
</pre>
|
||||
|
||||
<p class="indent">
|
||||
Calls the <a href="#assign"><tt>assign</tt></a> function with
|
||||
all of the arguments it is given.
|
||||
</p>
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<a name="mutators"></a><h3>Mutators</h3>
|
||||
<pre><a name="assign"></a>
|
||||
template<typename Graph, typename VertexIndexMap>
|
||||
void assign(const Graph& g, const VertexIndexMap& vi,
|
||||
vertices_size_type numverts, edges_size_type numedges);
|
||||
|
||||
template<typename Graph, typename VertexIndexMap>
|
||||
void assign(const Graph& g, const VertexIndexMap& vi);
|
||||
|
||||
template<typename Graph>
|
||||
void assign(const Graph& g);
|
||||
</pre>
|
||||
|
||||
<p class="indent">
|
||||
Clears the CSR graph and builds a CSR graph in place from the
|
||||
structure of another graph. The graph type <tt>Graph</tt> must
|
||||
be a model of <a href="IncidenceGraph.html">IncidenceGraph</a>
|
||||
and have a <tt>vertex(i, g)</tt> function that retrieves the
|
||||
<i>i</i><sup>th</sup> vertex in the graph.
|
||||
|
||||
<br><b>Parameters</b>
|
||||
|
||||
<ul>
|
||||
<li><tt>g</tt>: The incoming graph.</li>
|
||||
|
||||
<li><tt>vi</tt>: A map from vertices to indices. If not
|
||||
provided, <tt>get(vertex_index, g)</tt> will be used.</li>
|
||||
|
||||
<li><tt>numverts</tt>: The number of vertices in the graph
|
||||
<tt>g</tt>. If not provided, <tt>Graph</tt> must be a model of
|
||||
<a href="VertexListGraph.html">VertexListGraph</a>.</li>
|
||||
|
||||
<li><tt>numedges</tt>: The number of edges in the graph
|
||||
<tt>g</tt>. If not provided, <tt>Graph</tt> must be a model of
|
||||
<a href="EdgeListGraph.html">EdgeListGraph</a>.</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<a name="property-access"></a><h3>Property Access</h3>
|
||||
|
||||
<pre><a name="vertex-subscript"></a>
|
||||
VertexProperty& operator[](vertex_descriptor v);
|
||||
const VertexProperty& operator[](vertex_descriptor v) const;
|
||||
</pre>
|
||||
|
||||
<p class="indent">
|
||||
Retrieves the property value associated with vertex
|
||||
<tt>v</tt>. Only valid when <tt>VertexProperty</tt> is a class
|
||||
type that is not <tt>no_property</tt>.
|
||||
</p>
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<pre><a name="edge-subscript">
|
||||
EdgeProperty& operator[](edge_descriptor v);
|
||||
const EdgeProperty& operator[](edge_descriptor v) const;
|
||||
</pre>
|
||||
|
||||
<p class="indent">
|
||||
Retrieves the property value associated with edge
|
||||
<tt>v</tt>. Only valid when <tt>EdgeProperty</tt> is a class
|
||||
type that is not <tt>no_property</tt>.
|
||||
</p>
|
||||
|
||||
<hr></hr>
|
||||
<a name="non-members"></a><h2>Non-member Functions</h2>
|
||||
|
||||
<a name="vertex-access"></a><h3>Vertex access</h3>
|
||||
|
||||
<pre><a name="vertex"></a>
|
||||
vertex_descriptor vertex(vertices_size_type i, const compressed_sparse_row_graph&);
|
||||
</pre>
|
||||
<p class="indent">
|
||||
Retrieves the <i>i</i><sup>th</sup> vertex in the graph in
|
||||
constant time.
|
||||
</p>
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<a name="edge-access"></a><h3>Edge access</h3>
|
||||
<pre><a name="edge_range"></a>
|
||||
std::pair<out_edge_iterator, out_edge_iterator>
|
||||
edge_range(vertex_descriptor u, vertex_descriptor v, const compressed_sparse_row_graph&);
|
||||
</pre>
|
||||
|
||||
<p class="indent">
|
||||
Returns all edges from <tt>u</tt> to <tt>v</tt>. Requires time
|
||||
linear in the number of edges outgoing from <tt>u</tt>.
|
||||
</p>
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<pre><a name="edge"></a>
|
||||
std::pair<edge_descriptor, bool>
|
||||
edge(vertex_descriptor u, vertex_descriptor v, const compressed_sparse_row_graph&);
|
||||
</pre>
|
||||
|
||||
<p class="indent">
|
||||
If there exists an edge <i>(u, v)</i> in the graph, returns the
|
||||
descriptor for that edge and <tt>true</tt>; otherwise, the
|
||||
second value in the pair will be <tt>false</tt>. If multiple
|
||||
edges exist from <tt>u</tt> to <tt>v</tt>, the first edge will
|
||||
be returned; use <a href="#edge_range"><tt>edge_range</tt></a>
|
||||
to retrieve all edges.
|
||||
</p>
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<pre><a name="edge_from_index"></a>
|
||||
edge_descriptor edge_from_index(edges_size_type i, const compressed_sparse_row_graph&);
|
||||
</pre>
|
||||
|
||||
<p class="indent">
|
||||
Returns the <i>i</i><sup>th</sup> edge in the graph. This
|
||||
operation requires logarithmic time in the number of vertices.
|
||||
</p>
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<h3><a name="property-map-accessors">Property Map Accessors</a></h3>
|
||||
|
||||
<pre><a name="get"></a>
|
||||
template<typename <a href="./PropertyTag.html">PropertyTag</a>>
|
||||
property_map<compressed_sparse_row_graph, PropertyTag>::type
|
||||
get(PropertyTag, compressed_sparse_row_graph& g)
|
||||
|
||||
template<typename <a href="./PropertyTag.html">PropertyTag</a>>
|
||||
property_map<compressed_sparse_row_graph, Tag>::const_type
|
||||
get(PropertyTag, const compressed_sparse_row_graph& g)
|
||||
</pre>
|
||||
|
||||
<p class="indent">
|
||||
Returns the property map object for the vertex property
|
||||
specified by <TT>PropertyTag</TT>. The <TT>PropertyTag</TT> must
|
||||
be a member pointer to access one of the fields in
|
||||
<tt>VertexProperty</tt> or <tt>EdgeProperty</tt>.
|
||||
</p>
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<pre><a name="get-x"></a>
|
||||
template<typename <a href="./PropertyTag.html">PropertyTag</a>, class X>
|
||||
typename property_traits<property_map<compressed_sparse_row_graph, PropertyTag>::const_type>::value_type
|
||||
get(PropertyTag, const compressed_sparse_row_graph& g, X x)
|
||||
</pre>
|
||||
|
||||
<p class="indent">
|
||||
This returns the property value for <tt>x</tt>, where <tt>x</tt>
|
||||
is either a vertex or edge descriptor.
|
||||
</p>
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<pre><a name="put-x"></a>
|
||||
template<typename <a href="./PropertyTag.html">PropertyTag</a>, class X, class Value>
|
||||
void put(PropertyTag, const compressed_sparse_row_graph& g, X x, const Value& value);
|
||||
</pre>
|
||||
|
||||
<p class="indent">
|
||||
This sets the property value for <tt>x</tt> to
|
||||
<tt>value</tt>. <tt>x</tt> is either a vertex or edge
|
||||
descriptor. <tt>Value</tt> must be convertible to <tt>typename
|
||||
property_traits<property_map<compressed_sparse_row_graph,
|
||||
PropertyTag>::type>::value_type</tt>
|
||||
</p>
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<pre><a name="get_property"></a>
|
||||
template<typename <a href="./PropertyTag.html#GraphPropertyTag">GraphPropertyTag</a>>
|
||||
typename graph_property<compressed_sparse_row_graph, GraphPropertyTag>::type&
|
||||
get_property(compressed_sparse_row_graph& g, GraphPropertyTag);
|
||||
|
||||
template<typename <a href="./PropertyTag.html#GraphPropertyTag">GraphPropertyTag</a>>
|
||||
typename graph_property<compressed_sparse_row_graph, GraphPropertyTag>::type const &
|
||||
get_property(const compressed_sparse_row_graph& g, GraphPropertyTag);
|
||||
</pre>
|
||||
|
||||
<p class="indent">
|
||||
Return the property specified by <tt>GraphPropertyTag</tt> that
|
||||
is attached to the graph object <tt>g</tt>.
|
||||
</p>
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<pre><a name="set_property"></a>
|
||||
template<typename <a href="./PropertyTag.html#GraphPropertyTag">GraphPropertyTag</a>>
|
||||
void set_property(const compressed_sparse_row_graph& g, GraphPropertyTag,
|
||||
const typename graph_property<compressed_sparse_row_graph, GraphPropertyTag>::type& value);
|
||||
</pre>
|
||||
|
||||
<p class="indent">
|
||||
Set the property specified by <tt>GraphPropertyTag</tt> that
|
||||
is attached to the graph object <tt>g</tt>.
|
||||
</p>
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<h3><a name="incremental-construction-functions">Incremental construction functions</a></h3>
|
||||
|
||||
<pre><a name="add_vertex"></a>
|
||||
vertex_descriptor add_vertex(compressed_sparse_row_graph& g)
|
||||
</pre>
|
||||
|
||||
<p class="indent">
|
||||
Add a new vertex to the end of the graph <tt>g</tt>, and return a
|
||||
descriptor for that vertex. The new vertex will be greater than any of
|
||||
the previous vertices in <tt>g</tt>.
|
||||
</p>
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<pre><a name="add_vertices"></a>
|
||||
vertex_descriptor add_vertices(vertices_size_type count, compressed_sparse_row_graph& g)
|
||||
</pre>
|
||||
|
||||
<p class="indent">
|
||||
Add <tt>count</tt> new vertices to the end of the graph <tt>g</tt>, and
|
||||
return a descriptor for the smallest new vertex. The new vertices will
|
||||
be greater than any of the previous vertices in <tt>g</tt>.
|
||||
</p>
|
||||
|
||||
<hr></hr>
|
||||
|
||||
<pre><a name="add_edge"></a>
|
||||
edge_descriptor add_edge(vertex_descriptor src, vertex_descriptor tgt, compressed_sparse_row_graph& g)
|
||||
</pre>
|
||||
|
||||
<p class="indent">
|
||||
Add a new edge from <tt>src</tt> to <tt>tgt</tt> in the graph <tt>g</tt>,
|
||||
and return a descriptor for it. There must not be an edge in <tt>g</tt>
|
||||
whose source vertex is greater than <tt>src</tt>. If the vertex
|
||||
<tt>src</tt> has out edges before this operation is called, there must be
|
||||
none whose target is larger than <tt>tgt</tt>.
|
||||
</p>
|
||||
|
||||
<hr></hr>
|
||||
<a name="example"></a><h2>Example</h2>
|
||||
|
||||
<br>[<a
|
||||
href="../example/csr-example.cpp">libs/graph/example/csr-example.cpp</a>]
|
||||
|
||||
<p>We will use the <tt>compressed_sparse_row_graph</tt> graph
|
||||
class to store a simple Web graph. In this web graph the vertices
|
||||
represent web pages and the edges represent links from one web
|
||||
page to another. With each web page we want to associate a URL, so
|
||||
we initially create a <tt>WebPage</tt> class that stores the
|
||||
URL. Then we can create our graph type by providing
|
||||
<tt>WebPage</tt> as a parameter to the
|
||||
<tt>compressed_sparse_row_graph</tt> class template.</p>
|
||||
|
||||
<pre>
|
||||
class WebPage
|
||||
{
|
||||
public:
|
||||
std::string url;
|
||||
};
|
||||
|
||||
// ...
|
||||
|
||||
typedef compressed_sparse_row_graph<directedS, WebPage> WebGraph;
|
||||
WebGraph g(&the_edges[0], &the_edges[0] + sizeof(the_edges)/sizeof(E), 6);
|
||||
</pre>
|
||||
|
||||
<p>We can then set the properties on the vertices of the graph
|
||||
using the <a href="bundles.html">bundled properties</a> syntax,
|
||||
and display the edges for the user.</p>
|
||||
|
||||
<pre>
|
||||
// Set the URLs of each vertex
|
||||
int index = 0;
|
||||
BGL_FORALL_VERTICES(v, g, WebGraph)
|
||||
g[v].url = urls[index++];
|
||||
|
||||
// Output each of the links
|
||||
std::cout << "The web graph:" << std::endl;
|
||||
BGL_FORALL_EDGES(e, g, WebGraph)
|
||||
std::cout << " " << g[source(e, g)].url << " -> " << g[target(e, g)].url
|
||||
<< std::endl;
|
||||
</pre>
|
||||
|
||||
<p>See the <a href="../example/csr-example.cpp">complete example
|
||||
source</a> for other operations one can perform with a
|
||||
<tt>compressed_sparse_row_graph</tt>.</p>
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2005</TD><TD>
|
||||
<A HREF="../../../people/doug_gregor.html">Doug Gregor</A>, Indiana University (<script language="Javascript">address("cs.indiana.edu", "dgregor")</script>)<br>
|
||||
Jeremiah Willcock, Indiana University (<script language="Javascript">address("osl.iu.edu", "jewillco")</script>)<br>
|
||||
<A HREF=http://www.osl.iu.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Indiana University (<script language="Javascript">address("osl.iu.edu", "lums")</script>)
|
||||
</TD></TR></TABLE>
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000-2001
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Jeremy Siek makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Connected Components</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
@@ -22,6 +18,7 @@
|
||||
|
||||
<H1>
|
||||
<A NAME="sec:connected-components">
|
||||
<img src="figs/python.gif" alt="(Python)"/>
|
||||
<TT>connected_components</TT></A>
|
||||
</H1>
|
||||
|
||||
@@ -65,7 +62,9 @@ IN: <tt>const Graph& g</tt>
|
||||
<blockquote>
|
||||
An undirected graph. The graph type must be a model of <a
|
||||
href="VertexListGraph.html">Vertex List Graph</a> and <a
|
||||
href="IncidenceGraph.html">Incidence Graph</a>.
|
||||
href="IncidenceGraph.html">Incidence Graph</a>.<br>
|
||||
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
</blockquote>
|
||||
|
||||
OUT: <tt>ComponentMap c</tt>
|
||||
@@ -78,7 +77,10 @@ recording the component number in the component property map. The
|
||||
href="../../property_map/WritablePropertyMap.html">Writable Property
|
||||
Map</a>. The value type shouch be an integer type, preferably the same
|
||||
as the <tt>vertices_size_type</tt> of the graph. The key type must be
|
||||
the graph's vertex descriptor type.
|
||||
the graph's vertex descriptor type.<br>
|
||||
|
||||
<b>Python</b>: Must be an <tt>vertex_int_map</tt> for the graph.<br>
|
||||
<b>Python default</b>: <tt>graph.get_vertex_int_map("component")</tt>
|
||||
</blockquote>
|
||||
|
||||
<h3>Named Parameters</h3>
|
||||
@@ -96,7 +98,9 @@ UTIL: <tt>color_map(ColorMap color)</tt>
|
||||
</tt>iterator_property_map</tt></a> created from a
|
||||
<tt>std::vector</tt> of <tt>default_color_type</tt> of size
|
||||
<tt>num_vertices(g)</tt> and using the <tt>i_map</tt> for the index
|
||||
map.
|
||||
map.<br>
|
||||
<b>Python</b>: The color map must be a <tt>vertex_color_map</tt> for
|
||||
the graph.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
@@ -110,7 +114,13 @@ IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
vertex descriptor type of the graph needs to be usable as the key
|
||||
type of the map.<br>
|
||||
|
||||
<b>Default:</b> <tt>get(vertex_index, g)</tt>
|
||||
<b>Default:</b> <tt>get(vertex_index, g)</tt>.
|
||||
Note: if you use this default, make sure your graph has
|
||||
an internal <tt>vertex_index</tt> property. For example,
|
||||
<tt>adjacenty_list</tt> with <tt>VertexList=listS</tt> does
|
||||
not have an internal <tt>vertex_index</tt> property.<br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Constructing Graph Algorithms</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Jeremy Siek makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Copy Graph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
@@ -79,9 +75,13 @@ IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
The vertex index map type must be a model of <a
|
||||
href="../../property_map/ReadablePropertyMap.html">Readable Property
|
||||
Map</a> and must map the vertex descriptors of <tt>G</tt> to the
|
||||
integers from 0 to <tt>num_vertices(G)</tt>.<br>
|
||||
integers in the half-open range <tt>[0,num_vertices(G))</tt>.<br>
|
||||
|
||||
<b>Default:</b> <tt>get(vertex_index, G)</tt>
|
||||
<b>Default:</b> <tt>get(vertex_index, G)</tt>.
|
||||
Note: if you use this default, make sure your graph has
|
||||
an internal <tt>vertex_index</tt> property. For example,
|
||||
<tt>adjacenty_list</tt> with <tt>VertexList=listS</tt> does
|
||||
not have an internal <tt>vertex_index</tt> property.
|
||||
</blockquote>
|
||||
|
||||
|
||||
|
||||
@@ -1,25 +1,23 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-->
|
||||
<Head>
|
||||
|
||||
<!-- Copyright (c) Jeremy Siek 2000 -->
|
||||
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Cuthill-Mckee Ordering</Title>
|
||||
</Head>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1><A NAME="sec:bfs">
|
||||
<H1>
|
||||
<img src="figs/python.gif" alt="(Python)"/>
|
||||
<TT>cuthill_mckee_ordering</TT>
|
||||
</H1>
|
||||
|
||||
@@ -34,7 +32,7 @@
|
||||
<TD ALIGN="LEFT">color, degree</TD>
|
||||
</TR>
|
||||
<TR><TH ALIGN="LEFT"><B>Complexity:</B></TH>
|
||||
<TD ALIGN="LEFT">time: <i>O(log(m)|E|)</i> where <i>m = max { degree(v) | v in V }</i> </TD>
|
||||
<TD ALIGN="LEFT">time: <i>O(m log(m)|V|)</i> where <i>m = max { degree(v) | v in V }</i> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</DIV>
|
||||
@@ -44,17 +42,36 @@
|
||||
(1)
|
||||
template <class IncidenceGraph, class OutputIterator,
|
||||
class ColorMap, class DegreeMap>
|
||||
void
|
||||
cuthill_mckee_ordering(IncidenceGraph& g,
|
||||
OutputIterator
|
||||
cuthill_mckee_ordering(const IncidenceGraph& g,
|
||||
typename graph_traits<Graph>::vertex_descriptor s,
|
||||
OutputIterator inverse_permutation,
|
||||
ColorMap color, DegreeMap degree)
|
||||
|
||||
(2)
|
||||
template <class VertexListGraph, class OutputIterator>
|
||||
OutputIterator
|
||||
cuthill_mckee_ordering(const VertexIndexMap& G, OutputIterator inverse_permutation);
|
||||
|
||||
template <class VertexListGraph, class OutputIterator, class VertexIndexMap>
|
||||
OutputIterator
|
||||
cuthill_mckee_ordering(const VertexIndexMap& G, OutputIterator inverse_permutation,
|
||||
VertexIndexMap index_map);
|
||||
|
||||
template <class VertexListGraph, class OutputIterator,
|
||||
class ColorMap, class DegreeMap>
|
||||
void
|
||||
cuthill_mckee_ordering(VertexListGraph& G, OutputIterator inverse_permutation,
|
||||
OutputIterator
|
||||
cuthill_mckee_ordering(const VertexListGraph& G, OutputIterator inverse_permutation,
|
||||
ColorMap color, DegreeMap degree)
|
||||
|
||||
(3)
|
||||
template <class IncidenceGraph, class OutputIterator,
|
||||
class ColorMap, class DegreeMap>
|
||||
OutputIterator
|
||||
cuthill_mckee_ordering(const IncidenceGraph& g,
|
||||
std::deque< typename
|
||||
graph_traits<Graph>::vertex_descriptor > vertex_queue,
|
||||
OutputIterator inverse_permutation,
|
||||
ColorMap color, DegreeMap degree)
|
||||
</pre>
|
||||
|
||||
@@ -62,7 +79,7 @@ The goal of the Cuthill-Mckee (and reverse Cuthill-Mckee) ordering
|
||||
algorithm[<A
|
||||
HREF="bibliography.html#george81:__sparse_pos_def">14</A>, <A
|
||||
HREF="bibliography.html#cuthill69:reducing_bandwith">43</A>, <a
|
||||
href="bibliography.html#liu75:rcm">44</a>, <a
|
||||
href="bibliography.html#liu75:anal_cm_rcm">44</a>, <a
|
||||
href="bibliography.html#george71:fem">45</a> ] is to reduce the <a
|
||||
href="./bandwidth.html">bandwidth</a> of a graph by reordering the
|
||||
indices assigned to each vertex. The Cuthill-Mckee ordering algorithm
|
||||
@@ -73,9 +90,13 @@ increasing degree.
|
||||
|
||||
<p>
|
||||
Version 1 of the algorithm lets the user choose the ``starting
|
||||
vertex'' whereas version 2 finds a good starting vertex using the
|
||||
pseudo-peripheral pair heuristic. The choice of the ``starting
|
||||
vertex'' can have a significant effect on the quality of the ordering.
|
||||
vertex'', version 2 finds a good starting vertex using the
|
||||
pseudo-peripheral pair heuristic (among each component), while version 3
|
||||
contains the starting nodes for each vertex in the deque. The choice of the
|
||||
``starting vertex'' can have a significant effect on the quality of the
|
||||
ordering. For versions 2 and 3, <tt>find_starting_vertex</tt> will be called
|
||||
for each component in the graph, increasing run time significantly.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The output of the algorithm are the vertices in the new ordering.
|
||||
@@ -83,15 +104,17 @@ Depending on what kind of output iterator you use, you can get either
|
||||
the Cuthill-Mckee ordering or the reverse Cuthill-McKee ordering. For
|
||||
example, if you store the output into a vector using the vector's
|
||||
reverse iterator, then you get the reverse Cuthill-McKee ordering.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
std::vector<vertex_descriptor> inv_perm(num_vertices(G));
|
||||
cuthill_mckee_ordering(G, inv_perm.rbegin());
|
||||
cuthill_mckee_ordering(G, inv_perm.rbegin(), ...);
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Either way, storing the output into a vector gives you the
|
||||
permutation from the new ordering to the old ordering.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
inv_perm[new_index[u]] == u
|
||||
@@ -101,6 +124,7 @@ permutation from the new ordering to the old ordering.
|
||||
Often times, it is the opposite permutation that you want, the
|
||||
permutation from the old index to the new index. This can easily be
|
||||
computed in the following way.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
for (size_type i = 0; i != inv_perm.size(); ++i)
|
||||
@@ -117,23 +141,28 @@ For version 1:
|
||||
|
||||
<li> <tt>IncidenceGraph& g</tt> (IN) <br>
|
||||
An undirected graph. The graph's type must be a model of <a
|
||||
href="./IncidenceGraph.html">IncidenceGraph</a>.
|
||||
href="./IncidenceGraph.html">IncidenceGraph</a>.<br>
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
|
||||
<li> <tt>vertex_descriptor s</tt>  (IN) <br>
|
||||
The starting vertex.
|
||||
The starting vertex.<br>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
|
||||
<li> <tt>OutputIterator inverse_permutation</tt>  (OUT) <br>
|
||||
The new vertex ordering. The vertices are written to the <a
|
||||
href="http://www.sgi.com/tech/stl/OutputIterator.html">output
|
||||
iterator</a> in their new order.
|
||||
iterator</a> in their new order.<br>
|
||||
<b>Python</b>: This parameter is unused in Python. The new vertex
|
||||
ordering is returned as a Python <tt>list</tt>.
|
||||
|
||||
<li> <tt>ColorMap color_map</tt>  (WORK) <br>
|
||||
Used internally to keep track of the progress of the algorithm
|
||||
(to avoid visiting the same vertex twice).
|
||||
(to avoid visiting the same vertex twice).<br>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
|
||||
<li> <tt>DegreeMap degree_map</tt>  (IN) <br>
|
||||
This must map vertices to their degree.
|
||||
|
||||
This must map vertices to their degree.<br>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -143,23 +172,59 @@ For version 2:
|
||||
|
||||
<li> <tt>VertexListGraph& g</tt> (IN) <br>
|
||||
An undirected graph. The graph's type must be a model of <a
|
||||
href="./VertexListGraph.html">VertexListGraph</a>.
|
||||
href="./VertexListGraph.html">VertexListGraph</a>.<br>
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
|
||||
<li> <tt><a href="http://www.sgi.com/tech/stl/OutputIterator.html">
|
||||
OutputIterator</a> inverse_permutation</tt>  (OUT) <br>
|
||||
The new vertex ordering. The vertices are written to the
|
||||
output iterator in their new order.
|
||||
output iterator in their new order.<br>
|
||||
<b>Python</b>: This parameter is unused in Python. The new vertex
|
||||
ordering is returned as a Python <tt>list</tt>.
|
||||
|
||||
<li> <tt>ColorMap color_map</tt>  (WORK) <br>
|
||||
Used internally to keep track of the progress of the algorithm
|
||||
(to avoid visiting the same vertex twice).
|
||||
(to avoid visiting the same vertex twice).<br>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
|
||||
<li> <tt>DegreeMap degree_map</tt>  (IN) <br>
|
||||
This must map vertices to their degree.
|
||||
|
||||
This must map vertices to their degree.<br>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</ul>
|
||||
|
||||
|
||||
For version 3:
|
||||
|
||||
<ul>
|
||||
|
||||
<li> <tt>IncidenceGraph& g</tt> (IN) <br>
|
||||
An undirected graph. The graph's type must be a model of <a
|
||||
href="./IncidenceGraph.html">IncidenceGraph</a>.<br>
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
|
||||
<li> <tt> std::deque< typename graph_traits<Graph>::vertex_descriptor > vertex_queue </tt>  (IN) <br>
|
||||
The deque containing the starting vertices for each component.<br>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
|
||||
<li> <tt>OutputIterator inverse_permutation</tt>  (OUT) <br>
|
||||
The new vertex ordering. The vertices are written to the <a
|
||||
href="http://www.sgi.com/tech/stl/OutputIterator.html">output
|
||||
iterator</a> in their new order.<br>
|
||||
<b>Python</b>: This parameter is unused in Python. The new vertex
|
||||
ordering is returned as a Python <tt>list</tt>.
|
||||
|
||||
<li> <tt>ColorMap color_map</tt>  (WORK) <br>
|
||||
Used internally to keep track of the progress of the algorithm
|
||||
(to avoid visiting the same vertex twice).<br>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
|
||||
<li> <tt>DegreeMap degree_map</tt>  (IN) <br>
|
||||
This must map vertices to their degree.<br>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<h3>Example</h3>
|
||||
|
||||
See <a
|
||||
|
||||
@@ -2,24 +2,21 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Jeremy Siek makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Directed Acyclic Graph Shortest Paths</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1><A NAME="sec:dag_shortest_paths"></A>
|
||||
<img src="figs/python.gif" alt="(Python)"/>
|
||||
<TT>dag_shortest_paths</TT>
|
||||
</H1>
|
||||
|
||||
@@ -53,7 +50,7 @@ than either the Dijkstra or Bellman-Ford algorithm.
|
||||
Use breadth-first search instead of this algorithm
|
||||
when all edge weights are equal to one. For the definition of the
|
||||
shortest-path problem see Section <A
|
||||
HREF="graph_theory_review.html#sec:shortest-path-algorithms">Shortest-Paths
|
||||
HREF="graph_theory_review.html#sec:shortest-paths-algorithms">Shortest-Paths
|
||||
Algorithms</A> for some background to the shortest-path problem.
|
||||
</P>
|
||||
|
||||
@@ -80,13 +77,17 @@ algorithm's event points.</P>
|
||||
IN: <tt>const VertexListGraph& g</tt>
|
||||
<blockquote>
|
||||
The graph object on which the algorithm will be applied.
|
||||
The type <tt>VertexListGraph</tt> must be a model of \concept{VertexListGraph}.
|
||||
The type <tt>VertexListGraph</tt> must be a model of \concept{VertexListGraph}.<br>
|
||||
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_descriptor s</tt>
|
||||
<blockquote>
|
||||
The source vertex. All distance will be calculated from this vertex,
|
||||
and the shortest paths tree will be rooted at this vertex.
|
||||
and the shortest paths tree will be rooted at this vertex.<br>
|
||||
|
||||
<b>Python</b>: The parameter is named <tt>root_vertex</tt>.
|
||||
</blockquote>
|
||||
|
||||
<h3>Named Parameters</h3>
|
||||
@@ -99,7 +100,10 @@ IN: <tt>weight_map(WeightMap w_map)</tt>
|
||||
the graph needs to be usable as the key type for the weight
|
||||
map. The value type for the map must be
|
||||
<i>Addable</i> with the value type of the distance map.<br>
|
||||
<b>Default:</b> <tt>get(edge_weight, g)</tt>
|
||||
<b>Default:</b> <tt>get(edge_weight, g)</tt><br>
|
||||
<b>Python</b>: Must be an <tt>edge_double_map</tt> for the graph.<br>
|
||||
<b>Python default</b>: <tt>graph.get_edge_double_map("weight")</tt>
|
||||
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
@@ -111,7 +115,13 @@ IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
<a href="../../property_map/ReadablePropertyMap.html">Readable Property Map</a>. The value type of the map must be an
|
||||
integer type. The vertex descriptor type of the graph needs to be
|
||||
usable as the key type of the map.<br>
|
||||
<b>Default:</b> <tt>get(vertex_index, g)</tt>
|
||||
<b>Default:</b> <tt>get(vertex_index, g)</tt>.
|
||||
Note: if you use this default, make sure your graph has
|
||||
an internal <tt>vertex_index</tt> property. For example,
|
||||
<tt>adjacenty_list</tt> with <tt>VertexList=listS</tt> does
|
||||
not have an internal <tt>vertex_index</tt> property.<br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
|
||||
@@ -125,7 +135,8 @@ OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
|
||||
href="../../property_map/ReadWritePropertyMap.html">Read/Write
|
||||
Property Map</a> which key and vertex types the same as the vertex
|
||||
descriptor type of the graph.<br>
|
||||
<b>Default:</b> <tt>dummy_property_map</tt>
|
||||
<b>Default:</b> <tt>dummy_property_map</tt><br>
|
||||
<b>Python</b>: Must be a <tt>vertex_vertex_map</tt> for the graph.<br>
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>distance_map(DistanceMap d_map)</tt>
|
||||
@@ -150,7 +161,9 @@ UTIL/OUT: <tt>distance_map(DistanceMap d_map)</tt>
|
||||
<tt>iterator_property_map</tt></a> created from a
|
||||
<tt>std::vector</tt> of the <tt>WeightMap</tt>'s value type of size
|
||||
<tt>num_vertices(g)</tt> and using the <tt>i_map</tt> for the index
|
||||
map.
|
||||
map.<br>
|
||||
|
||||
<b>Python</b>: Must be a <tt>vertex_double_map</tt> for the graph.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_compare(CompareFunction cmp)</tt>
|
||||
@@ -164,7 +177,9 @@ IN: <tt>distance_compare(CompareFunction cmp)</tt>
|
||||
|
||||
<b>Default:</b>
|
||||
<tt>std::less<D></tt> with <tt>D=typename
|
||||
property_traits<DistanceMap>::value_type</tt>
|
||||
property_traits<DistanceMap>::value_type</tt><br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_combine(CombineFunction cmb)</tt>
|
||||
@@ -179,7 +194,9 @@ IN: <tt>distance_combine(CombineFunction cmb)</tt>
|
||||
type as the distance value type.<br>
|
||||
|
||||
<b>Default:</b> <tt>std::plus<D></tt> with
|
||||
<tt>D=typename property_traits<DistanceMap>::value_type</tt>
|
||||
<tt>D=typename property_traits<DistanceMap>::value_type</tt><br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_inf(D inf)</tt>
|
||||
@@ -187,7 +204,9 @@ IN: <tt>distance_inf(D inf)</tt>
|
||||
The <tt>inf</tt> object must be the greatest value of any <tt>D</tt> object.
|
||||
That is, <tt>compare(d, inf) == true</tt> for any <tt>d != inf</tt>.
|
||||
The type <tt>D</tt> is the value type of the <tt>DistanceMap</tt>.<br>
|
||||
<b>Default:</b> <tt>std::numeric_limits<D>::max()</tt>
|
||||
<b>Default:</b> <tt>std::numeric_limits<D>::max()</tt><br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_zero(D zero)</tt>
|
||||
@@ -196,7 +215,9 @@ IN: <tt>distance_zero(D zero)</tt>
|
||||
<a href="./Monoid.html">Monoid</a> formed by the distance values
|
||||
and the <tt>combine</tt> function object.
|
||||
The type \code{D} is the value type of the \code{DistanceMap}
|
||||
<b>Default:</b> <tt>D()</tt>
|
||||
<b>Default:</b> <tt>D()</tt><br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>color_map(ColorMap c_map)</tt>
|
||||
@@ -215,7 +236,11 @@ UTIL/OUT: <tt>color_map(ColorMap c_map)</tt>
|
||||
href="../../property_map/iterator_property_map.html">
|
||||
<tt>iterator_property_map</tt></a> created from a <tt>std::vector</tt>
|
||||
of <tt>default_color_type</tt> of size <tt>num_vertices(g)</tt> and
|
||||
using the <tt>i_map</tt> for the index map.
|
||||
using the <tt>i_map</tt> for the index map.<br>
|
||||
|
||||
<b>Python</b>: The color map must be a <tt>vertex_color_map</tt> for
|
||||
the graph.
|
||||
|
||||
</blockquote>
|
||||
|
||||
OUT: <tt>visitor(DijkstraVisitor v)</tt>
|
||||
@@ -226,7 +251,12 @@ OUT: <tt>visitor(DijkstraVisitor v)</tt>
|
||||
<a href="./DijkstraVisitor.html">Dijkstra Visitor</a> concept.
|
||||
The visitor object is passed by value <a
|
||||
href="#1">[1]</a>.<br>
|
||||
<b>Default:</b> <tt>dijkstra_visitor<null_visitor></tt>
|
||||
<b>Default:</b> <tt>dijkstra_visitor<null_visitor></tt><br>
|
||||
|
||||
<b>Python</b>: The parameter should be an object that derives from
|
||||
the <a
|
||||
href="DijkstraVisitor.html#python"><tt>DijkstraVisitor</tt></a> type
|
||||
of the graph.
|
||||
</blockquote>
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,231 @@
|
||||
/*
|
||||
:Author: David Goodger
|
||||
:Contact: goodger@users.sourceforge.net
|
||||
:date: $Date$
|
||||
:version: $Revision$
|
||||
:copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
|
||||
-- Copyright (c) 2005 Trustees of Indiana University
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
*/
|
||||
|
||||
.first {
|
||||
margin-top: 0 }
|
||||
|
||||
.last {
|
||||
margin-bottom: 0 }
|
||||
|
||||
a.toc-backref {
|
||||
text-decoration: none ;
|
||||
color: black }
|
||||
|
||||
dd {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
div.abstract {
|
||||
margin: 2em 5em }
|
||||
|
||||
div.abstract p.topic-title {
|
||||
font-weight: bold ;
|
||||
text-align: center }
|
||||
|
||||
div.attention, div.caution, div.danger, div.error, div.hint,
|
||||
div.important, div.note, div.tip, div.warning, div.admonition {
|
||||
margin: 2em ;
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.attention p.admonition-title, div.caution p.admonition-title,
|
||||
div.danger p.admonition-title, div.error p.admonition-title,
|
||||
div.warning p.admonition-title {
|
||||
color: red ;
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
div.hint p.admonition-title, div.important p.admonition-title,
|
||||
div.note p.admonition-title, div.tip p.admonition-title,
|
||||
div.admonition p.admonition-title {
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
div.dedication {
|
||||
margin: 2em 5em ;
|
||||
text-align: center ;
|
||||
font-style: italic }
|
||||
|
||||
div.dedication p.topic-title {
|
||||
font-weight: bold ;
|
||||
font-style: normal }
|
||||
|
||||
div.figure {
|
||||
margin-left: 2em }
|
||||
|
||||
div.footer, div.header {
|
||||
font-size: smaller }
|
||||
|
||||
div.sidebar {
|
||||
margin-left: 1em ;
|
||||
border: medium outset ;
|
||||
padding: 0em 1em ;
|
||||
background-color: #ffffee ;
|
||||
width: 40% ;
|
||||
float: right ;
|
||||
clear: right }
|
||||
|
||||
div.sidebar p.rubric {
|
||||
font-family: sans-serif ;
|
||||
font-size: medium }
|
||||
|
||||
div.system-messages {
|
||||
margin: 5em }
|
||||
|
||||
div.system-messages h1 {
|
||||
color: red }
|
||||
|
||||
div.system-message {
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.system-message p.system-message-title {
|
||||
color: red ;
|
||||
font-weight: bold }
|
||||
|
||||
div.topic {
|
||||
margin: 2em }
|
||||
|
||||
h1.title {
|
||||
text-align: center }
|
||||
|
||||
h2.subtitle {
|
||||
text-align: center }
|
||||
|
||||
hr {
|
||||
width: 75% }
|
||||
|
||||
ol.simple, ul.simple {
|
||||
margin-bottom: 1em }
|
||||
|
||||
ol.arabic {
|
||||
list-style: decimal }
|
||||
|
||||
ol.loweralpha {
|
||||
list-style: lower-alpha }
|
||||
|
||||
ol.upperalpha {
|
||||
list-style: upper-alpha }
|
||||
|
||||
ol.lowerroman {
|
||||
list-style: lower-roman }
|
||||
|
||||
ol.upperroman {
|
||||
list-style: upper-roman }
|
||||
|
||||
p.attribution {
|
||||
text-align: right ;
|
||||
margin-left: 50% }
|
||||
|
||||
p.caption {
|
||||
font-style: italic }
|
||||
|
||||
p.credits {
|
||||
font-style: italic ;
|
||||
font-size: smaller }
|
||||
|
||||
p.label {
|
||||
white-space: nowrap }
|
||||
|
||||
p.rubric {
|
||||
font-weight: bold ;
|
||||
font-size: larger ;
|
||||
color: maroon ;
|
||||
text-align: center }
|
||||
|
||||
p.sidebar-title {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold ;
|
||||
font-size: larger }
|
||||
|
||||
p.sidebar-subtitle {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
p.topic-title {
|
||||
font-weight: bold }
|
||||
|
||||
pre.address {
|
||||
margin-bottom: 0 ;
|
||||
margin-top: 0 ;
|
||||
font-family: serif ;
|
||||
font-size: 100% }
|
||||
|
||||
pre.line-block {
|
||||
font-family: serif ;
|
||||
font-size: 100% }
|
||||
|
||||
pre.literal-block, pre.doctest-block {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em ;
|
||||
background-color: #eeeeee }
|
||||
|
||||
span.classifier {
|
||||
font-family: sans-serif ;
|
||||
font-style: oblique }
|
||||
|
||||
span.classifier-delimiter {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
span.interpreted {
|
||||
font-family: sans-serif }
|
||||
|
||||
span.option {
|
||||
white-space: nowrap }
|
||||
|
||||
span.option-argument {
|
||||
font-style: italic }
|
||||
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic {
|
||||
color: red }
|
||||
|
||||
table {
|
||||
margin-top: 0.5em ;
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
table.citation {
|
||||
border-left: solid thin gray ;
|
||||
padding-left: 0.5ex }
|
||||
|
||||
table.docinfo {
|
||||
margin: 2em 4em }
|
||||
|
||||
table.footnote {
|
||||
border-left: solid thin black ;
|
||||
padding-left: 0.5ex }
|
||||
|
||||
td, th {
|
||||
padding-left: 0.5em ;
|
||||
padding-right: 0.5em ;
|
||||
vertical-align: top }
|
||||
|
||||
th.docinfo-name, th.field-name {
|
||||
font-weight: bold ;
|
||||
text-align: left ;
|
||||
white-space: nowrap }
|
||||
|
||||
h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
|
||||
font-size: 100% }
|
||||
|
||||
tt {
|
||||
background-color: #eeeeee }
|
||||
|
||||
ul.auto-toc {
|
||||
list-style-type: none }
|
||||
@@ -2,24 +2,20 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Depth-First Search</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1><A NAME="sec:depth-first-search"></A>
|
||||
<H1><A NAME="sec:depth-first-search"></A><img src="figs/python.gif" alt="(Python)"/>
|
||||
<TT>depth_first_search</TT>
|
||||
</H1>
|
||||
|
||||
@@ -164,7 +160,9 @@ IN: <tt>Graph& g</tt>
|
||||
<blockquote>
|
||||
A directed graph. The graph type must
|
||||
be a model of <a href="./IncidenceGraph.html">Incidence Graph</a>
|
||||
and <a href="./VertexListGraph.html">Vertex List Graph</a>.
|
||||
and <a href="./VertexListGraph.html">Vertex List Graph</a>.<br>
|
||||
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
</blockquote>
|
||||
|
||||
|
||||
@@ -176,7 +174,11 @@ IN: <tt>visitor(DFSVisitor vis)</tt>
|
||||
event-points specified by the <a href="./DFSVisitor.html">DFS
|
||||
Visitor</a> concept. The visitor object is passed by value <a
|
||||
href="#1">[1]</a>. <br> <b>Default:</b>
|
||||
<tt>dfs_visitor<null_visitor></tt>
|
||||
<tt>dfs_visitor<null_visitor></tt><br>
|
||||
|
||||
<b>Python</b>: The parameter should be an object that derives from
|
||||
the <a href="DFSVisitor.html#python"><tt>DFSVisitor</tt></a> type of
|
||||
the graph.
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>color_map(ColorMap color)</tt>
|
||||
@@ -192,7 +194,10 @@ UTIL/OUT: <tt>color_map(ColorMap color)</tt>
|
||||
</tt>iterator_property_map</tt></a> created from a
|
||||
<tt>std::vector</tt> of <tt>default_color_type</tt> of size
|
||||
<tt>num_vertices(g)</tt> and using the <tt>i_map</tt> for the index
|
||||
map.
|
||||
map.<br>
|
||||
|
||||
<b>Python</b>: The color map must be a <tt>vertex_color_map</tt> for
|
||||
the graph.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>root_vertex(typename
|
||||
@@ -201,7 +206,7 @@ graph_traits<VertexListGraph>::vertex_descriptor start)</tt>
|
||||
This specifies the vertex that the depth-first search should
|
||||
originate from. The type is the type of a vertex descriptor for the
|
||||
given graph.<br>
|
||||
<b>Default:</b> <tt>*vertices(g).first</tt>
|
||||
<b>Default:</b> <tt>*vertices(g).first</tt><br>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
@@ -215,7 +220,13 @@ IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
vertex descriptor type of the graph needs to be usable as the key
|
||||
type of the map.<br>
|
||||
|
||||
<b>Default:</b> <tt>get(vertex_index, g)</tt>
|
||||
<b>Default:</b> <tt>get(vertex_index, g)</tt>.
|
||||
Note: if you use this default, make sure your graph has
|
||||
an internal <tt>vertex_index</tt> property. For example,
|
||||
<tt>adjacenty_list</tt> with <tt>VertexList=listS</tt> does
|
||||
not have an internal <tt>vertex_index</tt> property.<br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
<P>
|
||||
|
||||
@@ -2,36 +2,33 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Depth-First Visit</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H2><A NAME="sec:dfs"></A>
|
||||
<img src="figs/python.gif" alt="(Python)"/>
|
||||
<TT>depth_first_visit</TT>
|
||||
</H2>
|
||||
|
||||
|
||||
<P>
|
||||
<PRE>
|
||||
template <class <a href="./IncidenceGraph.html">IncidenceGraph</a>, class <a href="./DFSVisitor.html">DFSVisitor</a>, class <a href="#ColorMap">ColorMap</a>>
|
||||
template <class <a href="./IncidenceGraph.html">IncidenceGraph</a>, class <a href="./DFSVisitor.html">DFSVisitor</a>, class ColorMap>
|
||||
void depth_first_visit(IncidenceGraph& g,
|
||||
typename graph_traits<IncidenceGraph>::vertex_descriptor s,
|
||||
DFSVisitor& vis, ColorMap color)
|
||||
|
||||
template <class <a href="./IncidenceGraph.html">IncidenceGraph</a>, class <a href="./DFSVisitor.html">DFSVisitor</a>, class <a href="#ColorMap">ColorMap</a>,
|
||||
template <class <a href="./IncidenceGraph.html">IncidenceGraph</a>, class <a href="./DFSVisitor.html">DFSVisitor</a>, class ColorMap,
|
||||
class TerminatorFunc>
|
||||
void depth_first_visit(IncidenceGraph& g,
|
||||
typename graph_traits<IncidenceGraph>::vertex_descriptor s,
|
||||
@@ -54,16 +51,6 @@ actions are taken at each event-point within the algorithm.
|
||||
The <tt>ColorMap</tt> is used by the algorithm to keep track
|
||||
of which vertices have been visited.
|
||||
|
||||
<p>
|
||||
The <tt>func</tt> parameter for the second variant of the algorithm is used to
|
||||
prevent the search to proceed past some vertices. It should be functional
|
||||
object callable with two parameters - the descriptor of vertex and the
|
||||
graph instance - and returing bool.
|
||||
|
||||
<p>The call is made immediately after call to 'discover_vertex' visitor
|
||||
event. If <tt>true</tt> is returned, the out edges of the vertex are not
|
||||
examined, as if they don't exist.
|
||||
|
||||
<p>The second variant can be used, for example, to find all marked vertices
|
||||
reachable from a start vertex by a path which does not contain any another
|
||||
marked vertices.
|
||||
@@ -81,12 +68,16 @@ marked vertices.
|
||||
IN <tt>IncidenceGraph& g</tt>
|
||||
<blockquote>
|
||||
A directed or undirected graph. The graph's type must be a model of
|
||||
<a href="./IncidenceGraph.html">Incidence Graph</a>.
|
||||
<a href="./IncidenceGraph.html">Incidence Graph</a>.<br>
|
||||
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_descriptor s</tt>
|
||||
<blockquote>
|
||||
The source vertex from which to start the search.
|
||||
The source vertex from which to start the search.<br>
|
||||
|
||||
<b>Python</b>: The parameter is named <tt>root_vertex</tt>.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>DFSVisitor visitor</tt>
|
||||
@@ -94,7 +85,11 @@ IN: <tt>DFSVisitor visitor</tt>
|
||||
A visitor object that is invoked inside the algorithm at the
|
||||
event-points specified by the <a href="./DFSVisitor.html">DFS
|
||||
Visitor</a> concept. The visitor object is passed by value <a
|
||||
href="#1">[1]</a>.
|
||||
href="#1">[1]</a>.<br>
|
||||
|
||||
<b>Python</b>: The parameter should be an object that derives from
|
||||
the <a href="DFSVisitor.html#python"><tt>DFSVisitor</tt></a> type of
|
||||
the graph.
|
||||
</blockquote>
|
||||
|
||||
UTIL: <tt>ColorMap color</tt>
|
||||
@@ -104,9 +99,22 @@ UTIL: <tt>ColorMap color</tt>
|
||||
href="../../property_map/ReadWritePropertyMap.html">Read/Write
|
||||
Property Map</a> and its key type must be the graph's vertex
|
||||
descriptor type and the value type of the color map map must model
|
||||
<a href="./ColorValue.html">Color Value</a>.
|
||||
<a href="./ColorValue.html">Color Value</a>.<br>
|
||||
|
||||
<b>Python</b>: The color map must be a <tt>vertex_color_map</tt> for
|
||||
the graph.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>TerminatorFunc func</tt>
|
||||
<blockquote>
|
||||
A function object callable with two parameters - the descriptor of
|
||||
vertex and the graph instance - and returning bool. The call is made
|
||||
immediately after call to 'discover_vertex' visitor
|
||||
event. If <tt>true</tt> is returned, the out edges of the vertex are
|
||||
not examined, as if they don't exist.<br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
<P>
|
||||
|
||||
<h3>Complexity</h3>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: dfs_visitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,24 +2,20 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Jeremy Siek makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Dijkstra's Shortest Paths</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1><A NAME="sec:dijkstra"></A>
|
||||
<H1><A NAME="sec:dijkstra"></A><img src="figs/python.gif" alt="(Python)"/>
|
||||
<TT>dijkstra_shortest_paths</TT>
|
||||
</H1>
|
||||
|
||||
@@ -37,14 +33,14 @@ dijkstra_shortest_paths(Graph& g,
|
||||
template <typename Graph, typename <a href="DijkstraVisitor.html">DijkstraVisitor</a>,
|
||||
typename PredecessorMap, typename DistanceMap,
|
||||
typename WeightMap, typename VertexIndexMap, typename <a href="http://www.sgi.com/tech/stl/BinaryPredicate.html">CompareFunction</a>, typename <a href="http://www.sgi.com/tech/stl/BinaryFunction.html">CombineFunction</a>,
|
||||
typename DistInf, typename DistZero>
|
||||
typename DistInf, typename DistZero, typename ColorMap = <i>default</i>>
|
||||
void dijkstra_shortest_paths
|
||||
(const Graph& g,
|
||||
typename graph_traits<Graph>::vertex_descriptor s,
|
||||
PredecessorMap predecessor, DistanceMap distance, WeightMap weight,
|
||||
VertexIndexMap index_map,
|
||||
CompareFunction compare, CombineFunction combine, DistInf inf, DistZero zero,
|
||||
DijkstraVisitor vis)
|
||||
DijkstraVisitor vis, ColorMap color = <i>default</i>)
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
@@ -56,7 +52,7 @@ algorithm for the case when some edge weights are negative. Use
|
||||
breadth-first search instead of Dijkstra's algorithm when all edge
|
||||
weights are equal to one. For the definition of the shortest-path
|
||||
problem see Section <A
|
||||
HREF="graph_theory_review.html#sec:shortest-path-algorithms">Shortest-Paths
|
||||
HREF="graph_theory_review.html#sec:shortest-paths-algorithms">Shortest-Paths
|
||||
Algorithms</A> for some background to the shortest-path problem.
|
||||
</P>
|
||||
|
||||
@@ -184,13 +180,17 @@ IN: <tt>const Graph& g</tt>
|
||||
The graph object on which the algorithm will be applied.
|
||||
The type <tt>Graph</tt> must be a model of
|
||||
<a href="./VertexListGraph.html">Vertex List Graph</a>
|
||||
and <a href="./IncidenceGraph.html">Incidence Graph</a>.
|
||||
and <a href="./IncidenceGraph.html">Incidence Graph</a>.<br>
|
||||
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_descriptor s</tt>
|
||||
<blockquote>
|
||||
The source vertex. All distance will be calculated from this vertex,
|
||||
and the shortest paths tree will be rooted at this vertex.
|
||||
and the shortest paths tree will be rooted at this vertex.<br>
|
||||
|
||||
<b>Python</b>: The parameter is named <tt>root_vertex</tt>.
|
||||
</blockquote>
|
||||
|
||||
<h3>Named Parameters</h3>
|
||||
@@ -206,19 +206,31 @@ IN: <tt>weight_map(WeightMap w_map)</tt>
|
||||
the graph needs to be usable as the key type for the weight
|
||||
map. The value type for this map must be
|
||||
the same as the value type of the distance map.<br>
|
||||
<b>Default:</b> <tt>get(edge_weight, g)</tt>
|
||||
<b>Default:</b> <tt>get(edge_weight, g)</tt><br>
|
||||
|
||||
<b>Python</b>: Must be an <tt>edge_double_map</tt> for the graph.<br>
|
||||
<b>Python default</b>: <tt>graph.get_edge_double_map("weight")</tt>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
<blockquote>
|
||||
This maps each vertex to an integer in the range <tt>[0,
|
||||
num_vertices(g))</tt>. This is necessary for efficient updates of the
|
||||
heap data structure when an edge is relaxed. The type
|
||||
heap data structure [<A
|
||||
HREF="bibliography.html#driscoll88">61</A>] when an edge is relaxed.
|
||||
The type
|
||||
<tt>VertexIndexMap</tt> must be a model of
|
||||
<a href="../../property_map/ReadablePropertyMap.html">Readable Property Map</a>. The value type of the map must be an
|
||||
integer type. The vertex descriptor type of the graph needs to be
|
||||
usable as the key type of the map.<br>
|
||||
<b>Default:</b> <tt>get(vertex_index, g)</tt>
|
||||
<b>Default:</b> <tt>get(vertex_index, g)</tt>.
|
||||
Note: if you use this default, make sure your graph has
|
||||
an internal <tt>vertex_index</tt> property. For example,
|
||||
<tt>adjacenty_list</tt> with <tt>VertexList=listS</tt> does
|
||||
not have an internal <tt>vertex_index</tt> property.
|
||||
<br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
|
||||
@@ -232,7 +244,9 @@ OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
|
||||
href="../../property_map/ReadWritePropertyMap.html">Read/Write
|
||||
Property Map</a> whose key and value types are the same as the vertex
|
||||
descriptor type of the graph.<br>
|
||||
<b>Default:</b> <tt>dummy_property_map</tt>
|
||||
<b>Default:</b> <tt>dummy_property_map</tt><br>
|
||||
|
||||
<b>Python</b>: Must be a <tt>vertex_vertex_map</tt> for the graph.<br>
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>distance_map(DistanceMap d_map)</tt>
|
||||
@@ -257,7 +271,9 @@ UTIL/OUT: <tt>distance_map(DistanceMap d_map)</tt>
|
||||
<tt>iterator_property_map</tt></a> created from a
|
||||
<tt>std::vector</tt> of the <tt>WeightMap</tt>'s value type of size
|
||||
<tt>num_vertices(g)</tt> and using the <tt>i_map</tt> for the index
|
||||
map.
|
||||
map.<br>
|
||||
|
||||
<b>Python</b>: Must be a <tt>vertex_double_map</tt> for the graph.<br>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_compare(CompareFunction cmp)</tt>
|
||||
@@ -271,7 +287,9 @@ IN: <tt>distance_compare(CompareFunction cmp)</tt>
|
||||
|
||||
<b>Default:</b>
|
||||
<tt>std::less<D></tt> with <tt>D=typename
|
||||
property_traits<DistanceMap>::value_type</tt>
|
||||
property_traits<DistanceMap>::value_type</tt><br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_combine(CombineFunction cmb)</tt>
|
||||
@@ -286,7 +304,9 @@ IN: <tt>distance_combine(CombineFunction cmb)</tt>
|
||||
type as the distance value type.<br>
|
||||
|
||||
<b>Default:</b> <tt>std::plus<D></tt> with
|
||||
<tt>D=typename property_traits<DistanceMap>::value_type</tt>
|
||||
<tt>D=typename property_traits<DistanceMap>::value_type</tt><br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_inf(D inf)</tt>
|
||||
@@ -294,7 +314,9 @@ IN: <tt>distance_inf(D inf)</tt>
|
||||
The <tt>inf</tt> object must be the greatest value of any <tt>D</tt> object.
|
||||
That is, <tt>compare(d, inf) == true</tt> for any <tt>d != inf</tt>.
|
||||
The type <tt>D</tt> is the value type of the <tt>DistanceMap</tt>.<br>
|
||||
<b>Default:</b> <tt>std::numeric_limits<D>::max()</tt>
|
||||
<b>Default:</b> <tt>std::numeric_limits<D>::max()</tt><br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_zero(D zero)</tt>
|
||||
@@ -304,7 +326,9 @@ IN: <tt>distance_zero(D zero)</tt>
|
||||
and the <tt>combine</tt> function object.
|
||||
The type <tt>D</tt> is the value type of the <tt>DistanceMap</tt>.<br>
|
||||
<b>Default:</b> <tt>D()</tt>with
|
||||
<tt>D=typename property_traits<DistanceMap>::value_type</tt>
|
||||
<tt>D=typename property_traits<DistanceMap>::value_type</tt><br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>color_map(ColorMap c_map)</tt>
|
||||
@@ -323,7 +347,10 @@ UTIL/OUT: <tt>color_map(ColorMap c_map)</tt>
|
||||
href="../../property_map/iterator_property_map.html">
|
||||
<tt>iterator_property_map</tt></a> created from a <tt>std::vector</tt>
|
||||
of <tt>default_color_type</tt> of size <tt>num_vertices(g)</tt> and
|
||||
using the <tt>i_map</tt> for the index map.
|
||||
using the <tt>i_map</tt> for the index map.<br>
|
||||
|
||||
<b>Python</b>: The color map must be a <tt>vertex_color_map</tt> for
|
||||
the graph.
|
||||
</blockquote>
|
||||
|
||||
OUT: <tt>visitor(DijkstraVisitor v)</tt>
|
||||
@@ -334,15 +361,20 @@ OUT: <tt>visitor(DijkstraVisitor v)</tt>
|
||||
<a href="./DijkstraVisitor.html">Dijkstra Visitor</a> concept.
|
||||
The visitor object is passed by value <a
|
||||
href="#2">[2]</a>.<br>
|
||||
<b>Default:</b> <tt>dijkstra_visitor<null_visitor></tt>
|
||||
<b>Default:</b> <tt>dijkstra_visitor<null_visitor></tt><br>
|
||||
|
||||
<b>Python</b>: The parameter should be an object that derives from
|
||||
the <a
|
||||
href="DijkstraVisitor.html#python"><tt>DijkstraVisitor</tt></a> type
|
||||
of the graph.
|
||||
</blockquote>
|
||||
|
||||
|
||||
<H3>Complexity</H3>
|
||||
|
||||
<P>
|
||||
The time complexity is <i>O((V + E) log V)</i>, or just <i>O(E log V)</i>
|
||||
if all vertices are reachable from the source.
|
||||
The time complexity is <i>O(V log V)</i>.
|
||||
|
||||
|
||||
<h3>Visitor Event Points</h3>
|
||||
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: dijkstra_visitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: distance_recorder</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Edge List Class</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Edmunds-Karp Maximum Flow</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
@@ -25,19 +21,19 @@
|
||||
|
||||
<PRE>
|
||||
<i>// named paramter version</i>
|
||||
template <class <a href="./VertexListGraph.html">VertexListGraph</a>, class P, class T, class R>
|
||||
typename detail::edge_capacity_value<VertexListGraph, P, T, R>::value_type
|
||||
edmunds_karp_max_flow(VertexListGraph& g,
|
||||
typename graph_traits<VertexListGraph>::vertex_descriptor src,
|
||||
typename graph_traits<VertexListGraph>::vertex_descriptor sink,
|
||||
template <class <a href="./Graph.html">Graph</a>, class P, class T, class R>
|
||||
typename detail::edge_capacity_value<Graph, P, T, R>::value_type
|
||||
edmunds_karp_max_flow(Graph& g,
|
||||
typename graph_traits<Graph>::vertex_descriptor src,
|
||||
typename graph_traits<Graph>::vertex_descriptor sink,
|
||||
const bgl_named_params<P, T, R>& params = <i>all defaults</i>)
|
||||
|
||||
<i>// non-named parameter version</i>
|
||||
template <class <a href="./VertexListGraph.html">VertexListGraph</a>,
|
||||
template <class <a href="./Graph.html">Graph</a>,
|
||||
class CapacityEdgeMap, class ResidualCapacityEdgeMap,
|
||||
class ReverseEdgeMap, class ColorMap, class PredEdgeMap>
|
||||
typename property_traits<CapacityEdgeMap>::value_type
|
||||
edmunds_karp_max_flow(VertexListGraph& g,
|
||||
edmunds_karp_max_flow(Graph& g,
|
||||
typename graph_traits<Graph>::vertex_descriptor src,
|
||||
typename graph_traits<Graph>::vertex_descriptor sink,
|
||||
CapacityEdgeMap cap, ResidualCapacityEdgeMap res, ReverseEdgeMap rev,
|
||||
@@ -101,11 +97,11 @@ algorithm.
|
||||
|
||||
<h3>Parameters</h3>
|
||||
|
||||
IN: <tt>VertexListGraph& g</tt>
|
||||
IN: <tt>Graph& g</tt>
|
||||
<blockquote>
|
||||
A directed graph. The
|
||||
graph's type must be a model of <a
|
||||
href="./VertexListGraph.html">VertexListGraph</a>. For each edge
|
||||
href="./VertexListGraph.html">VertexListGraph</a> and <a href="./IncidenceGraph.html">IncidenceGraph</a> For each edge
|
||||
<i>(u,v)</i> in the graph, the reverse edge <i>(v,u)</i> must also
|
||||
be in the graph.
|
||||
</blockquote>
|
||||
@@ -195,6 +191,10 @@ IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
Map</a>. The key type of the map must be the graph's vertex
|
||||
descriptor type.<br>
|
||||
<b>Default:</b> <tt>get(vertex_index, g)</tt>
|
||||
Note: if you use this default, make sure your graph has
|
||||
an internal <tt>vertex_index</tt> property. For example,
|
||||
<tt>adjacenty_list</tt> with <tt>VertexList=listS</tt> does
|
||||
not have an internal <tt>vertex_index</tt> property.
|
||||
</blockquote>
|
||||
|
||||
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
// Boost.Graph library isomorphism test
|
||||
|
||||
// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
|
||||
// Copyright (C) 2001 Douglas Gregor (gregod@cs.rpi.edu)
|
||||
//
|
||||
// Permission to copy, use, sell and distribute this software is granted
|
||||
// provided this copyright notice appears in all copies.
|
||||
// Permission to modify the code and to distribute modified code is granted
|
||||
// provided this copyright notice appears in all copies, and a notice
|
||||
// that the code was modified is included with the copyright notice.
|
||||
//
|
||||
// This software is provided "as is" without express or implied warranty,
|
||||
// and with no claim as to its suitability for any purpose.
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
//
|
||||
@@ -94,7 +89,7 @@ void test_isomorphism()
|
||||
std::vector<graph_traits<GraphB>::vertex_descriptor> f(num_vertices(Ga));
|
||||
|
||||
bool ret = isomorphism(Ga, Gb, &f[0], invariantA, invariantB,
|
||||
invariantB.max(),
|
||||
(invariantB.max)(),
|
||||
get(vertex_index, Ga), get(vertex_index, Gb));
|
||||
assert(ret == true);
|
||||
|
||||
@@ -107,5 +102,5 @@ void test_isomorphism()
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
test_isomorphism();
|
||||
return EXIT_SUCCESS;
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- Copyright (c) 2004, 2005 The Trustees of Indiana University
|
||||
--
|
||||
-- Use, modification and distribution is subject to the Boost Software
|
||||
-- License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
--
|
||||
-- Authors: Douglas Gregor
|
||||
-- Jeremiah Willcock
|
||||
-- Andrew Lumsdaine
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Erdös-Renyi Generator</Title>
|
||||
<script language="JavaScript" type="text/JavaScript">
|
||||
<!--
|
||||
function address(host, user) {
|
||||
var atchar = '@';
|
||||
var thingy = user+atchar+host;
|
||||
thingy = '<a hre' + 'f=' + "mai" + "lto:" + thingy + '>' + user+atchar+host + '</a>';
|
||||
document.write(thingy);
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<tt>erdos_renyi_iterator</tt>
|
||||
|
||||
<br>
|
||||
|
||||
<PRE>
|
||||
template<typename RandomGenerator, typename Graph>
|
||||
class erdos_renyi_iterator
|
||||
{
|
||||
public:
|
||||
typedef std::input_iterator_tag iterator_category;
|
||||
typedef std::pair<vertices_size_type, vertices_size_type> value_type;
|
||||
typedef const value_type& reference;
|
||||
typedef const value_type* pointer;
|
||||
typedef void difference_type;
|
||||
|
||||
erdos_renyi_iterator();
|
||||
erdos_renyi_iterator(RandomGenerator& gen, vertices_size_type n,
|
||||
double fraction = 0.0, bool allow_self_loops = false);
|
||||
erdos_renyi_iterator(RandomGenerator& gen, vertices_size_type n,
|
||||
edges_size_type m, bool allow_self_loops = false);
|
||||
|
||||
// Iterator operations
|
||||
reference operator*() const;
|
||||
pointer operator->() const;
|
||||
erdos_renyi_iterator& operator++();
|
||||
erdos_renyi_iterator operator++(int);
|
||||
bool operator==(const erdos_renyi_iterator& other) const;
|
||||
bool operator!=(const erdos_renyi_iterator& other) const;
|
||||
};
|
||||
</PRE>
|
||||
|
||||
<p> This class template implements a generator for Erdös-Renyi
|
||||
graphs, suitable for initializing an <a
|
||||
href="adjacency_list.html"><tt>adjacency_list</tt></a> or other graph
|
||||
structure with iterator-based initialization. An Erdös-Renyi
|
||||
graph <em>G = (n, p)</em> is a graph with <em>n</em> vertices
|
||||
that. The probability of having an edge <em>(u, v)</em> in <em>G</em>
|
||||
is <em>p</em> for any vertices <em>u</em> and <em>v</em>. Typically,
|
||||
there are no self-loops, but the generator can optionally introduce
|
||||
self-loops with probability <em>p</em>. This generator will not
|
||||
produce any parallel edges and will produce edges in sorted order (as
|
||||
required by, e.g., the <a
|
||||
href="compressed_sparse_row.html"><tt>compressed_sparse_row_graph</tt></a>).</p>
|
||||
|
||||
<p>Erdös-Renyi graphs typically exhibit very little
|
||||
structure. For this reason, they are rarely useful in modeling
|
||||
real-world problems. However, they are often used when determining
|
||||
the theoretical complexity of complex graph algorithms.</p>
|
||||
|
||||
<p>If you want the possibility of generating parallel edges and don't
|
||||
care about sorted order, use the <a
|
||||
href="erdos_renyi_generator.html"><tt>erdos_renyi_iterator</tt></a>.</p>
|
||||
|
||||
<h3>Where Defined</h3>
|
||||
|
||||
<a href="../../../boost/graph/erdos_renyi_generator.hpp"><tt>boost/graph/erdos_renyi_generator.hpp</tt></a>
|
||||
|
||||
<h3>Constructors</h3>
|
||||
|
||||
<a name="default-constructor"/>
|
||||
<pre>erdos_renyi_iterator();</pre>
|
||||
<blockquote>
|
||||
Constructs a past-the-end iterator.
|
||||
</blockquote>
|
||||
|
||||
<pre>
|
||||
erdos_renyi_iterator(RandomGenerator& gen, vertices_size_type n,
|
||||
double fraction = 0.0, bool allow_self_loops = false);
|
||||
</pre>
|
||||
<blockquote>
|
||||
Constructs an Erdös-Renyi generator iterator that creates a
|
||||
graph with <tt>n</tt> vertices and a given <tt>fraction</tt> of the
|
||||
total number of edges that a simple graph may have.
|
||||
<tt>probability</tt>. Random vertices and edges are selected using the
|
||||
random number generator <tt>gen</tt>. Self-loops are permitted only when
|
||||
<tt>allow_self_loops</tt> is <tt>true</tt>.
|
||||
</blockquote>
|
||||
|
||||
<pre>
|
||||
erdos_renyi_iterator(RandomGenerator& gen, vertices_size_type n,
|
||||
edges_size_type m, bool allow_self_loops = false);
|
||||
</pre>
|
||||
<blockquote>
|
||||
Constructs an Erdös-Renyi generator iterator that creates a
|
||||
graph with <tt>n</tt> vertices and <tt>m</tt> edges.
|
||||
<tt>probability</tt>. Random vertices and edges are selected using the
|
||||
random number generator <tt>gen</tt>. Self-loops are permitted only when
|
||||
<tt>allow_self_loops</tt> is <tt>true</tt>.
|
||||
</blockquote>
|
||||
|
||||
<H3>Example</H3>
|
||||
|
||||
<pre>
|
||||
#include <boost/graph/adjacency_list.hpp>
|
||||
#include <boost/graph/erdos_renyi_generator.hpp>
|
||||
#include <boost/random/linear_congruential.hpp>
|
||||
|
||||
typedef boost::adjacency_list<> Graph;
|
||||
typedef boost::erdos_renyi_iterator<boost::minstd_rand, Graph> ERGen;
|
||||
|
||||
int main()
|
||||
{
|
||||
boost::minstd_rand gen;
|
||||
// Create graph with 100 nodes and edges with probability 0.05
|
||||
Graph g(ERGen(gen, 100, 0.05), ERGen(), 100);
|
||||
return 0;
|
||||
}
|
||||
</pre>
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2005</TD><TD>
|
||||
<A HREF="../../../people/doug_gregor.html">Doug Gregor</A>, Indiana University (<script language="Javascript">address("cs.indiana.edu", "dgregor")</script>)<br>
|
||||
<A HREF=http://www.osl.iu.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Indiana University (<script language="Javascript">address("osl.iu.edu", "lums")</script>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2002
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Jeremy Siek makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Exceptions</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: FAQ</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
@@ -77,7 +73,7 @@ disadvantage of an adaptor class (compared to overloaded functions) is
|
||||
that one has to physically wrap and unwrap the objects as they go
|
||||
into/out of BGL algorithms. So the overloaded function route is more
|
||||
convenient. Granted, this is not a huge difference, but since there
|
||||
weren't other strong reasons, it was enough for us to choose member
|
||||
weren't other strong reasons, it was enough for us to choose free
|
||||
functions.
|
||||
</p>
|
||||
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
# -*- makefile -*-
|
||||
# Copyright (c) 2002 Trustees of Indiana University
|
||||
#
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
.SUFFIXES: .fig .gif .tif .jpeg
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 492 B |
@@ -0,0 +1,17 @@
|
||||
graph A {
|
||||
node[shape="circle"]
|
||||
B [ style="filled", fillcolor="red" ];
|
||||
G [ style="filled", fillcolor="red" ];
|
||||
A [ style="filled", fillcolor="red" ];
|
||||
A -- F[label="1"]
|
||||
A -- B[label="1"]
|
||||
A -- G[label="3"]
|
||||
B -- C[label="0"]
|
||||
B -- D[label="0"]
|
||||
B -- E[label="1"]
|
||||
C -- D[label="0"]
|
||||
E -- F[label="1"]
|
||||
G -- I[label="2"]
|
||||
G -- H[label="2"]
|
||||
H -- I[label="2"]
|
||||
}
|
||||
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 786 B |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 121 KiB |
|
After Width: | Height: | Size: 115 KiB |
|
After Width: | Height: | Size: 182 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 344 B |
|
After Width: | Height: | Size: 125 B |
|
After Width: | Height: | Size: 224 B |
@@ -0,0 +1,920 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CanvasColor</key>
|
||||
<dict>
|
||||
<key>w</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
<key>ColumnAlign</key>
|
||||
<integer>1</integer>
|
||||
<key>ColumnSpacing</key>
|
||||
<real>36</real>
|
||||
<key>GraphDocumentVersion</key>
|
||||
<integer>3</integer>
|
||||
<key>GraphicsList</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>Bounds</key>
|
||||
<string>{{444, 184.125}, {50, 14}}</string>
|
||||
<key>Class</key>
|
||||
<string>ShapedGraphic</string>
|
||||
<key>FitText</key>
|
||||
<string>YES</string>
|
||||
<key>ID</key>
|
||||
<integer>96</integer>
|
||||
<key>Shape</key>
|
||||
<string>Rectangle</string>
|
||||
<key>Style</key>
|
||||
<dict>
|
||||
<key>fill</key>
|
||||
<dict>
|
||||
<key>Draws</key>
|
||||
<string>NO</string>
|
||||
</dict>
|
||||
<key>shadow</key>
|
||||
<dict>
|
||||
<key>Draws</key>
|
||||
<string>NO</string>
|
||||
</dict>
|
||||
<key>stroke</key>
|
||||
<dict>
|
||||
<key>Draws</key>
|
||||
<string>NO</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Text</key>
|
||||
<dict>
|
||||
<key>Text</key>
|
||||
<string>{\rtf1\mac\ansicpg10000\cocoartf102
|
||||
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
|
||||
|
||||
\f0\fs24 \cf0 Color 2}</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Bounds</key>
|
||||
<string>{{412, 182}, {19, 19}}</string>
|
||||
<key>Class</key>
|
||||
<string>ShapedGraphic</string>
|
||||
<key>ID</key>
|
||||
<integer>95</integer>
|
||||
<key>Shape</key>
|
||||
<string>Rectangle</string>
|
||||
<key>Style</key>
|
||||
<dict>
|
||||
<key>fill</key>
|
||||
<dict>
|
||||
<key>Color</key>
|
||||
<dict>
|
||||
<key>b</key>
|
||||
<string>1</string>
|
||||
<key>g</key>
|
||||
<string>0.011662</string>
|
||||
<key>r</key>
|
||||
<string>0</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Bounds</key>
|
||||
<string>{{444, 160.125}, {50, 14}}</string>
|
||||
<key>Class</key>
|
||||
<string>ShapedGraphic</string>
|
||||
<key>FitText</key>
|
||||
<string>YES</string>
|
||||
<key>ID</key>
|
||||
<integer>94</integer>
|
||||
<key>Shape</key>
|
||||
<string>Rectangle</string>
|
||||
<key>Style</key>
|
||||
<dict>
|
||||
<key>fill</key>
|
||||
<dict>
|
||||
<key>Draws</key>
|
||||
<string>NO</string>
|
||||
</dict>
|
||||
<key>shadow</key>
|
||||
<dict>
|
||||
<key>Draws</key>
|
||||
<string>NO</string>
|
||||
</dict>
|
||||
<key>stroke</key>
|
||||
<dict>
|
||||
<key>Draws</key>
|
||||
<string>NO</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Text</key>
|
||||
<dict>
|
||||
<key>Text</key>
|
||||
<string>{\rtf1\mac\ansicpg10000\cocoartf102
|
||||
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
|
||||
|
||||
\f0\fs24 \cf0 Color 1}</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Bounds</key>
|
||||
<string>{{412, 158}, {19, 19}}</string>
|
||||
<key>Class</key>
|
||||
<string>ShapedGraphic</string>
|
||||
<key>ID</key>
|
||||
<integer>93</integer>
|
||||
<key>Shape</key>
|
||||
<string>Rectangle</string>
|
||||
<key>Style</key>
|
||||
<dict>
|
||||
<key>fill</key>
|
||||
<dict>
|
||||
<key>Color</key>
|
||||
<dict>
|
||||
<key>b</key>
|
||||
<string>0.00237679</string>
|
||||
<key>g</key>
|
||||
<string>1</string>
|
||||
<key>r</key>
|
||||
<string>0.0883496</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Bounds</key>
|
||||
<string>{{444, 136.125}, {50, 14}}</string>
|
||||
<key>Class</key>
|
||||
<string>ShapedGraphic</string>
|
||||
<key>FitText</key>
|
||||
<string>YES</string>
|
||||
<key>ID</key>
|
||||
<integer>92</integer>
|
||||
<key>Shape</key>
|
||||
<string>Rectangle</string>
|
||||
<key>Style</key>
|
||||
<dict>
|
||||
<key>fill</key>
|
||||
<dict>
|
||||
<key>Draws</key>
|
||||
<string>NO</string>
|
||||
</dict>
|
||||
<key>shadow</key>
|
||||
<dict>
|
||||
<key>Draws</key>
|
||||
<string>NO</string>
|
||||
</dict>
|
||||
<key>stroke</key>
|
||||
<dict>
|
||||
<key>Draws</key>
|
||||
<string>NO</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Text</key>
|
||||
<dict>
|
||||
<key>Text</key>
|
||||
<string>{\rtf1\mac\ansicpg10000\cocoartf102
|
||||
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
|
||||
|
||||
\f0\fs24 \cf0 Color 0}</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Bounds</key>
|
||||
<string>{{412, 134}, {19, 19}}</string>
|
||||
<key>Class</key>
|
||||
<string>ShapedGraphic</string>
|
||||
<key>ID</key>
|
||||
<integer>91</integer>
|
||||
<key>Shape</key>
|
||||
<string>Rectangle</string>
|
||||
<key>Style</key>
|
||||
<dict>
|
||||
<key>fill</key>
|
||||
<dict>
|
||||
<key>Color</key>
|
||||
<dict>
|
||||
<key>b</key>
|
||||
<string>0</string>
|
||||
<key>g</key>
|
||||
<string>0.0515676</string>
|
||||
<key>r</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Bounds</key>
|
||||
<string>{{426, 98.125}, {52, 14}}</string>
|
||||
<key>Class</key>
|
||||
<string>ShapedGraphic</string>
|
||||
<key>FitText</key>
|
||||
<string>YES</string>
|
||||
<key>ID</key>
|
||||
<integer>90</integer>
|
||||
<key>Shape</key>
|
||||
<string>Rectangle</string>
|
||||
<key>Style</key>
|
||||
<dict>
|
||||
<key>fill</key>
|
||||
<dict>
|
||||
<key>Draws</key>
|
||||
<string>NO</string>
|
||||
</dict>
|
||||
<key>shadow</key>
|
||||
<dict>
|
||||
<key>Draws</key>
|
||||
<string>NO</string>
|
||||
</dict>
|
||||
<key>stroke</key>
|
||||
<dict>
|
||||
<key>Draws</key>
|
||||
<string>NO</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Text</key>
|
||||
<dict>
|
||||
<key>Text</key>
|
||||
<string>{\rtf1\mac\ansicpg10000\cocoartf102
|
||||
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
|
||||
|
||||
\f0\fs24 \cf0 Legend}</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Bounds</key>
|
||||
<string>{{396, 90}, {111, 31}}</string>
|
||||
<key>Class</key>
|
||||
<string>ShapedGraphic</string>
|
||||
<key>ID</key>
|
||||
<integer>89</integer>
|
||||
<key>Shape</key>
|
||||
<string>Rectangle</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Bounds</key>
|
||||
<string>{{396, 122}, {111, 91}}</string>
|
||||
<key>Class</key>
|
||||
<string>ShapedGraphic</string>
|
||||
<key>ID</key>
|
||||
<integer>88</integer>
|
||||
<key>Shape</key>
|
||||
<string>Rectangle</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Class</key>
|
||||
<string>LineGraphic</string>
|
||||
<key>Head</key>
|
||||
<dict>
|
||||
<key>ID</key>
|
||||
<integer>80</integer>
|
||||
</dict>
|
||||
<key>ID</key>
|
||||
<integer>87</integer>
|
||||
<key>Points</key>
|
||||
<array>
|
||||
<string>{314, 217}</string>
|
||||
<string>{314, 96}</string>
|
||||
</array>
|
||||
<key>Style</key>
|
||||
<dict>
|
||||
<key>stroke</key>
|
||||
<dict>
|
||||
<key>HeadArrow</key>
|
||||
<string>0</string>
|
||||
<key>LineType</key>
|
||||
<integer>1</integer>
|
||||
<key>TailArrow</key>
|
||||
<string>0</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Tail</key>
|
||||
<dict>
|
||||
<key>ID</key>
|
||||
<integer>79</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Class</key>
|
||||
<string>LineGraphic</string>
|
||||
<key>Head</key>
|
||||
<dict>
|
||||
<key>ID</key>
|
||||
<integer>79</integer>
|
||||
</dict>
|
||||
<key>ID</key>
|
||||
<integer>86</integer>
|
||||
<key>Points</key>
|
||||
<array>
|
||||
<string>{140, 244}</string>
|
||||
<string>{287, 244}</string>
|
||||
</array>
|
||||
<key>Style</key>
|
||||
<dict>
|
||||
<key>stroke</key>
|
||||
<dict>
|
||||
<key>HeadArrow</key>
|
||||
<string>0</string>
|
||||
<key>LineType</key>
|
||||
<integer>1</integer>
|
||||
<key>TailArrow</key>
|
||||
<string>0</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Tail</key>
|
||||
<dict>
|
||||
<key>ID</key>
|
||||
<integer>78</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Class</key>
|
||||
<string>LineGraphic</string>
|
||||
<key>Head</key>
|
||||
<dict>
|
||||
<key>ID</key>
|
||||
<integer>78</integer>
|
||||
</dict>
|
||||
<key>ID</key>
|
||||
<integer>85</integer>
|
||||
<key>Points</key>
|
||||
<array>
|
||||
<string>{195.765, 170.877}</string>
|
||||
<string>{133.235, 226.123}</string>
|
||||
</array>
|
||||
<key>Style</key>
|
||||
<dict>
|
||||
<key>stroke</key>
|
||||
<dict>
|
||||
<key>HeadArrow</key>
|
||||
<string>0</string>
|
||||
<key>LineType</key>
|
||||
<integer>1</integer>
|
||||
<key>TailArrow</key>
|
||||
<string>0</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Tail</key>
|
||||
<dict>
|
||||
<key>ID</key>
|
||||
<integer>77</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Class</key>
|
||||
<string>LineGraphic</string>
|
||||
<key>Head</key>
|
||||
<dict>
|
||||
<key>ID</key>
|
||||
<integer>79</integer>
|
||||
</dict>
|
||||
<key>ID</key>
|
||||
<integer>84</integer>
|
||||
<key>Points</key>
|
||||
<array>
|
||||
<string>{235.786, 171.372}</string>
|
||||
<string>{294.214, 225.628}</string>
|
||||
</array>
|
||||
<key>Style</key>
|
||||
<dict>
|
||||
<key>stroke</key>
|
||||
<dict>
|
||||
<key>HeadArrow</key>
|
||||
<string>0</string>
|
||||
<key>LineType</key>
|
||||
<integer>1</integer>
|
||||
<key>TailArrow</key>
|
||||
<string>0</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Tail</key>
|
||||
<dict>
|
||||
<key>ID</key>
|
||||
<integer>77</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Class</key>
|
||||
<string>LineGraphic</string>
|
||||
<key>Head</key>
|
||||
<dict>
|
||||
<key>ID</key>
|
||||
<integer>80</integer>
|
||||
</dict>
|
||||
<key>ID</key>
|
||||
<integer>83</integer>
|
||||
<key>Points</key>
|
||||
<array>
|
||||
<string>{236.501, 135.428}</string>
|
||||
<string>{293.499, 86.5722}</string>
|
||||
</array>
|
||||
<key>Style</key>
|
||||
<dict>
|
||||
<key>stroke</key>
|
||||
<dict>
|
||||
<key>HeadArrow</key>
|
||||
<string>0</string>
|
||||
<key>LineType</key>
|
||||
<integer>1</integer>
|
||||
<key>TailArrow</key>
|
||||
<string>0</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Tail</key>
|
||||
<dict>
|
||||
<key>ID</key>
|
||||
<integer>77</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Class</key>
|
||||
<string>LineGraphic</string>
|
||||
<key>Head</key>
|
||||
<dict>
|
||||
<key>ID</key>
|
||||
<integer>80</integer>
|
||||
</dict>
|
||||
<key>ID</key>
|
||||
<integer>82</integer>
|
||||
<key>Points</key>
|
||||
<array>
|
||||
<string>{140, 69}</string>
|
||||
<string>{287, 69}</string>
|
||||
</array>
|
||||
<key>Style</key>
|
||||
<dict>
|
||||
<key>stroke</key>
|
||||
<dict>
|
||||
<key>HeadArrow</key>
|
||||
<string>0</string>
|
||||
<key>LineType</key>
|
||||
<integer>1</integer>
|
||||
<key>TailArrow</key>
|
||||
<string>0</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Tail</key>
|
||||
<dict>
|
||||
<key>ID</key>
|
||||
<integer>76</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Class</key>
|
||||
<string>LineGraphic</string>
|
||||
<key>Head</key>
|
||||
<dict>
|
||||
<key>ID</key>
|
||||
<integer>78</integer>
|
||||
</dict>
|
||||
<key>ID</key>
|
||||
<integer>81</integer>
|
||||
<key>Points</key>
|
||||
<array>
|
||||
<string>{113, 96}</string>
|
||||
<string>{113, 217}</string>
|
||||
</array>
|
||||
<key>Style</key>
|
||||
<dict>
|
||||
<key>stroke</key>
|
||||
<dict>
|
||||
<key>HeadArrow</key>
|
||||
<string>0</string>
|
||||
<key>LineType</key>
|
||||
<integer>1</integer>
|
||||
<key>TailArrow</key>
|
||||
<string>0</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Tail</key>
|
||||
<dict>
|
||||
<key>ID</key>
|
||||
<integer>76</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Bounds</key>
|
||||
<string>{{287, 42}, {54, 54}}</string>
|
||||
<key>Class</key>
|
||||
<string>ShapedGraphic</string>
|
||||
<key>ID</key>
|
||||
<integer>80</integer>
|
||||
<key>Shape</key>
|
||||
<string>Circle</string>
|
||||
<key>Style</key>
|
||||
<dict>
|
||||
<key>fill</key>
|
||||
<dict>
|
||||
<key>Color</key>
|
||||
<dict>
|
||||
<key>b</key>
|
||||
<string>0</string>
|
||||
<key>g</key>
|
||||
<string>1</string>
|
||||
<key>r</key>
|
||||
<string>0.184589</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Text</key>
|
||||
<dict>
|
||||
<key>Text</key>
|
||||
<string>{\rtf1\mac\ansicpg10000\cocoartf102
|
||||
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
|
||||
|
||||
\f0\fs24 \cf0 E}</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Bounds</key>
|
||||
<string>{{287, 217}, {54, 54}}</string>
|
||||
<key>Class</key>
|
||||
<string>ShapedGraphic</string>
|
||||
<key>ID</key>
|
||||
<integer>79</integer>
|
||||
<key>Shape</key>
|
||||
<string>Circle</string>
|
||||
<key>Style</key>
|
||||
<dict>
|
||||
<key>fill</key>
|
||||
<dict>
|
||||
<key>Color</key>
|
||||
<dict>
|
||||
<key>b</key>
|
||||
<string>1</string>
|
||||
<key>g</key>
|
||||
<string>0.0015586</string>
|
||||
<key>r</key>
|
||||
<string>0.00100458</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Text</key>
|
||||
<dict>
|
||||
<key>Text</key>
|
||||
<string>{\rtf1\mac\ansicpg10000\cocoartf102
|
||||
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
|
||||
|
||||
\f0\fs24 \cf0 D}</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Bounds</key>
|
||||
<string>{{86, 217}, {54, 54}}</string>
|
||||
<key>Class</key>
|
||||
<string>ShapedGraphic</string>
|
||||
<key>ID</key>
|
||||
<integer>78</integer>
|
||||
<key>Shape</key>
|
||||
<string>Circle</string>
|
||||
<key>Style</key>
|
||||
<dict>
|
||||
<key>fill</key>
|
||||
<dict>
|
||||
<key>Color</key>
|
||||
<dict>
|
||||
<key>b</key>
|
||||
<string>0.00237679</string>
|
||||
<key>g</key>
|
||||
<string>1</string>
|
||||
<key>r</key>
|
||||
<string>0.0883496</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Text</key>
|
||||
<dict>
|
||||
<key>Text</key>
|
||||
<string>{\rtf1\mac\ansicpg10000\cocoartf102
|
||||
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
|
||||
|
||||
\f0\fs24 \cf0 C}</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Bounds</key>
|
||||
<string>{{189, 126}, {54, 54}}</string>
|
||||
<key>Class</key>
|
||||
<string>ShapedGraphic</string>
|
||||
<key>ID</key>
|
||||
<integer>77</integer>
|
||||
<key>Shape</key>
|
||||
<string>Circle</string>
|
||||
<key>Style</key>
|
||||
<dict>
|
||||
<key>fill</key>
|
||||
<dict>
|
||||
<key>Color</key>
|
||||
<dict>
|
||||
<key>b</key>
|
||||
<string>0</string>
|
||||
<key>g</key>
|
||||
<string>0.0258026</string>
|
||||
<key>r</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Text</key>
|
||||
<dict>
|
||||
<key>Text</key>
|
||||
<string>{\rtf1\mac\ansicpg10000\cocoartf102
|
||||
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
|
||||
|
||||
\f0\fs24 \cf0 B}</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Bounds</key>
|
||||
<string>{{86, 42}, {54, 54}}</string>
|
||||
<key>Class</key>
|
||||
<string>ShapedGraphic</string>
|
||||
<key>ID</key>
|
||||
<integer>76</integer>
|
||||
<key>Shape</key>
|
||||
<string>Circle</string>
|
||||
<key>Style</key>
|
||||
<dict>
|
||||
<key>fill</key>
|
||||
<dict>
|
||||
<key>Color</key>
|
||||
<dict>
|
||||
<key>b</key>
|
||||
<string>0</string>
|
||||
<key>g</key>
|
||||
<string>0.0515676</string>
|
||||
<key>r</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>Text</key>
|
||||
<dict>
|
||||
<key>Text</key>
|
||||
<string>{\rtf1\mac\ansicpg10000\cocoartf102
|
||||
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc
|
||||
|
||||
\f0\fs24 \cf0 A}</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
<key>GridInfo</key>
|
||||
<dict/>
|
||||
<key>GuidesVisible</key>
|
||||
<string>YES</string>
|
||||
<key>HPages</key>
|
||||
<integer>1</integer>
|
||||
<key>ImageCounter</key>
|
||||
<integer>1</integer>
|
||||
<key>IsPalette</key>
|
||||
<string>NO</string>
|
||||
<key>Layers</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>Lock</key>
|
||||
<string>NO</string>
|
||||
<key>Name</key>
|
||||
<string>Layer 1</string>
|
||||
<key>Print</key>
|
||||
<string>YES</string>
|
||||
<key>View</key>
|
||||
<string>YES</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>LayoutInfo</key>
|
||||
<dict>
|
||||
<key>AutoAdjust</key>
|
||||
<string>YES</string>
|
||||
<key>ChildOrdering</key>
|
||||
<integer>2</integer>
|
||||
<key>MagneticFieldCenter</key>
|
||||
<string>{0, 0}</string>
|
||||
</dict>
|
||||
<key>LinksVisible</key>
|
||||
<string>NO</string>
|
||||
<key>MagnetsVisible</key>
|
||||
<string>NO</string>
|
||||
<key>Orientation</key>
|
||||
<integer>2</integer>
|
||||
<key>PageBreaks</key>
|
||||
<string>YES</string>
|
||||
<key>PageSetup</key>
|
||||
<data>
|
||||
BAt0eXBlZHN0cmVhbYED6IQBQISEhAtOU1ByaW50SW5mbwGEhAhOU09iamVjdACFkoSE
|
||||
hBNOU011dGFibGVEaWN0aW9uYXJ5AISEDE5TRGljdGlvbmFyeQCUhAFpFJKEhIQITlNT
|
||||
dHJpbmcBlIQBKxBOU0pvYkRpc3Bvc2l0aW9uhpKEmZkPTlNQcmludFNwb29sSm9ihpKE
|
||||
mZkLTlNQYXBlclNpemWGkoSEhAdOU1ZhbHVlAJSEASqEhAx7X05TU2l6ZT1mZn2cgQJk
|
||||
gQMYhpKEmZkZTlNQcmludFJldmVyc2VPcmllbnRhdGlvboaShISECE5TTnVtYmVyAJ2b
|
||||
hJeXAIaShJmZFE5TVmVydGljYWxQYWdpbmF0aW9uhpKEoZuilwCGkoSZmRROU1ZlcnRp
|
||||
Y2FsbHlDZW50ZXJlZIaShKGbopcBhpKEmZkOTlNQTVBhZ2VGb3JtYXSGkoSEhAZOU0Rh
|
||||
dGEAlJeBHa2EB1s3NTk3Y108P3htbCB2ZXJzaW9uPSIxLjAiIGVuY29kaW5nPSJVVEYt
|
||||
OCI/Pgo8IURPQ1RZUEUgcGxpc3QgUFVCTElDICItLy9BcHBsZSBDb21wdXRlci8vRFRE
|
||||
IFBMSVNUIDEuMC8vRU4iICJodHRwOi8vd3d3LmFwcGxlLmNvbS9EVERzL1Byb3BlcnR5
|
||||
TGlzdC0xLjAuZHRkIj4KPHBsaXN0IHZlcnNpb249IjEuMCI+CjxkaWN0PgoJPGtleT5j
|
||||
b20uYXBwbGUucHJpbnQuUGFnZUZvcm1hdC5QTUhvcml6b250YWxSZXM8L2tleT4KCTxk
|
||||
aWN0PgoJCTxrZXk+Y29tLmFwcGxlLnByaW50LnRpY2tldC5jcmVhdG9yPC9rZXk+CgkJ
|
||||
PHN0cmluZz5jb20uYXBwbGUucHJpbnRpbmdtYW5hZ2VyPC9zdHJpbmc+CgkJPGtleT5j
|
||||
b20uYXBwbGUucHJpbnQudGlja2V0Lml0ZW1BcnJheTwva2V5PgoJCTxhcnJheT4KCQkJ
|
||||
PGRpY3Q+CgkJCQk8a2V5PmNvbS5hcHBsZS5wcmludC5QYWdlRm9ybWF0LlBNSG9yaXpv
|
||||
bnRhbFJlczwva2V5PgoJCQkJPHJlYWw+NzI8L3JlYWw+CgkJCQk8a2V5PmNvbS5hcHBs
|
||||
ZS5wcmludC50aWNrZXQuY2xpZW50PC9rZXk+CgkJCQk8c3RyaW5nPmNvbS5hcHBsZS5w
|
||||
cmludGluZ21hbmFnZXI8L3N0cmluZz4KCQkJCTxrZXk+Y29tLmFwcGxlLnByaW50LnRp
|
||||
Y2tldC5tb2REYXRlPC9rZXk+CgkJCQk8ZGF0ZT4yMDAzLTAxLTI0VDE2OjI4OjU0Wjwv
|
||||
ZGF0ZT4KCQkJCTxrZXk+Y29tLmFwcGxlLnByaW50LnRpY2tldC5zdGF0ZUZsYWc8L2tl
|
||||
eT4KCQkJCTxpbnRlZ2VyPjA8L2ludGVnZXI+CgkJCTwvZGljdD4KCQk8L2FycmF5PgoJ
|
||||
PC9kaWN0PgoJPGtleT5jb20uYXBwbGUucHJpbnQuUGFnZUZvcm1hdC5QTU9yaWVudGF0
|
||||
aW9uPC9rZXk+Cgk8ZGljdD4KCQk8a2V5PmNvbS5hcHBsZS5wcmludC50aWNrZXQuY3Jl
|
||||
YXRvcjwva2V5PgoJCTxzdHJpbmc+Y29tLmFwcGxlLnByaW50aW5nbWFuYWdlcjwvc3Ry
|
||||
aW5nPgoJCTxrZXk+Y29tLmFwcGxlLnByaW50LnRpY2tldC5pdGVtQXJyYXk8L2tleT4K
|
||||
CQk8YXJyYXk+CgkJCTxkaWN0PgoJCQkJPGtleT5jb20uYXBwbGUucHJpbnQuUGFnZUZv
|
||||
cm1hdC5QTU9yaWVudGF0aW9uPC9rZXk+CgkJCQk8aW50ZWdlcj4xPC9pbnRlZ2VyPgoJ
|
||||
CQkJPGtleT5jb20uYXBwbGUucHJpbnQudGlja2V0LmNsaWVudDwva2V5PgoJCQkJPHN0
|
||||
cmluZz5jb20uYXBwbGUucHJpbnRpbmdtYW5hZ2VyPC9zdHJpbmc+CgkJCQk8a2V5PmNv
|
||||
bS5hcHBsZS5wcmludC50aWNrZXQubW9kRGF0ZTwva2V5PgoJCQkJPGRhdGU+MjAwMy0w
|
||||
MS0yNFQxNjoyODo1NFo8L2RhdGU+CgkJCQk8a2V5PmNvbS5hcHBsZS5wcmludC50aWNr
|
||||
ZXQuc3RhdGVGbGFnPC9rZXk+CgkJCQk8aW50ZWdlcj4wPC9pbnRlZ2VyPgoJCQk8L2Rp
|
||||
Y3Q+CgkJPC9hcnJheT4KCTwvZGljdD4KCTxrZXk+Y29tLmFwcGxlLnByaW50LlBhZ2VG
|
||||
b3JtYXQuUE1TY2FsaW5nPC9rZXk+Cgk8ZGljdD4KCQk8a2V5PmNvbS5hcHBsZS5wcmlu
|
||||
dC50aWNrZXQuY3JlYXRvcjwva2V5PgoJCTxzdHJpbmc+Y29tLmFwcGxlLnByaW50aW5n
|
||||
bWFuYWdlcjwvc3RyaW5nPgoJCTxrZXk+Y29tLmFwcGxlLnByaW50LnRpY2tldC5pdGVt
|
||||
QXJyYXk8L2tleT4KCQk8YXJyYXk+CgkJCTxkaWN0PgoJCQkJPGtleT5jb20uYXBwbGUu
|
||||
cHJpbnQuUGFnZUZvcm1hdC5QTVNjYWxpbmc8L2tleT4KCQkJCTxyZWFsPjE8L3JlYWw+
|
||||
CgkJCQk8a2V5PmNvbS5hcHBsZS5wcmludC50aWNrZXQuY2xpZW50PC9rZXk+CgkJCQk8
|
||||
c3RyaW5nPmNvbS5hcHBsZS5wcmludGluZ21hbmFnZXI8L3N0cmluZz4KCQkJCTxrZXk+
|
||||
Y29tLmFwcGxlLnByaW50LnRpY2tldC5tb2REYXRlPC9rZXk+CgkJCQk8ZGF0ZT4yMDAz
|
||||
LTAxLTI0VDE2OjI4OjU0WjwvZGF0ZT4KCQkJCTxrZXk+Y29tLmFwcGxlLnByaW50LnRp
|
||||
Y2tldC5zdGF0ZUZsYWc8L2tleT4KCQkJCTxpbnRlZ2VyPjA8L2ludGVnZXI+CgkJCTwv
|
||||
ZGljdD4KCQk8L2FycmF5PgoJPC9kaWN0PgoJPGtleT5jb20uYXBwbGUucHJpbnQuUGFn
|
||||
ZUZvcm1hdC5QTVZlcnRpY2FsUmVzPC9rZXk+Cgk8ZGljdD4KCQk8a2V5PmNvbS5hcHBs
|
||||
ZS5wcmludC50aWNrZXQuY3JlYXRvcjwva2V5PgoJCTxzdHJpbmc+Y29tLmFwcGxlLnBy
|
||||
aW50aW5nbWFuYWdlcjwvc3RyaW5nPgoJCTxrZXk+Y29tLmFwcGxlLnByaW50LnRpY2tl
|
||||
dC5pdGVtQXJyYXk8L2tleT4KCQk8YXJyYXk+CgkJCTxkaWN0PgoJCQkJPGtleT5jb20u
|
||||
YXBwbGUucHJpbnQuUGFnZUZvcm1hdC5QTVZlcnRpY2FsUmVzPC9rZXk+CgkJCQk8cmVh
|
||||
bD43MjwvcmVhbD4KCQkJCTxrZXk+Y29tLmFwcGxlLnByaW50LnRpY2tldC5jbGllbnQ8
|
||||
L2tleT4KCQkJCTxzdHJpbmc+Y29tLmFwcGxlLnByaW50aW5nbWFuYWdlcjwvc3RyaW5n
|
||||
PgoJCQkJPGtleT5jb20uYXBwbGUucHJpbnQudGlja2V0Lm1vZERhdGU8L2tleT4KCQkJ
|
||||
CTxkYXRlPjIwMDMtMDEtMjRUMTY6Mjg6NTRaPC9kYXRlPgoJCQkJPGtleT5jb20uYXBw
|
||||
bGUucHJpbnQudGlja2V0LnN0YXRlRmxhZzwva2V5PgoJCQkJPGludGVnZXI+MDwvaW50
|
||||
ZWdlcj4KCQkJPC9kaWN0PgoJCTwvYXJyYXk+Cgk8L2RpY3Q+Cgk8a2V5PmNvbS5hcHBs
|
||||
ZS5wcmludC5QYWdlRm9ybWF0LlBNVmVydGljYWxTY2FsaW5nPC9rZXk+Cgk8ZGljdD4K
|
||||
CQk8a2V5PmNvbS5hcHBsZS5wcmludC50aWNrZXQuY3JlYXRvcjwva2V5PgoJCTxzdHJp
|
||||
bmc+Y29tLmFwcGxlLnByaW50aW5nbWFuYWdlcjwvc3RyaW5nPgoJCTxrZXk+Y29tLmFw
|
||||
cGxlLnByaW50LnRpY2tldC5pdGVtQXJyYXk8L2tleT4KCQk8YXJyYXk+CgkJCTxkaWN0
|
||||
PgoJCQkJPGtleT5jb20uYXBwbGUucHJpbnQuUGFnZUZvcm1hdC5QTVZlcnRpY2FsU2Nh
|
||||
bGluZzwva2V5PgoJCQkJPHJlYWw+MTwvcmVhbD4KCQkJCTxrZXk+Y29tLmFwcGxlLnBy
|
||||
aW50LnRpY2tldC5jbGllbnQ8L2tleT4KCQkJCTxzdHJpbmc+Y29tLmFwcGxlLnByaW50
|
||||
aW5nbWFuYWdlcjwvc3RyaW5nPgoJCQkJPGtleT5jb20uYXBwbGUucHJpbnQudGlja2V0
|
||||
Lm1vZERhdGU8L2tleT4KCQkJCTxkYXRlPjIwMDMtMDEtMjRUMTY6Mjg6NTRaPC9kYXRl
|
||||
PgoJCQkJPGtleT5jb20uYXBwbGUucHJpbnQudGlja2V0LnN0YXRlRmxhZzwva2V5PgoJ
|
||||
CQkJPGludGVnZXI+MDwvaW50ZWdlcj4KCQkJPC9kaWN0PgoJCTwvYXJyYXk+Cgk8L2Rp
|
||||
Y3Q+Cgk8a2V5PmNvbS5hcHBsZS5wcmludC5zdWJUaWNrZXQucGFwZXJfaW5mb190aWNr
|
||||
ZXQ8L2tleT4KCTxkaWN0PgoJCTxrZXk+Y29tLmFwcGxlLnByaW50LlBhZ2VGb3JtYXQu
|
||||
UE1BZGp1c3RlZFBhZ2VSZWN0PC9rZXk+CgkJPGRpY3Q+CgkJCTxrZXk+Y29tLmFwcGxl
|
||||
LnByaW50LnRpY2tldC5jcmVhdG9yPC9rZXk+CgkJCTxzdHJpbmc+Y29tLmFwcGxlLnBy
|
||||
aW50aW5nbWFuYWdlcjwvc3RyaW5nPgoJCQk8a2V5PmNvbS5hcHBsZS5wcmludC50aWNr
|
||||
ZXQuaXRlbUFycmF5PC9rZXk+CgkJCTxhcnJheT4KCQkJCTxkaWN0PgoJCQkJCTxrZXk+
|
||||
Y29tLmFwcGxlLnByaW50LlBhZ2VGb3JtYXQuUE1BZGp1c3RlZFBhZ2VSZWN0PC9rZXk+
|
||||
CgkJCQkJPGFycmF5PgoJCQkJCQk8cmVhbD4wLjA8L3JlYWw+CgkJCQkJCTxyZWFsPjAu
|
||||
MDwvcmVhbD4KCQkJCQkJPHJlYWw+NzM0PC9yZWFsPgoJCQkJCQk8cmVhbD41NzY8L3Jl
|
||||
YWw+CgkJCQkJPC9hcnJheT4KCQkJCQk8a2V5PmNvbS5hcHBsZS5wcmludC50aWNrZXQu
|
||||
Y2xpZW50PC9rZXk+CgkJCQkJPHN0cmluZz5jb20uYXBwbGUucHJpbnRpbmdtYW5hZ2Vy
|
||||
PC9zdHJpbmc+CgkJCQkJPGtleT5jb20uYXBwbGUucHJpbnQudGlja2V0Lm1vZERhdGU8
|
||||
L2tleT4KCQkJCQk8ZGF0ZT4yMDA0LTEyLTE2VDE1OjI1OjIwWjwvZGF0ZT4KCQkJCQk8
|
||||
a2V5PmNvbS5hcHBsZS5wcmludC50aWNrZXQuc3RhdGVGbGFnPC9rZXk+CgkJCQkJPGlu
|
||||
dGVnZXI+MDwvaW50ZWdlcj4KCQkJCTwvZGljdD4KCQkJPC9hcnJheT4KCQk8L2RpY3Q+
|
||||
CgkJPGtleT5jb20uYXBwbGUucHJpbnQuUGFnZUZvcm1hdC5QTUFkanVzdGVkUGFwZXJS
|
||||
ZWN0PC9rZXk+CgkJPGRpY3Q+CgkJCTxrZXk+Y29tLmFwcGxlLnByaW50LnRpY2tldC5j
|
||||
cmVhdG9yPC9rZXk+CgkJCTxzdHJpbmc+Y29tLmFwcGxlLnByaW50aW5nbWFuYWdlcjwv
|
||||
c3RyaW5nPgoJCQk8a2V5PmNvbS5hcHBsZS5wcmludC50aWNrZXQuaXRlbUFycmF5PC9r
|
||||
ZXk+CgkJCTxhcnJheT4KCQkJCTxkaWN0PgoJCQkJCTxrZXk+Y29tLmFwcGxlLnByaW50
|
||||
LlBhZ2VGb3JtYXQuUE1BZGp1c3RlZFBhcGVyUmVjdDwva2V5PgoJCQkJCTxhcnJheT4K
|
||||
CQkJCQkJPHJlYWw+LTE4PC9yZWFsPgoJCQkJCQk8cmVhbD4tMTg8L3JlYWw+CgkJCQkJ
|
||||
CTxyZWFsPjc3NDwvcmVhbD4KCQkJCQkJPHJlYWw+NTk0PC9yZWFsPgoJCQkJCTwvYXJy
|
||||
YXk+CgkJCQkJPGtleT5jb20uYXBwbGUucHJpbnQudGlja2V0LmNsaWVudDwva2V5PgoJ
|
||||
CQkJCTxzdHJpbmc+Y29tLmFwcGxlLnByaW50aW5nbWFuYWdlcjwvc3RyaW5nPgoJCQkJ
|
||||
CTxrZXk+Y29tLmFwcGxlLnByaW50LnRpY2tldC5tb2REYXRlPC9rZXk+CgkJCQkJPGRh
|
||||
dGU+MjAwNC0xMi0xNlQxNToyNToyMFo8L2RhdGU+CgkJCQkJPGtleT5jb20uYXBwbGUu
|
||||
cHJpbnQudGlja2V0LnN0YXRlRmxhZzwva2V5PgoJCQkJCTxpbnRlZ2VyPjA8L2ludGVn
|
||||
ZXI+CgkJCQk8L2RpY3Q+CgkJCTwvYXJyYXk+CgkJPC9kaWN0PgoJCTxrZXk+Y29tLmFw
|
||||
cGxlLnByaW50LlBhcGVySW5mby5QTVBhcGVyTmFtZTwva2V5PgoJCTxkaWN0PgoJCQk8
|
||||
a2V5PmNvbS5hcHBsZS5wcmludC50aWNrZXQuY3JlYXRvcjwva2V5PgoJCQk8c3RyaW5n
|
||||
PmNvbS5hcHBsZS5wcmludC5wbS5Qb3N0U2NyaXB0PC9zdHJpbmc+CgkJCTxrZXk+Y29t
|
||||
LmFwcGxlLnByaW50LnRpY2tldC5pdGVtQXJyYXk8L2tleT4KCQkJPGFycmF5PgoJCQkJ
|
||||
PGRpY3Q+CgkJCQkJPGtleT5jb20uYXBwbGUucHJpbnQuUGFwZXJJbmZvLlBNUGFwZXJO
|
||||
YW1lPC9rZXk+CgkJCQkJPHN0cmluZz5uYS1sZXR0ZXI8L3N0cmluZz4KCQkJCQk8a2V5
|
||||
PmNvbS5hcHBsZS5wcmludC50aWNrZXQuY2xpZW50PC9rZXk+CgkJCQkJPHN0cmluZz5j
|
||||
b20uYXBwbGUucHJpbnQucG0uUG9zdFNjcmlwdDwvc3RyaW5nPgoJCQkJCTxrZXk+Y29t
|
||||
LmFwcGxlLnByaW50LnRpY2tldC5tb2REYXRlPC9rZXk+CgkJCQkJPGRhdGU+MjAwMC0w
|
||||
Ny0yOFQyMjo1NzowNFo8L2RhdGU+CgkJCQkJPGtleT5jb20uYXBwbGUucHJpbnQudGlj
|
||||
a2V0LnN0YXRlRmxhZzwva2V5PgoJCQkJCTxpbnRlZ2VyPjE8L2ludGVnZXI+CgkJCQk8
|
||||
L2RpY3Q+CgkJCTwvYXJyYXk+CgkJPC9kaWN0PgoJCTxrZXk+Y29tLmFwcGxlLnByaW50
|
||||
LlBhcGVySW5mby5QTVVuYWRqdXN0ZWRQYWdlUmVjdDwva2V5PgoJCTxkaWN0PgoJCQk8
|
||||
a2V5PmNvbS5hcHBsZS5wcmludC50aWNrZXQuY3JlYXRvcjwva2V5PgoJCQk8c3RyaW5n
|
||||
PmNvbS5hcHBsZS5wcmludC5wbS5Qb3N0U2NyaXB0PC9zdHJpbmc+CgkJCTxrZXk+Y29t
|
||||
LmFwcGxlLnByaW50LnRpY2tldC5pdGVtQXJyYXk8L2tleT4KCQkJPGFycmF5PgoJCQkJ
|
||||
PGRpY3Q+CgkJCQkJPGtleT5jb20uYXBwbGUucHJpbnQuUGFwZXJJbmZvLlBNVW5hZGp1
|
||||
c3RlZFBhZ2VSZWN0PC9rZXk+CgkJCQkJPGFycmF5PgoJCQkJCQk8cmVhbD4wLjA8L3Jl
|
||||
YWw+CgkJCQkJCTxyZWFsPjAuMDwvcmVhbD4KCQkJCQkJPHJlYWw+NzM0PC9yZWFsPgoJ
|
||||
CQkJCQk8cmVhbD41NzY8L3JlYWw+CgkJCQkJPC9hcnJheT4KCQkJCQk8a2V5PmNvbS5h
|
||||
cHBsZS5wcmludC50aWNrZXQuY2xpZW50PC9rZXk+CgkJCQkJPHN0cmluZz5jb20uYXBw
|
||||
bGUucHJpbnRpbmdtYW5hZ2VyPC9zdHJpbmc+CgkJCQkJPGtleT5jb20uYXBwbGUucHJp
|
||||
bnQudGlja2V0Lm1vZERhdGU8L2tleT4KCQkJCQk8ZGF0ZT4yMDAzLTAxLTI0VDE2OjI4
|
||||
OjU0WjwvZGF0ZT4KCQkJCQk8a2V5PmNvbS5hcHBsZS5wcmludC50aWNrZXQuc3RhdGVG
|
||||
bGFnPC9rZXk+CgkJCQkJPGludGVnZXI+MDwvaW50ZWdlcj4KCQkJCTwvZGljdD4KCQkJ
|
||||
PC9hcnJheT4KCQk8L2RpY3Q+CgkJPGtleT5jb20uYXBwbGUucHJpbnQuUGFwZXJJbmZv
|
||||
LlBNVW5hZGp1c3RlZFBhcGVyUmVjdDwva2V5PgoJCTxkaWN0PgoJCQk8a2V5PmNvbS5h
|
||||
cHBsZS5wcmludC50aWNrZXQuY3JlYXRvcjwva2V5PgoJCQk8c3RyaW5nPmNvbS5hcHBs
|
||||
ZS5wcmludC5wbS5Qb3N0U2NyaXB0PC9zdHJpbmc+CgkJCTxrZXk+Y29tLmFwcGxlLnBy
|
||||
aW50LnRpY2tldC5pdGVtQXJyYXk8L2tleT4KCQkJPGFycmF5PgoJCQkJPGRpY3Q+CgkJ
|
||||
CQkJPGtleT5jb20uYXBwbGUucHJpbnQuUGFwZXJJbmZvLlBNVW5hZGp1c3RlZFBhcGVy
|
||||
UmVjdDwva2V5PgoJCQkJCTxhcnJheT4KCQkJCQkJPHJlYWw+LTE4PC9yZWFsPgoJCQkJ
|
||||
CQk8cmVhbD4tMTg8L3JlYWw+CgkJCQkJCTxyZWFsPjc3NDwvcmVhbD4KCQkJCQkJPHJl
|
||||
YWw+NTk0PC9yZWFsPgoJCQkJCTwvYXJyYXk+CgkJCQkJPGtleT5jb20uYXBwbGUucHJp
|
||||
bnQudGlja2V0LmNsaWVudDwva2V5PgoJCQkJCTxzdHJpbmc+Y29tLmFwcGxlLnByaW50
|
||||
aW5nbWFuYWdlcjwvc3RyaW5nPgoJCQkJCTxrZXk+Y29tLmFwcGxlLnByaW50LnRpY2tl
|
||||
dC5tb2REYXRlPC9rZXk+CgkJCQkJPGRhdGU+MjAwMy0wMS0yNFQxNjoyODo1NFo8L2Rh
|
||||
dGU+CgkJCQkJPGtleT5jb20uYXBwbGUucHJpbnQudGlja2V0LnN0YXRlRmxhZzwva2V5
|
||||
PgoJCQkJCTxpbnRlZ2VyPjA8L2ludGVnZXI+CgkJCQk8L2RpY3Q+CgkJCTwvYXJyYXk+
|
||||
CgkJPC9kaWN0PgoJCTxrZXk+Y29tLmFwcGxlLnByaW50LlBhcGVySW5mby5wcGQuUE1Q
|
||||
YXBlck5hbWU8L2tleT4KCQk8ZGljdD4KCQkJPGtleT5jb20uYXBwbGUucHJpbnQudGlj
|
||||
a2V0LmNyZWF0b3I8L2tleT4KCQkJPHN0cmluZz5jb20uYXBwbGUucHJpbnQucG0uUG9z
|
||||
dFNjcmlwdDwvc3RyaW5nPgoJCQk8a2V5PmNvbS5hcHBsZS5wcmludC50aWNrZXQuaXRl
|
||||
bUFycmF5PC9rZXk+CgkJCTxhcnJheT4KCQkJCTxkaWN0PgoJCQkJCTxrZXk+Y29tLmFw
|
||||
cGxlLnByaW50LlBhcGVySW5mby5wcGQuUE1QYXBlck5hbWU8L2tleT4KCQkJCQk8c3Ry
|
||||
aW5nPkxldHRlcjwvc3RyaW5nPgoJCQkJCTxrZXk+Y29tLmFwcGxlLnByaW50LnRpY2tl
|
||||
dC5jbGllbnQ8L2tleT4KCQkJCQk8c3RyaW5nPmNvbS5hcHBsZS5wcmludC5wbS5Qb3N0
|
||||
U2NyaXB0PC9zdHJpbmc+CgkJCQkJPGtleT5jb20uYXBwbGUucHJpbnQudGlja2V0Lm1v
|
||||
ZERhdGU8L2tleT4KCQkJCQk8ZGF0ZT4yMDAwLTA3LTI4VDIyOjU3OjA0WjwvZGF0ZT4K
|
||||
CQkJCQk8a2V5PmNvbS5hcHBsZS5wcmludC50aWNrZXQuc3RhdGVGbGFnPC9rZXk+CgkJ
|
||||
CQkJPGludGVnZXI+MTwvaW50ZWdlcj4KCQkJCTwvZGljdD4KCQkJPC9hcnJheT4KCQk8
|
||||
L2RpY3Q+CgkJPGtleT5jb20uYXBwbGUucHJpbnQudGlja2V0LkFQSVZlcnNpb248L2tl
|
||||
eT4KCQk8c3RyaW5nPjAwLjIwPC9zdHJpbmc+CgkJPGtleT5jb20uYXBwbGUucHJpbnQu
|
||||
dGlja2V0LnByaXZhdGVMb2NrPC9rZXk+CgkJPGZhbHNlLz4KCQk8a2V5PmNvbS5hcHBs
|
||||
ZS5wcmludC50aWNrZXQudHlwZTwva2V5PgoJCTxzdHJpbmc+Y29tLmFwcGxlLnByaW50
|
||||
LlBhcGVySW5mb1RpY2tldDwvc3RyaW5nPgoJPC9kaWN0PgoJPGtleT5jb20uYXBwbGUu
|
||||
cHJpbnQudGlja2V0LkFQSVZlcnNpb248L2tleT4KCTxzdHJpbmc+MDAuMjA8L3N0cmlu
|
||||
Zz4KCTxrZXk+Y29tLmFwcGxlLnByaW50LnRpY2tldC5wcml2YXRlTG9jazwva2V5PgoJ
|
||||
PGZhbHNlLz4KCTxrZXk+Y29tLmFwcGxlLnByaW50LnRpY2tldC50eXBlPC9rZXk+Cgk8
|
||||
c3RyaW5nPmNvbS5hcHBsZS5wcmludC5QYWdlRm9ybWF0VGlja2V0PC9zdHJpbmc+Cjwv
|
||||
ZGljdD4KPC9wbGlzdD4KhpKEmZkPTlNQcmludEFsbFBhZ2VzhpKgkoSZmQtOU1BhcGVy
|
||||
TmFtZYaShJmZBkxldHRlcoaShJmZFU5TSG9yaXpvbmFsUGFnaW5hdGlvboaShKGbopcA
|
||||
hpKEmZkWTlNIb3Jpem9udGFsbHlDZW50ZXJlZIaSppKEmZkJTlNQcmludGVyhpKEhIQJ
|
||||
TlNQcmludGVyAJSShJmZBXBzbGFthoaShJmZCE5TQ29waWVzhpKEoZuilwGGkoSZmQ9O
|
||||
U1NjYWxpbmdGYWN0b3KGkoShm4SEAWahAYaShJmZDU5TUmlnaHRNYXJnaW6GkoShm7ih
|
||||
AIaShJmZDk5TQm90dG9tTWFyZ2luhpKEoZu4oQCGkoSZmQxOU0xlZnRNYXJnaW6GkoSh
|
||||
m7ihAIaShJmZC05TVG9wTWFyZ2luhpKEoZu4oQCGkoSZmQpOU0xhc3RQYWdlhpKEoZui
|
||||
l4J/////hpKEmZkLTlNGaXJzdFBhZ2WGkoShm6KXAYaShJmZDU5TT3JpZW50YXRpb26G
|
||||
koShm6KXAIaGhg==
|
||||
</data>
|
||||
<key>ReadOnly</key>
|
||||
<string>NO</string>
|
||||
<key>RowAlign</key>
|
||||
<integer>1</integer>
|
||||
<key>RowSpacing</key>
|
||||
<real>36</real>
|
||||
<key>SheetTitle</key>
|
||||
<string>Canvas 1</string>
|
||||
<key>SmartAlignmentGuidesActive</key>
|
||||
<string>YES</string>
|
||||
<key>SmartDistanceGuidesActive</key>
|
||||
<string>YES</string>
|
||||
<key>UseEntirePage</key>
|
||||
<true/>
|
||||
<key>VPages</key>
|
||||
<integer>1</integer>
|
||||
<key>WindowInfo</key>
|
||||
<dict>
|
||||
<key>CurrentSheet</key>
|
||||
<string>0</string>
|
||||
<key>Frame</key>
|
||||
<string>{{664, 346}, {591, 832}}</string>
|
||||
<key>ShowRuler</key>
|
||||
<false/>
|
||||
<key>ShowStatusBar</key>
|
||||
<true/>
|
||||
<key>VisibleRegion</key>
|
||||
<string>{{0, 0}, {576, 734}}</string>
|
||||
<key>Zoom</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 73 B |
|
After Width: | Height: | Size: 129 B |
|
After Width: | Height: | Size: 71 B |
|
After Width: | Height: | Size: 7.4 KiB |
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>File Dependency Example</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
@@ -85,14 +81,27 @@ href="../example/file_dependencies.cpp"><TT>examples/file_dependencies.cpp</TT><
|
||||
<H2>Graph Setup</H2>
|
||||
|
||||
<P>
|
||||
Here we show the construction of the graph. For simplicity we have
|
||||
Here we show the construction of the graph. First, these are the required
|
||||
header files:
|
||||
|
||||
<P>
|
||||
<PRE>
|
||||
#include <iostream> // std::cout
|
||||
#include <utility> // std::pair
|
||||
#include <boost/graph/graph_traits.hpp>
|
||||
#include <boost/graph/adjacency_list.hpp>
|
||||
#include <boost/graph/topological_sort.hpp>
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
For simplicity we have
|
||||
constructed the graph "by-hand". A compilation system such
|
||||
as <TT>make</TT> would instead parse a <TT>Makefile</TT> to get the
|
||||
list of files and to set-up the dependencies. We use the
|
||||
<TT>adjacency_list</TT> class to represent the graph. The
|
||||
<TT>vecS</TT> selector means that a <TT>std::vector</TT> will be used
|
||||
to represent each edge-list, which provides efficient traversal. The
|
||||
<TT>directedS</TT> selector means we want a directed graph, and the
|
||||
<TT>bidirectionalS</TT> selector means we want a directed graph with access to both the edges outgoing from each vertex and the edges incoming to each vertex, and the
|
||||
<TT>color_property</TT> attaches a color property to each vertex of the
|
||||
graph. The color property will be used in several of the algorithms in
|
||||
the following sections.
|
||||
@@ -127,11 +136,10 @@ the following sections.
|
||||
};
|
||||
|
||||
using namespace boost;
|
||||
typedef adjacency_list<vecS, vecS, directedS,
|
||||
property<vertex_color_t, default_color_type>,
|
||||
property<edge_weight_t, int>
|
||||
typedef adjacency_list<vecS, vecS, bidirectionalS,
|
||||
property<vertex_color_t, default_color_type>
|
||||
> Graph;
|
||||
Graph g(N, used_by, used_by + sizeof(used_by) / sizeof(Edge));
|
||||
Graph g(used_by, used_by + sizeof(used_by) / sizeof(Edge), N);
|
||||
typedef graph_traits<Graph>::vertex_descriptor Vertex;
|
||||
</PRE>
|
||||
|
||||
@@ -195,86 +203,42 @@ earliest time that a file can be built assuming that an unlimited
|
||||
number of files can be built at the same time? The main criteria for
|
||||
when a file can be built is that all of the files it depends on must
|
||||
already be built. To simplify things for this example, we'll assume
|
||||
that each file takes 1 time unit to build (even header files). The
|
||||
that each file takes 1 time unit to build (even header files). For
|
||||
parallel compilation, we can build all of the files corresponding to
|
||||
vertices with no dependencies, e.g., those that have
|
||||
an <i>in-degree</i> of 0, in the first step. For all other files, the
|
||||
main observation for determining the ``time slot'' for a file is that
|
||||
the time slot must be one more than the maximum time-slot of the files
|
||||
it depends on.
|
||||
|
||||
<P>
|
||||
This idea of calculating a value based on the previously computed
|
||||
values of neighboring vertices is the same idea behind Dijkstra's
|
||||
single-source shortest paths algorithm (see <a
|
||||
href="./dijkstra_shortest_paths.html"><tt>dijkstra_shortest_paths()</tt></a>). The
|
||||
main difference between this situation and a shortest-path algorithm
|
||||
is that we want to use the maximum of the neighbors' values instead of
|
||||
the minimum. In addition, we do not have a single source
|
||||
vertex. Instead we will want to treat all vertices with in-degree of
|
||||
zero as sources (i.e., vertices with no edges coming into them). So we
|
||||
use Dijkstra's algorithm with several extra parameters instead
|
||||
of relying on the defaults.
|
||||
|
||||
<P>
|
||||
To use <TT>dijkstra_shortest_paths()</TT>, we must first set up the vertex
|
||||
and edge properties that will be used in the algorithm. We will need
|
||||
a time property (replacing the distance property of Dijkstra's
|
||||
algorithm) and an edge weight property. We will use a
|
||||
<TT>std::vector</TT> to store the time. The weight property has already
|
||||
been attached to the graph via a plug-in so here we just declare an
|
||||
map for the internal weight property.
|
||||
<P>We start be creating a vector <code>time</code> that will store the
|
||||
time step at which each file can be built. We initialize every value
|
||||
with time step zero.</p>
|
||||
|
||||
<P>
|
||||
<PRE>
|
||||
std::vector<int> time(N, 0);
|
||||
typedef std::vector<int>::iterator Time;
|
||||
using boost::edge_weight_t;
|
||||
typedef boost::property_map<Graph, edge_weight_t>::type Weight;
|
||||
Weight weight = get(edge_weight, g);
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
The next step is to identify the vertices with zero in-degree which
|
||||
will be our ``source'' vertices from which to start the shortest path
|
||||
searches. The in-degrees can be calculated with the following loop.
|
||||
<p>Now, we want to visit the vertices against in topological order,
|
||||
from those files that need to be built first until those that need
|
||||
to be built last. However, instead of printing out the order
|
||||
immediately, we will compute the time step in which each file should
|
||||
be built based on the time steps of the files it depends on. We
|
||||
only need to consider those files whose in-degree is greater than
|
||||
zero.</p>
|
||||
|
||||
<P>
|
||||
<PRE>
|
||||
std::vector<int> in_degree(N, 0);
|
||||
Graph::vertex_iterator i, iend;
|
||||
Graph::out_edge_iterator j, jend;
|
||||
for (boost::tie(i, iend) = vertices(g); i != iend; ++i)
|
||||
for (boost::tie(j, jend) = out_edges(*i, g); j != jend; ++j)
|
||||
in_degree[target(*j, g)] += 1;
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
Next we need to define comparison of the "cost". In this
|
||||
case we want each file to have a time stamp greater than any of its
|
||||
predecessors. Therefore we define comparison with the
|
||||
<TT>std::greater<int></TT> function object. We also need to
|
||||
tell the algorithm that we want to use addition to combine time
|
||||
values, so we use <TT>std::plus<int></TT>.
|
||||
|
||||
<P>
|
||||
<PRE>
|
||||
std::greater<int> compare;
|
||||
std::plus<int> combine;
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
We are now ready to call <TT>uniform_cost_search()</TT>. We just
|
||||
loop through all the vertices in the graph, and invoke the algorithm
|
||||
if the vertex has zero in-degree.
|
||||
|
||||
<P>
|
||||
<PRE>
|
||||
for (boost::tie(i, iend) = vertices(g); i != iend; ++i)
|
||||
if (in_degree[*i] == 0)
|
||||
boost::dijkstra_shortest_paths(g, *i,
|
||||
distance_map(&time[0]).
|
||||
weight_map(weight).
|
||||
distance_compare(compare).
|
||||
distance_combine(combine));
|
||||
</PRE>
|
||||
<pre>
|
||||
for (i = make_order.begin(); i != make_order.end(); ++i) {
|
||||
if (in_degree (*i, g) > 0) {
|
||||
Graph::in_edge_iterator j, j_end;
|
||||
int maxdist = 0;
|
||||
for (tie(j, j_end) = in_edges(*i, g); j != j_end; ++j)
|
||||
maxdist = std::max(time[source(*j, g)], maxdist);
|
||||
time[*i]=maxdist+1;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<P>
|
||||
Last, we output the time-slot that we've calculated for each vertex.
|
||||
@@ -324,9 +288,8 @@ the system will need to report an error to the user so that the cycles
|
||||
can be removed. One easy way to detect a cycle is to run a <a
|
||||
href="./depth_first_search.html">depth-first search</a>, and if the
|
||||
search runs into an already discovered vertex (of the current search
|
||||
tree), then there is a cycle. An already discovered vertex will have
|
||||
been colored gray, so we can insert a check for this color in the
|
||||
depth-first search. The BGL graph search algorithms (which includes
|
||||
tree), then there is a cycle. The BGL graph search algorithms (which
|
||||
includes
|
||||
<TT>depth_first_search()</TT>) are all extensible via the
|
||||
<I>visitor</I> mechanism. A visitor is similar to a function object,
|
||||
but it has several methods instead of just the one
|
||||
@@ -339,9 +302,9 @@ for a detailed description of visitors.
|
||||
<P>
|
||||
We will create a visitor class and fill in the <TT>back_edge()</TT>
|
||||
method, which is the <a href="./DFSVisitor.html">DFSVisitor</a> method
|
||||
that is called when DFS explores a new edge. This is the place where
|
||||
we want to place the color check which will determine whether there
|
||||
are cyclic dependencies. Inheriting from <TT>dfs_visitor<></TT>
|
||||
that is called when DFS explores an edge to an already discovered
|
||||
vertex. A call to this method indicates the existence of a
|
||||
cycle. Inheriting from <TT>dfs_visitor<></TT>
|
||||
provides the visitor with empty versions of the other visitor methods.
|
||||
Once our visitor is created, we can construct and object and pass it
|
||||
to the BGL algorithm. Visitor objects are passed by value inside of
|
||||
@@ -350,21 +313,17 @@ reference in this visitor.
|
||||
|
||||
<P>
|
||||
<PRE>
|
||||
template <class Color>
|
||||
struct cycle_detector : public dfs_visitor<>
|
||||
{
|
||||
typedef typename boost::property_traits<Color>::value_type C;
|
||||
|
||||
cycle_detector(Color c, bool& has_cycle)
|
||||
: _has_cycle(has_cycle), color(c) { }
|
||||
cycle_detector( bool& has_cycle)
|
||||
: _has_cycle(has_cycle) { }
|
||||
|
||||
template <class Edge, class Graph>
|
||||
void back_edge(Edge e, Graph& g) {
|
||||
void back_edge(Edge, Graph&) {
|
||||
_has_cycle = true;
|
||||
}
|
||||
protected:
|
||||
bool& _has_cycle;
|
||||
Color color;
|
||||
bool& _has_cycle;
|
||||
};
|
||||
</PRE>
|
||||
|
||||
@@ -375,7 +334,7 @@ algorithm and pass in the cycle detector visitor.
|
||||
<P>
|
||||
<PRE>
|
||||
bool has_cycle = false;
|
||||
cycle_detector<Color> vis(color, has_cycle);
|
||||
cycle_detector vis(has_cycle);
|
||||
boost::depth_first_search(g, visitor(vis));
|
||||
std::cout << "The graph has a cycle? " << has_cycle << std::endl;
|
||||
</PRE>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Jeremy Siek makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Filtered Graph</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
@@ -44,7 +40,11 @@ the original graph can be changed through property maps of the
|
||||
filtered graph. Vertex and edge descriptors of the filtered graph are
|
||||
the same as, and interchangeable with, the vertex and edge descriptors
|
||||
of the original graph.
|
||||
<P>
|
||||
|
||||
<P>The <a href="#num_vertices"><tt>num_vertices</tt></a> and <a
|
||||
href="#num_edges"><tt>num_edges</tt></a> functions do not filter
|
||||
before returning results, so they return the number of vertices or
|
||||
edges in the underlying graph, unfiltered <a href="#2">[2]</a>.
|
||||
|
||||
<H3>Example</H3>
|
||||
|
||||
@@ -398,7 +398,7 @@ Returns the number of edges entering vertex <tt>u</tt>.
|
||||
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
<pre><a name="num_vertices"></a>
|
||||
vertices_size_type
|
||||
num_vertices(const filtered_graph& g)
|
||||
</pre>
|
||||
@@ -406,11 +406,11 @@ Returns the number of vertices in the underlying graph <a href="#2">[2]</a>.
|
||||
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
<pre><a name="num_edges"></a>
|
||||
edges_size_type
|
||||
num_edges(const filtered_graph& g)
|
||||
</pre>
|
||||
Returns the number of edges in the graph <tt>g</tt>.
|
||||
Returns the number of edges in the underlying graph <a href="#2">[2]</a>.
|
||||
|
||||
<hr>
|
||||
|
||||
@@ -497,16 +497,13 @@ by-value (for performance reasons) in the filter iterator adaptor, and
|
||||
iterators are required to be Default Constructible by the C++
|
||||
Standard.
|
||||
|
||||
<p>
|
||||
<a name="2">[2]</a> It would be nicer to return the number of
|
||||
vertices remaining after the filter has been applied, but
|
||||
this has two problems. The first is that it would take longer
|
||||
to calculate, and the second is that it would interact badly
|
||||
with the underlying vertex index mapping. The index mapping
|
||||
would no longer fall in the range <tt>[0,num_vertices(g))</tt>
|
||||
which is assumed in many of the algorithms. We are working
|
||||
on a solution that will remove that assumption from the
|
||||
algorithms.
|
||||
<p> <a name="2">[2]</a> It would be nicer to return the number of
|
||||
vertices (or edges) remaining after the filter has been applied, but
|
||||
this has two problems. The first is that it would take longer to
|
||||
calculate, and the second is that it would interact badly with the
|
||||
underlying vertex/edge index mappings. The index mapping would no
|
||||
longer fall in the range <tt>[0,num_vertices(g))</tt> (resp. <tt>[0,
|
||||
num_edges(g))</tt>) which is assumed in many of the algorithms.
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- Copyright (c) 2002 Rensselaer Polytechnic Institute
|
||||
--
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Floyd-Warshall All Pairs Shortest Paths</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1><A NAME="sec:floyd-warshall">
|
||||
<TT>floyd_warshall_all_pairs_shortest_paths</TT>
|
||||
</H1>
|
||||
|
||||
<PRE><em>// Named parameters version</em>
|
||||
template <class VertexListGraph, class DistanceMatrix,
|
||||
class P, class T, class R>
|
||||
bool floyd_warshall_initialized_all_pairs_shortest_paths(
|
||||
const VertexListGraph& g, DistanceMatrix& d,
|
||||
const bgl_named_params<P, T, R>& params)
|
||||
|
||||
template <class VertexAndEdgeListGraph, class DistanceMatrix,
|
||||
class P, class T, class R>
|
||||
bool floyd_warshall_all_pairs_shortest_paths(
|
||||
const VertexAndEdgeListGraph& g, DistanceMatrix& d,
|
||||
const bgl_named_params<P, T, R>& params)
|
||||
|
||||
<em>// Positional parameter versions</em>
|
||||
\begin{verbatim}
|
||||
template <typename VertexListGraph, typename DistanceMatrix,
|
||||
typename BinaryPredicate, typename BinaryFunction,
|
||||
typename Infinity, typename Zero>
|
||||
bool floyd_warshall_initialized_all_pairs_shortest_paths(
|
||||
const VertexListGraph& g, DistanceMatrix& d,
|
||||
const BinaryPredicate& compare, const BinaryFunction& combine,
|
||||
const Infinity& inf, const Zero& zero)
|
||||
|
||||
template <typename VertexAndEdgeListGraph, typename DistanceMatrix,
|
||||
typename WeightMap, typename BinaryPredicate,
|
||||
typename BinaryFunction, typename Infinity, typename Zero>
|
||||
bool floyd_warshall_all_pairs_shortest_paths(
|
||||
const VertexAndEdgeListGraph& g, DistanceMatrix& d,
|
||||
const WeightMap& w, const BinaryPredicate& compare,
|
||||
const BinaryFunction& combine,
|
||||
const Infinity& inf, const Zero& zero)</PRE>
|
||||
|
||||
<P>
|
||||
These algorithms find the shortest distance between every pair of
|
||||
vertices in the graph. The algorithms return false if there is a
|
||||
negative weight cycle in the graph, true otherwise. The shortest
|
||||
distance between each pair of vertices is stored in the distance
|
||||
matrix <code>d</code>. The difference between the two algorithms is in
|
||||
whether the distance matrix is assumed to be initialized or not, as
|
||||
discussed below under the OUT parameter description.
|
||||
|
||||
<P>This algorithm should be used to compute shortest paths between
|
||||
every pair of vertices for dense graphs. For sparse graphs, use <a
|
||||
href="johnson_all_pairs_shortest.html"><code>johnson_all_pairs_shortest_paths</code></a>.
|
||||
|
||||
<H3>Where Defined</H3>
|
||||
|
||||
<P>
|
||||
<a href="../../../boost/graph/floyd_warshall_shortest.hpp"><TT>boost/graph/floyd_warshall_shortest.hpp</TT></a>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
IN: <code>Graph& g</code>
|
||||
<blockquote>
|
||||
A directed or undirected graph. The graph must be a model of <a href="VertexListGraph.html">Vertex List Graph</a> for calls to
|
||||
<code>floyd_warshall_initialized_all_pairs_shortest_paths</code>, and
|
||||
<a href="VertexAndEdgeListGraph.html">Vertex And Edge List Graph</a> for calls to
|
||||
<code>floyd_warshall_all_pairs_shortest_paths</code>.<br>
|
||||
</blockquote>
|
||||
|
||||
OUT: <code>DistanceMatrix& d</code>
|
||||
<blockquote>
|
||||
The length of the shortest path between each pair of vertices
|
||||
<code>u</code>,<code>v</code> are
|
||||
stored in the matrix at location <code>D[u][v]</code>. The
|
||||
DistanceMatrix must be
|
||||
of type <code>{M, I, V}</code> where <code>I</code> is of type
|
||||
<code>vertex_descriptor</code> and <code>V</code> is the
|
||||
type of the <code>weight_map</code>. The set of types must be a model of
|
||||
<a href="BasicMatrix.html">BasicMatrix</a>, with the exceptions that
|
||||
it isn't required to
|
||||
run in constant time, and it must be mutable. The matrix must be
|
||||
properly initialized when it is passed to the function
|
||||
<code>floyd_warshall_initialized_all_pairs_shortest_paths</code>. If the
|
||||
function <code>floyd_warshall_all_pairs_shortest_paths</code> is used then the
|
||||
matrix will be initialized for the user.
|
||||
</blockquote>
|
||||
|
||||
<h3>Named Parameters</h3>
|
||||
|
||||
IN: <code>weight_map(WeightMap w)</code>
|
||||
<blockquote>
|
||||
The weight of length of each edge in the graph. The <code>WeightMap</code>
|
||||
must be a model of <a href="../../property_map/ReadablePropertyMap.html">Readable Property
|
||||
Map</a>. The edge descriptor
|
||||
type of the graph needs to be usable as the key type for the weight
|
||||
map. The <code>value_type</code> of the weight map must be the type of the
|
||||
<code>DistanceMatrix</code>, and must always either be part of the
|
||||
graph passed to the function, or passed in as a parameter.<br>
|
||||
<b>Default:</b> <code>get(edge_weight, g)</code>
|
||||
</blockquote>
|
||||
|
||||
IN: <code>distance_compare(CompareFunction cmp)</code>
|
||||
<blockquote>
|
||||
The function used to compare distances to determine which target
|
||||
vertex is closer to the source vertex. The CompareFunction must be a
|
||||
model of <code>BinaryPredicate</code>. The argument types must match the
|
||||
value type of the <code>WeightMap</code>.<br>
|
||||
|
||||
<b>Default:</b> <code>std::less<WM></code>with <code>WM = typename property_traits<WeightMap>::value_type</code>
|
||||
</blockquote>
|
||||
|
||||
IN: <code>distance_combine(CombineFunction cmb)</code>
|
||||
<blockquote>
|
||||
The function used to combine distance to compute the distance of a
|
||||
path. The CombineFunction must be a model of <code>BinaryFunction</code>.
|
||||
The argument types must match the value type of the <code>WeightMap</code>.
|
||||
The result type must be the same as the distance value type.<br>
|
||||
|
||||
<b>Default:</b> <code>std::plus<WM></code> with <code>WM = typename property_traits<WeightMap>::value_type</code>
|
||||
</blockquote>
|
||||
|
||||
IN: <code>distance_inf(WM inf)</code>
|
||||
<blockquote>
|
||||
The value used to initialize the distance for each vertex before
|
||||
starting the algorithm, and to represent the distance between vertices
|
||||
for which there is not path. Should be larger than any possible valid
|
||||
path length. The argument type must match the value type of the <code>
|
||||
WeightMap</code>.<br>
|
||||
|
||||
<b>Default:</b> <code>std::numeric_limits<WM>::max()</code> with <code>WM = typename property_traits<WeightMap>::value_type</code>
|
||||
</blockquote>
|
||||
|
||||
IN: <code>distance_zero(WM zero)</code>
|
||||
<blockquote>
|
||||
The value used to represent the distance from a vertex to itself, and
|
||||
to determine if a value is negative. The argument type must match the
|
||||
value type of the <code>WeightMap</code>.<br>
|
||||
<b>Default:</b> <code>0</code>
|
||||
</blockquote>
|
||||
|
||||
<h3>Complexity</h3>
|
||||
|
||||
The time complexity is <i>O(V<sup>3</sup>)</i>.
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2002-2004</TD><TD>
|
||||
Lauren Foutz, Rensselaer Polytechnic Institute</td>
|
||||
</tr><tr valign="top"><td></td>
|
||||
<td>Scott Hill, Rensselaer Polytechnic Institute
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -0,0 +1,241 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- Copyright (c) 2004 Trustees of Indiana University
|
||||
--
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Fruchterman-Reingold Force-Directed Layout</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
<img src="figs/python.gif" alt="(Python)"/>
|
||||
<TT>fruchterman_reingold_force_directed_layout</TT>
|
||||
</H1>
|
||||
|
||||
|
||||
<P>
|
||||
<PRE>
|
||||
<i>// named parameter version</i>
|
||||
template<typename Graph, typename PositionMap, typename Dim, typename Param,
|
||||
typename Tag, typename Rest>
|
||||
void
|
||||
fruchterman_reingold_force_directed_layout
|
||||
(const Graph& g,
|
||||
PositionMap position,
|
||||
Dim width,
|
||||
Dim height,
|
||||
const bgl_named_params<Param, Tag, Rest>& params);
|
||||
|
||||
<i>// non-named parameter version</i>
|
||||
template<typename Graph, typename PositionMap, typename Dim,
|
||||
typename AttractiveForce, typename RepulsiveForce,
|
||||
typename ForcePairs, typename DisplacementMap, typename Cooling>
|
||||
void
|
||||
fruchterman_reingold_force_directed_layout
|
||||
(const Graph& g,
|
||||
PositionMap position,
|
||||
Dim width,
|
||||
Dim height,
|
||||
AttractiveForce fa,
|
||||
RepulsiveForce fr,
|
||||
ForcePairs fp,
|
||||
Cooling cool,
|
||||
DisplacementMap displacement);
|
||||
|
||||
template<typename Graph, typename PositionMap, typename Dim>
|
||||
void
|
||||
fruchterman_reingold_force_directed_layout(const Graph& g,
|
||||
PositionMap position,
|
||||
Dim width,
|
||||
Dim height);
|
||||
</PRE>
|
||||
|
||||
<P> This algorithm [<A
|
||||
HREF="bibliography.html#fruchterman91">58</A>] performs layout of
|
||||
unweighted, undirected graphs. Unlike the <a
|
||||
href="kamada_kawai_spring_layout.html">Kamada-Kawai</a> layout
|
||||
algorithm, this algorithm directly supports the layout of disconnected
|
||||
graphs (but see the <tt>force_pairs</tt> named parameter). It is a
|
||||
<em>force-directed</em> algorithm, meaning that vertex layout is
|
||||
determined by the forces pulling vertices together and pushing them
|
||||
apart. Attractive forces occur between adjacent vertices only, whereas
|
||||
repulsive forces occur between every pair of vertices. Each iteration
|
||||
computes the sum of the forces on each vertex, then moves the vertices
|
||||
to their new positions. The movement of vertices is mitigated by the
|
||||
<i>temperature</i> of the system for that iteration: as the algorithm
|
||||
progresses through successive iterations, the temperature should
|
||||
decrease so that vertices settle in place. The cooling schedule,
|
||||
attractive forces, and repulsive forces can be provided by the user.
|
||||
|
||||
<p> The vertices are often placed randomly prior to execution of this algorithm via <a href="random_layout.html"><tt>random_graph_layout</tt></a>.
|
||||
|
||||
<h3>Where Defined</h3>
|
||||
|
||||
<a href="../../../boost/graph/fruchterman_reingold.hpp"><tt>boost/graph/fruchterman_reingold.hpp</tt></a>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
|
||||
IN: <tt>const Graph& g</tt>
|
||||
<blockquote>
|
||||
The graph object on which the algorithm will be applied.
|
||||
The type <tt>Graph</tt> must be a model of
|
||||
<a href="./VertexAndEdgeListGraph.html">Vertex And Edge List Graph</a>.<br>
|
||||
<b>Python</b>: This parameter is named <tt>graph</tt> in Python.
|
||||
</blockquote>
|
||||
|
||||
IN/OUT: <tt>PositionMap position</tt>
|
||||
<blockquote>
|
||||
The property map that stores the position of each vertex. It should
|
||||
typically be initialized with the vertices at random locations (use
|
||||
<a href="random_layout.html"><tt>random_graph_layout</tt></a>). The
|
||||
type <tt>PositionMap</tt> must be a model of <a
|
||||
href="../../property_map/LvaluePropertyMap.html">Lvalue Property
|
||||
Map</a> such that the vertex descriptor type of <tt>Graph</tt> is
|
||||
convertible to its key type. Its value type must be a structure
|
||||
with fields <tt>x</tt> and <tt>y</tt>, representing the coordinates
|
||||
of the vertex.<br>
|
||||
<b>Python</b>: The position map must be a <tt>vertex_point2d_map</tt> for
|
||||
the graph.<br>
|
||||
<b>Python default</b>: <tt>graph.get_vertex_point2d_map("position")</tt>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>Dim width</tt>
|
||||
<blockquote>
|
||||
The width of the display area in which layout should occur. On
|
||||
termination of the algorithm, the <tt>x</tt> coordinates of all
|
||||
vertices will fall in <tt>[-width/2, width/2]</tt>.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>Dim height</tt>
|
||||
<blockquote>
|
||||
The height of the display area in which layout should occur. On
|
||||
termination of the algorithm, the <tt>y</tt> coordinates of all
|
||||
vertices will fall in <tt>[-height/2, height/2]</tt>.
|
||||
</blockquote>
|
||||
|
||||
<h3>Named Parameters</h3>
|
||||
|
||||
IN: <tt>attractive_force(AttractiveForce fa)</tt>
|
||||
<blockquote>
|
||||
Computes the magnitude of the attractive force between two adjacent
|
||||
vertices. The function object <tt>fa</tt> must accept four
|
||||
parameters: the edge descriptor, <tt>k</tt>, the distance between the
|
||||
vertices, and the graph. <tt>k</tt> is the square root of the ratio
|
||||
of the display area to the number of vertices. <br>
|
||||
<b>Default:</b> <tt>square_distance_attractive_force()</tt>, which
|
||||
computes the attractive force as <code>dist<sup>2</sup>/k</code>.<br>
|
||||
<b>Python</b>: Any callable Python object that matches the signature will suffice.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>repulsive_force(RepulsiveForce fr)</tt>
|
||||
<blockquote>
|
||||
Computes the magnitude of the repulsive force between any two
|
||||
vertices. The function object <tt>fa</tt> must accept five
|
||||
parameters: the two vertex descriptors, <tt>k</tt>, the distance between the
|
||||
vertices, and the graph. <tt>k</tt> is the square root of the ratio
|
||||
of the display area to the number of vertices. <br>
|
||||
<b>Default:</b> <tt>square_distance_repsulsive_force()</tt>, which
|
||||
computes the repulsive force as <code>k<sup>2</sup>/dist</code>.<br>
|
||||
<b>Python</b>: Any callable Python object that matches the signature will suffice.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>force_pairs(ForcePairs fp)</tt>
|
||||
<blockquote>
|
||||
Enumerates the pairs of vertices on which the repulsive force should
|
||||
be applied. <tt>fp</tt> is a function object taking two parameters:
|
||||
the graph <tt>g</tt> and a binary function object that should be
|
||||
passed each pair of vertices to be considered. The basic formulation
|
||||
of the Fruchterman-Reingold algorithm computes repulsive forces
|
||||
between all pairs of vertices (pass <tt>all_force_pairs()</tt> for
|
||||
this parameter), which is functional for disconnected graphs but
|
||||
tends to push the connected components toward the edges of the
|
||||
display area. The grid variant of the algorithm places a grid over
|
||||
the display area and only computes repulsive forces among vertices
|
||||
within each rectangle in the grid. The grid variant can be more
|
||||
efficient than the basic formulation and tends to produce better
|
||||
layouts for disconnected graphs, but is not better overall: pass
|
||||
<tt>make_grid_force_pairs(width, height, position, g)</tt> as this
|
||||
parameter to use the grid variant. Other enumeration strategies may
|
||||
yield better results for particular graphs. <br>
|
||||
<b>Default:</b> <tt>make_grid_force_pairs(width, height, position, g)</tt><br>
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>cooling(Cooling cool)</tt>
|
||||
<blockquote>
|
||||
Determines the cooling schedule for the algorithm, which affects the
|
||||
rate of movement of vertices and termination of the algorithm. The
|
||||
<tt>cool</tt> parameter is a nullary function object (i.e., one that
|
||||
takes no arguments) and returns the temperature for the current
|
||||
iteration. When the returned temperature is zero, the algorithm
|
||||
terminates. Cooling schedules should begin with some initial
|
||||
temperature and gradually reduce the temperature to zero.<br>
|
||||
<b>Default:</b> <tt>linear_cooling<double>(100)</tt><br>
|
||||
<b>Python</b>: Any callable Python object that matches the signature will suffice.
|
||||
</blockquote>
|
||||
|
||||
UTIL: <tt>displacement_map(DisplacementMap displacement)</tt>
|
||||
<blockquote>
|
||||
The displacement map is used to compute the amount by which each
|
||||
vertex will move in each step. The <tt>DisplacementMap</tt> type
|
||||
carries the same requirements as the <tt>PositionMap</tt> type.<br>
|
||||
<b>Default:</b> An <tt>iterator_property_map</tt> with a value type
|
||||
of <tt>simple_point<double></tt> and using the given vertex index map.<br>
|
||||
<b>Python:</b> Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
<blockquote>
|
||||
This maps each vertex to an integer in the range <tt>[0,
|
||||
num_vertices(g))</tt>. This is only necessary when no
|
||||
displacement map is provided.
|
||||
The type <tt>VertexIndexMap</tt> must be a model of <a
|
||||
href="../../property_map/ReadablePropertyMap.html">Readable Property
|
||||
Map</a>. The value type of the map must be an integer type. The
|
||||
vertex descriptor type of the graph needs to be usable as the key
|
||||
type of the map.<br>
|
||||
<b>Default:</b> <tt>get(vertex_index, g)</tt>
|
||||
Note: if you use this default, make sure your graph has
|
||||
an internal <tt>vertex_index</tt> property. For example,
|
||||
<tt>adjacenty_list</tt> with <tt>VertexList=listS</tt> does
|
||||
not have an internal <tt>vertex_index</tt> property.
|
||||
<br>
|
||||
<b>Python:</b> Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
<b>Python</b> IN: <tt>bool progressive</tt>
|
||||
<blockquote>
|
||||
When <tt>false</tt>, performs a random layout of the graph before
|
||||
running the Fruchterman-Reingold algorithm. If <tt>true</tt>, the
|
||||
algorithm is executing starting with the vertex configuration in
|
||||
the <tt>position</tt> map.<br>
|
||||
<b>Default</b>: <tt>False</tt>.
|
||||
</blockquote>
|
||||
|
||||
<H3>Complexity</H3>
|
||||
|
||||
<P> The time complexity is <i>O(|V|<sup>2</sup> + |E|)</i> for each
|
||||
iteration of the algorithm in the worse case. The average case for the
|
||||
grid variant is <i>O(|V| + |E|)</i>. The number of iterations is
|
||||
determined by the cooling schedule.
|
||||
|
||||
<H3>Example</H3>
|
||||
<a href="../example/fr_layout.cpp">libs/graph/example/fr_layout.cpp</a>
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2004</TD><TD>
|
||||
<A HREF="../../../people/doug_gregor.html">Doug Gregor</A>, Indiana University
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Graph Coloring Example</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
@@ -121,7 +117,7 @@ namespace boost {
|
||||
void
|
||||
smallest_last_ordering(const VertexListGraph& G, Order order,
|
||||
Degree degree, Marker marker,
|
||||
BucketSorter& bucket_sorter) {
|
||||
BucketSorter& degree_buckets) {
|
||||
typedef typename graph_traits<VertexListGraph> GraphTraits;
|
||||
|
||||
typedef typename GraphTraits::vertex_descriptor Vertex;
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Concepts</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. Silicon Graphics makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Graph Theory Review</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
@@ -29,7 +25,7 @@ the reader has some previous acquaintance with graph algorithms, this
|
||||
chapter should be enough to get started. If the reader has no
|
||||
previous background in graph algorithms we suggest a more thorough
|
||||
introduction such as <a
|
||||
href="http://www.toc.lcs.mit.edu/~clr/">Introduction to Algorithms</a>
|
||||
href="http://toc.lcs.mit.edu/~clr/">Introduction to Algorithms</a>
|
||||
by Cormen, Leiserson, and Rivest.
|
||||
|
||||
<P>
|
||||
|
||||
@@ -2,19 +2,15 @@
|
||||
<!--
|
||||
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
|
||||
--
|
||||
-- Permission to use, copy, modify, distribute and sell this software
|
||||
-- and its documentation for any purpose is hereby granted without fee,
|
||||
-- provided that the above copyright notice appears in all copies and
|
||||
-- that both that copyright notice and this permission notice appear
|
||||
-- in supporting documentation. We make no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
-- Distributed under the Boost Software License, Version 1.0.
|
||||
-- (See accompanying file LICENSE_1_0.txt or copy at
|
||||
-- http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Graph Traits</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
<IMG SRC="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||