Compare commits
1626 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 48a6a716d8 | |||
| e553d1acf8 | |||
| 6a287972d4 | |||
| bc3a645196 | |||
| 801a11bf4a | |||
| 07671f91e3 | |||
| 1ef53b2d50 | |||
| 1a4e9ef4ad | |||
| 33af3494f7 | |||
| a1d6cf2106 | |||
| 4af9462b74 | |||
| 1acdecb32f | |||
| 30d0e0ea2a | |||
| 9a9bd728e7 | |||
| 06c0e7e505 | |||
| 7552f02d05 | |||
| b0e4e9fa01 | |||
| 872308b277 | |||
| d819683bf3 | |||
| dd5da5d657 | |||
| 016779276c | |||
| 93dc2b2c0d | |||
| 43b99f3fbe | |||
| 77b148e6db | |||
| 3d07d486b2 | |||
| ee35a986a7 | |||
| 8b185359ef | |||
| c9ac66d0d8 | |||
| 360e769758 | |||
| c4715738db | |||
| b35856b2f3 | |||
| dafc6fbb2b | |||
| 1a184e4e2e | |||
| f789831ba9 | |||
| dfb88dedb4 | |||
| 686376231a | |||
| 791a5f0e72 | |||
| 863b976726 | |||
| f72b7b9d1d | |||
| bec5451742 | |||
| f8960081b2 | |||
| 186d6baaaa | |||
| e7054fb090 | |||
| e9709979de | |||
| c5bcc31f22 | |||
| 1b46340737 | |||
| 8dd497a9f1 | |||
| 39eda77bb0 | |||
| 0fe3f9f7d7 | |||
| 025ae1f7b1 | |||
| 268d57b5f8 | |||
| 5279b7e743 | |||
| e18f677885 | |||
| 615f47676b | |||
| bdf6e6c832 | |||
| be6033bbb8 | |||
| c2b83032f8 | |||
| f925853bb5 | |||
| 00211e9135 | |||
| 5080ba19df | |||
| 6fd494aec2 | |||
| 72769b9017 | |||
| 71c8ff92a2 | |||
| 31b9be10a4 | |||
| 754f3b92ed | |||
| a1d00ed07b | |||
| c4167010e3 | |||
| 92e58bf5eb | |||
| c9fc501377 | |||
| cf6051cbfe | |||
| 3808741d30 | |||
| 3217880ec2 | |||
| f1c6d7b56f | |||
| 6365853620 | |||
| ebc735f49e | |||
| acfe2b5d90 | |||
| c0baa8282c | |||
| 827270f597 | |||
| da1172f268 | |||
| 21526c830a | |||
| ecdbf602d9 | |||
| c192807ea7 | |||
| 817f324a13 | |||
| c8f3f9b06b | |||
| d119620775 | |||
| 863b23408c | |||
| f6b51a43a2 | |||
| c09fa80aca | |||
| 7ade369d3e | |||
| c6f5a9b984 | |||
| b43a2ff6cc | |||
| e7914b3b7a | |||
| f8f08b8d46 | |||
| 450b60114c | |||
| 534e7f6acd | |||
| 23058f4e1c | |||
| 16e79e3bc5 | |||
| 8e7b8bb95c | |||
| ce04079e62 | |||
| ee18592d0f | |||
| 549db6db29 | |||
| c57722a10f | |||
| a18ee8efa5 | |||
| 6995f7fb7e | |||
| d0aeb0072c | |||
| 5e86165add | |||
| b4b0ec400b | |||
| 2b2061df1d | |||
| 7895ca9e8f | |||
| 9b25481ac8 | |||
| 704e2a0894 | |||
| 01b30ee264 | |||
| 519192a2b8 | |||
| 44a6ffef17 | |||
| a836552002 | |||
| faeb40f7c4 | |||
| f09e7ab08c | |||
| 0d65535a49 | |||
| e674c8b9c7 | |||
| 954100837b | |||
| 809904f268 | |||
| 39ffc159eb | |||
| 0f708da558 | |||
| cbbfe23b81 | |||
| cd2f3a3a5c | |||
| 03532e0d20 | |||
| 0cb233c412 | |||
| 8d4c3cc7d6 | |||
| a2843c2352 | |||
| 1c52b10253 | |||
| 0960281a15 | |||
| 891cf5584c | |||
| 0dfbf04a75 | |||
| 0185fdf67e | |||
| aec4a0f301 | |||
| cdde244b46 | |||
| 63fae9d658 | |||
| 803a8be664 | |||
| 43eed0a3ba | |||
| f1677c439a | |||
| 8803f55af9 | |||
| 3e3b80e5c1 | |||
| bae3f3950a | |||
| c6035b97e6 | |||
| 5b53e4e6e8 | |||
| 7ce44fc213 | |||
| cef7692b91 | |||
| 5a3b472a50 | |||
| eaf4275c61 | |||
| a5a3991c22 | |||
| dd5aff7029 | |||
| 71e23c2304 | |||
| d7e37c7b56 | |||
| 7777457d50 | |||
| 670d4d5029 | |||
| 7a9822f533 | |||
| e26020a782 | |||
| b9d8262153 | |||
| 0767d8a8bb | |||
| 288af2017a | |||
| 6f50bbc49d | |||
| 4358d99cb0 | |||
| 6a7fc39328 | |||
| 4f9ff68348 | |||
| aed5fa9949 | |||
| 77d5bf7b80 | |||
| 6671008f35 | |||
| 0596637103 | |||
| 70d7e52335 | |||
| afa1569043 | |||
| 292aea9404 | |||
| 8a9558f06f | |||
| bac69f84de | |||
| 78b6d375a7 | |||
| 17f6ae8dbb | |||
| 23e75246cb | |||
| 6600277899 | |||
| 4520906847 | |||
| e27b8977b4 | |||
| 2ed4a27395 | |||
| 83e3ee4b6c | |||
| 50fba1d79f | |||
| 9572d48a03 | |||
| 51d8d9f6be | |||
| b0e70a45d0 | |||
| 4b61796e41 | |||
| 4844c47f6a | |||
| 968edbe972 | |||
| 69d72805be | |||
| 1eba2f9cc5 | |||
| 6641c154ac | |||
| 6fdfca7d38 | |||
| 4a3510bbf9 | |||
| 62427b821f | |||
| 4a16dd2717 | |||
| 9a15c9fb1e | |||
| 86fb16b3b8 | |||
| db5bab4b99 | |||
| aff71f6147 | |||
| 275e1cb92b | |||
| a3ee4eb038 | |||
| af7369b6b0 | |||
| 06562ff825 | |||
| 9a6339df8d | |||
| 8c22a6d531 | |||
| b49cda6f03 | |||
| 3fbb14a5cf | |||
| 372c7e5740 | |||
| 70e103d1b9 | |||
| 6b4635c403 | |||
| b2724beb09 | |||
| a6daa83472 | |||
| 7f9306dec9 | |||
| 9ad0c6a23c | |||
| 3fdea479bd | |||
| 4a2994c9d7 | |||
| bc707a8f67 | |||
| 38aa3f34d8 | |||
| 2555c89f91 | |||
| 597d89ead2 | |||
| bafd8ea248 | |||
| 4f9ce0c88d | |||
| 5c899afa22 | |||
| 1562d2b1ab | |||
| 8bde5765ab | |||
| 2fbbd52a0e | |||
| 10d71f2365 | |||
| 7db8d06fbf | |||
| ebde55caab | |||
| 0e63ef5f89 | |||
| a9a49a55b7 | |||
| 71f20dd7b6 | |||
| b267aee59c | |||
| b7a5fe292b | |||
| 33640c6bf3 | |||
| f7585c91af | |||
| 9b902b614d | |||
| 7218c1ba66 | |||
| 19dd79f771 | |||
| e9d6adeab1 | |||
| 3a894a9a5f | |||
| 8cbf7d89aa | |||
| 424e529aba | |||
| d73b792b6c | |||
| b39dd26509 | |||
| 7e088fd0ec | |||
| 415b79eabc | |||
| 3ea25dc783 | |||
| 6d2a97d97c | |||
| f94d5a9530 | |||
| f9dcab79b2 | |||
| 3644e4d51a | |||
| d1ae2658f9 | |||
| ae53d6cbbc | |||
| c6c6be7ae0 | |||
| 1533e730ae | |||
| b98298ab98 | |||
| cf6006d528 | |||
| ccf09ceddf | |||
| bb1977b17a | |||
| 476e8dd7d1 | |||
| 23e8514ac7 | |||
| ecedcaa5a3 | |||
| aa97fdc26a | |||
| 07eee8a2a1 | |||
| e45cfb0ee3 | |||
| f865d6209e | |||
| 231f4c3573 | |||
| 40af610e8f | |||
| 751f8b5b7c | |||
| 73f24694dd | |||
| 5255835126 | |||
| 341a685ff1 | |||
| 6365afac60 | |||
| c28a996668 | |||
| 23ca414964 | |||
| c09b24159b | |||
| eb60f8c235 | |||
| 3884b842c6 | |||
| 05a4441935 | |||
| 8e5d48c839 | |||
| da3b568cb4 | |||
| e9747c0143 | |||
| e54f2934e1 | |||
| c691ac49f7 | |||
| fa42d8aa92 | |||
| 40ffa294a2 | |||
| b2be8e3dfc | |||
| 98d0755817 | |||
| 2f99e5b87f | |||
| 1cc2f6e13a | |||
| 2006d41573 | |||
| 4bda985420 | |||
| 666a919f70 | |||
| 03560ab9ae | |||
| a86a446429 | |||
| 8dfc1ad52c | |||
| dcb43119d5 | |||
| aa79cb6919 | |||
| 9d3d4e9a44 | |||
| 5461181e7f | |||
| d0432740ef | |||
| e6cd5bc377 | |||
| 148c441158 | |||
| a080a480ce | |||
| 1dfcd0e6fb | |||
| f3c29e22d2 | |||
| f6a8e8c66e | |||
| 54ff05ca06 | |||
| 1b69ebe5b5 | |||
| efcb9317fc | |||
| 96f923a52e | |||
| 45d0f1331b | |||
| 9445aff028 | |||
| f65f09bba9 | |||
| 43f0e01be5 | |||
| 7fdb4af8f6 | |||
| 660107b872 | |||
| ee9b816984 | |||
| e79c27b97b | |||
| 3125c8577d | |||
| b2bc98e410 | |||
| 4c8c2403c8 | |||
| 02cdd5c0f8 | |||
| 1f84c5b232 | |||
| 78d2fd885f | |||
| efa2fe286f | |||
| 45a2d06d94 | |||
| 55d57690f1 | |||
| 3f97161db1 | |||
| 0f49c8dcb2 | |||
| fcf80df5f9 | |||
| 85dd95cf77 | |||
| 1d8d4322d2 | |||
| 15d8e1dc21 | |||
| 99a56222da | |||
| 3bec282dbd | |||
| 3d5661096c | |||
| dfb49e339d | |||
| b493c0ea47 | |||
| c4a7c8cd37 | |||
| 64b6038f92 | |||
| 9d8f8ce0cd | |||
| fbd5c5120f | |||
| 46ae2cb6c1 | |||
| 83e26c7109 | |||
| d83d611b18 | |||
| 4af336e307 | |||
| e53d23d7d7 | |||
| 401165fe0c | |||
| 7e7359b330 | |||
| a728a94caa | |||
| 833169b3a0 | |||
| 770cce09ef | |||
| a237fb8cd9 | |||
| 79a1ef7d8f | |||
| dde01478fe | |||
| 41051db37b | |||
| 0a8a6f0812 | |||
| 1cfa23497b | |||
| 99d4f31d38 | |||
| a86397fc34 | |||
| 2c884b70b7 | |||
| 3c852ac7a0 | |||
| 0cb7bbf192 | |||
| a306a8119f | |||
| 88edab5b45 | |||
| b0474f1dd9 | |||
| 21b9a9f799 | |||
| 59ba89640e | |||
| d1c241d77e | |||
| 83e6c4a9c3 | |||
| 3ae3292696 | |||
| e0367b4a21 | |||
| f1257a09d1 | |||
| f4e0af95f1 | |||
| 4c5c2fc303 | |||
| 344dd6b155 | |||
| 392f5fa635 | |||
| bf2f7f86fa | |||
| cc4f49d760 | |||
| 0d2d95b2f2 | |||
| 58e287d115 | |||
| e505bf99db | |||
| d34d447b68 | |||
| a03ed0e26d | |||
| 9233499dbc | |||
| f4b0928c2d | |||
| 04fea004d9 | |||
| bc49236ccc | |||
| 73b6ddc2d4 | |||
| d4db30f9d3 | |||
| 3a07fe7c22 | |||
| a7c753ded9 | |||
| ac847ac715 | |||
| 47214f4fdc | |||
| ec2dcfddbb | |||
| ec7156274d | |||
| 9badc94845 | |||
| 39b29f3d79 | |||
| 65f63fecc1 | |||
| 7c5f9daa62 | |||
| 62cc164059 | |||
| fc6ec3f791 | |||
| 560f485326 | |||
| b47cf53fcb | |||
| 5898cc5bae | |||
| 0d30a51129 | |||
| 1035ddac56 | |||
| ce0f796b84 | |||
| 1b3a6936a2 | |||
| ad8a07eb09 | |||
| b659351ea7 | |||
| ff7a5d1282 | |||
| cfe0e0b552 | |||
| 50b1f74b93 | |||
| bf73135721 | |||
| 826f7a33d8 | |||
| 1b468cb8aa | |||
| fcd3996f0e | |||
| 05a7299c0e | |||
| e5848fee44 | |||
| fb06d7e38e | |||
| ebb6697936 | |||
| 77e5f0701d | |||
| 53f5645393 | |||
| 6b24966483 | |||
| ac1e867af4 | |||
| 62c6d9ef2f | |||
| 69c5cf732c | |||
| 0b1a337f52 | |||
| f44af6dd2f | |||
| 891ec4e4e3 | |||
| 96a3f1fa67 | |||
| 64428fc074 | |||
| 9a10195600 | |||
| fcf5d92ca6 | |||
| 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 | |||
| abd8f2aa84 | |||
| 9d583a1a91 | |||
| ffce9c06c9 | |||
| aa9b63ba07 | |||
| 818dcc73b0 | |||
| b6201b1288 | |||
| e0f1e4c036 | |||
| 324d895dd9 | |||
| 7f51375fc2 | |||
| 890769706d | |||
| 0fd24218e9 | |||
| 42a08f3ca5 | |||
| 278ba5a845 | |||
| decc08bb0e | |||
| 33913b20ea | |||
| 811cf59a54 | |||
| 40644bc5ed | |||
| 40e3b28909 | |||
| 924e1b1d9a | |||
| e60f34fca2 | |||
| 07fe2aafa3 | |||
| 276e86d0a6 | |||
| d11130909b | |||
| 668d9c7599 | |||
| 0658669b79 | |||
| 291b56aba0 | |||
| b21c4393ae | |||
| e7a047c5b1 | |||
| 196baddc84 | |||
| 6bd9634bda | |||
| 8febef8989 | |||
| a8a1df5ff2 | |||
| 63a8ee23c5 | |||
| 5a1526cc3b | |||
| 5b84611a39 | |||
| 7fbc23e3dd | |||
| b39891a708 | |||
| 3577a626b0 | |||
| a5abf00cc7 | |||
| 121bb31837 | |||
| 49e55bc606 | |||
| fd543d5fae | |||
| f52b93625f | |||
| 87bc680518 | |||
| 49d479632c | |||
| 3c65d754ee | |||
| 096c3d9eb2 | |||
| 6b3a136853 | |||
| c0fde285cd | |||
| e830cec2bf | |||
| a2c237a85d | |||
| ca79276a10 | |||
| edaf9a56b3 | |||
| 9b195bb299 | |||
| 9a6f00eb12 | |||
| 487bb3ad72 | |||
| b174cc0adf | |||
| 5f98c9923c | |||
| fd2844b35a | |||
| 81a1368fab | |||
| 50270ae7ba | |||
| 894905388c | |||
| 09488ccbbc | |||
| 8121e5394a | |||
| d8e0253233 | |||
| ab5cb5e51d | |||
| e530bade5b | |||
| b352541b14 | |||
| 4b9b46cf49 | |||
| dac729c926 | |||
| 03b8ab6734 | |||
| 015276d003 | |||
| f4d8b68e0e | |||
| 6715b847ca | |||
| 925ab9b163 | |||
| 5dfedd00db | |||
| bc232d0067 | |||
| 0f7fc74966 | |||
| fa46936c98 | |||
| f84665b72d | |||
| f8e19bd4e4 | |||
| 659b99dec8 | |||
| 2bab353870 | |||
| e6b7dfe69f | |||
| 566ded5df3 | |||
| df7037fba6 | |||
| c62a911429 | |||
| a1d45dfb0b | |||
| 04f72dd932 | |||
| 134e931fbc | |||
| 7e7074703d | |||
| ad6d5c75cd | |||
| 91f7d0d42d | |||
| 55581ff209 | |||
| 0fab95269c | |||
| e5f983c453 | |||
| e655580dcb | |||
| c275c502b6 | |||
| 508e8bcbed | |||
| 3e006dd6ea | |||
| 661eca78a1 | |||
| 1adbc147f1 | |||
| 0e88c8cf7a | |||
| e5a5be0d1d | |||
| ceb987e999 | |||
| aaf7b3191f | |||
| f5bf31f89d | |||
| bf177b12af | |||
| 8ec64fdd02 | |||
| 8840131daf | |||
| e055b2625c | |||
| 37f92a391c | |||
| 8a6fe44c8a | |||
| eefda06d3d | |||
| de72dd0fae | |||
| 3e954fede7 | |||
| 90a09357c7 | |||
| 1501df6386 | |||
| 329d43b6c6 | |||
| f7de068589 | |||
| 42852a6cf9 | |||
| f16a9890bf | |||
| 39104a5514 | |||
| 25dcd6f92c | |||
| 1b25060368 | |||
| 2b6b96b97d | |||
| 4e687216b7 | |||
| fdb0f8e6b4 | |||
| b3e7396c37 | |||
| 397ddb31ea | |||
| ea1bc03f71 | |||
| 69762c75ec | |||
| 58c22c7cf9 | |||
| a976e279a4 | |||
| b50bae2b22 | |||
| cfbf43e814 | |||
| a22326d2b5 | |||
| bb9e4ebe4a | |||
| 49488dd54a | |||
| 5c190c2da5 | |||
| 6a35e532d7 | |||
| e9152d8d8d | |||
| 8608ebaf0a | |||
| 258587e952 | |||
| 8fc0b12e34 | |||
| 8d4aaff25f | |||
| cad149a5de | |||
| 08bb638505 | |||
| 9f7c65022d | |||
| 4c668211c7 | |||
| 54a5a4a7a3 | |||
| 019cfbf502 | |||
| 6668dc65b8 | |||
| 6fea41727d | |||
| 4333f4c3f2 | |||
| 0415430b37 | |||
| ed7f263840 | |||
| dfb53a9695 | |||
| 274a57af77 | |||
| 185c8b4c66 | |||
| de3cf1c17c | |||
| 8e398e19c2 | |||
| 2647cb69a5 | |||
| 6778c5eaed | |||
| 85e8916e35 | |||
| 9dc4ef0c22 | |||
| f4392384c1 | |||
| 60d885a95f | |||
| 7578421de9 | |||
| b1fd572469 | |||
| 42e13e2f11 | |||
| 149b84cb99 | |||
| ac633fd8e5 | |||
| 6b08404083 | |||
| 22cb1e04ca | |||
| 87f63c1241 | |||
| 7085a2c7d9 | |||
| e4582d5118 | |||
| f18494eb54 | |||
| 9d978e16b2 | |||
| 74a679b769 | |||
| ccaaef7a72 | |||
| 0bbfbb9bdd | |||
| d9686745b8 | |||
| 73f3dc1a92 | |||
| a500eba00d | |||
| 39e27bc6a7 | |||
| 0f0cc3de96 | |||
| 7b96312a72 | |||
| f16dfaf309 | |||
| 595c3708ed | |||
| 877606cb52 | |||
| 802453b397 | |||
| 63cedbcc9c | |||
| c36c15cd47 | |||
| e0620c90c0 | |||
| 2d62520f3a | |||
| e7056e65de | |||
| 7fb2d45363 | |||
| 99fc1b170d | |||
| 42526b9ca5 | |||
| d70300766c | |||
| d5573da050 | |||
| b2ac4c2743 | |||
| eeefccf435 | |||
| 834d6ad8fd | |||
| 63290266da | |||
| ad88071877 | |||
| 1efa4097a2 | |||
| 2d30710ee0 | |||
| 76054ca8be | |||
| a78fe97664 | |||
| 1ef5b2d0f9 | |||
| 44ced84aa0 | |||
| 443172599b | |||
| 3ef6deec39 | |||
| ab2cb2b3d7 | |||
| 6394da10fb | |||
| 64f6b89c03 | |||
| 261dd8ab7b | |||
| c265a5d47c | |||
| f66b70570f | |||
| 41d9380175 | |||
| fc7d71789b | |||
| 3f735f2066 | |||
| b98e1687c2 | |||
| 49cf35b0ea | |||
| 0604ad7274 | |||
| e58e655b29 | |||
| 55581ebe44 | |||
| c5e6fda4de | |||
| 5ccae0f486 | |||
| f700be45cb | |||
| 2b112dcc11 | |||
| 50bd678384 | |||
| 9c5a05fba6 | |||
| 2c0ed06838 | |||
| 9c82870ba5 | |||
| 256fe97529 | |||
| d6c4087341 | |||
| 3f58e4d848 | |||
| f0ef1e67c2 | |||
| f49745c09c | |||
| 5df6b464fd | |||
| f458bf4b08 | |||
| bef01875bd | |||
| a671d97270 | |||
| e5b75b438e | |||
| aeb2d4a45c | |||
| e33c3b85f7 | |||
| cff7729134 | |||
| a49d3b463c | |||
| de0a153c53 | |||
| 8dc5ae74ee | |||
| cf7d296292 | |||
| c6976a6822 | |||
| 152ed87d83 | |||
| 130f137390 | |||
| 537acfbe1d | |||
| c2fa135465 | |||
| 4bb358841d | |||
| 6fa4c596fd | |||
| e4fa3d9e19 | |||
| 49c91d57a5 | |||
| fce3fe6ca6 | |||
| 4d9bc14e69 | |||
| d1f60541d9 | |||
| 22e8f37c3c | |||
| 97cab7e93e | |||
| b496ac4ede | |||
| f4f24955cb | |||
| b1c0d0f6c1 | |||
| c2cc2f1530 | |||
| dcb0dd0aa5 | |||
| e7c0d34a98 | |||
| b160dcdba8 | |||
| ed4bdc2417 | |||
| 6849cde487 | |||
| df3219f2cb | |||
| 750bd9a13d | |||
| b1784b9ebb | |||
| 7a31d48962 | |||
| 54f558ea0e | |||
| efa71a63bc | |||
| ab6d7a4b45 | |||
| b656236dfe | |||
| 64a41688bf | |||
| 097001da6a | |||
| 6fda589723 | |||
| 08b26e3f3b | |||
| b761b44a0d | |||
| 68b55f244d | |||
| 02ac6db93d | |||
| 12e472b741 | |||
| 994bbd5f4a | |||
| b18c5360ae | |||
| 73f8ed8f4c | |||
| 36a92c7f3b | |||
| aa0d999d15 | |||
| 33cca10d36 | |||
| 6f93b9d06d | |||
| fef88c6398 | |||
| bab22e8995 | |||
| 320200fbc5 | |||
| a2bf3d5d57 | |||
| 53c4b7e6cd | |||
| 2f2c90247e | |||
| ec25450524 | |||
| a0061ba07e | |||
| 5de2e1da53 | |||
| 980ba2c8ad | |||
| cc16790818 | |||
| d843017353 | |||
| 303d7671d8 | |||
| db43b1c850 | |||
| 7a1792c83c | |||
| c07cc82a4f | |||
| 14864367bd | |||
| 0a47324e23 | |||
| ab92236d78 | |||
| ff79797a30 | |||
| 8ddcdfd33e | |||
| dcde366d0e | |||
| 91d0af6c3c | |||
| fbb9320ea5 | |||
| f59476b6bf | |||
| 170c7d20fb | |||
| 25302ccbd7 | |||
| ed5bbee076 | |||
| 449d4a1155 | |||
| a722c03e20 | |||
| 05ca32e656 | |||
| 7234e21211 | |||
| 14df1ae19d | |||
| 571a855bbc | |||
| d54ebbf4bb | |||
| c31151437a | |||
| 9177957cfc | |||
| c8d186e50b | |||
| 352099dc87 | |||
| 0d9e90200b | |||
| 28d9222735 | |||
| 6503c7a8bc | |||
| 63cefa95f7 | |||
| 80b5933e0a | |||
| 80d971a7ab | |||
| 49fd1e8397 | |||
| 385f6886ad | |||
| 28946e60d2 | |||
| fea0a73313 | |||
| 7d838ee7a4 | |||
| 7ecf6f59a6 | |||
| bf33e66413 | |||
| 877f0d3b04 | |||
| e88bd871cb | |||
| 01a7242fc0 | |||
| 04c9f2a7d0 | |||
| 1ee576fea0 | |||
| 2f33232ea8 | |||
| f31e26f473 | |||
| cd177c8c15 | |||
| dfab7321dd | |||
| 4ac3b7c269 | |||
| ffc5a92b41 | |||
| 96fb1f3fac | |||
| 2af0e49c87 | |||
| 4585685c64 | |||
| f576c1828d | |||
| 0be3562844 | |||
| 79847fd163 | |||
| 1a29ad2c7a | |||
| 294cf572a3 | |||
| 7385173288 | |||
| 04ef43e4ac | |||
| cba36c6033 | |||
| 95120649d2 | |||
| 6b3b2d1c0c | |||
| 6605341a1e | |||
| ec28f6c8ee | |||
| 0385bca4b7 | |||
| 3601ab7b4a | |||
| 73f41b8785 | |||
| e579bf2cd1 | |||
| e4eb759d59 | |||
| 076be173e2 | |||
| 04bc75cd40 | |||
| 90cc4a95b4 | |||
| f664ee3baf | |||
| 140de98250 | |||
| 43efa28d29 | |||
| 74c9fa60de | |||
| 90e70dce7b | |||
| ea5aa3d107 | |||
| 01b3ee1c64 | |||
| 7eef43cea8 | |||
| 2c10480b28 | |||
| 7162fea287 | |||
| 304765a5ca | |||
| 4e958ba352 | |||
| 1c9b7a86f5 | |||
| 2d22a32f3a | |||
| f3ddfbfead | |||
| 3ddd054124 | |||
| 7d403bc6c7 | |||
| cb16f8a63e | |||
| a2fa9cf2cb | |||
| df1d831cdf | |||
| 6fb684c821 | |||
| 561ac6b939 | |||
| d65232abaa | |||
| e6aa3b06b0 | |||
| 1c31f8cafa | |||
| 1ffe30f89b | |||
| e7dda7eb6d | |||
| 4b7aa8fc4b | |||
| 86e7e07e2e | |||
| fbe3b430e0 | |||
| 048cf582e2 | |||
| 21ba3be83c | |||
| 2caa382c9d | |||
| af826c7074 | |||
| 8c5fc2a96e | |||
| 8888e44a0f | |||
| d5d69d0c82 | |||
| 44c8e75c2e | |||
| 98f6b487bd | |||
| f67afc52c8 | |||
| deb9d39027 | |||
| e52aa12a74 | |||
| 398aad812f | |||
| 1dd9c54a19 | |||
| bb278dfd8b | |||
| d265125e8f | |||
| 91afa63044 | |||
| c0176700a6 | |||
| bb0fc3a38c | |||
| 36e2a3074f | |||
| 3ec7cee5e2 | |||
| f79bd7ef42 | |||
| 4b772c3f03 | |||
| e3afc20360 | |||
| 5390ee0f7d | |||
| 5215e9b4f2 | |||
| d5f559e652 | |||
| 3bbe76382d | |||
| 393fa73878 | |||
| b32f7d7176 | |||
| 3521815d8c | |||
| ce7f13f760 | |||
| 1dd8aff67f | |||
| 35c92a9f40 | |||
| 167cd7ec62 | |||
| 77172b101e | |||
| c32f22631b | |||
| 223235a0f1 | |||
| 04c4df910d | |||
| 36da83ffe1 | |||
| c78cc61a52 | |||
| d08fbf9e34 | |||
| 0d833d261b | |||
| b6df85d0ff | |||
| 2c4ae14fbf | |||
| 61ba919d47 | |||
| f96a2347c0 | |||
| e60c67fa0c | |||
| 14dee94585 | |||
| 1af19ce75c | |||
| 918a13fd5d | |||
| 5254133ebc | |||
| bac38fd476 | |||
| b5cbee0b18 | |||
| ea0713d477 | |||
| d01e32a0c8 | |||
| f41fc4c8b0 | |||
| 02f68e8e0c | |||
| da4c8f3c59 | |||
| a8ccda6a94 | |||
| 78e6dc44cd | |||
| eb75d45b7d | |||
| cac9c7c670 | |||
| 741ac3cc5d | |||
| 37cfe92cd1 | |||
| be7fdbbc90 | |||
| 65c4f217e1 | |||
| 0adf317473 | |||
| 80d97db4d4 | |||
| 1490d11dc1 | |||
| 108ac662db | |||
| 63cb03ee66 | |||
| 936ea6d201 | |||
| 0868a30bf4 | |||
| 753f3deacc | |||
| 020fff0e68 | |||
| 8e55436641 | |||
| e49c09dbcc | |||
| 9f189ea251 | |||
| 06e257cca1 | |||
| 585bdc4581 | |||
| 92f34d87cf | |||
| 4978760586 | |||
| 78221a7d9d | |||
| f1218f29c1 | |||
| 8e883f6b8d | |||
| ebc42db0ac | |||
| a8169117e7 | |||
| 38d9e1c16a | |||
| fce1e474de | |||
| 79c23ef37c | |||
| 8dbcb2cc35 | |||
| 3633d698d5 | |||
| f4bee8e49d | |||
| 62e5677397 | |||
| 2b15915418 | |||
| 866581da18 | |||
| a53afa3f85 | |||
| d7fef57674 | |||
| cc7bb99dab | |||
| 2161263943 | |||
| 96f1e05c68 | |||
| 3573eca026 | |||
| 74f52fff4f | |||
| 1217a3640e | |||
| b7e10fba1e | |||
| 63801dee89 | |||
| 2dd42cbdec | |||
| 377af01609 | |||
| 6dba429c3c | |||
| 1cf5ee7e9a | |||
| ee45d0c93b | |||
| 1c27e7e1d7 | |||
| a28c64e02b | |||
| cab2ffe94b | |||
| af8a8a7515 | |||
| 3bd53a6cb9 | |||
| 87ada367fc | |||
| 298381d563 | |||
| a37ace5bd1 | |||
| 66e3331645 | |||
| 11143f35ed | |||
| a91c4c778d | |||
| 1b5044517d | |||
| 56ea9ab04f | |||
| fca2523c70 | |||
| f0b9143ff4 | |||
| fe0e452635 | |||
| 1f770d8cd5 | |||
| ca4b4c2b95 | |||
| 7c4b90d3a5 | |||
| df74e82f30 | |||
| 3be7ee713c | |||
| 8496830250 | |||
| 1b2fdeaa9a | |||
| df57d4ff71 | |||
| 888fd95090 | |||
| cb8b64e33f | |||
| f380608408 | |||
| c4c208cec5 | |||
| c609181bad | |||
| 76de551288 | |||
| 637c6d4b63 | |||
| 8aa0fb3e96 | |||
| 565759091a | |||
| 06984ec09b | |||
| 6f356bf76d | |||
| e415495f7a | |||
| 2af0b6c3e9 | |||
| d4d81791c3 | |||
| b4cd14409b | |||
| ead0a2ab0c | |||
| 0d06c41821 | |||
| 55cda1fbf2 | |||
| b97932bca6 | |||
| dd69c282a0 | |||
| 5e537cd741 | |||
| 32166306cc | |||
| 10e4fe85dd | |||
| 55f4d9f571 | |||
| 9c6f2e13b1 | |||
| d56e2dcca3 | |||
| d3afb05747 | |||
| 1ae3184d72 | |||
| 03c5d4bd5d | |||
| 3f2ba8e6c5 | |||
| efb7469f57 | |||
| 1a0b0ad901 | |||
| 71b616180a | |||
| 310050bc6a | |||
| 7c75d7dfce | |||
| 8235b88eed | |||
| 02a997f4be | |||
| c2f7b66d73 | |||
| 6180f6a138 | |||
| f9001b444a | |||
| 68335c5b4c | |||
| 4452ae08bb | |||
| b528c8d862 | |||
| 28696f5d5f | |||
| 3babab2bc3 | |||
| 36e574eeaa | |||
| 475917ad0c | |||
| d3fe34a860 | |||
| 009b171767 | |||
| 8be1db0687 | |||
| ad26f14c4d | |||
| f861bff900 | |||
| bed761e2c2 | |||
| db5a2b138d | |||
| 27960ba125 | |||
| 2251bbcb88 | |||
| c657912300 | |||
| 7530c853c1 | |||
| 93cdbc1d92 | |||
| 6509b5286c | |||
| 26229bc41d | |||
| 61a1d47e50 | |||
| b4b3d54454 | |||
| e2a15d933f | |||
| ccd4026450 | |||
| 0e5921515b | |||
| ce55233841 | |||
| 7762b3049e | |||
| 75c8652d82 | |||
| 6d9d3154ab | |||
| e662337924 | |||
| f71a3a3ec1 | |||
| 71c875133a | |||
| 00979a015f | |||
| 7f90a53c3f | |||
| 796580e232 | |||
| abe493726d | |||
| b7584b6716 | |||
| 8e26b31654 | |||
| 62d252cf30 | |||
| 6112510ccc | |||
| 03bdb90920 | |||
| 770d1be136 | |||
| 1d119b7e06 | |||
| f93174117d | |||
| dd326e44e1 | |||
| 46c4758971 | |||
| 08ebd39282 | |||
| 19ba74383b | |||
| b6d8de4cf9 | |||
| 2ddd8e0d87 | |||
| 0263065191 | |||
| 4e539c158a | |||
| 2466d4a818 | |||
| 980457c573 | |||
| 5615f1a34c | |||
| 66220c880f | |||
| 2b3b105bf8 | |||
| 49a7b57153 | |||
| c0c2fa34e6 | |||
| 6d14ca4278 | |||
| d2e2138c91 | |||
| 80c5421f5f | |||
| ce5ff30b1b | |||
| a1932a87df | |||
| a81199c4e8 | |||
| c39e9ba90d | |||
| 96c4ead801 | |||
| fd57957914 | |||
| da9b33a3d7 | |||
| aefe4d6b63 | |||
| c6f11d4bb7 | |||
| f4448a194c | |||
| 8209340d08 | |||
| af755d81cc | |||
| c11c698bec | |||
| ad8fc9ca0d | |||
| e0b96232d1 | |||
| 70a5ab79dd | |||
| fc1154b36e | |||
| 64bbd3a721 | |||
| c23f3afebe | |||
| 7824b8c5aa | |||
| eb9d16cd24 | |||
| 6447f3e0c1 | |||
| ff68b1284a | |||
| 66504e2668 | |||
| 4e87a15181 | |||
| 28e89ff16d | |||
| 10e21dd82f | |||
| 43a267a1a3 | |||
| e459d66d3f | |||
| d2259781a1 | |||
| 1c74d2312d | |||
| b0e3fe0c55 | |||
| 8ba27d50f6 |
@@ -1,100 +0,0 @@
|
||||
COPYRIGHT NOTICE:
|
||||
|
||||
Copyright 1997-2000, University of Notre Dame.
|
||||
Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
|
||||
|
||||
The Boost Graph Library "Artistic License"
|
||||
|
||||
Preamble
|
||||
|
||||
The intent of this document is to state the conditions under which a
|
||||
Package may be copied, such that the Copyright Holder maintains some
|
||||
semblance of artistic control over the development of the package,
|
||||
while giving the users of the package the right to use and distribute
|
||||
the Package in a more-or-less free fashion, plus the right to make
|
||||
reasonable modifications.
|
||||
|
||||
Definitions
|
||||
|
||||
"Package" refers to the collection of files distributed by the
|
||||
Copyright Holder, and derivatives of that collection of files created
|
||||
through textual modification.
|
||||
|
||||
"Standard Version" refers to such a Package if it has not been
|
||||
modified, or has been modified in accordance with the wishes of the
|
||||
Copyright Holder as specified below.
|
||||
|
||||
"Copyright Holder" is whoever is named in the copyright or copyrights for the package.
|
||||
|
||||
"You" is you, if you're thinking about copying or distributing this Package.
|
||||
|
||||
"Reasonable copying fee" is whatever you can justify on the basis of
|
||||
media cost, duplication charges, time of people involved, and so
|
||||
on. (You will not be required to justify it to the Copyright Holder,
|
||||
but only to the computing community at large as a market that must
|
||||
bear the fee.)
|
||||
|
||||
"Freely Available" means that no fee is charged for the item itself,
|
||||
though there may be fees involved in handling the item. It also means
|
||||
that recipients of the item may redistribute it under the same
|
||||
conditions they received it.
|
||||
|
||||
1. You may make and give away verbatim copies of the source form of
|
||||
the Standard Version of this Package without restriction, provided
|
||||
that you duplicate all of the original copyright notices and
|
||||
associated disclaimers.
|
||||
|
||||
2. You may apply bug fixes, portability fixes and other modifications
|
||||
derived from the Public Domain or from the Copyright Holder. A Package
|
||||
modified in such a way shall still be considered the Standard Version.
|
||||
|
||||
3. You may otherwise modify your copy of this Package in any way,
|
||||
provided that you insert a prominent notice in each changed file
|
||||
stating how and when you changed that file, and provided that you do
|
||||
at least ONE of the following:
|
||||
|
||||
a. place your modifications in the Public Domain or otherwise make
|
||||
them Freely Available, such as by posting said modifications to Usenet
|
||||
or an equivalent medium, or placing the modifications on a major
|
||||
archive site such as uunet.uu.net, or by allowing the Copyright Holder
|
||||
to include your modifications in the Standard Version of the Package.
|
||||
b. use the modified Package only within your corporation or organization.
|
||||
c. rename any non-standard types and functions so the names do not
|
||||
conflict with Standard Vibrary, which must also be provided, and
|
||||
provide a separate documentation for each non-standard type of function
|
||||
that clearly documents how it differs from the Standard Version.
|
||||
d. make other distribution arrangements with the Copyright Holder.
|
||||
|
||||
4. You may charge a reasonable copying fee for any distribution of this
|
||||
Package. You may charge any fee you choose for support of this
|
||||
Package. You may not charge a fee for this Package itself. However,
|
||||
you may distribute this Package in aggregate with other (possibly
|
||||
commercial) programs as part of a larger (possibly commercial)
|
||||
software distribution provided that you do not advertise this Package
|
||||
as a product of your own.
|
||||
|
||||
5. The name of the Copyright Holder may not be used to endorse or
|
||||
promote products derived from this software without specific prior
|
||||
written permission.
|
||||
|
||||
DISCLAIMER:
|
||||
|
||||
LICENSOR MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED.
|
||||
By way of example, but not limitation, Licensor MAKES NO
|
||||
REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY
|
||||
PARTICULAR PURPOSE OR THAT THE USE OF THE LICENSED SOFTWARE COMPONENTS
|
||||
OR DOCUMENTATION WILL NOT INFRINGE ANY PATENTS, COPYRIGHTS, TRADEMARKS
|
||||
OR OTHER RIGHTS.
|
||||
|
||||
The Authors and the University of Notre Dame du Lac shall not be held
|
||||
liable for any liability nor for any direct, indirect or consequential
|
||||
damages with respect to any claim by LICENSEE or any third party on
|
||||
account of or arising from this Agreement or use of this software.
|
||||
|
||||
Any disputes arising out of this Agreement or LICENSEE'S use of the
|
||||
software at any time shall be resolved by the courts of the state of
|
||||
Indiana. LICENSEE hereby consents to the jurisdiction of the Indiana
|
||||
courts and waives the right to challenge the jurisdiction thereof in
|
||||
any dispute arising out of this Agreement or Licensee's use of the
|
||||
software.
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
# 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)
|
||||
|
||||
import mpi ;
|
||||
|
||||
project boost/graph
|
||||
: requirements <include>../src
|
||||
: source-location ../src
|
||||
;
|
||||
|
||||
local optional_sources ;
|
||||
local optional_reqs ;
|
||||
|
||||
if [ modules.peek : EXPAT_INCLUDE ] && [ modules.peek : EXPAT_LIBPATH ]
|
||||
{
|
||||
local EXPAT_INCLUDE = [ modules.peek : EXPAT_INCLUDE ] ;
|
||||
local EXPAT_LIBPATH = [ modules.peek : EXPAT_LIBPATH ] ;
|
||||
|
||||
if --debug-configuration in [ modules.peek : ARGV ]
|
||||
{
|
||||
ECHO "Expat include directory: $(EXPAT_INCLUDE)" ;
|
||||
ECHO "Expat library directory: $(EXPAT_LIBPATH)" ;
|
||||
}
|
||||
|
||||
alias graphml
|
||||
: graphml.cpp
|
||||
: # requirements
|
||||
: # default built
|
||||
: # usage requirements
|
||||
<include>$(EXPAT_INCLUDE)
|
||||
<library-path>$(EXPAT_LIBPATH)
|
||||
<find-shared-library>expat
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
message graphml
|
||||
: "warning: Graph library does not contain optional GraphML reader."
|
||||
: "note: to enable GraphML support, set EXPAT_INCLUDE and EXPAT_LIBPATH to the"
|
||||
: "note: directories containing the Expat headers and libraries, respectively."
|
||||
;
|
||||
}
|
||||
explicit graphml ;
|
||||
|
||||
lib boost_graph
|
||||
:
|
||||
read_graphviz_new.cpp
|
||||
graphml
|
||||
:
|
||||
<library>../../regex/build//boost_regex
|
||||
<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-
|
||||
;
|
||||
|
||||
boost-install boost_graph ;
|
||||
@@ -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/doc/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>
|
||||
@@ -0,0 +1,130 @@
|
||||
<html>
|
||||
<head>
|
||||
<!-- Copyright 2007 Aaron Windsor
|
||||
|
||||
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)
|
||||
|
||||
-->
|
||||
<title>AddEdgeVisitor Concept</title>
|
||||
</head>
|
||||
<body alink="#ff0000"
|
||||
bgcolor="#ffffff"
|
||||
link="#0000ee"
|
||||
text="#000000"
|
||||
vlink="#551a8b">
|
||||
|
||||
<img src="../../../boost.png" alt="C++ Boost" height="86" width="277">
|
||||
|
||||
<br clear="">
|
||||
|
||||
<h1>AddEdgeVisitor Concept</h1>
|
||||
|
||||
The AddEdgeVisitor concept exists to allow for some indirection in algorithms
|
||||
that modify graphs by adding edges. In such algorithms, it may be convenient
|
||||
to perform additional operations (such as updating an edge index map) at
|
||||
points in the algorithm where an edge addition occurs. Replacing calls to
|
||||
to <tt>add_edge</tt> with calls to <tt>AddEdgeVisitor::visit_vertex_pair</tt>
|
||||
allows for such operations to be defined independently from the algorithm.
|
||||
|
||||
<h3>Notation</h3>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td> <tt>Visitor</tt> </td>
|
||||
<td> is a type that models the AddEdgeVisitor concept </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> <tt>vis</tt> </td>
|
||||
<td> is an object of type Visitor </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> <tt>Graph</tt> </td>
|
||||
<td> is the type of a graph </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> <tt>u,v</tt> </td>
|
||||
<td> are objects of type <tt>graph_traits<Graph>::vertex_descriptor</tt>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> <tt>e</tt> </td>
|
||||
<td> is an object of type <tt>graph_traits<Graph>::edge_descriptor</tt>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> <tt>v</tt> </td>
|
||||
<td> is an object of type <tt>graph_traits<Graph>::vertex_descriptor</tt>
|
||||
</td>
|
||||
|
||||
</tr><tr>
|
||||
<td>
|
||||
|
||||
</td></tr></tbody></table>
|
||||
|
||||
|
||||
<h3>Associated Types</h3>
|
||||
|
||||
None
|
||||
|
||||
<h3>Valid Expressions</h3>
|
||||
|
||||
<p>
|
||||
|
||||
<table border="1">
|
||||
|
||||
<tbody><tr><th>Name</th><th>Expression</th><th>Return Type</th>
|
||||
<th>Description</th>
|
||||
|
||||
</tr><tr>
|
||||
<td> Add an Edge </td>
|
||||
<td> <tt>vis.visit_vertex_pair(u, v, g)</tt> </td>
|
||||
<td> <tt>void</tt></td>
|
||||
<td> Invoked every time an edge between vertices <tt>u</tt> and <tt>v</tt>
|
||||
should be added to the graph <tt>g</tt>.
|
||||
</td></tr>
|
||||
|
||||
</tbody></table>
|
||||
|
||||
</p><h3>Models</h3>
|
||||
|
||||
Two models of this concept are defined in the file
|
||||
<a href="../../../boost/graph/planar_detail/add_edge_visitors.hpp">
|
||||
<tt>add_edge_visitors.hpp</tt></a>:
|
||||
|
||||
<ul>
|
||||
<li><tt>default_add_edge_visitor</tt>: The constructor of this class takes
|
||||
no arguments.<tt>visit_vertex_pair(u, v, g)</tt> is just a dispatch to
|
||||
<tt>add_edge(u, v, g)</tt>.
|
||||
<li><tt>edge_index_update_visitor</tt>: The constructor of this class takes
|
||||
two arguments: the first, an EdgeIndexMap,
|
||||
is a <a href="../../property_map/doc/ReadWritePropertyMap.html">
|
||||
ReadWritePropertyMap</a> that maps each edge in the associated graph
|
||||
<tt>g</tt> to a distinct integer in the range <tt>[0, num_edges(g))</tt>.
|
||||
The second argument is the number of edges in the underlying graph, which
|
||||
serves as the "next available index" counter within the visitor.
|
||||
For example, in the case the graph used has an initialized interior
|
||||
edge index, the <tt>edge_index_update_visitor</tt> constructor should be
|
||||
called with <tt>get(edge_index, g)</tt> as the edge index and
|
||||
<tt>num_edges(g)</tt> as the next available index. When
|
||||
<tt>visit_vertex_pair(u, v, g)</tt> is called, the
|
||||
<tt>edge_index_update_visitor</tt> will add the edge <i>(u,v)</i> to the graph
|
||||
and update the edge index for the newly created edge.
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
|
||||
<br>
|
||||
</p><hr>
|
||||
Copyright © 2007 Aaron Windsor (<a href="mailto:aaron.windsor@gmail.com">
|
||||
aaron.windsor@gmail.com</a>)
|
||||
|
||||
</body></html>
|
||||
@@ -1,20 +1,16 @@
|
||||
<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.
|
||||
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>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>
|
||||
@@ -61,6 +57,12 @@ vertices, whereas in other contexts the edges are also important.
|
||||
|
||||
<Table border>
|
||||
|
||||
<tr>
|
||||
<td><tt>boost::graph_traits<G>::traversal_category</tt><br><br>
|
||||
This tag type must be convertible to <tt>adjacency_graph_tag</tt>.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<TR>
|
||||
<TD><pre>boost::graph_traits<G>::adjacency_iterator</pre>
|
||||
An adjacency iterator for a vertex <i>v</i> provides access to the
|
||||
@@ -83,7 +85,7 @@ href="../../utility/MultiPassInputIterator.html">MultiPassInputIterator</a>.
|
||||
<TD>
|
||||
Returns an iterator-range providing access to the vertices adjacent to
|
||||
vertex <TT>v</TT> in graph <TT>g</TT>.<a
|
||||
href="adjacencygraph.html#1">[1]</a>
|
||||
href="#1">[1]</a>
|
||||
|
||||
<br> Return type:
|
||||
<TT>std::pair<adjacency_iterator, adjacency_iterator></TT>
|
||||
@@ -158,8 +160,8 @@ experience with graph algorithm implementations.
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<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.
|
||||
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>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>
|
||||
@@ -37,6 +33,18 @@ concept.
|
||||
|
||||
<a href="./Graph.html">Graph</a>
|
||||
|
||||
<H3>Associated Types</H3>
|
||||
|
||||
<Table border>
|
||||
|
||||
<tr>
|
||||
<td><tt>boost::graph_traits<G>::traversal_category</tt><br><br>
|
||||
This tag type must be convertible to <tt>adjacency_matrix_tag</tt>.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<H3>Valid Expressions</H3>
|
||||
|
||||
<table border>
|
||||
@@ -57,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>
|
||||
@@ -82,8 +95,8 @@ consisting of the edge descriptor if the edge was found.
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,25 +1,21 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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: 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>.
|
||||
@@ -168,7 +164,7 @@ that the vertex has been removed from the queue.
|
||||
<td>
|
||||
This invoked on a vertex after all of its out edges have been added to the
|
||||
search tree and all of the adjacent vertices have been discovered
|
||||
(but before their out-edges have been examined).
|
||||
(but before the out-edges of the adjacent vertices have been examined).
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -189,14 +206,14 @@ search tree and all of the adjacent vertices have been discovered
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
|
||||
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
|
||||
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2009 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: Jeremiah Willcock, Andrew Lumsdaine
|
||||
|
||||
for i in read_graphml read_graphviz write_graphml; do
|
||||
rst2html.py -gdt --link-stylesheet --traceback --trim-footnote-reference-space --footnote-references=superscript --stylesheet=../../../rst.css $i.rst > $i.html
|
||||
done
|
||||
# Also see grid_graph_export_png.sh for figure conversions
|
||||
@@ -0,0 +1,103 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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>BasicMatrix</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="concept:BasicMatrix"></A>
|
||||
BasicMatrix
|
||||
</H1>
|
||||
|
||||
The BasicMatrix concept provides a minimalist interface for
|
||||
accessing elements from a 2 dimensional table of values.
|
||||
|
||||
|
||||
<H3>Refinement of</H3>
|
||||
|
||||
none
|
||||
|
||||
<h3>Notation</h3>
|
||||
|
||||
<Table>
|
||||
<TR>
|
||||
<TD>{<tt>M,I,V</tt>}</TD>
|
||||
<TD>The matrix, index, and values types that together model the BasicMatrix concept.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><tt>A</tt></TD>
|
||||
<TD>An object of type <tt>M</tt>.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><tt>i, j</tt></TD>
|
||||
<TD>Objects of type <tt>I</tt>.</TD>
|
||||
</TR>
|
||||
|
||||
</table>
|
||||
|
||||
<H3>Associated Types</H3>
|
||||
|
||||
none
|
||||
|
||||
<h3>Valid Expressions</h3>
|
||||
|
||||
<Table border>
|
||||
|
||||
<tr>
|
||||
<td><a name="sec:elt-access"><TT>A[i][j]</TT></a></TD>
|
||||
<TD>Returns a reference to the element object stored at index <tt>(i,j)</tt><br>
|
||||
Return type: <TT>V&</TT> for mutable <tt>A</tt> or <TT>const V&</TT>
|
||||
for constant <tt>A</tt>.
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
</table>
|
||||
|
||||
<H3>Complexity guarantees</H3>
|
||||
|
||||
Element access is constant time.
|
||||
|
||||
<H3>Concept Checking Class</H3>
|
||||
|
||||
<pre>
|
||||
template <class M, class I, class V>
|
||||
struct BasicMatrixConcept
|
||||
{
|
||||
void constraints() {
|
||||
V& elt = A[i][j];
|
||||
const_constraints(A);
|
||||
ignore_unused_variable_warning(elt);
|
||||
}
|
||||
void const_constraints(const M& A) {
|
||||
const V& elt = A[i][j];
|
||||
ignore_unused_variable_warning(elt);
|
||||
}
|
||||
M A;
|
||||
I i, j;
|
||||
};
|
||||
</pre>
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,25 +1,21 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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: 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,19 +142,42 @@ 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>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
|
||||
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
|
||||
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<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.
|
||||
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>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>
|
||||
@@ -65,6 +61,12 @@ edges incident to the vertex.
|
||||
|
||||
<Table border>
|
||||
|
||||
<tr>
|
||||
<td><tt>boost::graph_traits<G>::traversal_category</tt><br><br>
|
||||
This tag type must be convertible to <tt>bidirectional_graph_tag</tt>.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<TR>
|
||||
<TD><pre>boost::graph_traits<G>::in_edge_iterator</pre>
|
||||
An in-edge iterator for a vertex <i>v</i> provides access to the
|
||||
@@ -138,7 +140,7 @@ undirected graphs).
|
||||
|
||||
<PRE>
|
||||
template <class G>
|
||||
struct BidirectionalGraph_concept
|
||||
struct BidirectionalGraphConcept
|
||||
{
|
||||
typedef typename boost::graph_traits<G>::in_edge_iterator
|
||||
in_edge_iterator;
|
||||
@@ -165,8 +167,8 @@ undirected graphs).
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,21 +1,17 @@
|
||||
<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.
|
||||
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>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>
|
||||
@@ -104,8 +100,7 @@ most linear time complexity in the size of the Generalized Queue.
|
||||
|
||||
<UL>
|
||||
<LI><a href="http://www.sgi.com/tech/stl/stack.html"><tt>std::stack</tt></a>
|
||||
<LI><a href="../../pri_queue/queue.html"><tt>boost::queue</tt></a>
|
||||
<LI><a href="../../pri_queue/p_queue.html"><tt>boost::priority_queue</tt></a>
|
||||
<LI><a href="../../../boost/pending/mutable_queue.hpp"><tt>boost::mutable_queue</tt></a>
|
||||
</UL>
|
||||
|
||||
<p>
|
||||
@@ -114,8 +109,8 @@ most linear time complexity in the size of the Generalized Queue.
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame and C++ Library & Compiler Group/SGI (<A HREF="mailto:jsiek@engr.sgi.com">jsiek@engr.sgi.com</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University and C++ Library & Compiler Group/SGI (<A HREF="mailto:jsiek@engr.sgi.com">jsiek@engr.sgi.com</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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: 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>
|
||||
@@ -98,14 +94,14 @@ href="http://www.sgi.com/tech/stl/DefaultConstructible.html">DefaultConstructibl
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
|
||||
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
|
||||
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,29 +1,25 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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>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.
|
||||
|
||||
@@ -132,7 +128,14 @@ form the search tree.</td>
|
||||
<td><tt>vis.back_edge(e, g)</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This is invoked on the back edges in the graph.
|
||||
This is invoked on the back edges in the graph. For an undirected
|
||||
graph there is some ambiguity between tree edges and back edges since
|
||||
the edge <i>(u,v)</i> and <i>(v,u)</i> are the same edge, but both the
|
||||
<tt>tree_edge()</tt> and <tt>back_edge()</tt> functions will be
|
||||
invoked. One way to resolve this ambiguity is to record the tree
|
||||
edges, and then disregard the back-edges that are already marked as
|
||||
tree edges. An easy way to record tree edges is to record
|
||||
predecessors at the <tt>tree_edge</tt> event point.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -151,9 +154,11 @@ undirected graph this method is never called.
|
||||
<td><tt>vis.finish_vertex(u, g)</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This invoked on a vertex after all of its out edges have been added to the
|
||||
search tree and all of the adjacent vertices have been discovered
|
||||
(but before their out-edges have been examined).
|
||||
This is invoked on vertex <tt>u</tt> after <tt>finish_vertex</tt> has
|
||||
been called for all the vertices in the DFS-tree rooted at vertex
|
||||
<tt>u</tt>. If vertex <tt>u</tt> is a leaf in the DFS-tree, then
|
||||
the <tt>finish_vertex</tt> function is call on <tt>u</tt> after
|
||||
all the out-edges of <tt>u</tt> have been examined.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -165,19 +170,42 @@ search tree and all of the adjacent vertices have been discovered
|
||||
<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>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
|
||||
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
|
||||
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,25 +1,21 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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: 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>
|
||||
@@ -69,7 +65,7 @@ the search.
|
||||
|
||||
<TR>
|
||||
<TD><tt>DistanceMap</tt></TD>
|
||||
<TD>A type that is a model of <a href="../../property_map/ReadWritePropertyMap.html">Read/Write Property Map</a>.</TD>
|
||||
<TD>A type that is a model of <a href="../../property_map/doc/ReadWritePropertyMap.html">Read/Write Property Map</a>.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
@@ -79,7 +75,7 @@ the search.
|
||||
|
||||
<TR>
|
||||
<TD><tt>WeightMap</tt></TD>
|
||||
<TD>A type that is a model of <a href="../../property_map/ReadWritePropertyMap.html">Readable Property Map</a>.</TD>
|
||||
<TD>A type that is a model of <a href="../../property_map/doc/ReadWritePropertyMap.html">Readable Property Map</a>.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
@@ -181,21 +177,45 @@ search tree and all of the adjacent vertices have been discovered
|
||||
<h3>Models</h3>
|
||||
|
||||
<ul>
|
||||
<li><a href="./ucs_visitor.html"><tt>ucs_visitor</tt></a>
|
||||
<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>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
|
||||
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
|
||||
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<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.
|
||||
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>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>
|
||||
@@ -58,6 +54,12 @@ edges in the graph.
|
||||
|
||||
<table border>
|
||||
|
||||
<tr>
|
||||
<td><tt>boost::graph_traits<G>::traversal_category</tt><br><br>
|
||||
This tag type must be convertible to <tt>edge_list_graph_tag</tt>.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><pre>boost::graph_traits<G>::edge_iterator</pre>
|
||||
An edge iterator (obtained via <TT>edges(g)</TT>) provides access to
|
||||
@@ -174,8 +176,8 @@ must all return in constant time.
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2001
|
||||
|
||||
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="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
|
||||
<H2><A NAME="concept:EdgeMutableGraph">
|
||||
Edge Mutable Graph
|
||||
</H2>
|
||||
|
||||
The <I>Edge Mutable Graph</I> concept defines the interface for a
|
||||
graph that supports the addition and removal of edges.
|
||||
|
||||
<H3>Refinement of</H3>
|
||||
|
||||
<a href="./Graph.html">Graph</a>
|
||||
|
||||
<H3>Associated Types</H3>
|
||||
|
||||
No additional associated types.
|
||||
|
||||
<h3>Valid Expressions</h3>
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a name="sec:add_edge"><TT>add_edge(u, v, g)</TT></a>
|
||||
<b>returns</b> <TT>std::pair<edge_descriptor, bool></TT>
|
||||
<br><br>
|
||||
|
||||
<b>Semantics:</b> Try to insert the edge <i>(u,v)</i> into the graph,
|
||||
returning the inserted edge or a parallel edge and a flag that
|
||||
specifies whether an edge was inserted. This operation must not
|
||||
invalidate vertex descriptors or vertex iterators of the graph, though
|
||||
it may invalidate edge descriptors or edge iterators.<br>
|
||||
|
||||
<b>Preconditions:</b> <i>u</i> and <i>v</i> are vertices in the
|
||||
graph. <br>
|
||||
|
||||
<b>Postconditions:</b> <i>(u,v)</i> is in the edge set of
|
||||
the graph. The returned edge descriptor will have <i>u</i> in the
|
||||
source position and <i>v</i> in the target position. If the graph
|
||||
allows parallel edges, then the returned flag is always
|
||||
<tt>true</tt>. If the graph does not allow parallel edges, if
|
||||
<i>(u,v)</i> was already in the graph then the returned flag is
|
||||
<tt>false</tt>. If <i>(u,v)</i> was not in the graph then the returned
|
||||
flag is <tt>true</tt>.<br>
|
||||
</li><br>
|
||||
|
||||
<li><a name="sec:remove_edge_by_pair"><tt>remove_edge(u, v, g)</tt></a>
|
||||
<b>returns</b> <tt>void</tt><br><br>
|
||||
<b>Semantics:</b> Remove the edge <i>(u,v)</i> from the graph. If the
|
||||
graph allows parallel edges this removes all occurrences of <i>(u,v)</i>. <br>
|
||||
<b>Precondition:</b> <i>(u,v)</i> is in the edge set of the graph. <br>
|
||||
<b>Postcondition:</b> <i>(u,v)</i> is no longer in the edge set of the graph. <br>
|
||||
</li><br>
|
||||
|
||||
<li>
|
||||
<a name="sec:remove_edge"><tt>remove_edge(e, g)</tt></a>
|
||||
<b>returns</b> <tt>void</tt><br><br>
|
||||
<b>Semantics:</b> Remove the edge <i>e</i> from the graph.<br>
|
||||
<b>Precondition:</b> <i>e</i> is an edge in the graph. <br>
|
||||
<b>Postcondition:</b> <i>e</i> is no longer in the edge set for <tt>g</tt>. <br>
|
||||
</li><br>
|
||||
|
||||
<li>
|
||||
<a name="sec:clear_vertex"><tt>clear_vertex(u, g)</tt></a>
|
||||
<b>returns</b> <tt>void</tt><br><br>
|
||||
<b>Semantics:</b> Remove all edges to and from vertex <i>u</i> from the graph. <br>
|
||||
<b>Precondition:</b> <i>u</i> is a valid vertex descriptor of
|
||||
<tt>g</tt>. <br> <b>Postconditions:</b> <i>u</i> does not appear as a
|
||||
source or target of any edge in <tt>g</tt>.
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<H3>Complexity guarantees</H3>
|
||||
|
||||
<P>
|
||||
UNDER CONSTRUCTION
|
||||
|
||||
<H3>See Also</H3>
|
||||
|
||||
<a href="./graph_concepts.html">Graph concepts</a>
|
||||
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,20 +1,16 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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: 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>
|
||||
@@ -151,14 +147,14 @@ either a vertex or edge descriptor of the graph.
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
|
||||
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
|
||||
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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: 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>
|
||||
@@ -117,14 +113,14 @@ std::make_pair(<i>visitor1</i>,
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
|
||||
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
|
||||
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<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.
|
||||
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>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.
|
||||
@@ -67,15 +62,14 @@ href="http://www.sgi.com/tech/stl/DefaultConstructible.html">Default Constructib
|
||||
An edge descriptor corresponds to a unique edge <i>(u,v)</i> in a
|
||||
graph. An edge descriptor must be <a
|
||||
href="http://www.sgi.com/tech/stl/DefaultConstructible.html">Default Constructible</I>,
|
||||
<a
|
||||
href="http://www.sgi.com/tech/stl/Assignable.html">Assignable</a>,
|
||||
and <a href="http://www.sgi.com/tech/stl/EqualityComparable.html">Equality Comparable</a>.
|
||||
<a href="http://www.sgi.com/tech/stl/Assignable.html">Assignable</a>, and
|
||||
<a href="http://www.sgi.com/tech/stl/EqualityComparable.html">Equality Comparable</a>.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<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>
|
||||
|
||||
@@ -90,7 +84,10 @@ are <TT>allow_parallel_edge_tag</TT> and <TT>disallow_parallel_edge_tag</TT>.
|
||||
<tr>
|
||||
<td><pre>boost::graph_traits<G>::traversal_category</pre>
|
||||
This describes the ways in which the vertices and edges of the
|
||||
graph can be visited.
|
||||
graph can be visited. The choices are <TT>incidence_graph_tag</TT>,
|
||||
<TT>adjacency_graph_tag</TT>, <TT>bidirectional_graph_tag</TT>,
|
||||
<TT>vertex_list_graph_tag</TT>, <TT>edge_list_graph_tag</TT>, and
|
||||
<TT>adjacency_matrix_tag</TT>.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -98,7 +95,18 @@ graph can be visited.
|
||||
|
||||
<H3>Valid Expressions</H3>
|
||||
|
||||
None required.
|
||||
<table border>
|
||||
|
||||
<tr>
|
||||
<td><pre>boost::graph_traits<G>::null_vertex()</pre></td></TD>
|
||||
<td>
|
||||
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>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<H3>Concept Checking Class</H3>
|
||||
|
||||
@@ -132,8 +140,8 @@ None required.
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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>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>
|
||||
@@ -60,6 +56,13 @@ efficient access to the out-edges of each vertex in the graph.
|
||||
|
||||
<Table border>
|
||||
|
||||
<tr>
|
||||
<td><tt>boost::graph_traits<G>::traversal_category</tt><br><br>
|
||||
This tag type must be convertible to <tt>incidence_graph_tag</tt>.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<TR>
|
||||
<TD>
|
||||
<pre>boost::graph_traits<G>::out_edge_iterator</pre>
|
||||
@@ -73,7 +76,7 @@ href="../../utility/MultiPassInputIterator.html">MultiPassInputIterator</a>.
|
||||
|
||||
<TR>
|
||||
<TD><pre>boost::graph_traits<G>::degree_size_type</pre>
|
||||
The unsigned intergral type used for representing the number
|
||||
The unsigned integral type used for representing the number
|
||||
out-edges or incident edges of a vertex.
|
||||
</TD>
|
||||
</TR>
|
||||
@@ -103,10 +106,10 @@ Return type: <TT>vertex_descriptor</TT>
|
||||
<TD>Returns an iterator-range providing access to the out-edges (for
|
||||
directed graphs) or incident edges (for undirected graphs) of vertex
|
||||
<TT>u</TT> in graph <TT>g</TT>. The source vertex of an edge obtained
|
||||
via and out edge iterator is guaranteed (for both directed and
|
||||
via an out edge iterator is guaranteed (for both directed and
|
||||
undirected graphs) to be the vertex <tt>u</tt> used in the call to
|
||||
<tt>out_edges(u, g)</tt> and the target vertex must the a vertex
|
||||
adjacent to <tt>u</tt>.<a href="">[1]</a>
|
||||
<tt>out_edges(u, g)</tt> and the target vertex must be a vertex
|
||||
adjacent to <tt>u</tt>.<a href="#1">[1]</a>
|
||||
<br>
|
||||
Return type: <TT>std::pair<out_edge_iterator, out_edge_iterator></TT>
|
||||
</TD>
|
||||
@@ -162,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);
|
||||
@@ -185,14 +188,14 @@ Therefore, the extra requirement is added that the out-edge connecting
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
|
||||
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
|
||||
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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>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>
|
||||
@@ -151,14 +147,14 @@ constructor lacking the graph size information.
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
|
||||
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
|
||||
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
# 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
|
||||
LATEXOUT = dvi
|
||||
RESULT = ps
|
||||
|
||||
LATEX = pdflatex
|
||||
LATEXOUT = pdf
|
||||
RESULT = pdf
|
||||
|
||||
.SUFFIXES: .tex .dvi .ps .pdf .c .lg .eps .fig .gif .dot .w .cpp .o .exe
|
||||
|
||||
.tex.$(LATEXOUT):
|
||||
@ if test ! -f $*.ind; then echo "" > $*.ind; fi
|
||||
@ $(LATEX) $*
|
||||
@ if ( grep 'LaTeX Warning: Label(s) may' $*.log > /dev/null ); \
|
||||
then $(LATEX) $* ; fi
|
||||
@ if ( grep 'LaTeX Warning: Citation' $*.log > /dev/null ); \
|
||||
then bibtex $* ; $(LATEX) $* ; fi
|
||||
@ if ( grep 'LaTeX Warning: Label(s) may' $*.log > /dev/null ); \
|
||||
then $(LATEX) $* ; fi
|
||||
@ if ( grep 'LaTeX Warning: Label(s) may' $*.log > /dev/null ); \
|
||||
then $(LATEX) $* ; fi
|
||||
@ if ( grep 'Writing index file' $*.log > /dev/null ); \
|
||||
then makeindex $* ; $(LATEX) $* ; fi
|
||||
@ if ( grep 'LaTeX Warning: Label(s) may' $*.log > /dev/null ); \
|
||||
then $(LATEX) $* ; fi
|
||||
@ if ( grep 'LaTeX Warning: Label(s) may' $*.log > /dev/null ); \
|
||||
then $(LATEX) $* ; fi
|
||||
|
||||
.dvi.ps:
|
||||
$(DVIPS) -t letter -o $*.ps $*
|
||||
|
||||
.eps.pdf:
|
||||
epstopdf $*.eps
|
||||
|
||||
.dot.eps:
|
||||
dot -Tps -o $*.eps $*.dot
|
||||
|
||||
.w.tex: /afs/nd.edu/user11/jsiek/.jweb
|
||||
jweb -np $*.w
|
||||
|
||||
BOOST = $(HOME)/boost
|
||||
BOOST_ALGO = $(HOME)/boost.algorithm
|
||||
CXX = c++
|
||||
INCLUDES = -I$(BOOST) -I$(BOOST_ALGO)
|
||||
#OPT = +K2 --display_error_number --diag_suppress=186
|
||||
OPT = -Wall -Wno-long-double -ftemplate-depth-30
|
||||
CXXFLAGS = $(OPT) $(INCLUDES)
|
||||
|
||||
.cpp.o:
|
||||
$(CXX) $(CXXFLAGS) $< -c
|
||||
|
||||
|
||||
JWEB = isomorphism-impl.w isomorphism-impl-v3.w
|
||||
DOT = out.dot in.dot iso-eg.dot iso-eg2.dot
|
||||
EPS_GEN = $(DOT:.dot=.eps)
|
||||
WEBTEX = $(JWEB:.w=.tex)
|
||||
PDFPICT = $(EPS_GEN:.eps=.pdf)
|
||||
|
||||
default: isomorphism-impl-v3.$(RESULT)
|
||||
|
||||
final: isomorphism-impl-v3.$(RESULT)
|
||||
$(LATEX) isomorphism-impl-v3
|
||||
csh ./mungeaux.csh *.aux
|
||||
$(LATEX) isomorphism-impl-v3
|
||||
|
||||
#isomorphism-impl.dvi: $(EPS_GEN) $(WEBTEX)
|
||||
#isomorphism-impl.ps: isomorphism-impl.dvi
|
||||
#isomorphism-impl.pdf: $(EPS_GEN) $(PDFPICT) $(WEBTEX)
|
||||
#isomorphism.hpp: isomorphism-impl.w isomorphism-impl.tex
|
||||
|
||||
isomorphism-impl-v3.dvi: $(DOT) $(EPS_GEN) $(WEBTEX)
|
||||
isomorphism-impl-v3.ps: isomorphism-impl-v3.dvi
|
||||
isomorphism-impl-v3.pdf: $(EPS_GEN) $(PDFPICT) $(WEBTEX)
|
||||
|
||||
isomorphism-v3.hpp: isomorphism-impl-v3.w isomorphism-impl-v3.tex
|
||||
|
||||
out.dot: isomorphism-impl.tex
|
||||
in.dot: isomorphism-impl.tex
|
||||
|
||||
isomorphism.o: isomorphism-v3.hpp isomorphism-impl-v3.w
|
||||
|
||||
isomorphism: isomorphism.o
|
||||
$(CXX) $(CXXFLAGS) $< -o $@ $(LIBS)
|
||||
|
||||
isomorphism-v3.hpp: isomorphism-impl-v3.tex isomorphism-impl-v3.w
|
||||
eg1-iso.o: isomorphism-impl-v3.tex isomorphism-impl-v3.w
|
||||
|
||||
eg1-iso: eg1-iso.o
|
||||
$(CXX) $(CXXFLAGS) $< -o $@ $(LIBS)
|
||||
|
||||
|
||||
clean:
|
||||
rm *.aux *.dvi $(EPS_GEN) $(PDFPICT)
|
||||
@@ -0,0 +1,122 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2001
|
||||
|
||||
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="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1><A NAME="concept:Monoid"></A>
|
||||
Monoid
|
||||
</H1>
|
||||
|
||||
A <i>Monoid</i> is a concept that describes a simple kind of algebraic
|
||||
system. A <b>monoid</b> consists of a set of elements <i>S</i>, a
|
||||
binary operation, and an identity element. The C++ representation of a
|
||||
monoid consists of a function object that implements the binary
|
||||
operation, a set of objects that represent the elements of <i>S</i>,
|
||||
and an object that represents the identity element.
|
||||
|
||||
|
||||
<H3>Refinement of</H3>
|
||||
|
||||
The element type must be a model of <a
|
||||
href="../../utility/Assignable.html">Assignable</a> and <a
|
||||
href="../../utility/CopyConstructible.html">CopyConstructible</a>.
|
||||
The function object type must be a model of <a
|
||||
href="http://www.sgi.com/tech/stl/BinaryFunction.html">BinaryFunction</a>.
|
||||
|
||||
<h3>Notation</h3>
|
||||
|
||||
<Table>
|
||||
<TR>
|
||||
<TD><tt>X</tt></TD>
|
||||
<TD>Is the element type of the Monoid.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><tt>a, b</tt></TD>
|
||||
<TD>are objects of type <tt>X</tt>.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><tt>op</tt></TD>
|
||||
<TD>Is the function object implementing the Monoid operation.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><tt>i</tt></TD>
|
||||
<TD>is an object of type <tt>X</tt> and is the identity element
|
||||
for the Monoid.</TD>
|
||||
</TR>
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
<h3>Valid Expressions</h3>
|
||||
|
||||
<Table border>
|
||||
|
||||
<tr>
|
||||
<td><a name="sec:source"><TT>op(a, b)</TT></a></TD>
|
||||
<TD>See below for semantics.<br>
|
||||
Return type: <TT>X</TT>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<tr>
|
||||
<TD><TT>a == b</TT></TD>
|
||||
<TD>Returns true if <tt>a</tt> and <tt>b</tt> represent
|
||||
the same element of <i>S</i>.<br>
|
||||
Return type: <TT>bool</TT>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<tr>
|
||||
<TD><TT>a != b</TT></TD>
|
||||
<TD>Returns true if <tt>a</tt> and <tt>b</tt> represent
|
||||
different elements of <i>S</i>.<br>
|
||||
Return type: <TT>bool</TT>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
|
||||
<H3>Invariants</H3>
|
||||
|
||||
<UL>
|
||||
<li>Closure<br>
|
||||
The result of <tt>op(a, b)</tt> is also an element of <i>S</i>.
|
||||
<li>Associativity<br>
|
||||
<tt>op(op(a, b), c) == op(a, op(b, c))</tt>
|
||||
<li>Definition of Identity Element<br>
|
||||
<tt>op(a, i) == a</tt>
|
||||
</UL>
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,20 +1,16 @@
|
||||
<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.
|
||||
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>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>
|
||||
@@ -95,7 +91,7 @@ Return type: <TT>std::pair<edge_descriptor, bool></TT>
|
||||
<TD><a name="sec:remove_edge"><TT>remove_edge(u, v, g)</TT></a></TD>
|
||||
<TD>
|
||||
Remove the edge <i>(u,v)</i> from the graph. If the
|
||||
graph allows parallel edges this remove all occurances of
|
||||
graph allows parallel edges this remove all occurrences of
|
||||
<i>(u,v)</i>.<br>
|
||||
Return type: <TT>void</TT><br>
|
||||
Precondition: <i>u</i> and <i>v</i> are vertices in the graph.<br>
|
||||
@@ -295,8 +291,8 @@ is no longer a valid vertex descriptor.
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<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.
|
||||
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>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>
|
||||
@@ -146,8 +142,8 @@ Return type: <TT>vertex_descriptor</TT>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
<html><head><!-- Copyright 2007 Aaron Windsor
|
||||
|
||||
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)
|
||||
|
||||
-->
|
||||
<title>Planar Embedding Concept</title>
|
||||
</head>
|
||||
<body alink="#ff0000"
|
||||
bgcolor="#ffffff"
|
||||
link="#0000ee"
|
||||
text="#000000"
|
||||
vlink="#551a8b">
|
||||
<img src="../../../boost.png" alt="C++ Boost" height="86" width="277">
|
||||
|
||||
<br clear="">
|
||||
|
||||
<h1>Planar Embedding Concept</h1>
|
||||
|
||||
|
||||
A planar embedding is an important intermediate representation of a drawing
|
||||
of a planar graph. Instead of specifying the absolute positions of the vertices
|
||||
and edges in the plane, a planar embedding specifies their positions relative
|
||||
to one another. A planar embedding consists of a sequence, for each vertex in
|
||||
the graph, of all of the edges incident on that vertex in the order in which
|
||||
they are to be drawn around that vertex.
|
||||
<p>
|
||||
A planar embedding is a refinement of
|
||||
<a href="../../property_map/doc/LvaluePropertyMap.html">LValuePropertyMap</a> that
|
||||
places additional restrictions the <tt>value_type</tt> used in the property
|
||||
map.
|
||||
|
||||
</p><h3>Notation</h3>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td> <tt>Embedding</tt> </td>
|
||||
<td> is a type that models the Planar Embedding concept.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> <tt>embedding</tt> </td>
|
||||
<td> is an object of type <tt>Embedding</tt>. </td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> <tt>Graph</tt> </td>
|
||||
<td> is the type of the underlying graph.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> <tt>e</tt> </td>
|
||||
<td> is an object of type <tt>graph_traits<Graph>::edge_descriptor</tt>.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> <tt>v</tt> </td>
|
||||
<td> is an object of type <tt>graph_traits<Graph>::vertex_descriptor
|
||||
</tt>.</td>
|
||||
|
||||
</tr><tr>
|
||||
<td>
|
||||
|
||||
</td></tr></tbody></table>
|
||||
|
||||
|
||||
<h3>Associated Types</h3>
|
||||
|
||||
<table border="1">
|
||||
|
||||
<tbody><tr>
|
||||
<td> Const Iterator </td>
|
||||
<td> <tt>boost::property_traits<Embedding>::value_type::const_iterator
|
||||
</tt>
|
||||
</td>
|
||||
<td> The iterator type used to iterate over the ordering of the edges in the
|
||||
planar embedding of a particular vertex
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
||||
|
||||
<h3>Valid Expressions</h3>
|
||||
|
||||
<p>
|
||||
|
||||
<table border="1">
|
||||
|
||||
<tbody><tr><th>Expression</th><th>Return Type</th><th>Description</th>
|
||||
|
||||
</tr><tr>
|
||||
<td> <tt>embedding[v].begin()</tt> </td>
|
||||
<td> <tt>boost::property_traits<Embedding>::value_type::const_iterator
|
||||
</tt></td>
|
||||
<td> Returns an iterator to the beginning of the range of edges in the
|
||||
embedding around vertex v</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> <tt>embedding[v].end()</tt> </td>
|
||||
<td> <tt>boost::property_traits<Embedding>::value_type::const_iterator
|
||||
</tt></td>
|
||||
<td> Returns an iterator to the end of the range of edges in the
|
||||
embedding around vertex v</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> <tt>embedding[v].clear()</tt> </td>
|
||||
<td> <tt>void</tt></td>
|
||||
<td> Clears all edges in the embedding around a vertex <tt>v</tt></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td> <tt>embedding[v].push_back(e)</tt> </td>
|
||||
<td> <tt>void</tt></td>
|
||||
<td> Adds an edge <tt>e</tt> to the end of the sequence of embedded edges
|
||||
around the vertex <tt>v</tt> </td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
||||
|
||||
</p><h3>Complexity Guarantees</h3>
|
||||
|
||||
Starting with an empty embedding, any mixed sequence of <i>n</i> calls to a
|
||||
particular vertex's <tt>push_back</tt> and <tt>clear</tt> should take
|
||||
<i>O(n)</i> time.
|
||||
|
||||
<h3>Models</h3>
|
||||
|
||||
Any LValue property map that maps vertices to a <tt>std::vector</tt>,
|
||||
<tt>std::list</tt>, or <tt>std::deque</tt> models this
|
||||
concept. Below is an example of using this approach to create a model of
|
||||
PlanarEmbedding:
|
||||
|
||||
<pre>
|
||||
#include <boost/property_map/property_map.hpp>
|
||||
#include <vector>
|
||||
|
||||
...
|
||||
|
||||
// Assume a graph type "Graph" defined somewhere above and
|
||||
// an instance of Graph in a variable g.
|
||||
|
||||
// A typedef for the storage - a vector of vectors of edge descriptors
|
||||
typedef
|
||||
std::vector< std::vector< graph_traits<Graph>::edge_descriptor > >
|
||||
planar_embedding_storage_t;
|
||||
|
||||
// A typedef for the iterator property map, assuming the graph has
|
||||
// an interior vertex index map
|
||||
typedef
|
||||
boost::iterator_property_map< planar_embedding_storage_t::iterator,
|
||||
property_map<Graph, vertex_index_t>::type
|
||||
>
|
||||
planar_embedding_t;
|
||||
|
||||
// Create an instance of the storage and the property map
|
||||
planar_embedding_storage_t planar_embedding_storage(num_vertices(g));
|
||||
planar_embedding_t planar_embedding(planar_embedding_storage.begin(),
|
||||
get(vertex_index, g)
|
||||
);
|
||||
|
||||
// planar_embedding can now be passed to any function expecting a model
|
||||
// of PlanarEmbedding.
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
|
||||
<br>
|
||||
</p><hr>
|
||||
Copyright © 2007 Aaron Windsor (<a href="mailto:aaron.windsor@gmail.com">
|
||||
aaron.windsor@gmail.com</a>)
|
||||
|
||||
</body></html>
|
||||
@@ -0,0 +1,148 @@
|
||||
<HTML>
|
||||
<!-- Copyright 2007 Aaron Windsor
|
||||
|
||||
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>Planar Face Visitor Concept</TITLE>
|
||||
</HEAD>
|
||||
<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>Planar Face Visitor Concept</H1>
|
||||
|
||||
This concept defines the visitor interface for
|
||||
<a href="./planar_face_traversal.html"><tt>planar_face_traversal</tt></a>.
|
||||
Users can define a class with the Planar Face Visitor interface and pass an
|
||||
object of the class to <tt>planar_face_traversal</tt>, thereby augmenting the
|
||||
actions taken during the traversal. Note that objects passed to
|
||||
<tt>planar_face_traversal</tt> are passed by reference.
|
||||
|
||||
<h3>Notation</h3>
|
||||
|
||||
<table>
|
||||
<tbody><tr>
|
||||
<td><tt>V</tt></td>
|
||||
<td>A type that is a model of Planar Face 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>e</tt></td>
|
||||
<td>An object of type <tt>boost::graph_traits<G>::edge_descriptor</tt>.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><tt>v</tt></td>
|
||||
<td>An object of type <tt>boost::graph_traits<G>::vertex_descriptor</tt>.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
||||
|
||||
|
||||
<h3>Valid Expressions</h3>
|
||||
|
||||
<table border="1">
|
||||
<tbody><tr>
|
||||
<th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Begin Traversal</td>
|
||||
<td><tt>vis.begin_traversal()</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This is invoked once per traversal, before the traversal begins.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Begin Face</td>
|
||||
<td><tt>vis.begin_face()</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This is invoked once for each face, before any vertices or edges on the face
|
||||
are visited.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Next Vertex</td>
|
||||
<td><tt>vis.next_vertex(v)</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This is invoked when a vertex is encountered while traversing a face.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td>Next Edge</td>
|
||||
<td><tt>vis.next_edge(e)</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This is invoked when an edge is encountered while traversing a face.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>End Face</td>
|
||||
<td><tt>vis.end_face()</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This is invoked once for each face, after all vertices and edges on the face
|
||||
are visited.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td>End Traversal</td>
|
||||
<td><tt>vis.end_traversal()</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This is invoked once per traversal, after the traversal ends.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody></table>
|
||||
|
||||
<h3>Models</h3>
|
||||
|
||||
<ul>
|
||||
<li> The file <a href="../../../boost/graph/planar_face_traversal.hpp">
|
||||
<tt>planar_face_traversal.hpp</tt></a> contains a class
|
||||
<tt>planar_face_traversal_visitor</tt> that implements empty actions for
|
||||
all event points of a Planar Face Visitor. In the case where only a few of the
|
||||
event points of Planar Face Visitor need to be implemented, one can derive from
|
||||
<tt>planar_face_traversal_visitor</tt> and only implement the necessary event
|
||||
points. <li> The implementation of <a href="./make_maximal_planar.html">
|
||||
<tt>make_maximal_planar</tt></a> uses a <tt>triangulation_visitor</tt> that is
|
||||
a model of Planar Face Visitor.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
Copyright © 2007 Aaron Windsor (<a href="mailto:aaron.windsor@gmail.com">
|
||||
aaron.windsor@gmail.com</a>)
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,20 +1,16 @@
|
||||
<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.
|
||||
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>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>
|
||||
@@ -94,7 +90,8 @@ function which returns a property map object.
|
||||
<td><pre>boost::property_map<G, PropertyTag>::type</pre>
|
||||
The type of the property map for the property specified by
|
||||
<TT>PropertyTag</TT>. This type must be a model of <a
|
||||
href="../../property_map/ReadWritePropertyMap.html">ReadWritePropertyMap</a> with a key type the same as the graph's vertex or descriptor type.
|
||||
href="../../property_map/doc/ReadWritePropertyMap.html">ReadWritePropertyMap</a>
|
||||
with a key type the same as the graph's vertex or edge descriptor type.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -102,7 +99,7 @@ href="../../property_map/ReadWritePropertyMap.html">ReadWritePropertyMap</a> wit
|
||||
<td><pre>boost::property_map<G, PropertyTag>::const_type</pre>
|
||||
The type of the const property map for the property specified by
|
||||
<TT>PropertyTag</TT>. This type must be a model of <a
|
||||
href="../../property_map/ReadablePropertyMap.html">ReadablePropertyMap</a>
|
||||
href="../../property_map/doc/ReadablePropertyMap.html">ReadablePropertyMap</a>
|
||||
with a key type the same as the graph's vertex or edge descriptor type.
|
||||
</td>
|
||||
</tr>
|
||||
@@ -205,8 +202,8 @@ The <tt>get()</tt> property map function must be constant time.
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<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.
|
||||
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>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>
|
||||
@@ -100,7 +96,7 @@ href="../../../boost/graph/properties.hpp"><tt>boost/graph/properties.hpp</tt></
|
||||
|
||||
<a href="./PropertyGraph.html">PropertyGraph</a>
|
||||
and
|
||||
<a href="../../property_map/property_map.html">Property Map Concepts</a>
|
||||
<a href="../../property_map/doc/property_map.html">Property Map Concepts</a>
|
||||
|
||||
<h3>Notes</h3>
|
||||
|
||||
@@ -113,8 +109,8 @@ type is also required to specialize
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Matyas Egyhazy 2008
|
||||
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: TSP Tour 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>TSP Tour Visitor concept</H1>
|
||||
|
||||
This concept defines the visitor interface for <a
|
||||
href="./metric_tsp_approx.html"><tt>metric_tsp_approx()</tt></a>
|
||||
and related algorithms. The user can create a class that matches this
|
||||
interface, and then pass objects of the class into
|
||||
<tt>metric_tsp_approx()</tt> to augment the actions taken during
|
||||
the search.
|
||||
|
||||
<h3>Refinement of</h3>
|
||||
|
||||
none
|
||||
|
||||
<h3>Notation</h3>
|
||||
|
||||
<Table>
|
||||
<TR>
|
||||
<TD><tt>V</tt></TD>
|
||||
<TD>A type that is a model of Dijkstra 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>v</tt></TD>
|
||||
<TD>An object of type <tt>boost::graph_traits<G>::vertex_descriptor</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>Visit Vertex</td>
|
||||
<td><tt>vis.visit_vertex(v, g)</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This is invoked on each vertex of the graph when it is visited as part of the TSP tour.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<h3>Models</h3>
|
||||
|
||||
<ul>
|
||||
<li><a href="tsp_tour_visitor.html"><tt>tsp_tour_visitor</tt></a>
|
||||
<li><a href="tsp_tour_len_visitor.html"><tt>tsp_tour_len_tsp_visitor</tt></a>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2008</TD><TD>
|
||||
Matyas Egyhazy</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,200 +0,0 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
-->
|
||||
<Head>
|
||||
<Title>Boost Graph Library: Uniform Cost Visitor</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H1>Uniform Cost Visitor Concept</H1>
|
||||
|
||||
This concept defines the visitor interface for <a
|
||||
href="./uniform_cost_search.html"><tt>uniform_cost_search()</tt></a>
|
||||
and related algorithms. The user can create a class that matches this
|
||||
interface, and then pass objects of the class into
|
||||
<tt>uniform_cost_search()</tt> to augment the actions taken during the
|
||||
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 Uniform Cost 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>DistanceMap</tt></TD>
|
||||
<TD>A type that is a model of <a href="../../property_map/ReadWritePropertyMap.html">ReadWritePropertyMap</a>.</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/ReadWritePropertyMap.html">ReadablePropertyMap</a>.</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD><tt>w</tt></TD>
|
||||
<TD>An object of type <tt>DistanceMap</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 one each vertex of the graph when it is initialized.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Start Vertex</td>
|
||||
<td><tt>vis.start_vertex(u, g)</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This is invoked on the source vertex at the beginning of the algorithm.
|
||||
</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 encountered for the first time.
|
||||
</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 discovered.
|
||||
</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 (its distance is reduced), and this method is invoked.<br>
|
||||
<tt>
|
||||
tie(u,v) = incident(e, g);<br>
|
||||
D d_u = get(d, u), d_v = get(d, v);<br>
|
||||
W w_e = get(w, e);<br>
|
||||
assert(compare(combine(d_u, w_e), d_v));<br>
|
||||
</tt>
|
||||
</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 the edge is not relaxed (see above) then
|
||||
this method is invoked.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Finish Vertex</td>
|
||||
<td><tt>vis.finish_vertex(u, g)</tt></td>
|
||||
<td><tt>void</tt></td>
|
||||
<td>
|
||||
This invoked on a vertex after all of its out edges have been added to the
|
||||
search tree and all of the adjacent vertices have been discovered
|
||||
(but before their out-edges have been examined).
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<h3>Models</h3>
|
||||
|
||||
<ul>
|
||||
<li><a href="./ucs_visitor.html"><tt>ucs_visitor</tt></a>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
|
||||
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
|
||||
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,20 +1,16 @@
|
||||
<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.
|
||||
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>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>
|
||||
@@ -52,7 +48,7 @@ requirements are added.
|
||||
<P>
|
||||
<PRE>
|
||||
template <class G>
|
||||
struct VertexAndEdgeListGraph
|
||||
struct VertexAndEdgeListGraphConcept
|
||||
{
|
||||
void constraints() {
|
||||
function_requires< VertexListGraphConcept<G> >();
|
||||
@@ -66,8 +62,8 @@ requirements are added.
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<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.
|
||||
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>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>
|
||||
@@ -24,19 +20,24 @@
|
||||
VertexListGraph
|
||||
</H2>
|
||||
|
||||
The VertexListGraph</I> concept refines the <a
|
||||
href="./AdjacencyGraph.html">AdjacencyGraph</a> concept, and adds the
|
||||
requirement for efficient traversal of all the vertices in the graph.
|
||||
The <I>VertexListGraph</I> concept refines the <a
|
||||
href="./Graph.html">Graph</a> concept, and adds the requirement for
|
||||
efficient traversal of all the vertices in the graph.
|
||||
|
||||
<H3>Refinement of</H3>
|
||||
|
||||
<a href="./IncidenceGraph.html">IncidenceGraph</a>
|
||||
and <a href="./AdjacencyGraph.html">AdjacencyGraph</a>
|
||||
<a href="./Graph.html">Graph</a>
|
||||
|
||||
<H3>Associated Types</H3>
|
||||
|
||||
<Table border>
|
||||
|
||||
<tr>
|
||||
<td><tt>boost::graph_traits<G>::traversal_category</tt><br><br>
|
||||
This tag type must be convertible to <tt>vertex_list_graph_tag</tt>.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<TR>
|
||||
<TD><tt>boost::graph_traits<G>::vertex_iterator</tt><br><br>
|
||||
A vertex iterator (obtained via <TT>vertices(g)</TT>) provides access
|
||||
@@ -145,8 +146,8 @@ groups these requirements together, hence the VertexListGraph concept.
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2001
|
||||
|
||||
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="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<H2><A NAME="concept:VertexMutableGraph">
|
||||
Vertex Mutable Graph
|
||||
</H2>
|
||||
|
||||
A vertex mutable graph can be changed by adding or removing
|
||||
vertices. The memory management is the responsibility of the graph
|
||||
implementation. The graph user need only make calls to
|
||||
<TT>add_vertex</TT> and <TT>remove_vertex</TT> and the graph
|
||||
implementation does the rest.
|
||||
|
||||
<H3>Refinement of</H3>
|
||||
|
||||
<a href="./Graph.html">Graph</a> and <a
|
||||
href="http://www.sgi.com/tech/stl/DefaultConstructible.html">DefaultConstructible</a>
|
||||
|
||||
<H3>Associated Types</H3>
|
||||
|
||||
No additional associated types.
|
||||
|
||||
<h3>Valid Expressions</h3>
|
||||
|
||||
<ul>
|
||||
<li><a name="sec:add_vertex"><TT>add_vertex(g)</TT></a>
|
||||
<b>returns</b> <TT>vertex_descriptor</TT>
|
||||
<br><br>
|
||||
|
||||
<b>Semantics:</b> Add a new vertex to the graph. The
|
||||
<TT>vertex_descriptor</TT> for the new vertex is returned.<br>
|
||||
</li>
|
||||
|
||||
<li><a name="sec:remove_vertex"><tt>remove_vertex(u, g)</tt></a>
|
||||
<b>returns</b> <tt>void</tt><br><br>
|
||||
|
||||
<b> Semantics:</b> Remove <i>u</i> from the vertex set of the graph.
|
||||
<br>
|
||||
<b> Preconditions:</b> <i>u</i> is a valid vertex descriptor of graph <i>g</i>
|
||||
and there are no edges incident to vertex <i>u</i>. The function
|
||||
<TT>clear_vertex</TT> can be used to remove all incident edges.
|
||||
<br>
|
||||
<b> Postconditions: </b> <TT>num_vertices(g)</TT> is one less; <i>u</i>
|
||||
no longer appears in the vertex set of the graph and it
|
||||
is no longer a valid vertex descriptor.
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<H3>Complexity guarantees</H3>
|
||||
<ul>
|
||||
<li> Vertex insertion is guaranteed to be amortized constant time.
|
||||
|
||||
<li> Vertex removal is at most <TT>O(|E| + |V|)</TT>.
|
||||
</ul>
|
||||
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@cs.indiana.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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: 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>
|
||||
@@ -66,14 +62,14 @@ Science of the U.S. Department of Energy.
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
|
||||
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
|
||||
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -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>
|
||||
@@ -56,7 +63,7 @@ class my_graph {
|
||||
// ...
|
||||
typedef ... out_edge_iterator;
|
||||
typedef ... vertex_descriptor;
|
||||
typedef boost::adjacency_iterator<my_graph, vertex_descriptor, out_edge_iterator>::type adjacency_iterator;
|
||||
typedef boost::adjacency_iterator_generator<my_graph, vertex_descriptor, out_edge_iterator>::type adjacency_iterator;
|
||||
// ...
|
||||
};
|
||||
|
||||
@@ -113,11 +120,11 @@ 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>
|
||||
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan -->11 Mar 2001<!--webbot bot="Timestamp" endspan i-checksum="14879" --></p>
|
||||
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan -->19 Aug 2001<!--webbot bot="Timestamp" endspan i-checksum="14767" --></p>
|
||||
<p>© Copyright Jeremy Siek 2000. Permission to copy, use,
|
||||
modify, sell and distribute this document is granted provided this copyright
|
||||
notice appears in all copies. This document is provided "as is"
|
||||
|
||||
@@ -1,29 +1,25 @@
|
||||
<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. Jeremy Siek makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
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: Adjacency List</Title>
|
||||
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
||||
ALINK="#ff0000">
|
||||
<IMG SRC="../../../c++boost.gif"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
<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:adjacency-list-class"></A>
|
||||
<pre>
|
||||
adjacency_list<EdgeList, VertexList, Directed,
|
||||
adjacency_list<OutEdgeList, VertexList, Directed,
|
||||
VertexProperties, EdgeProperties,
|
||||
GraphProperties>
|
||||
GraphProperties, EdgeList>
|
||||
</pre>
|
||||
</H1>
|
||||
|
||||
@@ -37,24 +33,24 @@ href="graph_theory_review.html#sec:adjacency-list-representation">adjacency-list
|
||||
is basically a two-dimensional structure, where each element of the
|
||||
first dimension represents a vertex, and each of the vertices contains
|
||||
a one-dimensional structure that is its edge list. <a
|
||||
href="fig:adj-list-graph">Figure 1</a> shows an adjacency list
|
||||
href="#fig:adj-list-graph">Figure 1</a> shows an adjacency list
|
||||
representation of a directed graph.
|
||||
|
||||
<P></P>
|
||||
<DIV ALIGN="center"><A NAME="fig:adj-list-graph"></A><A NAME="1509"></A>
|
||||
<TABLE>
|
||||
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 1:</STRONG> Adjacency List Representation of a Directed Graph.</CAPTION>
|
||||
<TR><TD><IMG SRC="./figs/adj-matrix-graph.gif" width="386" height="284"></TD>
|
||||
<TD><IMG SRC="./figs/adj-list.gif" width="62" height="122"></TD></TR>
|
||||
<TR><TD><IMG SRC="./figs/adj-matrix-graph2.gif" width="386" height="284"></TD>
|
||||
<TD><IMG SRC="./figs/adj-list2.gif" width="62" height="122"></TD></TR>
|
||||
</TABLE>
|
||||
</DIV><P></P>
|
||||
|
||||
The
|
||||
<TT>VertexList</TT> template parameter of the <TT>adjacency_list</TT>
|
||||
class controls what kind of container is used to represent the outer
|
||||
two-dimensional container. The <TT>EdgeList</TT> template parameter
|
||||
two-dimensional container. The <TT>OutEdgeList</TT> template parameter
|
||||
controls what kind of container is used to represent the edge
|
||||
lists. The choices for <TT>EdgeList</TT> and <TT>VertexList</TT> will
|
||||
lists. The choices for <TT>OutEdgeList</TT> and <TT>VertexList</TT> will
|
||||
determine the space complexity of the graph structure, and will
|
||||
determine the time complexity of the various graph operations. The
|
||||
possible choices and tradeoffs are discussed in Section <A
|
||||
@@ -67,14 +63,14 @@ directed, undirected, or directed with access to both the in-edges and
|
||||
out-edges (which we call bidirectional). The bidirectional graph takes
|
||||
up twice the space (per edge) of a directed graph since each edge will
|
||||
appear in both an out-edge and in-edge list. <a
|
||||
href="fig:undir-adj-list-graph">Figure 2</a> shows an adjacency list
|
||||
href="#fig:undir-adj-list-graph">Figure 2</a> shows an adjacency list
|
||||
representation of an undirected graph.
|
||||
|
||||
<P></P>
|
||||
<DIV ALIGN="center"><A NAME="fig:undir-adj-list-graph"></A><A NAME="1509"></A>
|
||||
<TABLE>
|
||||
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 2:</STRONG> Adjacency List Representation of an Undirected Graph.</CAPTION>
|
||||
<TR><TD><IMG SRC="./figs/undir-adj-matrix-graph.gif" width="260" height="240"></TD>
|
||||
<TR><TD><IMG SRC="./figs/undir-adj-matrix-graph2.gif" width="260" height="240"></TD>
|
||||
<TD><IMG SRC="./figs/undir-adj-list.gif" width="62" height="122"></TD></TR>
|
||||
</TABLE>
|
||||
</DIV><P></P>
|
||||
@@ -89,61 +85,9 @@ Section <A HREF="./using_adjacency_list.html">Using
|
||||
<H3>Example</H3>
|
||||
|
||||
<P>
|
||||
A graph used to represent a family tree. The complete source code is
|
||||
in the file <a
|
||||
href="../example/family_tree.cpp"><tt>examples/family_tree.cpp</tt></a>.
|
||||
|
||||
<PRE>
|
||||
enum { Jeanie, Debbie, Rick, John, Amanda,
|
||||
Margaret, Benjamin, N };
|
||||
|
||||
std::vector<std::string> name(N);
|
||||
name[Jeanie] = "Jeanie";
|
||||
name[Debbie] = "Debbie";
|
||||
name[Rick] = "Rick";
|
||||
name[John] = "John";
|
||||
name[Amanda] = "Amanda";
|
||||
name[Margaret] = "Margaret";
|
||||
name[Benjamin] = "Benjamin";
|
||||
|
||||
adjacency_list<> G(N);
|
||||
add_edge(Jeanie, Debbie, G);
|
||||
add_edge(Jeanie, Rick, G);
|
||||
add_edge(Jeanie, John, G);
|
||||
add_edge(Debbie, Amanda, G);
|
||||
add_edge(Rick, Margaret, G);
|
||||
add_edge(John, Benjamin, G);
|
||||
|
||||
graph_traits< adjacency_list<> >::vertex_iterator i, end;
|
||||
graph_traits< adjacency_list<> >::adjacency_iterator ai, a_end;
|
||||
|
||||
property_map<adjacency_list<>, vertex_index_t>::type
|
||||
id = get(vertex_index, G);
|
||||
|
||||
for(tie(i,end) = vertices(G); i != end; ++i) {
|
||||
cout << name[get(id, *i)];
|
||||
tie(ai, a_end) = adjacent_vertices(*i, G);
|
||||
if (ai == a_end)
|
||||
cout << " has no children";
|
||||
else
|
||||
cout << " is the parent of ";
|
||||
for (; ai != a_end; ++ai)
|
||||
cout << name[get(id, *ai)] << " ";
|
||||
cout << endl;
|
||||
}
|
||||
</PRE>
|
||||
The output is:
|
||||
<PRE>
|
||||
Jeanie is the parent of Debbie Rick John
|
||||
Debbie is the parent of Amanda
|
||||
Rick is the parent of Margaret
|
||||
John is the parent of Benjamin
|
||||
Amanda has no children
|
||||
Margaret has no children
|
||||
Benjamin has no children
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
The example in <a
|
||||
href="../example/family-tree-eg.cpp"><tt>examples/family-tree-eg.cpp</tt></a>
|
||||
shows how to represent a family tree with a graph.
|
||||
|
||||
<H3>Template Parameters</H3>
|
||||
|
||||
@@ -153,7 +97,7 @@ The output is:
|
||||
<th>Parameter</th><th>Description</th><th>Default</th>
|
||||
</tr>
|
||||
|
||||
<TR><TD><TT>EdgeList</TT></TD>
|
||||
<TR><TD><TT>OutEdgeList</TT></TD>
|
||||
<TD>The selector for the container used to represent the
|
||||
edge-list for each of the vertices.</TD>
|
||||
<TD><TT>vecS</TT></TD>
|
||||
@@ -190,22 +134,33 @@ The output is:
|
||||
<TD><TT>no_property</TT></TD>
|
||||
</TR>
|
||||
|
||||
<TR><TD><TT>EdgeList</TT></TD>
|
||||
<TD>The selector for the container used to represent the
|
||||
edge-list for the graph.</TD>
|
||||
<TD><TT>listS</TT></TD>
|
||||
</TR>
|
||||
|
||||
</TABLE>
|
||||
<P>
|
||||
|
||||
<H3>Model of</H3>
|
||||
|
||||
<P>
|
||||
<a href="./VertexAndEdgeListGraph.html">VertexAndEdgeListGraph</a>,
|
||||
<a href="./MutablePropertyGraph.html">MutablePropertyGraph</a>
|
||||
<a href="./VertexAndEdgeListGraph.html">VertexAndEdgeListGraph</a>,
|
||||
<a href="./MutablePropertyGraph.html">MutablePropertyGraph</a>,
|
||||
<a href="../../utility/CopyConstructible.html">CopyConstructible</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>
|
||||
@@ -220,10 +175,13 @@ properties is described in Section <A
|
||||
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
|
||||
HREF="../../property_map/doc/property_map.html">Property Map
|
||||
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
|
||||
href="../../property_map/doc/LvaluePropertyMap.html">Lvalue Property
|
||||
Map</a> concept. If the <TT>adjacency_list</TT> is const,
|
||||
then the property map is constant, otherwise the property
|
||||
map is mutable.
|
||||
@@ -236,7 +194,7 @@ the <TT>vertex_index_t</TT> property. The indices fall in the range
|
||||
removed the indices are adjusted so that they retain these
|
||||
properties. Some care must be taken when using these indices to access
|
||||
exterior property storage. The property map for vertex index is a
|
||||
model of <a href="../../property_map/ReadablePropertyMap.html">Readable
|
||||
model of <a href="../../property_map/doc/ReadablePropertyMap.html">Readable
|
||||
Property Map</a>.
|
||||
|
||||
<P>
|
||||
@@ -307,7 +265,7 @@ The stability issue also affects vertex and edge descriptors. For
|
||||
example, suppose you use vector of vertex descriptors to keep track of
|
||||
the parents (or predecessors) of vertices in a shortest paths tree
|
||||
(see <a
|
||||
href="../example/dijkstra.cpp"><tt>examples/dijkstra.cpp</tt></a>).
|
||||
href="../example/dijkstra-example.cpp"><tt>examples/dijkstra-example.cpp</tt></a>).
|
||||
You create the parent vector with a call to
|
||||
<tt>dijkstra_shortest_paths()</tt>, and then remove a vertex from the
|
||||
graph. Subsequently you try to use the parent vector, but since all
|
||||
@@ -317,8 +275,8 @@ vertex descriptors have become invalid, the result is incorrect.
|
||||
std::vector<Vertex> parent(num_vertices(G));
|
||||
std::vector<Vertex> distance(num_vertices(G));
|
||||
|
||||
dijkstra_shortest_paths(G, s, &distance[0],
|
||||
make_ucs_visitor(record_predecessors(&parent[0], on_edge_relaxed())));
|
||||
dijkstra_shortest_paths(G, s, distance_map(&distance[0]).
|
||||
predecessor_map(&parent[0]));
|
||||
|
||||
remove_vertex(s, G); <b>// Bad idea! Invalidates vertex descriptors in parent vector.</b>
|
||||
|
||||
@@ -342,16 +300,16 @@ iterators that point to other edges (not <i>(u,v)</i>).
|
||||
<p>
|
||||
In general, if you want your vertex and edge descriptors to be stable
|
||||
(never invalidated) then use <tt>listS</tt> or <tt>setS</tt> for the
|
||||
<tt>VertexList</tt> and <tt>EdgeList</tt> template parameters of
|
||||
<tt>VertexList</tt> and <tt>OutEdgeList</tt> template parameters of
|
||||
<tt>adjacency_list</tt>. If you are not as concerned about descriptor
|
||||
and iterator stability, and are more concerned about memory
|
||||
consumption and graph traversal speed, use <tt>vecS</tt> for the
|
||||
<tt>VertexList</tt> and/or <tt>EdgeList</tt> template parameters.
|
||||
<tt>VertexList</tt> and/or <tt>OutEdgeList</tt> template parameters.
|
||||
|
||||
<p>
|
||||
The following table summarizes which operations cause descriptors and
|
||||
iterators to become invalid. In the table, <tt>EL</tt> is an
|
||||
abbreviation for <tt>EdgeList</tt> and <tt>VL</tt> means
|
||||
abbreviation for <tt>OutEdgeList</tt> and <tt>VL</tt> means
|
||||
<tt>VertexList</tt>. The <b>Adj Iter</b> category includes the
|
||||
<tt>out_edge_iterator</tt>, <tt>in_edge_iterator</tt>, and
|
||||
<tt>adjacency_iterator</tt> types. A more detailed description of
|
||||
@@ -364,30 +322,51 @@ each operation.
|
||||
<CAPTION ALIGN="BOTTOM"><STRONG>Table:</STRONG>
|
||||
Summary of Descriptor and Iterator Invalidation.
|
||||
</CAPTION>
|
||||
<tr> <th>Function</th> <th>Vertex Desc</th> <th>Edge Desc</th>
|
||||
<th>Vertex Iter</th> <th>Edge Iter</th> <th>Adj Iter</th> </tr>
|
||||
|
||||
<tr>
|
||||
<td><tt>add_edge()</tt></td> <td align=center><tt>OK</tt></td><td
|
||||
align=center><tt>OK</tt></td><td align=center><tt>OK</tt></td><td
|
||||
align=center><tt>EL=vecS &&<br> Directed=directedS</tt></td><td align=center><tt>EL=vecS</tt></td>
|
||||
<th>Function</th>
|
||||
<th>Vertex Desc</th>
|
||||
<th>Edge Desc</th>
|
||||
<th>Vertex Iter</th>
|
||||
<th>Edge Iter</th>
|
||||
<th>Adj Iter</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>remove_edge()<br>remove_edge_if()<br>remove_out_edge_if()<br>remove_in_edge_if()<br>clear_vertex()</tt></td><td align=center><tt>OK</tt></td><td align=center><tt>OK</tt></td><td align=center><tt>OK</tt></td>
|
||||
<td align=center><tt>EL=vecS &&<br> Directed=directedS</tt></td><td align=center><tt>EL=vecS</tt></td>
|
||||
<td>
|
||||
<tt>add_edge()</tt></td>
|
||||
<td align=center><tt>OK</tt></td>
|
||||
<td align=center><tt>OK</tt></td>
|
||||
<td align=center><tt>OK</tt></td>
|
||||
<td align=center><tt>EL=vecS && <br>Directed=directedS</tt></td>
|
||||
<td align=center><tt>EL=vecS</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>add_vertex()</tt></td><td align=center><tt>OK</tt></td><td
|
||||
align=center><tt>OK</tt></td><td align=center><tt>OK</tt></td><td
|
||||
align=center><tt>OK</tt></td><td align=center><tt>OK</tt></td>
|
||||
<td><tt>remove_edge()<br>remove_edge_if()<br>remove_out_edge_if()<br>
|
||||
remove_in_edge_if()<br>clear_vertex()</tt>
|
||||
</td>
|
||||
<td align=center><tt>OK</tt></td>
|
||||
<td align=center><tt>OK</tt></td>
|
||||
<td align=center><tt>OK</tt></td>
|
||||
<td align=center><tt>EL=vecS && <br>Directed=directedS</tt></td>
|
||||
<td align=center><tt>EL=vecS</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>remove_vertex()</tt></td><td align=center><tt>VL=vecS</tt></td><td align=center><tt>VL=vecS</tt></td><td align=center><tt>VL=vecS</tt></td><td align=center><tt>VL=vecS</tt></td><td align=center><tt>VL=vecS</tt></td>
|
||||
<td><tt>add_vertex()</tt></td>
|
||||
<td align=center><tt>OK</tt></td>
|
||||
<td align=center><tt>OK</tt></td>
|
||||
<td align=center><tt>OK</tt></td>
|
||||
<td align=center><tt>VL=vecS && <br/> Directed=directedS</tt></td>
|
||||
<td align=center><tt>VL=vecS && <br/> Directed=directedS</tt></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt>remove_vertex()</tt></td>
|
||||
<td align=center><tt>VL=vecS</tt></td>
|
||||
<td align=center><tt>VL=vecS</tt></td>
|
||||
<td align=center><tt>VL=vecS</tt></td>
|
||||
<td align=center><tt>VL=vecS</tt></td>
|
||||
<td align=center><tt>VL=vecS</tt></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
<H2>Associated Types</H2>
|
||||
|
||||
<hr>
|
||||
@@ -396,7 +375,7 @@ align=center><tt>OK</tt></td><td align=center><tt>OK</tt></td>
|
||||
<br>
|
||||
and
|
||||
<br>
|
||||
<tt>adjacency_list_traits<EdgeList, VertexList, Directed>::vertex_descriptor</tt>
|
||||
<tt>adjacency_list_traits<OutEdgeList, VertexList, Directed, EdgeList>::vertex_descriptor</tt>
|
||||
<br><br>
|
||||
The type for the vertex descriptors associated with the
|
||||
<TT>adjacency_list</TT>.
|
||||
@@ -405,7 +384,7 @@ The type for the vertex descriptors associated with the
|
||||
|
||||
<tt>graph_traits<adjacency_list>::edge_descriptor</tt><br>
|
||||
and<br>
|
||||
<tt>adjacency_list_traits<EdgeList, VertexList, Directed>::edge_descriptor</tt>
|
||||
<tt>adjacency_list_traits<OutEdgeList, VertexList, Directed, EdgeList>::edge_descriptor</tt>
|
||||
<br><br>
|
||||
The type for the edge descriptors associated with the
|
||||
<TT>adjacency_list</TT>.
|
||||
@@ -438,9 +417,9 @@ href="http://www.sgi.com/tech/stl/BidirectionalIterator.html">BidirectionalItera
|
||||
<br><br>
|
||||
|
||||
The type for the iterators returned by <TT>out_edges()</TT>.
|
||||
When <tt>EdgeList=vecS</tt> then the <tt>out_edge_iterator</tt> models
|
||||
When <tt>OutEdgeList=vecS</tt> then the <tt>out_edge_iterator</tt> models
|
||||
<a href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">
|
||||
RandomAccessIterator</a>. When <tt>EdgeList=slistS</tt> then the
|
||||
RandomAccessIterator</a>. When <tt>OutEdgeList=slistS</tt> then the
|
||||
<tt>out_edge_iterator</tt> models <a
|
||||
href="http://www.sgi.com/tech/stl/ForwardIterator.html">
|
||||
ForwardIterator</a>. Otherwise the <tt>out_edge_iterator</tt> models
|
||||
@@ -457,9 +436,16 @@ 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<EdgeList, VertexList, Directed>::directed_category</tt>
|
||||
<tt>adjacency_list_traits<OutEdgeList, VertexList, Directed, EdgeList>::directed_category</tt>
|
||||
<br><br>
|
||||
Provides information about whether the graph is
|
||||
directed (<TT>directed_tag</TT>) or undirected
|
||||
@@ -469,7 +455,7 @@ directed (<TT>directed_tag</TT>) or undirected
|
||||
|
||||
<tt>graph_traits<adjacency_list>::edge_parallel_category</tt><br>
|
||||
and<br>
|
||||
<tt>adjacency_list_traits<EdgeList, VertexList, Directed>::edge_parallel_category</tt>
|
||||
<tt>adjacency_list_traits<OutEdgeList, VertexList, Directed, EdgeList>::edge_parallel_category</tt>
|
||||
<br><br>
|
||||
This describes whether the graph class allows the insertion of
|
||||
parallel edges (edges with the same source and target). The two tags
|
||||
@@ -480,13 +466,17 @@ parallel edges while the others allow parallel edges.
|
||||
|
||||
<hr>
|
||||
|
||||
<tt>graph_traits<adjacency_list>::vertices_size_type</tt>
|
||||
<tt>graph_traits<adjacency_list>::vertices_size_type</tt><br>
|
||||
and<br>
|
||||
<tt>adjacency_list_traits<OutEdgeList, VertexList, Directed_list, EdgeList>::vertices_size_type</tt><br>
|
||||
<br><br>
|
||||
The type used for dealing with the number of vertices in the graph.
|
||||
|
||||
<hr>
|
||||
|
||||
<tt>graph_traits<adjacency_list>::edge_size_type</tt>
|
||||
<tt>graph_traits<adjacency_list>::edge_size_type</tt><br>
|
||||
and<br>
|
||||
<tt>adjacency_list_traits<OutEdgeList, VertexList, Directed_list, EdgeList>::edge_size_type</tt><br>
|
||||
<br><br>
|
||||
The type used for dealing with the number of edges in the graph.
|
||||
|
||||
@@ -517,6 +507,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>
|
||||
@@ -546,7 +560,7 @@ Assignment operator. Makes this graph a copy of graph
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
adjacency_list(vertices_size_type n,
|
||||
adjacency_list(vertices_size_type n,
|
||||
const GraphProperty& p = GraphProperty())
|
||||
</pre>
|
||||
Creates a graph object with <TT>n</TT> vertices and zero edges.
|
||||
@@ -556,8 +570,9 @@ Creates a graph object with <TT>n</TT> vertices and zero edges.
|
||||
<a name="sec:iterator-constructor">
|
||||
<pre>
|
||||
template <class EdgeIterator>
|
||||
adjacency_list(vertices_size_type n,
|
||||
EdgeIterator first, EdgeIterator last,
|
||||
adjacency_list(EdgeIterator first, EdgeIterator last,
|
||||
vertices_size_type n,
|
||||
edges_size_type m = 0,
|
||||
const GraphProperty& p = GraphProperty())
|
||||
</pre>
|
||||
Creates a graph object with <TT>n</TT> vertices and with the edges
|
||||
@@ -574,9 +589,10 @@ range of <TT>[0, n)</TT>.
|
||||
|
||||
<pre>
|
||||
template <class EdgeIterator, class EdgePropertyIterator>
|
||||
adjacency_list(vertices_size_type num_vertices,
|
||||
EdgeIterator first, EdgeIterator last,
|
||||
adjacency_list(EdgeIterator first, EdgeIterator last,
|
||||
EdgePropertyIterator ep_iter,
|
||||
vertices_size_type n,
|
||||
edges_size_type m = 0,
|
||||
const GraphProperty& p = GraphProperty())
|
||||
</pre>
|
||||
Creates a graph object with <TT>n</TT> vertices and with the edges
|
||||
@@ -605,7 +621,7 @@ void swap(adjacency_list& x)
|
||||
Swap the vertices, edges, and properties of this graph with the
|
||||
vertices, edges, and properties of graph <tt>x</tt>.
|
||||
<hr>
|
||||
|
||||
|
||||
<P>
|
||||
|
||||
<H2>Non-Member Functions</H2>
|
||||
@@ -638,7 +654,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>
|
||||
|
||||
@@ -733,7 +763,7 @@ std::pair<edge_descriptor, bool>
|
||||
edge(vertex_descriptor u, vertex_descriptor v,
|
||||
const adjacency_list& g)
|
||||
</pre>
|
||||
Returns the edge connecting vertex <tt>u</tt> to vertex <tt>v</tt> in
|
||||
Returns an edge connecting vertex <tt>u</tt> to vertex <tt>v</tt> in
|
||||
graph <tt>g</tt>.
|
||||
|
||||
<hr>
|
||||
@@ -745,7 +775,7 @@ edge_range(vertex_descriptor u, vertex_descriptor v,
|
||||
</pre>
|
||||
Returns a pair of out-edge iterators that give the range for
|
||||
all the parallel edges from <tt>u</tt> to <tt>v</tt>. This
|
||||
function only works when the <tt>EdgeList</tt> for the
|
||||
function only works when the <tt>OutEdgeList</tt> for the
|
||||
<tt>adjacency_list</tt> is a container that sorts the
|
||||
out edges according to target vertex, and allows for
|
||||
parallel edges. The <tt>multisetS</tt> selector chooses
|
||||
@@ -765,16 +795,14 @@ 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>
|
||||
The placement of the new edge in the out-edge list is in general
|
||||
unspecified, though ordering of the out-edge list can be accomplished
|
||||
through the choice of <tt>EdgeList</tt>.
|
||||
through the choice of <tt>OutEdgeList</tt>.
|
||||
|
||||
If the <tt>VertexList</tt> selector is
|
||||
<tt>vecS</tt>, and if either vertex descriptor <tt>u</tt> or
|
||||
@@ -783,9 +811,9 @@ number of vertices in the graph, the graph is enlarged so that the
|
||||
number of vertices is <tt>std::max(u,v) + 1</tt>.
|
||||
|
||||
<p>
|
||||
If the <TT>EdgeList</TT> selector is <TT>vecS</TT> then this operation
|
||||
If the <TT>OutEdgeList</TT> selector is <TT>vecS</TT> then this operation
|
||||
will invalidate any <tt>out_edge_iterator</tt> for vertex
|
||||
<i>u</i>. This also applies if the <TT>EdgeList</TT> is a user-defined
|
||||
<i>u</i>. This also applies if the <TT>OutEdgeList</TT> is a user-defined
|
||||
container that invalidates its iterators when <TT>push(container,
|
||||
x)</TT> is invoked (see Section <A
|
||||
HREF="./using_adjacency_list.html#sec:custom-storage">Customizing the
|
||||
@@ -814,11 +842,11 @@ value of the edge's internal property storage. Also see the previous
|
||||
void remove_edge(vertex_descriptor u, vertex_descriptor v,
|
||||
adjacency_list& g)
|
||||
</pre>
|
||||
Removes the edge <i>(u,v)</i> from the graph.
|
||||
Removes the edge <i>(u,v)</i> from the graph.
|
||||
<p>
|
||||
This operation causes any outstanding edge descriptors or iterators
|
||||
that point to edge <i>(u,v)</i> to become invalid. In addition, if
|
||||
the <TT>EdgeList</TT> selector is <TT>vecS</TT> then this operation
|
||||
the <TT>OutEdgeList</TT> selector is <TT>vecS</TT> then this operation
|
||||
will invalidate any iterators that point into the edge-list for vertex
|
||||
<i>u</i> and also for vertex <i>v</i> in the undirected and
|
||||
bidirectional case. Also, for directed graphs this invalidates any
|
||||
@@ -860,7 +888,7 @@ void remove_out_edge_if(vertex_descriptor u, Predicate predicate,
|
||||
</pre>
|
||||
Removes all out-edges of vertex <i>u</i> from the graph that satisfy
|
||||
the <tt>predicate</tt>. That is, if the predicate returns true when
|
||||
applied to an edge descriptor, then the edge is removed.
|
||||
applied to an edge descriptor, then the edge is removed.
|
||||
<p>
|
||||
The affect on descriptor and iterator stability is the same as that of
|
||||
invoking <tt>remove_edge()</tt> on each of the removed edges.
|
||||
@@ -892,7 +920,7 @@ void remove_edge_if(Predicate predicate, adjacency_list& g)
|
||||
</pre>
|
||||
Removes all edges from the graph that satisfy
|
||||
the <tt>predicate</tt>. That is, if the predicate returns true when
|
||||
applied to an edge descriptor, then the edge is removed.
|
||||
applied to an edge descriptor, then the edge is removed.
|
||||
<p>
|
||||
The affect on descriptor and iterator stability is the same as that of
|
||||
invoking <tt>remove_edge()</tt> on each of the removed edges.
|
||||
@@ -905,7 +933,7 @@ vertex_descriptor
|
||||
add_vertex(adjacency_list& g)
|
||||
</pre>
|
||||
Adds a vertex to the graph and returns the vertex descriptor for the
|
||||
new vertex.
|
||||
new vertex.
|
||||
</a>
|
||||
|
||||
<hr>
|
||||
@@ -933,13 +961,42 @@ the edges that have <tt>u</tt> as the source or target.
|
||||
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
void clear_out_edges(vertex_descriptor u, adjacency_list& g)
|
||||
</pre>
|
||||
Removes all out-edges from vertex <i>u</i>. The vertex still appears
|
||||
in the vertex set of the graph.
|
||||
<p>
|
||||
The affect on descriptor and iterator stability is the
|
||||
same as that of invoking <tt>remove_edge()</tt> for all of
|
||||
the edges that have <tt>u</tt> as the source.
|
||||
<p>
|
||||
This operation is not applicable to undirected graphs
|
||||
(use <tt>clear_vertex()</tt> instead).
|
||||
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
void clear_in_edges(vertex_descriptor u, adjacency_list& g)
|
||||
</pre>
|
||||
Removes all in-edges from vertex <i>u</i>. The vertex still appears
|
||||
in the vertex set of the graph.
|
||||
<p>
|
||||
The affect on descriptor and iterator stability is the
|
||||
same as that of invoking <tt>remove_edge()</tt> for all of
|
||||
the edges that have <tt>u</tt> as the target.
|
||||
<p>
|
||||
This operation is only applicable to bidirectional graphs.
|
||||
|
||||
<hr>
|
||||
|
||||
<pre>
|
||||
void remove_vertex(vertex_descriptor u, adjacency_list& g)
|
||||
</pre>
|
||||
Remove vertex <i>u</i> from the vertex set of the graph. It is assumed
|
||||
that there are no edges to or from vertex <i>u</i> when it is removed.
|
||||
One way to make sure of this is to invoke <TT>clear_vertex()</TT>
|
||||
beforehand.
|
||||
beforehand.
|
||||
<p>
|
||||
If the <TT>VertexList</TT> template parameter of the
|
||||
<TT>adjacency_list</TT> was <TT>vecS</TT>, then all vertex
|
||||
@@ -1020,9 +1077,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>
|
||||
@@ -1037,19 +1120,19 @@ href="../../../boost/graph/adjacency_list.hpp"><tt>boost/graph/adjacency_list.hp
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
|
||||
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
|
||||
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
<!-- LocalWords: gif ALT EdgeList VertexList html VertexProperties EdgeProperties
|
||||
</HTML>
|
||||
<!-- LocalWords: gif ALT OutEdgeList EdgeList VertexList html VertexProperties EdgeProperties
|
||||
-->
|
||||
<!-- LocalWords: GraphPropertyTag cpp enum ai cout endl VertexAndEdgeListGraph
|
||||
-->
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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: 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>
|
||||
@@ -148,14 +144,14 @@ parallel edges (<tt>disallow_parallel_edge_tag</tt>).
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
|
||||
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
|
||||
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<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. Jeremy Siek makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
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: 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>
|
||||
@@ -39,7 +35,7 @@ representation of a graph.
|
||||
<DIV ALIGN="center"><A NAME="fig:adj-matrix-graph"></A><A NAME="1509"></A>
|
||||
<TABLE>
|
||||
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 1:</STRONG> Adjacency Matrix Representation of a Directed Graph.</CAPTION>
|
||||
<TR><TD><IMG SRC="./figs/adj-matrix-graph.gif" width="386" height="284"></TD>
|
||||
<TR><TD><IMG SRC="./figs/adj-matrix-graph3.gif" width="386" height="284"></TD>
|
||||
<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>
|
||||
@@ -74,8 +75,8 @@ matrix representation of an undirected graph.
|
||||
<DIV ALIGN="center"><A NAME="fig:undir-adj-matrix-graph"></A><A NAME="1509"></A>
|
||||
<TABLE>
|
||||
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 1:</STRONG> Adjacency Matrix Representation of an Undirected Graph.</CAPTION>
|
||||
<TR><TD><IMG SRC="./figs/undir-adj-matrix-graph.gif" width="260" height="240"></TD>
|
||||
<TD><IMG SRC="./figs/undir-adj-matrix.gif" width="135" height="136"></TD></TR>
|
||||
<TR><TD><IMG SRC="./figs/undir-adj-matrix-graph3.gif" width="260" height="240"></TD>
|
||||
<TD><IMG SRC="./figs/undir-adj-matrix2.gif" width="135" height="136"></TD></TR>
|
||||
</TABLE>
|
||||
</DIV><P></P>
|
||||
|
||||
@@ -204,12 +205,17 @@ The output is:
|
||||
|
||||
<h3>Model Of</h3>
|
||||
|
||||
<a href="./VertexAndEdgeListGraph.html">VertexAndEdgeListGraph</a>, <a
|
||||
href="./AdjacencyMatrix.html">AdjacencyMatrix</a>, and <a
|
||||
href="./MutablePropertyGraph.html">MutablePropertyGraph</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>,
|
||||
and <a href="../../utility/Assignable.html">Assignable</a>.
|
||||
|
||||
|
||||
<h3>Associates Types</h3>
|
||||
<h3>Associated Types</h3>
|
||||
|
||||
<hr>
|
||||
|
||||
@@ -248,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>
|
||||
@@ -354,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>
|
||||
@@ -371,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>
|
||||
@@ -380,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>
|
||||
@@ -390,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>
|
||||
@@ -398,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>
|
||||
@@ -406,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>
|
||||
@@ -436,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>
|
||||
@@ -445,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
|
||||
@@ -459,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.
|
||||
|
||||
@@ -468,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>
|
||||
@@ -483,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>.)
|
||||
|
||||
@@ -507,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,499 @@
|
||||
<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);
|
||||
|
||||
<i>// Version that does not initialize property maps (used for implicit graphs)</i>
|
||||
template <typename VertexListGraph, typename AStarHeuristic,
|
||||
typename <a href="AStarVisitor.html">AStarVisitor</a>, typename PredecessorMap,
|
||||
typename CostMap, typename DistanceMap,
|
||||
typename WeightMap, typename ColorMap,
|
||||
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 CostInf, typename CostZero>
|
||||
inline void
|
||||
astar_search_no_init
|
||||
(VertexListGraph &g,
|
||||
typename graph_traits<VertexListGraph>::vertex_descriptor s,
|
||||
AStarHeuristic h, AStarVisitor vis,
|
||||
PredecessorMap predecessor, CostMap cost,
|
||||
DistanceMap distance, WeightMap weight,
|
||||
ColorMap color, VertexIndexMap index_map,
|
||||
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. Please note that
|
||||
<tt>astar_search_no_init()</tt> must be used for implicit graphs; the basic
|
||||
<tt>astar_search()</tt> function requires a graph that models
|
||||
<a href="VertexListGraph.html"><tt>VertexListGraph</tt></a>.
|
||||
</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/doc/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/doc/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/doc/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/doc/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/doc/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/doc/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(e, 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>
|
||||
@@ -0,0 +1,6 @@
|
||||
\DeclareOption{awpaper}
|
||||
{\setlength\paperheight {9.25in}%
|
||||
\setlength\paperwidth {7.375in}}
|
||||
\DeclareOption*{\PassOptonsToPackage{\CurrentOption}{newsiambook}}
|
||||
\ProcessOptions
|
||||
\ExecuteOptions{awpaper}
|
||||
@@ -1,20 +1,16 @@
|
||||
<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.
|
||||
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: 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>
|
||||
@@ -89,8 +85,8 @@ of the i-th bandwidths <i>B<sub>i</sub>(G)</i>.<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -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/doc/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/doc/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="http://www.boost.org/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>
|
||||
@@ -1,34 +1,44 @@
|
||||
<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.
|
||||
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>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>
|
||||
|
||||
<P>
|
||||
<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(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,
|
||||
class PredecessorMap, class DistanceMap,
|
||||
class <a href="http://www.sgi.com/tech/stl/BinaryFunction.html">BinaryFunction</a>, class <a href="http://www.sgi.com/tech/stl/BinaryPredicate.html">BinaryPredicate</a>,
|
||||
class <a href="./BellmanFordVisitor.html">BellmanFordVisitor</a>>
|
||||
bool bellman_ford_shortest_paths(EdgeListGraph& g, Size N,
|
||||
const bgl_named_params<P, T, R>& params = <i>all defaults</i>)
|
||||
WeightMap weight, PredecessorMap pred, DistanceMap distance,
|
||||
BinaryFunction combine, BinaryPredicate compare, BellmanFordVisitor v)
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
@@ -51,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
|
||||
@@ -103,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>
|
||||
@@ -124,7 +136,8 @@ BELLMAN-FORD(<i>G</i>)
|
||||
<td valign="top">
|
||||
<pre>
|
||||
|
||||
initialize vertex <i>u</i>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -153,8 +166,8 @@ shortest paths tree in the <tt>predecessor_map()</tt>. For each vertex
|
||||
<i>u in V</i>, <i>p[u]</i> will be the predecessor of <i>u</i> in the
|
||||
shortest paths tree (unless <i>p[u] = u</i>, in which case <i>u</i> is
|
||||
either the source vertex or a vertex unreachable from the source). In
|
||||
addition to these two options, the user can provide there own
|
||||
custom-made visitor that can takes actions during any of the
|
||||
addition to these two options, the user can provide her own
|
||||
custom-made visitor that can take actions at any of the
|
||||
algorithm's event points.
|
||||
|
||||
<P>
|
||||
@@ -165,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>
|
||||
|
||||
|
||||
@@ -181,11 +201,14 @@ IN: <tt>weight_map(WeightMap w)</tt>
|
||||
<blockquote>
|
||||
The weight (also know as ``length'' or ``cost'') of each edge in the
|
||||
graph. The <tt>WeightMap</tt> type must be a model of <a
|
||||
href="../../property_map/ReadablePropertyMap.html">Readable Property
|
||||
href="../../property_map/doc/ReadablePropertyMap.html">Readable Property
|
||||
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>
|
||||
@@ -196,10 +219,12 @@ OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
|
||||
u</i> then <i>u</i> is either the source vertex or a vertex that is
|
||||
not reachable from the source. The <tt>PredecessorMap</tt> type
|
||||
must be a <a
|
||||
href="../../property_map/ReadWritePropertyMap.html">Read/Write
|
||||
href="../../property_map/doc/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>
|
||||
@@ -207,20 +232,41 @@ IN/OUT: <tt>distance_map(DistanceMap d)</tt>
|
||||
The shortest path weight from the source vertex to each vertex in
|
||||
the graph <tt>g</tt> is recorded in this property map. The type
|
||||
<tt>DistanceMap</tt> must be a model of <a
|
||||
href="../../property_map/ReadWritePropertyMap.html">Read/Write
|
||||
href="../../property_map/doc/ReadWritePropertyMap.html">Read/Write
|
||||
Property Map</a>. The key type of the property map must be the
|
||||
vertex descriptor type of the graph, and the value type of the
|
||||
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>
|
||||
<blockquote>
|
||||
The visitor object, whose type must be a model of
|
||||
<a href="./BellmanFordVisitor.html">Bellman-Ford Visitor</a>.<br>
|
||||
<b>Default:</b> <tt>bellman_visitor<null_visitor></tt>
|
||||
<a href="./BellmanFordVisitor.html">Bellman-Ford Visitor</a>.
|
||||
The visitor object is passed by value <a
|
||||
href="#1">[1]</a>.
|
||||
<br>
|
||||
<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>
|
||||
@@ -231,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>
|
||||
@@ -240,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>
|
||||
@@ -276,14 +326,23 @@ The time complexity is <i>O(V E)</i>.
|
||||
|
||||
<P>
|
||||
An example of using the Bellman-Ford algorithm is in <a
|
||||
href="../example/bellman_ford.cpp"><TT>examples/bellman_ford.cpp</TT></a>.
|
||||
href="../example/bellman-example.cpp"><TT>examples/bellman-example.cpp</TT></a>.
|
||||
|
||||
<h3>Notes</h3>
|
||||
|
||||
<p><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 © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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: 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>
|
||||
@@ -101,14 +97,14 @@ and <a href="./property_writer.html"><tt>property_writer</tt></a>.
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
|
||||
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
|
||||
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -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/doc/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/doc/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/doc/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/doc/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/doc/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/doc/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/doc/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/doc/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/doc/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/doc/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/doc/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/doc/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="http://www.boost.org/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>
|
||||
@@ -1,20 +1,16 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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: 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>
|
||||
@@ -43,7 +39,7 @@ visitor.
|
||||
// Construct graph G and obtain the source vertex s ...
|
||||
|
||||
boost::breadth_first_search(G, s,
|
||||
make_bfs_visitor(
|
||||
boost::make_bfs_visitor(
|
||||
std::make_pair(boost::record_distances(d, boost::on_tree_edge()),
|
||||
std::make_pair(boost::record_predecessors(p.begin(),
|
||||
boost::on_tree_edge()),
|
||||
@@ -118,14 +114,14 @@ and <a href="./property_writer.html"><tt>property_writer</tt></a>.
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
|
||||
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
|
||||
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
|
||||
|
After Width: | Height: | Size: 8.2 KiB |
@@ -1,20 +1,16 @@
|
||||
<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. Jeremy Siek makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
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: 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>
|
||||
@@ -86,14 +82,14 @@ like <tt>boost::weight_map</tt> that create an instance of
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
|
||||
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
|
||||
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<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.
|
||||
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: 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>
|
||||
@@ -307,14 +303,143 @@ Prentice Hall (1977)
|
||||
International Symposium on the Theory of Switching (1959)<br>
|
||||
Harvard University Press
|
||||
|
||||
</DL>
|
||||
<P></P><DT><A NAME="nuutila95">50</a>
|
||||
<DD>E. Nuutila<BR>
|
||||
<EM>Efficient transitive closure computation in large digraphs</EM><br>
|
||||
PhD Thesis, Helsinki University of Technology, 1995. <br>
|
||||
Acta Polytechnica Scandinavica, Mathematics and Computing in
|
||||
Engineering Series, No. 74.
|
||||
|
||||
<P></P><DT><A NAME="goral79">51</a>
|
||||
<DD>A. Goralcikova and V. Koubek<BR>
|
||||
<EM>A reduct and closure algorithm for graphs</EM><br>
|
||||
In Mathematical Foundations of Computer Science, <br>
|
||||
volume 74 of Lecture Notes in Computer Science, pages 301-307. <br>
|
||||
Springer-Verlag, 1979
|
||||
|
||||
<P></P><DT><A NAME="simon86">52</a>
|
||||
<DD>Klaus Simon<BR>
|
||||
<EM>An Improved Algorithm for Transitive Closure on Acyclic Digraphs</EM><br>
|
||||
Theoretical Computer Science 58<br>
|
||||
Automata, Languages and Programming, 376-386, 1986
|
||||
|
||||
<P></P><DT><A NAME="purdom70">53</a>
|
||||
<DD>P. Purdom<BR>
|
||||
<EM>A Transitive Closure Algorithm</EM><br>
|
||||
BIT, 10, 1970, pp. 76-94.
|
||||
|
||||
<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.
|
||||
|
||||
<p></p><dt><a name="kolmogorov03">68</a>
|
||||
<dd>Vladimir Kolmogorov<br>
|
||||
<em>Graph Based Algorithms for Scene Reconstruction from Two or More Views</em><br>
|
||||
PhD thesis, Cornell University, September 2003.
|
||||
|
||||
<p></p><dt><a name="boykov-kolmogorov04">69</a>
|
||||
<dd>Yuri Boykov and Vladimir Kolmogorov<br>
|
||||
<em><a href="http://www.csd.uwo.ca/faculty/yuri/Abstracts/pami04-abs.html">An Experimental Comparison of Min-Cut/Max-Flow Algorithms for Energy Minimization in Vision</a></em><br>
|
||||
In IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 26, no. 9, pp. 1124-1137, Sept. 2004.
|
||||
|
||||
<p></p><dt><a name="boyermyrvold04">70</a>
|
||||
<dd>John M. Boyer and Wendy J. Myrvold<br>
|
||||
<em><a href="http://www.emis.de/journals/JGAA/accepted/2004/BoyerMyrvold2004.8.3.pdf">
|
||||
On the Cutting Edge: Simplified O(n) Planarity by Edge Addition</a>
|
||||
</em><br>
|
||||
Journal of Graph Algorithms and Applications, 8(2): 241-273, 2004.
|
||||
|
||||
<p></p><dt><a name="chrobakpayne95">71</a>
|
||||
<dd>M. Chrobak, T. Payne<br>
|
||||
<em>
|
||||
A Linear-time Algorithm for Drawing a Planar Graph on the Grid
|
||||
</em><br>
|
||||
Information Processing Letters 54: 241-246, 1995.
|
||||
|
||||
<p></p><dt><a name="defraysseixpachpollack90">72</a>
|
||||
<dd>H. de Fraysseix, J. Pach, R. Pollack<br>
|
||||
<em>
|
||||
How to Draw a Planar Graph on a Grid
|
||||
</em><br>
|
||||
Combinatorica 10: 41-51, 1990.
|
||||
|
||||
</dl>
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -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/doc/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/doc/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/doc/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/doc/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/doc/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/doc/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/doc/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/doc/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="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana
|
||||
University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<a href="http://www.boost.org/people/doug_gregor.html">Doug Gregor</a>, Indiana University
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -0,0 +1,386 @@
|
||||
\documentclass[11pt]{report}
|
||||
|
||||
|
||||
\usepackage[leqno]{amsmath}
|
||||
\usepackage{amsfonts}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{amsthm}
|
||||
\usepackage{latexsym}
|
||||
\usepackage{jweb}
|
||||
\usepackage{times}
|
||||
\usepackage{graphicx}
|
||||
\usepackage[nolineno]{lgrind}
|
||||
|
||||
\newif\ifpdf
|
||||
\ifx\pdfoutput\undefined
|
||||
\pdffalse
|
||||
\else
|
||||
\pdfoutput=1
|
||||
\pdftrue
|
||||
\fi
|
||||
|
||||
\ifpdf
|
||||
\usepackage[
|
||||
pdftex,
|
||||
colorlinks=true, % change to true for the electronic version
|
||||
linkcolor=blue,filecolor=blue,pagecolor=blue,urlcolor=blue
|
||||
]{hyperref}
|
||||
\newcommand{\myhyperref}[2]{\hyperref[#1]{#2}}
|
||||
\fi
|
||||
|
||||
\newcommand{\mtlfig}[2]{\centerline{\includegraphics*[#2]{#1.pdf}}}
|
||||
|
||||
\newcommand{\Path}{\rightsquigarrow}
|
||||
\newcommand{\ancestor}{\overset{T}{\rightsquigarrow}}
|
||||
\newcommand{\descendant}{\ancestor^{-1}}
|
||||
\newcommand{\backedge}{\overset{B}{\rightarrow}}
|
||||
\newcommand{\edge}{\rightarrow}
|
||||
\DeclareMathOperator{\suchthat}{s.t.}
|
||||
|
||||
\newcommand{\code}[1]{{\small{\em \textbf{#1}}}}
|
||||
\newcommand{\concept}[1]{\textsf{#1}}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\title{An Implementation of Biconnected Components}
|
||||
\author{Jeremy Siek}
|
||||
|
||||
\maketitle
|
||||
|
||||
\section{Introduction}
|
||||
|
||||
This paper documents the implementation of the
|
||||
\code{biconnected\_components()} function of the Boost Graph
|
||||
Library. The function was implemented by Jeremy Siek.
|
||||
|
||||
The algorithm used to implement the \code{biconnected\_components()}
|
||||
function is the one based on depth-first search described
|
||||
by Tarjan~\cite{tarjan72:dfs_and_linear_algo}.
|
||||
|
||||
An undirected graph $G = (V,E)$ is \emph{biconnected} if for each
|
||||
triple of distinct vertices $v, w, a \in V$ there is a path $p : v
|
||||
\Path w$ such that $a$ is not on the path $p$. An \emph{articulation
|
||||
point} of $G = (V,E)$ is a vertex $a \in V$ where there are two other
|
||||
distinct vertices $v,w \in V$ such that $a$ is on any path $p:v \Path
|
||||
w$ and there is at least one such path. If $a$ were to be removed from
|
||||
$G$, then $v$ and $w$ would no longer be reachable from each other.
|
||||
So articulation points act as bridges between biconnected components;
|
||||
the only path from one biconnected component to another is through an
|
||||
articulation point.
|
||||
|
||||
The algorithm finds articulation points based on information provided
|
||||
by depth-first search. During a DFS, we label each vertex $v \in G$
|
||||
with its discover time, denoted $d[v]$. During the DFS we also
|
||||
compute the $lowpt(v)$, which is the smallest (in terms of discover
|
||||
time) vertex reachable from $v$ by traversing zero or more DFS-tree
|
||||
edges followed by at most one back edge. Tree edges and back edges can
|
||||
be identified based on discover time because for tree edge $(u,v)$ we
|
||||
have $d[u] < d[v]$ and for back edge $(u,v)$ we have $d[u] >
|
||||
d[v]$. The $lowpt(v)$ is computed for $v$ by taking the minimum
|
||||
$lowpt$ of the vertices to which $v$ is adjacent. The $lowpt(v)$ is
|
||||
computed after the recursive DFS call so the $lowpt$ has already been
|
||||
computed for the adjacent vertices by the time $lowpt(v)$ is computed.
|
||||
|
||||
Now it turns out that $lowpt$ can be used to identify articulation
|
||||
points. Suppose $a,v,w$ are distinct vertices in $G$ such that $(a,v)$
|
||||
is a tree edge and $w$ is not a descendant of $v$. If $d[lowpt(v)]
|
||||
\geq d[a]$, then $a$ is an articulation point and removal of $a$
|
||||
disconnects $v$ and $w$. The reason this works is that if $d[lowpt(v)]
|
||||
\geq d[a]$, then we know all paths starting from $v$ stay within the
|
||||
sub-tree $T_v$ rooted at $v$. If a path were to escape from the
|
||||
sub-tree, then consider the first vertex $w$ in that path outside of
|
||||
$T_v$. $v \Path w$ must be considered for $lowpt(v)$, so $d[lowpt(v)]
|
||||
< d[w]$. Now $d[w] < d[a]$ due the structure of the DFS, so
|
||||
transitively $d[lowpt(v)] < d[a]$.
|
||||
|
||||
\section{The Implementation}
|
||||
|
||||
The implementation consists of a recursive DFS-like function named
|
||||
\code{biconnect()} and the public interface function
|
||||
\code{biconnected\-\_components()}. The \code{Graph} type must be a
|
||||
model of \concept{VertexListGraph} and of \concept{IncidenceGraph}.
|
||||
The result of the algorithm is recorded in the \code{ComponentMap},
|
||||
which maps edges to the biconnected component that they belong to
|
||||
(components are labeled with integers from zero on up). The
|
||||
\code{ComponentMap} type must be a model of
|
||||
\concept{WritablePropertyMap}, which the graph's
|
||||
\code{edge\-\_descriptor} type as the key type and an unsigned integer
|
||||
type as the value type. We do not record which component each vertex
|
||||
belongs to because vertices that are articulation points belong to
|
||||
multiple biconnected components. The number of biconnected components
|
||||
is returned in the \code{num\_components} parameter. The
|
||||
\code{discover\_time} parameter is used internally to keep track of
|
||||
the DFS discover time for each vertex. It must be a
|
||||
\concept{ReadWritePropertyMap} with the graph's
|
||||
\code{vertex\_\-descriptor} type as the key type and an unsigned
|
||||
integer as the value type. The \code{lowpt} parameter is used
|
||||
internally to keep track of the $d[lowpt(v)]$ for each vertex $v$. It
|
||||
must be a \concept{ReadWritePropertyMap} with the graph's
|
||||
\code{vertex\_\-descriptor} type is the key type and the value type is
|
||||
the same unsigned integer type as the value type in the
|
||||
\code{discover\-\_time} map.
|
||||
|
||||
@d Biconnected Components Algorithm
|
||||
@{
|
||||
namespace detail {
|
||||
@<Recursive Biconnect Function@>
|
||||
}
|
||||
|
||||
template <typename Graph, typename ComponentMap,
|
||||
typename DiscoverTimeMap, typename LowPointMap>
|
||||
void biconnected_components
|
||||
(typename graph_traits<Graph>::vertex_descriptor v,
|
||||
typename graph_traits<Graph>::vertex_descriptor u,
|
||||
const Graph& g,
|
||||
ComponentMap comp,
|
||||
std::size_t& num_components,
|
||||
DiscoverTimeMap discover_time,
|
||||
LowPointMap lowpt)
|
||||
{
|
||||
typedef graph_traits<Graph>::vertex_descriptor vertex_t;
|
||||
typedef graph_traits<Graph>::edge_descriptor edge_t;
|
||||
@<Concept checking of type parameters@>
|
||||
typedef typename property_traits<DiscoverTimeMap>::value_type D;
|
||||
num_components = 0;
|
||||
std::size_t dfs_time = 0;
|
||||
std::stack<edge_t> S;
|
||||
@<Initialize discover times to infinity@>
|
||||
@<Process each connected component@>
|
||||
}
|
||||
@}
|
||||
|
||||
\noindent In the following code we use the Boost Concept Checking
|
||||
Library to provide better error messages in the event that the user
|
||||
makes a mistake in the kind of parameter used in the function
|
||||
template.
|
||||
|
||||
@d Concept checking of type parameters
|
||||
@{
|
||||
function_requires< VertexListGraphConcept<Graph> >();
|
||||
function_requires< IncidenceGraphConcept<Graph> >();
|
||||
function_requires< WritablePropertyMapConcept<ComponentMap, edge_t> >();
|
||||
function_requires< ReadWritePropertyMapConcept<DiscoverTimeMap, vertex_t> >();
|
||||
function_requires< ReadWritePropertyMapConcept<LowPointMap, vertex_t> >();
|
||||
@}
|
||||
|
||||
The first step of the algorithm is to initialize the discover times of
|
||||
all the vertices to infinity. This marks the vertices as undiscovered.
|
||||
|
||||
@d Initialize discover times to infinity
|
||||
@{
|
||||
typename graph_traits<Graph>::vertex_iterator wi, wi_end;
|
||||
std::size_t infinity = std::numeric_limits<std::size_t>::max();
|
||||
for (tie(wi, wi_end) = vertices(g); wi != wi_end; ++wi)
|
||||
put(discover_time, *wi, infinity);
|
||||
@}
|
||||
|
||||
\noindent Next we invoke \code{biconnect()} on every vertex in the
|
||||
graph, making sure that all connected components within the graph are
|
||||
searched (\code{biconnect()} only processes a single connected
|
||||
component).
|
||||
|
||||
@d Process each connected component
|
||||
@{
|
||||
for (tie(wi, wi_end) = vertices(g); wi != wi_end; ++wi)
|
||||
if (get(discover_time, *wi) == std::numeric_limits<D>::max())
|
||||
detail::biconnect(*wi, *wi, true,
|
||||
g, comp, num_components,
|
||||
discover_time, dfs_time, lowpt, S);
|
||||
@}
|
||||
|
||||
The recursive \code{biconnect()} function is shown below. The
|
||||
\code{v} parameter is where the DFS is started. The \code{u}
|
||||
parameter is the parent of \code{v} in the DFS-tree if \code{at\_top
|
||||
== false} or if \code{at\_top == true} the \code{u} is not used.
|
||||
\code{S} is a stack of edges that is used to collect all edges in a
|
||||
biconnected component. The way this works is that on ``the way down''
|
||||
edges are pushed into the stack. ``On the way back up'', when an
|
||||
articulation point $v$ is found (identified because $d[lowpt(w)] \geq
|
||||
d[v]$) we know that a contiguous portion of the stack (starting at the
|
||||
top) contains the edges in the sub-tree $T_v$ which is the biconnected
|
||||
component. We therefore pop these edges off of the stack (until we
|
||||
find an edge $e$ where $d[lowpt(source(e))] < d[w]$) and mark them as
|
||||
belonging to the same component. The code below also includes the
|
||||
bookkeeping details such as recording the discover times and computing
|
||||
$lowpt$. When a back edge $(v,w)$ is encountered, we do not use
|
||||
$lowpt(w)$ in calculating $lowpt(v)$ since $lowpt(w)$ has not yet been
|
||||
computed. Also, we ignore the edge $(v,w)$ if $w$ is the parent of $v$
|
||||
in the DFS-tree, meaning that $(w,v)$ has already been examined and
|
||||
categorized as a tree edge (not a back edge).
|
||||
|
||||
@d Recursive Biconnect Function
|
||||
@{
|
||||
template <typename Graph, typename ComponentMap,
|
||||
typename DiscoverTimeMap, typename LowPointMap, typename Stack>
|
||||
void biconnect(typename graph_traits<Graph>::vertex_descriptor v,
|
||||
typename graph_traits<Graph>::vertex_descriptor u,
|
||||
bool at_top,
|
||||
const Graph& g,
|
||||
ComponentMap comp,
|
||||
std::size_t& c,
|
||||
DiscoverTimeMap d,
|
||||
std::size_t& dfs_time,
|
||||
LowPointMap lowpt,
|
||||
Stack& S)
|
||||
{
|
||||
typedef typename graph_traits<Graph>::vertex_descriptor vertex_t;
|
||||
typedef typename property_traits<DiscoverTimeMap>::value_type D;
|
||||
D infinity = std::numeric_limits<D>::max();
|
||||
put(d, v, ++dfs_time);
|
||||
put(lowpt, v, get(d, v));
|
||||
typename graph_traits<Graph>::out_edge_iterator ei, ei_end;
|
||||
for (tie(ei, ei_end) = out_edges(v, g); ei != ei_end; ++ei) {
|
||||
vertex_t w = target(*ei, g);
|
||||
if (get(d, w) == infinity) {
|
||||
S.push(*ei);
|
||||
biconnect(w, v, false, g, comp, c, d, dfs_time, lowpt, S);
|
||||
put(lowpt, v, std::min(get(lowpt, v), get(lowpt, w)));
|
||||
if (get(lowpt, w) >= get(d, v)) {
|
||||
@<Record the biconnected component@>
|
||||
}
|
||||
} else if (get(d, w) < get(d, v) && (!at_top && w != u)) {
|
||||
S.push(*ei);
|
||||
put(lowpt, v, std::min(get(lowpt, v), get(d, w)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@}
|
||||
|
||||
\noindent The following is the code for popping the edges of sub-tree
|
||||
$T_v$ off of the stack and recording them as being in the same
|
||||
biconnected component.
|
||||
|
||||
@d Record the biconnected component
|
||||
@{
|
||||
while (d[source(S.top(), g)] >= d[w]) {
|
||||
put(comp, S.top(), c);
|
||||
S.pop();
|
||||
}
|
||||
put(comp, S.top(), c);
|
||||
S.pop();
|
||||
++c;
|
||||
@}
|
||||
|
||||
|
||||
\section{Appendix}
|
||||
|
||||
@o biconnected-components.hpp
|
||||
@{
|
||||
// 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.
|
||||
|
||||
// NOTE: this final is generated by libs/graph/doc/biconnected_components.w
|
||||
|
||||
#ifndef BOOST_GRAPH_BICONNECTED_COMPONENTS_HPP
|
||||
#define BOOST_GRAPH_BICONNECTED_COMPONENTS_HPP
|
||||
|
||||
#include <stack>
|
||||
#include <boost/limits.hpp>
|
||||
#include <boost/graph/graph_traits.hpp>
|
||||
#include <boost/graph/graph_concepts.hpp>
|
||||
#include <boost/property_map/property_map.hpp>
|
||||
|
||||
namespace boost {
|
||||
@<Biconnected Components Algorithm@>
|
||||
} // namespace boost
|
||||
|
||||
#endif BOOST_GRAPH_BICONNECTED_COMPONENTS_HPP
|
||||
@}
|
||||
|
||||
Figure~\ref{fig:bcc} shows the graph used in the following example and
|
||||
the edges are labeled by biconnected component number, as computed by
|
||||
the algorithm.
|
||||
|
||||
|
||||
\begin{figure}[htbp]
|
||||
\mtlfig{bcc}{width=3.0in}
|
||||
\caption{The biconnected components.}
|
||||
\label{fig:bcc}
|
||||
\end{figure}
|
||||
|
||||
|
||||
@o biconnected-components.cpp
|
||||
@{
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <boost/graph/biconnected_components.hpp>
|
||||
#include <boost/graph/adjacency_list.hpp>
|
||||
|
||||
namespace boost {
|
||||
struct edge_component_t {
|
||||
enum { num = 555 };
|
||||
typedef edge_property_tag kind;
|
||||
} edge_component;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace boost;
|
||||
typedef adjacency_list<vecS, vecS, undirectedS,
|
||||
no_property, property<edge_component_t, std::size_t> > graph_t;
|
||||
typedef graph_traits<graph_t>::vertex_descriptor vertex_t;
|
||||
graph_t g(9);
|
||||
add_edge(0, 5, g); add_edge(0, 1, g); add_edge(0, 6, g);
|
||||
add_edge(1, 2, g); add_edge(1, 3, g); add_edge(1, 4, g);
|
||||
add_edge(2, 3, g);
|
||||
add_edge(4, 5, g);
|
||||
add_edge(6, 8, g); add_edge(6, 7, g);
|
||||
add_edge(7, 8, g);
|
||||
|
||||
std::size_t c = 0;
|
||||
std::vector<std::size_t> discover_time(num_vertices(g));
|
||||
std::vector<vertex_t> lowpt(num_vertices(g));
|
||||
property_map<graph_t, edge_component_t>::type
|
||||
component = get(edge_component, g);
|
||||
biconnected_components(0, 8, g, component,
|
||||
c, &discover_time[0], &lowpt[0]);
|
||||
|
||||
std::cout << "graph A {\n"
|
||||
<< " node[shape=\"circle\"]\n";
|
||||
|
||||
graph_traits<graph_t>::edge_iterator ei, ei_end;
|
||||
for (tie(ei, ei_end) = edges(g); ei != ei_end; ++ei)
|
||||
std::cout << source(*ei, g) << " -- " << target(*ei, g)
|
||||
<< "[label=\"" << component[*ei] << "\"]\n";
|
||||
std::cout << "}\n";
|
||||
|
||||
return 0;
|
||||
}
|
||||
@}
|
||||
|
||||
|
||||
|
||||
% \paragraph{Definition.} A \emph{palm tree} $P$ is a directed graph that
|
||||
% consists of two disjoint sets of edges, denoted by $v \rightarrow w$
|
||||
% and $v \backedge w$ respectively, with the following properties:
|
||||
|
||||
% \begin{enumerate}
|
||||
|
||||
% \item The subgraph $T$ containing the edges $v \rightarrow w$ is a
|
||||
% spanning tree of $P$.
|
||||
|
||||
% \item $\backedge \; \subseteq \descendant$. That is, each edge of $P$
|
||||
% that is not in $T$ connects a vertex to one of its ancestors in $T$.
|
||||
% \end{enumerate}
|
||||
|
||||
|
||||
|
||||
\bibliographystyle{abbrv}
|
||||
\bibliography{jtran,ggcl,optimization,generic-programming,cad}
|
||||
|
||||
\end{document}
|
||||
|
||||
% LocalWords: Biconnected Siek biconnected Tarjan undirected DFS lowpt num dfs
|
||||
% LocalWords: biconnect VertexListGraph IncidenceGraph ComponentMap namespace
|
||||
% LocalWords: WritablePropertyMap ReadWritePropertyMap typename LowPointMap wi
|
||||
% LocalWords: DiscoverTimeMap const comp typedef VertexListGraphConcept max ei
|
||||
% LocalWords: IncidenceGraphConcept WritablePropertyMapConcept iterator bool
|
||||
% LocalWords: ReadWritePropertyMapConcept hpp ifndef endif bcc cpp struct enum
|
||||
% LocalWords: adjacency vecS undirectedS jtran ggcl
|
||||
@@ -0,0 +1,259 @@
|
||||
<HTML>
|
||||
<!-- Copyright 2007 Aaron Windsor
|
||||
|
||||
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: Boyer-Myrvold Planarity Testing/Embedding</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>Boyer-Myrvold Planarity Testing/Embedding</H1>
|
||||
|
||||
<p>
|
||||
A graph is <a href="./planar_graphs.html#planar"><i>planar</i></a> if it can
|
||||
be drawn in two-dimensional space without any of its edges crossing. Such a
|
||||
drawing of a planar graph is called a
|
||||
<a href="./planar_graphs.html#plane_drawing"><i>plane drawing</i></a>. Each
|
||||
plane drawing belongs to an equivalence class called a <i>planar embedding</i>
|
||||
<a href="#1">[1]</a> that is defined by the clockwise ordering of adjacent
|
||||
edges around each vertex in the graph. A planar embedding is a convenient
|
||||
intermediate representation of an actual drawing of a planar graph, and many
|
||||
planar graph drawing algorithms are formulated as functions mapping a planar
|
||||
embedding to a plane drawing.
|
||||
<br>
|
||||
<br>
|
||||
<table align="center" class="image">
|
||||
<caption align="bottom"><h5>A planar graph (top left), along with a planar
|
||||
embedding of that graph (bottom left) can be used to create a plane drawing
|
||||
(right) by embedding edges around each vertex in the order in which they
|
||||
appear in the planar embedding.
|
||||
</h5></caption>
|
||||
<tr><td>
|
||||
<img src="./figs/embedding_illustration.png">
|
||||
</td></tr>
|
||||
<tr></tr>
|
||||
<tr></tr>
|
||||
</table>
|
||||
<br>
|
||||
<p>
|
||||
The function <tt>boyer_myrvold_planarity_test</tt> implements the planarity
|
||||
testing/embedding algorithm of Boyer and Myrvold
|
||||
[<a href="./bibliography.html#boyermyrvold04">70</a>].
|
||||
<tt>boyer_myrvold_planarity_test</tt> returns <tt>true</tt> if the input graph
|
||||
is planar and <tt>false</tt> otherwise. As a side-effect of this test, a planar
|
||||
embedding can be constructed if the graph is planar or a minimal set of edges
|
||||
that form a <a href = "./planar_graphs.html#kuratowskisubgraphs">Kuratowski
|
||||
subgraph</a> can be found if the graph is not planar.
|
||||
<tt>boyer_myrvold_planarity_test</tt> uses named parameter arguments (courtesy
|
||||
of the <a href="../../parameter/doc/html/index.html">Boost.Parameter</a>
|
||||
library) to specify what the function actually does. Some examples are:
|
||||
|
||||
<ul>
|
||||
<li>Testing whether or not a graph is planar:
|
||||
<pre>
|
||||
bool is_planar = boyer_myrvold_planarity_test(g);
|
||||
</pre>
|
||||
|
||||
<li>Computing a planar embedding for a graph if it is planar, otherwise finding
|
||||
a set of edges that forms an obstructing Kuratowski subgraph:
|
||||
<pre>
|
||||
if (boyer_myrvold_planarity_test(boyer_myrvold_params::graph = g,
|
||||
boyer_myrvold_params::embedding = embedding_pmap,
|
||||
boyer_myrvold_params::kuratowski_subgraph = out_itr
|
||||
)
|
||||
)
|
||||
{
|
||||
//do something with the embedding in embedding_pmap
|
||||
}
|
||||
else
|
||||
{
|
||||
//do something with the kuratowski subgraph output to out_itr
|
||||
}
|
||||
</pre>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
The parameters passed to <tt>boyer_myrvold_planarity_test</tt> in the examples
|
||||
above do more than just carry the data structures used for input and output -
|
||||
the algorithm is optimized at compile time based on which parameters are
|
||||
present. A complete list of parameters accepted and their interactions are
|
||||
described below.
|
||||
<p>
|
||||
<tt>boyer_myrvold_planarity_test</tt> accepts as input any undirected graph,
|
||||
even those with self-loops and multiple edges.
|
||||
However, many planar graph drawing algorithms make additional restrictions
|
||||
on the structure of the input graph - for example, requiring that the input
|
||||
graph is connected, biconnected, or even maximal planar (triangulated.)
|
||||
Fortunately, any planar graph on <i>n</i> vertices that lacks one of these
|
||||
properties can be augmented with additional edges so that it satisfies that
|
||||
property in <i>O(n)</i> time - the functions
|
||||
<tt><a href="./make_connected.html">make_connected</a></tt>,
|
||||
<tt><a href="./make_biconnected_planar.html">make_biconnected_planar</a></tt>,
|
||||
and <tt><a href="./make_maximal_planar.html">make_maximal_planar</a></tt>
|
||||
exist for this purpose. If the graph drawing algorithm you're using requires,
|
||||
say, a biconnected graph, then you must make your input graph biconnected
|
||||
<i>before</i> passing it into <tt>boyer_myrvold_planarity_test</tt> so that the
|
||||
computed planar embedding includes these additional edges. This may require
|
||||
more than one call to <tt>boyer_myrvold_planarity_test</tt> depending on the
|
||||
structure of the graph you begin with, since both
|
||||
<tt>make_biconnected_planar</tt> and <tt>make_maximal_planar</tt> require a
|
||||
planar embedding of the existing graph as an input parameter.
|
||||
|
||||
<p><p>
|
||||
The named parameters accepted by <tt>boyer_myrvold_planarity_test</tt> are:
|
||||
|
||||
<ul>
|
||||
<li><b><tt>graph</tt></b> : The input graph - this is the only required
|
||||
parameter.
|
||||
<li><b><tt>vertex_index_map</tt></b> : A mapping from vertices of the input
|
||||
graph to indexes in the range <tt>[0..num_vertices(g))</tt>. If this parameter
|
||||
is not provided, the vertex index map is assumed to be available as an interior
|
||||
property of the graph, accessible by calling <tt>get(vertex_index, g)</tt>.
|
||||
<li><b><tt>edge_index_map</tt></b>: A mapping from the edges of the input graph
|
||||
to indexes in the range <tt>[0..num_edges(g))</tt>. This parameter is only
|
||||
needed if the <tt>kuratowski_subgraph</tt> argument is provided. If the
|
||||
<tt>kuratowski_subgraph</tt> argument is provided and this parameter is not
|
||||
provided, the EdgeIndexMap is assumed to be available as an interior property
|
||||
accessible by calling <tt>get(edge_index, g)</tt>.
|
||||
<li><b><tt>embedding</tt></b> : If the graph is planar, this will be populated
|
||||
with a mapping from vertices to the clockwise order of neighbors in the planar
|
||||
embedding.
|
||||
<li><b><tt>kuratowski_subgraph</tt></b> : If the graph is not planar, a minimal
|
||||
set of edges that form the obstructing Kuratowski subgraph will be written to
|
||||
this iterator.
|
||||
</ul>
|
||||
|
||||
These named parameters all belong to the namespace
|
||||
<tt>boyer_myrvold_params</tt>. See below for more information on the concepts
|
||||
required for these arguments.
|
||||
|
||||
<H3>Verifying the output</H3>
|
||||
|
||||
Whether or not the input graph is planar, <tt>boyer_myrvold_planarity_test</tt>
|
||||
can produce a certificate that can be automatically checked to verify that the
|
||||
function is working properly.
|
||||
<p>
|
||||
If the graph is planar, a planar embedding can be produced. The
|
||||
planar embedding can be verified by passing it to a plane drawing routine
|
||||
(such as <tt><a href="straight_line_drawing.html">
|
||||
chrobak_payne_straight_line_drawing</a></tt>) and using the function
|
||||
<tt><a href="is_straight_line_drawing.html">is_straight_line_drawing</a></tt>
|
||||
to verify that the resulting graph is planar.
|
||||
<p>
|
||||
If the graph is not planar, a set of edges that forms a Kuratowski subgraph in
|
||||
the original graph can be produced. This set of edges can be passed to the
|
||||
function <tt><a href="is_kuratowski_subgraph.html">is_kuratowski_subgraph</a>
|
||||
</tt> to verify that they can be contracted into a <i>K<sub>5</sub></i> or
|
||||
<i>K<sub>3,3</sub></i>. <tt>boyer_myrvold_planarity_test</tt> chooses the set
|
||||
of edges forming the Kuratowski subgraph in such a way that the contraction to
|
||||
a <i>K<sub>5</sub></i> or <i>K<sub>3,3</sub></i> can be done by a simple
|
||||
deterministic process which is described in the documentation to
|
||||
<tt>is_kuratowski_subgraph</tt>.
|
||||
|
||||
<H3>Where Defined</H3>
|
||||
|
||||
<P>
|
||||
<a href="../../../boost/graph/boyer_myrvold_planar_test.hpp">
|
||||
<TT>boost/graph/boyer_myrvold_planar_test.hpp</TT>
|
||||
</a>
|
||||
|
||||
<H3>Parameters</H3>
|
||||
|
||||
IN: <tt>Graph& g</tt>
|
||||
|
||||
<blockquote>
|
||||
Any undirected graph. The graph type must be a model of
|
||||
<a href="VertexAndEdgeListGraph.html">VertexAndEdgeListGraph</a> and
|
||||
<a href="IncidenceGraph.html">IncidenceGraph</a>.
|
||||
</blockquote>
|
||||
|
||||
OUT <tt>PlanarEmbedding embedding</tt>
|
||||
|
||||
<blockquote>
|
||||
Must model the <a href="PlanarEmbedding.html">PlanarEmbedding</a> concept.
|
||||
</blockquote>
|
||||
|
||||
IN <tt>OutputIterator kuratowski_subgraph</tt>
|
||||
|
||||
<blockquote>
|
||||
An OutputIterator which accepts values of the type
|
||||
<tt>graph_traits<Graph>::edge_descriptor</tt>
|
||||
</blockquote>
|
||||
|
||||
IN <tt>VertexIndexMap vm</tt>
|
||||
|
||||
<blockquote>
|
||||
A <a href="../../property_map/doc/ReadablePropertyMap.html">Readable Property Map
|
||||
</a> that maps vertices from <tt>g</tt> to distinct integers in the range
|
||||
<tt>[0, num_vertices(g) )</tt><br>
|
||||
<b>Default</b>: <tt>get(vertex_index,g)</tt><br>
|
||||
</blockquote>
|
||||
|
||||
IN <tt>EdgeIndexMap em</tt>
|
||||
|
||||
<blockquote>
|
||||
A <a href="../../property_map/doc/ReadablePropertyMap.html">Readable Property Map
|
||||
</a> that maps edges from <tt>g</tt> to distinct integers in the range
|
||||
<tt>[0, num_edges(g) )</tt><br>
|
||||
<b>Default</b>: <tt>get(edge_index,g)</tt>, but this parameter is only used if
|
||||
the <tt>kuratowski_subgraph_iterator</tt> is provided.<br>
|
||||
</blockquote>
|
||||
|
||||
<H3>Complexity</H3>
|
||||
|
||||
Assuming that both the vertex index and edge index supplied take time
|
||||
<i>O(1)</i> to return an index and there are <i>O(n)</i>
|
||||
total self-loops and parallel edges in the graph, most combinations of
|
||||
arguments given to
|
||||
<tt>boyer_myrvold_planarity_test</tt> result in an algorithm that runs in time
|
||||
<i>O(n)</i> for a graph with <i>n</i> vertices and <i>m</i> edges. The only
|
||||
exception is when Kuratowski subgraph isolation is requested for a dense graph
|
||||
(a graph with <i>n = o(m)</i>) - the running time will be <i>O(n+m)</i>
|
||||
<a href = "#2">[2]</a>.
|
||||
|
||||
<H3>Examples</H3>
|
||||
|
||||
<P>
|
||||
<ul>
|
||||
<li><a href="../example/simple_planarity_test.cpp">A simple planarity test</a>
|
||||
<li><a href="../example/kuratowski_subgraph.cpp">Isolating a Kuratowski
|
||||
Subgraph</a>
|
||||
<li><a href="../example/straight_line_drawing.cpp">Using a planar embedding to
|
||||
create a straight line drawing</a>
|
||||
</ul>
|
||||
|
||||
<h3>See Also</h3>
|
||||
|
||||
<a href="./planar_graphs.html">Planar Graphs in the Boost Graph Library</a>
|
||||
|
||||
|
||||
<h3>Notes</h3>
|
||||
|
||||
<p><a name="1">[1] A planar embedding is also called a <i>combinatorial
|
||||
embedding</i>.
|
||||
|
||||
<p><a name="2">[2] The algorithm can still be made to run in time <i>O(n)</i>
|
||||
for this case, if needed. <a href="planar_graphs.html#EulersFormula">Euler's
|
||||
formula</a> implies that a planar graph with <i>n</i> vertices can have no more
|
||||
than <i>3n - 6</i> edges, which means that any non-planar graph on <i>n</i>
|
||||
vertices has a subgraph of only <i>3n - 5</i> edges that contains a Kuratowski
|
||||
subgraph. So, if you need to find a Kuratowski subgraph of a graph with more
|
||||
than <i>3n - 5</i> edges in time <i>O(n)</i>, you can create a subgraph of the
|
||||
original graph consisting of any arbitrary <i>3n - 5</i> edges and pass that
|
||||
graph to <tt>boyer_myrvold_planarity_test</tt>.
|
||||
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
Copyright © 2007 Aaron Windsor (<a href="mailto:aaron.windsor@gmail.com">
|
||||
aaron.windsor@gmail.com</a>)
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,34 +1,39 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek 2000, 2001
|
||||
|
||||
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>
|
||||
template <class <a href="./VertexListGraph.html">VertexListGraph</a>, class P, class T, class R>
|
||||
void breadth_first_search(VertexListGraph& G,
|
||||
typename graph_traits<VertexListGraph>::vertex_descriptor s,
|
||||
const bgl_named_params<P, T, R>& params);
|
||||
<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,
|
||||
const bgl_named_params<P, T, R>& params);
|
||||
|
||||
<i>// non-named parameter version</i>
|
||||
template <class Graph, class Buffer, class BFSVisitor,
|
||||
class ColorMap>
|
||||
void breadth_first_search(const Graph& g,
|
||||
typename graph_traits<Graph>::vertex_descriptor s,
|
||||
Buffer& Q, BFSVisitor vis, ColorMap color);
|
||||
</PRE>
|
||||
|
||||
|
||||
@@ -145,15 +150,20 @@ event visitors.
|
||||
|
||||
<h3>Parameters</h3>
|
||||
|
||||
IN: <tt>VertexListGraph& g</tt>
|
||||
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>.
|
||||
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>
|
||||
|
||||
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>
|
||||
|
||||
|
||||
@@ -163,24 +173,40 @@ IN: <tt>visitor(BFSVisitor vis)</tt>
|
||||
<blockquote>
|
||||
A visitor object that is invoked inside the algorithm at the
|
||||
event-points specified by the <a href="BFSVisitor.html">BFS
|
||||
Visitor</a> concept.<br> <b>Default:</b>
|
||||
<tt>bfs_visitor<null_visitor></tt>
|
||||
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> <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>
|
||||
<blockquote>
|
||||
This is used by the algorithm to keep track of its progress through
|
||||
the graph. The type <tt>ColorMap</tt> must be a model of <a
|
||||
href="../../property_map/ReadWritePropertyMap.html">Read/Write
|
||||
the graph. The user need not initialize the color map before calling
|
||||
<tt>breadth_first_search()</tt> since the algorithm initializes the
|
||||
color of every vertex to white at the start of the algorihtm. If you
|
||||
need to perform multiple breadth-first searches on a graph (for
|
||||
example, if there are some disconnected components) then use the <a
|
||||
href="./breadth_first_visit.html"><tt>breadth_first_visit()</tt></a>
|
||||
function and do your own color initialization.
|
||||
|
||||
<p>The type <tt>ColorMap</tt> must be a model of <a
|
||||
href="../../property_map/doc/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 must model
|
||||
<a href="./ColorValue.html">ColorValue</a>.<br>
|
||||
<b>Default:</b> an <a
|
||||
href="../../property_map/iterator_property_map.html">
|
||||
href="../../property_map/doc/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.
|
||||
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>
|
||||
@@ -189,12 +215,18 @@ IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
num_vertices(g))</tt>. This parameter is only necessary when the
|
||||
default color property map is used. The type <tt>VertexIndexMap</tt>
|
||||
must be a model of <a
|
||||
href="../../property_map/ReadablePropertyMap.html">Readable Property
|
||||
href="../../property_map/doc/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>
|
||||
|
||||
UTIL: <tt>buffer(Buffer& Q)</tt>
|
||||
@@ -205,8 +237,13 @@ UTIL: <tt>buffer(Buffer& Q)</tt>
|
||||
can be used, but the traversal order will be different.
|
||||
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>
|
||||
<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.<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>
|
||||
|
||||
|
||||
@@ -265,24 +302,36 @@ Example</A>
|
||||
|
||||
<P>
|
||||
The example in <a
|
||||
href="../example/bfs_basics.cpp"><TT>examples/bfs_basics.cpp</TT></a>
|
||||
href="../example/bfs-example.cpp"><TT>example/bfs-example.cpp</TT></a>
|
||||
demonstrates using the BGL Breadth-first search algorithm on the graph
|
||||
from <A HREF="./graph_theory_review.html#fig:bfs-example">Figure
|
||||
5</A>.
|
||||
|
||||
5</A>. The file
|
||||
<a href="../example/bfs-example2.cpp"><TT>example/bfs-example2.cpp</TT></a>
|
||||
contains the same example, except that the <tt>adacency_list</tt>
|
||||
class used has <tt>VertexList</tt> and <tt>EdgeList</tt> set
|
||||
to <tt>listS</tt>.
|
||||
</P>
|
||||
|
||||
<h3>See Also</h3>
|
||||
|
||||
<a href="./bfs_visitor.html"><tt>bfs_visitor</tt></a> and
|
||||
<a href="./depth_first_search.html"><tt>depth_first_search()</tt></a>
|
||||
|
||||
<h3>Notes</h3>
|
||||
|
||||
<p><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 © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,25 +1,21 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek 2000, 2001
|
||||
|
||||
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>
|
||||
|
||||
@@ -29,6 +25,12 @@
|
||||
void breadth_first_visit(IncidenceGraph& G,
|
||||
typename graph_traits<IncidenceGraph>::vertex_descriptor s,
|
||||
const bgl_named_params<P, T, R>& params);
|
||||
|
||||
template <class <a href="./IncidenceGraph.html">IncidenceGraph</a>, class <a href="./Buffer.html">Buffer</a>, class <a href="./BFSVisitor.html">BFSVisitor</a>, class ColorMap>
|
||||
void breadth_first_visit
|
||||
(const IncidenceGraph& g,
|
||||
typename graph_traits<IncidenceGraph>::vertex_descriptor s,
|
||||
Buffer& Q, BFSVisitor vis, ColorMap color)
|
||||
</PRE>
|
||||
|
||||
This function is basically the same as <tt>breadth_first_search()</tt>
|
||||
@@ -54,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>
|
||||
|
||||
|
||||
@@ -69,19 +75,26 @@ IN: <tt>visitor(BFSVisitor vis)</tt>
|
||||
<blockquote>
|
||||
A visitor object that is invoked inside the algorithm at the
|
||||
event-points specified by the <a href="BFSVisitor.html">BFS
|
||||
Visitor</a> concept.<br> <b>Default:</b>
|
||||
<tt>bfs_visitor<null_visitor></tt>
|
||||
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><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>
|
||||
<blockquote>
|
||||
This is used by the algorithm to keep track of its progress through
|
||||
the graph. The type <tt>ColorMap</tt> must be a model of <a
|
||||
href="../../property_map/ReadWritePropertyMap.html">Read/Write
|
||||
href="../../property_map/doc/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 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>
|
||||
@@ -93,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>
|
||||
|
||||
|
||||
@@ -109,9 +125,6 @@ The time complexity is <i>O(E)</i>.
|
||||
<h3>Visitor Event Points</h3>
|
||||
|
||||
<ul>
|
||||
<li><b><tt>vis.initialize_vertex(v, g)</tt></b> is invoked on every vertex
|
||||
before the start of the search.
|
||||
|
||||
<li><b><tt>vis.examine_vertex(u, g)</tt></b>r is invoked in each
|
||||
vertex as it is removed from the queue.
|
||||
|
||||
@@ -152,13 +165,21 @@ The time complexity is <i>O(E)</i>.
|
||||
<a href="./bfs_visitor.html"><tt>bfs_visitor</tt></a>, and
|
||||
<a href="./depth_first_search.html"><tt>depth_first_search()</tt></a>
|
||||
|
||||
<h3>Notes</h3>
|
||||
|
||||
<p><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 © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -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/doc/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="http://www.boost.org/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>
|
||||
@@ -1,20 +1,16 @@
|
||||
<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.
|
||||
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>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>
|
||||
@@ -25,14 +21,18 @@
|
||||
|
||||
<ul>
|
||||
|
||||
<li>Dynamic graph algorithms such as described in <a
|
||||
href="http://citeseer.ist.psu.edu/eppstein99dynamic.html">Dynamic Graph
|
||||
Algorithms</a> and <a
|
||||
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
|
||||
review. The pending items are:</li>
|
||||
<ul>
|
||||
<li><tt>container_traits.hpp</tt> (this should also include
|
||||
the work Matt Austern is doing on this topic)</li>
|
||||
|
||||
<li><tt>property.hpp</tt></li>
|
||||
|
||||
<li>The queues and heaps: <tt>queue.hpp</tt>,
|
||||
<tt>mutable_queue.hpp</tt>, <tt>fibonacci_heap.hpp</tt>.
|
||||
Somehow merge implementation with Dietmer's heaps and queues.</li>
|
||||
@@ -40,8 +40,6 @@ review. The pending items are:</li>
|
||||
<li><tt>disjoint_sets</tt> </li>
|
||||
</ul>
|
||||
|
||||
<li>Port the graph library to Borland C++</li>
|
||||
|
||||
<li>Construct a set of planar graph algorithms.</li>
|
||||
<ul>
|
||||
<li> Is the graph planar?</li>
|
||||
@@ -60,9 +58,19 @@ 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
|
||||
href="http://www.geom.umn.edu/locate/qhull">Qhull</a> computes the
|
||||
convex hull, Delaunay triangulation, Voronoi diagram, and halfspace
|
||||
intersection about a point. Qhull runs in 2-d, 3-d, 4-d, and higher
|
||||
dimensions. Qhull is used for collision detection, animation, plate
|
||||
tectonics, 3-d modeling, robot motion planning, and other <a
|
||||
href="http://www.geom.umn.edu/~bradb/qhull-news.html#use">applications</a>.
|
||||
It is currently difficult to use from a C++ program.
|
||||
|
||||
</li>
|
||||
|
||||
<li>Rewrite the Qhull algorithm using the Boost Graph Library.</li>
|
||||
|
||||
<li>Explore the use of Algorithm Objects as an alternative to
|
||||
the current approach with visitors.</li>
|
||||
@@ -81,27 +89,31 @@ polygons.</li>
|
||||
<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>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -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="http://www.boost.org/people/people.htm">People</a></td><td align="center"><a href="http://www.boost.org/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/doc/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="http://www.boost.org/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>
|
||||
@@ -1,20 +1,16 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek 2000-2001
|
||||
|
||||
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,14 +18,18 @@
|
||||
|
||||
<H1>
|
||||
<A NAME="sec:connected-components">
|
||||
<img src="figs/python.gif" alt="(Python)"/>
|
||||
<TT>connected_components</TT></A>
|
||||
</H1>
|
||||
|
||||
<PRE>
|
||||
<i>// named parameter version</i>
|
||||
template <class VertexListGraph, class ComponentMap, class P, class T, class R>
|
||||
typename property_traits<ComponentMap>::value_type
|
||||
connected_components(VertexListGraph& G, ComponentMap comp,
|
||||
const bgl_named_params<P, T, R>& params = <i>all defaults</i>);
|
||||
|
||||
<i>// there is not a non-named parameter version of this function</i>
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
@@ -62,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>
|
||||
@@ -72,10 +74,13 @@ and assigning each component an integer label. The algorithm then
|
||||
records which component each vertex 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
|
||||
href="../../property_map/doc/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>
|
||||
@@ -84,16 +89,18 @@ UTIL: <tt>color_map(ColorMap color)</tt>
|
||||
<blockquote>
|
||||
This is used by the algorithm to keep track of its progress through
|
||||
the graph. The type <tt>ColorMap</tt> must be a model of <a
|
||||
href="../../property_map/ReadWritePropertyMap.html">Read/Write
|
||||
href="../../property_map/doc/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 must model
|
||||
<a href="./ColorValue.html">ColorValue</a>.<br>
|
||||
<b>Default:</b> an <a
|
||||
href="../../property_map/iterator_property_map.html">
|
||||
href="../../property_map/doc/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.
|
||||
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>
|
||||
@@ -102,12 +109,18 @@ IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
num_vertices(g))</tt>. This parameter is only necessary when the
|
||||
default color property map is used. The type <tt>VertexIndexMap</tt>
|
||||
must be a model of <a
|
||||
href="../../property_map/ReadablePropertyMap.html">Readable Property
|
||||
href="../../property_map/doc/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>
|
||||
|
||||
|
||||
@@ -136,8 +149,8 @@ undirected graph.
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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: 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>
|
||||
@@ -95,12 +91,12 @@ use the propery map interface. This gives the user of the
|
||||
algorithm the ability to decide how they want to store the properties.
|
||||
Since we will need to both read and write the colors we specify the
|
||||
requirements as <a
|
||||
href="../../property_map/ReadWritePropertyMap.html">ReadWritePropertyMap</a>. The
|
||||
href="../../property_map/doc/ReadWritePropertyMap.html">ReadWritePropertyMap</a>. The
|
||||
<TT>key_type</TT> of the color map must be the
|
||||
<TT>vertex_descriptor</TT> from the graph, and the <TT>value_type</TT>
|
||||
must be some kind of integer. We also specify the interface for the
|
||||
<TT>order</TT> parameter as a property map, in this case a <a
|
||||
href="../../property_map/ReadablePropertyMap.html">ReadablePropertyMap</a>. For
|
||||
href="../../property_map/doc/ReadablePropertyMap.html">ReadablePropertyMap</a>. For
|
||||
order, the <TT>key_type</TT> is an integer offset and the
|
||||
<TT>value_type</TT> is a <TT>vertex_descriptor</TT>. Again we enforce
|
||||
these requirements with concept checks. The return value of this
|
||||
@@ -173,14 +169,14 @@ namespace boost {
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
|
||||
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
|
||||
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<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. Jeremy Siek makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
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: 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>
|
||||
@@ -46,7 +42,7 @@ IN: <tt>const VertexListGraph& G</tt>
|
||||
A directed or undirected graph. The graph type must be a model of <a href="./VertexListGraph.html">Vertex List Graph</a>.
|
||||
</blockquote>
|
||||
|
||||
OUT: <tt>const MutableGraph& G_copy</tt>
|
||||
OUT: <tt>MutableGraph& G_copy</tt>
|
||||
<blockquote>
|
||||
The resulting copy of the graph. The graph type must be a model of <a
|
||||
href="./MutableGraph.html">Mutable Graph</a>.
|
||||
@@ -77,11 +73,15 @@ map from the graph.
|
||||
IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
<blockquote>
|
||||
The vertex index map type must be a model of <a
|
||||
href="../../property_map/ReadablePropertyMap.html">Readable Property
|
||||
href="../../property_map/doc/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>
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ UTIL/OUT: <tt>orig_to_copy(Orig2CopyMap c)</tt>
|
||||
This maps vertices in the original graph to vertices in the copy.
|
||||
|
||||
<b>Default:</b> an <a
|
||||
href="../../property_map/iterator_property_map.html">
|
||||
href="../../property_map/doc/iterator_property_map.html">
|
||||
</tt>iterator_property_map</tt></a> created from a
|
||||
<tt>std::vector</tt> of the output graph's vertex descriptor type of size
|
||||
<tt>num_vertices(g)</tt> and using the <tt>i_map</tt> for the index
|
||||
@@ -108,8 +108,8 @@ The time complexity is <i>O(V + E)</i>.
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,25 +1,24 @@
|
||||
<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.
|
||||
|
||||
<!-- 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>
|
||||
|
||||
<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 +33,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 +43,36 @@
|
||||
(1)
|
||||
template <class IncidenceGraph, class OutputIterator,
|
||||
class ColorMap, class DegreeMap>
|
||||
void
|
||||
cuthill_mckee_ordering(IncidenceGraph& g,
|
||||
typename graph_traits<Graph>::vertex_descriptor s,
|
||||
OutputIterator
|
||||
cuthill_mckee_ordering(const IncidenceGraph& g,
|
||||
typename graph_traits<IncidenceGraph>::vertex_descriptor s,
|
||||
OutputIterator inverse_permutation,
|
||||
ColorMap color, DegreeMap degree)
|
||||
|
||||
(2)
|
||||
template <class VertexListGraph, class OutputIterator>
|
||||
OutputIterator
|
||||
cuthill_mckee_ordering(const VertexListGraph& g, OutputIterator inverse_permutation);
|
||||
|
||||
template <class VertexListGraph, class OutputIterator, class VertexIndexMap>
|
||||
OutputIterator
|
||||
cuthill_mckee_ordering(const VertexListGraph& 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<IncidenceGraph>::vertex_descriptor > vertex_queue,
|
||||
OutputIterator inverse_permutation,
|
||||
ColorMap color, DegreeMap degree)
|
||||
</pre>
|
||||
|
||||
@@ -62,7 +80,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 +91,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,28 +105,31 @@ 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]] == old_index[u]
|
||||
inv_perm[new_index[u]] == u
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
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)
|
||||
perm[inv_perm[i]] = i;
|
||||
perm[old_index[inv_perm[i]]] = i;
|
||||
</pre>
|
||||
|
||||
|
||||
@@ -117,23 +142,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 +173,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> and <a href="./IncidenceGraph.html">IncidenceGraph</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
|
||||
@@ -174,8 +240,8 @@ and <tt>degree_property_map</tt> in <tt>boost/graph/properties.hpp</tt>.
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -0,0 +1,326 @@
|
||||
<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>
|
||||
<Title>Boost Graph Library: Directed Acyclic Graph 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:dag_shortest_paths"></A>
|
||||
<img src="figs/python.gif" alt="(Python)"/>
|
||||
<TT>dag_shortest_paths</TT>
|
||||
</H1>
|
||||
|
||||
|
||||
<P>
|
||||
<PRE>
|
||||
<i>// named paramter version</i>
|
||||
template <class VertexListGraph, class Param, class Tag, class Rest>
|
||||
void dag_shortest_paths(const VertexListGraph& g,
|
||||
typename graph_traits<VertexListGraph>::vertex_descriptor s,
|
||||
const bgl_named_params<Param,Tag,Rest>& params)
|
||||
|
||||
<i>// non-named parameter version</i>
|
||||
template <class VertexListGraph, class DijkstraVisitor,
|
||||
class DistanceMap, class WeightMap, class ColorMap,
|
||||
class PredecessorMap,
|
||||
class Compare, class Combine,
|
||||
class DistInf, class DistZero>
|
||||
void dag_shortest_paths(const VertexListGraph& g,
|
||||
typename graph_traits<VertexListGraph>::vertex_descriptor s,
|
||||
DistanceMap distance, WeightMap weight, ColorMap color,
|
||||
PredecessorMap pred, DijkstraVisitor vis,
|
||||
Compare compare, Combine combine, DistInf inf, DistZero zero)
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
This algorithm [<A HREF="bibliography.html#clr90">8</A>] solves
|
||||
the single-source shortest-paths problem on a weighted, directed
|
||||
acyclic graph (DAG). This algorithm is more efficient for DAG's
|
||||
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-paths-algorithms">Shortest-Paths
|
||||
Algorithms</A> for some background to the shortest-path problem.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
There are two main options for obtaining output from the
|
||||
<tt>dag_shortest_paths()</tt> function. If you provide a
|
||||
distance property map through the <tt>distance_map()</tt> parameter
|
||||
then the shortest distance from the source vertex to every other
|
||||
vertex in the graph will be recorded in the distance map. Also you can
|
||||
record the shortest paths tree in a predecessor map: for each vertex
|
||||
<i>u in V</i>, <i>p[u]</i> will be the predecessor of <i>u</i> in
|
||||
the shortest paths tree (unless <i>p[u] = u</i>, in which case <i>u</i> is
|
||||
either the source or a vertex unreachable from the source). In
|
||||
addition to these two options, the user can provide there own
|
||||
custom-made visitor that can takes actions during any of the
|
||||
algorithm's event points.</P>
|
||||
|
||||
<h3>Where Defined</h3>
|
||||
|
||||
<a href="../../../boost/graph/dag_shortest_paths.hpp"><tt>boost/graph/dag_shortest_paths.hpp</tt></a>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
|
||||
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}.<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.<br>
|
||||
|
||||
<b>Python</b>: The parameter is named <tt>root_vertex</tt>.
|
||||
</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 type <tt>WeightMap</tt> must be a model of
|
||||
<a href="../../property_map/doc/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 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><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
|
||||
<tt>VertexIndexMap</tt> must be a model of
|
||||
<a href="../../property_map/doc/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>
|
||||
|
||||
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 <i>(p[u],u)</i>
|
||||
for all <i>u in V</i> are in the minimum spanning tree. If <i>p[u] =
|
||||
u</i> then <i>u</i> is either the source vertex or a vertex that is
|
||||
not reachable from the source. The <tt>PredecessorMap</tt> type
|
||||
must be a <a
|
||||
href="../../property_map/doc/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><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>
|
||||
<blockquote>
|
||||
The shortest path weight from the source 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/doc/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</tt> formed with the <tt>combine</tt>
|
||||
function object and the <tt>zero</tt> object for the identity
|
||||
element. Also the distance value type must have a <a
|
||||
href="http://www.sgi.com/tech/stl/StrictWeakOrdering.html">
|
||||
StrictWeakOrdering</a> provided by the <tt>compare</tt> function
|
||||
object.<br>
|
||||
<b>Default:</b> <a
|
||||
href="../../property_map/doc/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 of size
|
||||
<tt>num_vertices(g)</tt> and using the <tt>i_map</tt> for the index
|
||||
map.<br>
|
||||
|
||||
<b>Python</b>: Must be a <tt>vertex_double_map</tt> for the graph.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_compare(CompareFunction cmp)</tt>
|
||||
<blockquote>
|
||||
This function is use to compare distances to determine which vertex
|
||||
is closer to the source vertex. The <tt>CompareFunction</tt> type
|
||||
must be a model of <a
|
||||
href="http://www.sgi.com/tech/stl/BinaryPredicate.html">Binary
|
||||
Predicate</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><br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_combine(CombineFunction cmb)</tt>
|
||||
<blockquote>
|
||||
This function is used to combine distances to compute the distance
|
||||
of a path. The <tt>CombineFunction</tt> type must be a model of <a
|
||||
href="http://www.sgi.com/tech/stl/BinaryFunction.html">Binary
|
||||
Function</a>. The first argument type of the binary function must
|
||||
match the value type of the <tt>DistanceMap</tt> property map and
|
||||
the second argument type must match the value type of the
|
||||
<tt>WeightMap</tt> property map. 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><br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</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><br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</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">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><br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>color_map(ColorMap c_map)</tt>
|
||||
<blockquote>
|
||||
This is used during the execution of the algorithm to mark the
|
||||
vertices. The vertices start out white and become gray when they are
|
||||
inserted in the queue. They then turn black when they are removed
|
||||
from the queue. 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/doc/ReadWritePropertyMap.html">Read/Write
|
||||
Property Map</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">Color Value</a>.<br>
|
||||
<b>Default:</b> an <a
|
||||
href="../../property_map/doc/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.<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>
|
||||
<blockquote>
|
||||
Use this to specify actions that you would like to happen
|
||||
during certain event points within the algorithm.
|
||||
The type <tt>DijkstraVisitor</tt> must be a model of the
|
||||
<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><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)</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.examine_vertex(u, g)</tt></b>
|
||||
is invoked on a vertex as it is added to set <i>S</i>.
|
||||
At this point we know that <i>(p[u],u)</i>
|
||||
is a shortest-paths tree edge so
|
||||
<i>d[u] = delta(s,u) = d[p[u]] + w(p[u],u)</i>. Also, the distances
|
||||
of the examined vertices is monotonically increasing
|
||||
<i>d[u<sub>1</sub>] <= d[u<sub>2</sub>] <= d[u<sub>n</sub>]</i>.
|
||||
<li><b><tt>vis.examine_edge(e, g)</tt></b>
|
||||
is invoked on each out-edge of a vertex immediately after it has
|
||||
been added to set <i>S</i>.
|
||||
<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>.
|
||||
The edge <i>(u,v)</i> that participated in the last
|
||||
relaxation for vertex <i>v</i> is an edge in the shortest paths tree.
|
||||
<li><b><tt>vis.discover_vertex(v, g)</tt></b>
|
||||
is invoked on vertex <i>v</i> when the edge
|
||||
<i>(u,v)</i> is examined and <i>v</i> is WHITE. Since
|
||||
a vertex is colored GRAY when it is discovered,
|
||||
each reacable vertex is discovered exactly once.
|
||||
<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.finish_vertex(u, g)</tt></b>
|
||||
is invoked on a vertex after all of its out edges have
|
||||
been examined.
|
||||
</ul>
|
||||
|
||||
<H3>Example</H3>
|
||||
|
||||
<P>
|
||||
See <a href="../example/dag_shortest_paths.cpp">
|
||||
<TT>example/dag_shortest_paths.cpp</TT></a> for an example of using this
|
||||
algorithm.
|
||||
|
||||
<H3>Notes</H3>
|
||||
|
||||
<p><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 © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -1,38 +1,44 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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: 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>
|
||||
|
||||
<P>
|
||||
<PRE>
|
||||
template <class <a href="./VertexListGraph.html">VertexListGraph</a>, class class P, class T, class R>
|
||||
void depth_first_search(VertexListGraph& G,
|
||||
<i>// named parameter version</i>
|
||||
template <class Graph, class class P, class T, class R>
|
||||
void depth_first_search(Graph& G,
|
||||
const bgl_named_params<P, T, R>& params);
|
||||
|
||||
<i>// non-named parameter version</i>
|
||||
template <class Graph, class <a href="DFSVisitor.html">DFSVisitor</a>, class ColorMap>
|
||||
void depth_first_search(const Graph& g, DFSVisitor vis, ColorMap color)
|
||||
|
||||
template <class Graph, class <a href="DFSVisitor.html">DFSVisitor</a>, class ColorMap>
|
||||
void depth_first_search(const Graph& g, DFSVisitor vis, ColorMap color,
|
||||
typename graph_traits<Graph>::vertex_descriptor start)
|
||||
|
||||
</PRE>
|
||||
|
||||
<p>
|
||||
The <tt>depth_first_search()</tt> function performs a depth-first
|
||||
traversal of the vertices in a directed or undirected graph. When
|
||||
traversal of the vertices in a directed graph. When
|
||||
possible, a depth-first traversal chooses a vertex adjacent to the
|
||||
current vertex to visit next. If all adjacent vertices have already
|
||||
been discovered, or there are no adjacent vertices, then the algorithm
|
||||
@@ -60,7 +66,7 @@ The <tt>depth_first_search()</tt> function invokes user-defined
|
||||
actions at certain event-points within the algorithm. This provides a
|
||||
mechanism for adapting the generic DFS algorithm to the many
|
||||
situations in which it can be used. In the pseudo-code below, the
|
||||
event points for DFS are indicated in by the triangles and labels on
|
||||
event points for DFS are the labels on
|
||||
the right. The user-defined actions must be provided in the form of a
|
||||
visitor object, that is, an object whose type meets the requirements
|
||||
for a <a href="./DFSVisitor.html">DFS Visitor</a>. In the pseudo-code
|
||||
@@ -83,12 +89,13 @@ DFS(<i>G</i>)
|
||||
<i>p[u] = u</i>
|
||||
<b>end for</b>
|
||||
<i>time := 0</i>
|
||||
<b>if</b> there is a starting vertex <i>s</i>
|
||||
<b>call</b> DFS-VISIT(<i>G</i>, <i>s</i>)
|
||||
<b>for</b> each vertex <i>u in V</i>
|
||||
<b>if</b> <i>color[u] =</i> WHITE
|
||||
<b>call</b> DFS-VISIT(<i>G</i>, <i>u</i>)
|
||||
<b>end for</b>
|
||||
return (<i>p</i>,<i>d_time</i>,<i>f_time</i>)
|
||||
|
||||
return (<i>p</i>,<i>d_time</i>,<i>f_time</i>) <br>
|
||||
DFS-VISIT(<i>G</i>, <i>u</i>)
|
||||
<i>color[u] :=</i> GRAY
|
||||
<i>d_time[u] := time := time + 1</i>
|
||||
@@ -107,31 +114,34 @@ DFS-VISIT(<i>G</i>, <i>u</i>)
|
||||
</td>
|
||||
<td valign="top">
|
||||
<pre>
|
||||
|
||||
-
|
||||
-
|
||||
initialize vertex <i>u</i>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
start vertex <i>u</i>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
discover vertex <i>u</i>
|
||||
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
start vertex <i>s</i>
|
||||
-
|
||||
-
|
||||
start vertex <i>u</i>
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
discover vertex <i>u</i>
|
||||
-
|
||||
examine edge <i>(u,v)</i>
|
||||
-
|
||||
<i>(u,v)</i> is a tree edge
|
||||
|
||||
|
||||
|
||||
<i>(u,v)</i> is a back edge
|
||||
|
||||
<i>(u,v)</i> is a cross or forward edge
|
||||
|
||||
-
|
||||
-
|
||||
<i>(u,v)</i> is a back edge
|
||||
-
|
||||
<i>(u,v)</i> is a cross or forward edge
|
||||
-
|
||||
finish vertex <i>u</i>
|
||||
-
|
||||
</pre>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -146,10 +156,13 @@ finish vertex <i>u</i>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
|
||||
IN: <tt>VertexListGraph& g</tt>
|
||||
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>.
|
||||
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>.<br>
|
||||
|
||||
<b>Python</b>: The parameter is named <tt>graph</tt>.
|
||||
</blockquote>
|
||||
|
||||
|
||||
@@ -159,24 +172,41 @@ 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.<br> <b>Default:</b>
|
||||
<tt>dfs_visitor<null_visitor></tt>
|
||||
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>
|
||||
|
||||
UTIL/OUT: <tt>color_map(ColorMap color)</tt>
|
||||
<blockquote>
|
||||
This is used by the algorithm to keep track of its progress through
|
||||
the graph. The type <tt>ColorMap</tt> must be a model of <a
|
||||
href="../../property_map/ReadWritePropertyMap.html">Read/Write
|
||||
href="../../property_map/doc/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 must model
|
||||
<a href="./ColorValue.html">ColorValue</a>.<br>
|
||||
<b>Default:</b> an <a
|
||||
href="../../property_map/iterator_property_map.html">
|
||||
href="../../property_map/doc/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.
|
||||
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
|
||||
graph_traits<VertexListGraph>::vertex_descriptor start)</tt>
|
||||
<blockquote>
|
||||
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><br>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
@@ -185,12 +215,18 @@ IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
num_vertices(g))</tt>. This parameter is only necessary when the
|
||||
default color property map is used. The type <tt>VertexIndexMap</tt>
|
||||
must be a model of <a
|
||||
href="../../property_map/ReadablePropertyMap.html">Readable Property
|
||||
href="../../property_map/doc/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>
|
||||
|
||||
<P>
|
||||
@@ -242,27 +278,36 @@ The time complexity is <i>O(E + V)</i>.
|
||||
<H3>Example</H3>
|
||||
|
||||
<P>
|
||||
The example in <a href="../example/dfs_basics.cpp">
|
||||
<TT>examples/dfs_basics.cpp</TT></a> shows DFS applied to the graph in
|
||||
The example in <a href="../example/dfs-example.cpp">
|
||||
<TT>examples/dfs-example.cpp</TT></a> shows DFS applied to the graph in
|
||||
<A HREF="./graph_theory_review.html#fig:dfs-example">Figure 1</A>.
|
||||
|
||||
<h3>See Also</h3>
|
||||
|
||||
<a href="./depth_first_visit.html"><tt>depth_first_visit</tt></a>
|
||||
<a href="./undirected_dfs.html"><tt>undirected_dfs</tt></a>
|
||||
|
||||
<h3>Notes</h3>
|
||||
|
||||
<p><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 © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
|
||||
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
|
||||
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,35 +1,38 @@
|
||||
<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.
|
||||
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: 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 ColorMap,
|
||||
class TerminatorFunc>
|
||||
void depth_first_visit(IncidenceGraph& g,
|
||||
typename graph_traits<IncidenceGraph>::vertex_descriptor s,
|
||||
DFSVisitor& vis, ColorMap color, TerminatorFunc func = TerminatorFunc())
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
@@ -48,6 +51,11 @@ 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 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.
|
||||
|
||||
|
||||
<P>
|
||||
|
||||
<h3>Where Defined:</h3>
|
||||
@@ -60,31 +68,53 @@ of which vertices have been visited.
|
||||
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>
|
||||
<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.
|
||||
Visitor</a> concept. The visitor object is passed by value <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>
|
||||
<blockquote>
|
||||
This is used by the algorithm to keep track of its progress through
|
||||
the graph. The type <tt>ColorMap</tt> must be a model of <a
|
||||
href="../../property_map/ReadWritePropertyMap.html">Read/Write
|
||||
href="../../property_map/doc/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>
|
||||
@@ -92,14 +122,22 @@ UTIL: <tt>ColorMap color</tt>
|
||||
Time complexity is <i>O(E)</i>.
|
||||
|
||||
|
||||
<h3>Notes</h3>
|
||||
|
||||
<p><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 © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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: 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>
|
||||
@@ -101,14 +97,14 @@ and <a href="./property_writer.html"><tt>property_writer</tt></a>.
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
|
||||
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
|
||||
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,36 +1,59 @@
|
||||
<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. Jeremy Siek makes no
|
||||
-- representations about the suitability of this software for any
|
||||
-- purpose. It is provided "as is" without express or implied warranty.
|
||||
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: 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>
|
||||
|
||||
|
||||
<P>
|
||||
<PRE>
|
||||
template <class <a href="./VertexListGraph.html">VertexListGraph</a>, class P, class T, class R>
|
||||
<i>// named parameter version</i>
|
||||
template <typename Graph, typename P, typename T, typename R>
|
||||
void
|
||||
dijkstra_shortest_paths(VertexListGraph& g,
|
||||
typename graph_traits<VertexListGraph>::vertex_descriptor s,
|
||||
dijkstra_shortest_paths(Graph& g,
|
||||
typename graph_traits<Graph>::vertex_descriptor s,
|
||||
const bgl_named_params<P, T, R>& params);
|
||||
|
||||
<i>// non-named parameter version</i>
|
||||
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 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, ColorMap color = <i>default</i>)
|
||||
|
||||
<i>// version that does not initialize the property maps (except for the default color map)</i>
|
||||
template <class Graph, class DijkstraVisitor,
|
||||
class PredecessorMap, class DistanceMap,
|
||||
class WeightMap, class IndexMap, class Compare, class Combine,
|
||||
class DistZero, class ColorMap>
|
||||
void
|
||||
dijkstra_shortest_paths_no_init
|
||||
(const Graph& g,
|
||||
typename graph_traits<Graph>::vertex_descriptor s,
|
||||
PredecessorMap predecessor, DistanceMap distance, WeightMap weight,
|
||||
IndexMap index_map,
|
||||
Compare compare, Combine combine, DistZero zero,
|
||||
DijkstraVisitor vis, ColorMap color = <i>default</i>);
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
@@ -42,7 +65,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>
|
||||
|
||||
@@ -56,8 +79,8 @@ record the shortest paths tree in a predecessor map: for each vertex
|
||||
<i>u in V</i>, <i>p[u]</i> will be the predecessor of <i>u</i> in
|
||||
the shortest paths tree (unless <i>p[u] = u</i>, in which case <i>u</i> is
|
||||
either the source or a vertex unreachable from the source). In
|
||||
addition to these two options, the user can provide there own
|
||||
custom-made visitor that can takes actions during any of the
|
||||
addition to these two options, the user can provide their own
|
||||
custom-made visitor that takes actions during any of the
|
||||
algorithm's event points.</P>
|
||||
|
||||
<P>
|
||||
@@ -82,7 +105,7 @@ track of which set each vertex is in. Vertices colored black are in
|
||||
<i>S</i>. Vertices colored white or gray are in <i>V-S</i>. White vertices have
|
||||
not yet been discovered and gray vertices are in the priority queue.
|
||||
By default, the algorithm will allocate an array to store a color
|
||||
marker for each vertex in the graph. You can provide you own storage
|
||||
marker for each vertex in the graph. You can provide your own storage
|
||||
and access for colors with the <tt>color_map()</tt> parameter.
|
||||
</P>
|
||||
<p>
|
||||
@@ -99,7 +122,7 @@ indicated by the labels on the right.
|
||||
<td valign="top">
|
||||
<pre>
|
||||
DIJKSTRA(<i>G</i>, <i>s</i>, <i>w</i>)
|
||||
<b>for</b> each vertex <i>u in V</i>
|
||||
<b>for</b> each vertex <i>u in V</i> <b>(This loop is not run in dijkstra_shortest_paths_no_init)</b>
|
||||
<i>d[u] := infinity</i>
|
||||
<i>p[u] := u</i>
|
||||
<i>color[u] :=</i> WHITE
|
||||
@@ -165,41 +188,62 @@ finish vertex <i>u</i>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
|
||||
IN: <tt>const VertexListGraph& g</tt>
|
||||
IN: <tt>const Graph& 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>Graph</tt> 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>
|
||||
|
||||
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>
|
||||
|
||||
IN: <tt>weight_map(WeightMap w_map)</tt>
|
||||
<blockquote>
|
||||
The weight or ``length'' of each edge in the graph.
|
||||
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
|
||||
<a href="../../property_map/doc/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 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>
|
||||
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><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
|
||||
<a href="../../property_map/doc/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>
|
||||
@@ -210,10 +254,12 @@ OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
|
||||
u</i> then <i>u</i> is either the source vertex or a vertex that is
|
||||
not reachable from the source. The <tt>PredecessorMap</tt> type
|
||||
must be a <a
|
||||
href="../../property_map/ReadWritePropertyMap.html">Read/Write
|
||||
Property Map</a> which key and vertex types the same as the vertex
|
||||
href="../../property_map/doc/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>
|
||||
@@ -222,19 +268,25 @@ UTIL/OUT: <tt>distance_map(DistanceMap d_map)</tt>
|
||||
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">Read/Write
|
||||
href="../../property_map/doc/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 must be <a
|
||||
href="http://www.sgi.com/tech/stl/LessThanComparable.html">Less Than
|
||||
Comparable</a>.<br>
|
||||
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> formed with the <tt>combine</tt>
|
||||
function object and the <tt>zero</tt> object for the identity
|
||||
element. Also the distance value type must have a <a
|
||||
href="http://www.sgi.com/tech/stl/StrictWeakOrdering.html">
|
||||
StrictWeakOrdering</a> provided by the <tt>compare</tt> function
|
||||
object.<br>
|
||||
<b>Default:</b> <a
|
||||
href="../../property_map/iterator_property_map.html">
|
||||
href="../../property_map/doc/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 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>
|
||||
@@ -248,7 +300,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>
|
||||
@@ -262,33 +316,32 @@ IN: <tt>distance_combine(CombineFunction cmb)</tt>
|
||||
<tt>WeightMap</tt> property map. 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>
|
||||
<b>Default:</b> <tt>closed_plus<D></tt> with
|
||||
<tt>D=typename property_traits<DistanceMap>::value_type</tt><br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_inf(InfinityGenerator inf)</tt>
|
||||
IN: <tt>distance_inf(D inf)</tt>
|
||||
<blockquote>
|
||||
This function is used to initialize the distance for each
|
||||
vertex before the start of the algorithm.
|
||||
The <tt>InfinityGenerator</tt>
|
||||
type must model the <a href="http://www.sgi.com/tech/stl/Generator.html">Generator</a> concept. The
|
||||
result type of the generator must be convertible to the
|
||||
value type of the <tt>DistanceMap</tt>. The
|
||||
default infinity generator uses <tt>std::numeric_limits::max()</tt>.<br>
|
||||
<b>Default:</b> <tt>detail::generate_infinity<D></tt>
|
||||
with <tt>D=typename property_traits<DistanceMap>::value_type</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><br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_zero(ZeroGenerator zero)</tt>
|
||||
IN: <tt>distance_zero(D zero)</tt>
|
||||
<blockquote>
|
||||
This function is used to initialize the distance for the source
|
||||
vertex before the start of the algorithm. The
|
||||
<tt>ZeroGenerator</tt> type must model the <a
|
||||
href="http://www.sgi.com/tech/stl/Generator.html">Generator</a>concept. The
|
||||
result type of the generator must be convertible to the value type
|
||||
of the <tt>DistanceMap</tt>.<br>
|
||||
<b>Default:</b> <tt>detail::generate_zero<D></tt>
|
||||
with <tt>D=typename property_traits<DistanceMap>::value_type</tt>
|
||||
The <tt>zero</tt> value must be the identity element for the
|
||||
<a href="./Monoid.html">Monoid</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><br>
|
||||
|
||||
<b>Python</b>: Unsupported parameter.
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>color_map(ColorMap c_map)</tt>
|
||||
@@ -299,32 +352,42 @@ UTIL/OUT: <tt>color_map(ColorMap c_map)</tt>
|
||||
from the queue. 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">Read/Write
|
||||
<a href="../../property_map/doc/ReadWritePropertyMap.html">Read/Write
|
||||
Property Map</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">Color Value</a>.<br>
|
||||
<b>Default:</b> an <a
|
||||
href="../../property_map/iterator_property_map.html">
|
||||
href="../../property_map/doc/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(Vis v)</tt>
|
||||
OUT: <tt>visitor(DijkstraVisitor v)</tt>
|
||||
<blockquote>
|
||||
Use this to specify actions that you would like to happen
|
||||
during certain event points within the algorithm.
|
||||
The type <tt>Vis</tt> must be a model of
|
||||
<a href="./DijkstraVisitor.html">Dijkstra Visitor</a>. <br>
|
||||
<b>Default:</b> <tt>dijkstra_visitor<null_visitor></tt>
|
||||
The type <tt>DijkstraVisitor</tt> must be a model of the
|
||||
<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><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>
|
||||
|
||||
@@ -362,10 +425,12 @@ if all vertices are reachable from the source.
|
||||
<H3>Example</H3>
|
||||
|
||||
<P>
|
||||
See <a href="../example/dijkstra.cpp">
|
||||
<TT>examples/dijkstra.cpp</TT></a> for an example of using Dijkstra's
|
||||
See <a href="../example/dijkstra-example.cpp">
|
||||
<TT>example/dijkstra-example.cpp</TT></a> for an example of using Dijkstra's
|
||||
algorithm.
|
||||
|
||||
<H3>See also</H3> <a href="dijkstra_shortest_paths_no_color_map.html">dijkstra_shortest_paths_no_color_map</a> for a version of dijkstra's shortest path that does not use a color map.
|
||||
|
||||
<H3>Notes</H3>
|
||||
|
||||
<a name="1">[1]</a>
|
||||
@@ -374,12 +439,19 @@ S</i> vertices in the priority queue at once, but instead only those
|
||||
vertices in <i>V - S</i> that are discovered and therefore have a
|
||||
distance less than infinity.
|
||||
|
||||
<p><a name="2">[2]</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 © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -0,0 +1,398 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Michael Hansen 2009
|
||||
|
||||
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 (No Color Map)</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:dijkstra"></A>
|
||||
<TT>dijkstra_shortest_paths_no_color_map</TT>
|
||||
</H1>
|
||||
|
||||
<P>
|
||||
<PRE>
|
||||
<i>// named parameter version</i>
|
||||
template <typename Graph, typename Param, typename Tag, typename Rest>
|
||||
void dijkstra_shortest_paths_no_color_map
|
||||
(const Graph& graph,
|
||||
typename graph_traits<Graph>::vertex_descriptor start_vertex,
|
||||
const bgl_named_params<Param,Tag,Rest>& params);
|
||||
|
||||
<i>// non-named parameter version</i>
|
||||
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">DistanceCompare</a>, typename <a href="http://www.sgi.com/tech/stl/BinaryFunction.html">DistanceWeightCombine</a>,
|
||||
typename DistanceInfinity, typename DistanceZero>
|
||||
void dijkstra_shortest_paths_no_color_map
|
||||
(const Graph& graph,
|
||||
typename graph_traits<Graph>::vertex_descriptor start_vertex,
|
||||
PredecessorMap predecessor_map, DistanceMap distance_map, WeightMap weight_map,
|
||||
VertexIndexMap index_map,
|
||||
DistanceCompare distance_compare, DistanceWeightCombine distance_weight_combine,
|
||||
DistanceInfinity distance_infinity, DistanceZero distance_zero);
|
||||
|
||||
<i>// version that does not initialize the property maps</i>
|
||||
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">DistanceCompare</a>, typename <a href="http://www.sgi.com/tech/stl/BinaryFunction.html">DistanceWeightCombine</a>,
|
||||
typename DistanceInfinity, typename DistanceZero>
|
||||
void dijkstra_shortest_paths_no_color_map_no_init
|
||||
(const Graph& graph,
|
||||
typename graph_traits<Graph>::vertex_descriptor start_vertex,
|
||||
PredecessorMap predecessor_map, DistanceMap distance_map, WeightMap weight_map,
|
||||
VertexIndexMap index_map,
|
||||
DistanceCompare distance_compare, DistanceWeightCombine distance_weight_combine,
|
||||
DistanceInfinity distance_infinity, DistanceZero distance_zero);
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
This algorithm [<A HREF="bibliography.html#dijkstra59">10</A>,<A
|
||||
HREF="bibliography.html#clr90">8</A>] solves the single-source
|
||||
shortest-paths problem on a weighted, directed or undirected graph for
|
||||
the case where all edge weights are nonnegative. Use the Bellman-Ford
|
||||
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-paths-algorithms">Shortest-Paths
|
||||
Algorithms</A> for some background to the shortest-path problem.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
<tt>dijkstra_shortest_paths_no_color_map</tt> differs from the original <tt>dijkstra_shortest_paths</tt> algorithm by not using a color map to identify vertices as discovered or undiscovered. Instead, this is done with the distance map: a vertex <i>u</i> such that <i>distance_compare(distance_map[u], distance_infinity) == false</i> is considered to be undiscovered.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
There are two main options for obtaining output from the
|
||||
<tt>dijkstra_shortest_paths_no_color_map()</tt> function. If you provide a
|
||||
distance property map through the <tt>distance_map()</tt> parameter
|
||||
then the shortest distance from the start vertex to every other
|
||||
vertex in the graph will be recorded in the distance map. Also you can
|
||||
record the shortest paths tree in a predecessor map: for each vertex
|
||||
<i>u in V</i>, <i>p[u]</i> will be the predecessor of <i>u</i> in
|
||||
the shortest paths tree (unless <i>p[u] = u</i>, in which case <i>u</i> is
|
||||
either the source or a vertex unreachable from the source). In
|
||||
addition to these two options, the user can provide their own
|
||||
custom-made visitor that takes actions during any of the
|
||||
algorithm's event points <a href="#4">[4]</a>.</P>
|
||||
|
||||
<P>
|
||||
Dijkstra's algorithm finds all the shortest paths from the source
|
||||
vertex to every other vertex by iteratively "growing" the set of
|
||||
vertices <i>S</i> to which it knows the shortest path. At each step of
|
||||
the algorithm, the next vertex added to <i>S</i> is determined by a
|
||||
priority queue. The queue contains the vertices in <i>V - S</i><a
|
||||
href="#1">[1]</a> prioritized by their distance label, which is the
|
||||
length of the shortest path seen so far for each vertex. The vertex
|
||||
<i>u</i> at the top of the priority queue is then added to <i>S</i>,
|
||||
and each of its out-edges is relaxed: if the distance to <i>u</i> plus
|
||||
the weight of the out-edge <i>(u,v)</i> is less than the distance
|
||||
label for <i>v</i> then the estimated distance for vertex <i>v</i> is
|
||||
reduced. The algorithm then loops back, processing the next vertex at
|
||||
the top of the priority queue. The algorithm finishes when the
|
||||
priority queue is empty.
|
||||
</P>
|
||||
<p>
|
||||
The following is the pseudo-code for Dijkstra's single-source shortest
|
||||
paths algorithm. <i>w</i> is the edge weight, <i>d</i> is the distance label,
|
||||
and <i>p</i> is the predecessor of each vertex which is used to encode
|
||||
the shortest paths tree. <i>Q</i> is a priority queue that supports the
|
||||
DECREASE-KEY operation. The visitor event points for the algorithm are
|
||||
indicated by the labels on the right.
|
||||
</p>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<pre>
|
||||
DIJKSTRA(<i>G</i>, <i>s</i>, <i>w</i>)
|
||||
<b>for</b> each vertex <i>u in V</i> <b>(This loop is not run in dijkstra_shortest_paths_no_color_map_no_init)</b>
|
||||
<i>d[u] := infinity</i>
|
||||
<i>p[u] := u</i>
|
||||
<b>end for</b>
|
||||
<i>d[s] := 0</i>
|
||||
INSERT(<i>Q</i>, <i>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>p[v] := u</i>
|
||||
DECREASE-KEY(<i>Q</i>, <i>v</i>)
|
||||
<b>else</b>
|
||||
...
|
||||
<b>if</b> (<i>d[v]</i> was originally infinity)
|
||||
INSERT(<i>Q</i>, <i>v</i>)
|
||||
<b>end for</b>
|
||||
<b>end while</b>
|
||||
return (<i>d</i>, <i>p</i>)
|
||||
</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
|
||||
|
||||
|
||||
|
||||
edge <i>(u,v)</i> not relaxed
|
||||
|
||||
discover vertex <i>v</i>
|
||||
finish vertex <i>u</i>
|
||||
</pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>Where Defined</h3>
|
||||
|
||||
<a href="../../../boost/graph/dijkstra_shortest_paths_no_color_map.hpp"><tt>boost/graph/dijkstra_shortest_paths_no_color_map.hpp</tt></a>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
|
||||
IN: <tt>const Graph& graph</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>.<br>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>vertex_descriptor start_vertex</tt>
|
||||
<blockquote>
|
||||
The source vertex. All distance will be calculated from this vertex,
|
||||
and the shortest paths tree will be rooted at this vertex.<br>
|
||||
</blockquote>
|
||||
|
||||
<h3>Named Parameters</h3>
|
||||
|
||||
IN: <tt>weight_map(WeightMap weight_map)</tt>
|
||||
<blockquote>
|
||||
The weight or ``length'' of each edge in the graph. The weights
|
||||
must all be non-negative and non-infinite <a href="#3">[3]</a>. 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/doc/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> <tt>get(edge_weight, graph)</tt><br>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>index_map(VertexIndexMap index_map)</tt>
|
||||
<blockquote>
|
||||
This maps each vertex to an integer in the range <tt>[0,
|
||||
num_vertices(graph))</tt>. This is necessary for efficient updates of the
|
||||
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/doc/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, graph)</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>
|
||||
</blockquote>
|
||||
|
||||
OUT: <tt>predecessor_map(PredecessorMap predecessor_map)</tt>
|
||||
<blockquote>
|
||||
The predecessor map records the edges in the minimum spanning
|
||||
tree. Upon completion of the algorithm, the edges <i>(p[u],u)</i>
|
||||
for all <i>u in V</i> are in the minimum spanning tree. If <i>p[u] =
|
||||
u</i> then <i>u</i> is either the source vertex or a vertex that is
|
||||
not reachable from the source. The <tt>PredecessorMap</tt> type
|
||||
must be a <a
|
||||
href="../../property_map/doc/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><br>
|
||||
|
||||
<b>Python</b>: Must be a <tt>vertex_vertex_map</tt> for the graph.<br>
|
||||
</blockquote>
|
||||
|
||||
UTIL/OUT: <tt>distance_map(DistanceMap distance_map)</tt>
|
||||
<blockquote>
|
||||
The shortest path weight from the source vertex <tt>start_vertex</tt> to each
|
||||
vertex in the graph <tt>graph</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/doc/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> formed with the <tt>distance_weight_combine</tt>
|
||||
function object and the <tt>distance_zero</tt> object for the identity
|
||||
element. Also the distance value type must have a <a
|
||||
href="http://www.sgi.com/tech/stl/StrictWeakOrdering.html">
|
||||
StrictWeakOrdering</a> provided by the <tt>distance_compare</tt> function
|
||||
object.<br>
|
||||
<b>Default:</b> <a
|
||||
href="../../property_map/doc/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 of size
|
||||
<tt>num_vertices(graph)</tt> and using the <tt>index_map</tt> for the index
|
||||
map.<br>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_compare(CompareFunction distance_compare)</tt>
|
||||
<blockquote>
|
||||
This function is use to compare distances to determine which vertex
|
||||
is closer to the source vertex. The <tt>DistanceCompareFunction</tt> type
|
||||
must be a model of <a
|
||||
href="http://www.sgi.com/tech/stl/BinaryPredicate.html">Binary
|
||||
Predicate</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><br>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_combine(CombineFunction distance_weight_combine)</tt>
|
||||
<blockquote>
|
||||
This function is used to combine distances to compute the distance
|
||||
of a path. The <tt>DistanceWeightCombineFunction</tt> type must be a model of <a
|
||||
href="http://www.sgi.com/tech/stl/BinaryFunction.html">Binary
|
||||
Function</a>. The first argument type of the binary function must
|
||||
match the value type of the <tt>DistanceMap</tt> property map and
|
||||
the second argument type must match the value type of the
|
||||
<tt>WeightMap</tt> property map. The result type must be the same
|
||||
type as the distance value type.<br>
|
||||
|
||||
<b>Default:</b> <tt>boost::closed_plus<D></tt> with
|
||||
<tt>D=typename property_traits<DistanceMap>::value_type</tt><br>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_inf(D distance_infinity)</tt>
|
||||
<blockquote>
|
||||
The <tt>distance_infinity</tt> object must be the greatest value of any <tt>D</tt> object.
|
||||
That is, <tt>distance_compare(d, distance_infinity) == true</tt> for any <tt>d != distance_infinity</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><br>
|
||||
</blockquote>
|
||||
|
||||
IN: <tt>distance_zero(D distance_zero)</tt>
|
||||
<blockquote>
|
||||
The <tt>distance_zero</tt> value must be the identity element for the
|
||||
<a href="./Monoid.html">Monoid</a> formed by the distance values
|
||||
and the <tt>distance_weight_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><br>
|
||||
</blockquote>
|
||||
|
||||
OUT: <tt>visitor(DijkstraVisitor v)</tt>
|
||||
<blockquote>
|
||||
Use this to specify actions that you would like to happen
|
||||
during certain event points within the algorithm.
|
||||
The type <tt>DijkstraVisitor</tt> must be a model of the
|
||||
<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><br>
|
||||
</blockquote>
|
||||
|
||||
|
||||
<H3>Complexity</H3>
|
||||
|
||||
<P>
|
||||
The time complexity is <i>O(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.examine_vertex(u, g)</tt></b>
|
||||
is invoked on a vertex as it is removed from the priority queue
|
||||
and added to set <i>S</i>. At this point we know that <i>(p[u],u)</i>
|
||||
is a shortest-paths tree edge so
|
||||
<i>d[u] = delta(s,u) = d[p[u]] + w(p[u],u)</i>. Also, the distances
|
||||
of the examined vertices is monotonically increasing
|
||||
<i>d[u<sub>1</sub>] <= d[u<sub>2</sub>] <= d[u<sub>n</sub>]</i>.
|
||||
<li><b><tt>vis.examine_edge(e, g)</tt></b>
|
||||
is invoked on each out-edge of a vertex immediately after it has
|
||||
been added to set <i>S</i>.
|
||||
<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>.
|
||||
The edge <i>(u,v)</i> that participated in the last
|
||||
relaxation for vertex <i>v</i> is an edge in the shortest paths tree.
|
||||
<li><b><tt>vis.discover_vertex(v, g)</tt></b>
|
||||
is invoked on vertex <i>v</i> when the edge
|
||||
<i>(u,v)</i> is examined and <i>v</i> has not yet been discovered (i.e. its distance was infinity before relaxation was attempted on the edge). This
|
||||
is also when the vertex is inserted into the priority queue.
|
||||
<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.finish_vertex(u, g)</tt></b>
|
||||
is invoked on a vertex after all of its out edges have
|
||||
been examined.
|
||||
</ul>
|
||||
|
||||
<H3>Example</H3>
|
||||
|
||||
<P>
|
||||
See <a href="../example/dijkstra-no-color-map-example.cpp">
|
||||
<TT>example/dijkstra-no-color-map-example.cpp</TT></a> for an example of using Dijkstra's algorithm.
|
||||
|
||||
<H3>See also</H3> <a href="dijkstra_shortest_paths.html">dijkstra_shortest_paths</a> for a version of dijkstra's shortest path that uses a color map.
|
||||
|
||||
<H3>Notes</H3>
|
||||
|
||||
<p>Based on the documentation for <a href="dijkstra_shortest_paths.html">dijkstra_shortest_paths</a>.
|
||||
|
||||
<p><a name="1">[1]</a>
|
||||
The algorithm used here saves a little space by not putting all <i>V -
|
||||
S</i> vertices in the priority queue at once, but instead only those
|
||||
vertices in <i>V - S</i> that are discovered and therefore have a
|
||||
distance less than infinity.
|
||||
|
||||
<p><a name="2">[2]</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.
|
||||
|
||||
<p><a name="3">[3]</a>
|
||||
The algorithm will not work correctly if any of the edge weights are equal to infinity since the infinite distance value is used to determine if a vertex has been discovered.
|
||||
|
||||
<p><a name="4">[4]</a>
|
||||
Calls to the visitor events occur in the same order as <tt>dijkstra_shortest_paths</tt> (i.e. <i>discover_vertex(u)</i> will always be called after <i>examine_vertex(u)</i> for an undiscovered vertex <i>u</i>). However, the vertices of the graph given to <i>dijkstra_shortest_paths_no_color_map</i> will <b>not</b> necessarily be visited in the same order as <i>dijkstra_shortest_paths</i>.
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2009</TD><TD>
|
||||
Trustees of Indiana University</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -0,0 +1,125 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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: dijkstra_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>
|
||||
dijkstra_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="./DijkstraVisitor.html">DijkstraVisitor</a>.
|
||||
|
||||
|
||||
<h3>Example</h3>
|
||||
|
||||
This is an excerpt from <a
|
||||
href="../example/dave.cpp"><tt>examples/dave.cpp</tt></a>
|
||||
where the <tt>copy_graph</tt> single-event visitor
|
||||
is used to create a copy the shortest-paths search-tree calculated
|
||||
by Dijkstra's algorithm.
|
||||
|
||||
<pre>
|
||||
boost::dijkstra_shortest_paths
|
||||
(G, vertex(a, G),
|
||||
distance_map(make_iterator_property_map(distance.begin(), vertex_id, distance[0])).
|
||||
predecessor_map(make_iterator_property_map(parent.begin(), vertex_id, parent[0])).
|
||||
visitor(make_dijkstra_visitor(copy_graph(G_copy, on_examine_edge()))));
|
||||
</pre>
|
||||
|
||||
|
||||
<h3>Model of</h3>
|
||||
|
||||
<a href="./DijkstraVisitor.html">Dijkstra Visitor</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/dijkstra_shortest_paths.hpp">
|
||||
<TT>boost/graph/dijkstra_shortest_paths.hpp</TT></a>
|
||||
|
||||
<h3>Member Functions</h3>
|
||||
|
||||
This class implements all of the member functions required by <a
|
||||
href="./DijkstraVisitor.html">DijkstraVisitor</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>
|
||||
dijkstra_visitor<EventVisitorList><br>
|
||||
make_dijkstra_visitor(EventVisitorList ev_list);
|
||||
</tt></td><td>
|
||||
Returns the event visitor list adapted to be a Dijkstra 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 © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -1,20 +1,16 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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: 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>
|
||||
@@ -68,7 +64,7 @@ See the example for <a href="./bfs_visitor.html"><tt>bfs_visitor</tt></a>.
|
||||
<TR><TD><TT>DistanceMap</TT></TD>
|
||||
<TD>
|
||||
A <a
|
||||
href="../../property_map/WritablePropertyMap.html">WritablePropertyMap</a>,
|
||||
href="../../property_map/doc/WritablePropertyMap.html">WritablePropertyMap</a>,
|
||||
where the key type and the value type are the vertex descriptor type
|
||||
of the graph.
|
||||
</TD>
|
||||
@@ -166,14 +162,14 @@ and <a href="./property_writer.html"><tt>property_writer</tt></a>.
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
|
||||
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
|
||||
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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: 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>
|
||||
@@ -211,14 +207,14 @@ Returns the target vertex of edge <TT>e</TT>.
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
|
||||
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
|
||||
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
|
||||
Univ.of Notre Dame (<A
|
||||
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>,
|
||||
Indiana University (<A
|
||||
HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
|
||||
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@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>
|
||||
|
||||
</BODY>
|
||||
|
||||
@@ -1,40 +1,47 @@
|
||||
<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.
|
||||
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: Edmunds-Karp Maximum Flow</Title>
|
||||
<Title>Boost Graph Library: Edmonds-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>
|
||||
|
||||
<H1><A NAME="sec:edmunds_karp_max_flow">
|
||||
<TT>edmunds_karp_max_flow</TT>
|
||||
<H1><A NAME="sec:edmonds_karp_max_flow">
|
||||
<TT>edmonds_karp_max_flow</TT>
|
||||
</H1>
|
||||
|
||||
<PRE>
|
||||
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,
|
||||
const bgl_named_params<P, T, R>& params = <i>all defaults</i>)
|
||||
<i>// named paramter version</i>
|
||||
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
|
||||
edmonds_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="./Graph.html">Graph</a>,
|
||||
class CapacityEdgeMap, class ResidualCapacityEdgeMap,
|
||||
class ReverseEdgeMap, class ColorMap, class PredEdgeMap>
|
||||
typename property_traits<CapacityEdgeMap>::value_type
|
||||
edmonds_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,
|
||||
ColorMap color, PredEdgeMap pred)
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
The <tt>edmunds_karp_max_flow()</tt> function calculates the maximum flow
|
||||
The <tt>edmonds_karp_max_flow()</tt> function calculates the maximum flow
|
||||
of a network. See Section <a
|
||||
href="./graph_theory_review.html#sec:network-flow-algorithms">Network
|
||||
Flow Algorithms</a> for a description of maximum flow. The calculated
|
||||
@@ -64,10 +71,12 @@ algorithm'' described in <a
|
||||
href="./bibliography.html#ahuja93:_network_flows">Network Flows</a>.
|
||||
|
||||
<p>
|
||||
This algorithm provides a very simple an easy to implement solution to
|
||||
This algorithm provides a very simple and easy to implement solution to
|
||||
the maximum flow problem. However, there are several reasons why this
|
||||
algorithm is not as good as the <a
|
||||
href="./push_relabel_max_flow.html"><tt>push_relabel_max_flow()</tt></a>
|
||||
or the <a
|
||||
href="./kolmogorov_max_flow.html"><tt>kolmogorov_max_flow()</tt></a>
|
||||
algorithm.
|
||||
|
||||
<ul>
|
||||
@@ -84,17 +93,17 @@ algorithm.
|
||||
<H3>Where Defined</H3>
|
||||
|
||||
<P>
|
||||
<a href="../../../boost/graph/edmunds_karp_max_flow.hpp"><TT>boost/graph/edmunds_karp_max_flow.hpp</TT></a>
|
||||
<a href="../../../boost/graph/edmonds_karp_max_flow.hpp"><TT>boost/graph/edmonds_karp_max_flow.hpp</TT></a>
|
||||
|
||||
<P>
|
||||
|
||||
<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>
|
||||
@@ -116,7 +125,7 @@ IN: <tt>capacity_map(CapacityEdgeMap cap)</tt>
|
||||
<blockquote>
|
||||
The edge capacity property map. The type must be a model of a
|
||||
constant <a
|
||||
href="../../property_map/LvaluePropertyMap.html">Lvalue Property Map</a>. The
|
||||
href="../../property_map/doc/LvaluePropertyMap.html">Lvalue Property Map</a>. The
|
||||
key type of the map must be the graph's edge descriptor type.<br>
|
||||
<b>Default:</b> <tt>get(edge_capacity, g)</tt>
|
||||
</blockquote>
|
||||
@@ -125,7 +134,7 @@ OUT: <tt>residual_capacity_map(ResidualCapacityEdgeMap res)</tt>
|
||||
<blockquote>
|
||||
This maps edges to their residual capacity. The type must be a model
|
||||
of a mutable <a
|
||||
href="../../property_map/LvaluePropertyMap.html">Lvalue Property
|
||||
href="../../property_map/doc/LvaluePropertyMap.html">Lvalue Property
|
||||
Map</a>. The key type of the map must be the graph's edge descriptor
|
||||
type.<br>
|
||||
<b>Default:</b> <tt>get(edge_residual_capacity, g)</tt>
|
||||
@@ -135,7 +144,7 @@ IN: <tt>reverse_edge_map(ReverseEdgeMap rev)</tt>
|
||||
<blockquote>
|
||||
An edge property map that maps every edge <i>(u,v)</i> in the graph
|
||||
to the reverse edge <i>(v,u)</i>. The map must be a model of
|
||||
constant <a href="../../property_map/LvaluePropertyMap.html">Lvalue
|
||||
constant <a href="../../property_map/doc/LvaluePropertyMap.html">Lvalue
|
||||
Property Map</a>. The key type of the map must be the graph's edge
|
||||
descriptor type.<br>
|
||||
<b>Default:</b> <tt>get(edge_reverse, g)</tt>
|
||||
@@ -147,13 +156,13 @@ UTIL: <tt>color_map(ColorMap color)</tt>
|
||||
breadth-first search stage. At the end of the algorithm, the white
|
||||
vertices define the minimum cut set. The map must be a model of
|
||||
mutable <a
|
||||
href="../../property_map/LvaluePropertyMap.html">Lvalue Property Map</a>.
|
||||
href="../../property_map/doc/LvaluePropertyMap.html">Lvalue Property Map</a>.
|
||||
The key type of the map should be the graph's vertex descriptor type, and
|
||||
the value type must be a model of <a
|
||||
href="./ColorValue.html">ColorValue</a>.<br>
|
||||
|
||||
<b>Default:</b> an <a
|
||||
href="../../property_map/iterator_property_map.html">
|
||||
href="../../property_map/doc/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.
|
||||
@@ -163,12 +172,12 @@ UTIL: <tt>predecessor_map(PredEdgeMap pred)</tt>
|
||||
<blockquote>
|
||||
Use by the algorithm to store augmenting paths. The map must be a
|
||||
model of mutable <a
|
||||
href="../../property_map/LvaluePropertyMap.html">Lvalue Property Map</a>.
|
||||
href="../../property_map/doc/LvaluePropertyMap.html">Lvalue Property Map</a>.
|
||||
The key type must be the graph's vertex descriptor type and the
|
||||
value type must be the graph's edge descriptor type.<br>
|
||||
|
||||
<b>Default:</b> an <a
|
||||
href="../../property_map/iterator_property_map.html">
|
||||
href="../../property_map/doc/iterator_property_map.html">
|
||||
<tt>iterator_property_map</tt></a> created from a <tt>std::vector</tt>
|
||||
of edge descriptors of size <tt>num_vertices(g)</tt> and
|
||||
using the <tt>i_map</tt> for the index map.
|
||||
@@ -180,10 +189,14 @@ IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
|
||||
<tt>[0, num_vertices(g))</tt>. This property map is only needed
|
||||
if the default for the color or predecessor map is used.
|
||||
The vertex index map must be a model of <a
|
||||
href="../../property_map/ReadablePropertyMap.html">Readable Property
|
||||
href="../../property_map/doc/ReadablePropertyMap.html">Readable Property
|
||||
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>
|
||||
|
||||
|
||||
@@ -196,28 +209,29 @@ some constant <i>U</i>.
|
||||
<h3>Example</h3>
|
||||
|
||||
The program in <a
|
||||
href="../example/edmunds_karp_max_flow.cpp"><tt>example/edmunds_karp_max_flow.cpp</tt></a>
|
||||
href="../example/edmonds-karp-eg.cpp"><tt>example/edmonds-karp-eg.cpp</tt></a>
|
||||
reads an example maximum flow problem (a graph with edge capacities)
|
||||
from a file in the DIMACS format and computes the maximum flow.
|
||||
|
||||
|
||||
<h3>See Also</h3>
|
||||
|
||||
<a href="./push_relabel_max_flow.html"><tt>push_relabel_max_flow()</tt></a>.
|
||||
<a href="./push_relabel_max_flow.html"><tt>push_relabel_max_flow()</tt></a><br>
|
||||
<a href="./kolmogorov_max_flow.html"><tt>kolmogorov_max_flow()</tt></a>.
|
||||
|
||||
<br>
|
||||
<HR>
|
||||
<TABLE>
|
||||
<TR valign=top>
|
||||
<TD nowrap>Copyright © 2000</TD><TD>
|
||||
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
||||
<TD nowrap>Copyright © 2000-2001</TD><TD>
|
||||
<A HREF="http://www.boost.org/users/people/jeremy_siek.html">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
<!-- LocalWords: HTML Siek Edmunds BGCOLOR ffffff ee VLINK ALINK ff IMG SRC
|
||||
<!-- LocalWords: HTML Siek Edmonds BGCOLOR ffffff ee VLINK ALINK ff IMG SRC
|
||||
-->
|
||||
<!-- LocalWords: gif ALT BR sec edmunds karp TT DIV CELLPADDING TR TD PRE lt
|
||||
<!-- LocalWords: gif ALT BR sec edmonds karp TT DIV CELLPADDING TR TD PRE lt
|
||||
-->
|
||||
<!-- LocalWords: typename VertexListGraph CapacityEdgeMap ReverseEdgeMap gt
|
||||
-->
|
||||
@@ -0,0 +1,106 @@
|
||||
// Boost.Graph library isomorphism test
|
||||
|
||||
// Copyright (C) 2001 Douglas Gregor (gregod@cs.rpi.edu)
|
||||
//
|
||||
// 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
|
||||
//
|
||||
// Revision History:
|
||||
//
|
||||
// 29 Nov 2001 Jeremy Siek
|
||||
// Changed to use Boost.Random.
|
||||
// 29 Nov 2001 Doug Gregor
|
||||
// Initial checkin.
|
||||
|
||||
#define BOOST_INCLUDE_MAIN
|
||||
#include <boost/test/test_tools.hpp>
|
||||
#include <boost/graph/adjacency_list.hpp>
|
||||
#include <boost/graph/isomorphism.hpp>
|
||||
//#include "isomorphism-v3.hpp"
|
||||
#include <boost/property_map/property_map.hpp>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <map>
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <ctime>
|
||||
|
||||
using namespace boost;
|
||||
|
||||
|
||||
enum { a, b, c, d, e, f, g, h };
|
||||
enum { _1, _2, _3, _4, _5, _6, _7, _8 };
|
||||
|
||||
void test_isomorphism()
|
||||
{
|
||||
typedef adjacency_list<vecS, vecS, bidirectionalS> GraphA;
|
||||
typedef adjacency_list<vecS, vecS, bidirectionalS> GraphB;
|
||||
|
||||
char a_names[] = "abcdefgh";
|
||||
char b_names[] = "12345678";
|
||||
|
||||
GraphA Ga(8);
|
||||
add_edge(a, d, Ga);
|
||||
add_edge(a, h, Ga);
|
||||
add_edge(b, c, Ga);
|
||||
add_edge(b, e, Ga);
|
||||
add_edge(c, f, Ga);
|
||||
add_edge(d, a, Ga);
|
||||
add_edge(d, h, Ga);
|
||||
add_edge(e, b, Ga);
|
||||
add_edge(f, b, Ga);
|
||||
add_edge(f, e, Ga);
|
||||
add_edge(g, d, Ga);
|
||||
add_edge(g, f, Ga);
|
||||
add_edge(h, c, Ga);
|
||||
add_edge(h, g, Ga);
|
||||
|
||||
GraphB Gb(8);
|
||||
add_edge(_1, _6, Gb);
|
||||
add_edge(_2, _1, Gb);
|
||||
add_edge(_2, _5, Gb);
|
||||
add_edge(_3, _2, Gb);
|
||||
add_edge(_3, _4, Gb);
|
||||
add_edge(_4, _2, Gb);
|
||||
add_edge(_4, _3, Gb);
|
||||
add_edge(_5, _4, Gb);
|
||||
add_edge(_5, _6, Gb);
|
||||
add_edge(_6, _7, Gb);
|
||||
add_edge(_6, _8, Gb);
|
||||
add_edge(_7, _8, Gb);
|
||||
add_edge(_8, _1, Gb);
|
||||
add_edge(_8, _7, Gb);
|
||||
|
||||
|
||||
std::vector<std::size_t> in_degree_A(num_vertices(Ga));
|
||||
boost::detail::compute_in_degree(Ga, &in_degree_A[0]);
|
||||
|
||||
std::vector<std::size_t> in_degree_B(num_vertices(Gb));
|
||||
boost::detail::compute_in_degree(Gb, &in_degree_B[0]);
|
||||
|
||||
degree_vertex_invariant<std::size_t*, GraphA>
|
||||
invariantA(&in_degree_A[0], Ga);
|
||||
degree_vertex_invariant<std::size_t*, GraphB>
|
||||
invariantB(&in_degree_B[0], Gb);
|
||||
|
||||
std::vector<graph_traits<GraphB>::vertex_descriptor> f(num_vertices(Ga));
|
||||
|
||||
bool ret = isomorphism(Ga, Gb, &f[0], invariantA, invariantB,
|
||||
(invariantB.max)(),
|
||||
get(vertex_index, Ga), get(vertex_index, Gb));
|
||||
assert(ret == true);
|
||||
|
||||
for (std::size_t i = 0; i < num_vertices(Ga); ++i)
|
||||
std::cout << "f(" << a_names[i] << ")=" << b_names[f[i]] << std::endl;
|
||||
|
||||
BOOST_TEST(verify_isomorphism(Ga, Gb, &f[0]));
|
||||
}
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
test_isomorphism();
|
||||
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="http://www.boost.org/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>
|
||||
@@ -0,0 +1,46 @@
|
||||
<HTML>
|
||||
<!--
|
||||
Copyright (c) Jeremy Siek 2002
|
||||
|
||||
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="../../../boost.png"
|
||||
ALT="C++ Boost" width="277" height="86">
|
||||
|
||||
<BR Clear>
|
||||
|
||||
<h1><a href="../../../boost/graph/exception.hpp"><tt>boost/graph/exception.hpp</tt></a></h1>
|
||||
|
||||
<P>
|
||||
The BGL defines several exception classes for reporting errors from
|
||||
BGL algorithms. Many of the BGL algorithms place certain requirements
|
||||
on the input graph. If these requirements are not met then the
|
||||
algorithm can not successfully complete, and instead throws the
|
||||
appropriate exception.
|
||||
</P>
|
||||
|
||||
<h3>Synopsis</h3>
|
||||
|
||||
<pre>
|
||||
struct <a name="bad_graph">bad_graph</a> : public invalid_argument {
|
||||
bad_graph(const string& what_arg);
|
||||
};
|
||||
struct <a name="not_a_dag">not_a_dag</a> : public bad_graph {
|
||||
not_a_dag();
|
||||
};
|
||||
struct <a name="negative_edge">negative_edge</a> : public bad_graph {
|
||||
negative_edge();
|
||||
};
|
||||
struct <a name="negative_cycle">negative_cycle</a> : public bad_graph {
|
||||
negative_cycle();
|
||||
};
|
||||
struct <a name="not_connected">not_connected</a> : public bad_graph {
|
||||
not_connected();
|
||||
};
|
||||
</pre>
|
||||
@@ -1,29 +1,97 @@
|
||||
<HTML>
|
||||
<!--
|
||||
-- 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.
|
||||
Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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: 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>
|
||||
|
||||
<h1>Frequently Asked Questions</h1>
|
||||
|
||||
|
||||
<ol>
|
||||
|
||||
<li>
|
||||
How do I perform an early exit from an algorithm such as BFS?<br>
|
||||
|
||||
<p>
|
||||
Create a visitor that throws an exception when you want to cut off the
|
||||
search, then put your call to <tt>breadth_first_search</tt> inside of
|
||||
an appropriate try/catch block. This strikes many programmers as a
|
||||
misuse of exceptions, however, much thought was put into the decision
|
||||
to have exceptions has the preferred way to exit early. See boost
|
||||
email discussions for more details.
|
||||
</p>
|
||||
|
||||
<li>
|
||||
Why is the visitor parameter passed by value rather than reference
|
||||
in the various BGL algorithms?<br>
|
||||
|
||||
<p>
|
||||
One of the usage scenarios that we wanted to support with the
|
||||
algorithms was creating visitor objects on the fly, within the
|
||||
argument list of the call to the graph algorithm. In this situation,
|
||||
the visitor object is a temporary object. Now there is a truly
|
||||
unfortunate rule in the C++ standard that says a temporary cannot be
|
||||
bound to a non-const reference parameter. So we had to decide whether
|
||||
we wanted to support this kind of usage and call-by-value, or not and
|
||||
call-by-reference. We chose call-by-value, following in the footsteps
|
||||
of the STL (which passes functors by value). The disadvantage of this
|
||||
decision is that if your visitor contains state and changes that state
|
||||
during the algorithm, the change 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.
|
||||
</p>
|
||||
|
||||
<li>Why does the BGL interface use friend functions (or free functions)
|
||||
instead of member functions?<br>
|
||||
<p>
|
||||
For the most part, the differences between member functions and free
|
||||
functions are syntactic, and not very important, though people can get
|
||||
religious about them. However, we had one technical reason for
|
||||
favoring free functions. A programmer can overload a free function for
|
||||
a type coming from a 3rd party without modifying the source
|
||||
code/definition of that type. There are several uses of this in the
|
||||
BGL. For example, Stanford GraphBase and LEDA graphs can both be used
|
||||
in BGL algorithms because of overloads in <tt>stanford_graph.hpp</tt>
|
||||
and <tt>leda_graph.hpp</tt>. One can even use
|
||||
<tt>std::vector<std::list></tt> as a graph due to the overloads
|
||||
in <tt>vector_as_graph.hpp</tt>.
|
||||
</p>
|
||||
<p>
|
||||
Of course, there is a way to adapt 3rd party classes into an interface
|
||||
with member functions. You create an adaptor class. However, the
|
||||
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 free
|
||||
functions.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Our religious reason for choosing free functions is to send the message
|
||||
that BGL is a generic library, and not a traditional object-oriented
|
||||
library. OO was hip in the 80s and 90s, but its time we moved beyond!
|
||||
</p>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li>How do I create a graph where the edges are sorted/ordered? <br>
|
||||
<p>The example <a href="../example/ordered_out_edges.cpp">
|
||||
<tt>ordered_out_edges.cpp</tt></a> shows how to do this.</p>
|
||||
</li>
|
||||
|
||||
<li>Why does the algorithm X work with <tt>adjacency_list</tt> where
|
||||
<tt>VertexList=vecS</tt> but not when <tt>VertexList=listS</tt>? <br><br>
|
||||
Often the reason is that the algorithm expects to find the
|
||||
@@ -76,3 +144,9 @@ argument to the algorithm.</li>
|
||||
|
||||
|
||||
</ol>
|
||||
<!-- LocalWords: gif ALT BGL std const STL GraphBase LEDA BFS stanford hpp OO
|
||||
-->
|
||||
<!-- LocalWords: leda cpp VertexList vecS listS undirectedS num cnt struct
|
||||
-->
|
||||
<!-- LocalWords: enum
|
||||
-->
|
||||
|
||||
@@ -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: 613 B |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
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: 19 KiB |
|
After Width: | Height: | Size: 786 B |
@@ -10,9 +10,6 @@ Single
|
||||
2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
|
||||
1 1 1.00 60.00 120.00
|
||||
6975 3150 7500 3000
|
||||
2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
|
||||
1 1 1.00 60.00 120.00
|
||||
6525 3825 7650 3075
|
||||
2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
|
||||
1 1 1.00 60.00 120.00
|
||||
6975 2175 7575 2775
|
||||
@@ -22,23 +19,23 @@ Single
|
||||
2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
|
||||
1 1 1.00 60.00 120.00
|
||||
6975 2625 7575 2850
|
||||
2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
|
||||
1 1 1.00 60.00 120.00
|
||||
4350 2625 4800 2625
|
||||
2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
|
||||
1 1 1.00 60.00 120.00
|
||||
4350 2550 5175 2100
|
||||
2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
|
||||
1 1 1.00 60.00 120.00
|
||||
2250 3075 2850 2700
|
||||
2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
|
||||
1 1 1.00 60.00 120.00
|
||||
3900 3225 4875 3225
|
||||
4 0 0 100 0 19 18 0.0000 4 255 2070 4350 3900 AdacencyMatrix\001
|
||||
2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
|
||||
1 1 1.00 60.00 120.00
|
||||
6525 4350 7650 3150
|
||||
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
|
||||
1 1 1.00 60.00 120.00
|
||||
3900 3225 4575 3825
|
||||
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
|
||||
1 1 1.00 60.00 120.00
|
||||
6525 3900 7575 3075
|
||||
4 0 0 100 0 19 18 0.0000 4 255 2040 5175 2100 IncidenceGraph\001
|
||||
4 0 0 100 0 19 18 0.0000 4 255 2430 900 2100 BidirectionalGraph\001
|
||||
4 0 0 100 0 19 18 0.0000 4 255 1935 4950 3300 EdgeListGraph\001
|
||||
4 0 0 100 0 19 18 0.0000 4 255 795 7575 3000 Graph\001
|
||||
4 0 0 100 0 19 18 0.0000 4 255 2145 4800 2700 AdjacencyGraph\001
|
||||
4 0 0 100 0 19 18 0.0000 4 255 2100 2175 2700 VertexListGraph\001
|
||||
4 0 0 100 0 19 18 0.0000 4 255 3285 600 3300 VertexAndEdgeListGraph\001
|
||||
4 0 0 100 0 19 18 0.0000 4 255 1935 4575 3975 EdgeListGraph\001
|
||||
4 0 0 100 0 19 18 0.0000 4 255 2100 4800 3300 VertexListGraph\001
|
||||
4 0 0 100 0 19 18 0.0000 4 255 2145 4350 4500 AdjacencyMatrix\001
|
||||
|
||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 11 KiB |