Compare commits

...

1279 Commits

Author SHA1 Message Date
Jeremy W. Murphy 7474f49dde Bump requirement to current version 2026-07-02 09:56:24 +09:00
Jeremy W. Murphy 75fc41afd9 Change indentation for easier review 2026-07-02 09:44:25 +09:00
Jeremy W. Murphy dbbc4ea619 Merge branch 'develop' into CMake 2026-06-25 19:38:05 +09:00
Arnaud Becheler 170eeb7157 Merge pull request #517 from Becheler/docs/event-visitor-reference-pages
fix: restructure visitors pages to match old html style
2026-06-24 15:48:45 +02:00
Arnaud Becheler 3898362db3 doc: reorder pre-built visitor nav and group algo-specific ones 2026-06-24 14:05:24 +02:00
Arnaud Becheler 108c02bbe3 fix: restructure null visitor page to match old html style 2026-06-24 13:54:36 +02:00
Arnaud Becheler 3109027d88 fix: restructure property put page to match old html style 2026-06-24 13:50:12 +02:00
Arnaud Becheler c9ff9d496a fix: restructure property writer page to match old html style 2026-06-24 13:47:37 +02:00
Arnaud Becheler da9891445f fix: restructure time stamper page to match old html style 2026-06-24 13:44:33 +02:00
Arnaud Becheler b1c09b7c98 fix: restructure distance recorder page to match old html style 2026-06-24 13:40:53 +02:00
Arnaud Becheler 42dedb70dc fix: restructure edge predecessor recorder page to match old html style 2026-06-24 13:16:25 +02:00
Arnaud Becheler 8306d6917c fix: restructure predecessor recorder page to match old html style 2026-06-24 12:31:55 +02:00
Arnaud Becheler a77dec6feb Merge pull request #514 from Becheler/fix/sign-compare-warnings
clears gcc -Wsign-compare
2026-06-23 10:29:02 +02:00
Arnaud Becheler 1349344269 Merge pull request #513 from Becheler/fix/deprecated-random-shuffle
Replace the deprecated `std::random_shuffle` with `std::shuffle`
2026-06-23 10:28:18 +02:00
Arnaud Becheler bd10fa6f46 Merge pull request #512 from Becheler/fix/example-unused-warnings
fix: silence -Wunused-local-typedef and -Wunused-variable in four examples
2026-06-23 10:27:39 +02:00
Arnaud Becheler 7012e975eb Merge pull request #511 from Becheler/fix/unused-but-set-variable
fix: remove dead test variables
2026-06-23 10:27:04 +02:00
Arnaud Becheler 4df6881bee Merge pull request #509 from Becheler/doc/frontpage-example-cleanup
doc: landing page code cleanup
2026-06-23 10:26:02 +02:00
Arnaud Becheler fa19c3bfe8 Merge pull request #510 from Becheler/fix/howard-unused-lambda-capture
fix: lambda capture 'this' is not used
2026-06-23 10:25:21 +02:00
Arnaud Becheler 6103fa5010 clears gcc -Wsign-compare 2026-06-22 14:33:44 +02:00
Arnaud Becheler 29be624016 clears Wdeprecated-declarations 2026-06-22 14:24:12 +02:00
Arnaud Becheler 30013adff1 Silence -Wunused-local-typedef and -Wunused-variable in four examples 2026-06-22 13:23:02 +02:00
Arnaud Becheler 505d1ca260 fix: remove dead test variables 2026-06-22 13:02:23 +02:00
Arnaud Becheler 476e3791a2 fix: lambda capture 'this' is not used 2026-06-22 11:01:48 +02:00
Arnaud Becheler 32fe89d9ca update num_vertices to nb_vertices, update godbolt 2026-06-22 10:27:33 +02:00
Arnaud Becheler 8ed6e4148b fix: identation 2026-06-20 17:19:15 +02:00
Arnaud Becheler b70604ba98 fix: verbosity level in example 2026-06-20 16:49:34 +02:00
Arnaud Becheler 434eba8377 fix: take andrzej feedback into account 2026-06-20 16:37:54 +02:00
Arnaud Becheler 1de0d5cb4a Merge pull request #508 from andreacassioli/succ-shortest-path-missing-const
add missing const values; use some using instead of typedef
2026-06-20 11:06:16 +02:00
Andrea Cassioli cf1839a3dc aPR comments 2026-06-19 22:02:06 +02:00
Andrea Cassioli 41e64b12a9 add missing const values; use some using instead of typedef 2026-06-18 22:33:15 +02:00
Arnaud Becheler dae20d5a36 Merge pull request #507 from Becheler/doc/index-html-redirect
fix: adding doc/index.html
2026-06-15 16:01:50 +02:00
Arnaud Becheler da8ff0f6ce fix: adding doc/index.html 2026-06-15 15:59:24 +02:00
Jeremy W. Murphy 02cb1797fb Merge pull request #491 from Becheler/doc-migration
Doc migration
2026-06-15 17:14:07 +09:00
Jeremy W. Murphy 167e619bbb Merge branch 'develop' into CMake 2026-06-09 07:22:33 +09:00
Arnaud Becheler 5c61bd0bb0 Merge pull request #506 from Becheler/fix/louvain-unused-dead-code
Fix unused dead code in `louvain_clustering.hpp`
2026-06-08 12:13:01 +02:00
Arnaud Becheler d064024368 Merge pull request #505 from Becheler/fix/adjacency-list-uninitialized-edge-property
fix: initialize `edge_property_type` value in `adjacency_list.hpp`
2026-06-08 11:41:02 +02:00
Arnaud Becheler a1ac74112e Merge pull request #504 from Becheler/fix/sparse-ordering-eccentricity-narrowing
fix wrong return type in accessor
2026-06-08 11:40:33 +02:00
Arnaud Becheler 0d3e577658 Merge pull request #499 from Becheler/fix/king-ordering-size-t-narrowing
remove narrowing conversion in `king_ordering.hpp`
2026-06-08 11:33:23 +02:00
Arnaud Becheler 8ad0ef8519 Merge pull request #498 from Becheler/fix/bandwidth-hpp-size-t-narrowing
remove narrowing conversion in `bandwidth.hpp`
2026-06-08 11:17:14 +02:00
Arnaud Becheler fe3ac077b1 Merge pull request #497 from Becheler/fix/random-hpp-size-t-narrowing
remove narrowing conversion in `random.hpp`
2026-06-08 11:16:26 +02:00
Arnaud Becheler d86a207a6b fix: initialize value 2026-06-08 09:47:12 +02:00
Arnaud Becheler e6fa04062f Merge pull request #503 from Becheler/fix/warning-bot-fork-pr-number
fix bot warning count to match head.sha against base repo open PR list
2026-06-08 08:30:18 +02:00
Arnaud Becheler 7ac2ddff07 fix wrong return type in accessor 2026-06-08 08:29:44 +02:00
Arnaud Becheler 85d048a629 fix bot warning count to match head.sha against base repo open PR list 2026-06-08 08:00:11 +02:00
Jeremy W. Murphy 35c7a0956d Merge pull request #500 from Becheler/ci/warning-count-comment
generate warnings counts in PR comment
2026-06-08 12:08:02 +09:00
Arnaud Becheler 21cd4df091 ci: trigger 2026-06-07 16:17:28 +02:00
Arnaud Becheler bc69cb4ed8 generate warnings counts in PR comment 2026-06-07 16:08:02 +02:00
Arnaud Becheler f3ea278844 remove unused variables and typedefs 2026-06-07 15:13:07 +02:00
Arnaud Becheler 2dd06ac7a7 sparse_ordering: widen queue operator[] from int to size_type 2026-06-07 13:22:52 +02:00
Arnaud Becheler de9a2f6d5e king_ordering: widen heap indices to std::ptrdiff_t 2026-06-06 19:23:53 +02:00
Arnaud Becheler a80891754a harden king ordering test 2026-06-06 18:27:36 +02:00
Arnaud Becheler 95e3a3c6a2 remove narrowing conversion in bandwidth 2026-06-06 14:33:40 +02:00
Arnaud Becheler c1ed7eca2a remove narrowing conversion 2026-06-06 13:34:54 +02:00
Arnaud Becheler 5a86742db1 fixes #343: surprising counts of faces in planar_face_traversal 2026-06-04 17:34:34 +02:00
Arnaud Becheler 6039644bea fix #246 by documentation const Graph ref properly 2026-06-04 13:04:19 +02:00
Arnaud Becheler 6efc6b60d0 Merge pull request #489 from Becheler/doc/gh-plumbing
Adding and editing github plumbing files
2026-06-01 15:48:43 +02:00
Arnaud Becheler 223223ac9e Merge remote-tracking branch 'upstream/develop' into doc-migration
# Conflicts:
#	doc/circle_layout.html
2026-06-01 14:49:18 +02:00
Arnaud Becheler d112309ea9 minor rewording 2026-06-01 14:42:13 +02:00
Jeremy W. Murphy 439351a7ed Merge pull request #469 from andreacassioli/fix-circle-layout-docs-and-cleanup
Fix circle layout docs and cleanup
2026-05-30 14:44:36 +09:00
Arnaud Becheler 6c1b24d488 using types and labels 2026-05-23 17:22:18 +02:00
Andrea Cassioli 3ba1ef9b4e revert change in index type 2026-05-21 21:30:55 +02:00
Arnaud Becheler b448bf3ae3 integrate andreacassioli's feedback 2026-05-21 11:55:19 +02:00
Arnaud Becheler 7f10bfb0d9 clean up doc root folder, remove unused and broken files 2026-05-19 15:25:27 +02:00
Arnaud Becheler 65c691f726 have the Edit This Page link point to boost::graph::develop rather than becheler fork 2026-05-19 12:52:29 +02:00
Arnaud Becheler 2c30cd95d4 fix merge conflicts 2026-05-19 12:17:35 +02:00
Arnaud Becheler 6800e76199 retiring old doc and hooking new doc to boost antora 2026-05-19 11:54:39 +02:00
Arnaud Becheler 7304e54dca follow sylvain feedback for TOC 2026-05-18 16:12:24 +02:00
Arnaud Becheler f51204ef1a follow sylvain feedback for TOC 2026-05-18 16:09:10 +02:00
Arnaud Becheler 3f972d6a4f add note and link for graph theory 2026-05-18 15:50:07 +02:00
Arnaud Becheler 14264f3a74 add animations for BGL primitives 2026-05-18 15:17:18 +02:00
Arnaud Becheler 672f6f06f8 fix name 2026-05-15 13:09:43 +02:00
Arnaud Becheler 8790022347 update landing page animation+code 2026-05-15 13:02:47 +02:00
Arnaud Becheler d8371c7ed0 add warning to mcgregor 2026-05-14 17:19:53 +02:00
Arnaud Becheler 5b19b1dadc bug boost static assert 2026-05-14 12:52:13 +02:00
Arnaud Becheler b2ceaae8a6 add banner with old doc, fix Edit This Page 2026-05-14 12:31:58 +02:00
Arnaud Becheler 57b7cba59c adding and editing github plumbing files 2026-05-13 15:33:55 +02:00
Jeremy W. Murphy c1f4786e11 Merge pull request #488 from Flamefire/add-toolchain-ppa
Enable adding Ubuntu toolchain PPA by default
2026-05-06 10:56:37 +09:00
Alexander Grund 288c626c32 Enable adding Ubuntu toolchain PPA by default
The default in Boost.CI will be false but some jobs still rely on this, so keep it for now the default.
2026-05-05 14:02:38 +02:00
Jeremy W. Murphy ae8e08d88f Merge pull request #453 from Becheler/feature/louvain-algorithm
Add Louvain community detection algorithm
2026-04-28 17:55:54 +09:00
Arnaud Becheler 4bc376279a fix ci 2026-04-22 15:04:39 +02:00
Arnaud Becheler 90a58597d1 fixes 2026-04-22 15:01:49 +02:00
Arnaud Becheler 6b7ca26148 search bar 2026-04-22 14:37:07 +02:00
Arnaud Becheler 7e7a17aa3b toc and faq 2026-04-22 13:28:36 +02:00
Arnaud Becheler 559b68b8ba references: andreaas feedback 2026-04-22 13:11:19 +02:00
Arnaud Becheler 4aab9289c2 harmonize signatures styles 2026-04-21 19:07:07 +02:00
Arnaud Becheler ca2c6a6dd7 remove internal properties 2026-04-21 18:39:13 +02:00
Arnaud Becheler 4c32a93dad See on CE 2026-04-21 18:35:14 +02:00
Arnaud Becheler 4801103ac4 fix toc and bugs 2026-04-21 18:22:55 +02:00
Arnaud Becheler 2e528f290a align expected output code snippet 2026-04-21 17:02:57 +02:00
Arnaud Becheler 2edd46503e fix 2026-04-21 15:10:26 +02:00
Arnaud Becheler 4c8b05e074 fix playbook 2026-04-21 15:03:43 +02:00
Arnaud Becheler 3ff238675e generator fix 2026-04-21 14:55:05 +02:00
Arnaud Becheler 0b37a0cbaf build examples and doc in CI 2026-04-21 14:48:17 +02:00
Arnaud Becheler 3de2a688fa bibliography 2026-04-21 12:41:33 +02:00
Arnaud Becheler 8c0d42b5e9 boost url template 2026-04-21 11:06:28 +02:00
Jeremy W. Murphy 73190bf898 Merge pull request #468 from sdarwin/drone3
Drone: drone.sh
2026-04-21 07:03:10 +09:00
Arnaud Becheler 7e1812ed51 update 2026-04-20 20:23:59 +02:00
Arnaud Becheler 1dc557406c update 2026-04-20 15:53:27 +02:00
Arnaud Becheler 394bea9ca9 update 2026-04-20 14:01:05 +02:00
Arnaud Becheler 372dd21037 adding static html build 2026-04-16 14:38:26 +02:00
Arnaud Becheler e8799c4edf pages 2026-04-16 14:36:36 +02:00
Arnaud Becheler 9bdc4a85c9 publish 2026-04-16 14:22:04 +02:00
Arnaud Becheler 1a254b7e72 removing old tutorials 2026-04-16 14:17:39 +02:00
Arnaud Becheler 53189be2bb fixes algorithms 2026-04-16 14:00:00 +02:00
Arnaud Becheler 3480acd1a3 algorithms mostly ok 2026-04-16 13:50:21 +02:00
Arnaud Becheler f9ec2bd17a adaptors ok 2026-04-16 05:28:51 +02:00
Arnaud Becheler 3d1dcb3b4d IO ok 2026-04-16 04:41:20 +02:00
Arnaud Becheler b7a2acd12f property maps ok 2026-04-16 00:17:55 +02:00
Arnaud Becheler 8f2e44c9c0 generators ok 2026-04-15 21:07:35 +02:00
Arnaud Becheler 65c234fdaf generators ok 2026-04-15 21:06:50 +02:00
Arnaud Becheler 76c33f6ff5 progress 2026-04-14 09:03:02 +02:00
Andrea Cassioli 8acad90b83 more auto 2026-04-13 22:15:42 +02:00
Andrea Cassioli 4188686303 add a const 2026-04-11 21:07:34 +02:00
Andrea Cassioli 4e51deab5b fix synopsis 2026-04-11 21:01:02 +02:00
Andrea Cassioli a466abb35a fix synopsis 2026-04-11 21:00:39 +02:00
Arnaud Becheler 7fd07d770e fixes, document generators 2026-04-09 17:06:56 +02:00
Arnaud Becheler 422ba537e0 beginning switching to adoc + antora 2026-04-09 15:02:09 +02:00
sdarwin a6404c8555 Drone: drone.sh 2026-04-07 11:20:21 -06:00
Andrea Cassioli d2c82c8e66 fix docs 2026-03-30 18:42:11 +02:00
Jeremy W. Murphy a7f7a1498b Merge pull request #443 from andreacassioli/fix-adjacency-serialiser-types
Fix adjacency list serialise types
2026-03-28 09:26:14 +09:00
Jeremy W. Murphy 1e9d083125 Merge pull request #450 from Lastique/feature/remove_static_assert
Remove dependencies on Boost.StaticAssert
2026-03-23 11:44:58 +09:00
Andrea Cassioli 47f3767fc8 fix missing space 2026-03-15 11:54:44 +01:00
Jeremy W. Murphy a409705ae6 Merge pull request #460 from andreacassioli/fix-bk-max-flow-figure
new figure aligned with the docs
2026-03-13 16:18:58 +09:00
Arnaud Becheler b9ad3a887b benchmarks informed choice to trust aggregation as modularity preserving and to remove best partition tracking 2026-03-12 10:08:18 +01:00
Arnaud Becheler 79523b647f fix: disentangle trust Q and track peak 2026-03-11 15:38:02 +01:00
Arnaud Becheler ef7933eae1 test: TRUST_AGGREGATED_Q path 2026-03-11 12:27:32 +01:00
Arnaud Becheler a846cdece1 fix: cleanup dead internal_weights 2026-03-11 09:32:03 +01:00
Andrea Cassioli 3728c4d943 new figure aligned with the docs 2026-03-08 17:40:31 +01:00
Arnaud Becheler 85f017427f fix: assertion on edge added 2026-03-06 13:35:44 +01:00
Jeremy W. Murphy f4cf405962 Use FILE_SET HEADERS and bump to 1.90 2026-03-05 09:05:29 +09:00
Arnaud Becheler ca528f54d7 updated documentation 2026-02-26 16:52:54 +01:00
Arnaud Becheler a4e2ada51b typo 2026-02-24 17:32:10 +01:00
Arnaud Becheler 39c486396a default value for policy 2026-02-24 17:05:59 +01:00
Arnaud Becheler f04a9cc67c quality functions passed as objects with named methods 2026-02-24 16:50:29 +01:00
Arnaud Becheler 4b8a584b8e specializing std::hash forbidden here 2026-02-23 15:58:11 +01:00
Arnaud Becheler bdedea7e63 fix dosctrsing 2026-02-23 15:55:54 +01:00
Arnaud Becheler 967f47bf08 index-based interals and contguous outputs labels 2026-02-23 15:50:46 +01:00
Arnaud Becheler af23880ebd index-based interals and contguous outputs labels 2026-02-23 15:50:22 +01:00
Andrea Cassioli 024ee8f87a refactor deducing types from the graph; use unordered map; 2026-02-20 21:25:49 +01:00
Arnaud Becheler fb6105197c docs 2026-02-17 14:50:17 +01:00
Arnaud Becheler 7180cd69a3 fix: no hierarchy_t, free unfold function 2026-02-17 12:40:47 +01:00
Arnaud Becheler e8760cfd89 incremental and non incremental metrics can lead to different optimization paths 2026-02-16 14:28:36 +01:00
Arnaud Becheler 0034d3f133 Trigger CI 2026-02-16 14:15:07 +01:00
Arnaud Becheler a02bc0fa75 incremental and non incremental metrics can lead to different optimization paths 2026-02-16 13:46:48 +01:00
Arnaud Becheler 24002dbbb9 fix unused variables in concepts 2026-02-16 13:13:26 +01:00
Arnaud Becheler c5c9ac48ef fix wrong namespace 2026-02-16 12:36:01 +01:00
Arnaud Becheler 28721e1cd0 incremental versus non-incremental concepts 2026-02-16 11:57:06 +01:00
Arnaud Becheler 6b278b8e64 adding LouvainQualityFunctionConcept 2026-02-10 16:19:31 +01:00
Arnaud Becheler 422d376e92 fix: URGB made generic 2026-02-09 16:20:37 +01:00
Arnaud Becheler 78d9225ad9 PR review: fixed copyright, local optimization visibility, assertions, type mismatch in for loop 2026-02-09 16:03:12 +01:00
Arnaud Becheler 385e8c813b Delete scratch/benchmark/bgl_louvain.cpp
this was not supposed to be commited :)
2026-02-05 00:48:16 +01:00
Arnaud Becheler de9b6a8c04 Delete scratch/benchmark/run_benchmark.sh
this was not supposed to be commited :)
2026-02-05 00:45:36 +01:00
Arnaud Becheler 76efd88f1d add some comments 2026-02-04 11:01:01 +01:00
Arnaud Becheler 6ef3267a9d adding louvain tests to jamfile 2026-02-04 09:10:59 +01:00
Arnaud Becheler 374db7bc1a Add Louvain clustering algorithm 2026-02-02 13:48:50 +01:00
Andrey Semashev d1b08acfbe Remove dependencies on Boost.StaticAssert.
Boost.StaticAssert has been merged into Boost.Config, so remove
the dependency.
2026-01-22 20:03:22 +03:00
Andrea Cassioli e792cf1494 align integer types 2025-12-30 15:53:02 +01:00
Andrea Cassioli 4caed4cae3 use auto for local variables 2025-12-29 16:44:48 +01:00
Andrea Cassioli 19e08a76bd revert c++17 feature 2025-12-29 16:00:37 +01:00
Andrea Cassioli eaf8cc19be revert c++17 feature 2025-12-29 15:38:23 +01:00
Andrea Cassioli 2d894ebe64 Cleanup and revert to use integers; 2025-12-28 22:56:12 +01:00
Andrea Cassioli 630590035d use graph traits for number of edges; 2025-12-06 22:34:48 +01:00
Andrea Cassioli f593e09b3d use graph traits for number of vertices and edges; use unsigned size_t for loops 2025-12-05 22:21:05 +01:00
Andrea Cassioli 7850cff75f use graph traits for number of vertices and edges; use unsigned size_t for loop indeces 2025-12-05 22:16:37 +01:00
Jeremy W. Murphy 3131c24630 Merge pull request #442 from tinko92/robust_integer_crosses_straight_line_drawing
Robust, integer crosses for is_straight_line_drawing
2025-12-01 07:18:39 +09:00
Tinko Sebastian Bartels ac16714397 Add robust, integer crosses check instead of relying on Boost.Geometry in is_straight_line_drawing.hpp. 2025-11-30 13:17:48 +08:00
Jeremy W. Murphy 0cdf8dd014 Merge pull request #423 from murraycu/develop-murrayc-examples-modern-cpp-attempt2c
examples: C++11: Replace typedef with using declaration
2025-11-26 07:18:26 +09:00
Jeremy W. Murphy 13b531b037 Merge branch 'develop' into CMake 2025-10-27 09:11:34 +09:00
Jeremy W. Murphy 6c78c84156 Merge pull request #440 from boostorg/fix-GHA
Remove old platforms
2025-10-09 16:54:49 +09:00
Jeremy W. Murphy a94c7056e2 Remove old platforms
Primarily Windows-2019, but also MacOS 13.
2025-10-08 08:58:40 +09:00
Jeremy W. Murphy a4326c3dc1 Merge branch 'develop' into CMake 2025-10-08 07:57:15 +09:00
Jeremy W. Murphy 2eb59d35a7 Merge pull request #439 from Flamefire/fix-cmake-version
Bump required CMake version to 3.8
2025-10-01 18:14:28 +09:00
Alexander Grund 4b521fe624 Fix required CMake version 2025-10-01 10:17:42 +02:00
Jeremy W. Murphy 46559d7a6e Merge pull request #438 from Becheler/patch-1
Update iohb.c to use snprintf
2025-08-25 14:39:14 +09:00
Arnaud Becheler d10b83cedd Update iohb.c to use snprintf
Use snprintf if available as some compilers (clang 14.0) issue deprecation warnings for sprintf, see issue #437
2025-08-24 21:15:47 +02:00
Jeremy W. Murphy 9eed47ce43 Merge branch 'develop' into CMake 2025-08-18 12:15:37 +09:00
Murray Cumming 35f6a2dc27 examples: C++11: Use using instead of typedef 2025-07-20 17:51:15 +02:00
Jeremy W. Murphy 1cfeb9ad6b Merge pull request #432 from andrea-cassioli-maersk/rcsp-visitor-docs
Update r_c_shortest_paths.html
2025-07-18 12:08:04 +09:00
Andrea Cassioli 6df9717c84 Update doc/r_c_shortest_paths.html
Co-authored-by: Jeremy W. Murphy <jeremy.william.murphy@gmail.com>
2025-07-17 11:28:45 +02:00
Andrea Cassioli 7e1863ae10 Update r_c_shortest_paths.html
Add few details about the on_enter_loop visitor event that is not documented
2025-07-10 15:32:02 +02:00
Jeremy W. Murphy 3784692731 Merge pull request #429 from jan-grimo/fix-github-428
Fix multiplicity value comparison
2025-05-12 17:55:19 +09:00
Jan-Grimo Sobez 4697f3fb19 Update file paths 2025-05-09 22:07:47 +02:00
Jan-Grimo Sobez 4aec705625 Merge branch 'develop' into fix-github-428 2025-05-06 07:20:19 +02:00
Jeremy W. Murphy acc19514d7 Remove ancient compilers and 2a versions 2025-05-02 13:26:28 +09:00
Jeremy W. Murphy f2f55c2062 Merge pull request #382 from grafikrobot/modular
Add support for modular build structure.
2025-05-02 13:23:31 +09:00
Rene Rivera 4951181a2e Translate the compioler install name to the CXX command for B2. 2025-05-01 22:37:02 -05:00
Rene Rivera 7b7ab3f917 Update GHA CI to latest OSes and compilers. 2025-05-01 22:17:51 -05:00
Rene Rivera 7b9640389c Sync from upstream. 2025-05-01 21:44:03 -05:00
Jan-Grimo Sobez f434208542 Fix multiplicity value comparison
Fix multiplicity value comparison
- Replacement of at() in 8f3139be as part of #349 was faulty: Iterator
deref is a (key, value) pair, but only the value should be compared
2025-05-01 16:32:43 +02:00
Jeremy W. Murphy 34f3587678 Merge pull request #427 from jorisvr/iss426
Specify path of weighted_matching.dat via Jamfile
2025-04-30 19:33:33 +09:00
Rene Rivera e9a12bb577 Move include to target. 2025-04-17 08:50:26 -05:00
Rene Rivera 823e17fb44 Tests no longer depend on Boost.Assign. 2025-04-12 23:10:50 -05:00
Joris van Rantwijk be7434e584 Specify path of weighted_matching.dat via Jamfile 2025-04-05 12:02:25 +02:00
Rene Rivera 258f47a3b1 Sync from upstream. 2025-04-04 21:39:36 -05:00
Jeremy W. Murphy cbae97953a Merge pull request #421 from murraycu/develop-murrayc-examples-modern-cpp-attempt2
examples: C++11: Some use of range-based for loops
2025-03-12 19:07:32 +09:00
Jeremy W. Murphy 9bed95c45c Merge pull request #424 from murraycu/develop-murrayc-examples-modern-cpp-attempt2d
examples: C++11: Use std::begin() and std::end()
2025-03-10 08:11:56 +09:00
Murray Cumming d93f67d804 examples: C++11: Use std::begin() and std::end()
Instead of array + length.
And use initializer lists.
2025-03-09 18:49:52 +01:00
Murray Cumming 6ebdc2c8fd examples: C++11: Some use of range-based for loops 2025-03-09 18:21:54 +01:00
Jeremy W. Murphy 4792e04be7 Merge pull request #408 from samolisov/dominator-tree-vector-of-structs
Aggregate predecessor state for Lengauer-Tarjan

Improves performance on several benchmarks although regresses on one.
2025-03-04 22:19:26 +09:00
Pavel Samolysov 7b04334601 Rename preds -> pred 2025-03-04 13:43:27 +03:00
Pavel Samolysov 57058f091a Combine the preds_of_n's components update into a whole 2025-03-01 17:05:04 +03:00
Pavel Samolysov e936b09340 Add a test case for adjacency_matrix 2025-03-01 16:29:06 +03:00
Pavel Samolysov 38b4f317a8 Add a test case for adjacency_list< listS, vecS, bidirectionalS >
This specialization of the adjacency_list class uses different value
for `graph_traits< G >::null_vertex()`.
2025-03-01 14:21:49 +03:00
Pavel Samolysov 561e377199 .clang-format Enable adding a blank line between template and class name 2025-03-01 14:21:49 +03:00
Pavel Samolysov e121340571 Address the comments from @jeremy-murphy
Closes #383
2025-03-01 14:21:49 +03:00
Pavel Samolysov 3de9380d48 Remove the 'set_' members from 'preds' struct 2025-03-01 14:21:49 +03:00
Pavel Samolysov 8119d0e169 Use vector-of-structs of preds/semi for Lengauer-Tarjan
Closes #383
2025-03-01 14:21:49 +03:00
Jeremy W. Murphy 9237081239 Merge pull request #403 from Wavetrace/feature-matrix-bidir
Make adjacency_matrix implement BidirectionalGraph concept
2025-02-28 16:07:00 +09:00
Jeremy W. Murphy 50d26818e0 Fix comments for degree functions 2025-02-28 14:56:13 +09:00
Jeremy W. Murphy 8f05ca23fa Merge pull request #410 from Tuxliri/patch-1
Fixed wrong link in grid_graph documentation
2025-02-27 07:11:09 +09:00
Jeremy W. Murphy 8a2d0439e4 Merge pull request #422 from murraycu/develop-murrayc-examples-modern-cpp-attempt2b
examples: C++11: Use list initialization instead of push_back()
2025-02-20 20:13:07 +11:00
Jeremy W. Murphy d5531e24dc Merge pull request #418 from gogagum/feature/remove-boost-bind-usages
Remove Boost.Bind usages, replace with lambda
2025-02-18 18:50:34 +11:00
Georgy Guminov 2d182cff02 Remove all std::bind usages. 2025-02-17 21:13:30 +03:00
Georgy Guminov 4aadc91f5c Remove Boost.Bind usages.
Fix build for clang.
2025-02-17 21:13:28 +03:00
Murray Cumming 5dbdc5546a examples: C++11: Use list initialization instead of push_back() 2025-02-16 11:58:27 +01:00
Jeremy W. Murphy 167ac18ae7 Merge pull request #400 from jorisvr/matching_joris
Replace implementation of maximum_weighted_matching()

Based on a paper by Zvi Galil. The new code runs in time O(V^3).
2025-02-10 11:26:52 +09:00
Jeremy W. Murphy 84eaec81ec Merge pull request #416 from gogagum/feature/remove-boost-assign-usages
Remove Boost.Assign usages.
2025-02-10 11:11:59 +09:00
Joris van Rantwijk 6d9f2391b8 Use reference arguments instead of pointers 2025-02-06 22:59:40 +01:00
Joris van Rantwijk dc9886b1cd Avoid space after "!" operator 2025-02-06 22:25:40 +01:00
Joris van Rantwijk ef60a858a5 Use auto for local variables 2025-02-06 22:11:35 +01:00
Joris van Rantwijk cbcefb2db0 Avoid const member variables 2025-02-06 21:33:22 +01:00
Joris van Rantwijk 8600b33b5a Use pointer instead of reference member variable 2025-02-06 20:21:40 +01:00
Joris van Rantwijk 3db393b6fd Remove unnused #include 2025-02-06 20:09:38 +01:00
Georgy Guminov 8696a1fdc2 Remove Boost.Assign usages. 2025-02-06 00:43:03 +03:00
Joris van Rantwijk 69f393a08b Rewrite "typedef" as "using"
Also remove unnecessary < > spaces around template arguments.
2025-02-05 21:12:34 +01:00
Joris van Rantwijk 6396f826d3 Remove random test cases 2025-02-05 19:21:39 +01:00
Jeremy W. Murphy cbb91297ca Merge pull request #415 from AnthonyVH/anthonyvh/fix_named_graph_copy
Ensure named_graph base class is initialized before accessing it
2025-02-04 21:10:47 +11:00
Anthony Van Herrewege 1c295e6830 Ensure named_graph base class is initialized before accessing it 2025-02-03 15:36:24 +01:00
Jeremy W. Murphy 254d7cbb24 Merge pull request #411 from murraycu/develop-murrayc-examples-modern-cpp-attempt2
examples: C++11: Use auto
2025-02-03 17:05:51 +11:00
Murray Cumming f4d50aa424 examples: C++11: Use auto 2025-02-02 16:05:33 +01:00
Joris van Rantwijk 88a4f855f2 Clarify algorithm doc after review 2025-01-31 08:29:08 +01:00
Joris van Rantwijk 13c5fd7011 Remove verification code 2025-01-30 19:25:50 +01:00
Peter Dimov f29296306f Add missing include 2025-01-28 02:02:12 +02:00
Jeremy W. Murphy 84c36ca5f9 Merge pull request #412 from jeremy-murphy/388_is_straight_line_drawing
Fix geometry bug in is_straight_line_drawing
2025-01-27 08:22:46 +11:00
Joris van Rantwijk 26efe6629e Fix grammar in doc after review 2025-01-26 12:08:29 +01:00
Joris van Rantwijk fa388e2784 Fix include order after review 2025-01-26 12:05:38 +01:00
Joris van Rantwijk c8bd42dd53 Fix include order after review 2025-01-26 12:04:59 +01:00
Jeremy W. Murphy 80e00c358d Merge pull request #414 from Flamefire/patch-1
Fix GHA build status badges in Readme
2025-01-22 22:11:43 +11:00
Alexander Grund df1666e57a Fix GHA build status badges in Readme 2025-01-22 11:13:56 +01:00
Jeremy W. Murphy a372a07f0a Merge pull request #413 from AnthonyVH/anthonyvh/fix_reserve_performance
Fix performance issues for vector-based storage

Also remove requirement for a mutable graph on vertex_by_property().
2025-01-22 20:11:39 +11:00
Anthony Van Herrewege 15b587adb8 Fix vector insertion complexity from O(N) to O(1) 2025-01-16 11:49:58 +01:00
Anthony Van Herrewege 9096f61b27 Allow getting vertex property from const graph object 2025-01-16 11:49:58 +01:00
Joris van Rantwijk 5fa8626155 Add weighted_matching_example to Jamfile 2025-01-13 21:35:19 +01:00
Joris van Rantwijk 059365ffe8 Update maximum_weighted_matching documentation 2025-01-13 21:35:19 +01:00
Joris van Rantwijk fb66ac492f Replace maximum_weighted_matching implementation
The new code runs in O(V^3).
It also solves a number of known issues.
2025-01-13 21:35:19 +01:00
Joris van Rantwijk f30ba13a24 Add more tests for maximum_weighted_matching
- Hand-picked graphs to explore basic functionality.
- Graphs that are known to trigger bugs in the old
  implementation of maximum_weighted_matching().
- Random small graphs.
2025-01-13 21:32:38 +01:00
Jeremy W. Murphy d4bf882a4a CMAKE_SOURCE_DIR != CMAKE_CURRENT_SOURCE_DIR == Graph developer 2025-01-03 09:50:33 +11:00
Jeremy W. Murphy 9176040132 Refactor the geometry details out into make and crosses 2025-01-02 09:35:40 +11:00
Jeremy W. Murphy 3244b38788 Use numeric_cast because size_t -> double is narrowing 2024-12-28 09:50:18 +11:00
Davide Iafrate 4d701e74f2 Fixed wrong link in grid_graph documentation 2024-12-25 12:43:59 +01:00
Jeremy W. Murphy 3a51b37063 Merge branch 'develop' into CMake 2024-12-21 09:15:28 +11:00
Jeremy W. Murphy 16660dc68f Fix finding Boost for the unit tests 2024-12-21 09:15:24 +11:00
Jeremy W. Murphy ce1daebc3d Merge pull request #405 from murraycu/develop-murrayc-examples-modern-cpp-attempt2
Examples: Fix minor warnings
2024-12-21 08:30:02 +11:00
Jeremy W. Murphy 68b08e32a0 Merge pull request #407 from samolisov/dominator-tree-deque-to-vector
Replace std::deque with std::vector for Lengauer-Tarjan
2024-12-21 08:27:48 +11:00
Pavel Samolysov ca7741a8d8 Replace std::deque with std::vector for Lengauer-Tarjan
Issue: #383
2024-12-19 13:39:44 +03:00
Jeremy W. Murphy 87b862c191 Fix #388 by using Boost.Geometry
"crosses" fits the requirement as it means that the interior parts of the
geometry share some common points, not exterior parts such as
end-points, and it means "not within".
2024-12-19 08:43:00 +11:00
Murray Cumming 350e8d74c4 Examples: Avoid signed/unsigned comparison warnings. 2024-12-15 17:32:17 +01:00
Murray Cumming c3868dcdb7 Example: Avoid unused variable warning. 2024-12-15 17:31:56 +01:00
Peter Kerzum b0be1f7087 Make adjacency_matrix implement BidirectionalGraph concept
Adjacency matrix is by nature bidirectional and one can see that the
concept was mostly implemented before. That implementation missed
the degree function(s). These functions are implemented in this commit
and the traversal_category is updated to meet the concept requirements.

Tests are also added, though they are a bit shallow in the sense that
they seem to omit intensive algorithms.
2024-12-12 03:33:26 +01:00
Jeremy W. Murphy bdeaf549ec Merge pull request #402 from jorisvr/fix_doc_vertex
Fix time complexity spec of vertex()
2024-12-10 08:32:58 +11:00
Joris van Rantwijk ce24b257ca Fix time complexity spec of vertex() 2024-12-08 11:37:24 +01:00
Joris van Rantwijk f98edae416 weighted_matching_test check input file
Without this check, the test program declares all tests passed if it
fails to open the input file.
2024-12-03 21:38:27 +01:00
Jeremy W. Murphy 33b6802023 Merge pull request #394 from tsnorri/fix/cycle-canceling-dispatch1-call
Fix missing detail:: namespace qualification on call to cycle_canceling_dispatch1.
2024-11-19 23:51:59 +11:00
Tuukka Norri 98e541c930 Fix missing namespace name 2024-11-08 12:21:28 +02:00
Peter Dimov f1e51a0857 Add CMake subdir and install tests to ci.yml 2024-11-07 10:36:23 +02:00
Jeremy W. Murphy fdc6199b6d Merge pull request #393 from JulienDelacroix/warning
bron_kerbosch_all_cliques: Fix unused parameter/variable warnings
2024-11-01 16:14:55 +11:00
Julien DELACROIX 5c753bedae Fix unused parameter/variable warnings 2024-10-31 17:27:35 +01:00
Jeremy Murphy ed3ad56654 Fix compile and link issues 2024-10-31 14:38:37 +11:00
Jeremy Murphy d3f7d136c4 It uses Boost.Core's lightweight_test, not Boost.Test 2024-10-31 13:21:51 +11:00
Jeremy Murphy 7917600ae4 Split CMake identities: superproject and 'developer' 2024-10-31 11:58:18 +11:00
Jeremy W. Murphy 4d6a196d04 Merge pull request #390 from danielyxyang/fix/undirected_dfs
fixed incorrect callbacks to finish_edge in undirected_dfs
2024-10-30 17:47:54 +11:00
Hermann Stamm-Wilbrandt 8a60b5a259 Merge branch 'boostorg:develop' into issue_is_straight_line_drawing 2024-10-12 19:37:00 +02:00
Hermann-SW bda28c863a add failing is_straight_line_drawing testcase 2024-10-12 19:35:43 +02:00
Rene Rivera dabe257fda Sync from upstream. 2024-10-10 08:42:09 -05:00
Daniel Yang b671e3d5e6 added test for checking dfs_visitor callbacks in undirected_dfs 2024-10-09 09:29:28 +02:00
Daniel Yang 0b63c6896a fixed advancement of the edge iterator 2024-10-09 08:44:02 +02:00
Daniel Yang 6f2e223c7d fixed incorrect callbacks to finish_edge in undirected_dfs 2024-10-09 08:41:09 +02:00
Jeremy W. Murphy d108c967a1 Fix Clang 7 std, remove 1z 2024-10-09 14:17:22 +11:00
Jeremy W. Murphy ba3022a97d Remove C++11 from GitHub Actions 2024-10-08 10:44:57 +11:00
Jeremy W. Murphy 8a52339716 Remove C++11 builds 2024-10-08 10:43:21 +11:00
Rene Rivera ab1d87b956 Sync from upstream. 2024-09-24 23:21:30 -05:00
Jeremy W. Murphy 41c1c56860 Merge pull request #386 from brunom/patch-1
Update publications.html
2024-09-23 06:25:14 +10:00
Bruno Martinez e0e3731ca6 Update publications.html 2024-09-22 12:22:44 -03:00
Rene Rivera f76084c5b8 Sync from upstream. 2024-09-14 08:39:44 -05:00
Jeremy W. Murphy 98019df3fd Merge pull request #385 from boostorg/disjoint_set_doc_fixes
Fix issue #384: broken links between disjoint_sets and incremental connected components
2024-09-12 09:54:26 +10:00
Jeremy W. Murphy 41d39a5162 Update disjoint_sets.html
Remove unnecessary dir prefix
2024-09-12 09:51:00 +10:00
Jeremy W. Murphy 3184d9a084 Fix broken link to disjoint_sets 2024-09-12 09:49:54 +10:00
Jeremy W. Murphy 212451425d Fix broken links to incremental components 2024-09-12 09:43:39 +10:00
Rene Rivera df399ee1ed Change math dep real target math/tr1. 2024-08-11 09:23:25 -05:00
Rene Rivera a9516ad819 Update build deps. 2024-08-03 12:29:04 -05:00
Rene Rivera 82a4c4e9ca Split b2 dependencies into public and private. 2024-07-26 13:03:51 -05:00
Rene Rivera a40316edea Move inter-lib dependencies to a project variable and into the build targets. 2024-07-23 22:34:22 -05:00
Rene Rivera 325f5b7921 Bump B2 require to 5.2 2024-06-14 11:33:55 -05:00
Rene Rivera 6b09e7b7e3 Sync from upstream. 2024-05-10 20:46:30 -05:00
Jeremy W. Murphy 5557ccf921 Merge pull request #376 from sehe/pr-364
Fix security issue #364 and non-keyword subgraph parsing
2024-05-10 16:09:02 +10:00
Jeremy W. Murphy 17acf25da7 Merge pull request #375 from sehe/graphviz_test-refactor
Refactoring graphviz_test for review
2024-05-09 15:00:01 +10:00
Jeremy W. Murphy 64a3bae4f2 Merge pull request #374 from sehe/workaround-373
Fix and restore broken test_basic_csr_directed_graph
2024-05-09 14:50:52 +10:00
sehe 05aa9fd816 Include test for subgraph nesting limit
Eliminating need for manual re-test after review updates PR #376
2024-05-08 15:41:04 +02:00
sehe c71ceb8486 max_subgraph_nesting_level in read_graphviz_new 2024-05-08 14:48:06 +02:00
sehe 9c0ceda4c8 test_subgraphs verifies (keyword) subgraphs parse 2024-05-08 14:48:06 +02:00
sehe 5007b01ad5 Fix non-keyword subgraph parsing
Non-keyword graphs never worked (!). This was uncovered because of
security issue #364.

parse_subgraph() incorrectly dealt with first_token in the case
where the `subgraph` keyword wasn't used.
2024-05-08 14:48:06 +02:00
sehe 8126d97989 refactoring graphviz_test for review
The code was mostly fine (except for unhygienic `using namespace` in
places), but it was hard to see what was covered.

I've seperated fixtures (sample input + expected output) and this will
simplify invoking the ComparisonDriver (test_graph).
2024-05-08 14:43:53 +02:00
sehe 2154398906 Review comments 2024-05-08 14:39:27 +02:00
Rene Rivera 41e8999121 Add requires-b2 check to top-level build file. 2024-05-05 09:00:01 -05:00
Rene Rivera a5b6c4aeec Sync from upstream. 2024-05-02 22:46:35 -05:00
sehe b8150fac82 Restore broken test_basic_csr_directed_graph
Works around invalidation of bundle property maps (see #373).

The `#if SEHE_UNSTABLE_PROPERTY_MAPS_FIXED` section is there to signal
my intent to investigate a generalized fix under that issue. It doubles
as literate documentation of the need for the workaround, so it's less
likely to bite the unwary.
2024-05-03 04:20:45 +02:00
Jeremy W. Murphy 06339d6f44 Update cxxstd to 14
This choice is based on feedback to the Boost.Graph user survey.
2024-04-30 10:56:52 +10:00
Jeremy W. Murphy e7d0adb472 Replace Noel with myself as maintainer
I confirmed with Noel that he was happy with this and told him
that the door is always open if he wants to come back.
Thanks for all your help, Noel!
2024-04-30 10:44:45 +10:00
Rene Rivera 4857f12f7a Fix NO_LIB property syntax. 2024-04-28 21:45:45 -05:00
Rene Rivera 3f2414abd2 Add missing NO_LIB usage requirements. 2024-04-28 20:15:20 -05:00
Rene Rivera e0d11417c5 Sync from upstream. 2024-04-20 15:32:18 -05:00
Jeremy W. Murphy a3fffa9c2b Merge pull request #370 from jcdong98/fix
Fix labeled_graph typo in name adjacenct_vertices.
2024-04-17 10:41:01 +10:00
Jeremy W. Murphy 6caa0baaec Merge pull request #349 from jan-grimo/isomorphism-no-contiguous-invariants
Isomorphism: Remove invariant contiguous range requirement
2024-04-15 11:19:20 +10:00
Jan-Grimo Sobez 044c7d65a5 Use unordered_flat_map, parameterize invariant map 2024-04-14 09:48:36 +02:00
Jan-Grimo Sobez 2e7d74b1a0 Remove iterator rename in multiplicities 2024-04-14 09:48:36 +02:00
Jan-Grimo Sobez 71cea99db3 Remove Invariant concept checking 2024-04-14 09:48:36 +02:00
Jan-Grimo Sobez b9fbc47bbb Remove C++20 reserved keyword namespace (concept) 2024-04-14 09:48:36 +02:00
Jan-Grimo Sobez 2c36c0f819 Replace is_detected_v w/ is_detected<...>::value 2024-04-14 09:48:36 +02:00
Jan-Grimo Sobez 2f5a3c2ccc Clean up bracket style 2024-04-14 09:48:36 +02:00
Jan-Grimo Sobez db7b3736d6 Refactor multiplicities() with iterators 2024-04-14 09:48:36 +02:00
Jan-Grimo Sobez 8f3139bed4 Avoid reference member in multiplicity functor 2024-04-14 09:48:36 +02:00
Jan-Grimo Sobez 0be4c876bd Avoid requiring invariant default-constructibility
Avoid requiring invariant default-constructibility
- Refactor concept checking with boost type_traits
2024-04-14 09:48:36 +02:00
Jan-Grimo Sobez 5ec4327816 Invariant contiguous range requirement removal
Invariant contiguous range requirement removal
- Vertex invariants for use in isomorphism algorithm must no longer have
  low upper bounds due to a hidden allocation linear in the maximum
  encountered vertex invariant.
- Vertex invariants must no longer be convertible to `size_t`, but can
  be any comparable and hashable types
- Build `unordered_map`-backed invariant multiplicity map efficiently
  from sorted vertex invariants
2024-04-14 09:48:36 +02:00
Jeremy W. Murphy 4375631fa6 Remove MSVC 14.0 from github workflow 2024-04-14 07:24:22 +10:00
Jiachen Dong 81ead6e595 Fix typo in name adjacenct_vertices. 2024-04-12 17:17:15 +08:00
Rene Rivera fe90a5b067 Sync from upstream. 2024-04-10 07:56:28 -05:00
Jeremy W. Murphy 158eebd082 Merge pull request #368 from andrea-cassioli-maersk/fix-single-solution-rcsp
Fix issue #368 in the single solution RCSP
2024-04-04 09:46:39 +11:00
andrea-cassioli-maersk fa8caeeffa fix wrong naming 2024-04-03 16:07:08 +02:00
Rene Rivera e2547c2137 Switch to library requirements instead of source. As source puts extra source in install targets. 2024-03-29 21:15:59 -05:00
andrea-cassioli-maersk 33a2510c54 Update rcsp_single_solution.cpp 2024-03-22 11:00:59 +01:00
andrea-cassioli-maersk 57fdbf4093 Update rcsp_single_solution.cpp 2024-03-22 10:31:14 +01:00
andrea-cassioli-maersk 3fd626fa71 Update .gitignore 2024-03-22 10:08:17 +01:00
andrea-cassioli-maersk 46a2823a94 fix issue in the single solution rcsp 2024-03-22 10:04:32 +01:00
Rene Rivera 3d5eba2410 Make the library modular usable. 2024-03-11 08:38:17 -05:00
Jeremy W. Murphy 46ddc517a2 Merge pull request #361 from Lastique/feature/update_filesystem_usage
Update Boost.Filesystem usage
2024-01-31 13:40:38 +11:00
Jeremy W. Murphy 9c9f9f4b49 Merge pull request #360 from andrea-cassioli-maersk/andrea-cassioli-maersk-reverse-graph-doc-broken-link-to-example
Minor fixes to reverse_graph and r_c_shortest_paths documentation

reverse_graph example link was broken, r_c_shortest_paths had some stray > symbols.
2024-01-29 11:09:48 +11:00
Andrey Semashev a052dcdd06 Updated Boost.Filesystem usage.
This commit updates tests to avoid using Boost.Filesystem APIs that
were deprecated and then removed.
2024-01-27 00:35:52 +03:00
andrea-cassioli-maersk 72cad02a0b fix reverse graph example example broken link; fix rcsp functions parameters 2024-01-26 11:41:05 +01:00
Jeremy W. Murphy a7c3845f28 Merge pull request #352 from Romain-Geissler-1A/remove-link-against-boost-regex
Remove link against boost regex library, as normally it is header only when using C++ >= 11.
2024-01-01 14:50:25 +11:00
Romain Geissler e522561485 Remove link against boost regex library, as normally it is header only when using C++ >= 11. 2023-12-08 00:00:37 +00:00
Jeremy W. Murphy 1f6bb4adfa Remove Clang 3.x from Drone config 2023-12-07 16:15:25 +11:00
Jeremy W. Murphy a63690ac60 Merge pull request #357 from vslashg/develop
Add missing includes to graph headers
2023-12-07 16:07:29 +11:00
vslashg 3d6b1d4c9b Add missing includes to graph headers
Some graph .hpp files are using APIs without including the associated
headers.  This can cause compile errors if these headers are included
first in a .cpp file.
2023-12-06 16:08:16 +00:00
Jeremy W. Murphy 5235d7dd49 Merge pull request #355 from vslashg/patch-2
Move an #include outside of the boost namespace declaration.
2023-12-02 14:54:14 +11:00
vslashg 372355b045 Move an #include outside of the boost namespace declaration.
iteration_macros.hpp itself includes <utility>, so this inclusion ends up effectively doing

```
namespace boost {
#include <utility>
}
```

which is disallowed per [using.headers].
2023-12-01 19:03:05 -05:00
Jeremy W. Murphy fa2636d69d Merge pull request #354 from DeuceBox/remove-labeled-vertex
Fix labeled_graph::remove_vertex(Label const&) so that it removes the label too
2023-11-28 11:48:46 +11:00
George Williams e94408cf41 test/labeled_graph: added test for multiple associative container 2023-11-27 13:42:58 -05:00
George Williams 8dc51f8bdc test/labeled_graph: added test for removing a labeled vertex 2023-11-20 08:41:55 -05:00
George Williams 52c216c0aa graph/labeled_graph: added remove_labeled_vertex
I took this patch from this ticket:
https://svn.boost.org/trac/boost/ticket/9493
2023-11-18 17:34:09 -05:00
Jeremy W. Murphy f3158683b5 Merge pull request #341 from mglisse/small_prop
Compress boost::property using BOOST_ATTRIBUTE_NO_UNIQUE_ADDRESS
2023-09-13 11:11:59 +10:00
Jeremy W. Murphy 77c07d131e Merge pull request #321 from derek-mcblane/fixup-challenge-doc
Fix hyperlink for disjoint sets in "Challenge and To-Do Items"
2023-09-12 13:32:15 +10:00
Jeremy W. Murphy 2e63766abb Merge pull request #331 from mglisse/link-disjoint
Don't look for disjoint-sets representatives in link
2023-09-12 13:30:51 +10:00
Jeremy W. Murphy f2d0ae7827 Merge pull request #350 from vslashg/patch-1
Add a missing include for shared_ptr to topology.hpp
2023-09-12 13:26:55 +10:00
Jeremy W. Murphy d09128fc7b Reordered incluldes 2023-09-12 10:54:02 +10:00
Jeremy W. Murphy 0fd61671ae Merge pull request #348 from jeremy-murphy/drone
Remove GCC 4.x, Clang 3.5 and C++03
2023-09-11 10:52:09 +10:00
Jeremy W. Murphy c3574b1f2d Remove 03 from GitHub CI 2023-09-11 09:48:16 +10:00
vslashg e5ccf7977e Add a missing include to topology.hpp
boost::shared_ptr is used in this file without the corresponding include, so currently this file does not compile on its own.
2023-09-08 14:11:07 -04:00
Jeremy W. Murphy 3e2b86ab81 Remove C++03 testing 2023-09-04 13:30:23 +10:00
Jeremy W. Murphy 2cff7c5207 Remove GCC 4.x and Clang 3.5
Also remove old commented-out Xcode stuff.
2023-09-04 13:29:04 +10:00
Jeremy W. Murphy 7a469ec47a Merge pull request #207 from jargonzombies/map-disconnected-vertices
Isomorphism: Map disconnected vertices
2023-09-04 13:00:16 +10:00
Jeremy W. Murphy 1a3dab98cd Remove redundant scope braces 2023-08-02 13:52:38 +10:00
Jan-Grimo Sobez b48bf93057 Move disconnected vertex matching to member fn 2023-08-01 12:31:50 +02:00
Jeremy W. Murphy 942829ee68 Merge pull request #329 from francoisk/develop
Don't include graphviz.hpp from graphml.hpp (#326)
2023-07-18 15:56:11 +10:00
Jeremy W. Murphy 4fc6b0b65e Merge pull request #206 from jargonzombies/isomorphism-max-invariant
Isomorphism: Replace vertex_max_invariant with internal calculation
2023-07-18 15:06:54 +10:00
Jan-Grimo Sobez 9f36ca3a1d Add overflow assert and doc explanation for bound 2023-07-17 09:52:58 +02:00
Jan-Grimo Sobez 047fff647f Variable renames, doc update 2023-07-09 16:13:32 +02:00
Jan-Grimo Sobez 2097d8ffed Replace lowest with min for int case 2023-07-09 15:56:24 +02:00
Jan-Grimo Sobez 98e7bfa10a Isomorphism: Map disconnected vertices
Isomorphism: Map disconnected vertices
- Adds O(V) algorithm at return_point_true to match disconnected
  vertices in the isomorphism map
- Adds colored isomorphism test ensuring no null vertices are in the
  isomorphism map
2023-07-09 15:56:24 +02:00
Jan-Grimo Sobez ec28611026 Remove max since invar?_arrays are equal 2023-07-09 15:54:08 +02:00
Jan-Grimo Sobez b14f16b472 Revert empty checks 2023-07-09 08:43:23 +02:00
Marc Glisse 41aa91891d [[no_unique_address]] on the base of property
The chain typically ends with no_property, which is empty and wastes
space otherwise.
2023-07-07 21:10:20 +02:00
Jan-Grimo Sobez 38efd9dc1d max_invariant initialization, expand doc
max_invariant initialization
- Zero-initialize `max_invariant` and ensure no UB happens since
  `invar?_array` vecs may be empty if their corresponding graph is empty

expand doc
- More explanation on why `vertex_max_invariant` is ignored
2023-07-07 20:34:20 +02:00
Jeremy W. Murphy 8c9f2dcaf5 Merge pull request #313 from mattpulver/develop
Silence maybe-uninitialized warning in adj_list_edge_iterator::operator++()
2023-07-07 11:49:56 +10:00
Jeremy W. Murphy ee2cdcc805 Merge pull request #205 from jargonzombies/isomorphism-docs
Isomorphism docs: AdaptableUnaryFn, null vertices
2023-07-07 10:32:23 +10:00
Jeremy W. Murphy e56883f789 Merge pull request #339 from svengato/develop
Make comments refer to variables rather than duplicating values
2023-05-08 14:45:05 +10:00
Sven Gato Redsun 0182f7490e Generalize comments to be valid for any values of N and P 2023-05-07 22:02:19 -06:00
Sven Gato Redsun 05e099335a Make comments match actual values of the random graph's number of vertices and probability of edge connection 2023-05-07 20:24:48 -06:00
Jeremy W. Murphy 5ef6a074e7 Merge pull request #315 from svengato/develop
Optionally specify a maximum circuit length in Hawick circuits algorithm
2023-05-08 11:57:33 +10:00
Sven Gato Redsun 2573812229 Add unit tests for max_length from 0 to 10 2023-05-04 07:43:58 -05:00
Jeremy W. Murphy b5fa4d9758 Merge pull request #337 from daankolthof/mas
Maximum Adjacency Search: refactor existing tests + create new tests
2023-05-01 09:22:10 +10:00
Daan Kolthof 12a57f9c01 Merge branch 'develop' into mas 2023-04-27 10:16:49 +01:00
Jeremy W. Murphy 985bfbd765 Merge pull request #336 from daankolthof/ubuntu_bionic_deprecation
Remove Ubuntu Bionic platform from GitHub workflows

Also, fix use of deprecated header for boost::timer::progress_display.
2023-04-27 14:21:45 +10:00
Daan Kolthof 634f5fb1dd Merge branch 'progress_hpp_deprecated' into ubuntu_bionic_deprecation 2023-04-25 11:43:05 +01:00
Daan Kolthof a981db8b1f Remove Ubuntu Bionic from ci.yml 2023-04-25 11:38:02 +01:00
Daan Kolthof a3001ec2e6 Merge branch 'progress_hpp_deprecated' into develop 2023-04-23 23:40:12 +01:00
Daan Kolthof 5308f29b6a Fix small coding errors 2023-04-23 21:35:27 +01:00
Daan Kolthof eb0ab8bd4b Fix deprecation of boost/progress.hpp 2023-04-23 19:00:57 +01:00
Daan Kolthof 0714892239 Fix mas_test compatibility issues with C++98, 0x, 03 2023-04-23 17:41:22 +01:00
Daan Kolthof 0fb5562d43 More mas_test unit tests + refactoring test helper functions 2023-04-21 22:51:37 +01:00
Daan Kolthof 088714f052 Change arity for d-ary-heaps in testing 2023-04-21 14:55:36 +01:00
Daan Kolthof 4d968a2972 Reorganise mas_test, add some simple new tests 2023-04-21 14:35:30 +01:00
Daan Kolthof 1cf87d5558 Cleanup based on static code analysis 2023-04-21 01:00:54 +01:00
Daan Kolthof b460995095 More small cleanups to mas_test 2023-04-21 00:47:39 +01:00
Daan Kolthof 2eea120320 Small cleanup on mas_test 2023-04-21 00:46:05 +01:00
Daan Kolthof 21a9c6588f Refactor existing tests 2023-04-21 00:40:27 +01:00
Jeremy W. Murphy aa0a4d3c93 Merge pull request #332 from ams2990/develop
Add missing break to switch
2023-03-29 10:20:17 +11:00
Andy Shulman e8e47eacbb Add missing break to switch 2023-03-27 23:02:01 -04:00
Marc Glisse 68ee7972df Don't look for representatives in link
The arguments are already required to be the representative of their
class. If we do not know the representatives, we are supposed to call
union_set instead, which first finds them.
2023-03-19 09:44:20 +01:00
Francois Kritzinger 04a213038c Don't include graphviz.hpp from graphml.hpp (#326) 2023-03-13 14:17:18 +02:00
Sven Gato Redsun d95b3d477d Modify unit tests to compare computed and expected number of cycles, and report any errors 2023-03-12 23:19:43 -06:00
Sven Gato Redsun 5a9e2aa794 Add unit tests for nonzero max_length 2023-03-09 21:29:38 -07:00
Sven Gato Redsun a07f3532ad Do not use 'const' with value parameters 2023-03-09 21:26:33 -07:00
Sven Gato Redsun e17d6f9ff8 Use snake case (max_length) for style consistency 2023-03-09 18:17:35 -07:00
Sven Gato Redsun b9509fd9a8 Enforce 80-column line limit 2023-03-09 18:09:25 -07:00
Jeremy W. Murphy 00028767d8 Merge pull request #324 from weenchvd/patch-1
Fix r_c_shortest_paths example
2023-02-15 15:33:08 +11:00
Jeremy W. Murphy 1cf05f2b3f Merge pull request #325 from ams2990/develop
Add missing include on boost/config.hpp
2023-02-15 15:25:09 +11:00
Andy Shulman b33c1eb37d Add missing include on boost/config.hpp
exception.hpp uses BOOST_SYMBOL_VISIBLE, which is defined in boost/config.hpp. Without this, compiling just exception.hpp is broken.
2023-02-09 19:00:19 -05:00
ꓪꓱꓱꓠꓛꓧ 5ccd0852b7 Fix r_c_shortest_paths example 2023-01-26 15:10:46 +03:00
Derek McBlane a3148837c2 fixed hyperlink for disjoint sets 2022-12-27 22:14:20 -05:00
Jeremy W. Murphy 231de4c573 Merge pull request #318 from hdu-sdlzx/develop
Don't run performance test in CI
2022-12-20 09:52:24 +11:00
l00574988 f58f3df2bf Don't run performance test in CI 2022-12-15 21:31:43 -05:00
Sven Gato Redsun 3f75ea7aa3 Optionally specify a maximum circuit length in Hawick circuits algorithm 2022-11-26 10:02:08 -07:00
Jeremy W. Murphy c9f515347b Merge pull request #314 from poelmanc/c++23-fix-add-parentheses
Fix compilation using C++23 by adding parentheses around comma operator inside square brackets
2022-11-23 11:54:47 +11:00
Conrad Poelman 6f1f605ac8 Add parentheses so compiles in C++23 mode
e.g. [a,b] -> [(a,b)] to avoid confusion with C++23 array subscript operator[]
2022-11-21 20:24:02 -05:00
Matt Pulver dd77077747 Silence maybe-uninitialized warning in adj_list_edge_iterator::operator++(). Resolves boostorg/graph#312. 2022-11-14 11:41:34 -05:00
Jeremy W. Murphy ed75fd3e03 Merge pull request #310 from sebrockm/fix-boykov-kolmogorov-all-defaults-overload
Add tests for the all defaults overload of `boykov_kolmogorov_max_flow`
2022-10-25 09:43:52 +11:00
Sebastian Brockmeyer a487ba019d Add a test for the all defaults overload with custom properties 2022-10-23 20:28:02 +02:00
Sebastian Brockmeyer e9852ef6a0 Add test for the all defaults overload with interior properties 2022-10-23 20:27:23 +02:00
Jeremy W. Murphy a649be53bd Merge pull request #305 from boostorg/develop
Merge develop into master for 1.80.0 release
2022-07-27 09:55:56 +10:00
Jeremy W. Murphy 2862644154 Merge pull request #304 from sebrockm/fix-max-flows
Fix named parameter overload of `boykov_kolmogorov_max_flow`
2022-07-25 11:44:49 +10:00
Sebastian Brockmeyer f62a1839bd Fix return type of named paramter overload 2022-07-25 01:37:31 +02:00
Sebastian Brockmeyer 3600dbc226 add test for bk_max_flow with named bundled properties 2022-07-25 01:08:40 +02:00
Sebastian Brockmeyer 01020b0265 Use put instead of subscript operator in fill_random_max_flow_graph 2022-07-25 00:30:19 +02:00
Jeremy W. Murphy fcfc152f85 Merge pull request #303 from jesseli2002/docs_update
Clarify docs on what traversal category allowed
2022-07-20 09:32:57 +10:00
Jesse Li ea24532da5 Clarify docs on what traversal category allowed 2022-07-18 22:54:03 -07:00
Jeremy W. Murphy 944d9fc836 Merge pull request #302 from sebrockm/fix-conversion-warning
Fix conversion warning
2022-07-18 21:13:36 +10:00
Sebastian Brockmeyer 446dc15cf8 Remove redundant erase call 2022-07-17 21:23:08 +02:00
Sebastian Brockmeyer 44632af1a9 Fix conversion warning 2022-07-17 21:20:40 +02:00
Jeremy W. Murphy 5f4ce096f8 Merge pull request #299 from boostorg/Xcode_CI
Disable old versions of Xcode in Drone config
2022-07-15 09:50:55 +10:00
Jeremy W. Murphy 393c31d148 Remove GCC 11 and 12 2022-07-15 09:48:45 +10:00
Jeremy W. Murphy 73149e556b Add GCC 11 and 12 from Beast 2022-07-13 15:06:45 +10:00
Jeremy W. Murphy 3b6d40011b Remove old versions of Xcode from Drone config 2022-07-13 13:58:47 +10:00
Jeremy W. Murphy 797530d23a Merge pull request #296 from sebrockm/fix_stoer_wagner
Fix Stoer Wagner
2022-07-12 16:02:26 +10:00
Sebastian Brockmeyer 2e4b9c461a Rollback implementation change of 393c072c18 2022-07-11 14:19:18 +02:00
Sebastian Brockmeyer 3b6825958a Fix link and expected result in regression test 2022-07-10 19:42:46 +02:00
etienneINSA fa6aa57529 add test for stoer_wagner 2022-07-10 19:30:49 +02:00
Jeremy W. Murphy 430f61f696 Merge pull request #290 from jeremy-murphy/windows_msvc_14_3
Add MSVC 14.3 to github CI

Not Drone CI like I mistakenly said in the original commit message.
2022-03-06 22:46:10 +11:00
Jeremy W. Murphy 51f7f20cb6 Add MSVC 14.3 to Drone CI
Using windows-2022 machine.
2022-03-06 21:39:50 +11:00
Jeremy W. Murphy 71fed2fda8 Merge pull request #264 from qbit86/feature/first-child
Resolves #261 by replacing child() with first_child()
2022-03-04 13:10:18 +11:00
Jeremy W. Murphy 76aed24add Merge pull request #265 from qbit86/feature/remove-combine
Resolves #260 by removing call to `combine`
2022-03-04 10:55:12 +11:00
John Maddock c583bfa197 Merge branch 'develop' 2022-02-22 12:13:51 +00:00
Jeremy W. Murphy fa3bd05312 Merge pull request #269 from cqc-alec/bugfix/issue_268
Revert commit change to `reindex_edge_list`

Specifically, this reverts 5dd748307c.
2022-02-21 11:43:28 +11:00
Alec Edgington 99d0414416 Merge branch 'develop' into bugfix/issue_268 2022-02-20 07:56:56 +00:00
Jeremy W. Murphy 31026c4a5a Merge pull request #289 from jeremy-murphy/fix-windows-CI
Change windows-latest to windows-2019
2022-02-20 12:32:44 +11:00
Jeremy W. Murphy 5f6e128c16 Change windows-latest to windows-2019 2022-02-20 07:09:17 +11:00
Alec Edgington 1e200701f8 Merge branch 'develop' into bugfix/issue_268 2022-02-04 08:50:16 +00:00
Jeremy W. Murphy 8543c8ad78 Merge pull request #279 from jeremy-murphy/gcc-10-ICE
Get a green CI build by removing builds and code that we can't support

In the long term someone may want to revisit the builds removed and reinstate them if the underlying problem can be fixed.
Boost.Concept_Check has to be made compatible with C++17 before we can resume using the broken features.
2022-02-03 15:10:41 +11:00
Jeremy W. Murphy f2e5ef1b40 Disable failing builds 2022-02-03 09:55:02 +11:00
Jeremy W. Murphy f6fc9c8157 Remove failing builds from Drone CI configuration 2022-01-30 06:39:52 +11:00
Alec Edgington 0486e91d1b Extend unit test to cover directed graphs as well and add a couple of checks. 2022-01-05 10:43:25 +00:00
Jeremy W. Murphy 0defbbc323 Merge pull request #277 from cvvergara/patch-1
Add pgRouting to Boost Graph Library Users
2022-01-04 12:58:12 +11:00
Jeremy W. Murphy b657cf3901 Disable use of AdaptableBinaryFunction
It uses deprecated (C++17) and removed (C++20) classes such as
std::binary_function. Fails to compile on msvc-14.2.
Temporarily disabling altogether for simplicity.
2021-12-12 22:10:45 +11:00
Jeremy W. Murphy 5ff3645af6 Remove g++-10 from CI because it has an ICE on Boost.Xpressive code. 2021-12-12 22:04:47 +11:00
Alec Edgington 84232b46c0 Add unit test. 2021-12-10 12:47:21 +00:00
Ashish Kumar b76ffc7f2a Typo fix in graph edge_coloring docs (#209) 2021-12-09 17:26:38 +11:00
Philip Allgaier 972bde3031 Fix minor doc typos (#270)
* Fix typo in incident doc

* Add missing closing bracket to random_spanning_tree doc
2021-12-09 17:22:10 +11:00
char-lie 8c76c8aa01 Fix #274: Typo in Boykov-Kolmogorov Max-Flow (#275)
Redundant letter `c` in a comment.
2021-12-09 17:19:11 +11:00
Vicky Vergara 4879e70593 Add pgRouting to Boost Graph Library Users
First of all, I want to congratulate you for the amazing job you are doing.

I am the main developer of pgRouting, and the project is part of the OSGeo
Foundation [2] community projects.

pgRouting extends the PostGIS / PostgreSQL geospatial database to provide
geospatial routing functionality.

I would like pgRouting [1] to be added on the list of
"Boost Graph Library Users"
The Boost license is on the projects repository [3] and we document when a
boost graph function is used for example in [4]

[1] https://pgrouting.org/
[2] https://www.osgeo.org
[3] https://github.com/pgRouting/pgrouting
[4] https://docs.pgrouting.org/latest/en/pgr_aStar.html
2021-11-12 09:49:11 -06:00
Alec Edgington 27202068ea Remove stray bracket. 2021-07-05 13:31:20 +01:00
John Maddock cea3ee8225 Merge branch 'develop' 2021-07-03 10:21:10 +01:00
Alec Edgington 6e1f68ef22 Partially revert commit 5dd748307c.
Revert change to `reindex_edge_list`.

See https://github.com/boostorg/graph/issues/268 .
2021-07-02 14:17:27 +01:00
jzmaddock af22c9bcde Merge pull request #267 from boostorg/feature/lightweight_test
Convert the few remaining tests to use the header-only Lightweight Test
2021-06-10 08:55:38 +01:00
Glen Fernandes 7a6ceb3cd2 Convert the few remaining tests to use the header only Lightweight Test 2021-06-09 22:40:16 -04:00
Peter Dimov 2bc8d0490e Do not define BOOST_GRAPH_SOURCE in CMakeLists.txt 2021-06-09 19:06:17 +03:00
Peter Dimov 5bb73cd899 Add CMakeLists.txt 2021-06-09 19:06:00 +03:00
Peter Dimov 6bae630c38 Do not define BOOST_GRAPH_SOURCE in CMakeLists.txt 2021-06-09 18:45:39 +03:00
Viktor T bb4fbd6494 Resolves #260 by removing call to combine from astar_search_no_init_tree 2021-06-04 00:01:17 +03:00
Viktor T 64aa4a822a Resolves #261 by replacing child() with first_child() 2021-06-03 02:14:43 +03:00
jzmaddock d865589d62 As with other repro's, clang-9 on github is broken. 2021-05-31 12:01:41 +01:00
jzmaddock 03318bfb5f Fix #include errors and one GCC-ism in relaxed_heap.hpp. 2021-05-31 09:50:52 +01:00
Peter Dimov 97f51d8180 Add CMakeLists.txt 2021-05-29 20:34:01 +03:00
jzmaddock 35d3e15a47 Merge pull request #255 from boostorg/pr190_integration
Integration testing for PR190
2021-04-21 19:23:47 +01:00
jzmaddock c2c341c12d Merge pull request #254 from boostorg/pr234_integrate
Run PR234 through new CI
2021-04-21 11:59:23 +01:00
jzmaddock 685f9e091a Merge pull request #253 from boostorg/pr217_integrate
Integration CI test for PR217
2021-04-21 11:59:07 +01:00
jzmaddock 2247005473 Remove XCode testing workarounds, to see if PR190 fixes them.
Fixes: https://github.com/boostorg/graph/issues/251
2021-04-20 19:18:50 +01:00
John Maddock 1fd5fc12a4 Merge branch 'issue_175' of https://github.com/bkpoon/graph into pr190_integration 2021-04-20 19:14:58 +01:00
jzmaddock 58b6f3640a Merge pull request #202 from jwakely/patch-2
Prevent fallthrough when assertions are not fatal
2021-04-20 19:11:58 +01:00
jzmaddock 63135f59b5 Merge pull request #219 from vadi2/patch-1
Remove extra closing bracket
2021-04-20 19:10:55 +01:00
John Maddock 0c38817632 Merge branch 'develop' of https://github.com/jcelerier/graph into pr234_integrate 2021-04-20 18:59:31 +01:00
jzmaddock 5842a766b6 Merge pull request #236 from Myles1/fix-links
fix graph library user manual links
2021-04-20 18:57:38 +01:00
John Maddock 5f1bbdb941 Merge branch 'use-boost-override' of https://github.com/EugeneZelenko/graph into pr217_integrate 2021-04-20 18:54:20 +01:00
jzmaddock 9b425a037c Merge pull request #191 from valiko-ua/develop
Fixed HTML and other errors in doc/graph_theory_review.html
2021-04-20 10:47:28 +01:00
jzmaddock 2bcd634112 Merge pull request #210 from jaredkhan/patch-1
Fix minor typo in AdjacencyGraph docs
2021-04-20 10:45:22 +01:00
jzmaddock 7cccda8854 Merge pull request #241 from eldiener/develop
[skip ci] Add "cxxstd" json field
2021-04-20 10:42:56 +01:00
jzmaddock f4aa9658fe Update build badges. 2021-04-20 10:41:22 +01:00
jzmaddock b3751605e4 Merge pull request #250 from boostorg/update_ci
Update CI.
2021-04-19 17:53:20 +01:00
jzmaddock d63a380343 Add missing #define to drone config. 2021-04-19 15:31:11 +01:00
jzmaddock 46702c45ac More clang versions have broken std lib headers. 2021-04-19 08:43:19 +01:00
jzmaddock 487459712b Change version number to which issue 251 applies. 2021-04-19 08:42:13 +01:00
jzmaddock cb342d159b Correct various CI issues. 2021-04-18 19:12:40 +01:00
jzmaddock b05b379492 Correct CI script and Jamfile. 2021-04-18 10:04:21 +01:00
jzmaddock 099f965f24 Correct path to tests. 2021-04-17 18:43:44 +01:00
jzmaddock d4160d52ba More CI fixes. 2021-04-17 18:38:43 +01:00
jzmaddock 50e9e7a692 Correct CI scripts. 2021-04-17 16:44:40 +01:00
jzmaddock d2ae80b7db Update drone files. 2021-04-17 12:46:04 +01:00
jzmaddock 0cfb1b8895 Update CI. 2021-04-17 12:01:26 +01:00
Edward Diener 493e7b53a5 [skip ci] Add "cxxstd" json field. The "cxxstd" json field is being added to each Boost library's meta json information for libraries in order to specify the minumum C++ standard compilation level. The value of this field matches one of the values for 'cxxstd' in Boost.Build. The purpose of doing this is to provide information for the Boost website documentation for each library which will specify the minimum C++ standard compilation that an end-user must employ in order to use the particular library. This will aid end-users who want to know if they can successfully use a Boost library based on their C++ compiler's compilation level, without having to search the library's documentation to find this out. 2021-01-19 22:42:35 -05:00
Myles1 f0c469b8e6 fix graph library user manual links 2020-12-21 18:39:49 -08:00
Jean-Michaël Celerier bbc499708c Fix compilation on C++20 mode
MSVC standard library has removed std::not1, thus use the C++17 alternative if available
2020-12-14 12:08:04 +01:00
jzmaddock e4e12158e7 Merge pull request #218 from Lastique/fix_deprecated_headers
Fix usage of deprecated headers boost/bind.hpp and boost/detail/iterator.hpp
2020-11-02 15:39:05 +00:00
Peter Dimov 0c9dbd7808 Merge branch 'master' into develop 2020-11-01 16:20:07 +02:00
Peter Dimov 83646b1913 Merge pull request #215 from eldiener/develop
Changes for Embarcadero C++ clang-based compilers, targeting Boost 1.74
2020-08-24 14:08:17 +03:00
Vadim Peretokin 56ce18a75d Remove extra closing bracket 2020-05-24 10:13:30 +02:00
Andrey Semashev 1b2c9d8d3f Update usage of deprecated header boost/bind.hpp, add missing includes.
boost/bind.hpp generates compiler warnings about deprecation of placeholders
in the global namespace. Updated to include boost/bind/bind.hpp and
using namespace boost::placeholders;

Also added a few missing includes.
2020-05-11 20:11:06 +03:00
Andrey Semashev f364ee7be2 Removed usage of deprecated header boost/detail/iterator.hpp.
The header was deprecated in favor of <iterator>. It generates compiler
warnings and will be removed in a future release.
2020-05-11 19:59:23 +03:00
Eugene Zelenko 910445584a Use BOOST_OVERRIDE to fix GCC -Wsuggest-override and Clang-tidy modernize-use-override warnings.
Also fix CLang extra-semi, Clang-tidy modernize-deprecated-headers and readability-container-size-empty warnings.
Alphabetical order of C++ headers.
2020-05-09 15:05:13 -07:00
Edward Diener 4149230e27 Corrected fix. 2020-04-08 19:08:47 -04:00
Edward Diener 7f77c3563b Include ctime and use std::time function. 2020-04-03 12:11:43 -04:00
Edward Diener 14c2bf17b4 Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers. 2020-03-31 08:36:03 -04:00
Jared Khan ecbd271eb1 Fix minor typo in AdjacencyGraph docs 2020-03-17 16:31:08 +00:00
Jan-Grimo Sobez e5f9471984 Isomorphism: Ignore vertex_max_invariant
Isomorphism: Ignore vertex_max_invariant
- vertex_max_invariant and invariant2.max() are misnomers since what is
  expected is an upper exclusive bound on the possible invariant values,
  not their maximum value.
- The parameter can be ignored and the upper exclusive bound found
  cheaply at the start of test_isomorphism
- Removes the additional requirement of a nullary max member function on
  invariant2
2020-02-16 11:21:45 +01:00
Jan-Grimo Sobez 70d7fca2ce Isomorphism docs: AdaptableUnaryFn, null vertices
Isomorphism docs
- The expected concept for invariant functors is AdaptableUnaryFunction,
  not UnaryFunction
- Null vertices can appear in the isomorphism map output if both graphs
  contain disconnected vertices, add a note to that parameter's
  documentation
2020-02-16 11:12:30 +01:00
jzmaddock ca17604dca Update readme with correct bug reporting locations, plus CI badges. 2020-02-09 19:48:38 +00:00
Jonathan Wakely 274a05f630 Prevent fallthrough when assertions are not fatal
When BOOST_DISABLE_ASSERTS or BOOST_ENABLE_ASSERT_HANDLER is defined, the nested switch on `str[1]` can continue past the assert and will fallthrough to the `default` case below.

This can cause warnings with static analysis tools, and if a user-defined `boost::assertion_failed` function that doesn't terminate the process is being used, that function will be called twice because the first assertion falls through to the second.

Inserting a `break` avoids static analysis warnings and avoids potentially calling the assertion handler twice.
2020-01-31 14:48:21 +00:00
jzmaddock 554da2950e Merge pull request #196 from boostorg/develop
Merge develop to master
2020-01-11 13:26:54 +00:00
jzmaddock be1a8fdebc Make example reproducible for CI testing. 2020-01-07 18:23:16 +00:00
Glen Fernandes 2159a9ec62 Make all guard macros BOOST_GRAPH_ prefixed 2019-12-24 19:47:37 -05:00
Peter Dimov 99b9fd190a Merge branch 'master' into develop 2019-12-13 17:20:52 +02:00
Peter Dimov d26f6acc17 Merge commit 'b3f9fa1284702f756ecc6fb3ac8daebffb4f8774' 2019-12-13 17:18:42 +02:00
Peter Dimov dc7b450dea Merge commit 'a7896a7e974e453fdf6122981912c3ddd97f8c41' 2019-12-13 17:17:51 +02:00
Peter Dimov 27a28047d8 Merge branch 'master' into develop 2019-12-13 17:15:47 +02:00
Valentyn Shtronda 7c0a9d2998 One more correction of "Elementary Graph Theory" 2019-12-03 16:13:54 +02:00
Valentyn Shtronda c1803bbb4f Some vertices were omitted 2019-11-27 04:26:23 +02:00
Valentyn Shtronda 545428a4d0 Grammar/formatting 2019-11-27 04:25:30 +02:00
Valentyn Shtronda 53d0e93e43 Added missing parts.
Added parts that seems were lost long time ago during conversion to HTML.
2019-11-27 04:22:38 +02:00
Valentyn Shtronda 1eb8c16a76 Fixed HTML. 2019-11-27 04:17:17 +02:00
Billy K. Poon b9c3b14d39 Second file with forward iterator issue 2019-10-16 15:30:58 -07:00
Billy K. Poon 80b88a32e9 Use boost::first_max_element instead of std::max_element to avoid issue with forward iterator (#175) 2019-10-16 15:30:11 -07:00
jzmaddock ed8b0bb007 travis testing update #2. 2019-08-27 13:23:50 +01:00
jzmaddock 318920a132 travis update. 2019-08-27 09:09:47 +01:00
John Maddock c188da1fac Merge branch 'deprication-and-lint' of https://github.com/anadon/graph into pr171_2 2019-08-26 18:10:02 +01:00
jzmaddock fa6871ef4d Merge branch 'whitespace_and_formatting' of https://github.com/anadon/graph into pr171_2
Resolved Conflicts:
 include/boost/graph/one_bit_color_map.hpp
 include/boost/graph/two_bit_color_map.hpp
2019-08-26 18:09:24 +01:00
Glen Fernandes d3b157f465 Value initialize to not require fill() 2019-08-21 22:52:45 -04:00
jzmaddock 1134c88ee6 Merge pull request #173 from ffosilva/develop
adjacency_list: Fix example broken link
2019-07-14 09:01:08 +01:00
Fábio Silva daec2ee5e0 adjacency_list: Fix example broken link
- family-tree-eg.cpp -> family_tree.cpp
2019-06-09 22:17:43 -03:00
Josh Marshall b6ff20c1a5 Dusting off tests 2019-05-08 18:10:07 -04:00
Josh Marshall d497c3731c This appears to be the one whitespace character change needed to fix everything. 2019-05-05 20:21:47 -04:00
Josh Marshall 66d8827926 Changed clang-format settings from C++11 to C++03 to allow '>>' to '> >' for templates. 2019-05-03 15:37:47 -04:00
Josh Marshall 3fb1a64bd1 Shouldn't have modified the PDFs. 2019-05-02 16:37:09 -04:00
Josh Marshall 8747675e12 Applied clang-format and stripped all trailing whitespace. 2019-05-02 16:31:08 -04:00
jzmaddock b3f9fa1284 Fix links in docs moved from disjoint_sets. 2019-05-02 18:31:24 +01:00
jzmaddock a7896a7e97 Merge pull request #169 from jeking3/ingest-disjoint-sets
Relocate boostorg/disjoint_sets into graph
2019-05-02 18:22:50 +01:00
jzmaddock 8f5e1f1bf9 Merge pull request #164 from boostorg/develop
merge develop to master for release
2019-04-28 14:54:05 +01:00
James E. King III 0978691c1f Integrate boostorg/disjoint_sets into boostorg/graph 2019-04-26 14:42:58 -04:00
James E. King III 5c7e174ae1 Import files from boostorg/disjoint_sets 2019-04-26 14:42:58 -04:00
jzmaddock a2f6aa7317 Merge pull request #168 from tinko92/develop
Fix for a number of broken links.
2019-04-24 18:48:39 +01:00
Tinko Bartels d483524c83 Fix for a number of broken links. 2019-04-24 08:49:53 +02:00
jzmaddock 146f6f7b3d Merge pull request #165 from ahhz/dijkstra_uses_std_plus
Dijkstra uses std::plus
2019-04-17 17:18:30 +01:00
Alex Hagen-Zanker 3a388e5843 Dijkstra uses std::plus
This commit changes the relax function that dijkstra shortest paths uses to only update the distance and predecessor map of the target vertex of each edge. This has the benefit that from now on we can use std::plus as the default combine function.
2019-03-08 17:56:20 +00:00
John Maddock 887e63d34e Merge branch 'develop' of https://github.com/aleden/graph into develop 2019-01-26 09:31:03 +00:00
jzmaddock 15ffe0e5cf Remove comments from examples about them being broken - as they're now fixed. 2019-01-26 09:26:11 +00:00
jzmaddock e694fc7e9e Merge branch 'bucket_sorter' of https://github.com/deinst/graph into develop
Fixed Conflicts:
	example/Jamfile.v2
2019-01-26 09:05:44 +00:00
jzmaddock 338f917cfb Merge branch 'csr-example' of https://github.com/deinst/graph into develop
Fixed Conflicts:
	example/Jamfile.v2
2019-01-26 09:03:55 +00:00
jzmaddock 487347fc08 Add astar_maze.cpp back into the tests. 2019-01-26 08:39:43 +00:00
jzmaddock 36a395a14c Merge branch 'develop' of https://github.com/boostorg/graph into develop 2019-01-26 08:38:19 +00:00
jzmaddock a7a78f0df8 cycle_ratio_example.cpp: adjust tolerance on assert: otherwise we can get random failures. 2019-01-26 08:37:59 +00:00
jzmaddock 32bc0e1dff Modify astar_maze.cpp to not return a dangling reference from random_maze().
See discussion in https://github.com/boostorg/graph/issues/148.
2019-01-26 08:34:54 +00:00
jzmaddock c314b5518b Merge pull request #144 from boostorg/testing-fixup
Fix up tests and examples so that more are tested
2019-01-25 19:01:01 +00:00
jzmaddock 0310bbee74 Add maximum weighting matching to the table of contents. 2019-01-23 19:34:20 +00:00
jzmaddock ac0a340d0b maximum_weighted_matching: change initialization order to suppress GCC warnings. 2019-01-23 19:30:42 +00:00
John Maddock 4d45af8b80 Merge branch 'develop' of https://github.com/yi-ji/graph into develop 2019-01-23 17:40:05 +00:00
David Einstein 4e270bd62b Fix bucket_sorter example. Bug #151
Changed ID toidentity_property_map.
Added concept check to bucket_sorter.hpp.
Fixed minor grammar nits.
2019-01-22 14:25:42 -05:00
jzmaddock 1dfbbe2a16 Don't test adj_list_invalidation.cpp - it deliberately creates graphs in an invalid state which runtime-crash. 2019-01-22 19:18:08 +00:00
John Maddock 32087dd0b6 Merge branch 'develop' into testing-fixup 2019-01-22 19:03:28 +00:00
jzmaddock ee71134160 Merge pull request #154 from CromwellEnage/doc_stl_links
Documentation cleanup
2019-01-22 18:05:43 +00:00
jzmaddock a0d87b4467 Merge pull request #138 from CromwellEnage/min_degree_empty
Fix minimum_degree_ordering
2019-01-22 17:59:52 +00:00
CromwellEnage bf217327df Documentation cleanup
Replace links to Hewlett Packard's retired Silicon Graphics STL website.
2019-01-21 16:09:17 -05:00
Cromwell D. Enage aa7f76d79d Merge with boostorg/graph 2019-01-21 16:07:19 -05:00
David Einstein 002c56a108 Make csr-example compile
github bug #150 for boost/graph
Changed write_graphviz to write_graphviz_dp to handle dynamic properties
2019-01-20 20:52:52 -05:00
jzmaddock 12be045f8d Merge branch 'develop' into testing-fixup 2019-01-16 18:15:35 +00:00
jzmaddock 1324532d83 Merge pull request #152 from CromwellEnage/parameter_usage
Fix regressions & update .yml scripts
2019-01-16 18:13:54 +00:00
yi-ji 04f8155cbb [CI SKIP] update bibliography for max weighted matching labeling procedure 2018-12-23 01:32:23 +09:00
CromwellEnage d73f1d2a76 Fix regressions & update .yml scripts
<boost/graph/named_function_params.hpp>
* Original fix worked only when one boost::parameter::keyword was bound and passed in.  This fix now works when binding and passing in one or more boost::parameter::keyword objects.

<boost/graph/isomorphism.hpp>
* Make isomorphism_impl a metafunction that returns the function object result_type for the fix to work.

"test/isomorphism.cpp"
* Test the fix with two boost::parameter::keyword objects.

".travis.yml"
"appveyor.yml"
* Update as per Peter Dimov's message announcing the merging of CMake into boostorg/develop.
2018-12-19 23:32:51 -05:00
jzmaddock 32a83a7479 Add notes to examples that are outdated and either crash or do not compile. 2018-12-18 18:35:20 +00:00
jzmaddock e2851a6b8c Disable one more example which segfaults under VC12, correct file handling in graphviz.cpp. 2018-12-18 13:22:49 +00:00
jzmaddock cec1b39f43 Fix up paths to .dot files so they can be used in the tests. 2018-12-17 18:57:50 +00:00
jzmaddock 0048ae1b7e Remove reference to deleted file. 2018-12-16 20:12:07 +00:00
jzmaddock 972f3c49d0 Fix examples that don't build and/or run, rationalize Jamfile.v2 to place them all in alphabetical order, run those that can be run, and document those that are terminally broken. 2018-12-16 18:53:35 +00:00
jzmaddock 40f15af259 Add more untested files to Jamfile.v2. 2018-12-16 10:33:57 +00:00
jzmaddock 0157743b8e Add filter_graph_vp_test.cpp to Jamfile.v2. 2018-12-16 10:19:48 +00:00
jzmaddock 31375672d7 Include csr_graph_test.cpp in Jamfile.v2 2018-12-16 10:17:23 +00:00
jzmaddock 977560b917 Remove adj_list_test.cpp as it could never be portably run, replace with updated version of graph_type.hpp which tests all the same permutations that adj_list_test.cpp was intended to handle. Update Jamfile.v2 to run all the permutations. 2018-12-16 10:10:04 +00:00
CromwellEnage 1b177b75a8 Consolidate variable declaration & definition 2018-12-16 01:19:35 -05:00
jzmaddock 44663dd46f Suppress msvc warnings, add adj_list_invalidation.cpp to tests and fix buggy #include. 2018-12-15 18:34:41 +00:00
CromwellEnage 48af7e0237 Merge branch 'min_degree_empty' of https://github.com/CromwellEnage/graph into min_degree_empty 2018-12-15 11:34:41 -05:00
Cromwell D. Enage 833589ebdf Merge with boostorg/graph 2018-12-15 11:30:23 -05:00
jzmaddock 174ed2ed11 Merge pull request #137 from CromwellEnage/parameter_usage
Fix compiler errors
2018-12-15 15:50:00 +00:00
CromwellEnage f234920446 Merge branch 'parameter_usage' into min_degree_empty 2018-12-14 12:20:59 -05:00
CromwellEnage 8a2381f9c2 Fix memory access violations
Algorithms affected: astar_search and random_spanning_tree
2018-12-14 12:20:12 -05:00
CromwellEnage d81e8612d3 Fix memory access violations
Algorithms affected: boyer_myrvold_planar_test, maximum_adjacency_search, stoer_wagner_min_cut
2018-12-13 15:25:05 -05:00
CromwellEnage 0201705aa3 Fix memory access violations in boyer_myrvold_planar_test 2018-12-12 17:59:01 -05:00
CromwellEnage cb8e9738b6 Merge branch 'parameter_usage' into min_degree_empty 2018-12-11 22:47:55 -05:00
CromwellEnage 9aff046cb5 Split jobs
Reduce chances of timeout errors.
2018-12-11 22:47:30 -05:00
Anthony Eden f2bd3d1be7 couldn't infer unused template argument 2018-12-11 15:10:09 -05:00
CromwellEnage ec34a721b3 Merge branch 'parameter_usage' into min_degree_empty 2018-12-11 14:04:59 -05:00
CromwellEnage 91291eab78 Revert unnecessary changes & update test suite
<boost/graph/named_function_params.hpp>
* Revert unnecessary changes.

"test/Jamfile.v2"
* Add alias statements to deal with xcode compile failures stemming from Boost.Filesystem.
* Mark regressions as expected.

"travis.yml"
* Remove xcode6.4 from test suite since Travis Cl deprecated it.
* Add xcode9.4.1 to test suite.
2018-12-11 13:58:52 -05:00
CromwellEnage df1d52790c Fix minimum_degree_ordering
Handle degenerate case where input graph contains no edges.
2018-11-23 01:18:28 -05:00
CromwellEnage 484ccb08c9 Revert unnecessary changes 2018-11-23 01:07:43 -05:00
CromwellEnage b3cefefb76 Revert unnecessary changes 2018-11-23 01:00:03 -05:00
CromwellEnage a62de4ae41 Revert unnecessary changes
<boost/pending/bucket_sorter.hpp>
"example/Jamfile.v2"
* Revert

"test/Jamfile.v2"
* Remove <preserve-target-tests>off
2018-11-23 00:58:30 -05:00
CromwellEnage 52978e2ac1 Fix test/Jamfile.v2
Mark msvc-14.0 failures as expected.
2018-11-21 02:17:57 -05:00
CromwellEnage 392b280fc7 Revert test suite
...but also remove "sudo: false" from .travis.yml because Travis Cl just deprecated it.  (See <https://blog.travis-ci.com/2018-10-04-combining-linux-infrastructures>.)
2018-11-20 16:38:51 -05:00
CromwellEnage 038fe2890a Fix test suite
Mark ICE failures as expected for correct test configurations.
2018-11-16 18:57:15 -05:00
CromwellEnage c1e69486d6 Update test suite
Mark ICE failures as expected.
2018-11-16 17:46:58 -05:00
CromwellEnage 6a46e45fee Fix compiler errors
<boost/pending/bucket_sorter.hpp>
* Work around OSX implementation of iterator copy constructor defined in private scope.

<boost/graph/named_function_params.hpp>
* Use typename add_const<remove_reference<typename T::value_type>::type>::type vice const typename T::value_type within boost::parameter::aux::tagged_argument type definition.
* Use boost::mpl::has_key vice boost::detail::parameter_exists.
* Add missing boost::graph::[function_name] overload defintion that takes in ArgumentPack as the last parameter.

"example/Jamfile.v2"
* Define BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY=0 where applicable to suppress generation of exponential boost::parameter::parameters::operator() overloads and prevent ICE failures.

"test/Jamfile.v2"
* Define BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY=0 where applicable to suppress generation of exponential boost::parameter::parameters::operator() overloads and prevent ICE failures.
2018-11-16 14:23:38 -05:00
yi-ji d05622a677 [CI SKIP] documentation for maximum weighted matching 2018-11-16 01:09:22 +09:00
jzmaddock f7dfafb5af Merge pull request #128 from ZaMaZaN4iK/develop
Fix typo in the documentation
2018-11-05 18:24:56 +00:00
Alexander Zaitsev 741bff6b7c Fix typo in the documentation 2018-11-05 00:52:48 +03:00
jzmaddock 023bca04f6 Merge pull request #121 from kenkangxgwe/develop
Fix the copy constructor of the subgraph.
2018-11-01 18:07:44 +00:00
jzmaddock c731e2a29c Split gcc-6 tests into 2 blocks to prevent timeouts. 2018-11-01 17:59:34 +00:00
yi-ji 4f937d1617 Name VERTEX_STATE to anonymous enum; change brute-force verification to pre-computed answers comparison 2018-10-24 22:35:26 +09:00
康小广 5d17aeb1ae Fix the copy constructor of the subgraph.
In the previous version, the children and their properties are not copied correctly.
Please see the test case.
2018-10-18 03:06:14 -04:00
jzmaddock fa7fe4d622 Merge pull request #115 from pavelkryukov/gcc8
Fix G++8 warnings: catch by reference and unused variables
2018-10-17 18:38:49 +01:00
jzmaddock b27d731c1e Merge pull request #83 from e-kwsm/exterior
fix comments about boost::detail::vector_matrix
2018-10-17 18:38:11 +01:00
jzmaddock 8f11f4b51f Merge branch 'develop' of https://github.com/boostorg/graph into develop 2018-10-15 13:36:57 +01:00
jzmaddock 8934754552 Reduce clang testing load as tests time out. 2018-10-15 13:36:43 +01:00
jzmaddock f30f9ca2b3 Merge pull request #101 from DanielaE/fix/no-iterator-inheritance
Inheriting std::iterator is deprecated in C++17
2018-10-15 08:34:53 +01:00
jzmaddock 6bfc5b5b79 Change fibonacci_heap.cpp to use <random> where possible - not all versions of std::shuffle work with Boost's rng's. 2018-10-15 08:33:54 +01:00
jzmaddock 8c7ea35cc8 Testing 4 std versions in one go takes too long - reduce to 2 or 3 at a time. 2018-10-15 08:23:22 +01:00
jzmaddock 9cc83d86d8 Merge branch 'develop' of https://github.com/boostorg/graph into develop
Resolved Conflicts:
	example/astar_maze.cpp
	example/gerdemann.cpp
2018-10-14 13:43:54 +01:00
jzmaddock d51ba76e20 Include examples in tests -
Fix C++17 build errors in examples.
Disable some examples that use Unix-ism's from building on other platforms.
2018-10-14 13:40:56 +01:00
jzmaddock 38b65d2afd Merge pull request #99 from pavelkryukov/patch-2
Remove deprecated std::unary_function and std::binary_function from examples
2018-10-14 08:47:59 +01:00
jzmaddock 948eb2455a Merge branch 'fix/replace-deprecated-allocator-members' of https://github.com/DanielaE/boost.graph into develop
Resolved Conflicts:
	include/boost/graph/r_c_shortest_paths.hpp
2018-10-14 08:45:04 +01:00
Peter Dimov bdccbcdde2 Merge pull request #120 from boostorg/pr/move-graph_test
Move graph_test.hpp to test/ to avoid a dependency on Boost.Test
2018-10-14 08:02:28 +03:00
yi-ji 650291caf6 remove decltype of anonymous enum; decrease test time 2018-10-14 10:09:46 +09:00
jzmaddock affdd15565 Merge pull request #94 from jedrezej/subgraph_docs_fix
Fix subgraph usage example in the documentation.
2018-10-13 08:38:58 +01:00
jzmaddock 462d4bbc9b Merge pull request #108 from mywtfmp3/fix-type-error-in-example
fix type error in grid graph example
2018-10-13 08:38:03 +01:00
jiyi 10242dd583 decrease test batch size to avoid travis-ci timeout 2018-10-13 16:34:17 +09:00
jiyi 71f544d41d O(n^3) maximum weighted matching 2018-10-13 13:10:23 +09:00
jiyi 79b32f5d6e some examples for maximum weighted matching 2018-10-13 13:10:23 +09:00
jiyi 5fd3b3d078 tests for maxmimum weighted matching using brute-force verifier 2018-10-13 13:10:23 +09:00
jiyi 400eed8f02 Maximum weighted matching of O(n^4) time complexity, with brute-force verifier 2018-10-13 13:10:23 +09:00
Pavel I. Kryukov 3d737c34af Fix G++8 warnings: catch by reference and unused variables 2018-10-12 23:11:07 +03:00
Peter Dimov 5809e70e60 Move graph_test.hpp to test/ to avoid a dependency on Boost.Test 2018-10-12 22:15:17 +03:00
jzmaddock 48aff2213e Merge pull request #107 from mywtfmp3/fix-typo
fix typos
2018-10-12 19:15:19 +01:00
jzmaddock 084e55f5d5 Merge pull request #109 from katrinleinweber/resolve-DOIs-securely
Hyperlink DOIs against preferred resolver
2018-10-12 18:41:29 +01:00
jzmaddock a01537012d Reinstate assert in subgraph.hpp.
Refer to discussion in https://github.com/boostorg/graph/pull/101
Original PR was https://github.com/boostorg/graph/pull/80.
2018-10-12 18:32:08 +01:00
jzmaddock b7c9394c22 Merge branch 'develop' of https://github.com/anadon/graph into develop
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2018-10-12 17:58:56 +01:00
Peter Dimov 1e2a8ccf03 Merge pull request #119 from boostorg/feature/mpi-include
Include graph_parallel headers through a BOOST_GRAPH_MPI_INCLUDE macro
2018-10-09 06:20:19 +03:00
Peter Dimov 0d56559460 Avoid including an mpi header in property_serialize.hpp 2018-10-08 01:34:25 +03:00
Jeremiah Willcock 6f9a4a9468 Changed property lookup code to simplify graph implementations (remove most special-casing of bundled properties), made CSR graph work with non-bundled properties (probably), split named parameter algorithms to not use property map code
[SVN r77549]
2018-10-08 01:34:25 +03:00
Jeremiah Willcock 0fcc4dd80e Fixed warnings
[SVN r57559]
2018-10-08 01:34:25 +03:00
Jeremiah Willcock 0a0b58c6bb Merged headers and source files (but not examples, tests, or docs) from Parallel BGL
[SVN r52300]
2018-10-08 01:34:25 +03:00
Douglas Gregor 785306781f Adjacency list serialization fixes, from David Keller
[SVN r36838]
2018-10-08 01:34:25 +03:00
Douglas Gregor dd85022178 boost/pending/property_serialize.hpp: - Moved serialization code here
boost/pending/property.hpp:
  - From here

boost/graph/adj_list_serialize.hpp:
  - Include the new property_serialization header

[SVN r32275]
2018-10-08 01:34:25 +03:00
Peter Dimov 5f1edca51c Include graph_parallel headers through a BOOST_GRAPH_MPI_INCLUDE macro to hide them from boostdep 2018-10-06 19:03:11 +03:00
Peter Dimov 6039d918eb Re-add g++-4.6 to Travis 2018-09-30 02:57:44 +03:00
Josh Marshall 183a67fdc4 Merge branch 'boostorg-develop' into develop 2018-09-29 19:45:29 -04:00
Josh Marshall d31aa184af Rebasing to new develop 2018-09-29 19:44:58 -04:00
Peter Dimov 878d6f6b22 Fix xcode configs (8.2, 8.1, 8.0 don't exist, were interpreted as default (9.4) 2018-09-29 18:26:26 +03:00
Peter Dimov a65f604d54 Deprecate relaxed_heap.hpp, do not test (fails on g++-8) 2018-09-29 17:20:25 +03:00
Peter Dimov 23b26724c2 Merge pull request #118 from apolukhin/antoshkka/visibility-issues
fix visibility of exceptions within Boost.Graph
2018-09-29 17:14:43 +03:00
jrmarsha 2e54007e75 Merge pull request #6 from apolukhin/antoshkka/visibility-issues
Antoshkka/visibility issues
2018-09-29 10:05:34 -04:00
Peter Dimov 80806fdfb7 Enable Travis testing of feature branches 2018-09-29 16:50:59 +03:00
Josh Marshall 5dd748307c Realized the while loop in reindex_edge_list(), and so changed this. 2018-09-28 09:47:26 -04:00
Josh Marshall 5d6c7f6695 Reverting a block comment removal at jzmaddock's request. 2018-09-25 09:59:16 -04:00
Antony Polukhin ab9299f9c6 fix visibility of exceptions within Boost.Graph 2018-09-25 11:05:31 +03:00
Josh Marshall 5d0f5a6b03 Clang had some helpful warnings about typename usage which were applied. 2018-09-22 22:03:15 -04:00
Josh Marshall 9cfddda9cf I don't recall messing with these to make them auto, but they were auto. I've still been unable to reproduce the TravisCI errors, but this should still bring this branch closer to merging. 2018-09-22 21:25:21 -04:00
Josh Marshall 21bdac5709 Silencing some build warnings about a trivial faux pas 2018-09-14 14:45:11 -04:00
Josh Marshall 6808062c07 First possible complete fixes for r_c_shortest_paths. 2018-09-11 17:00:43 -04:00
Josh Marshall a10f17eb99 Made typename fixes more broad and complete. 2018-09-11 17:00:05 -04:00
Josh Marshall 8551039ae3 Learned more of how typename works, changed to using that. 2018-09-08 03:02:13 -04:00
Josh Marshall 3cc890e854 Changing c++11 auto type usage to delctype() boilerplate in order to allow compatability with C++03. This has only been tested locally, and this is being uploaded to test aginst the automated test suite. 2018-09-07 00:03:57 -04:00
Josh Marshall 037af4db54 Fixing incorrect use of typedef's via macro. 2018-09-06 10:06:07 -04:00
Josh Marshall 82fa79e783 Inappropriate overuse of 'typename' removed. 2018-09-05 14:35:26 -04:00
Josh Marshall 283675d792 Use of nullptr when it is too soon to include that feature. 2018-09-05 14:33:43 -04:00
Pavel I. Kryukov 2f430a19e1 Remove deprecated code from examples
std::unary_function and std::binary_function were
removed in C++17 and are no longer available
while compiling with MS Visual Studio 2017
2018-09-02 14:05:50 +03:00
Josh Marshall 98164bf937 Removed dead code/comment block from iteration macros. 2018-09-01 17:59:02 -04:00
Josh Marshall 19c23ca255 Removing references and testing to relaxed heap; relaxed heap is now marked as depreciated. This is due to some testing failures and a lack of use of relaxed_heap. 2018-09-01 14:51:42 -04:00
jzmaddock 4aaf5307db CI: disable toolsets that fail for reasons unconnected to us.
[CI SKIP]
2018-09-01 13:05:23 +01:00
jzmaddock f36a7bab16 Touch travis.yml. 2018-09-01 09:39:12 +01:00
jzmaddock 458594d43a Add better Appveyor and Travis support. 2018-09-01 09:03:11 +01:00
Josh Marshall 84122c8049 Fixed an incorrect file name in tests and added a git ignore for generated testing files. 2018-08-31 23:53:45 -04:00
jrmarsha c0450496a8 Merge pull request #5 from anadon/fix-add-vertex-subgraph
Getting together PR's for first batch of merges.
2018-08-31 22:07:36 -04:00
jrmarsha 19dd94ee70 Merge pull request #4 from boostorg/develop
Updating development branch that I'm merging to.
2018-08-31 22:03:34 -04:00
jrmarsha e2f742d584 Merge pull request #2 from asomers/develop
Creating first batch merge for well formed bug fixes.
2018-08-31 21:58:43 -04:00
jrmarsha 03b6e8acd6 Merge pull request #3 from raahlb/fix_remove_vertex
Creating first batch of merges for well formed bug fixes.
2018-08-31 21:58:28 -04:00
jrmarsha a499be87cb Merge pull request #1 from pmateusz/develop
Creating first batch merge to bring in well formed bugfixing pull requests.
2018-08-31 21:58:08 -04:00
Rasmus Ahlberg e8d7c9fe9b Added test case for removing edges bug from previous commit. 2018-08-23 16:22:06 +02:00
Rasmus Ahlberg e2db737d1b Don't copy value if not needed, as source's m_property will be set to null when copied.
See https://svn.boost.org/trac10/ticket/13544.
2018-07-30 12:15:25 +02:00
Katrin Leinweber 94b4c662f8 Hyperlink DOIs against preferred resolver 2018-06-24 08:17:22 +02:00
John Zhang bcc8ed65b5 fix type error in grid graph example 2018-05-15 11:55:21 +08:00
John Zhang 30d0faa665 fix typos 2018-05-12 13:27:24 +08:00
Daniel James 815268534f Merge remote-tracking branch 'origin/develop' 2018-04-15 21:38:19 +01:00
Daniel James cb43ad3a45 Merge commit 'c48c80f51fca0cad8b654135a5940a5a33bbc571'
Everything up to this commit is already in master, apart from a minor
whitespace change.
2018-04-15 21:37:04 +01:00
Daniela Engert 32d5b35e2e Most members of std::allocate are deprecated in C++17
Replace them by their cousins from std::allocator_traits. Without that, heaps of deprecation warnings will fall onto humble users when compiling with MSVC 15 in C++17 mode.

Signed-off-by: Daniela Engert <dani@ngrt.de>
2018-04-14 18:14:41 +02:00
Daniela Engert 93cfa18f3d Inheriting std::iterator is deprecated in C++17
Boost's iterator.hpp is deprecated, too. Therefore get rid of all of that and replace inheritance by lifting std::iterator's members into the derived class.

Signed-off-by: Daniela Engert <dani@ngrt.de>
2018-04-14 18:11:05 +02:00
Daniel James 4c752ee2f1 Use std::mt19937 where available
In C++17 mode, libc++'s `std::shuffle` isn't compatible with Boost's random
generators because the `min` and `max` functions aren't `constexpr`, so use
`std::mt19937` instead. This might not be required if boostorg/random#24 is
accepted.
2018-04-13 15:43:38 +01:00
Daniel James e0b46b934e Merge pull request #102 from hlynurf/develop
Fix typos
2018-04-13 13:33:02 +01:00
Daniel James 1643881cac Merge pull request #98 from jwakely/patch-1
Fix typo
2018-04-13 13:29:15 +01:00
Daniel James 98899a640a Merge pull request #105 from danieljames/fix-argument-type
Remove reference from argument_type
2018-04-13 13:22:12 +01:00
Daniel James a651ecf6ab Merge pull request #85 from Flast/patch-1
Qualify calling of as_const.
2018-04-13 13:21:59 +01:00
Denis Davydov da6e2b5efb fix missing header (#104) 2018-04-04 00:22:47 +01:00
Daniel James 85b3f9746a Merge pull request #104 from davydden/fix_missing_header
fix missing header
2018-04-04 00:21:43 +01:00
Daniel James 50dcb5528d Remove reference from argument_type
The reference was added in pull request #89. It causes a regression of gcc 4.4
in C++98 mode.
2018-03-31 14:10:40 +01:00
Denis Davydov a5ff4ea80e fix missing header 2018-03-31 10:38:10 +02:00
Eric Niebler 2a9ef82c35 Merge pull request #103 from smeenai/develop
Fix friend declarations for iterator_core_access
2018-03-01 12:24:44 -08:00
Shoaib Meenai 07e902d8e7 Fix friend declarations for iterator_core_access
csr_out_edge_iterator and csr_in_edge_iterator are part of the
boost::detail namespace, so they need to explicitly qualify
iterator_core_access in their friend declarations. Note that
csr_edge_iterator already gets this correct.
2018-02-28 15:45:10 -08:00
hlynurf bbb74d5a71 Fix typos 2018-01-03 12:26:45 +00:00
Jonathan Wakely 58f550a361 Fix typo 2017-09-06 16:46:05 +01:00
Alan Somers 726e9530d6 Replace /bin/bash with /bin/sh
/bin/bash is a Linuxism.  /bin/sh is portable, and this script isn't
using any bash-specific features.
2017-07-27 14:34:07 -06:00
Jedrzej Solecki 2999dc735b Fix subgraph usage example in the documentation.
Make the docs match the example.
2017-07-13 09:33:52 -07:00
Mateusz Polnik 67a32c26b2 Fix read/writes outside allocated memory. Remove is_valid assertions - explain a scenario where they do not work correctly. 2017-07-04 23:26:54 +01:00
Mateusz Polnik faef224193 Reproduce memory issue with resource constrained shortest paths. Valgrind confirms reads/writes outside allocated memory. 2017-07-04 23:26:54 +01:00
Andreas Scherer 74115a2a1e Compile the SGB examples. (#87)
Works fine with c++11, thanks!

System: (K)Ubuntu 16.04 LTS
Compiler: g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609

Try to 'g++ -c' the four SGB examples girth.cpp, miles_span.cpp,
roget_components.cpp, and topo-sort-with-sgb.cpp.

(1) SGB 2002-01-30 changed the 'Associated Press scores' from 'ap0' and
'ap1' to 'ap'. This preprocessor macro (sic!) collides with numerous
function parameters in 'named_function_params.hpp'. '#undef'ining the
macro doesn't break the BGL examples.

(2) girth.cpp fails because of a missing 'null_vertex()' function.

(3) roget_components.cpp invokes 'strncmp()' from the C library.

(4) topo-sort-with-sgb.cpp hickups because of a missing 'vertices()'
function. Following roget_components.cpp and putting the collective
SGB header up front fixes this.
2017-05-26 18:00:45 -06:00
Nik Reiman eda383e91d Fix compiler error with release builds on VS2015 (#84)
When using MSVC compiler optimization, using param_not_found() causes
compiler error C4172: returning address of local variable or temporary
2017-05-26 15:34:07 -06:00
Daniela Engert 9886e3fef2 Conditionally replace deprecated/removed C++98 std::bind1st by std::bind, std::auto_ptr by std::unique_ptr, and std::random_shuffle by std::shuffle. (#89)
Signed-off-by: Daniela Engert <dani@ngrt.de>
2017-05-26 15:04:34 -06:00
Murray Cumming 9697b20826 astar_search: Remove unused variable. (#90)
To avoid a compiler warning.
2017-05-26 13:53:02 -06:00
Andreas Scherer 87bf61ced3 Fix typos. (#88)
* Fix typos.

A quick check with 'aspell -c -l en_US'.

* Fix some more typos.

* More typos fixed.
2017-05-26 13:45:40 -06:00
Kohei Takahashi a45e3de9b7 Qualify calling of as_const.
It is ambiguous with upcoming standardized `std::as_const`.
2017-02-04 13:27:07 +09:00
E Kawashima 9757b9e44c fix comments about boost::detail::vector_matrix 2016-11-07 21:36:55 +09:00
K. Noel Belcourt ac70119f9f Make example file names consistent. 2016-11-05 13:14:55 -06:00
K. Noel Belcourt bc21e6426e Rename files so easier to find expected output. 2016-11-05 13:13:27 -06:00
K. Noel Belcourt b6594e17e7 Fix typo. 2016-11-05 13:11:40 -06:00
K. Noel Belcourt c88a459d8c Use consistent naming convention for related files. 2016-11-05 13:11:40 -06:00
K. Noel Belcourt 00ad80ec84 Fix typename outside of template, use consistent naming convention
for source file and expected results file.
2016-11-05 12:37:30 -06:00
E Kawashima 7913228c9d Fix dead links (#79) 2016-11-03 11:29:42 -06:00
Jakob Lykke Andersen 45b600b665 VF2, fix assumption that index maps are default constructible. (#27) 2016-11-03 11:29:32 -06:00
K. Noel Belcourt 41dc6bc8ec Update meta data. 2016-11-03 11:29:17 -06:00
Murray Cumming 09914913d8 Remove any support for slist, which is a deprecated gcc extension. (#73)
We might want to add support for std::forward_list as a replacement
for slist.
2016-11-03 11:29:05 -06:00
K. Noel Belcourt 38c0346d50 Fix uninitialized variable. 2016-11-03 11:28:48 -06:00
K. Noel Belcourt d59e865d77 Remove unused typedef. 2016-11-03 11:28:38 -06:00
K. Noel Belcourt 06184c0bfe Fix a tautological compare warning with clang on mbp. 2016-11-03 11:28:28 -06:00
K. Noel Belcourt 15d1ce3c5b Add dependency on missing deprecated header <boost/detail/iterator.hpp>
This so all examples build correctly.  Will need to migrate the rest
of the code to use <boost/iterator/...>  instead.
2016-11-03 11:28:16 -06:00
K. Noel Belcourt 96e152f8e5 Remove unwanted side effect from add_edge call. 2016-11-03 11:28:03 -06:00
K. Noel Belcourt 10035bd207 Silence uninitialized variable warning. 2016-11-03 11:27:53 -06:00
K. Noel Belcourt d311ba1ccf Fix unused variable warning. 2016-11-03 11:27:41 -06:00
K. Noel Belcourt 3977e06d83 Fix duplicate quick_tour build target. 2016-11-03 11:27:31 -06:00
E Kawashima e758310566 Enable printing functions to use arbitary std::ostream and avoid flush (#71)
* print_in_edges
* print_graph_dispatch
* print_graph
* print_edges
* print_edges2
* print_vertices
2016-11-03 11:27:20 -06:00
E Kawashima 3b503707ad doc/subgraph.html: fix typo (#76) 2016-11-03 11:27:07 -06:00
akumta 03b9b5bdfd update for ticket #12526 (#77)
Thanks for the patch.
2016-11-03 11:26:55 -06:00
Matt Barr da0610c99b Add degree to reverse_graph (#78)
degree is required for BidirectionalGraphConcept.
Also adds the concept check to the reverse_graph unit test.
2016-11-03 11:26:41 -06:00
Maël Valais db5c1b317c Add Travis-ci as the continuous integration service for Boost.Graph (#63)
* Add travis-ci as CI for boostorg/graph repo.

I thought it would be a great idea to have the test running from a
"neutral entity" instead of having to checkout the pull request and
cd libs/graph/test && ../../../b2

I saw that many other boostorg submodules had their own CI system:
- compute relies on travis-ci
- geometry uses circleci

The major difference between circleci and travis-ci is the multi-threading supported by circleci. Both are free for open-source project (as of 2016/04/26). I chose travis-ci because I know how to configure it.

As for geometry, we could also use coveralls.io to display the test covering reports and improve the quality/coverage of tests on boostorg/graph.

IMPORTANT: a member of boostorg will have to add the repo boostorg/graph into travis-ci for it to work.

* csr_graph_test won't pass unless -std=c++11 is enabled

* Fixed gcc too old (4.6.3) using instead gcc-4.8 for -std=c++11
2016-11-03 11:26:29 -06:00
Murray Cumming 05a9ed31da Add a .clang-format file. (#68)
So we can at least make the examples use a more consistent code style.

Run clang-format like so:
$ clang-format -i *.cpp
and use git diff to see what has changed.

This will strip trailing whitespace too. You can ignore that by
using git diff -w
2016-11-03 11:26:19 -06:00
Murray Cumming c1ccf73891 example: Build all the examples (#64)
* examples: Sort the examples in the Jamfile.

This makes it easier to see which example files are even
mentioned in the build.

* examples: Build all examples.

To at least test that they build with the current API.

The newly-mentioned files here seem to be mostly (maybe all) the
BGL book examples that were added in 2001:
https://github.com/boostorg/graph/commit/5215e9b4f201bf4509a78abe89d16cb8f4199bbd
I would prefer to put these all in an examples/bgl_book subdirectory.

* Examples build: Comment out examples that cannot be expected to build.

For instance, because they depend on SBG or Stanford Graph.

* Examples: Add missing <iostream> includes.

* Examples: Comment out unused typedefs and variables.

* Examples: king_ordering: Adapt to newer API.

Specify the extra parameter for king_ordering().
The API was changed in 2005:
https://github.com/boostorg/graph/commit/4bc19a162166c025ba878cf77e959deab8cf1983
The test code was already correct:
https://github.com/imvu/boost/blob/master/libs/graph/test/king_ordering.cpp

* Examples: Some graphviz examples: Link to the library.

read_graphviz() is not header only.

* csr-example: Pass edge_are_sorted to constructor.

To use the new (well, in 2009) API:
https://github.com/boostorg/graph/commit/809904f268eb719e400fb20a4b62e17c45247066

* iteration_macros: Use BGL_FORALL_ADJ.

Not BGL_FORALL_ADJACENT(), which doesn't exist, because this was
changed in 2001:
https://github.com/boostorg/graph/commit/a0061ba07e8662561b362461c2d4347a5eb5f236

* examples: kevin-bacon2: Fix the build.

Include boost/serialization/string.hpp to fix this error:
kevin-bacon2.cpp:68:9:   required from here
../../../boost/serialization/access.hpp:116:9: error: ‘class std::__cxx11::basic_string<char>’ has no member named ‘serialize’

and link to the boost serialization library.

* examples: loop_dfs: Add a missing typename keyword.

* examples: accum-compile-times: Remove unused variables.

* Examples: Remove unused typedefs.

* examples: avoid warning about parentheses aronud &&.

* example: read_graphviz: Actually use status.

* Example: adj_list_ra_edgelist: Fix the build.

The [] syntax must have worked once but doesn't anymore.
This fixes the build but it is even more clearl now a stupid way to use
the edge iterator.

* Examples: Remove unused typedefs.

* Examples: Remove an unused variable.

* Example: iohb: A const correction.

Otherwise newer compilers complain about converting string literals
to char* when callig this function.

* Exmaples: iohb: Avoid security warning with fprintf().

* Examples: Actually use a variable.

* Examples: Comment out all Graphviz examples.

These use the now-non-existant GraphizGraph and GraphvizDigraph
types. Presumably these could be updated but it's not obvious how
to do that:
https://svn.boost.org/trac/boost/ticket/4762
2016-11-03 11:26:06 -06:00
Murray Cumming 281bb94e51 random.hpp: weighted_random_out_edge(): Add missing return. (#74)
This should avoid a compiler warning. For instance:
http://beta.boost.org/development/tests/develop/output/GLIS-homo-impi-graph-intel-linux-warnings.html#cycle_ratio_tests

Looks good, thanks.
2016-11-03 11:25:49 -06:00
E Kawashima c48c80f51f Fix dead links (#79) 2016-11-02 08:51:15 -06:00
Stefan Hammer f07d91397c [subgraph.hpp] add_vertex(u_global, g) on a subgraph does not recursively add to parent subgraphs 2016-11-02 11:02:39 +01:00
Jakob Lykke Andersen cf6e8efdf4 VF2, fix assumption that index maps are default constructible. (#27) 2016-10-31 20:10:23 -06:00
K. Noel Belcourt db0f694531 Update meta data. 2016-10-31 19:03:02 -06:00
Murray Cumming d4ae9d1e3f Remove any support for slist, which is a deprecated gcc extension. (#73)
We might want to add support for std::forward_list as a replacement
for slist.
2016-10-31 16:43:12 -06:00
K. Noel Belcourt f3939dcef2 Fix uninitialized variable. 2016-10-31 15:54:33 -06:00
K. Noel Belcourt af40fc7f8c Remove unused typedef. 2016-10-31 15:47:50 -06:00
K. Noel Belcourt 3d5d6b70f1 Fix a tautological compare warning with clang on mbp. 2016-10-31 15:44:42 -06:00
K. Noel Belcourt 2f18f795a2 Add dependency on missing deprecated header <boost/detail/iterator.hpp>
This so all examples build correctly.  Will need to migrate the rest
of the code to use <boost/iterator/...>  instead.
2016-10-31 15:41:30 -06:00
K. Noel Belcourt 10a5b5182f Remove unwanted side effect from add_edge call. 2016-10-31 15:36:34 -06:00
K. Noel Belcourt a915aa0ade Silence uninitialized variable warning. 2016-10-31 15:31:52 -06:00
K. Noel Belcourt 090527e0fd Fix unused variable warning. 2016-10-31 15:29:28 -06:00
K. Noel Belcourt d396eb771e Fix duplicate quick_tour build target. 2016-10-31 14:18:05 -06:00
E Kawashima b48a9cd5a4 Enable printing functions to use arbitary std::ostream and avoid flush (#71)
* print_in_edges
* print_graph_dispatch
* print_graph
* print_edges
* print_edges2
* print_vertices
2016-10-31 14:10:45 -06:00
E Kawashima 8b5d16c7b0 doc/subgraph.html: fix typo (#76) 2016-10-31 14:06:12 -06:00
akumta f5bc5e8504 update for ticket #12526 (#77)
Thanks for the patch.
2016-10-31 14:05:52 -06:00
Matt Barr 387bcb3d72 Add degree to reverse_graph (#78)
degree is required for BidirectionalGraphConcept.
Also adds the concept check to the reverse_graph unit test.
2016-10-31 14:03:54 -06:00
Maël Valais f3b89e9f19 Add Travis-ci as the continuous integration service for Boost.Graph (#63)
* Add travis-ci as CI for boostorg/graph repo.

I thought it would be a great idea to have the test running from a
"neutral entity" instead of having to checkout the pull request and
cd libs/graph/test && ../../../b2

I saw that many other boostorg submodules had their own CI system:
- compute relies on travis-ci
- geometry uses circleci

The major difference between circleci and travis-ci is the multi-threading supported by circleci. Both are free for open-source project (as of 2016/04/26). I chose travis-ci because I know how to configure it.

As for geometry, we could also use coveralls.io to display the test covering reports and improve the quality/coverage of tests on boostorg/graph.

IMPORTANT: a member of boostorg will have to add the repo boostorg/graph into travis-ci for it to work.

* csr_graph_test won't pass unless -std=c++11 is enabled

* Fixed gcc too old (4.6.3) using instead gcc-4.8 for -std=c++11
2016-10-31 13:22:40 -06:00
Murray Cumming 8dd8cd945e Add a .clang-format file. (#68)
So we can at least make the examples use a more consistent code style.

Run clang-format like so:
$ clang-format -i *.cpp
and use git diff to see what has changed.

This will strip trailing whitespace too. You can ignore that by
using git diff -w
2016-10-31 13:21:10 -06:00
Murray Cumming 8f15303620 example: Build all the examples (#64)
* examples: Sort the examples in the Jamfile.

This makes it easier to see which example files are even
mentioned in the build.

* examples: Build all examples.

To at least test that they build with the current API.

The newly-mentioned files here seem to be mostly (maybe all) the
BGL book examples that were added in 2001:
https://github.com/boostorg/graph/commit/5215e9b4f201bf4509a78abe89d16cb8f4199bbd
I would prefer to put these all in an examples/bgl_book subdirectory.

* Examples build: Comment out examples that cannot be expected to build.

For instance, because they depend on SBG or Stanford Graph.

* Examples: Add missing <iostream> includes.

* Examples: Comment out unused typedefs and variables.

* Examples: king_ordering: Adapt to newer API.

Specify the extra parameter for king_ordering().
The API was changed in 2005:
https://github.com/boostorg/graph/commit/4bc19a162166c025ba878cf77e959deab8cf1983
The test code was already correct:
https://github.com/imvu/boost/blob/master/libs/graph/test/king_ordering.cpp

* Examples: Some graphviz examples: Link to the library.

read_graphviz() is not header only.

* csr-example: Pass edge_are_sorted to constructor.

To use the new (well, in 2009) API:
https://github.com/boostorg/graph/commit/809904f268eb719e400fb20a4b62e17c45247066

* iteration_macros: Use BGL_FORALL_ADJ.

Not BGL_FORALL_ADJACENT(), which doesn't exist, because this was
changed in 2001:
https://github.com/boostorg/graph/commit/a0061ba07e8662561b362461c2d4347a5eb5f236

* examples: kevin-bacon2: Fix the build.

Include boost/serialization/string.hpp to fix this error:
kevin-bacon2.cpp:68:9:   required from here
../../../boost/serialization/access.hpp:116:9: error: ‘class std::__cxx11::basic_string<char>’ has no member named ‘serialize’

and link to the boost serialization library.

* examples: loop_dfs: Add a missing typename keyword.

* examples: accum-compile-times: Remove unused variables.

* Examples: Remove unused typedefs.

* examples: avoid warning about parentheses aronud &&.

* example: read_graphviz: Actually use status.

* Example: adj_list_ra_edgelist: Fix the build.

The [] syntax must have worked once but doesn't anymore.
This fixes the build but it is even more clearl now a stupid way to use
the edge iterator.

* Examples: Remove unused typedefs.

* Examples: Remove an unused variable.

* Example: iohb: A const correction.

Otherwise newer compilers complain about converting string literals
to char* when callig this function.

* Exmaples: iohb: Avoid security warning with fprintf().

* Examples: Actually use a variable.

* Examples: Comment out all Graphviz examples.

These use the now-non-existant GraphizGraph and GraphvizDigraph
types. Presumably these could be updated but it's not obvious how
to do that:
https://svn.boost.org/trac/boost/ticket/4762
2016-10-31 13:20:27 -06:00
K. Noel Belcourt 7cb9113a61 Disable csr_graph_test until can work through lack of c++11 support. 2016-10-31 11:02:17 -06:00
Murray Cumming 0d3be12b42 random.hpp: weighted_random_out_edge(): Add missing return. (#74)
This should avoid a compiler warning. For instance:
http://beta.boost.org/development/tests/develop/output/GLIS-homo-impi-graph-intel-linux-warnings.html#cycle_ratio_tests

Looks good, thanks.
2016-08-09 19:51:39 -06:00
K. Noel Belcourt 54589358a4 Disable csr_graph_test until can work through lack of c++11 support. 2016-07-24 13:41:26 -06:00
Murray Cumming 56d3e72155 bc_clustering: Remove an unused typedef. (#66)
Thanks.
2016-07-16 17:19:23 -06:00
Murray Cumming 7e54f9997d Make files not executable. (#69)
See https://github.com/boostorg/admin/issues/47
2016-07-16 17:19:11 -06:00
Nicholas Matteo 2796c0a147 Fix typos (#70)
Thanks!
2016-07-16 17:18:57 -06:00
Murray Cumming 2f8b0897aa bc_clustering: Remove an unused typedef. (#66)
Thanks.
2016-07-16 17:08:04 -06:00
Murray Cumming a9c0fa9495 Make files not executable. (#69)
See https://github.com/boostorg/admin/issues/47
2016-07-16 17:05:54 -06:00
Nicholas Matteo 2f257fa083 Fix typos (#70)
Thanks!
2016-07-16 17:04:30 -06:00
K. Noel Belcourt b50fe850a2 Apologies to whomever committed this patch, I was unable to locate
the original commit to cherry-pick so have picked this source up
from develop and committed to master.
2016-07-16 16:43:20 -06:00
K. Noel Belcourt 529934f827 Apologies to whomever contributed this patch, I lost the original
commit.  Pick this from develop as work towards moving master
towards develop for the next release.
2016-07-16 16:41:07 -06:00
K. Noel Belcourt caa8fd4568 Minor wordsmiting and formatting picked from develop. 2016-07-16 16:39:16 -06:00
K. Noel Belcourt c7a6fdc418 Fixes unused variable warnings, picked from develop. 2016-07-16 16:35:16 -06:00
Murray Cumming 0ce03767a8 Add a README.md file.
So people can see what the project even is when they reach the GitHub repository.
Also, even the documentation doesn't have an actual short description of what
BGL is.
And, without a direct link, it is very hard to find the list of open issues
on Boost's trac system.

With many improvements from Maël Valais:
https://github.com/murraycu/graph/pull/1
2016-07-16 16:19:11 -06:00
Murray Cumming 8321c79d20 tree_traits: Add include for boost::tie().
This lets examples/graph_as_tree compile.
2016-07-16 16:18:52 -06:00
Maël Valais 589584b4e4 Fix #11374 and #12038: issues with find_flow_cost(), bundled properties and named parameters (#61)
* trac 11374: find_flow_cost() not working with bundled properties.

When using bundled for Weight and Cost properties, find_flow_cost() coudln't work because the properties had been "hard coded" instead of using generic types.

Fixes https://svn.boost.org/trac/boost/ticket/11374

* trac 12038: max-flow algorithms not working with named parameters.

The named parameter "Capacity" was not working. I just had to reverse the order of get_param_type parameters.

Here are the max-flow algorithms that are curretly not working with the named parameter "Capacity":
- edmonds_karp_max_flow,
- push_relabel_max_flow,
- boykov_kolmogorov_max_flow.

Fixes https://svn.boost.org/trac/boost/ticket/12038

* trac 11374: find_flow_cost() not working with named parameters and bundled properties at the same time.

When using bundled properties as well as named parameters, there was an error.

What happened is that the "named parameters" version of find_flow_cost() was not using a generic return value, hence the error.

Also, the return value_type was using edge_capacity_value instead of edge_weight_value (which is the type of a flow cost).

I fixed it using the trick used for edmonds_karp_max_flow(): add `edge_weight_value` to named_function_params.hpp.

* Unit test find_flow_cost() with bundled properties & named params.

-> unit tests for trac 11374

I used the existing min_cost_max_flow_utils.hpp, but I had to make the graph of getSampleGraph() more generic.

In the first place, I wanted to make a compile-only test but I also made
the test runnable so we check that
- find_flow_cost works() correctly with bundled properties
- successive_shortest_path_nonnegative_weights() also works with bundled properties

To run this test, this is a bit painful...
I had to run the entire graph-related tests.
- I commented the other tests except for graph in ./status/Jamfile.v2
- in this same dir, I ran `../b2`

One issue though: csr_graph_test seems to be broken on my boost copy, I may have an issue with updating the submodules or something...

* Unit test edmond_karp_max_flow with named params & bundled properties.

-> unit tests for trac 12038

As the previous commit, I rely on min_cost_max_flow_utils.hpp.

And I also made a runnable test instead of a simple "compile-time" test.

* Indented with 2 spaces instead of tabs

Thanks for the patch!
2016-07-16 16:18:35 -06:00
Justin Viiret f0faaabca1 Make lengauer_tarjan_dominator_tree use indexMap (#49)
Pass the indexMap parameter through to the dominator_visitor and use it
instead of get(vertex_index, g). This allows this algorithm to be used
for graphs without a vertex_index property.

Addresses bug #11742.
2016-07-16 16:18:22 -06:00
K. Noel Belcourt 4b07d0b469 Eliminate unused variable, regularize formatting. 2016-07-16 16:17:54 -06:00
K. Noel Belcourt cdc7f4f75b Remove unused member variable. 2016-07-16 16:17:44 -06:00
K. Noel Belcourt 9249b640e4 Fix a stack variable bound to member reference, a concept
checking variable that was unused triggering a warning,
and a documentation typo.
2016-07-16 16:17:33 -06:00
coderakki c0756b5ebf Update kamada_kawai_spring_layout.hpp (#53) 2016-07-16 16:17:21 -06:00
Alexander Lauser a14f8df86c Fixed bug 10231 partly: If finish_edge was called, then now correctly. (#16)
This appears to be fixed, we may have to patch this to ensure there's no backward compatibility issues with older compilers.  Thanks for the bug report and patch.

The bug that it never gets called with the current construction remains.
2016-07-16 16:17:09 -06:00
K. Noel Belcourt 7f94230dca Revert "removed an unused function (#39)"
This reverts commit 655ce30eb3.
2016-07-16 16:16:59 -06:00
Mads Jensen ecf83843e7 removed an unused function (#39)
The C++ standard deprecates use of <stdio.h>, <stdlib.h> etc., and suggests using <cstdio>, <cstdlib> etc.

Some trailing whitespace removed in affected files because of a setting in my editor

dead code surrounded by #if 0 ... #endif removed
2016-07-16 16:16:42 -06:00
K. Noel Belcourt 13cea9c32b Fix unused variable warning. 2016-07-16 16:16:33 -06:00
K. Noel Belcourt 50cb642e94 Quiet an unused variable warning. 2016-07-16 16:16:23 -06:00
sehe c112afbbad Fix labeled_graph constructors (#58)
* Fix labeled_graph constructors

* Wraparound bug leads to out-of-bounds addressing. 

    Seems obvious that `> 0` was meant (seeing the comments). 
    Also, if `vertices_size_type` is unsigned - which it usually (always?) is - the loop condition was never false.

 * Finally, one constructor didn't properly initialize the graph property

* Copy vertex property on add_vertex

Tested with clang on El Capitan, thanks!
2016-07-16 16:16:09 -06:00
felix b1a4f32b1f use graph_traits to access *_category types of a Graph (#54)
Tested with El Capitan and clang-darwin, thanks!
2016-07-16 16:15:54 -06:00
Arne B f9e930f006 Fixes bug 10449 (#57)
Without this patch it is not possible to call the copy constructor of directed_graph
2016-07-16 16:15:36 -06:00
E Kawashima a4e6f4dd78 fix typo in document of subgraph (#62)
Thanks!
2016-07-16 16:15:20 -06:00
Jakob Lykke Andersen 753c88c484 Add missing check for 'degree' in BidirectionalGraphConcept. Fix the concept checking class in the documentation for BidirectionalGraphConcept. Implementation of missing 'degree' function for filtered_graph. (#29)
Thanks for the patch.
2016-07-16 16:15:09 -06:00
Jared Grubb fa7ef591c2 Fix Ticket #11133: Graph: using 'nil' as a local variable (#34)
Looks good, thanks.
2016-07-16 16:14:55 -06:00
Louis Dionne eec98072db [Doc] Fix broken link to article for hawick_circuits, and remove useless .md file (#50)
Also update copyright and add license information.

Thanks for the patch.
2016-07-16 16:14:38 -06:00
Jakob Lykke Andersen 48b63adf44 Doc: remove IncidenceGraph requirement from AdjacencyGraph. (#28)
Thanks for the fix, it's good to have to documentation reflect the actual code.
2016-07-16 16:14:16 -06:00
Daniel J. H b0214ec131 Fix some minor documentation annoyances (#51)
* Fix documentation about type alias edge_size_type -> edges_size_type

This replaces occurences of `edge_size_type` (sg.) in the documentation
with the actual `edges_size_type` (pl.) as it is named in the
implementation.

There is a graph implementation (Stanford graph) that has a type alias
of `edge_size_type` (sg.) --- I did not change that implementation, as
it would break backwards compatibility, and therefore I also did not
change its documentation.

* Fix documentation on push_relabel algorithm, defined in header: preflow_push -> push_relabel
2016-07-16 16:14:01 -06:00
Vladimir Prus ba0cf281c9 Add missing include of <list>.
Thanks to Amit Prakash Ambasta for the report.
2016-07-16 16:13:34 -06:00
Ola Nilsson b5171962bf Fix doc spelling 2016-07-16 16:12:09 -06:00
Ahmed Charles 5d8c6fd1d3 Match concept_def.hpp and concept_undef.hpp. 2016-07-16 16:11:55 -06:00
Mads Jensen 59aba774bc Typo in Misra name 2016-07-16 16:11:12 -06:00
Mads Jensen 0eabc7ceb5 documentation fix for "allow_parallel_edge-_tag" 2016-07-16 16:10:59 -06:00
Mads Jensen 8729cc8a7c no need for executable flag on source files 2016-07-16 16:10:30 -06:00
Akira Takahashi 5bfc793f06 breadth_first_search doc : fix figure number
BFS Figure number is 6.
2016-07-16 16:10:11 -06:00
Akira Takahashi b357a88ecd add_edge doc : fix minor mistake
s/member function/non-member function/
2016-07-16 16:09:53 -06:00
K. Noel Belcourt a089d3bc35 Fix uninitialized variable by setting to null_vertex.
Thanks to Lu Wang for reporting this.
2016-07-16 16:08:58 -06:00
K. Noel Belcourt 04c1c99051 Add new strong components test to Jamfile from Alex Lauser.
Remove long unused file.
2016-07-16 16:04:39 -06:00
K. Noel Belcourt d6b7a717db Add finish_edge test case from Alex Lauser.
This test demonstrates incorrect output in
the order edges are finished.  We're using
this test to both ensure finish_edge is
called, and that the output is incorrect.
Once we fix where the visitor is called,
this test will be changed to check for the
correct output.
2016-07-16 16:03:30 -06:00
K. Noel Belcourt b6d9a72999 Fix macro logic for gcc 5, thanks to Alex Lauser
for pointing this out.
2016-07-16 16:03:18 -06:00
Alexander Lauser 6f5964a6bd Cleaned up the strong-components test. 2016-07-16 16:02:59 -06:00
Alexander Lauser d155583ac2 Added test for Boost.Graph's strong_components.
Associated with Bug #10231 which causes the test to fail.
2016-07-16 16:02:31 -06:00
K. Noel Belcourt 6a2d45ae20 Condition TTI finish_edge on supported compilers.
If compiler doesn't support has_member_function for member
templates, use old TTI syntax to avoid compiler error.
Supported compilers are gcc 4.9 and newer, clang any platform,
and intel 12 and newer.
2016-07-16 16:02:12 -06:00
K. Noel Belcourt 0e1414f46e Fix type traits so finish_edge is called when defined.
Changed the usage of TTI so that finish_edge is actually
called when defined.  Also regularized the finish_edge
signature so E is passed by value and G by const ref.
2016-07-16 16:01:53 -06:00
K. Noel Belcourt 189c113f04 Add missing iostream header. 2016-07-16 16:01:30 -06:00
Jakob Lykke Andersen add3546f94 Update attribute delimiter for read_graphviz
Support semicolon and nothing as ending of attributes, in addition to comma. See http://graphviz.org/content/dot-language.
2016-07-16 16:01:11 -06:00
mikael 6416fecc90 Simplified the move and copy constructor and assignment to avoid the maintenance nightmare of trying to rely on default functions. 2016-07-16 16:00:51 -06:00
Lorenz Breidenbach 8ca2084c9d Add missing #include of boost/functional/hash.hpp 2016-07-16 16:00:20 -06:00
Josef Cibulka 5b84005bac Comparison of doubles in graphml_test.cpp in now done with some tolerance to rounding errors. 2016-07-16 15:59:44 -06:00
Josef Cibulka 6a33285342 Changed asserts to BOOST_CHECK in graphml_test.cpp 2016-07-16 15:59:19 -06:00
Josef Cibulka 379383b62a Added reading of graph properties from graphml. 2016-07-16 15:57:52 -06:00
Daniel James a5b6a097e6 Add metadata file. 2016-07-16 15:56:22 -06:00
Murray Cumming e24fe39546 Add a README.md file.
So people can see what the project even is when they reach the GitHub repository.
Also, even the documentation doesn't have an actual short description of what
BGL is.
And, without a direct link, it is very hard to find the list of open issues
on Boost's trac system.

With many improvements from Maël Valais:
https://github.com/murraycu/graph/pull/1
2016-07-14 18:13:57 +03:00
Murray Cumming e4aa48bc4b tree_traits: Add include for boost::tie().
This lets examples/graph_as_tree compile.
2016-07-14 18:10:16 +03:00
Marcel Raad 316445d7c9 Fix MSVC14 compile break
array_binary_tree_node::children_type::iterator pretends to be a bidirectional iterator but does not define operator--, which results in compile breaks with Visual C++ 2015.
2016-05-08 17:47:46 -06:00
Maël Valais 15872fe070 Fix #11374 and #12038: issues with find_flow_cost(), bundled properties and named parameters (#61)
* trac 11374: find_flow_cost() not working with bundled properties.

When using bundled for Weight and Cost properties, find_flow_cost() coudln't work because the properties had been "hard coded" instead of using generic types.

Fixes https://svn.boost.org/trac/boost/ticket/11374

* trac 12038: max-flow algorithms not working with named parameters.

The named parameter "Capacity" was not working. I just had to reverse the order of get_param_type parameters.

Here are the max-flow algorithms that are curretly not working with the named parameter "Capacity":
- edmonds_karp_max_flow,
- push_relabel_max_flow,
- boykov_kolmogorov_max_flow.

Fixes https://svn.boost.org/trac/boost/ticket/12038

* trac 11374: find_flow_cost() not working with named parameters and bundled properties at the same time.

When using bundled properties as well as named parameters, there was an error.

What happened is that the "named parameters" version of find_flow_cost() was not using a generic return value, hence the error.

Also, the return value_type was using edge_capacity_value instead of edge_weight_value (which is the type of a flow cost).

I fixed it using the trick used for edmonds_karp_max_flow(): add `edge_weight_value` to named_function_params.hpp.

* Unit test find_flow_cost() with bundled properties & named params.

-> unit tests for trac 11374

I used the existing min_cost_max_flow_utils.hpp, but I had to make the graph of getSampleGraph() more generic.

In the first place, I wanted to make a compile-only test but I also made
the test runnable so we check that
- find_flow_cost works() correctly with bundled properties
- successive_shortest_path_nonnegative_weights() also works with bundled properties

To run this test, this is a bit painful...
I had to run the entire graph-related tests.
- I commented the other tests except for graph in ./status/Jamfile.v2
- in this same dir, I ran `../b2`

One issue though: csr_graph_test seems to be broken on my boost copy, I may have an issue with updating the submodules or something...

* Unit test edmond_karp_max_flow with named params & bundled properties.

-> unit tests for trac 12038

As the previous commit, I rely on min_cost_max_flow_utils.hpp.

And I also made a runnable test instead of a simple "compile-time" test.

* Indented with 2 spaces instead of tabs

Thanks for the patch!
2016-05-02 11:11:23 -06:00
Justin Viiret 976e524b59 Make lengauer_tarjan_dominator_tree use indexMap (#49)
Pass the indexMap parameter through to the dominator_visitor and use it
instead of get(vertex_index, g). This allows this algorithm to be used
for graphs without a vertex_index property.

Addresses bug #11742.
2016-05-01 17:52:37 -06:00
K. Noel Belcourt ded3042cd2 Eliminate unused variable, regularize formatting. 2016-05-01 16:17:47 -06:00
K. Noel Belcourt 677ba4b1e6 Remove unused member variable. 2016-05-01 16:14:28 -06:00
K. Noel Belcourt 400e8b5904 Fix a stack variable bound to member reference, a concept
checking variable that was unused triggering a warning,
and a documentation typo.
2016-05-01 16:06:24 -06:00
coderakki 06f304656c Update kamada_kawai_spring_layout.hpp (#53) 2016-05-01 15:42:15 -06:00
Alexander Lauser ee8b7c377d Fixed bug 10231 partly: If finish_edge was called, then now correctly. (#16)
This appears to be fixed, we may have to patch this to ensure there's no backward compatibility issues with older compilers.  Thanks for the bug report and patch.

The bug that it never gets called with the current construction remains.
2016-05-01 14:00:19 -06:00
K. Noel Belcourt ed98931118 Fixes to clear graph and graph_parallel for 1.61 release. 2016-04-27 05:42:03 -06:00
K. Noel Belcourt 08453c109a Revert "removed an unused function (#39)"
This reverts commit 655ce30eb3.
2016-04-26 10:54:43 -06:00
Mads Jensen 655ce30eb3 removed an unused function (#39)
The C++ standard deprecates use of <stdio.h>, <stdlib.h> etc., and suggests using <cstdio>, <cstdlib> etc.

Some trailing whitespace removed in affected files because of a setting in my editor

dead code surrounded by #if 0 ... #endif removed
2016-04-24 10:26:25 -06:00
K. Noel Belcourt a61ae7153e Fix unused variable warning. 2016-04-23 22:25:57 -06:00
K. Noel Belcourt 6fc1f4a924 Quiet an unused variable warning. 2016-04-23 22:17:49 -06:00
sehe 73136fa215 Fix labeled_graph constructors (#58)
* Fix labeled_graph constructors

* Wraparound bug leads to out-of-bounds addressing. 

    Seems obvious that `> 0` was meant (seeing the comments). 
    Also, if `vertices_size_type` is unsigned - which it usually (always?) is - the loop condition was never false.

 * Finally, one constructor didn't properly initialize the graph property

* Copy vertex property on add_vertex

Tested with clang on El Capitan, thanks!
2016-04-23 20:08:52 -06:00
felix 89b694c3f5 use graph_traits to access *_category types of a Graph (#54)
Tested with El Capitan and clang-darwin, thanks!
2016-04-23 16:31:01 -06:00
Arne B b2526fbd16 Fixes bug 10449 (#57)
Without this patch it is not possible to call the copy constructor of directed_graph
2016-04-23 16:15:42 -06:00
E Kawashima 12737ab552 fix typo in document of subgraph (#62)
Thanks!
2016-04-23 16:13:49 -06:00
Jakob Lykke Andersen 50bfd8dad0 Add missing check for 'degree' in BidirectionalGraphConcept. Fix the concept checking class in the documentation for BidirectionalGraphConcept. Implementation of missing 'degree' function for filtered_graph. (#29)
Thanks for the patch.
2016-04-23 12:27:51 -06:00
Jared Grubb 06f9e27fdf Fix Ticket #11133: Graph: using 'nil' as a local variable (#34)
Looks good, thanks.
2016-04-22 12:14:16 -06:00
Louis Dionne d84651c9ad [Doc] Fix broken link to article for hawick_circuits, and remove useless .md file (#50)
Also update copyright and add license information.

Thanks for the patch.
2016-04-21 20:41:16 -06:00
Jakob Lykke Andersen 05dc4222ee Doc: remove IncidenceGraph requirement from AdjacencyGraph. (#28)
Thanks for the fix, it's good to have to documentation reflect the actual code.
2016-04-21 20:37:31 -06:00
Daniel J. H d69fcd93c5 Fix some minor documentation annoyances (#51)
* Fix documentation about type alias edge_size_type -> edges_size_type

This replaces occurences of `edge_size_type` (sg.) in the documentation
with the actual `edges_size_type` (pl.) as it is named in the
implementation.

There is a graph implementation (Stanford graph) that has a type alias
of `edge_size_type` (sg.) --- I did not change that implementation, as
it would break backwards compatibility, and therefore I also did not
change its documentation.

* Fix documentation on push_relabel algorithm, defined in header: preflow_push -> push_relabel
2016-04-21 20:12:22 -06:00
Noel Belcourt 702c1110ad Merge pull request #44 from silolis/silolis-doc-patch-1
Fix doc spelling
2016-04-21 20:09:59 -06:00
Vladimir Prus 6197b9c549 Add missing include of <list>.
Thanks to Amit Prakash Ambasta for the report.
2015-12-07 13:55:07 +03:00
marcinz 8cad3dfa4b Merge pull request #42 from jzmaddock/patch-2
Remove depricated type_traits usage.
2015-10-23 09:11:18 -04:00
marcinz daa2e69db1 Merge pull request #46 from aschnell/patch-1
fixed typo
2015-10-23 08:50:19 -04:00
Arvin Schnell 6a559d3b73 coding style 2015-10-23 14:25:08 +02:00
Arvin Schnell b31f6de077 fixed typo 2015-10-23 14:15:57 +02:00
jzmaddock 1d5f43d9f6 Remove depricated type_traits usage. 2015-07-21 18:54:48 +01:00
Noel Belcourt 7c95f6ebcd Merge pull request #26 from faithandbrave/patch-3
breadth_first_search doc : fix figure number
2015-07-21 11:00:27 -06:00
Noel Belcourt 3921923880 Merge pull request #25 from faithandbrave/patch-2
add_edge doc : fix minor mistake
2015-07-21 11:00:06 -06:00
Ola Nilsson 66f5121309 Fix doc spelling 2015-07-09 11:32:04 +02:00
Ahmed Charles dfe2156c16 Match concept_def.hpp and concept_undef.hpp. 2015-05-21 10:37:26 +03:00
Noel Belcourt 7492a04210 Merge pull request #37 from atombrella/master
no need for executable flag on source files
2015-05-18 11:30:29 -06:00
Noel Belcourt 60fcab11ca Merge pull request #36 from atombrella/doc_fix
Doc fix
2015-05-16 13:36:58 -06:00
Noel Belcourt 4aa40f807a Merge pull request #33 from MarcelRaad/patch-1
Fix MSVC14 compile break
2015-05-14 19:43:03 -06:00
Mads Jensen 3c25ef6717 Typo in Misra name 2015-05-12 20:45:09 +02:00
Mads Jensen c0b8ef85fb documentation fix for "allow_parallel_edge-_tag" 2015-05-12 11:10:30 +02:00
Marcel Raad 0fc1749bd7 Fix MSVC14 compile break
array_binary_tree_node::children_type::iterator pretends to be a bidirectional iterator but does not define operator--, which results in compile breaks with Visual C++ 2015.
2015-03-02 18:47:19 +01:00
Mads Jensen b326f2cdb6 no need for executable flag on source files 2015-01-31 23:00:53 +01:00
Akira Takahashi 69db10b6ef breadth_first_search doc : fix figure number
BFS Figure number is 6.
2014-12-16 15:11:59 +09:00
Akira Takahashi 56a9c5e5c3 add_edge doc : fix minor mistake
s/member function/non-member function/
2014-12-11 17:40:18 +09:00
K. Noel Belcourt 2573fbb9f0 Fix warning on const return by value. 2014-11-20 12:17:23 -07:00
K. Noel Belcourt ffb6218f07 Fix uninitialized variable by setting to null_vertex.
Thanks to Lu Wang for reporting this.
2014-11-18 20:14:26 -07:00
Noel Belcourt 8c7c546942 Merge pull request #22 from mikael-s-persson/bugfix/ticket-10382-simplified-edge-move-copy
Simplified the stored-edge move and copy
2014-11-16 15:33:46 -07:00
K. Noel Belcourt 9d35801154 Add new strong components test to Jamfile from Alex Lauser.
Remove long unused file.
2014-11-11 21:02:19 -07:00
Noel Belcourt efa9fbd904 Merge pull request #15 from gatlex/bugfix/ticket-10222-root-map-broken
Fixed bug 10222.

I'll go ahead and add the test to the Jamfile, thanks for the test.
2014-11-11 20:57:50 -07:00
K. Noel Belcourt 713ee03efc Add finish_edge test case from Alex Lauser.
This test demonstrates incorrect output in
the order edges are finished.  We're using
this test to both ensure finish_edge is
called, and that the output is incorrect.
Once we fix where the visitor is called,
this test will be changed to check for the
correct output.
2014-11-11 12:37:56 -07:00
K. Noel Belcourt 441edc8e1c Fix macro logic for gcc 5, thanks to Alex Lauser
for pointing this out.
2014-11-11 12:18:44 -07:00
Alexander Lauser 9cd237093c Cleaned up the strong-components test. 2014-11-11 11:09:39 +01:00
Alexander Lauser 221ac5d6f0 Added test for Boost.Graph's strong_components.
Associated with Bug #10231 which causes the test to fail.
2014-11-11 10:49:47 +01:00
K. Noel Belcourt f13ec6fa32 Condition TTI finish_edge on supported compilers.
If compiler doesn't support has_member_function for member
templates, use old TTI syntax to avoid compiler error.
Supported compilers are gcc 4.9 and newer, clang any platform,
and intel 12 and newer.
2014-11-10 21:39:40 -07:00
K. Noel Belcourt 8ece8fac15 Fix type traits so finish_edge is called when defined.
Changed the usage of TTI so that finish_edge is actually
called when defined.  Also regularized the finish_edge
signature so E is passed by value and G by const ref.
2014-11-08 17:01:01 -07:00
K. Noel Belcourt 63dd92da72 Add missing iostream header. 2014-11-08 13:07:55 -07:00
Noel Belcourt eb9c64626c Merge pull request #23 from jakobandersen/develop
Update attribute delimiter for read_graphviz
2014-11-07 17:34:10 -07:00
Jakob Lykke Andersen 183a74d213 Update attribute delimiter for read_graphviz
Support semicolon and nothing as ending of attributes, in addition to comma. See http://graphviz.org/content/dot-language.
2014-11-08 01:27:35 +01:00
mikael 1740916e42 Simplified the move and copy constructor and assignment to avoid the maintenance nightmare of trying to rely on default functions. 2014-11-06 01:25:01 -05:00
Noel Belcourt aba24ae80a Merge pull request #19 from josefcibulka/changes
Added graph property support to read_graphml

Well, it turns out there's already Boost.Test dependencies in Graph that I wasn't aware of.  Tested with Clang 6.0 on Darwin.
2014-11-02 15:23:14 -07:00
Noel Belcourt cad7851624 Merge pull request #21 from lorenzb/develop
Fix missing #include causing compilation errors

Thanks, nice find!
2014-11-02 13:38:20 -07:00
Lorenz Breidenbach 6e1ed79cbc Add missing #include of boost/functional/hash.hpp 2014-10-15 13:05:26 +02:00
Josef Cibulka bc60e27f75 Comparison of doubles in graphml_test.cpp in now done with some tolerance to rounding errors. 2014-09-29 11:08:23 +02:00
Josef Cibulka 3afa03dcd0 Changed asserts to BOOST_CHECK in graphml_test.cpp 2014-09-29 10:27:19 +02:00
Josef Cibulka 3a663cddc3 Merge remote-tracking branch 'myremote/master' into HEAD 2014-09-27 21:11:10 +02:00
Josef Cibulka 02fbda4272 Added reading of graph properties from graphml. 2014-09-26 16:28:22 +02:00
Noel Belcourt c07183ad71 Merge pull request #17 from danieljames/metadata
Create metadata file.

Thanks Daniel.
2014-09-01 20:33:01 -06:00
Daniel James 292fb84421 Add metadata file. 2014-08-18 14:59:33 +01:00
Eric Niebler 290e9fc3d1 Merge branch 'master' into develop 2014-08-03 13:06:46 -07:00
Eric Niebler 70a2630932 Merge pull request #14 from Lastique/patch-1
Fix compilation with gcc 4.4 in C++11 mode
2014-08-03 12:46:30 -07:00
Noel Belcourt 7d7eca4a38 Cleanup unused typedefs (gcc-4.8.2 c++0x). 2014-07-31 12:46:39 -06:00
Noel Belcourt 03dbf02a5a Fixes explicit operator() bool of Boost.Optional in c++11 mode.
Uses static_cast<const bool>() rather than explicit conversion.
2014-07-31 12:12:05 -06:00
Noel Belcourt da78b282b4 Fix convertion to bool from vector boost::optional in c++0x mode. 2014-07-30 21:09:52 -06:00
Eric Niebler 612b42c7b2 Merge pull request #14 from Lastique/patch-1
Fix compilation with gcc 4.4 in C++11 mode
2014-07-30 14:13:56 -07:00
Andrey Semashev 73c4e2e36c Resolve assignment operator ambiguity with gcc 4.4. 2014-07-30 23:37:09 +04:00
Andrey Semashev 0f4ecbcd4b Fix compilation with gcc 4.4 in C++11 mode
Add constructor and assignment operator implementations for gcc 4.4 since it does not support defaulted move constructors and assignment. The operators are also used for gcc 4.5 for good measure (I cannot test it but gcc 4.6 does not need this workaround).

Also the workaround is used for MSVC as well. The previous MSVC branch was incorrect since it did not invoke base class constructors and assignment.
2014-07-30 12:01:19 +04:00
Alexander Lauser 9160fdb45e Fixed bug 10222. 2014-07-28 19:07:08 +02:00
Noel Belcourt 4210b6aa84 Merge pull request #11 from MarcelRaad/patch-1
Remove unused variables

Tested with clang-5.1 on Mavericks, thanks Marcel.
2014-07-12 15:03:43 -06:00
Marcel Raad d6314a81bb Remove unused variables
This fixes compiler warnings about variable shadowing.
2014-07-12 13:32:16 +02:00
K. Noel Belcourt 9ce26cf6ea Fix graph_parallel test conversion from const optional<> to
a non-const bool.
2014-05-18 21:27:08 -06:00
Noel Belcourt 235064c63c Merge branch 'develop' 2014-05-16 15:15:30 -06:00
Noel Belcourt 1b88c5bc8b Merge branch 'master' into develop
Conflicts:
	include/boost/graph/adjacency_matrix.hpp
	include/boost/graph/detail/adjacency_list.hpp
	include/boost/graph/named_graph.hpp
	include/boost/graph/r_c_shortest_paths.hpp
	include/boost/graph/vf2_sub_graph_iso.hpp
	test/Jamfile.v2
	test/make_connected_test.cpp
2014-05-16 15:14:57 -06:00
Noel Belcourt 887de5e2e3 Merge pull request #10 from jhunold/vc12
Vc12 does not support default move constructors

Looks okay, assume you'll followup with any remaining failing vc12 tests.
2014-05-14 17:07:40 -06:00
Noel Belcourt 12d334fff6 Merge pull request #5 from BenPope/develop
Fix [un]directed_graph::swap and add tests

Nice job, thanks!  I'll have to look at your other points a bit more carefully before responding.
2014-05-14 10:41:25 -06:00
BenPope e2da814588 Add tests for member swap and fix undirected_graph<>::swap 2014-05-14 23:46:25 +08:00
BenPope 9b7fbc1a76 Add tests for member swap and fix undirected_graph<>::swap 2014-05-14 23:43:53 +08:00
BenPope 1f2dc47fdd Merge branch 'develop' of github.com:boostorg/graph into develop 2014-05-14 21:51:59 +08:00
Jürgen Hunold fcaef7c4e3 Fix: vc12 doe not support defaulted move constructors, so provide an implementation. 2014-05-13 15:52:46 +02:00
Noel Belcourt 07c47bca51 Merge pull request #8 from cirosantilli/doc-quicktour-vertex-type
Explicitly use vertex type on quick tour example.
2014-04-28 13:42:15 -06:00
Ciro Santilli b77deb851a Explicitly use vertex type on quick tour example. 2014-04-28 09:28:13 +02:00
BenPope 86bbbf563d Fix directed_graph::swap 2014-04-21 22:15:48 +08:00
K. Noel Belcourt f1fe4a9132 Fix a use of typename outside of template. Looks like a merge
from develop omitted this as it's fixed in develop, not in
master.

This should clear master graph tests on Darwin and Linux.
2014-01-29 13:01:02 -07:00
Jeremiah Willcock cb26ccf2ba Changed to use unique_ptr when C++11 is enabled; made other fixes to enable move semantics
[SVN r86733]
2013-11-17 02:18:42 +00:00
Jeremiah Willcock cec654dedb Changed some names to fix shadowing warnings; refs #9371
[SVN r86680]
2013-11-13 17:36:02 +00:00
Jeremiah Willcock 983be4b9e7 Added graph property support to write_graphviz_dp
[SVN r86604]
2013-11-09 19:06:06 +00:00
Jeremiah Willcock 332b49261c Fixed invalid uses of "typename"
[SVN r86577]
2013-11-06 21:16:55 +00:00
Jeremiah Willcock a9b0657fd3 Fixed figure caption; fixes #9312
[SVN r86502]
2013-10-28 16:40:16 +00:00
Jeremiah Willcock 4af610830b Fixed edge_range bug from http://stackoverflow.com/questions/19223692/boost-graph-library-directed-multigraph-edge-range-bug?rq=1
[SVN r86469]
2013-10-26 22:57:10 +00:00
Jeremiah Willcock 031ce8084b Changed random_access_iterator_property_map to iterator_property_map in documentation; fixes #9300
[SVN r86456]
2013-10-26 15:30:09 +00:00
Jeremiah Willcock db6e8b7981 Moved parts of PBGL used by parallel property maps over to property map directories and namespaces; this fixes circular dependencies between these two libraries (assuming boost/property_map/parallel is treated as a separate library)
[SVN r86381]
2013-10-21 18:29:04 +00:00
Jeremiah Willcock 74564d5a1c Made some of changes from #9246: added new test case (modifying tests on callback usage to match current documentation); removed special-casing of empty graphs; added patch from #9246 for correct return values; did not make change to documentation suggested there since I chose to have the callback called even for empty graphs; fixes #9246
[SVN r86336]
2013-10-17 02:51:14 +00:00
Stephen Kelly 91a21a559c Remove BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
Process #ifndef...#else...#endif blocks.

[SVN r86245]
2013-10-11 23:17:48 +00:00
Stephen Kelly 73b68e32ba Remove BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
Process #ifndef...#endif conditions.

[SVN r86244]
2013-10-11 23:15:00 +00:00
Stephen Kelly 0464915a7f Remove BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
Process #ifdef...#endif blocks.

[SVN r86243]
2013-10-11 23:13:10 +00:00
Jeremiah Willcock 4ebf7f60fc Applied patch from #9229 to allow common subgraphs of size 1; fixes #9229
[SVN r86236]
2013-10-11 14:32:02 +00:00
Jeremiah Willcock 4fc3cbfaae Made boost::unordered inclusion unconditional; removed support for non-partial-specialization compilers; enabled C++11 unordered containers when they are present; refs #8962
[SVN r86137]
2013-10-02 19:15:21 +00:00
Jeremiah Willcock da59145176 Fixed documentation about hash_setS; fixes #6990
[SVN r86136]
2013-10-02 19:10:30 +00:00
Jeremiah Willcock bed19d5c25 Qualified calls to tie in documentation; fixes #9184
[SVN r86126]
2013-10-01 18:12:50 +00:00
Stephen Kelly f0f1251da7 Graph: Remove obsolete GCC version check.
[SVN r86059]
2013-09-30 15:55:18 +00:00
Stephen Kelly 4f8a34090e Pending: Remove obsolete MSVC version checks.
[SVN r86028]
2013-09-30 00:19:09 +00:00
Stephen Kelly e096e7e5cc Graph: Remove obsolete MSVC version checks.
[SVN r85934]
2013-09-26 09:41:38 +00:00
Jeremiah Willcock 51d3fe8aed Cleaned up property maps and added a bunch of error checking asserts
[SVN r85853]
2013-09-23 15:30:22 +00:00
Jeremiah Willcock 5922324c2b Merged Boost.Graph, Boost.Graph.Parallel, and Boost.PropertyMap changes from Boost trunk
[SVN r85813]
2013-09-21 20:17:00 +00:00
Jeremiah Willcock f97c2ee746 Attached patch from Piotr Wygocki for min-cost max-flow
[SVN r85661]
2013-09-13 14:48:17 +00:00
Jeremiah Willcock c40148ee94 Removed uses of pointers as property maps from tests and examples
[SVN r85655]
2013-09-12 15:14:36 +00:00
Jeremiah Willcock fdd8e41b47 Fixing tests (hopefully) for VC++
[SVN r85654]
2013-09-12 14:01:50 +00:00
Jeremiah Willcock 93f232252e Fixed VC++ warning
[SVN r85594]
2013-09-07 16:36:45 +00:00
Jeremiah Willcock 93f4a862c3 Changed from iterator to const_iterator to fix VC++ issue
[SVN r85593]
2013-09-07 16:34:49 +00:00
Jeremiah Willcock e1bcb667b6 Fixed ambiguous call
[SVN r85583]
2013-09-06 03:54:57 +00:00
Jeremiah Willcock 405e21d011 Applied patch from potato_research to add copyright notice
[SVN r85580]
2013-09-05 19:48:31 +00:00
Jeremiah Willcock a3efa1c030 Added new test from potato_research of custom vertex index map in r_c_shortest_paths
[SVN r85571]
2013-09-05 12:57:15 +00:00
Jeremiah Willcock bd107e4ab5 Applied patch and file renames from Piotr Wygocki
[SVN r85568]
2013-09-04 21:39:21 +00:00
Jeremiah Willcock 85b45da7c8 Fixed various data type bugs, and cleaned up signed vs. unsigned and int vs. size_t issues
[SVN r85567]
2013-09-04 20:47:36 +00:00
Jeremiah Willcock 8aa602b40d Fixed pseudocode in documentation; fixes #9080
[SVN r85551]
2013-09-03 18:12:59 +00:00
Jeremiah Willcock 915b70ec05 Added min_cost_max_flow code from Piotr Wygocki
[SVN r85536]
2013-08-31 20:09:11 +00:00
Jeremiah Willcock 5297423229 Added edge coloring code from Maciej Piechotka; fixes #8317
[SVN r85534]
2013-08-31 19:44:08 +00:00
Jeremiah Willcock 01a683d8ce Added Hawick circuits code from Louis Dionne; fixes #8433
[SVN r85533]
2013-08-31 19:29:22 +00:00
Jeremiah Willcock 5ba855f46e Removed use of "void" as property type to avoid errors in Clang; added static assertion to prevent this use in the future (it is broken anyway)
[SVN r85472]
2013-08-26 04:11:49 +00:00
Jeremiah Willcock d983ea89a5 Simplified negative-edge test; refs #9012
[SVN r85387]
2013-08-17 22:21:16 +00:00
Jeremiah Willcock cd267de654 Fixed test for negative-weight edges when combine operator is project2nd (as in prim_minimum_spanning_tree); fixes #9012; refs #8398
[SVN r85386]
2013-08-17 22:12:20 +00:00
Jeremiah Willcock 130f7129c3 Added MSSP support for non-named parameter versions
[SVN r85348]
2013-08-14 15:34:02 +00:00
Jeremiah Willcock be2fc043d1 Fixed unused typedef warnings from GCC 4.9; fixes #8877; fixes #8986
[SVN r85323]
2013-08-12 18:14:58 +00:00
Jeremiah Willcock a5a29bd065 Changed to use adjacency_list for temporary graph, avoiding ADL issues with vector_as_graph; fixes #8791
[SVN r84976]
2013-07-07 16:50:24 +00:00
Jeremiah Willcock 73d2d7500e Added #define to detect recent modification
[SVN r84915]
2013-06-29 19:12:52 +00:00
Jeremiah Willcock d53729083f Changed dispatching strategy for bfs_helper
[SVN r84913]
2013-06-28 18:47:30 +00:00
Jeremiah Willcock 37bd777094 Moved distributed graph tags into graph_traits.hpp
[SVN r84912]
2013-06-28 18:47:10 +00:00
Jeremiah Willcock ca70cdaa2c Removed assertion to enable removal of non-existent edges, as suggested by comment to #4622; refs #4622
[SVN r84869]
2013-06-21 20:06:45 +00:00
Jeremiah Willcock 5e88d92265 Merged another bug fix from trunk
[SVN r84728]
2013-06-10 15:23:08 +00:00
Jeremiah Willcock 61296c352a Changed // comments to be non-greedy; fixes #8681
[SVN r84725]
2013-06-10 14:29:39 +00:00
Jeremiah Willcock 2cd57a4180 Merged more Boost.Graph bug fixes from trunk
[SVN r84641]
2013-06-04 20:53:19 +00:00
Jeremiah Willcock df1a183214 Added reference in parameter type
[SVN r84633]
2013-06-04 16:07:45 +00:00
Jeremiah Willcock bf00bbe4f0 Fixed dangling reference bug reported by Marshall Clow; other small cleanups
[SVN r84632]
2013-06-04 16:07:20 +00:00
Jeremiah Willcock b98f225d0d Removed unused typedefs
[SVN r84471]
2013-05-25 02:20:09 +00:00
Jeremiah Willcock 1311d1b035 Chaned project1st and project2nd function objects to return copies rather than references to arguments, preventing a dangling reference when the type of the argument passed in is not exactly the same as the template argument of the projection function object
[SVN r84466]
2013-05-24 21:19:21 +00:00
Jeremiah Willcock 966aa0cf48 Fixed to work with self-loops
[SVN r84396]
2013-05-20 21:33:31 +00:00
Jeremiah Willcock 67f7bcfa96 Merged Boost.Graph, Boost.Graph.Parallel, and Boost.PropertyMap changes from trunk
[SVN r84299]
2013-05-16 15:38:05 +00:00
Jeremiah Willcock 2c62f35e46 Added timeout support code from Brammert Ottens
[SVN r84102]
2013-05-01 17:42:44 +00:00
Jeremiah Willcock 67aacbe6ef Added support for distance types without numeric_limits specializations; changed test to use that functionality to ensure that it keeps working; fixes #8490
[SVN r84028]
2013-04-24 02:19:13 +00:00
Jeremiah Willcock 53bdf1db9c Applied patch from #7155 to add "graphml" as a value for "for"; fixes #7155; fixes #7016
[SVN r83961]
2013-04-18 20:21:39 +00:00
Jeremiah Willcock 7e9b77f5fb Fixed VC++ error
[SVN r83893]
2013-04-14 03:49:56 +00:00
Jeremiah Willcock 535e593810 Added sloan_ordering example to build list
[SVN r83878]
2013-04-13 18:20:45 +00:00
Jeremiah Willcock c40a522362 Fixed 32/64-bit size issues; fixes #8434
[SVN r83877]
2013-04-13 18:20:16 +00:00
Jeremiah Willcock 32fa162931 Fixed documentation to be correct; fixes #8428
[SVN r83857]
2013-04-12 19:54:31 +00:00
Jeremiah Willcock 65c9ef22c6 Flipped arguments to combine calls to match documentation; refs #8428
[SVN r83845]
2013-04-11 17:19:38 +00:00
Jeremiah Willcock 44912cc2be Fixed some typos; not a fix to #8428 yet
[SVN r83844]
2013-04-11 17:14:28 +00:00
Jeremiah Willcock f9dbc3ffb3 Removed unnecessary requirement; fixes #8427
[SVN r83837]
2013-04-10 20:42:27 +00:00
Jeremiah Willcock 3e770e171e Added patches from Flavio De Lorenzi; fixed HTML typo in VF2 documentation
[SVN r83832]
2013-04-10 17:03:21 +00:00
Jeremiah Willcock 4f3e758c9c Fixed example for C++11 mode
[SVN r83798]
2013-04-07 19:37:29 +00:00
Jeremiah Willcock 0e4f022d9d Changed test for negative edges per #8398; fixes #8398
[SVN r83772]
2013-04-05 18:25:33 +00:00
Jeremiah Willcock 393c072c18 Added maximum adjacency search from Fernando Vilas; fixes #6780
[SVN r83410]
2013-03-12 00:35:48 +00:00
Jeremiah Willcock 2539ea8bca Changed .size() comparison against 0 to .empty()
[SVN r83409]
2013-03-12 00:34:38 +00:00
Jeremiah Willcock 02aaeccae5 Changed difference_types to not be void
[SVN r83366]
2013-03-08 17:31:15 +00:00
Jeremiah Willcock 3ebad4bc01 Added patch to example from Takatoshi Kondo
[SVN r83234]
2013-03-01 18:41:32 +00:00
Jeremiah Willcock 057a718a39 Added new versions of VF2 from Jakob Lykke Andersen; fixes #8166; some test cases for the new functionality would be appreciated as a separate patch.
[SVN r83233]
2013-03-01 18:17:34 +00:00
Jeremiah Willcock 51a28ac04b Fixed handling of const graphs and property maps; fixes #8192
[SVN r83191]
2013-02-27 22:04:17 +00:00
Jeremiah Willcock e8eba95d4a Fixed typo in tag
[SVN r83067]
2013-02-21 19:51:54 +00:00
Jeremiah Willcock afd2ee41bd Removed uses of check_is_close which seems to be broken now
[SVN r82779]
2013-02-07 21:13:56 +00:00
Jeremiah Willcock e41d96177f Added check to prevent use of remove_vertex on named adjacency list graphs with vecS vertex container (since it does not work and could not be made to work efficiently); refs #7863
[SVN r82498]
2013-01-14 21:03:48 +00:00
Jeremiah Willcock 1c54f431ca Changed loop header to avoid GCC warning from -Wunsafe-loop-optimizations
[SVN r82445]
2013-01-11 03:05:08 +00:00
Jeremiah Willcock 7ea6373369 Removed obsolete workarounds and changed to iterator_property_map; refs #7877
[SVN r82441]
2013-01-10 22:51:53 +00:00
Jeremiah Willcock 8caf6fc368 Removed obsolete workaround
[SVN r82440]
2013-01-10 22:50:14 +00:00
Jeremiah Willcock f10ad0650a Changed to iterator_property_map; fixes #7877
[SVN r82439]
2013-01-10 22:49:10 +00:00
Jeremiah Willcock 2f12c59529 Added more examples to Jamfile
[SVN r82438]
2013-01-10 22:14:46 +00:00
Jeremiah Willcock 086cd12a7e Applied variant of patch from #7845; fixes #7845
[SVN r82358]
2013-01-04 19:29:27 +00:00
Jeremiah Willcock 22b521ecf4 Merged Boost.Graph changes from trunk for 1.53
[SVN r82061]
2012-12-17 23:59:46 +00:00
Jeremiah Willcock 31cf899da9 Trying to fix defaults for StoredEdge; refs #7801
[SVN r82052]
2012-12-17 17:37:39 +00:00
Jeremiah Willcock ebd636bfc0 Added VF2 updates from Flavio De Lorenzi
[SVN r82050]
2012-12-17 17:11:02 +00:00
Jeremiah Willcock 8a1913f804 Trying to fix property map ambiguities with distributed graphs on Intel compiler
[SVN r82010]
2012-12-16 05:16:47 +00:00
Jeremiah Willcock f53d02e0eb Added updates from Flavio De Lorenzi to vf2_sub_graph_iso code
[SVN r82007]
2012-12-16 01:51:51 +00:00
Jeremiah Willcock 233cc514c5 Re-added incident edges example from documentation; fixed undirected_adjacency_list.expected to match current code; fixed link to undirected.cpp example in documentation; fixes #7787
[SVN r81869]
2012-12-12 03:38:48 +00:00
Jeremiah Willcock 5f6963e0f0 Fixed typo; fixes #7780
[SVN r81822]
2012-12-10 15:26:59 +00:00
Jeremiah Willcock 25852f92af Applied patch from #7766; fixes #7766
[SVN r81772]
2012-12-07 19:41:01 +00:00
Jeremiah Willcock 36d3d83375 Fixed adding properties in labeled_graph; fixes #7773
[SVN r81771]
2012-12-07 19:30:28 +00:00
Jeremiah Willcock 867f8cf495 Fixed directed_graph and undirected_graph handling of vertex_all and edge_all properties
[SVN r81770]
2012-12-07 19:29:12 +00:00
Jeremiah Willcock add307aafc Added info on default argument; fixes #7771
[SVN r81747]
2012-12-07 01:33:49 +00:00
Jeremiah Willcock 0c2db206d3 Added VF2 subgraph isomorphism algorithm from Flavio De Lorenzi and Vomel Christof
[SVN r81725]
2012-12-05 19:28:12 +00:00
Jeremiah Willcock fd7f84560b Changed to BOOST_ASSERT
[SVN r81724]
2012-12-05 19:26:38 +00:00
Jeremiah Willcock 6aed0a5a45 Removed unused code
[SVN r81603]
2012-11-27 22:25:50 +00:00
Jeremiah Willcock 1a9533422d Fixed template parameter names; fixes #4386
[SVN r81602]
2012-11-27 22:17:25 +00:00
Jeremiah Willcock 56223ce7b0 Added name A* for astar_search
[SVN r81601]
2012-11-27 22:14:29 +00:00
Jeremiah Willcock e39be516c2 Added tree version of astar_search functions
[SVN r81600]
2012-11-27 22:13:46 +00:00
Jeremiah Willcock 55047c74c1 Added new property map that returns a constant and eats writes
[SVN r81599]
2012-11-27 22:12:39 +00:00
Jeremiah Willcock d1bd08f2a3 Added astar-cities example to build list
[SVN r81598]
2012-11-27 22:12:17 +00:00
Jeremiah Willcock 74dc17ee94 Added assertions and cast on property map value
[SVN r81597]
2012-11-27 22:11:57 +00:00
Jeremiah Willcock 942d3430f1 Removed references to member types not required by documentation; fixed concept definitions; fixes #7741
[SVN r81589]
2012-11-27 15:14:36 +00:00
Jeremiah Willcock eefb7a3d47 Applied patch from #7728 to fix B-K max-flow bug; fixes #7728; fixes #3468
[SVN r81536]
2012-11-25 20:13:25 +00:00
Jeremiah Willcock 923877b3c5 Applied patch from #7684; fixes #7684
[SVN r81369]
2012-11-16 15:30:42 +00:00
Jeremiah Willcock 4495a409e5 Added support for reading reliably from files with more than one GraphML graph
[SVN r81313]
2012-11-12 22:30:19 +00:00
Jeremiah Willcock 1bb17dab63 Applied patch from #7648; fixes #7648
[SVN r81218]
2012-11-06 13:23:03 +00:00
Jeremiah Willcock f95e102060 Applied patch from #7600; fixes #7600
[SVN r81099]
2012-10-29 18:16:22 +00:00
Jeremiah Willcock 0df5824004 Trying to fix issue reported by Jan Hudec
[SVN r81049]
2012-10-22 20:12:34 +00:00
Jürgen Hunold 3419d42acc Merge 80908,80939,80957 from ^/trunk
------------------------------------------------------------------------
  r80908 | jewillco | 2012-10-08 22:04:48 +0200 (Mo, 08 Okt 2012) | 1 line
  
  Added attempt at workaround for VC++ const graph type bug
  ------------------------------------------------------------------------
  r80939 | jewillco | 2012-10-10 19:27:44 +0200 (Mi, 10 Okt 2012) | 1 line
  
  Added another remove_const to work around VC++ 9 issues
  ------------------------------------------------------------------------
  r80957 | jewillco | 2012-10-11 18:45:33 +0200 (Do, 11 Okt 2012) | 1 line
  
  Added test from Juergen Hunold
  ------------------------------------------------------------------------


[SVN r81042]
2012-10-21 18:06:15 +00:00
Marshall Clow b5b07e13a8 Merge comment typo to release; Fixes #7511
[SVN r80998]
2012-10-16 03:44:59 +00:00
Marshall Clow 2275b3019b Fix typo; Refs #7511
[SVN r80997]
2012-10-16 03:35:39 +00:00
Jeremiah Willcock 0a990db1c5 Fixed for starting vertices other than 0; thanks to Morten Strandberg for the bug report
[SVN r80961]
2012-10-11 20:09:23 +00:00
Jeremiah Willcock b4e1fe7a66 Added test from Juergen Hunold
[SVN r80957]
2012-10-11 16:45:33 +00:00
Jeremiah Willcock 8c4d0b33cd Added another remove_const to work around VC++ 9 issues
[SVN r80939]
2012-10-10 17:27:44 +00:00
Jeremiah Willcock 0d1769a27c Added attempt at workaround for VC++ const graph type bug
[SVN r80908]
2012-10-08 20:04:48 +00:00
Jeremiah Willcock 8f37c21e99 Fixed return type of vertex_by_label
[SVN r80879]
2012-10-05 22:40:22 +00:00
Jeremiah Willcock 34ddb83a49 Removed extra semicolon; fixes #7467
[SVN r80842]
2012-10-04 14:49:26 +00:00
Jeremiah Willcock c964747407 Applied patch from #7457; fixes #7457
[SVN r80814]
2012-10-02 03:05:22 +00:00
Jeremiah Willcock b214ef2f4d Changed classes to structs to get public inheritance; thanks to Shaun Jackman for the bug report
[SVN r80811]
2012-10-01 18:31:15 +00:00
Jeremiah Willcock 607d866854 Merged Boost.Graph changes from trunk
[SVN r80740]
2012-09-28 18:34:12 +00:00
Jeremiah Willcock f95abaa83c Applied patch from #7428; fixes #7428
[SVN r80725]
2012-09-27 17:43:07 +00:00
Jeremiah Willcock ddf8a5e07e Removed incorrect note about restrictions on graph dimensionality and fixed other typos; fixes #6950
[SVN r80642]
2012-09-22 20:09:44 +00:00
Jeremiah Willcock 3009b2303c Checking multiple dimensionalities of graphs
[SVN r80641]
2012-09-22 20:09:08 +00:00
Jeremiah Willcock b9e9ed2067 Removed invalid templated friend definitions and fixed other bugs
[SVN r80640]
2012-09-22 20:08:44 +00:00
Jeremiah Willcock f16a1b114d Fixed relax logic to not write predecessor map unless distance was actually changed in memory (although this case will never be hit unless registers have extra precision compared to memory); fixes #7226
[SVN r80639]
2012-09-22 19:32:32 +00:00
Jeremiah Willcock 8afe81608c Reversed incorrect order of arguments to non-named-parameter call; fixes #7380
[SVN r80638]
2012-09-22 19:26:30 +00:00
Jeremiah Willcock 3be269ba35 Added wording that infinite-weight edges are not guaranteed to work correctly; fixes #7398
[SVN r80637]
2012-09-22 19:21:39 +00:00
Jeremiah Willcock 58829e019b Added more enable_ifs to try to get code working on VC++
[SVN r80582]
2012-09-18 18:20:15 +00:00
Jeremiah Willcock 663127c3b7 Trying to remove unnecessary member accesses (that might not exist) for unused traits
[SVN r80569]
2012-09-18 03:27:42 +00:00
Jeremiah Willcock 9002628f15 Further fixed #7378 issue; refs #7378
[SVN r80532]
2012-09-15 13:49:04 +00:00
Jeremiah Willcock 076085fd29 Using lazy_enable_if to avoid "reference to void" errors for properties that are not found; fixes #7378
[SVN r80528]
2012-09-14 21:41:06 +00:00
Jeremiah Willcock adaa84d861 Added void as default value of lookup_one_property_internal::type for "not found"; refs #7378
[SVN r80524]
2012-09-14 18:04:00 +00:00
Jeremiah Willcock 8c83132ef7 Applied patch from #7327; fixes #7327
[SVN r80511]
2012-09-13 13:18:36 +00:00
Jeremiah Willcock 60b5e07027 Allowed pointers-to-base-members to be used to access properties of derived bundled property classes; fixes #7308
[SVN r80505]
2012-09-12 12:24:04 +00:00
Jeremiah Willcock 58ff2364ba Fixed typos
[SVN r80490]
2012-09-11 07:04:18 +00:00
Jeremiah Willcock fecccdd81c Changed core_numbers to use d_ary_heap and only update queue elements that are in the queue; fixes #7341
[SVN r80421]
2012-09-06 15:31:41 +00:00
Jeremiah Willcock b52e49730b Fixed issues with indirect_cmp; fixes #7338
[SVN r80420]
2012-09-06 13:44:21 +00:00
Jeremiah Willcock 9dcbb861d6 Added warning about copying
[SVN r80407]
2012-09-05 15:19:59 +00:00
Jeremiah Willcock d2d880b4e0 Made edge weight a reference based on a suggestion by Tristram Gräbener; made vertex distance variables const values
[SVN r80264]
2012-08-27 19:05:25 +00:00
Jeremiah Willcock 88101e0ab0 Fixed default template arguments
[SVN r80216]
2012-08-25 20:45:29 +00:00
Jeremiah Willcock 4672f4d430 Fixed typo
[SVN r80189]
2012-08-25 03:10:40 +00:00
Jeremiah Willcock 6dc5eb1d6a Fixed typo
[SVN r80188]
2012-08-25 03:09:27 +00:00
Jeremiah Willcock 48f4d92a38 Removed retag_property_list and all uses of it
[SVN r79855]
2012-08-02 18:05:11 +00:00
Jeremiah Willcock ff872bad11 Fixed subgraph_properties example and added more examples to Jamfile.v2
[SVN r79833]
2012-08-01 15:31:23 +00:00
Jeremiah Willcock 245e36feba Fixed order of arguments to get_param_type
[SVN r79772]
2012-07-27 18:23:02 +00:00
Jeremiah Willcock 1cdce524a2 Merged r79227 from trunk, hopefully fixing all VC++ Boost.Graph Graphviz test issues
[SVN r79771]
2012-07-27 18:15:55 +00:00
Jeremiah Willcock ba9155f89c Merged bug fix from trunk
[SVN r79393]
2012-07-09 20:15:04 +00:00
Jeremiah Willcock df80876475 Fixed uninitialized variable problem
[SVN r79391]
2012-07-09 20:10:02 +00:00
Jeremiah Willcock 6604e3a013 Merged more changes (bug fixes, especially hopefully fixing the VC++ test failure) from trunk
[SVN r79390]
2012-07-09 20:07:47 +00:00
Jeremiah Willcock 408469afcf Refactored handling of properties (especially bogus property tags) to work around VC++ <=10 issues in graphviz_test; changed graph_all_t to return ref_property_map like is needed for dynamic_properties in I/O functions
[SVN r79388]
2012-07-09 19:49:55 +00:00
Jeremiah Willcock 20ab0ffec3 Fixed VC++ issues in examples
[SVN r79387]
2012-07-09 19:48:12 +00:00
Jeremiah Willcock 71f0ab997d Added default for property_kind to try to work around VC++ issues
[SVN r79227]
2012-07-02 12:53:15 +00:00
Jeremiah Willcock 708d8b62a5 Second batch of Boost.Graph and Boost.PropertyMap changes for 1.51
[SVN r79191]
2012-06-30 20:22:16 +00:00
Jeremiah Willcock 616b9e7134 Merged first batch of 1.51 changes for Boost.Graph and Boost.PropertyMap
[SVN r79189]
2012-06-30 20:00:41 +00:00
Jeremiah Willcock 849d1538ed Fixed construction and assignment of bidirectional CSR graphs from other graphs; removed add_edges* functions (which were broken and not documented) from bidirectional CSR; fixes #7002
[SVN r79179]
2012-06-29 20:26:26 +00:00
Jeremiah Willcock 215359117a Applied patch from #7023; fixes #7023
[SVN r79177]
2012-06-29 19:40:29 +00:00
Jeremiah Willcock 5cab2dcf61 Changed grid_graph_index_map to use raw pointer to graph based on suggestion by Sergey Mitsyn
[SVN r79017]
2012-06-20 16:37:50 +00:00
Jeremiah Willcock 30dd4d8f69 Fixed property name as per #6993; fixes #6993
[SVN r79010]
2012-06-19 19:14:46 +00:00
Jeremiah Willcock 0cbdd0a40f Merged warning fixes from trunk
[SVN r78652]
2012-05-26 19:33:09 +00:00
Jeremiah Willcock 38ad939f37 Fixed warnings
[SVN r78651]
2012-05-26 19:30:47 +00:00
Jeremiah Willcock cbe70511cd Merged in more trunk bug fixes for Boost.Graph and Boost.PropertyMap
[SVN r78641]
2012-05-26 18:56:37 +00:00
Jeremiah Willcock 0b30767da0 Merged bug fixes for Boost.Graph and Boost.PropertyMap from trunk
[SVN r78639]
2012-05-26 18:23:01 +00:00
Dave Abrahams 8ff9b6c510 Replace all uses of boost/utility.hpp with more-granular includes. Solves modularization dependency nightmare.
[SVN r78502]
2012-05-18 04:44:04 +00:00
Jeremiah Willcock b37570381b Fixed inspect warnings and typos
[SVN r78442]
2012-05-12 20:46:47 +00:00
Jeremiah Willcock 34ba5d36d7 Fixed uses of std::min
[SVN r78441]
2012-05-12 20:36:02 +00:00
Jeremiah Willcock 856e0fb3ab Fixed bugs in remove_edge and clear_vertex for undirected graphs; refs #4622
[SVN r78439]
2012-05-12 20:10:11 +00:00
Jeremiah Willcock 48860d938c Removed unnecessary concept requirement; fixes #6892
[SVN r78438]
2012-05-12 18:46:34 +00:00
Jeremiah Willcock 4e5382d828 Trying to fix undirected clear_vertex() again; refs #4622
[SVN r78428]
2012-05-11 21:03:19 +00:00
Jeremiah Willcock 2d70ac7254 Fixed handling of self-loops; fixes #4622
[SVN r78425]
2012-05-11 19:37:54 +00:00
Jeremiah Willcock 1eb950d630 Removed use of Boost.Typeof to enhance portability; using Boost.ResultOf instead
[SVN r78330]
2012-05-05 03:08:49 +00:00
Jeremiah Willcock 1441c15255 Removed use of Boost.Typeof to enhance portability; using Boost.ResultOf instead
[SVN r78329]
2012-05-05 03:07:40 +00:00
Jeremiah Willcock 8e40b350e3 Qualified calls to tie
[SVN r78328]
2012-05-05 02:52:41 +00:00
Jeremiah Willcock 429112df7c Fixed ambiguous call
[SVN r78327]
2012-05-05 02:50:55 +00:00
Jeremiah Willcock 0586ac290f Edited reverse_graph to fix test case; fixes #6858
[SVN r78315]
2012-05-03 16:20:58 +00:00
Jeremiah Willcock d42d54b54e Removed #error for lack of bundled properties
[SVN r78076]
2012-04-19 03:30:59 +00:00
Jeremiah Willcock bec6cb4dda Disabled build on Sun; waiting to disable in regression test output until results show that library is not built
[SVN r78053]
2012-04-17 19:53:26 +00:00
Jeremiah Willcock 117689a3f9 Fixed argument order to get_param_type
[SVN r78031]
2012-04-16 23:17:12 +00:00
Jeremiah Willcock 6ea899f7ed Added code and docs from #5269 (some code heavily rewritten) and removed old workarounds; fixes #5269
[SVN r78030]
2012-04-16 23:12:50 +00:00
Jeremiah Willcock a64981a983 Changed to old-style named parameter wrapper generator
[SVN r78027]
2012-04-16 19:17:04 +00:00
Jeremiah Willcock 2a4350905b Added generator to make old-style named parameter wrappers
[SVN r78026]
2012-04-16 19:07:20 +00:00
Jeremiah Willcock ebdec45c4b Added test for Boost.Parameter version of isomorphism; fixed bugs that found
[SVN r78024]
2012-04-16 18:44:36 +00:00
Jeremiah Willcock 97bea429fc Added new code from #6242; fixes #6242
[SVN r78023]
2012-04-16 17:55:07 +00:00
Jeremiah Willcock 01832f76c2 Fixed SCC example and added it to Jamfile; fixes #6647
[SVN r78022]
2012-04-16 17:46:15 +00:00
Jeremiah Willcock 0aaf3858a0 Reverted r77731 because it complicated the code and did not fix BGL compilation on any compilers
[SVN r78020]
2012-04-16 17:35:15 +00:00
Jeremiah Willcock efd4b992cc Clarified and corrected documentation
[SVN r77924]
2012-04-11 20:52:32 +00:00
Jeremiah Willcock 706859b595 Removed uses of Boost.Typeof to hopefully help on XLC
[SVN r77916]
2012-04-11 16:26:51 +00:00
Jeremiah Willcock 3d43c1a8ec Added algorithm from Michele Caini for common spanning trees of two graphs; fixes #6401
[SVN r77893]
2012-04-10 19:51:59 +00:00
Jeremiah Willcock eeaee30dd3 Converted to Boost.Parameter
[SVN r77739]
2012-04-03 05:50:40 +00:00
Jeremiah Willcock a4806bed3b Fixed off-by-one bug
[SVN r77738]
2012-04-03 05:50:29 +00:00
Jeremiah Willcock 8400e599ca Starting on converting to Boost.Parameter; not finished yet because of interaction with PBGL
[SVN r77737]
2012-04-03 05:50:09 +00:00
Jeremiah Willcock 28cf285c4d Added no-named-parameter version and simplified code
[SVN r77736]
2012-04-03 05:49:36 +00:00
Jeremiah Willcock 7d3b9f0b4b Qualified call to isomorphism
[SVN r77735]
2012-04-03 05:49:07 +00:00
Jeremiah Willcock aaedb9bac7 Added user-visible Boost.Parameter version; changed to use new wrapper functions, and to allow old named-parameter version to call it, changed detection of starting vertex
[SVN r77734]
2012-04-03 04:45:47 +00:00
Jeremiah Willcock ce845156b8 Added null_vertex()
[SVN r77733]
2012-04-03 04:44:40 +00:00
Jeremiah Willcock 755c77e7c1 Added functions to get null_vertex and default starting vertex, added code to generate wrappers to allow user-visible Boost.Parameter-enabled versions of BGL functions
[SVN r77732]
2012-04-03 04:44:08 +00:00
Jeremiah Willcock 30026490ee Changed to manual token-testing code to avoid use of Boost.Xpressive (allowing use on more compilers)
[SVN r77731]
2012-04-03 04:42:25 +00:00
Jeremiah Willcock 63200dc0ea Added null_vertex() required by Graph concept
[SVN r77730]
2012-04-03 04:39:03 +00:00
Jeremiah Willcock 8ecd3a986c Disabling abort for Windows CE
[SVN r77693]
2012-04-01 19:23:18 +00:00
Jeremiah Willcock d70d07b0ba Trying to fix choose_pmap on more compilers
[SVN r77650]
2012-03-30 17:50:17 +00:00
Jeremiah Willcock eaebaf87a6 Fixing things so bundled graph properties will not crash
[SVN r77634]
2012-03-29 18:43:26 +00:00
Jeremiah Willcock 428762da2b Keeping tag values around to allow bundled properties
[SVN r77633]
2012-03-29 18:42:53 +00:00
Jeremiah Willcock 5d1e1ce628 Changed more things to inheritance to allow more SFINAE and fixed accessibility problem
[SVN r77632]
2012-03-29 18:42:04 +00:00
Jeremiah Willcock 771d9307cc Added forwarding of values of property tags to fix bundled properties
[SVN r77616]
2012-03-28 20:57:02 +00:00
Jeremiah Willcock 7fccfd1f42 Added graph property to serialization, and made default graph property no_property to allow serialization; fixes #5310
[SVN r77615]
2012-03-28 20:56:44 +00:00
Jeremiah Willcock 9092da0b8f Changed default version of property_map to use inheritance to try to get SFINAE in more cases
[SVN r77611]
2012-03-28 20:40:15 +00:00
Jeremiah Willcock 118a055bc4 Fixed narrowing conversion
[SVN r77610]
2012-03-28 20:27:30 +00:00
Jeremiah Willcock 068b2916b3 Fixed categories of property maps for subgraph based on constness of graph; fixes #6739
[SVN r77609]
2012-03-28 20:20:45 +00:00
Jeremiah Willcock e77cd87de1 Changed property lookup code to simplify graph implementations (remove most special-casing of bundled properties), made CSR graph work with non-bundled properties (probably), split named parameter algorithms to not use property map code
[SVN r77549]
2012-03-25 21:03:59 +00:00
Jeremiah Willcock e0c11b3116 Fixed HTML
[SVN r77536]
2012-03-25 05:22:49 +00:00
Jeremiah Willcock 8f8cd154e6 Fixed warning
[SVN r77534]
2012-03-25 05:01:58 +00:00
Jeremiah Willcock 5aa2be67b0 Changed to use documented interface
[SVN r77533]
2012-03-25 05:01:15 +00:00
Jeremiah Willcock 7a2ec7c4dc Removed unused type and variable
[SVN r77532]
2012-03-25 05:00:52 +00:00
Jeremiah Willcock 035fac705c Fixed warnings
[SVN r77531]
2012-03-25 05:00:36 +00:00
Jeremiah Willcock 6f4b8bf204 Removed unused variable
[SVN r77530]
2012-03-25 05:00:21 +00:00
Jeremiah Willcock 57121513a7 Fixed property map access
[SVN r77529]
2012-03-25 05:00:05 +00:00
Jeremiah Willcock 7e59864546 Fixed warnings
[SVN r77528]
2012-03-25 04:59:23 +00:00
Jeremiah Willcock bbab01b9c3 Removed incorrect tests
[SVN r77527]
2012-03-25 04:58:58 +00:00
Jeremiah Willcock 3b7250f736 Disambiguated tuple operations
[SVN r77526]
2012-03-25 04:57:48 +00:00
Jeremiah Willcock e315856b1b Fixed warnings
[SVN r77525]
2012-03-25 01:38:29 +00:00
Jeremiah Willcock b838adfa32 Fixed warnings
[SVN r77523]
2012-03-24 23:35:23 +00:00
Jeremiah Willcock cae4628d7e Added "inline" to avoid multiple definition errors; fixes #6708
[SVN r77415]
2012-03-19 20:48:42 +00:00
Jeremiah Willcock a3d25c5521 Added missing #include; fixes #6707
[SVN r77414]
2012-03-19 20:38:20 +00:00
Jeremiah Willcock 7cddb8febf Changed type of graph property keys to Graph* to match Graphviz reader code and test
[SVN r77341]
2012-03-15 17:39:14 +00:00
Jeremiah Willcock 908ebf506f Added range checking in asserts
[SVN r77279]
2012-03-09 02:19:01 +00:00
Jeremiah Willcock fee51b8cdc Added typename; fixes #6656
[SVN r77248]
2012-03-06 16:23:53 +00:00
Jeremiah Willcock 00ae7b7e72 Applied patch from #6564; fixes #6564
[SVN r77223]
2012-03-04 20:24:30 +00:00
Jeremiah Willcock 5476d8d70a Made Graphviz reading into CSR graphs work for external properties only; refs #5442
[SVN r77222]
2012-03-04 20:21:22 +00:00
Jeremiah Willcock c49c05f502 Tried to do read_graphviz for CSR; does not work but some infrastructure changed so it is being committed
[SVN r77189]
2012-03-03 21:19:38 +00:00
Jeremiah Willcock e7d2639f6e Added finish call to mutate_graph
[SVN r77188]
2012-03-03 21:19:03 +00:00
Jeremiah Willcock fdc5f76aca Fixed use of non-existent member
[SVN r77187]
2012-03-03 21:18:22 +00:00
Jeremiah Willcock 761f792ed4 Applied new patch from #6033 from Jan Hazla; fixes #6033
[SVN r77186]
2012-03-03 20:06:15 +00:00
Jeremiah Willcock c1b4a409a5 Changed to trampolined implementation of match() to avoid stack overflows, now passes test case in #6573 with 10000 sides; fixes #6573
[SVN r77185]
2012-03-03 20:02:27 +00:00
Jeremiah Willcock 2d41bea1c8 Fixed typo in documentation; fixes #6583
[SVN r77182]
2012-03-03 18:56:40 +00:00
Jeremiah Willcock ce88df48fd Changed property map uses to not use operator[]
[SVN r77074]
2012-02-19 20:06:15 +00:00
Aaron Windsor 0a31d3c76b Correcting a doc bug: order of vertices on the outer face of a graph should have been reversed in planar_face_traversal example
[SVN r77013]
2012-02-14 02:43:44 +00:00
Jeremiah Willcock cdef2804ea Fixed incorrect iterator type
[SVN r76868]
2012-02-04 05:12:58 +00:00
Jeremiah Willcock b42b71824b Removed unused parameter names
[SVN r76867]
2012-02-04 05:12:04 +00:00
Jeremiah Willcock cd1186205d Added links sent by David Doria to his new documentation files
[SVN r76783]
2012-01-29 21:36:23 +00:00
Jeremiah Willcock 9d353c53e2 Added documentation and examples from David Doria
[SVN r76779]
2012-01-29 21:08:40 +00:00
Jeremiah Willcock a1fc58cc93 Added directed_graph stub documentation from David Doria
[SVN r76778]
2012-01-29 19:04:46 +00:00
Jeremiah Willcock f63ebe9a8b Added example from David Doria
[SVN r76726]
2012-01-27 22:06:21 +00:00
Jeremiah Willcock 1c7c456e18 Changed another property map type to const_type
[SVN r76654]
2012-01-23 19:57:42 +00:00
Jeremiah Willcock e761a6b4d0 Fixed typo from #6435 plus others; fixes #6435
[SVN r76651]
2012-01-23 16:07:05 +00:00
K. Noel Belcourt cddab52a7b Fix astar_search graph test.
[SVN r76648]
2012-01-23 02:52:23 +00:00
Jeremiah Willcock 3af4b053be Fixed issue with printing const graphs
[SVN r76588]
2012-01-19 16:35:28 +00:00
Jeremiah Willcock 210e7857b2 Removed redundant function_requires in test case
[SVN r76537]
2012-01-15 23:59:39 +00:00
Jeremiah Willcock a4dc3d7b23 Merged r75066, r75067, r75124, r75140, r75165, r75861, r75862, r75863, r75878, r75906, r75970, r75973, r75974, and r76394 from trunk
[SVN r76536]
2012-01-15 23:52:45 +00:00
Jeremiah Willcock 4b95dcfbe9 Merged r76050, r75547, r75891, r76049, r76083, and r76439 from trunk (reverse_graph bug fixes and fix for #6293); refs #6293
[SVN r76535]
2012-01-15 23:32:09 +00:00
Jeremiah Willcock f761059ecd Applied some fixes from #6313; fixes #6313
[SVN r76439]
2012-01-12 20:27:31 +00:00
Jeremiah Willcock a439c48425 Applied patch from #6371; fixes #6371
[SVN r76394]
2012-01-10 01:29:38 +00:00
Jeremiah Willcock 99f7ed91af Applied patch from bug #6306; fixes #6306
[SVN r76083]
2011-12-20 18:49:09 +00:00
Jeremiah Willcock cd1fee5f7d Applied fixed version of patch from #6293; fixes #6293
[SVN r76050]
2011-12-18 21:09:34 +00:00
Jeremiah Willcock 231bb5dbfb Added documented way to get underlying edge descriptor from a reverse_graph; changed name of member to prevent future use
[SVN r76049]
2011-12-18 20:53:26 +00:00
Steven Watanabe 456f4006cb Remove unused library.
[SVN r75974]
2011-12-15 22:59:03 +00:00
Jeremiah Willcock 52d7bc8d5e Applied patch from Jens Muller
[SVN r75973]
2011-12-15 22:36:20 +00:00
Steven Watanabe 8f3dd3a4f9 Fix search for SDB and LEDA.
[SVN r75970]
2011-12-15 22:07:53 +00:00
Jeremiah Willcock 79573b5dbd Added another copy_graph hack for transpose_graph
[SVN r75906]
2011-12-11 21:09:33 +00:00
Jeremiah Willcock fc1619d91e Fixed copying of reverse_graphs to compensate for new reverse_edge_descriptor class
[SVN r75891]
2011-12-11 07:19:19 +00:00
Jeremiah Willcock 17f92dd61e Added include of <stack>; fixes #6246
[SVN r75878]
2011-12-09 17:53:43 +00:00
Jeremiah Willcock 2a5874c7b9 Fixed typo
[SVN r75863]
2011-12-08 02:00:04 +00:00
Jeremiah Willcock 03193c2fb4 Added documentation for edge_predecessor_recorder and fixed several typos in other doc pages
[SVN r75862]
2011-12-08 01:59:21 +00:00
Jeremiah Willcock 345a6b964b Removed debugging output; fixes #6239
[SVN r75861]
2011-12-08 01:43:39 +00:00
Jeremiah Willcock 366cd32060 Added comparison operators; fixes #6137
[SVN r75547]
2011-11-18 20:06:07 +00:00
Jeremiah Willcock a88250f76f Merged change r75431 from trunk; refs #6112
[SVN r75471]
2011-11-13 06:10:55 +00:00
Jeremiah Willcock 2b2f2d464e Qualified more calls to tie; fixes #6112
[SVN r75431]
2011-11-10 15:04:27 +00:00
Jeremiah Willcock 3619e54948 Fixed degree_vertex_invariant::max; fixes #5881
[SVN r75165]
2011-10-29 06:11:02 +00:00
Jeremiah Willcock d6643f50f3 Added missing "end for"; fixes #6061
[SVN r75140]
2011-10-27 19:51:37 +00:00
Jeremiah Willcock 63249fa231 Removed hash<void*> specialization
[SVN r75124]
2011-10-27 01:17:35 +00:00
Jeremiah Willcock 6f91f83d2e Removed incorrect != 0 test on boost::optional; fixes #6044
[SVN r75074]
2011-10-20 21:32:45 +00:00
Jeremiah Willcock 2edbcb500f Fixed strange use of pred map, and changed algorithm to be more similar to Tarjan paper cited in bibliography; fixes #6033
[SVN r75067]
2011-10-19 20:03:54 +00:00
Jeremiah Willcock ffff89b1a2 Refactored and added test graph from Andre Dau
[SVN r75066]
2011-10-19 20:03:00 +00:00
Jeremiah Willcock 3a546c9418 Merged r72747, r74075, r74094, r74232, r74357, r74602, and r74783 from trunk
[SVN r74862]
2011-10-09 20:33:56 +00:00
Jeremiah Willcock 27e5672047 Fixed typo
[SVN r74783]
2011-10-07 21:28:22 +00:00
Jeremiah Willcock 4a19d6d288 Applied patch from #5919; fixes #5919
[SVN r74602]
2011-09-28 19:04:30 +00:00
Jeremiah Willcock 4778a4b359 Fixed link
[SVN r74357]
2011-09-12 15:01:25 +00:00
Jeremiah Willcock fd37deb67b Added requirement to link to Boost.Regex
[SVN r74232]
2011-09-04 18:47:27 +00:00
Jeremiah Willcock 90678ab0fa Fixed inspection report issues
[SVN r74094]
2011-08-27 19:35:05 +00:00
Jeremiah Willcock 48b3020f7d Added parentheses around call to numeric_limits::max; fixes #5813
[SVN r74075]
2011-08-26 17:33:02 +00:00
Jeremiah Willcock 9f29ef1a83 Merged in BGL, enable_if, and related changes from trunk: r67035, r57559, r72837, r73010, r73026, r72960, r73425, r73424, r73009, r73998, r73997, r73006, r73630, r73631, r73999, r73422, r73423, r73996, r71221
[SVN r74023]
2011-08-23 18:26:46 +00:00
Jeremiah Willcock b156db0c9e Fixed traits class name
[SVN r73999]
2011-08-22 01:44:08 +00:00
Jeremiah Willcock 9c7f42c58a Changed to custom edge_descriptor type in reverse_graph to avoid ambiguities when using a std::pair edge_descriptor from an underlying graph
[SVN r73997]
2011-08-22 01:43:07 +00:00
Jeremiah Willcock c0bc3e3aea Fixed documentation based on issues found by Ragavendran Gopalakrishnan
[SVN r73996]
2011-08-22 01:42:12 +00:00
Jeremiah Willcock fee2e45a8c Fixed vertex count computation for case where number of vertices does not fit into an int
[SVN r73631]
2011-08-09 19:32:20 +00:00
Jeremiah Willcock f0343d2264 Fixed grid graph for case where VertexIndex is smaller than int
[SVN r73630]
2011-08-09 19:23:16 +00:00
Jeremiah Willcock fcf6446201 Removed calls to exit(); fixes #5185
[SVN r73425]
2011-07-29 01:44:48 +00:00
Jeremiah Willcock 1180386ac1 Applied patch from #5506; fixes #5506
[SVN r73424]
2011-07-29 01:30:53 +00:00
Jeremiah Willcock b021084901 Added caveat about PDF file; refs #5633
[SVN r73423]
2011-07-29 01:16:43 +00:00
Jeremiah Willcock c416132bfe Fixed HTML documentation for isomorphism algorithm; refs #5633
[SVN r73422]
2011-07-29 01:12:57 +00:00
Jürgen Hunold fec3bd2314 Merge 73299,73301,73308 from ^/trunk
------------------------------------------------------------------------
r73299 | jhunold | 2011-07-22 14:08:03 +0200 (Fr, 22 Jul 2011) | 2 lines

Enable visibility support. Refs #2114.

------------------------------------------------------------------------
r73301 | jhunold | 2011-07-22 16:15:45 +0200 (Fr, 22 Jul 2011) | 2 lines

Enable visibility support. Refs #2114.

------------------------------------------------------------------------
r73308 | jhunold | 2011-07-23 11:24:35 +0200 (Sa, 23 Jul 2011) | 2 lines

Enable visibility support. Refs #2114.

------------------------------------------------------------------------


[SVN r73381]
2011-07-26 17:40:21 +00:00
Jürgen Hunold 8b4ac5cc39 Enable visibility support. Refs #2114.
[SVN r73308]
2011-07-23 09:24:35 +00:00
Jeremiah Willcock b6c54fa390 Weakened property map requirements further, removing uses of [] on property maps
[SVN r73026]
2011-07-13 01:04:47 +00:00
Jeremiah Willcock 6edd466d86 Weakened concept requirements
[SVN r73010]
2011-07-12 02:47:34 +00:00
Jeremiah Willcock f98a8afdd6 Fixed to work with graphs whose vertex_index maps are not the identity
[SVN r73009]
2011-07-12 01:26:09 +00:00
Jeremiah Willcock 9cf1345871 Added built-in reverse edge map for max-flow
[SVN r73006]
2011-07-11 19:54:19 +00:00
Jeremiah Willcock 55b82bd1f2 Applied patch from #5659, plus made similar changes to other algorithms that have inf parameters; did not add inf parameters to algorithms that did not already have them; fixes #5659
[SVN r72960]
2011-07-07 21:07:41 +00:00
Jeremiah Willcock 2c3505aec9 Fixed ith_bandwidth for directed graphs; changed bandwidth to use the graph edges rather than scanning the out edges of every vertex; other small fixes
[SVN r72837]
2011-07-01 19:36:08 +00:00
Jeremiah Willcock c5780610c6 Changed grid_graph to directed to match differing edge indices in documentation
[SVN r72747]
2011-06-24 22:49:29 +00:00
Jeremiah Willcock 081b1f90bf Merged r71166, r71238, r71300, r71489, r71704, and r71929 from trunk
[SVN r72334]
2011-06-01 16:58:36 +00:00
Jeremiah Willcock a4af894285 Changed to explicit stack as suggested by Aaron Windsor
[SVN r71929]
2011-05-13 23:50:01 +00:00
Jeremiah Willcock b407ea9309 Fixes
[SVN r71489]
2011-04-25 21:10:58 +00:00
Jeremiah Willcock 19b05b0cae Fixed typo
[SVN r71300]
2011-04-15 22:11:40 +00:00
Jeremiah Willcock 3131ffa454 Added note about broken example
[SVN r71238]
2011-04-14 02:30:56 +00:00
Jeremiah Willcock 1fa0cd9a26 Fixed C++0x array ambiguity
[SVN r71166]
2011-04-10 20:01:06 +00:00
Jeremiah Willcock 5a5b35b154 Merged r70875 from trunk
[SVN r70995]
2011-04-05 02:31:38 +00:00
Jeremiah Willcock 4b1c5fe438 Fixed types in bundled property docs; fixes #5410
[SVN r70875]
2011-04-02 18:43:03 +00:00
Jeremiah Willcock 03510b4a6e Merged more fixes from trunk; added is_sorted.hpp because that is needed for BGL fixes
[SVN r70704]
2011-03-29 19:07:16 +00:00
Jeremiah Willcock 30e9f22af4 Merged r67703-67704,68155,69263,69629,69726 from trunk
[SVN r70703]
2011-03-29 18:56:56 +00:00
Jeremiah Willcock 06bdbbcbba Changed concepts to use proper names for property types
[SVN r69726]
2011-03-08 20:53:50 +00:00
Jeremiah Willcock f52b7df417 Added includes of <utility> for Clang/libc++
[SVN r69629]
2011-03-07 19:28:34 +00:00
Jeremiah Willcock 2e4073a8b7 Merged bug fixes from trunk (r68781,r68949,r68972,r68979,r69021,r69404,r69430) for 1.46.1
[SVN r69502]
2011-03-03 00:29:41 +00:00
Jeremiah Willcock 516c833574 Removed superseded workaround from reverse_graph
[SVN r69430]
2011-03-01 03:20:29 +00:00
Jeremiah Willcock fd549fe0fa Made filtered_graph work with bundled graph properties by fixing bundle_type template; probably fixed other adapters as well
[SVN r69404]
2011-02-28 22:41:34 +00:00
Jeremiah Willcock b52d4724c2 Removed obsolete (and unused) file
[SVN r69263]
2011-02-25 06:37:46 +00:00
Jeremiah Willcock 66cd415568 Fixed typo as suggested by Shaun Jackman
[SVN r69021]
2011-02-19 04:17:48 +00:00
Jeremiah Willcock d44293d8a8 Fixed buffer overflow from parallel edges in isomorphism(); fixes #5175
[SVN r68979]
2011-02-17 23:00:20 +00:00
Jeremiah Willcock a0c90983ab Fixed escaping using patch from #5199; fixes #5199
[SVN r68972]
2011-02-17 20:02:58 +00:00
Jeremiah Willcock bb1ce866f8 Applied second patch from #5180; fixes #5180
[SVN r68949]
2011-02-16 16:35:42 +00:00
Jeremiah Willcock ac4b12107f Changed "continue" to "break" in remove_edge_if; fixes #5181
[SVN r68781]
2011-02-11 18:39:11 +00:00
Steven Watanabe a4452c3539 Revert [67111] (addition of boost/detail/iomanip.hpp) and all the commits that depend on it. ([68137], [68140], [68141], [68154], and [68165]).
[SVN r68168]
2011-01-15 08:11:51 +00:00
Bryce Adelstein-Lelbach 074277924a Replacing the use of <iomanip> with <boost/detail/iomanip.hpp> across Boost.
On Linux, GNU's libstdc++, which is the default stdlib for icc and clang,
cannot parse the <iomanip> header in version 4.5+ (which thankfully neither
compiler advises the use of yet), as it's original C++98-friendly
implementation has been replaced with a gnu++0x implementation.
<boost/detail/iomanip.hpp> is a portable implementation of <iomanip>, providing
boost::detail::setfill, boost::detail::setbase, boost::detail::setw,
boost::detail::setprecision, boost::detail::setiosflags and
boost::detail::resetiosflags. 



[SVN r68140]
2011-01-14 02:35:58 +00:00
Jeremiah Willcock 6e73c470a4 Removed BOOST_FILESYSTEM_VERSION setting from test cases and removed Filesystem v2 workaround
[SVN r68001]
2011-01-11 22:19:57 +00:00
Jeremiah Willcock 1963179514 Removed Boost.Test #defines from test case
[SVN r67971]
2011-01-11 19:00:35 +00:00
Jeremiah Willcock bd69c0c5cf Merged r66528,66559,66960,67010,67012,67033,67035,67038,67040,67069,67086,67723,67914 from trunk
[SVN r67970]
2011-01-11 18:52:51 +00:00
Jeremiah Willcock dcd9920780 Updated removal version
[SVN r67968]
2011-01-11 18:19:59 +00:00
Jeremiah Willcock 8b4eb672e0 Merged r67041,67084,67110,67705-67706,67722,67724,67764 (bug fixes) from trunk, plus allowed Boost.Filesystem v2 to be used in boost/distributed/adjlist/serialization.hpp
[SVN r67967]
2011-01-11 18:17:40 +00:00
Jeremiah Willcock ec5f6a655c Fixed URL
[SVN r67914]
2011-01-10 15:20:55 +00:00
Jeremiah Willcock e5341acc43 Changed to StringAlgo for replace operation rather than Xpressive
[SVN r67764]
2011-01-07 21:36:01 +00:00
Jeremiah Willcock 19679d3851 Simplifying code for VC++ 7.1
[SVN r67724]
2011-01-06 16:30:58 +00:00
Jeremiah Willcock 3624e74d13 Fixed typo
[SVN r67723]
2011-01-06 16:24:56 +00:00
Jeremiah Willcock ae33127eed Added disambiguation of regex_replace() overloads for VC++ 7.1
[SVN r67722]
2011-01-06 16:08:05 +00:00
Jeremiah Willcock 43386bca5c Fixed assert inspection issues in sequential BGL
[SVN r67705]
2011-01-06 02:08:41 +00:00
Jeremiah Willcock 287529480f Removed deprecated code and docs
[SVN r67704]
2011-01-06 02:00:35 +00:00
Jeremiah Willcock 6fb2f7edec Removed deprecated file
[SVN r67703]
2011-01-06 01:51:16 +00:00
Jeremiah Willcock 4a5c105654 Applied patch from #4966 to fix self-loop insertion; fixes #4966
[SVN r67110]
2010-12-08 18:11:52 +00:00
Jeremiah Willcock f132fd060f Using incantation from Boost.Math (test_laplace.cpp) to try to get Boost.Test linking to work
[SVN r67086]
2010-12-07 17:35:24 +00:00
Jeremiah Willcock 595b9abbdc Simplified code for VC++ 7.1
[SVN r67084]
2010-12-07 17:20:55 +00:00
Jeremiah Willcock 0415ceffe0 Removed dynamic linking to Boost.Test
[SVN r67069]
2010-12-06 18:20:16 +00:00
Jeremiah Willcock 4000bccb3d Fixed typo
[SVN r67040]
2010-12-05 20:43:45 +00:00
Jeremiah Willcock 2e5db3d026 Testing more example codes
[SVN r67038]
2010-12-05 20:39:59 +00:00
Jeremiah Willcock ff1775df18 Removed <boost/pending/integer_range.hpp> and a few more uses of it; fixes #4642
[SVN r67035]
2010-12-05 20:38:44 +00:00
Jeremiah Willcock b76015210d Turned off VC++ auto-linking
[SVN r67033]
2010-12-05 20:24:28 +00:00
Jeremiah Willcock cf1943fb84 Merged r67031 from trunk
[SVN r67032]
2010-12-05 20:21:37 +00:00
Jeremiah Willcock 086a94c8a5 Applied patch from Matthias Walter
[SVN r67031]
2010-12-05 20:17:48 +00:00
Jeremiah Willcock 0ec513eab1 Merged r67014 from trunk
[SVN r67015]
2010-12-04 20:51:15 +00:00
Jeremiah Willcock 10b41afc0f Fixed uninitialized variables
[SVN r67014]
2010-12-04 20:49:49 +00:00
Jeremiah Willcock c3aad6b27e Merged r67011 from trunk
[SVN r67013]
2010-12-04 20:46:50 +00:00
Jeremiah Willcock cc07f4c201 Moved #define up
[SVN r67012]
2010-12-04 20:45:42 +00:00
Jeremiah Willcock 904b4cc924 Forcing filesystem version 3
[SVN r67011]
2010-12-04 20:45:09 +00:00
Jeremiah Willcock e864071546 Put in more checks to avoid seg faults
[SVN r67010]
2010-12-04 20:39:00 +00:00
Jeremiah Willcock 979e02a617 Merged r67008 from trunk
[SVN r67009]
2010-12-04 20:33:36 +00:00
Jeremiah Willcock 9bcc1b9a69 Changed to Boost.Filesystem v3
[SVN r67008]
2010-12-04 20:31:33 +00:00
Jeremiah Willcock 11d2d38a51 Merged r66286, r66707, r66900, and r66907 from trunk
[SVN r67007]
2010-12-04 20:21:20 +00:00
Jeremiah Willcock db812aa773 Fixed complexity of Dijkstra's algorithm; fixes #4852
[SVN r66960]
2010-12-01 20:15:41 +00:00
Jeremiah Willcock 6c48845da8 Fixed up computation of property types; fixes #1021
[SVN r66907]
2010-11-30 18:16:29 +00:00
Jeremiah Willcock fb567057df Fixed bundled graph properties in filtered_graph; fixes #4914
[SVN r66900]
2010-11-30 17:48:33 +00:00
Jeremiah Willcock 8e365de488 Applied patch from #4887 -- thank you for the bug report and patch; fixes #4887
[SVN r66707]
2010-11-24 01:23:42 +00:00
Jeremiah Willcock a934539462 Fixed typo; fixes #4851
[SVN r66559]
2010-11-13 15:04:24 +00:00
Jeremiah Willcock f5b408ef7f Removed access to (unused) edge id attribute, also making that attribute optional; fixes #4843
[SVN r66528]
2010-11-12 15:34:20 +00:00
Jeremiah Willcock 7d02f7dd6b Applied patch from Daniel Trebbien
[SVN r66286]
2010-10-30 20:16:17 +00:00
Daniel James 11187e5a25 Link fixes.
[SVN r66273]
2010-10-30 14:32:50 +00:00
Jeremiah Willcock 55dec7c079 Fixed signature of copy_one_vertex(); refs #4793
[SVN r66204]
2010-10-26 18:37:29 +00:00
Jeremiah Willcock a3786d7f7e Repaired copy_component() using suggestion from Christopher Alfeld; fixes #4793
[SVN r66203]
2010-10-26 18:24:01 +00:00
Jeremiah Willcock 822fc80494 Merged patch from #4631 and made appropriate doc changes; fixes #4631
[SVN r66099]
2010-10-19 16:00:15 +00:00
Jeremiah Willcock 24a2de892f Fixed remove_edge_if and clear_vertex for subgraphs; commented out remove_vertex; refs #4752; fixes #4753
[SVN r66098]
2010-10-19 15:55:27 +00:00
Jeremiah Willcock 61d37fe743 Repeating edge insertions (up to a limit) when they fail in generate_random_graph; fixes #4758
[SVN r66097]
2010-10-19 15:46:00 +00:00
Jeremiah Willcock 7ba05ec487 Clarified docs further; fixes #4731
[SVN r65964]
2010-10-14 19:02:03 +00:00
Jeremiah Willcock f66d119969 Fixed documentation of distance map; fixes #4737
[SVN r65963]
2010-10-14 18:58:00 +00:00
Andrew Sutton adc6eb0f0d Clarifying references to MST in Dijkstra's SP algorithm.
[SVN r65939]
2010-10-13 13:47:23 +00:00
Jeremiah Willcock 7b97cbf393 Fixed const issue on VC++ 8; fixes #4715
[SVN r65836]
2010-10-08 17:32:57 +00:00
Jeremiah Willcock 89cd3d8a8a Added patch from Daniel Trebbien
[SVN r65593]
2010-09-26 02:29:42 +00:00
1453 changed files with 175180 additions and 107580 deletions
+16
View File
@@ -0,0 +1,16 @@
BasedOnStyle: WebKit
Standard: Cpp03
AlignAfterOpenBracket: false
AlignEscapedNewlinesLeft: true
AlwaysBreakAfterDefinitionReturnType: None
BreakBeforeBraces: Allman
BreakConstructorInitializersBeforeComma: false
BreakTemplateDeclarations: Yes
ColumnLimit: 80
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 0
IndentCaseLabels: false
SortIncludes: false
AlignTrailingComments: false
SpacesInAngles: true
+49
View File
@@ -0,0 +1,49 @@
# Use, modification, and distribution are
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE.txt)
#
# Copyright Rene Rivera 2020.
# For Drone CI we use the Starlark scripting language to reduce duplication.
# As the yaml syntax for Drone CI is rather limited.
#
#
globalenv={'ADD_UBUNTU_TOOLCHAIN_PPA': 'true'}
linuxglobalimage="cppalliance/droneubuntu1604:1"
windowsglobalimage="cppalliance/dronevs2019"
def main(ctx):
return [
linux_cxx("g++-7 14", "g++-7", packages="g++-7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("g++-7 17", "g++-7", packages="g++-7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("g++-8 14", "g++-8", packages="g++-8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-8', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("g++-8 17", "g++-8", packages="g++-8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-8', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("g++-9 14", "g++-9", packages="g++-9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("g++-9 17", "g++-9", packages="g++-9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("g++-9 2a", "g++-9", packages="g++-9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': '2a', }, globalenv=globalenv),
linux_cxx("g++-10 14", "g++-10", packages="g++-10", image="cppalliance/droneubuntu2004:1", buildtype="boost", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("g++-10 17", "g++-10", packages="g++-10", image="cppalliance/droneubuntu2004:1", buildtype="boost", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("g++-10 20", "g++-10", packages="g++-10", image="cppalliance/droneubuntu2004:1", buildtype="boost", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': '20', }, globalenv=globalenv),
linux_cxx("clang++-7 14", "clang++-7", packages="clang-7", llvm_os="xenial", llvm_ver="7", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-7', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("clang++-7 17", "clang++-7", packages="clang-7", llvm_os="xenial", llvm_ver="7", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-7', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("clang++-8 14", "clang++-8", packages="clang-8", llvm_os="xenial", llvm_ver="8", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("clang++-8 17", "clang++-8", packages="clang-8", llvm_os="xenial", llvm_ver="8", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("clang++-9 14", "clang++-9", packages="clang-9", llvm_os="xenial", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("clang++-9 17", "clang++-9", packages="clang-9", llvm_os="xenial", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("clang++-10 14", "clang++-10", packages="clang-10", llvm_os="xenial", llvm_ver="10", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("clang++-10 17", "clang++-10", packages="clang-10", llvm_os="xenial", llvm_ver="10", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("clang++-10 20", "clang++-10", packages="clang-10", llvm_os="xenial", llvm_ver="10", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': '20', }, globalenv=globalenv),
osx_cxx("XCode-11.7 14", "clang++", packages="", buildtype="boost", xcode_version="11.7", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '14', }, globalenv=globalenv),
osx_cxx("XCode-11.7 17", "clang++", packages="", buildtype="boost", xcode_version="11.7", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '17', }, globalenv=globalenv),
]
# from https://github.com/boostorg/boost-ci
load("@boost_ci//ci/drone/:functions.star", "linux_cxx","windows_cxx","osx_cxx","freebsd_cxx")
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
+42
View File
@@ -0,0 +1,42 @@
#!/bin/bash
set -ex
export TRAVIS_BUILD_DIR=$(pwd)
export DRONE_BUILD_DIR=$(pwd)
export TRAVIS_BRANCH=$DRONE_BRANCH
export VCS_COMMIT_ID=$DRONE_COMMIT
export GIT_COMMIT=$DRONE_COMMIT
export PATH=~/.local/bin:/usr/local/bin:$PATH
echo '==================================> BEFORE_INSTALL'
. .drone/before-install.sh
echo '==================================> INSTALL'
cd ..
git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule update --init tools/build
git submodule update --init libs/config
git submodule update --init tools/boost_install
git submodule update --init libs/headers
git submodule update --init tools/boostdep
cp -r $TRAVIS_BUILD_DIR/* libs/graph
python tools/boostdep/depinst/depinst.py graph
./bootstrap.sh
./b2 headers
echo '==================================> BEFORE_SCRIPT'
. $DRONE_BUILD_DIR/.drone/before-script.sh
echo '==================================> SCRIPT'
echo "using $TOOLSET : : $COMPILER : $OPTIONS ;" > ~/user-config.jam
(cd libs/config/test && ../../../b2 cxxstd=$CXXSTD config_info_travis_install toolset=$TOOLSET && ./config_info_travis)
(cd libs/graph/test && ../../../b2 -j3 cxxstd=$CXXSTD toolset=$TOOLSET define=CI_SUPPRESS_KNOWN_ISSUES)
echo '==================================> AFTER_SUCCESS'
. $DRONE_BUILD_DIR/.drone/after-success.sh
+42
View File
@@ -0,0 +1,42 @@
#!/bin/bash
set -ex
export TRAVIS_BUILD_DIR=$(pwd)
export DRONE_BUILD_DIR=$(pwd)
export TRAVIS_BRANCH=$DRONE_BRANCH
export VCS_COMMIT_ID=$DRONE_COMMIT
export GIT_COMMIT=$DRONE_COMMIT
export PATH=~/.local/bin:/usr/local/bin:$PATH
echo '==================================> BEFORE_INSTALL'
. .drone/before-install.sh
echo '==================================> INSTALL'
cd ..
git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule update --init tools/build
git submodule update --init libs/config
git submodule update --init tools/boost_install
git submodule update --init libs/headers
git submodule update --init tools/boostdep
cp -r $TRAVIS_BUILD_DIR/* libs/graph
python tools/boostdep/depinst/depinst.py graph
./bootstrap.sh
./b2 headers
echo '==================================> BEFORE_SCRIPT'
. $DRONE_BUILD_DIR/.drone/before-script.sh
echo '==================================> SCRIPT'
echo "using $TOOLSET : : $COMPILER : $OPTIONS ;" > ~/user-config.jam
(cd libs/config/test && ../../../b2 cxxstd=$CXXSTD config_info_travis_install toolset=$TOOLSET && ./config_info_travis)
(cd libs/graph/test && ../../../b2 -j3 cxxstd=$CXXSTD toolset=$TOOLSET define=CI_SUPPRESS_KNOWN_ISSUES)
echo '==================================> AFTER_SUCCESS'
. $DRONE_BUILD_DIR/.drone/after-success.sh
+19
View File
@@ -0,0 +1,19 @@
# Code owners for Boost.Graph
#
# When a PR is opened, GitHub automatically requests review from the matching
# owners listed below. The order of rules matters: later, more specific rules
# override earlier, more general ones.
#
# Authoritative maintainer list: meta/libraries.json
# Contact details: CONTRIBUTING.md#maintainers
# Default reviewers for everything
* @jeremy-murphy @becheler
# Documentation, contributor-facing files, and CI configuration
/doc/ @becheler
/README.md @becheler
/CONTRIBUTING.md @becheler
/SECURITY.md @becheler
/CODE_OF_CONDUCT.md @becheler
/.github/ @becheler
+84
View File
@@ -0,0 +1,84 @@
---
name: Bug report
about: Report a defect or unexpected behavior in Boost.Graph
title: ''
labels: ''
type: Bug
assignees: ''
---
<!--
Thank you for taking the time to file a bug report. Please fill in as much
of the template below as you can. Reports without a reproducer or
environment details are very hard to triage.
-->
### Before filing
- [ ] I searched the [existing issues](https://github.com/boostorg/graph/issues?q=is%3Aissue) and did not find a duplicate.
- [ ] I have reproduced the bug against the `develop` branch or the latest Boost release.
- [ ] I have a minimal reproducer (or I will paste my full failing code below).
### Boost version
<!--
You can find the version number in `<boost/version.hpp>`, or by running
`git log -1` in your local Boost.Graph checkout.
-->
### Compiler family
- [ ] GCC / g++
- [ ] Clang / clang++
- [ ] MSVC (Visual Studio)
- [ ] Intel / oneAPI
- [ ] Other (specify below)
Exact compiler version: <!-- e.g. g++ 13.2.0, clang 17.0.6, MSVC 19.39 -->
### Standard library
- [ ] libstdc++
- [ ] libc++
- [ ] MSVC STL
- [ ] Other (specify below)
### Operating system
- [ ] Linux
- [ ] macOS
- [ ] Windows
- [ ] Other (specify below)
### Kind of component affected
- [ ] Graph data structure (e.g. `adjacency_list`, `adjacency_matrix`)
- [ ] Algorithm (e.g. `dijkstra_shortest_paths`, `breadth_first_search`)
- [ ] Property map
- [ ] I/O or file-format reader (e.g. `read_graphml`, `read_graphviz`)
- [ ] Visitor / event hooks
- [ ] Other (specify below)
Exact name of the affected component: <!-- e.g. dijkstra_shortest_paths -->
### Steps to reproduce
<!--
A minimal compiling program that demonstrates the problem is ideal.
A [Compiler Explorer](https://godbolt.org/z/9Esszr9Ga) link is even better.
-->
### Expected behavior
### Actual behavior
<!--
Include compiler error messages or runtime output verbatim, with file and
line numbers where applicable.
-->
### Are you willing to help?
- [ ] I'd like to submit a fix as a pull request.
- [ ] I can help diagnose or test a candidate fix.
- [ ] I'm only reporting the issue.
+9
View File
@@ -0,0 +1,9 @@
blank_issues_enabled: false
contact_links:
- name: Design discussion or open-ended question
url: https://github.com/boostorg/graph/discussions
about: |
For "should we...?" questions, design exploration, or anything not
yet a concrete proposal, please start a GitHub Discussion. Issues
are reserved for bugs, feature requests with a concrete proposal,
and documentation problems.
+59
View File
@@ -0,0 +1,59 @@
---
name: Documentation issue
about: Report missing, incorrect, or unclear documentation
title: ''
labels: docs
type: Task
assignees: ''
---
<!--
Documentation problems are real issues. Thanks for taking the time to
report one.
-->
### Before filing
- [ ] I searched the [existing issues](https://github.com/boostorg/graph/issues?q=is%3Aissue+label%3Adocs) and did not find a duplicate.
- [ ] I checked the latest version of the documentation on `develop`.
### Kind of problem
- [ ] Documentation is missing entirely
- [ ] Documentation is incorrect or out of date
- [ ] Explanation is unclear or confusing
- [ ] Example does not compile
- [ ] Example compiles but does not produce the documented result
- [ ] Dead link or broken cross-reference
- [ ] Other (specify below)
### Where is the issue?
<!--
A link to the page, or the path to the file (for example,
`doc/quick_tour.html` or `include/boost/graph/dijkstra_shortest_paths.hpp`).
-->
### What is wrong, missing, or unclear?
<!--
For example: an example does not compile, an algorithm's complexity is
not stated, a parameter is undocumented, an explanation is confusing.
-->
### What did you expect to find?
<!-- What information would have helped you? -->
### Suggested wording (optional)
<!--
If you already have an idea of what the docs should say, paste a draft
here.
-->
### Are you willing to help?
- [ ] I'd like to submit a docs pull request.
- [ ] I can review a candidate fix.
- [ ] I'm only reporting the issue.
+72
View File
@@ -0,0 +1,72 @@
---
name: Feature request
about: Suggest a new algorithm, API addition, or enhancement
title: ''
labels: ''
type: Feature
assignees: ''
---
<!--
Thanks for proposing an addition to Boost.Graph.
If you want to explore an idea or discuss whether a feature would be
worthwhile before committing to a concrete proposal, please start a
GitHub Discussion instead:
https://github.com/boostorg/graph/discussions
This template is for requests with a clear, actionable proposal: a
specific algorithm, API, or enhancement that a maintainer could
reasonably implement or review.
-->
### Before filing
- [ ] I searched the [existing issues](https://github.com/boostorg/graph/issues?q=is%3Aissue) and did not find a duplicate.
- [ ] This is a concrete proposal, not an open-ended design question.
### Kind of addition
- [ ] New algorithm
- [ ] New data structure
- [ ] New property map or utility
- [ ] New I/O format reader or writer
- [ ] Extension to an existing component
- [ ] Performance improvement
- [ ] Other (specify below)
### Motivation
<!--
What problem does this feature solve? Who would use it, and in what
context?
-->
### Proposed addition
<!--
A new algorithm, a new data structure, an extension to an existing
component, or something else? If you have a rough API sketch, paste it
here.
-->
### Relation to existing Boost.Graph components
<!--
Does this overlap with or build on something that already exists in the
library (for example, an existing algorithm or property map)?
-->
### Prior art
- [ ] Reference paper or textbook (cite below)
- [ ] Implementation in another library (link below)
- [ ] None / original idea
References: <!-- paste DOI, ISBN, or URL -->
### Are you willing to contribute?
- [ ] I'd like to submit the implementation as a pull request.
- [ ] I can help with review or testing, but not the implementation.
- [ ] I'm only proposing the idea.
+50
View File
@@ -0,0 +1,50 @@
<!--
Thanks for contributing to Boost.Graph! A few notes before you fill this in:
* Target the `develop` branch.
* New contributions must be licensed under the
[Boost Software License 1.0](https://www.boost.org/LICENSE_1_0.txt).
* Please link any related issue with `Fixes #N` or `Refs #N`.
-->
### Before submitting
- [ ] This PR targets the `develop` branch.
- [ ] I searched for an existing PR or issue covering the same change.
- [ ] My contribution is licensed under the Boost Software License 1.0.
### Type of change
- [ ] Bug fix
- [ ] New feature or API addition
- [ ] Refactor (no behavior change)
- [ ] Documentation
- [ ] Build, CI, or tooling
- [ ] Other (specify below)
### Does this PR introduce a breaking change?
- [ ] Yes (describe migration impact below)
- [ ] No
### What this PR does
<!-- A short summary of the change. -->
### Motivation
<!-- Why is this needed? Link related issue with `Fixes #N` or `Refs #N`. -->
### Testing
<!--
How did you verify the change? Which compilers and standard libraries did
you build against? Were new tests added under `test/`?
-->
### Checklist
- [ ] Existing tests pass (`b2` in the `test/` directory).
- [ ] New behavior is covered by a test, or this is a docs / build / refactor change.
- [ ] Documentation was updated if user-facing behavior changed.
- [ ] No new compiler warnings on the platforms I built against.
+48
View File
@@ -0,0 +1,48 @@
#!/usr/bin/env python3
"""Print a markdown table comparing compiler-warning counts between two CI log archives.
Usage: warn_table.py BASELINE.zip AFTER.zip
A warning is a line matching 'file:line:col: warning:' (clang/gcc) or 'warning Cxxxx'
(msvc). Linker, "N warnings generated" summary, and CI-runner lines are not counted.
"""
import re
import sys
import zipfile
WARNING = re.compile(r":\d+:\d+: warning:|warning C\d+")
def counts(zip_path):
"""Map each CI job to its warning count, read from the run's log archive."""
result = {}
with zipfile.ZipFile(zip_path) as archive:
for entry in archive.namelist():
# Top-level per-job logs are named like "12_ubuntu (gcc-14, 14).txt".
if "/" in entry or not entry.endswith(".txt"):
continue
job = re.sub(r"^\d+_", "", entry[:-4])
log = archive.read(entry).decode("utf-8", "replace")
result[job] = sum(1 for line in log.splitlines() if WARNING.search(line))
return result
def main(baseline_zip, after_zip):
baseline = counts(baseline_zip)
after = counts(after_zip)
print("| Job | Baseline | After | Delta |")
print("|-----|---------:|------:|------:|")
for job in sorted(baseline.keys() | after.keys()):
if "cmake" in job: # cmake jobs build only the library, they never warn
continue
before = baseline.get(job, 0)
now = after.get(job, 0)
diff = now - before
delta = f"{diff:+d}" if diff else "0"
print(f"| {job} | {before} | {now} | {delta} |")
if __name__ == "__main__":
if len(sys.argv) != 3:
sys.exit("usage: warn_table.py BASELINE.zip AFTER.zip")
main(sys.argv[1], sys.argv[2])
+357
View File
@@ -0,0 +1,357 @@
# Copyright 2020 Evan Miller
# Copyright 2020 Matt Borland
# Copyright 2021 John Maddock
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
name: CI
on: [ push, pull_request ]
jobs:
ubuntu:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
compiler: [ gcc-14, clang-19 ]
cxxstd: [ 14, 17, 20, 23 ]
steps:
- uses: actions/checkout@master
with:
fetch-depth: '0'
- uses: mstachniuk/ci-skip@v1
with:
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE]'
commit-filter-separator: ';'
fail-fast: true
- name: Set ENV
run: |
echo ${{ matrix.compiler }} | awk '/^gcc/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV
echo ${{ matrix.compiler }} | awk '/^gcc/ { gsub(/gcc/,"CXX=g++"); print; } /^clang/ { gsub(/clang/,"CXX=clang++"); print; }' >> $GITHUB_ENV
- name: Install packages
run: sudo apt install ${{ matrix.compiler }}
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: cp -r $GITHUB_WORKSPACE/* libs/graph
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py graph
working-directory: ../boost-root
- name: Bootstrap
run: ./bootstrap.sh
working-directory: ../boost-root
- name: Generate headers
run: ./b2 headers
working-directory: ../boost-root
- name: Generate user config
run: 'echo "using $TOOLSET : : $CXX ;" > ~/user-config.jam'
working-directory: ../boost-root
- name: Config info
run: ../../../b2 print_config_info toolset=$TOOLSET cxxstd=${{ matrix.cxxstd }}
working-directory: ../boost-root/libs/config/test
- name: Test
run: ../../../b2 toolset=$TOOLSET cxxstd=${{ matrix.cxxstd }}
working-directory: ../boost-root/libs/graph/test
macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
toolset: [ clang ]
cxxstd: [ 14, 17, 20 ]
steps:
- uses: actions/checkout@master
with:
fetch-depth: '0'
- uses: mstachniuk/ci-skip@v1
with:
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[linux];[Linux];[LINUX]'
commit-filter-separator: ';'
fail-fast: true
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: cp -r $GITHUB_WORKSPACE/* libs/graph
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py graph
working-directory: ../boost-root
- name: Bootstrap
run: ./bootstrap.sh
working-directory: ../boost-root
- name: Generate headers
run: ./b2 headers
working-directory: ../boost-root
- name: Config info
run: ../../../b2 print_config_info toolset=${{ matrix.toolset }} cxxstd=${{ matrix.cxxstd }}
working-directory: ../boost-root/libs/config/test
- name: Test
run: ../../../b2 toolset=${{ matrix.toolset }} cxxstd=${{ matrix.cxxstd }} define=CI_SUPPRESS_KNOWN_ISSUES
working-directory: ../boost-root/libs/graph/test
windows_msvc_14_3:
runs-on: windows-2022
defaults:
run:
shell: cmd
strategy:
fail-fast: false
matrix:
toolset: [ msvc-14.3 ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: mstachniuk/ci-skip@v1
with:
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX]'
commit-filter-separator: ';'
fail-fast: true
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\graph
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py graph
working-directory: ../boost-root
- name: Bootstrap
run: bootstrap
working-directory: ../boost-root
- name: Generate headers
run: b2 headers
working-directory: ../boost-root
- name: Config info
run: ..\..\..\b2 print_config_info cxxstd=14,17,20 address-model=64 toolset=msvc-14.3
working-directory: ../boost-root/libs/config/test
- name: Test
run: ..\..\..\b2 --hash address-model=64 cxxstd=14,17,20 toolset=msvc-14.3
working-directory: ../boost-root/libs/graph/test
posix-cmake-subdir:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
- os: ubuntu-24.04
- os: macos-14
- os: macos-15
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Install packages
if: matrix.install
run: sudo apt-get -y install ${{matrix.install}}
- name: Setup Boost
run: |
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
LIBRARY=${GITHUB_REPOSITORY#*/}
echo LIBRARY: $LIBRARY
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
echo GITHUB_REF: $GITHUB_REF
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}
echo REF: $REF
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
- name: Use library with add_subdirectory
run: |
cd ../boost-root/libs/$LIBRARY/test/cmake_subdir_test
mkdir __build__ && cd __build__
cmake ..
cmake --build .
ctest --output-on-failure --no-tests=error
posix-cmake-install:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
- os: ubuntu-24.04
- os: macos-14
- os: macos-15
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Install packages
if: matrix.install
run: sudo apt-get -y install ${{matrix.install}}
- name: Setup Boost
run: |
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
LIBRARY=${GITHUB_REPOSITORY#*/}
echo LIBRARY: $LIBRARY
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
echo GITHUB_REF: $GITHUB_REF
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}
echo REF: $REF
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
- name: Configure
run: |
cd ../boost-root
mkdir __build__ && cd __build__
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DCMAKE_INSTALL_PREFIX=~/.local ..
- name: Install
run: |
cd ../boost-root/__build__
cmake --build . --target install
- name: Use the installed library
run: |
cd ../boost-root/libs/$LIBRARY/test/cmake_install_test && mkdir __build__ && cd __build__
cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
cmake --build .
ctest --output-on-failure --no-tests=error
windows-cmake-subdir:
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
- os: windows-2025
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Setup Boost
shell: cmd
run: |
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
echo LIBRARY: %LIBRARY%
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
echo GITHUB_REF: %GITHUB_REF%
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
set BOOST_BRANCH=develop
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
echo BOOST_BRANCH: %BOOST_BRANCH%
cd ..
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
- name: Use library with add_subdirectory (Debug)
shell: cmd
run: |
cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test
mkdir __build__ && cd __build__
cmake ..
cmake --build . --config Debug
ctest --output-on-failure --no-tests=error -C Debug
- name: Use library with add_subdirectory (Release)
shell: cmd
run: |
cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test/__build__
cmake --build . --config Release
ctest --output-on-failure --no-tests=error -C Release
windows-cmake-install:
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
- os: windows-2025
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Setup Boost
shell: cmd
run: |
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
echo LIBRARY: %LIBRARY%
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
echo GITHUB_REF: %GITHUB_REF%
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
set BOOST_BRANCH=develop
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
echo BOOST_BRANCH: %BOOST_BRANCH%
cd ..
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
- name: Configure
shell: cmd
run: |
cd ../boost-root
mkdir __build__ && cd __build__
cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix ..
- name: Install (Debug)
shell: cmd
run: |
cd ../boost-root/__build__
cmake --build . --target install --config Debug
- name: Install (Release)
shell: cmd
run: |
cd ../boost-root/__build__
cmake --build . --target install --config Release
- name: Use the installed library (Debug)
shell: cmd
run: |
cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test && mkdir __build__ && cd __build__
cmake -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix ..
cmake --build . --config Debug
ctest --output-on-failure --no-tests=error -C Debug
- name: Use the installed library (Release)
shell: cmd
run: |
cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test/__build__
cmake --build . --config Release
ctest --output-on-failure --no-tests=error -C Release
+62
View File
@@ -0,0 +1,62 @@
name: docs-check
# PR-time sanity check for the Antora documentation:
# - b2 builds every example .cpp and regenerates its .txt sidecar
# (catches broken examples; failures here fail the job)
# - Antora renders the full site (catches broken .adoc, missing
# includes, broken xrefs)
#
# No deployment. The real publishing path is boostorg/release-tools,
# which auto-detects doc/build_antora.sh and ships to
# www.boost.org/doc/libs/<version>/libs/graph/.
on:
pull_request:
branches: ["develop", "documentation"]
workflow_dispatch:
permissions:
contents: read
jobs:
docs-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node 20
uses: actions/setup-node@v4
with:
node-version: '20'
# Set up boost-root so b2 can build the example .cpp files (needs
# the full Boost build tree, not just the headers we ship in this
# repo).
- name: Set up boost-root
run: |
git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
cd ../boost-root
git submodule update --init tools/boostdep
rm -rf libs/graph
cp -r "$GITHUB_WORKSPACE" libs/graph
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" graph
git submodule update --init --depth 1 libs/static_assert
./bootstrap.sh
./b2 headers
- name: Snapshot example outputs (b2)
working-directory: ../boost-root
run: ./b2 -j$(nproc) libs/graph/doc/modules/ROOT/examples
# Mirror the regenerated .txt sidecars back into the workspace so
# the Antora build below renders pages against fresh outputs.
- name: Mirror generated .txt back to workspace
run: rsync -a ../boost-root/libs/graph/doc/modules/ROOT/examples/ doc/modules/ROOT/examples/
# Build the site exactly as boostorg/release-tools will at release
# time: invoke doc/build_antora.sh, which runs npm ci + npx antora
# against the committed package-lock.json.
- name: Build the site (release-tools entry point)
working-directory: doc
run: ./build_antora.sh playbook.yml
@@ -0,0 +1,61 @@
name: warning-count-comment
on:
workflow_run:
workflows: ["CI"]
types: [completed]
permissions:
actions: read
pull-requests: write
contents: read
jobs:
comment:
if: github.event.workflow_run.event == 'pull_request'
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
PR_RUN: ${{ github.event.workflow_run.id }}
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
steps:
- uses: actions/checkout@v4
- name: Download this PR run's log archive
run: gh api "repos/$REPO/actions/runs/$PR_RUN/logs" > pr-logs.zip
- name: Download latest successful develop run's log archive
run: |
DEV=$(gh run list --workflow CI --branch develop --status success \
--limit 1 --json databaseId --jq '.[0].databaseId')
if [ -z "$DEV" ]; then echo "no develop baseline run found" >&2; exit 1; fi
echo "DEV_RUN=$DEV" >> "$GITHUB_ENV"
gh api "repos/$REPO/actions/runs/$DEV/logs" > base-logs.zip
- name: Generate table
run: |
{
echo "Compiler-warning counts vs \`develop\` (auto-generated)."
echo "PR run \`$PR_RUN\` vs develop run \`$DEV_RUN\` (\`${HEAD_SHA:0:10}\`)."
echo
python3 .github/scripts/warn_table.py base-logs.zip pr-logs.zip
} > table.md
- name: Resolve PR number
id: pr
run: |
num=$(gh api "repos/$REPO/pulls?state=open&per_page=100" \
--jq "map(select(.head.sha==\"$HEAD_SHA\"))[0].number")
if [ -z "$num" ]; then
echo "no open PR found with head $HEAD_SHA" >&2
exit 1
fi
echo "num=$num" >> "$GITHUB_OUTPUT"
- name: Post or update sticky comment
uses: marocchino/sticky-pull-request-comment@v2
with:
header: warning-counts
number: ${{ steps.pr.outputs.num }}
path: table.md
+20
View File
@@ -0,0 +1,20 @@
cube-fr.dot
cube.dot
disconnected-fr.dot
graphml_test_out.xml
kevin-bacon2.dat
random.dot
triangular-fr.dot
triangular-kk.dot
test/*.dot
example/routing-table.dat
example/figs/ospf-sptree.dot
CMakeFiles/
# Antora docs build artifacts
doc/build/
doc/node_modules/
# macOS
.DS_Store
**/.DS_Store
+253
View File
@@ -0,0 +1,253 @@
# Copyright 2020, 2021 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
# When we're part of the Boost super project.
cmake_minimum_required(VERSION 3.8...3.16)
project(boost_graph VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
add_library(boost_graph
src/graphml.cpp
src/read_graphviz_new.cpp
)
target_include_directories(boost_graph PUBLIC include)
target_link_libraries(boost_graph
PUBLIC
Boost::algorithm
Boost::any
Boost::array
Boost::assert
Boost::bimap
Boost::concept_check
Boost::config
Boost::container_hash
Boost::conversion
Boost::core
Boost::detail
Boost::foreach
Boost::function
Boost::integer
Boost::iterator
Boost::lexical_cast
Boost::math
Boost::move
Boost::mpl
Boost::multi_index
Boost::multiprecision
Boost::optional
Boost::parameter
Boost::preprocessor
Boost::property_map
Boost::property_tree
Boost::random
Boost::range
Boost::serialization
Boost::smart_ptr
Boost::spirit
Boost::throw_exception
Boost::tti
Boost::tuple
Boost::type_traits
Boost::typeof
Boost::unordered
Boost::utility
Boost::xpressive
PRIVATE
Boost::regex
)
target_compile_definitions(boost_graph
PUBLIC BOOST_GRAPH_NO_LIB
# Source files already define BOOST_GRAPH_SOURCE
# PRIVATE BOOST_GRAPH_SOURCE
)
else()
# When we're worked on by Boost.Graph developers.
# Using 3.29 for now until I figure out the differences with the new Boost
# config cmake introduced in 3.30.
cmake_minimum_required(VERSION 3.29)
project(boost_graph VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
# TODO: The super-project version is set explicitly just like this, but we
# should parse it from boost/version.hpp.
find_package(Boost 1.90.0 REQUIRED COMPONENTS regex)
add_library(boost_graph)
target_sources(boost_graph PUBLIC
FILE_SET HEADERS
BASE_DIRS "include"
FILES
include/boost/graph/adj_list_serialize.hpp
include/boost/graph/adjacency_iterator.hpp
include/boost/graph/adjacency_list.hpp
include/boost/graph/adjacency_list_io.hpp
include/boost/graph/adjacency_matrix.hpp
include/boost/graph/astar_search.hpp
include/boost/graph/bandwidth.hpp
include/boost/graph/bc_clustering.hpp
include/boost/graph/bellman_ford_shortest_paths.hpp
include/boost/graph/betweenness_centrality.hpp
include/boost/graph/biconnected_components.hpp
include/boost/graph/bipartite.hpp
include/boost/graph/boyer_myrvold_planar_test.hpp
include/boost/graph/boykov_kolmogorov_max_flow.hpp
include/boost/graph/breadth_first_search.hpp
include/boost/graph/bron_kerbosch_all_cliques.hpp
include/boost/graph/buffer_concepts.hpp
include/boost/graph/chrobak_payne_drawing.hpp
include/boost/graph/circle_layout.hpp
include/boost/graph/closeness_centrality.hpp
include/boost/graph/clustering_coefficient.hpp
include/boost/graph/compressed_sparse_row_graph.hpp
include/boost/graph/connected_components.hpp
include/boost/graph/copy.hpp
include/boost/graph/core_numbers.hpp
include/boost/graph/create_condensation_graph.hpp
include/boost/graph/cuthill_mckee_ordering.hpp
include/boost/graph/cycle_canceling.hpp
include/boost/graph/dag_shortest_paths.hpp
include/boost/graph/degree_centrality.hpp
include/boost/graph/depth_first_search.hpp
include/boost/graph/dijkstra_shortest_paths.hpp
include/boost/graph/dijkstra_shortest_paths_no_color_map.hpp
include/boost/graph/dimacs.hpp
include/boost/graph/directed_graph.hpp
include/boost/graph/dll_import_export.hpp
include/boost/graph/dominator_tree.hpp
include/boost/graph/eccentricity.hpp
include/boost/graph/edge_coloring.hpp
include/boost/graph/edge_connectivity.hpp
include/boost/graph/edge_list.hpp
include/boost/graph/edmonds_karp_max_flow.hpp
include/boost/graph/edmunds_karp_max_flow.hpp
include/boost/graph/erdos_renyi_generator.hpp
include/boost/graph/exception.hpp
include/boost/graph/exterior_property.hpp
include/boost/graph/filtered_graph.hpp
include/boost/graph/find_flow_cost.hpp
include/boost/graph/floyd_warshall_shortest.hpp
include/boost/graph/fruchterman_reingold.hpp
include/boost/graph/geodesic_distance.hpp
include/boost/graph/graph_archetypes.hpp
include/boost/graph/graph_as_tree.hpp
include/boost/graph/graph_concepts.hpp
include/boost/graph/graph_mutability_traits.hpp
include/boost/graph/graph_selectors.hpp
include/boost/graph/graph_stats.hpp
include/boost/graph/graph_traits.hpp
include/boost/graph/graph_utility.hpp
include/boost/graph/graphml.hpp
include/boost/graph/graphviz.hpp
include/boost/graph/grid_graph.hpp
include/boost/graph/gursoy_atun_layout.hpp
include/boost/graph/hawick_circuits.hpp
include/boost/graph/howard_cycle_ratio.hpp
include/boost/graph/incremental_components.hpp
include/boost/graph/is_kuratowski_subgraph.hpp
include/boost/graph/is_straight_line_drawing.hpp
include/boost/graph/isomorphism.hpp
include/boost/graph/iteration_macros.hpp
include/boost/graph/iteration_macros_undef.hpp
include/boost/graph/johnson_all_pairs_shortest.hpp
include/boost/graph/kamada_kawai_spring_layout.hpp
include/boost/graph/king_ordering.hpp
include/boost/graph/kruskal_min_spanning_tree.hpp
include/boost/graph/labeled_graph.hpp
include/boost/graph/leda_graph.hpp
include/boost/graph/lookup_edge.hpp
include/boost/graph/loop_erased_random_walk.hpp
include/boost/graph/make_biconnected_planar.hpp
include/boost/graph/make_connected.hpp
include/boost/graph/make_maximal_planar.hpp
include/boost/graph/matrix_as_graph.hpp
include/boost/graph/max_cardinality_matching.hpp
include/boost/graph/maximum_adjacency_search.hpp
include/boost/graph/maximum_weighted_matching.hpp
include/boost/graph/mcgregor_common_subgraphs.hpp
include/boost/graph/mesh_graph_generator.hpp
include/boost/graph/metis.hpp
include/boost/graph/metric_tsp_approx.hpp
include/boost/graph/minimum_degree_ordering.hpp
include/boost/graph/named_function_params.hpp
include/boost/graph/named_graph.hpp
include/boost/graph/neighbor_bfs.hpp
include/boost/graph/numeric_values.hpp
include/boost/graph/one_bit_color_map.hpp
include/boost/graph/overloading.hpp
include/boost/graph/page_rank.hpp
include/boost/graph/planar_canonical_ordering.hpp
include/boost/graph/planar_face_traversal.hpp
include/boost/graph/plod_generator.hpp
include/boost/graph/point_traits.hpp
include/boost/graph/prim_minimum_spanning_tree.hpp
include/boost/graph/profile.hpp
include/boost/graph/properties.hpp
include/boost/graph/property_iter_range.hpp
include/boost/graph/push_relabel_max_flow.hpp
include/boost/graph/r_c_shortest_paths.hpp
include/boost/graph/random.hpp
include/boost/graph/random_layout.hpp
include/boost/graph/random_spanning_tree.hpp
include/boost/graph/read_dimacs.hpp
include/boost/graph/relax.hpp
include/boost/graph/reverse_graph.hpp
include/boost/graph/rmat_graph_generator.hpp
include/boost/graph/sequential_vertex_coloring.hpp
include/boost/graph/simple_point.hpp
include/boost/graph/sloan_ordering.hpp
include/boost/graph/small_world_generator.hpp
include/boost/graph/smallest_last_ordering.hpp
include/boost/graph/ssca_graph_generator.hpp
include/boost/graph/st_connected.hpp
include/boost/graph/stanford_graph.hpp
include/boost/graph/stoer_wagner_min_cut.hpp
include/boost/graph/strong_components.hpp
include/boost/graph/subgraph.hpp
include/boost/graph/successive_shortest_path_nonnegative_weights.hpp
include/boost/graph/tiernan_all_cycles.hpp
include/boost/graph/topological_sort.hpp
include/boost/graph/topology.hpp
include/boost/graph/transitive_closure.hpp
include/boost/graph/transitive_reduction.hpp
include/boost/graph/transpose_graph.hpp
include/boost/graph/tree_traits.hpp
include/boost/graph/two_bit_color_map.hpp
include/boost/graph/two_graphs_common_spanning_trees.hpp
include/boost/graph/undirected_dfs.hpp
include/boost/graph/undirected_graph.hpp
include/boost/graph/use_mpi.hpp
include/boost/graph/vector_as_graph.hpp
include/boost/graph/vertex_and_edge_range.hpp
include/boost/graph/vf2_sub_graph_iso.hpp
include/boost/graph/visitors.hpp
include/boost/graph/wavefront.hpp
include/boost/graph/write_dimacs.hpp
PRIVATE
src/graphml.cpp
src/read_graphviz_new.cpp
)
target_link_libraries(boost_graph PUBLIC Boost::headers PRIVATE Boost::regex)
include(CTest)
endif()
add_library(Boost::graph ALIAS boost_graph)
if(BUILD_SHARED_LIBS)
target_compile_definitions(boost_graph PUBLIC BOOST_GRAPH_DYN_LINK)
else()
target_compile_definitions(boost_graph PUBLIC BOOST_GRAPH_STATIC_LINK)
endif()
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
add_subdirectory(test)
endif()
+84
View File
@@ -0,0 +1,84 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at `arnaud.becheler -at- gmail.com`. All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of actions.
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
+182
View File
@@ -0,0 +1,182 @@
# Contributing to Boost.Graph
## We are welcoming contributions
- Bug fixes and test cases for them
- New algorithms (with tests, documentation, complexity notes, and a reference)
- Documentation, examples, performance work
- Concept refinements (handle with care as these are API-visible)
## Maintainers
| Maintainer | Role | Focus | Availability | Contact |
|---|---|---|---|---|
| **Jeremy W. Murphy** | Principal maintainer. Holds merge authority and final say on design decisions. | Algorithms, technical review, library architecture. 10+ years on BGL. | Part-time, best-effort. | `jeremy.william.murphy -at- gmail.com` |
| **Arnaud Becheler** | Assistant maintainer. Triage, review, and contributor support; defers to Jeremy on merge decisions. | Documentation, modernization, contributor onboarding. | Full-time, funded by the [C++ Alliance](https://cppalliance.org) to assist Jeremy. | `arnaud.becheler -at- gmail.com` |
The authoritative maintainer list lives in [meta/libraries.json](meta/libraries.json); keep this section in sync with it. Maintainers aim to provide first-pass review on new PRs within two weeks.
## Getting set up
Clone the [Boost superproject](https://github.com/boostorg/boost):
```bash
git clone --depth 1 https://github.com/boostorg/boost
cd boost
git submodule update --init --depth 1
./bootstrap.sh
./b2 headers
```
Then replace `libs/graph/` with your fork:
```bash
rm -rf libs/graph
git clone https://github.com/<you>/graph libs/graph
cd libs/graph
git remote add upstream https://github.com/boostorg/graph
```
## Building and testing
- Headers only: `./b2 headers` from boost root
- Compiled components: `./b2` from `libs/graph`
- All tests: `./b2` from `libs/graph/test` (takes ~10 min)
- Single test: `./b2 cycle_canceling_test` from `libs/graph/test`
- Different C++ standard: `./b2 cxxstd=20`
- Different compiler: `./b2 toolset=clang`
### Naming conventions
BGL follows the standard Boost / STL conventions:
| Kind | Style | Example |
|---|---|---|
| Functions, types, variables, files | `snake_case` | `dijkstra_visitor`, `add_edge`, `adjacency_list.hpp` |
| Member functions / methods | `snake_case` (same as free functions) | `get_edge`, `out_edges` |
| Private member variables | `m_` prefix + `snake_case` | `m_matrix`, `m_num_edges`, `m_property` |
| Concept names | `PascalCase` | `IncidenceGraph`, `VertexListGraph` |
| Template parameters | `PascalCase` | `template <class Graph, class WeightMap>` |
| Tag-dispatch types | `snake_case` + `S` suffix | `vecS`, `directedS` |
| Macros | `BOOST_GRAPH_` prefix, `SCREAMING_SNAKE_CASE` | `BOOST_GRAPH_DECLARE_EDGE_PROPERTY` |
### Formatting
Low-level formatting (braces, column width, spaces in angle brackets, etc.) is captured by the [`.clang-format`](.clang-format) file at the repo root (WebKit preset with BGL-specific overrides: Allman braces, 80-column limit, `Cpp03`). It is **not** enforced by CI, but contributors are encouraged to run `clang-format -i` on files they touch before opening a PR.
## Using other Boost libraries
When writing new code:
- **Prefer `std::`** when the supported C++ standard has an equivalent. Use `std::function`, `std::shared_ptr`, `std::tuple` over their Boost counterparts. Exceptions are welcome with justification in the PR description, in particular Boost containers with no std equivalent in our standard window (e.g. `boost::unordered_flat_map`, `boost::bimap`, `boost::multi_index_container`).
- **Avoid pulling in new heavy dependencies** (Spirit, property_tree, xpressive, etc.) without justification: BGL is gradually migrating away from heavy Boost dependencies. Open a discussion before adding one.
- **Concept checks** (`boost::concept`) are encouraged for any new public template. New public APIs should respect the existing concept hierarchy.
- Track BGL's position in the Boost dependency DAG via [boostdep](https://github.com/boostorg/boostdep)'s hosted reports. The long-term goal is to reduce BGL's level over time:
- **[Module levels](https://pdimov.github.io/boostdep-report/master/module-levels.html#graph)** shows BGL's depth in the global DAG. A rising level means new transitive Boost dependencies have been pulled in.
- **[Per-library page](https://pdimov.github.io/boostdep-report/develop/graph.html)** shows BGL's direct deps and per-dep `#include` counts.
## Boost macro usage
BGL has accumulated a wide vocabulary of `BOOST_*` macros from its pre-C++14 days. The table below captures the current guidance for each one used in the codebase: **Keep** as-is, **Replace** with a language or std equivalent, or **Remove** along with the dead `#if defined(...)` branch the macro guards. When in doubt, follow the recommendation here or ask before introducing new uses.
| Macro | Recommendation |
|---|---|
| `BOOST_ASSERT` | Keep, more useful and configurable than `assert` |
| `BOOST_BORLANDC` | Remove |
| `BOOST_CONCEPT_ASSERT` | Keep (pre C++20) |
| `BOOST_CONCEPT_REQUIRES` | Keep (pre C++20) |
| `BOOST_CONCEPT_USAGE` | Keep (pre C++20) |
| `BOOST_DEDUCED_TYPENAME` | Remove |
| `BOOST_FOREACH` | Replace with an appropriate algorithm or range-based `for` loop |
| `BOOST_FWD_REF` | Replace with `T&&` |
| `BOOST_JOIN` | Keep |
| `BOOST_MPL_HAS_XXX_TRAIT_DEF` | Consider writing the same utility without dependency on MPL |
| `BOOST_MSVC` | Keep |
| `BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP` | Remove |
| `BOOST_NO_AUTO_PTR` | Remove and assume `auto_ptr` is not available |
| `BOOST_NO_CXX11_ALLOCATOR` | Remove |
| `BOOST_NO_CXX11_RVALUE_REFERENCES` | Remove |
| `BOOST_NO_CXX11_SMART_PTR` | Remove |
| `BOOST_NO_CXX17_STRUCTURED_BINDINGS` | Keep |
| `BOOST_NO_MEMBER_TEMPLATE_FRIENDS` | Remove |
| `BOOST_NO_SFINAE` | Remove |
| `BOOST_NO_STDC_NAMESPACE` | Possibly keep |
| `BOOST_NO_STD_ALLOCATOR` | Remove |
| `BOOST_NO_STD_ITERATOR_TRAITS` | Remove |
| `BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS` | Remove |
| `BOOST_OVERRIDE` | Possibly remove |
| `BOOST_PARAMETER_KEYWORD` | Keep |
| `BOOST_PARAMETER_NAME` | Keep |
| `BOOST_PP_CAT` | Use if Boost.PP can't be replaced with variadics |
| `BOOST_PP_COMMA_IF` | Use if Boost.PP can't be replaced with variadics |
| `BOOST_PP_DEC` | Use if Boost.PP can't be replaced with variadics |
| `BOOST_PP_ENUM_BINARY_PARAMS` | Use if Boost.PP can't be replaced with variadics |
| `BOOST_PP_ENUM_BINARY_PARAMS_Z` | Use if Boost.PP can't be replaced with variadics |
| `BOOST_PP_ENUM_PARAMS` | Use if Boost.PP can't be replaced with variadics |
| `BOOST_PP_ENUM_PARAMS_Z` | Use if Boost.PP can't be replaced with variadics |
| `BOOST_PP_ENUM_TRAILING_BINARY_PARAMS_Z` | Use if Boost.PP can't be replaced with variadics |
| `BOOST_PP_ENUM_TRAILING_PARAMS_Z` | Use if Boost.PP can't be replaced with variadics |
| `BOOST_PP_EXPR_IF` | Use if Boost.PP can't be replaced with variadics |
| `BOOST_PP_INC` | Use if Boost.PP can't be replaced with variadics |
| `BOOST_PP_LPAREN_IF` | Use if Boost.PP can't be replaced with variadics |
| `BOOST_PP_REPEAT` | Use if Boost.PP can't be replaced with variadics |
| `BOOST_PP_REPEAT_FROM_TO` | Use if Boost.PP can't be replaced with variadics |
| `BOOST_PP_RPAREN_IF` | Use if Boost.PP can't be replaced with variadics |
| `BOOST_PP_SEQ_ELEM` | Use if Boost.PP can't be replaced with variadics |
| `BOOST_PP_SUB` | Use if Boost.PP can't be replaced with variadics |
| `BOOST_PP_TUPLE_EAT` | Use if Boost.PP can't be replaced with variadics |
| `BOOST_PREVENT_MACRO_SUBSTITUTION` | Keep |
| `BOOST_SERIALIZATION_NVP` | Consider removing if you can eliminate the dependency on Boost.Serialization via `<boost/core/serialization.hpp>` |
| `BOOST_SPIRIT_CLOSURE_LIMIT` | Keep |
| `BOOST_SPIRIT_DEBUG` | Keep |
| `BOOST_SPIRIT_DEBUG_RULE` | Keep |
| `BOOST_STATIC_ASSERT` | Replace with `static_assert(..., msg)` |
| `BOOST_STATIC_ASSERT_MSG` | Replace with `static_assert(..., msg)` |
| `BOOST_STATIC_CONSTANT` | Remove in favour of in-class `static constexpr` initialization |
| `BOOST_SYMBOL_EXPORT` | Keep |
| `BOOST_SYMBOL_IMPORT` | Keep |
| `BOOST_SYMBOL_VISIBLE` | Keep |
| `BOOST_TESTED_AT` | Keep |
| `BOOST_THROW_EXCEPTION` | Keep |
| `BOOST_TTI_HAS_MEMBER_FUNCTION` | Consider writing the same utility without dependency on TTI |
| `BOOST_USING_STD_MAX` | Replace with `(std::max)(...)` |
| `BOOST_USING_STD_MIN` | Replace with `(std::min)(...)` |
| `BOOST_WORKAROUND` | Keep |
When you mark a `BOOST_NO_*` flag as **Remove**, also delete the `#if defined(...)` block it gates — the alternate branch is always taken on the supported toolchains.
## Pull request process
- Fork, branch from `develop`, PR back to `develop`
- One logical change per PR; rebase before requesting review
- Tests required for new features and bug fixes
- **Open (non-draft) PRs are assumed ready for review.** Use GitHub's Draft state while iterating, then mark the PR as *Ready for review* when you want maintainers to look at it.
- A maintainer will review within ~2 weeks (see Maintainers below)
- Squash on merge by default
## Merge criteria
Before a PR is merged, all of the following must hold:
1. CI is green on the full matrix (gcc-14 + clang-19, C++14/17/20/23).
2. New behavior has tests.
3. Bug fixes have a regression test.
4. Documentation under [doc/](doc/) is updated if the public API changed.
5. No new compiler warnings on the supported toolchains.
6. The PR is rebased on current `develop` with a clean commit history.
7. The principal maintainer has approved.
## Reporting bugs
1. Search [existing issues](https://github.com/boostorg/graph/issues) first
2. Note compiler, version, OS, Boost version
3. Minimal reproducer on [Compiler Explorer](https://godbolt.org/z/37dPWd5bs)
4. Expected Output versus Actual Output is explained.
## Security
See [SECURITY.md](SECURITY.md).
## License
By contributing, you agree your contribution is licensed under the [Boost Software License 1.0](https://www.boost.org/LICENSE_1_0.txt).
+106
View File
@@ -0,0 +1,106 @@
# Boost Graph Library
[![Docs](https://img.shields.io/badge/docs-boost.org-blue.svg)](https://www.boost.org/doc/libs/release/libs/graph/doc/index.html)
[![C++14](https://img.shields.io/badge/C%2B%2B-14-blue.svg)](https://en.cppreference.com/w/cpp/14)
[![CI](https://github.com/boostorg/graph/actions/workflows/ci.yml/badge.svg)](https://github.com/boostorg/graph/actions/workflows/ci.yml)
[![License: BSL-1.0](https://img.shields.io/badge/License-BSL_1.0-blue.svg)](https://www.boost.org/LICENSE_1_0.txt)
[![Boost release](https://img.shields.io/github/v/release/boostorg/boost?label=Boost&color=orange)](https://github.com/boostorg/boost/releases)
The Boost Graph Library (BGL) is a generic library that allows users to:
1. Represent graph data using different structures (adjacency matrix, adjacency list, compressed sparse row, vectors of vectors, user-defined data structures).
2. Attach user-defined data to vertices, edges, or the graph itself.
3. Run a large number of algorithms on the graph.
4. Inject user logic into algorithms using visitor hooks.
## Example
[Try it on Compiler Explorer](https://godbolt.org/z/9Esszr9Ga)
```cpp
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/graph/visitors.hpp>
#include <iostream>
#include <limits>
#include <vector>
struct City {};
struct Road { int cost; };
using namespace boost;
using Graph = adjacency_list<vecS, vecS, directedS, City, Road>;
using Vertex = graph_traits<Graph>::vertex_descriptor;
int main() {
Graph g(4);
add_edge(0, 1, Road{1}, g);
add_edge(1, 2, Road{2}, g);
add_edge(0, 2, Road{10}, g);
add_edge(2, 3, Road{1}, g);
// Storage: you control allocation, lifetime, and container type
std::vector<Vertex> storage_pred(num_vertices(g));
std::vector<int> storage_dist(num_vertices(g));
// Property maps: lightweight views into the storage
auto index_map = get(vertex_index, g);
auto costs_map = get(&Road::cost, g);
auto predecessor_map = make_iterator_property_map(storage_pred.begin(), index_map);
auto distance_map = make_iterator_property_map(storage_dist.begin(), index_map);
dijkstra_shortest_paths(g, vertex(0, g),
predecessor_map, distance_map,
costs_map, index_map,
std::less<int>(), std::plus<int>(),
std::numeric_limits<int>::max(), 0,
dijkstra_visitor<null_visitor>());
for (auto v : make_iterator_range(vertices(g)))
std::cout << "distance to " << v << " = " << storage_dist[v] << "\n";
}
```
```
distance to 0 = 0
distance to 1 = 1
distance to 2 = 3
distance to 3 = 4
```
## Algorithms
BGL ships dozens of graph algorithms: shortest paths (Dijkstra, Bellman-Ford, A*, Floyd-Warshall, Johnson), spanning trees (Kruskal, Prim), maximum flow (Edmonds-Karp, push-relabel, Boykov-Kolmogorov), traversal (BFS, DFS, topological sort), planarity testing, isomorphism, component decomposition, and more.
See the [full algorithm reference](https://becheler.github.io/graph/graph/algorithms/overview.html) for the complete catalogue.
## Help and feedback
* **[GitHub Issues](https://github.com/boostorg/graph/issues)** for bug reports. Search before opening a new one.
* **[GitHub Discussions](https://github.com/boostorg/graph/discussions)** for questions, design ideas, and general conversation about the library.
* **[Boost mailing list](http://lists.boost.org/mailman/listinfo.cgi/boost-users)** for general Boost development. Use the `[graph]` tag in the subject line.
* **CppLang Slack** for real-time chat. [Request an invite](https://cppalliance.org/slack/), then join the `#boost` channel.
* **Direct contact with maintainers**: see [CONTRIBUTING.md#maintainers](CONTRIBUTING.md#maintainers).
## Using BGL
Install Boost via your package manager:
| Manager | Command |
|---|---|
| [vcpkg](https://vcpkg.io) | `vcpkg install boost-graph` |
| [Conan](https://conan.io) | `conan install --requires=boost/[*]` |
| apt (Debian/Ubuntu) | `sudo apt install libboost-graph-dev` |
| Homebrew (macOS) | `brew install boost` |
Then wire it into CMake:
```cmake
find_package(Boost REQUIRED COMPONENTS graph)
target_link_libraries(my_app PRIVATE Boost::graph)
```
Most of BGL is header-only. Linking `Boost::graph` is only required for the GraphViz and GraphML parsers.
## Building from source
For working on BGL itself (building Boost from source, running the test suite), see [CONTRIBUTING.md](CONTRIBUTING.md).
+14
View File
@@ -0,0 +1,14 @@
# Security Policy
Boost.Graph is a header-only C++ template library. Most issues that look
like security problems are caused by misuse of the API, undefined behavior
in caller code, or violating a documented precondition. Those should be
filed as regular GitHub issues.
If you believe you have found a genuine vulnerability in the library
itself, please report it privately through GitHub's
[private vulnerability reporting](https://github.com/boostorg/graph/security/advisories/new)
rather than opening a public issue.
Fixes land on the `develop` branch and ship with the next Boost release.
No back-porting to older releases is guaranteed.
+61
View File
@@ -0,0 +1,61 @@
# Copyright René Ferdinand Rivera Morell 2024
# 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)
require-b2 5.2 ;
constant boost_dependencies :
/boost/algorithm//boost_algorithm
/boost/any//boost_any
/boost/array//boost_array
/boost/assert//boost_assert
/boost/bimap//boost_bimap
/boost/bind//boost_bind
/boost/concept_check//boost_concept_check
/boost/config//boost_config
/boost/container_hash//boost_container_hash
/boost/conversion//boost_conversion
/boost/core//boost_core
/boost/detail//boost_detail
/boost/foreach//boost_foreach
/boost/function//boost_function
/boost/integer//boost_integer
/boost/iterator//boost_iterator
/boost/lexical_cast//boost_lexical_cast
/boost/math//boost_math_tr1
/boost/move//boost_move
/boost/mpl//boost_mpl
/boost/multi_index//boost_multi_index
/boost/multiprecision//boost_multiprecision
/boost/optional//boost_optional
/boost/parameter//boost_parameter
/boost/preprocessor//boost_preprocessor
/boost/property_map//boost_property_map
/boost/property_tree//boost_property_tree
/boost/random//boost_random
/boost/range//boost_range
/boost/serialization//boost_serialization
/boost/smart_ptr//boost_smart_ptr
/boost/spirit//boost_spirit
/boost/throw_exception//boost_throw_exception
/boost/tti//boost_tti
/boost/tuple//boost_tuple
/boost/type_traits//boost_type_traits
/boost/typeof//boost_typeof
/boost/unordered//boost_unordered
/boost/utility//boost_utility
/boost/xpressive//boost_xpressive ;
project /boost/graph
;
explicit
[ alias boost_graph : build//boost_graph ]
[ alias all : boost_graph example test ]
;
call-if : boost-library graph
: install boost_graph
;
+9 -5
View File
@@ -6,9 +6,15 @@
import mpi ;
project boost/graph
: requirements <include>../src
constant boost_dependencies_private :
/boost/regex//boost_regex
;
project
: common-requirements <include>../include <library>$(boost_dependencies)
: requirements <include>../src <library>$(boost_dependencies_private)
: source-location ../src
: usage-requirements <define>BOOST_GRAPH_NO_LIB=1
;
lib boost_graph
@@ -16,13 +22,11 @@ lib boost_graph
read_graphviz_new.cpp
graphml.cpp
:
<library>../../regex/build//boost_regex
<link>shared:<define>BOOST_GRAPH_DYN_LINK=1
# Without these flags, MSVC 7.1 and 8.0 crash
# User reports that VC++ 8.0 does not fail anymore, so that is removed
<toolset>msvc-7.1:<cxxflags>-GR-
<toolset>sun:<build>no
:
:
;
boost-install boost_graph ;
-138
View File
@@ -1,138 +0,0 @@
<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&lt;G&gt;::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 &lt;class Heuristic, class Graph&gt;
struct AStarHeuristicConcept {
void constraints()
{
function_requires&lt; CopyConstructibleConcept&lt;Heuristic&gt; &gt;();
h(u);
}
Heuristic h;
typename graph_traits&lt;Graph&gt;::vertex_descriptor u;
};
</pre>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-213
View File
@@ -1,213 +0,0 @@
<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>const G&amp;</tt>.</TD>
</TR>
<TR>
<TD><tt>e</tt></TD>
<TD>An object of type <tt>boost::graph_traits&lt;G&gt;::edge_descriptor</tt>.</TD>
</TR>
<TR>
<TD><tt>s,u,v</tt></TD>
<TD>An object of type <tt>boost::graph_traits&lt;G&gt;::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. This
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 &copy; 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>
-130
View File
@@ -1,130 +0,0 @@
<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&lt;Graph&gt;::vertex_descriptor</tt>
</td>
</tr>
<tr>
<td> <tt>e</tt> </td>
<td> is an object of type <tt>graph_traits&lt;Graph&gt;::edge_descriptor</tt>
</td>
</tr>
<tr>
<td> <tt>v</tt> </td>
<td> is an object of type <tt>graph_traits&lt;Graph&gt;::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>
-168
View File
@@ -1,168 +0,0 @@
<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>AdjacencyGraph</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:AdjacencyGraph"></A>
AdjacencyGraph
</H2>
The AdjacencyGraph concept provides and interface for efficient access
of the adjacent vertices to a vertex in a graph. This is quite similar
to the <a href="./IncidenceGraph.html">IncidenceGraph</a> concept (the
target of an out-edge is an adjacent vertex). Both concepts are
provided because in some contexts there is only concern for the
vertices, whereas in other contexts the edges are also important.
<H3>Refinement of</H3>
<a href="Graph.html">Graph</a>
<h3>Notation</h3>
<Table>
<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&lt;G&gt;::vertex_descriptor</tt>.</TD>
</TR>
</table>
<H3>Associated Types</H3>
<Table border>
<tr>
<td><tt>boost::graph_traits&lt;G&gt;::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&lt;G&gt;::adjacency_iterator</pre>
An adjacency iterator for a vertex <i>v</i> provides access to the
vertices adjacent to <i>v</i>. As such, the value type of an
adjacency iterator is the vertex descriptor type of its graph. An
adjacency iterator must meet the requirements of <a
href="../../utility/MultiPassInputIterator.html">MultiPassInputIterator</a>.
</TD>
</TR>
</table>
<h3>Valid Expressions</h3>
<table border>
<tr>
<td><a name="sec:adjacent-vertices"><TT>adjacent_vertices(v,&nbsp;g)</TT></a></TD>
<TD>
Returns an iterator-range providing access to the vertices adjacent to
vertex <TT>v</TT> in graph <TT>g</TT>.<a
href="#1">[1]</a>
<br> Return type:
<TT>std::pair&lt;adjacency_iterator,&nbsp;adjacency_iterator&gt;</TT>
</TD>
</TR>
</table>
<H3>Complexity guarantees</H3>
The <TT>adjacent_vertices()</TT> function must return in constant time.
<H3>See Also</H3>
<a href="./graph_concepts.html">Graph concepts</a>,
<a href="./adjacency_iterator.html"><tt>adjacency_iterator</tt></a>
<H3>Concept Checking Class</H3>
<PRE>
template &lt;class G&gt;
struct AdjacencyGraphConcept
{
typedef typename boost::graph_traits&lt;G&gt;::adjacency_iterator
adjacency_iterator;
void constraints() {
function_requires&lt; IncidenceGraphConcept&lt;G&gt; &gt;();
function_requires&lt; MultiPassInputIteratorConcept&lt;adjacency_iterator&gt; &gt;();
p = adjacent_vertices(v, g);
v = *p.first;
const_constraints(g);
}
void const_constraints(const G&amp; g) {
p = adjacent_vertices(v, g);
}
std::pair&lt;adjacency_iterator,adjacency_iterator&gt; p;
typename boost::graph_traits&lt;G&gt;::vertex_descriptor v;
G g;
};
</PRE>
<h3>Design Rationale</h3>
The AdjacencyGraph concept is somewhat frivolous since <a
href="./IncidenceGraph.html">IncidenceGraph</a> really covers the same
functionality (and more). The AdjacencyGraph concept exists because
there are situations when <tt>adjacent_vertices()</tt> is more
convenient to use than <tt>out_edges()</tt>. If you are constructing a
graph class and do not want to put in the extra work of creating an
adjacency iterator, have no fear. There is an adaptor class named <a
href="./adjacency_iterator.html"> <tt>adjacency_iterator</tt></a> that
you can use to create an adjacency iterator out of an out-edge
iterator.
<h3>Notes</h3>
<a name="1">[1]</a> The case of a
<I>multigraph</I> (where multiple edges can connect the same two
vertices) brings up an issue as to whether the iterators returned by
the <TT>adjacent_vertices()</TT> function access a range that
includes each adjacent vertex once, or whether it should match the
behavior of the <TT>out_edges()</TT> function, and access a
range that may include an adjacent vertex more than once. For now the
behavior is defined to match that of <TT>out_edges()</TT>,
though this decision may need to be reviewed in light of more
experience with graph algorithm implementations.
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-103
View File
@@ -1,103 +0,0 @@
<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>AdjacencyMatrix</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:AdjacencyMatrix"></A>
AdjacencyMatrix
</H2>
<P>
The AdjacencyMatrix concept refines <a href="./Graph.html">Graph</a>
concept and adds the requirement for efficient access to any edge in
the graph given the source and target vertices. No Boost Graph Library
algorithms currently use this concept. However there are algorithms
not yet implemented such as Floyd-Warshall that would require this
concept.
<H3>Refinement of</H3>
<a href="./Graph.html">Graph</a>
<H3>Associated Types</H3>
<Table border>
<tr>
<td><tt>boost::graph_traits&lt;G&gt;::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>
<tr>
<th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th>
</tr>
<tr>
<td>Direct Edge Access</td>
<TD><TT>edge(u,v,g)</TT></TD>
<TD><TT>std::pair&lt;edge_descriptor, bool&gt;</TT></TD>
<TD>
Returns a pair consisting of a flag saying whether there exists an
edge between <TT>u</TT> and <TT>v</TT> in graph <TT>g</TT>, and
consisting of the edge descriptor if the edge was found.
</TD>
</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>
<H3>Concept Checking Class</H3>
<PRE>
template &lt;class G&gt;
struct AdjacencyMatrix
{
typedef typename boost::graph_traits&lt;G&gt;::edge_descriptor edge_descriptor;
void constraints() {
p = edge(u, v, g);
}
typename boost::graph_traits&lt;G&gt;::vertex_descriptor u, v;
std::pair&lt;bool, edge_descriptor&gt; p;
G g;
};
</PRE>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-220
View File
@@ -1,220 +0,0 @@
<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: BFSVisitor</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><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>.
Users can define a class with the BFS Visitor interface and pass and
object of the class to <tt>breadth_first_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 BFS 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&lt;G&gt;::edge_descriptor</tt>.</TD>
</TR>
<TR>
<TD><tt>s,u</tt></TD>
<TD>An object of type <tt>boost::graph_traits&lt;G&gt;::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>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>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 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. 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 discovered.
</td>
</tr>
<tr>
<td>Tree Edge</td>
<td><tt>vis.tree_edge(e, g)</tt></td>
<td><tt>void</tt></td>
<td>
This is invoked on each edge as it becomes a member of the edges that
form the search tree.</td>
</tr>
<tr>
<td>Non-Tree Edge</td>
<td><tt>vis.non_tree_edge(e, g)</tt></td>
<td><tt>void</tt></td>
<td>
This is invoked on back or cross edges for directed graphs and cross
edges for undirected graphs.
</td>
</tr>
<tr>
<td>Gray Target</td>
<td><tt>vis.gray_target(e, g)</tt></td>
<td><tt>void</tt></td>
<td>
This is invoked on the subset of non-tree edges whose target vertex is
colored gray at the time of examination. The color gray indicates
that the vertex is currently in the queue.
</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 on the subset of non-tree edges whose target vertex is
colored black at the time of examination. The color black indicates
that the vertex has been removed from the queue.
</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 the out-edges of the adjacent vertices have been examined).
</td>
</tr>
</table>
<h3>Models</h3>
<ul>
<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>
<a href="./visitor_concepts.html">Visitor concepts</a>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-22
View File
@@ -1,22 +0,0 @@
#!/bin/sh
# Copyright (C) 2009 The Trustees of Indiana University.
# Copyright (C) 2010 Daniel Trebbien.
# 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, Daniel Trebbien, 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
# Stoer-Wagner images from Daniel Trebbien
fdp -s -n -Tgif -ostoer_wagner_imgs/digraph1.gif stoer_wagner_imgs/digraph1.dot
fdp -s -n -Tgif -ostoer_wagner_imgs/digraph1-min-cut.gif stoer_wagner_imgs/digraph1-min-cut.dot
fdp -s -n -Tgif -ostoer_wagner_imgs/stoer_wagner-example.gif stoer_wagner_imgs/stoer_wagner-example.dot
fdp -s -n -Tgif -ostoer_wagner_imgs/stoer_wagner-example-c1.gif stoer_wagner_imgs/stoer_wagner-example-c1.dot
fdp -s -n -Tgif -ostoer_wagner_imgs/stoer_wagner-example-min-cut.gif stoer_wagner_imgs/stoer_wagner-example-min-cut.dot
dot -Tgif -ostoer_wagner_imgs/stoer_wagner.cpp.gif stoer_wagner_imgs/stoer_wagner.cpp.dot
-103
View File
@@ -1,103 +0,0 @@
<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&amp;</TT> for mutable <tt>A</tt> or <TT>const V&amp;</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 &lt;class M, class I, class V&gt;
struct BasicMatrixConcept
{
void constraints() {
V&amp; elt = A[i][j];
const_constraints(A);
ignore_unused_variable_warning(elt);
}
void const_constraints(const M&amp; A) {
const V&amp; elt = A[i][j];
ignore_unused_variable_warning(elt);
}
M A;
I i, j;
};
</pre>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-184
View File
@@ -1,184 +0,0 @@
<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: Bellman Ford 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><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>.
Users can define a class with the Bellman Ford Visitor interface and
pass and object of the class to <tt>bellman_ford_shortest_paths()</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 Bellman Ford 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&lt;G&gt;::edge_descriptor</tt>.</TD>
</TR>
<TR>
<TD><tt>s,u</tt></TD>
<TD>An object of type <tt>boost::graph_traits&lt;G&gt;::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>Examine Edge</td>
<td><tt>vis.examine_edge(e, g)</tt></td>
<td><tt>void</tt></td>
<td>
This is invoked on every edge in the graph <tt>num_vertices(g)</tt> times.
</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>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>Edge Minimized</td>
<td><tt>vis.edge_minimized(e, g)</tt></td>
<td><tt>void</tt></td>
<td>
After <tt>num_vertices(g)</tt> iterations through the edge set
of the graph are completed, one last iteration is made to test whether
each edge was minimized. If the edge is minimized then this function
is invoked.
</td>
</tr>
<tr>
<td>Edge Not Minimized</td>
<td><tt>edge_not_minimized(e, g)</tt></td>
<td><tt>void</tt></td>
<td>
If the edge is not minimized, this function is invoked. This happens
when there is a negative cycle in the graph.
</td>
</tr>
</table>
<h3>Models</h3>
<ul>
<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 &copy; 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>
-175
View File
@@ -1,175 +0,0 @@
<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>Bidirectional</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:BidirectionalGraph"></A>
BidirectionalGraph
</H2>
<P>
The BidirectionalGraph concept refines <a
href="./IncidenceGraph.html">IncidenceGraph</a> and adds the
requirement for efficient access to the in-edges of each vertex. This
concept is separated from <a
href="./IncidenceGraph.html">IncidenceGraph</a> because for directed
graphs efficient access to in-edges typically requires more storage
space, and many algorithms do not require access to in-edges. For
undirected graphs this is not an issue, since the <TT>in_edges()</TT>
and <TT>out_edges()</TT> functions are the same, they both return the
edges incident to the vertex.
<H3>Refinement of</H3>
<a href="./IncidenceGraph.html">IncidenceGraph</a>
<h3>Notation</h3>
<Table>
<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&lt;G&gt;::vertex_descriptor</tt>.</TD>
</TR>
</table>
<H3>Associated Types</H3>
<Table border>
<tr>
<td><tt>boost::graph_traits&lt;G&gt;::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&lt;G&gt;::in_edge_iterator</pre>
An in-edge iterator for a vertex <i>v</i> provides access to the
in-edges of <i>v</i>. As such, the value type of an in-edge iterator
is the edge descriptor type of its graph. An in-edge iterator must
meet the requirements of <a href="../../utility/MultiPassInputIterator.html">MultiPassInputIterator</a>.
</TD>
</TR>
</Table>
<h3>Valid Expressions</h3>
<Table border>
<tr>
<td><a name="sec:in-edges"><TT>in_edges(v, g)</TT></a></TD>
<TD>
Returns an iterator-range providing access to the
in-edges (for directed graphs) or incident edges (for
undirected graphs) of vertex <TT>v</TT> in graph <TT>g</TT>.
For both directed and undirected graphs, the target of
an out-edge is required to be vertex <tt>v</tt> and the
source is required to be a vertex that is adjacent to <tt>v</tt>.
<br>
Return type: <TT>std::pair&lt;in_edge_iterator, in_edge_iterator&gt;</TT>
</TD>
</TR>
<tr>
<TD><TT>in_degree(v, g)</TT></TD>
<TD>
Returns the number of in-edges (for directed graphs) or the
number of incident edges (for undirected graphs) of vertex <TT>v</TT>
in graph <TT>g</TT>.<br>
Return type: <TT>degree_size_type</TT>
</TD>
</TR>
<tr>
<TD><TT>degree(v, g)</TT></TD>
<TD>Returns the number of in-edges plus out-edges (for directed graphs) or the
number of incident edges (for undirected graphs) of vertex <TT>v</TT>
in graph <TT>g</TT>.<br>
Return type: <TT>degree_size_type</TT>
</TD>
</TR>
</Table>
<H3>Models</H3>
<ul>
<li><a href="./adjacency_list.html"><tt>adjacency_list</tt></a> with <tt>Directed=bidirectionalS</tt></li>
<li><a href="./adjacency_list.html"><tt>adjacency_list</tt></a> with <tt>Directed=undirectedS</tt></li>
</ul>
<H3>Complexity guarantees</H3>
The <TT>in_edges()</TT> function is required to be constant time. The
<tt>in_degree()</tt> and <tt>degree()</tt> functions must be linear in
the number of in-edges (for directed graphs) or incident edges (for
undirected graphs).
<H3>See Also</H3>
<a href="./graph_concepts.html">Graph concepts</a>
<H3>Concept Checking Class</H3>
<PRE>
template &lt;class G&gt;
struct BidirectionalGraphConcept
{
typedef typename boost::graph_traits&lt;G&gt;::in_edge_iterator
in_edge_iterator;
void constraints() {
function_requires&lt; IncidenceGraphConcept&lt;G&gt; &gt;();
function_requires&lt; MultiPassInputIteratorConcept&lt;in_edge_iterator&gt; &gt;();
p = in_edges(v, g);
e = *p.first;
const_constraints(g);
}
void const_constraints(const G&amp; g) {
p = in_edges(v, g);
e = *p.first;
}
std::pair&lt;in_edge_iterator, in_edge_iterator&gt; p;
typename boost::graph_traits&lt;G&gt;::vertex_descriptor v;
typename boost::graph_traits&lt;G&gt;::edge_descriptor e;
G g;
};
</PRE>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-118
View File
@@ -1,118 +0,0 @@
<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>Buffer</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>
<h3>Buffer Concept</h3>
A Buffer is something in which items can be put and removed.
The Buffer <i>concept</i> has very few requirements. It does
not require any particular ordering of how the items are stored or in
what order they will appear when removed, however, there is typically
some sort of ordering policy.
<h3>Notation</h3>
<table>
<tr> <td> <tt>B</tt> </td> <td> is a type that models Buffer. </td></tr>
<tr> <td> <tt>T</tt> </td> <td> is the value type of <tt>B</tt>. </td></tr>
<tr> <td> <tt>t</tt> </td> <td> is an object of type <tt>T</tt>. </td></tr>
</table>
<h3>Members</h3>
For a type to model the Buffer concept it must have the following members.
<p>
<table border="1">
<tr> <td><b>Member</b></td> <td><b>Description</b></td> </tr>
<tr> <td> <tt>value_type</tt> </td>
<td> The type of object stored in the Buffer. The value type
must be <A href="http://www.sgi.com/tech/stl/Assignable.html">Assignable</a>.</td>
</tr>
<tr> <td> <tt>size_type</tt> </td>
<td> An unsigned integral type for representing the number of
objects in the Buffer.</td>
</tr>
<tr> <td> <tt>void push(const T& t)</tt> </td>
<td> Inserts <tt>t</tt> into the Buffer. <tt>size()</tt> will be
incremented by one.</td>
</tr>
<tr> <td> <tt>void pop()</tt> </td>
<td> Removes an object from the Buffer. <tt>size()</tt> will be
decremented by one. Precondition: <tt>empty()</tt>
is <tt>false</tt>. </td>
</tr>
<tr> <td> <tt>T& top()</tt> </td>
<td> Returns a mutable reference to some object in the Buffer.
Precondition: <tt>empty()</tt> is <tt>false</tt>.</td>
</tr>
<tr> <td> <tt>const T& top() const</tt> </td>
<td> Returns a const reference to some object in the Buffer.
Precondition: <tt>empty()</tt> is <tt>false</tt>.</td>
</tr>
<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>
<tr> <td> <tt>bool empty() const</tt> </td>
<td> Equivalent to <tt>b.size() == 0</tt>.</td>
</tr>
</table>
<h3>Complexity Guarantees</h3>
<UL>
<LI> <tt>push()</tt>, <tt>pop()</tt>, and <tt>size()</tt> must be at
most linear time complexity in the size of the Generalized Queue.
<LI> <tt>top()</tt> and <tt>empty()</tt> must be amortized constant time.
</UL>
<h3>Models</h3>
<UL>
<LI><a href="http://www.sgi.com/tech/stl/stack.html"><tt>std::stack</tt></a>
<LI><a href="../../../boost/pending/mutable_queue.hpp"><tt>boost::mutable_queue</tt></a>
</UL>
<p>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
</HTML>
+85
View File
@@ -0,0 +1,85 @@
# Contributing to the Boost.Graph documentation
The docs are built with [Antora](https://antora.org) from AsciiDoc
sources under `doc/modules/ROOT/`.
## Layout
| Where | What |
|---|---|
| `doc/modules/ROOT/pages/` | All `.adoc` pages (organized by topic) |
| `doc/modules/ROOT/examples/` | One `.cpp` per page; the build script captures stdout into a sibling `.txt` |
| `doc/modules/ROOT/nav.adoc` | Left-side navigation tree |
| `doc/templates/` | Starter templates: `algorithm.adoc`, `generator.adoc`, `graph_class.adoc` — copy and fill in |
| `doc/playbook.yml` | Antora playbook (UI bundle, content sources) |
| `doc/modules/ROOT/examples/Jamfile` | b2 rules that compile every example and snapshot its stdout into a sibling `.txt` |
| `doc/build_example_outputs.sh`| g++-only fallback that does the same thing as the Jamfile, for contributors without a `boost-root` checkout |
## Adding a new page
1. Pick a template in `doc/templates/` and copy it into the right
`pages/` subdirectory.
2. Replace the placeholders (title, signatures, parameter table). Keep
the section order from the template so the page is consistent with
the rest.
3. Add an `.cpp` example under `modules/ROOT/examples/` at the path
the page's `include::example$…[]` directive points to.
4. Add an `xref:` line to `doc/modules/ROOT/nav.adoc`.
## Building locally
The example outputs are generated by b2 (the standard Boost build
system). From a `boost-root` layout:
```sh
# 1) Compile every example and snapshot its stdout into a sibling .txt.
b2 libs/graph/doc/modules/ROOT/examples
# 2) Build the static site.
cd libs/graph
npx antora doc/playbook.yml
# 3) Open the result.
open doc/build/site/index.html # macOS
xdg-open doc/build/site/index.html # Linux
```
CI runs the same commands on every push.
### Quick fallback (no boost-root required)
For doc-only contributors who only want to fix typos and don't have a
boost-root checkout, a shell-script equivalent is provided:
```sh
BOOST_INCLUDE=/path/to/boost/include \
BOOST_LIB=/path/to/boost/lib \
bash doc/build_example_outputs.sh
```
Functionally equivalent to step 1 above; uses g++ directly instead of
b2. `BOOST_LIB` is only needed for the three link-required examples
(`io/graphml.cpp`, `io/graphviz.cpp`,
`algorithms/isomorphism/isomorphism.cpp`).
## Conventions
- **Examples first.** `== Example` (with `*Expected output:*` block)
goes immediately after `*Defined in:*` so readers see working code
before signatures.
- **Bold metadata.** `*Complexity:*`, `*Defined in:*`,
`*Expected output:*` are bold.
- **Output blocks** use `[,text]\n----` (same listing-block wrapper as
the code above) and pull from the `.txt` sidecar via
`include::example$…[]`, so the documentation can never drift from the
code and the two blocks align vertically on the page.
- **Heading levels:** `==` for top-level sections; `===` only for
numbered overloads or grouped variants. The `'''` thematic break
appears only before a `===`, never before a `==`.
- **Bundled properties** preferred over interior tag properties in
examples, unless the algorithm requires the tag.
## License
By contributing you agree to license your contribution under the
[Boost Software License 1.0](http://www.boost.org/LICENSE_1_0.txt).
-108
View File
@@ -1,108 +0,0 @@
<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: ColorValue Concept</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:ColorValue"></A>
ColorValue
</H1>
<P>
This concept describes the requirements for the type used for color
values, as in for coloring a graph during a breath-first search to
mark which vertices have been visited.
<P>
<h3>Refinement of</h3> <a
href="http://www.sgi.com/tech/stl/EqualityComparable.html">EqualityComparable</a>
and <a
href="http://www.sgi.com/tech/stl/DefaultConstructible.html">DefaultConstructible</a>
<h3>Notation</h3>
<Table>
<TR>
<TD><tt>T</tt></TD>
<TD>A type that is a model of ColorValue.</TD>
</TR>
<TR>
<TD><tt>cv</tt></TD>
<TD>An object of type <tt>T</tt>.</TD>
</TR>
</table>
<h3>Valid Expressions</h3>
<Table border>
<tr>
<th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th>
</tr>
<tr>
<td>Get Color White </td>
<TD><TT>color_traits&lt;T&gt;::white()</TT></TD>
<TD><TT>T</TT></TD>
<TD>Returns an object that represents the color white.</TD>
</TR>
<tr>
<td>Get Color Gray </td>
<TD><TT>color_traits&lt;T&gt;::gray()</TT></TD>
<TD><TT>T</TT></TD>
<TD>Returns an object that represents the color gray.</TD>
</TR>
<tr>
<td>Get Color Black </td>
<TD><TT>color_traits&lt;T&gt;::black()</TT></TD>
<TD><TT>T</TT></TD>
<TD>Returns an object that represents the color black.</TD>
</TR>
</TABLE>
<P>
</LI>
</UL>
<h3>Models</h3>
<ul>
<li><tt>default_color_type</tt> (in <a href="../../../boost/graph/properties.hpp"><tt>boost/graph/properties.hpp</tt>)
</ul>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-212
View File
@@ -1,212 +0,0 @@
<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>DFS 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><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 an
object of the class to <tt>depth_first_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 DFS 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&lt;G&gt;::edge_descriptor</tt>.</TD>
</TR>
<TR>
<TD><tt>s,u</tt></TD>
<TD>An object of type <tt>boost::graph_traits&lt;G&gt;::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>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>Start Vertex</td>
<td><tt>vis.start_vertex(s, g)</tt></td>
<td><tt>void</tt></td>
<td>
This is invoked on the source vertex once before the start of the
search.
</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>Tree Edge</td>
<td><tt>vis.tree_edge(e, g)</tt></td>
<td><tt>void</tt></td>
<td>
This is invoked on each edge as it becomes a member of the edges that
form the search tree.</td>
</tr>
<tr>
<td>Back Edge</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. 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>
<tr>
<td>Forward or Cross Edge</td>
<td><tt>vis.forward_or_cross_edge(e, g)</tt></td>
<td><tt>void</tt></td>
<td>
This is invoked on forward or cross edges in the graph. In an
undirected graph this method is never called.
</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 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 called on <tt>u</tt> after
all the out-edges of <tt>u</tt> have been examined.
</td>
</tr>
</table>
<h3>Models</h3>
<ul>
<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 &copy; 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>
-222
View File
@@ -1,222 +0,0 @@
<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><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>
and related algorithms. The user can create a class that matches this
interface, and then pass objects of the class into
<tt>dijkstra_shortest_paths()</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 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>e</tt></TD>
<TD>An object of type <tt>boost::graph_traits&lt;G&gt;::edge_descriptor</tt>.</TD>
</TR>
<TR>
<TD><tt>s,u,v</tt></TD>
<TD>An object of type <tt>boost::graph_traits&lt;G&gt;::vertex_descriptor</tt>.</TD>
</TR>
<TR>
<TD><tt>DistanceMap</tt></TD>
<TD>A type that is a model of <a href="../../property_map/doc/ReadWritePropertyMap.html">Read/Write Property Map</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/doc/ReadWritePropertyMap.html">Readable Property Map</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>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. 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 discovered.
</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>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="./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 &copy; 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>
-184
View File
@@ -1,184 +0,0 @@
<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>EdgeListGraph</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:EdgeListGraph"></A>
EdgeListGraph
</H2>
The EdgeListGraph concept refines the <a href="./Graph.html">Graph</a>
concept, and adds the requirement for efficient access to all the
edges in the graph.
<H3>Refinement of</H3>
<a href="./Graph.html">Graph</a>
<h3>Notation</h3>
<Table>
<TR>
<TD><tt>G</tt></TD>
<TD>A type that is a model of EdgeListGraph.</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&lt;G&gt;::edge_descriptor</tt>.</TD>
</TR>
</table>
<H3>Associated Types</H3>
<table border>
<tr>
<td><tt>boost::graph_traits&lt;G&gt;::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&lt;G&gt;::edge_iterator</pre>
An edge iterator (obtained via <TT>edges(g)</TT>) provides access to
all of the edges in a graph. An edge iterator type must meet the
requirements of <a
href="../../utility/MultiPassInputIterator.html">MultiPassInputIterator</a>. The
value type of the edge iterator must be the same as the edge
descriptor of the graph.
<tr>
<td><pre>boost::graph_traits&lt;G&gt;::edges_size_type</pre>
The unsigned integer type used to represent the number of edges in the
graph.
</td>
</tr>
</table>
<h3>Valid Expressions</h3>
<table border>
<tr>
<TD><a name="sec:edges"><TT>edges(g)</TT></a></TD>
<TD>Returns an iterator-range providing access to all
the edges in the graph <TT>g</TT>.<br>
Return type: <TT>std::pair&lt;edge_iterator, edge_iterator&gt;</TT>
</td>
</TR>
<tr>
<TD><TT>num_edges(g)</TT></TD>
<TD>Returns the number of edges in the graph <TT>g</TT>.<br>
Return type: <TT>edges_size_type</TT>
</td>
</TR>
<tr>
<TD><TT>source(e, g)</TT></TD>
<TD>
Returns the vertex descriptor for <i>u</i> of the edge <i>(u,v)</i>
represented by <TT>e</TT>.<br>
Return type: <TT>vertex_descriptor</TT>
</td>
</tr>
<tr>
<TD><TT>target(e, g)</TT></TD>
<TD>
Returns the vertex descriptor for
<i>v</i> of the edge <i>(u,v)</i> represented by <TT>e</TT>.<br>
Return type: <TT>vertex_descriptor</TT>
</TD>
</TR>
</TABLE>
<H3>Models</H3>
<UL>
<LI><a href="./adjacency_list.html"><TT>adjacency_list</TT></a></LI>
<LI><a href="./edge_list.html"><TT>edge_list</TT></a></LI>
</UL>
<H3>Complexity guarantees</H3>
The <TT>edges()</TT>, <TT>source()</TT>, and <TT>target()</TT> functions
must all return in constant time.
<H3>See Also</H3>
<a href="./graph_concepts.html">Graph concepts</a>
<H3>Concept Checking Class</H3>
<P>
<PRE>
template &lt;class G&gt;
struct EdgeListGraphConcept
{
typedef typename boost::graph_traits&lt;G&gt;::edge_iterator
edge_iterator;
void constraints() {
function_requires&lt; GraphConcept&lt;G&gt; &gt;();
function_requires&lt; MultiPassInputIteratorConcept&lt;edge_iterator&gt; &gt;();
p = edges(g);
E = num_edges(g);
e = *p.first;
u = source(e, g);
v = target(e, g);
const_constraints(g);
}
void const_constraints(const G&amp; g) {
p = edges(g);
E = num_edges(g);
e = *p.first;
u = source(e, g);
v = target(e, g);
}
std::pair&lt;edge_iterator,edge_iterator&gt; p;
typename boost::graph_traits&lt;G&gt;::vertex_descriptor u, v;
typename boost::graph_traits&lt;G&gt;::edge_descriptor e;
typename boost::graph_traits&lt;G&gt;::edges_size_type E;
G g;
};
</PRE>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-108
View File
@@ -1,108 +0,0 @@
<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&lt;edge_descriptor,&nbsp;bool&gt;</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 &copy; 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>
-161
View File
@@ -1,161 +0,0 @@
<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: EventVisitor</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>EventVisitor Concept</H1>
This concept defines the interface for single-event visitors. An
EventVisitor has an apply member function (<tt>operator()</tt>) which
is invoked within the graph algorithm at the event-point specified by
the <tt>event_filter</tt> typedef within the
EventVisitor. EventVisitor's can be combined into an <a
href="./EventVisitorList.html">EventVistorList</a>.
<p>
The following is the list of event tags that can be invoked in BGL
algorithms. Each tag corresponds to a member function of the visitor
for an algorithm. For example, the <a
href="./BFSVisitor.html">BFSVisitor</a> of <a
href="./breadth_first_search.html"><tt>breadth_first_search()</tt></a>
has a <tt>cycle_edge()</tt> member function. The corresponding tag is
<tt>on_cycle_edge</tt>. The first argument is the event visitor's
<tt>operator()</tt> must be either an edge or vertex descriptor
depending on the event tag.
<pre>
namespace boost {
struct on_initialize_vertex { };
struct on_start_vertex { };
struct on_discover_vertex { };
struct on_examine_edge { };
struct on_tree_edge { };
struct on_cycle_edge { };
struct on_finish_vertex { };
struct on_forward_or_cross_edge { };
struct on_back_edge { };
struct on_edge_relaxed { };
struct on_edge_not_relaxed { };
struct on_edge_minimized { };
struct on_edge_not_minimized { };
} // namespace boost
</pre>
<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>G</tt></TD>
<TD>A type that is a model of <a href="./Graph.html">Graph</a>.</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>A type that is a model of EventVisitor.</TD>
</TR>
<TR>
<TD><tt>vis</tt></TD>
<TD>An object of type <tt>V</tt>.</TD>
</TR>
<TR>
<TD><tt>x</tt></TD>
<TD>An object of type
<tt>boost::graph_traits&lt;G&gt;::vertex_descriptor</tt>
or <tt>boost::graph_traits&lt;G&gt;::edge_descriptor</tt>.</TD>
</TR>
</table>
<h3>Associated Types</h3>
<Table border>
<TR>
<TD>Event Filter </TD>
<TD><TT>V::event_filter</TT></TD>
<TD>
A tag struct to specify on which event the visitor should be invoked.
</TD>
</TR>
</table>
<h3>Valid Expressions</h3>
<Table border>
<tr>
<th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th>
</tr>
<tr>
<td>Apply Visitor</td>
<td><TT>vis(x, g)</TT></TD>
<TD><TT>void</TT></TD>
<TD>
Invokes the visitor operation on object <tt>x</tt>, which is
either a vertex or edge descriptor of the graph.
</TD>
</TR>
</table>
<h3>Models</h3>
<ul>
<li><a
href="./predecessor_recorder.html"><tt>predecessor_recorder</tt></a>
<li><a href="./distance_recorder.html"><tt>distance_recorder</tt></a>
<li><a href="./time_stamper.html"><tt>time_stamper</tt></a>
<li><a href="./property_writer.html"><tt>property_writer</tt></a>
<li><a href="./null_visitor.html"><tt>null_visitor</tt></a>
</ul>
<h3>See Also</h3>
<a href="./EventVisitorList.html">EventVisitorList</a>,
<a href="./visitor_concepts.html">Visitor concepts</a>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-127
View File
@@ -1,127 +0,0 @@
<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: EventVisitorList</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>EventVisitorList Concept</H1>
An EventVisitorList is either an <a
href="./EventVisitor.html">EventVisitor</a>, or a list of
EventVisitors combined using <tt>std::pair</tt>. Each graph algorithm
defines visitor adaptors that convert an EventVisitorList into the
particular kind of visitor needed by the algorithm.
In the following example we will show how to combine event visitors
into a list using <tt>std::pair</tt> and how to use an algorithm's
visitor adaptor class.
<p>
Suppose we would like to print out the parenthesis
structure of the discover/finish times of vertices in a <a
href="./graph_theory_review.html#sec:dfs-algorithm">depth-first
search</a>. We can use the BGL algorithm <a
href="./depth_first_search.html"><tt>depth_first_search()</tt></a> and
two event visitors to accomplish this. The complete source code for
the following example is in <a href="../example/dfs_parenthesis.cpp">
<tt>examples/dfs_parenthesis.cpp</tt></a>. First we define the two
event visitors. We use <tt>on_discover_vertex</tt> and
<tt>on_finish_vertex</tt> as the event points, selected from the list
of event points specified in <a
href="./DFSVisitor.html">DFSVisitor</a>.
<pre>
struct open_paren : public base_visitor&lt;open_paren&gt; {
typedef on_discover_vertex event_filter;
template &lt;class Vertex, class Graph&gt;
void operator()(Vertex v, Graph& G) {
std::cout &lt;&lt; "(" &lt;&lt; v;
}
};
struct close_paren : public base_visitor&lt;close_paren&gt; {
typedef on_finish_vertex event_filter;
template &lt;class Vertex, class Graph&gt;
void operator()(Vertex v, Graph& G) {
std::cout &lt;&lt; v &lt;&lt; ")";
}
};
</pre>
Next we create two event visitor objects and make an EventVisitorList
out of them using a <tt>std::pair</tt> which created by
<tt>std::make_pair</tt>.
<pre>
std::make_pair(open_paren(), close_paren())
</pre>
Next we want to pass this list into <tt>depth_first_search()</tt>, but
<tt>depth_first_search()</tt> is expecting a <a
href="./DFSVisitor.html">DFSVisitor</a>, not a EventVisitorList. We
therefore use the <a
href="./dfs_visitor.html"><tt>dfs_visitor</tt></a> adaptor which turns
an EventVisitor list into a DFSVisitor. Like all of the visitor
adaptors, <tt>dfs_visitor</tt> has a creation function called
<tt>make_dfs_visitor()</tt>.
<pre>
make_dfs_visitor(std::make_pair(open_paren(), close_paren()))
</pre>
Now we can pass the resulting visitor object into
<tt>depth_first_search()</tt> as follows.
<pre>
// graph object G is created ...
std::vector&lt;default_color_type&gt; color(num_vertices(G));
depth_first_search(G, make_dfs_visitor(std::make_pair(open_paren(), close_paren())),
color.begin());
</pre>
For creating a list of more than two event visitors, you can nest calls to
<tt>std::make_pair</tt> in the following way:
<pre>
std::make_pair(<i>visitor1</i>,
std::make_pair(<i>visitor2</i>,
...
std::make_pair(<i>visitorN-1</i>, <i>visitorN</i>)...));
</pre>
<h3>See Also</h3>
<a href="./EventVisitor.html">EventVisitor</a>,
<a href="./visitor_concepts.html">Visitor concepts</a>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-148
View File
@@ -1,148 +0,0 @@
<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>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:Graph"></A>
Graph
</H2>
<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. 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.
<P>
<h3>Notation</h3>
<Table>
<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>
</table>
<H3>Associated Types</H3>
<table border>
<tr>
<td><pre>boost::graph_traits&lt;G&gt;::vertex_descriptor</pre>
A vertex descriptor corresponds to a unique vertex in an abstract
graph instance. A vertex descriptor must be
<a
href="http://www.sgi.com/tech/stl/DefaultConstructible.html">Default Constructible</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&lt;G&gt;::edge_descriptor</pre>
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>.
</td>
</tr>
<tr>
<td><pre>boost::graph_traits&lt;G&gt;::directed_category</pre>
This type shall be convertible to <TT>directed_tag</TT> or <TT>undirected_tag</TT>.
</td>
</tr>
<tr>
<td><pre>boost::graph_traits&lt;G&gt;::edge_parallel_category</pre>
This describes whether the graph class allows the insertion of
parallel edges (edges with the same source and target). The two tags
are <TT>allow_parallel_edge_tag</TT> and <TT>disallow_parallel_edge_tag</TT>.
</td>
</tr>
<tr>
<td><pre>boost::graph_traits&lt;G&gt;::traversal_category</pre>
This describes the ways in which the vertices and edges of the
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>
</table>
<H3>Valid Expressions</H3>
<table border>
<tr>
<td><pre>boost::graph_traits&lt;G&gt;::null_vertex()</pre></td></TD>
<td>
Returns a special <tt>boost::graph_traits&lt;G&gt;::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>
<PRE>
template &lt;class G&gt;
struct GraphConcept
{
typedef typename boost::graph_traits&lt;G&gt;::vertex_descriptor vertex_descriptor;
typedef typename boost::graph_traits&lt;G&gt;::edge_descriptor edge_descriptor;
typedef typename boost::graph_traits&lt;G&gt;::directed_category directed_category;
typedef typename boost::graph_traits&lt;G&gt;::edge_parallel_category edge_parallel_category;
typedef typename boost::graph_traits&lt;G&gt;::traversal_category traversal_category;
void constraints() {
function_requires&lt; DefaultConstructibleConcept&lt;vertex_descriptor&gt; &gt;();
function_requires&lt; EqualityComparableConcept&lt;vertex_descriptor&gt; &gt;();
function_requires&lt; AssignableConcept&lt;vertex_descriptor&gt; &gt;();
function_requires&lt; DefaultConstructibleConcept&lt;edge_descriptor&gt; &gt;();
function_requires&lt; EqualityComparableConcept&lt;edge_descriptor&gt; &gt;();
function_requires&lt; AssignableConcept&lt;edge_descriptor&gt; &gt;();
}
G g;
};
</PRE>
<H3>See Also</H3>
<a href="./graph_concepts.html">Graph concepts</a>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-202
View File
@@ -1,202 +0,0 @@
<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>IncidenceGraph</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:IncidenceGraph"></A>
IncidenceGraph
</H1>
The IncidenceGraph concept provides an interface for
efficient access to the out-edges of each vertex in the graph.
<H3>Refinement of</H3>
<a href="./Graph.html">Graph</a>
<h3>Notation</h3>
<Table>
<TR>
<TD><tt>G</tt></TD>
<TD>A type that is a model of IncidenceGraph.</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&lt;G&gt;::edge_descriptor</tt>.</TD>
</TR>
<TR>
<TD><tt>u, v</tt></TD>
<TD>Are objects of type <tt>boost::graph_traits&lt;G&gt;::vertex_descriptor</tt>.</TD>
</TR>
</table>
<H3>Associated Types</H3>
<Table border>
<tr>
<td><tt>boost::graph_traits&lt;G&gt;::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&lt;G&gt;::out_edge_iterator</pre>
An out-edge iterator for a vertex <i>v</i> provides access to the
out-edges of the vertex. As such, the value type of an out-edge
iterator is the edge descriptor type of its graph. An out-edge
iterator must meet the requirements of <a
href="../../utility/MultiPassInputIterator.html">MultiPassInputIterator</a>.
</TD>
</TR>
<TR>
<TD><pre>boost::graph_traits&lt;G&gt;::degree_size_type</pre>
The unsigned integral type used for representing the number
out-edges or incident edges of a vertex.
</TD>
</TR>
</table>
<h3>Valid Expressions</h3>
<Table border>
<tr>
<td><a name="sec:source"><TT>source(e,&nbsp;g)</TT></a></TD>
<TD>Returns the vertex descriptor for <i>u</i> of the edge <i>(u,v)</i> represented by <TT>e</TT>.<br>
Return type: <TT>vertex_descriptor</TT>
</TD>
</TR>
<tr>
<td><a name="sec:target"><TT>target(e,&nbsp;g)</TT></a></TD>
<TD>Returns the vertex descriptor for <i>v</i> of the edge <i>(u,v)</i> represented by <TT>e</TT>.<br>
Return type: <TT>vertex_descriptor</TT>
</td></tr>
<tr>
<td><a name="sec:out-edges"><TT>out_edges(u,&nbsp;g)</TT></a></TD>
<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 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 be a vertex
adjacent to <tt>u</tt>.<a href="#1">[1]</a>
<br>
Return type: <TT>std::pair&lt;out_edge_iterator, out_edge_iterator&gt;</TT>
</TD>
</tr>
<tr>
<TD><TT>out_degree(u,&nbsp;g)</TT></TD>
<TD>Returns the number of out-edges (for directed graphs) or the
number of incident edges (for undirected graphs) of vertex <TT>u</TT>
in graph <TT>g</TT>.<br>
Return type: <TT>degree_size_type</TT>
</TD>
</TR>
</TABLE>
<P>
<H3>Complexity guarantees</H3>
<P>
The <TT>source()</TT>, <TT>target()</TT>, and <TT>out_edges()</TT>
functions must all be constant time. The <tt>out_degree()</tt>
function must be linear in the number of out-edges.
<P>
<H3>See Also</H3>
<a href="./graph_concepts.html">Graph concepts</a>
<H3>Notes</H3>
<a name="1">[1]</a> For undirected graphs, the edge <tt>(u,v)</tt> is
the same as edge <tt>(v,u)</tt>, so without some extra guarantee an
implementation would be free use any ordering for the pair of vertices
in an out-edge. For example, if you call <tt>out_edges(u, g)</tt>, and
<tt>v</tt> is one of the vertices adjacent to <tt>u</tt>, then the
implementation would be free to return <tt>(v,u)</tt> as an out-edge
which would be non-intuitive and cause trouble for algorithms.
Therefore, the extra requirement is added that the out-edge connecting
<tt>u</tt> and <tt>v</tt> must be given as <tt>(u,v)</tt> and not
<tt>(v,u)</tt>.
<H3>Concept Checking Class</H3>
<PRE>
template &lt;class G&gt;
struct IncidenceGraphConcept
{
typedef typename boost::graph_traits&lt;G&gt;::out_edge_iterator out_edge_iterator;
void constraints() {
function_requires&lt; GraphConcept&lt;G&gt; &gt;();
function_requires&lt; MultiPassInputIteratorConcept&lt;out_edge_iterator&gt; &gt;();
p = out_edges(u, g);
e = *p.first;
u = source(e, g);
v = target(e, g);
}
void const_constraints(const G&amp; g) {
p = out_edges(u, g);
e = *p.first;
u = source(e, g);
v = target(e, g);
}
std::pair&lt;out_edge_iterator, out_edge_iterator&gt; p;
typename boost::graph_traits&lt;G&gt;::vertex_descriptor u, v;
typename boost::graph_traits&lt;G&gt;::edge_descriptor e;
G g;
};
</PRE>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-161
View File
@@ -1,161 +0,0 @@
<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>IteratorConstructibleGraph</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:IteratorConstructibleGraph"></A>
IteratorConstructibleGraph
</H1>
The IteratorConstructibleGraph concept describes the interface for
graph types that can be constructed using a kind of edge iterator. The
edge iterator can be any <a
href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
that dereferences to a pair of integers <i>(i,j)</i>, which represent
an edge that should be in the graph. The two integers <i>i</i> and
<i>j</i> represent vertices where <i>0 <= i < |V|</i> and <i>0 <= j <
|V|</i>. The edge iterator's value type should be
<tt>std::pair&lt;T,T&gt;</tt> (or at least be a structure that has
members <tt>first</tt> and <tt>second</tt>) and the value type
<tt>T</tt> of the pair must be convertible to the
<tt>vertices_size_type</tt> of the graph (an integer).
There are two valid expressions required by this concept, both of
which are constructors. The first creates a graph object from a
first/last iterator range. The second constructor also takes a
first/last iterator range and in addition requires the number of
vertices and number of edges. For some graph and edge iterator types
the second constructor can be more efficient than the first.
<h3>Example</h3>
The following exampe creates two graph objects from an array of edges
(vertex pairs). The type <tt>Edge*</tt> satisfies the requirements for
an <a
href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
and can therefore be used to construct a graph.
<pre>
typedef ... IteratorConstructibleGraph;
typedef boost::graph_traits<IteratorConstructibleGraph> Traits;
typedef std::pair<Traits::vertices_size_type,
Traits::vertices_size_type> Edge;
Edge edge_array[] =
{ Edge(0,1), Edge(0,2), Edge(0,3), Edge(0,4), Edge(0,5),
Edge(1, 2), Edge(1,5), Edge(1,3),
Edge(2, 4), Edge(2,5),
Edge(3, 2),
Edge(4, 3), Edge(4,1),
Edge(5, 4) };
Edge* first = edge_array,
last = edge_array + sizeof(edge_array)/sizeof(Edge);
IteratorConstructibleGraph G1(first, last);
// do something with G1 ...
Traits::vertices_size_type size_V = 6;
Traits::edges_size_type size_E = sizeof(edge_array)/sizeof(Edge);
IteratorConstructibleGraph G2(first, last, size_V, size_E);
// do something with G2 ...
</pre>
<h3>Refinement of</h3>
<a href="Graph.html">Graph</a>
<h3>Notation</h3>
<Table>
<tr>
<td><tt>G</tt></td>
<td>is a graph type that models IteratorConstructibleGraph.</td>
<tr>
<tr>
<td><tt>g</tt></td>
<td>is an object of type <tt>G</tt>.</td>
</tr>
<tr>
<td><tt>first, last</tt></td>
<td>are edge iterators (see above).</td>
</tr>
<tr>
<td><tt>Tr</tt></td>
<td>is an object of type <tt>graph_traits&lt;G&gt;</tt>.</td>
</tr>
<tr>
<td><tt>n_vertices</tt></td>
<td>is an object of type <tt>Tr::vertices_size_type</tt>.</td>
</tr>
<tr>
<td><tt>n_edges</tt></td>
<td>is an object of type <tt>Tr::edges_size_type</tt>.</td>
</tr>
</Table>
<h3>Valid Expressions</h3>
<Table border>
<tr>
<td>
<pre>G g(first, last);</pre>
Construct graph object <tt>g</tt> given an edge range <tt>[first,last)</tt>.
</td>
<tr>
<tr>
<td>
<pre>G g(first, last, n_vertices, n_edges);</pre>
Construct graph object <tt>g</tt> given an edge range
<tt>[first,last)</tt>, the number of vertices, and the number of
edges. Sometimes this constructor is more efficient than the
constructor lacking the graph size information.
</td>
</tr>
</Table>
<!--
<H3>Concept Checking Class</H3>
<PRE>
</PRE>
-->
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-99
View File
@@ -1,99 +0,0 @@
<!DOCTYPE html>
<!--
Copyright Daniel Trebbien 2010.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or the copy at
http://www.boost.org/LICENSE_1_0.txt)
-->
<html>
<head>
<title>KeyedUpdatableQueue</title>
</head>
<body>
<img src="../../../boost.png" alt="C++ Boost">
<h2><a name="concept:KeyedUpdatableQueue">KeyedUpdatableQueue</a></h2>
<p>A <i>KeyedUpdatableQueue</i> is a refinement of the <a href="./UpdatableQueue.html">UpdatableQueue</a> concept.
It requires that models order the contained values by their <i>keys</i>, to which
values are mapped via a read/write key map.
<h3>Notation</h3>
<table>
<tr> <td> <tt>Q</tt> </td> <td> is a type that models KeyedUpdatableQueue. </td></tr>
<tr> <td> <tt>T</tt> </td> <td> is the value type of <tt>Q</tt>. </td></tr>
</table>
<h3>Members</h3>
For a type to model the KeyedUpdatableQueue concept it must have the following members
in addition to the members that are required of types that model <a href="./UpdatableQueue.html">UpdatableQueue</a>:
<p>
<table border="1">
<tr> <td><b>Member</b></td> <td><b>Description</b></td> </tr>
<tr> <td> <tt>key_type</tt> </td>
<td> The type of keys that are associated with values </td>
</tr>
<tr> <td> <tt>key_map</tt> </td>
<td> The key property map type. This type must model <a href="../../property_map/doc/ReadWritePropertyMap.html">Read/Write Property Map</a>. </td>
</tr>
<tr> <td> <tt>key_map keys() const</tt> </td>
<td> Returns the key map </td>
</tr>
</table>
<h3>Concept Checking Class</h3>
<p><a href="../../../boost/graph/buffer_concepts.hpp"><tt>boost/graph/buffer_concepts.hpp</tt></a>
<pre>
template &lt;class Q&gt;
struct KeyedUpdatableQueueConcept
{
typedef typename Q::key_type key_type;
typedef typename Q::key_map key_map;
void constraints() {
function_requires&lt; UpdatableQueue&lt;Q&gt; &gt;();
function_requires&lt; ReadWritePropertyMap&lt; key_map, typename Buffer&lt;Q&gt;::value_type &gt; &gt;();
}
void const_constraints(const Q&amp; cq) {
km = cq.keys();
k = get(km, g_ct);
}
static const typename Buffer&lt;Q&gt;::value_type g_ct;
key_type k;
key_map km;
Q q;
};
</pre>
<h3>Models</h3>
<ul>
<li><tt>boost::d_ary_heap_indirect</tt></a>
</ul>
<br>
<hr>
<table>
<tr>
<td>Copyright&nbsp;&copy;&nbsp;2010</td>
<td>Daniel Trebbien (<a href="mailto:dtrebbien@gmail.com">dtrebbien@gmail.com</a>)
</td>
</tr>
</table>
</body>
</html>
-101
View File
@@ -1,101 +0,0 @@
# 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)
-122
View File
@@ -1,122 +0,0 @@
<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,&nbsp;b)</TT></a></TD>
<TD>See below for semantics.<br>
Return type: <TT>X</TT>
</TD>
</TR>
<tr>
<TD><TT>a&nbsp;==&nbsp;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&nbsp;!=&nbsp;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 &copy; 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>
-299
View File
@@ -1,299 +0,0 @@
<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>MutableGraph</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="sec:MutableGraph"></A>
MutableGraph
</H2>
A MutableGraph can be changed via the addition or removal of
edges and vertices.
<H3>Refinement of</H3>
<a href="./Graph.html">Graph</a>
<h3>Notation</h3>
<Table>
<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&lt;G&gt;::edge_descriptor</tt>.</TD>
</TR>
<TR>
<TD><tt>u,v</tt></TD>
<TD>are objects of type <tt>boost::graph_traits&lt;G&gt;::vertex_descriptor</tt>.</TD>
</TR>
<TR>
<TD><tt>iter</tt></TD>
<TD>is an object of type <tt>boost::graph_traits&lt;G&gt;::out_edge_iterator</tt>.</TD>
</TR>
<TR>
<TD><tt>p</tt></TD>
<TD>is an object of a type that models <a
href="http://www.sgi.com/tech/stl/Predicate.html">Predicate</a>
and whose argument type matches the <tt>edge_descriptor</tt> type.
</TR>
</table>
<H3>Valid Expressions</H3>
<table border>
<tr>
<TD><a name="sec:add-edge"><TT>add_edge(u,&nbsp;v,&nbsp;g)</TT></a></TD>
<TD>
Inserts the edge <i>(u,v)</i> into the graph, and returns an edge
descriptor pointing to the new edge. If the graph disallows parallel
edges, and the edge <i>(u,v)</i> is already in the graph, then the
<tt>bool</tt> flag returned is <tt>false</tt> and the returned edge
descriptor points to the already existing edge. Note that for
undirected graphs, <i>(u,v)</i> is the same edge as <i>(v,u)</i>, so
after a call to the function <tt>add_edge()</tt>, this implies that
edge <i>(u,v)</i> will appear in the out-edges of <i>u</i> and
<i>(u,v)</i> (or equivalently <i>(v,u)</i>) will appear in the
out-edges of <i>v</i>. Put another way, <i>v</i> will be adjacent to
<i>u</i> and <i>u</i> will be adjacent to <i>v</i>.
<br>
Return type: <TT>std::pair&lt;edge_descriptor, bool&gt;</TT>
</TD>
</tr>
<tr>
<TD><a name="sec:remove_edge"><TT>remove_edge(u,&nbsp;v,&nbsp;g)</TT></a></TD>
<TD>
Remove the edge <i>(u,v)</i> from the graph. If the
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>
Postcondition: <i>(u,v)</i> is no longer in the edge set for
<TT>g</TT>.<br>
</TD>
</TR>
<tr>
<TD><TT>remove_edge(e,&nbsp;g)</TT></TD>
<TD>Remove the edge <i>e</i> from the graph.<br>
Return type: <TT>void</TT><br>
Precondition: <i>e</i> is an edge in the graph.<br>
Postcondition: <i>e</i> is no longer in the edge set for <TT>g</TT>.
</TD>
</TR>
<tr>
<TD><TT>remove_edge(iter,&nbsp;g)</TT></TD>
<TD>Remove the edge pointed to be <tt>iter</tt> from the graph. This
expression is only required when the graph also models <a
href="./IncidenceGraph.html">IncidenceGraph</a>.<br>
Return type: <TT>void</TT><br>
Precondition: <tt>*iter</tt> is an edge in the graph.<br>
Postcondition: <tt>*iter</tt> is no longer in the edge set for <TT>g</TT>.
</TD>
</TR>
<tr>
<TD><TT>remove_edge_if(p,&nbsp;g)</TT></TD>
<TD>Remove all the edges from graph <tt>g</tt> for which
the predicate <tt>p</tt> returns true.<br>
Return type: <TT>void</TT>
</TD>
</TR>
<tr>
<TD><TT>remove_out_edge_if(u,&nbsp;p,&nbsp;g)</TT></TD>
<TD>Remove all the out-edges of vertex <tt>u</tt> for which the
predicate <tt>p</tt> returns true. This expression is only required
when the graph also models <a
href="./IncidenceGraph.html">IncidenceGraph</a>.<br>
Return type: <TT>void</TT>
</TD>
</TR>
<tr>
<TD><TT>remove_in_edge_if(u,&nbsp;p,&nbsp;g)</TT></TD>
<TD>Remove all the in-edges of vertex <tt>u</tt> for which the
predicate <tt>p</tt> returns true. This expression is only required when the
graph also models <a
href="./BidirectionalGraph.html">BidirectionalGraph</a>.<br>
Return type: <TT>void</TT>
</TD>
</TR>
<tr>
<TD><a name="sec:add-vertex"><TT>add_vertex(g)</TT></a></TD>
<TD>
Add a new vertex to the graph. The <TT>vertex_descriptor</TT> for the
new vertex is returned.<br>
Return type: <TT>vertex_descriptor</TT>
</TD>
</TR>
<tr>
<TD><TT>clear_vertex(u,&nbsp;g)</TT></TD>
<TD>
Remove all edges to and from vertex <tt>u</tt> from the graph.<br>
Return type: <TT>void</TT><br>
Precondition: <tt>u</tt> is a valid vertex descriptor of <TT>g</TT>.<br>
Postcondition: <tt>u</tt> does not appear as a source or target of
any edge in <TT>g</TT>.
</TD>
</TR>
<tr>
<TD><a name="sec:remove-vertex"><TT>remove_vertex(u,&nbsp;g)</TT></a></TD>
<TD>
Remove <i>u</i> from the vertex set of the graph. Note that undefined
behavior may result if there are edges remaining in the graph who's
target is <i>u</i>. Typically the <TT>clear_vertex()</TT> function
should be called first.<br>
Return type: <TT>void</TT><br>
Precondition: <TT>u</TT> is a valid vertex descriptor of <TT>g</TT>.<br>
Postcondition: <TT>num_vertices(g)</TT> is one less, <TT>u</TT>
no longer appears in the vertex set of the graph and it
is no longer a valid vertex descriptor.
</TD>
</TR>
</TABLE>
<P>
</LI>
</UL>
<P>
<H3>Complexity Guarantees</H3>
<P>
<UL>
<LI>Edge insertion must be either amortized constant time or it
can be <i>O(log(E/V))</i> if the insertion also checks to
prevent the addition of parallel edges (which is a ``feature'' of
some graph types).
</LI>
<LI>Edge removal is guaranteed to be <i>O(E)</i>.</LI>
<LI>Vertex insertion is guaranteed to be amortized constant time.</LI>
<LI>Clearing a vertex is <i>O(E + V)</i>.</LI>
<LI>Vertex removal is <i>O(E + V)</i>.</LI>
</UL>
<H3>Models</H3>
<UL>
<LI><TT>adjacency_list</TT>
</LI>
</UL>
<H3>Concept Checking Class</H3>
<PRE>
template &lt;class G&gt;
struct MutableGraphConcept
{
typedef typename boost::graph_traits&lt;G&gt;::edge_descriptor edge_descriptor;
void constraints() {
v = add_vertex(g);
clear_vertex(v, g);
remove_vertex(v, g);
e_b = add_edge(u, v, g);
remove_edge(u, v, g);
remove_edge(e, g);
}
G g;
edge_descriptor e;
std::pair&lt;edge_descriptor, bool&gt; e_b;
typename boost::graph_traits&lt;G&gt;::vertex_descriptor u, v;
typename boost::graph_traits&lt;G&gt;::out_edge_iterator iter;
};
template &lt;class edge_descriptor&gt;
struct dummy_edge_predicate {
bool operator()(const edge_descriptor& e) const {
return false;
}
};
template &lt;class G&gt;
struct MutableIncidenceGraphConcept
{
void constraints() {
function_requires&lt; MutableGraph&lt;G&gt; &gt;();
remove_edge(iter, g);
remove_out_edge_if(u, p, g);
}
G g;
typedef typename boost::graph_traits&lt;G&gt;::edge_descriptor edge_descriptor;
dummy_edge_predicate&lt;edge_descriptor&gt; p;
typename boost::graph_traits&lt;G&gt;::vertex_descriptor u;
typename boost::graph_traits&lt;G&gt;::out_edge_iterator iter;
};
template &lt;class G&gt;
struct MutableBidirectionalGraphConcept
{
void constraints() {
function_requires&lt; MutableIncidenceGraph&lt;G&gt; &gt;();
remove_in_edge_if(u, p, g);
}
G g;
typedef typename boost::graph_traits&lt;G&gt;::edge_descriptor edge_descriptor;
dummy_edge_predicate&lt;edge_descriptor&gt; p;
typename boost::graph_traits&lt;G&gt;::vertex_descriptor u;
};
template &lt;class G&gt;
struct MutableEdgeListGraphConcept
{
void constraints() {
function_requires&lt; MutableGraph&lt;G&gt; &gt;();
remove_edge_if(p, g);
}
G g;
typedef typename boost::graph_traits&lt;G&gt;::edge_descriptor edge_descriptor;
dummy_edge_predicate&lt;edge_descriptor&gt; p;
};
</PRE>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-150
View File
@@ -1,150 +0,0 @@
<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>MutablePropertyGraph</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="sec:MutablePropertyGraph"></A>
MutablePropertyGraph
</H2>
A MutablePropertyGraph is a <a
href="./MutableGraph.html">MutableGraph</a> with properties attached
internally to the vertices and edges. When adding vertices and edges
the value of the properties can be given.
<H3>Refinement of</H3>
<a href="./MutableGraph.html">MutableGraph</a> and
<a href="./PropertyGraph.html">PropertyGraph</a>
<H3>Notation</H3>
<TABLE>
<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&lt;G&gt;::edge_descriptor</tt>.</TD>
</TR>
<TR>
<TD><tt>u,v</tt></TD>
<TD>are objects of type <tt>boost::graph_traits&lt;G&gt;::vertex_descriptor</tt>.</TD>
</TR>
<TR>
<TD><TT>ep</TT></TD><TD>is an object of type <TT>G::edge_property_type</TT></TD>
</TR>
<TR>
<TD><TT>vp</TT></TD><TD>is an object of type <TT>G::vertex_property_type</TT></TD>
</TR>
</TABLE>
<P>
<H3>Associated Types</H3>
<table border>
<tr>
<td>Edge Property Type </td>
<td><TT>graph_traits&lt;G&gt;::edge_property_type</TT></td>
</tr>
<tr>
<td>Vertex Property Type </td>
<td><TT>graph_traits&lt;G&gt;::vertex_property_type</TT> </td>
</tr>
</table>
<H3>Valid Expressions</h3>
<table border>
<tr>
<TD><TT>add_edge(u,&nbsp;v,&nbsp;ep,&nbsp;g)</TT></TD>
<TD>Inserts the edge <i>(u,v)</i> into the graph, and
copies object <TT>ep</TT> into the property for that edge.<br>
Return type: <TT>std::pair&lt;edge_descriptor, bool&gt;</TT></TD>
</TR>
<tr>
<TD><TT>add_vertex(vp,&nbsp;g)</TT></TD>
<TD>
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>
</TD>
</TR>
</TABLE>
<H3>Models</H3>
<UL>
<LI><TT>adjacency_list</TT></LI>
</UL>
<H3>Concept Checking Class</H3>
<P>
<PRE>
template &lt;class G&gt;
struct MutablePropertyGraphConcept
{
typedef typename boost::graph_traits&lt;G&gt;::edge_descriptor edge_descriptor;
void constraints() {
function_requires&lt; MutableGraphConcept&lt;G&gt; &gt;();
v = add_vertex(vp, g);
p = add_edge(u, v, ep, g);
}
G g;
std::pair&lt;edge_descriptor, bool&gt; p;
typename boost::graph_traits&lt;G&gt;::vertex_descriptor u, v;
typename boost::graph_traits&lt;G&gt;::vertex_property_type vp;
typename boost::graph_traits&lt;G&gt;::edge_property_type ep;
};
</PRE>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-178
View File
@@ -1,178 +0,0 @@
<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&lt;Graph&gt;::edge_descriptor</tt>.
</td>
</tr>
<tr>
<td> <tt>v</tt> </td>
<td> is an object of type <tt>graph_traits&lt;Graph&gt;::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&lt;Embedding&gt;::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&lt;Embedding&gt;::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&lt;Embedding&gt;::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 &lt;boost/property_map/property_map.hpp&gt;
#include &lt;vector&gt;
...
// 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&lt; std::vector&lt; graph_traits&lt;Graph&gt;::edge_descriptor &gt; &gt;
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&lt; planar_embedding_storage_t::iterator,
property_map&lt;Graph, vertex_index_t&gt;::type
&gt;
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>
-148
View File
@@ -1,148 +0,0 @@
<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&lt;G&gt;::edge_descriptor</tt>.
</td>
</tr>
<tr>
<td><tt>v</tt></td>
<td>An object of type <tt>boost::graph_traits&lt;G&gt;::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 &copy; 2007 Aaron Windsor (<a href="mailto:aaron.windsor@gmail.com">
aaron.windsor@gmail.com</a>)
</BODY>
</HTML>
-210
View File
@@ -1,210 +0,0 @@
<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>PropertyGraph</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:PropertyGraph"></A>
PropertyGraph
</H2>
A PropertyGraph is a graph that has some property associated with each
of the vertices or edges in the graph. As a given graph may have
several properties associated with each vertex or edge, a tag is used
to identify which property is being accessed. The graph provides a
function which returns a property map object.
<P>
<H3>Refinement of</H3>
<a href="./Graph.html">Graph</a>
<h3>Notation</h3>
<Table>
<TR>
<TD><tt>G</tt></TD>
<TD>A type that is a model of PropertyGraph.</TD>
</TR>
<TR>
<TD><tt>g</tt></TD>
<TD>An object of type <tt>G</tt>.</TD>
</TR>
<TR>
<TD><tt>X</tt></TD>
<TD>Either the vertex or edge descriptor type for <tt>G</tt>.</TD>
</TR>
<TR>
<TD><tt>x</tt></TD>
<TD>An object of type <tt>X</tt>.</TD>
</TR>
<TR>
<TD><tt>Map</tt></TD>
<TD>The type <tt>boost::property_map&lt;G, Property&gt;::const_type</tt>.</TD>
</TR>
<TR>
<TD><tt>v</tt></TD>
<TD>An object of type <tt>boost::property_traits&lt;Map&gt;::value_type</tt>.</TD>
</TR>
<TR>
<TD><tt>PropertyTag</tt></TD>
<TD>A type that models the <a href="./PropertyTag.html">PropertyTag</a> concept.</TD>
</TR>
<TR>
<TD><tt>p</tt></TD>
<TD>An object of type <tt>PropertyTag</tt>.</td>
</TR>
<TR>
<TD><tt>pmap</tt></TD>
<TD>An object of type <tt>Map</tt>.</td>
</TR>
</table>
<H3>Associated types</H3>
<table border>
<tr>
<td><pre>boost::property_map&lt;G, PropertyTag&gt;::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/doc/ReadWritePropertyMap.html">ReadWritePropertyMap</a>
with a key type the same as the graph's vertex or edge descriptor type.
</td>
</tr>
<tr>
<td><pre>boost::property_map&lt;G, PropertyTag&gt;::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/doc/ReadablePropertyMap.html">ReadablePropertyMap</a>
with a key type the same as the graph's vertex or edge descriptor type.
</td>
</tr>
</table>
<h3>Valid Expressions</h3>
<table border>
<tr>
<td> <TT>get(p,&nbsp;g)</TT> </td>
<td>
Returns the property map for the property specified by the
<tt>PropertyTag</tt> type. The object <tt>p</tt> is only used to
carry the type.<br>
Return type: <TT>boost::property_map&lt;G,&nbsp;PropertyTag&gt;::type</TT> if <TT>g</TT> is mutable and <br><TT>boost::property_map&lt;G,&nbsp;PropertyTag&gt;::const_type</TT> otherwise.
</td>
</TR>
<tr>
<td> <TT>get(p,&nbsp;g,&nbsp;x)</TT> </td>
<td>
Returns the property value (specified by the <tt>PropertyTag</tt> type)
associated with object <tt>x</tt> (a vertex or edge).
The object <tt>p</tt> is only used to carry the type.
This function is equivalent to:<br>
<tt>get(get(p, g), x)</tt><br>
Return type: <tt>boost::property_traits&lt;Map&gt;::value_type</tt>
</td>
</TR>
<tr>
<td> <TT>put(p,&nbsp;g,&nbsp;x,&nbsp;v)</TT> </td>
<td>
Set the property (specified by the <tt>PropertyTag</tt> type)
associated with object <tt>x</tt> (a vertex or edge) to
the value <tt>v</tt>. The object <tt>p</tt> is only used to carry the type.
This function is equivalent to:<br>
<tt>
pmap = get(p, g);<br>
put(pmap, x, v)
</tt><br>
Return type: <TT>void</TT>
</td>
</TR>
</TABLE>
<H3>Complexity</H3>
The <tt>get()</tt> property map function must be constant time.
<H3>Models</H3>
<UL>
<LI><tt>adjacency_list</tt> with <tt>VertexProperty=property&lt;vertex_distance_t,int,property&lt;vertex_in_degree_t,int&gt; &gt;</tt> and <tt>PropertyTag=vertex_distance_t</tt>.</li>
<li><tt>adjacency_list</tt> with <tt>VertexPropertyTag=property&lt;vertex_distance_t,int,property&lt;vertex_in_degree_t,int&gt; &gt;</TT> and <tt>PropertyTag=vertex_in_degree_t</tt>.</li>
</UL>
<H3>Concept Checking Class</H3>
<PRE>
template &lt;class Graph, class X, class PropertyTag&gt;
struct PropertyGraphConcept
{
typedef typename property_map&lt;G, PropertyTag&gt;::type Map;
typedef typename property_map&lt;G, PropertyTag&gt;::const_type const_Map;
void constraints() {
function_requires&lt; GraphConcept&lt;G&gt; &gt;();
function_requires&lt; ReadWritePropertyMapConcept&lt;Map, X&gt; &gt;();
function_requires&lt; ReadablePropertyMapConcept&lt;const_Map, X&gt; &gt;();
Map pmap = get(PropertyTag(), g);
pval = get(PropertyTag(), g, x);
put(PropertyTag(), g, x, pval);
ignore_unused_variable_warning(pmap);
}
void const_constraints(const G&amp; g) {
const_Map pmap = get(PropertyTag(), g);
pval = get(PropertyTag(), g, x);
ignore_unused_variable_warning(pmap);
}
G g;
X x;
typename property_traits&lt;Map&gt;::value_type pval;
};
</PRE>
<h3>See Also</h3>
<a href="./property_map.html"><tt>property_map</tt></a>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-117
View File
@@ -1,117 +0,0 @@
<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>Property</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:PropertyTag"></A>
PropertyTag
</H2>
A Property Tag is a type used to name or identify properties that are
attached to the vertices and edges of a graph. A Property type is not
the type of the actual property values. Objects of the Property type
are not used except to carry the type information which specifies the
property. See the section about <A
href="using_adjacency_list.html#sec:custom-edge-properties"> Custom
Edge Properties</a> for a description of how to define your own
property tags.
<h3>Associated Types</h3>
<table border>
<tr>
<td>Property Kind </td>
<td><TT>property_kind&lt;PropertyTag&gt;::type</TT> </td>
<td>
This specifies whether the property is a <a
name="VertexPropertyTag"><b>Vertex Property Tag</b></a>
(<tt>vertex_property_tag</tt>), an <a
name="EdgePropertyTag"><b>Edge Property Tag</b></a> (<tt>edge_property_tag</tt>), or
a <a name="GraphPropertyTag"><b>Graph Property Tag</b></a> which is attached to the
graph object itself (<tt>graph_property_tag</tt>). The tags are
defined in <a
href="../../../boost/graph/properties.hpp"><tt>boost/graph/properties.hpp</tt></a>. The <tt>property_kind</tt> traits class is defined in <a href="../../../boost/pending/property.hpp"><tt>boost/pending/property.hpp</tt></a>.
</td>
</tr>
<tr>
<td>Property ID Number </td>
<td><TT>property_num&lt;PropertyTag&gt;::value</TT> </td>
<td>
This is needed as a workaround when using compilers that do not
support partial specialization (and hence prevent us from using
<tt>boost::is_same</tt> to detect if two property tags are the same).
The <tt>property_num</tt> traits class is defined in <a
href="../../../boost/pending/property.hpp"><tt>boost/pending/property.hpp</tt></a>.
</td>
</tr>
</table>
<h3>Refinement of</h3>
<a
href="http://www.sgi.com/tech/stl/DefaultConstructible.html">Default Constructible</a>
<h3>Models</h3>
The following models of the Property Tag concept are defined
in <a
href="../../../boost/graph/properties.hpp"><tt>boost/graph/properties.hpp</tt></a>.
<ul>
<li><tt>vertex_index_t</tt></li>
<li><tt>edge_index_t</tt></li>
<li><tt>graph_name_t</tt></li>
<li><tt>vertex_name_t</tt></li>
<li><tt>edge_name_t</tt></li>
<li><tt>edge_weight_t</tt></li>
<li><tt>vertex_distance_t</tt></li>
<li><tt>vertex_color_t</tt></li>
<li><tt>vertex_degree_t</tt></li>
<li><tt>vertex_out_degree_t</tt></li>
<li><tt>vertex_in_degree_t</tt></li>
<li><tt>vertex_discover_time_t</tt></li>
<li><tt>vertex_finish_time_t</tt></li>
</ul>
<h3>See Also</h3>
<a href="./PropertyGraph.html">PropertyGraph</a>
and
<a href="../../property_map/doc/property_map.html">Property Map Concepts</a>
<h3>Notes</h3>
On compilers that do not support partial specialization, each Property
type is also required to specialize
<tt>property_num&lt;PropertyTag&gt;</tt> to contain an enum named
<tt>value</tt> which uniquely identifies the property type.
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-99
View File
@@ -1,99 +0,0 @@
<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&lt;G&gt;::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 &copy; 2008</TD><TD>
Matyas Egyhazy</TD></TR></TABLE>
</BODY>
</HTML>
-100
View File
@@ -1,100 +0,0 @@
<!DOCTYPE html>
<!--
Copyright Daniel Trebbien 2010.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or the copy at
http://www.boost.org/LICENSE_1_0.txt)
-->
<html>
<head>
<title>UpdatableQueue</title>
</head>
<body>
<img src="../../../boost.png" alt="C++ Boost">
<h2><a name="concept:UpdatableQueue">UpdatableQueue</a></h2>
<p>An <i>UpdatableQueue</i> is a refinement of the <a href="./Buffer.html">Buffer</a> concept that additionally requires that the Buffer be updatable.
<p>Implicit in the definition is an ordering of values. Though access to the order is not required, types that model UpdatableQueue must document how an object of the type orders values so that a program may change the position of a given value in the ordering. For example, an UpdatableQueue may choose to order values by using a property map, and a value <tt>v1</tt> is considered less than a value <tt>v2</tt> if <tt><nobr>get(pm, v1) &lt; get(pm, v2)</nobr></tt>. A program can update the properties of values, thus changing the order of values in the UpdatableQueue, and notify the UpdatableQueue of the specific values that have a different position in the ordering by calling the <tt>update</tt> member of the UpdatableQueue on each.
<p>A program that modifies the order must notify the UpdatableQueue of values that may have different positions in the ordering since they were inserted or last updated.
<h3>Notation</h3>
<table>
<tr> <td> <tt>Q</tt> </td> <td> is a type that models UpdatableQueue. </td></tr>
<tr> <td> <tt>T</tt> </td> <td> is the value type of <tt>Q</tt>. </td></tr>
</table>
<h3>Members</h3>
For a type to model the UpdatableQueue concept it must have the following members
in addition to the members that are required of types that model <a href="./Buffer.html">Buffer</a>:
<p>
<table border="1">
<tr> <td><b>Member</b></td> <td><b>Description</b></td> </tr>
<tr> <td> <a name="concept:UpdatableQueue:update"><tt>void update(const T& t)</tt></a> </td>
<td> Informs the UpdatableQueue that the program has modified the position of <tt>t</tt> in the ordering </td>
</tr>
<tr> <td> <tt><i>unspecified-bool-type</i> contains(const T& t) const</tt> </td>
<td> Returns whether the queue contains <tt>t</tt> </td>
</tr>
</table>
<h3>Concept Checking Class</h3>
<p><a href="../../../boost/graph/buffer_concepts.hpp"><tt>boost/graph/buffer_concepts.hpp</tt></a>
<pre>
template &lt;class Q&gt;
struct UpdatableQueueConcept
{
void constraints() {
function_requires&lt; Buffer&lt;Q&gt; &gt;();
q.update(g_ct);
}
void const_constraints(const Q&amp; cq) {
if (cq.contains(g_ct));
}
static const typename Buffer&lt;Q&gt;::value_type g_ct;
Q q;
};
</pre>
<h3>Futher Refinements</h3>
<ul>
<li><a href="#concept%3AUpdatablePriorityQueue">UpdatablePriorityQueue</a>
<li><a href="./KeyedUpdatableQueue.html">KeyedUpdatableQueue</a>
</ul>
<h2><a name="concept:UpdatablePriorityQueue">UpdatablePriorityQueue</a></h2>
<p>An <i>UpdatablePriorityQueue</i> is a slight refinement of <a href="#concept%3AUpdatableQueue">UpdatableQueue</a>
that imposes the requirement that a program may not increase the position of a value that is held in the queue. That is,
if a value <tt>v</tt> had position <i>n</i> in the ordering, a program may update the position of <tt>v</tt> only to 0, 1, ..., <i>n</i>&nbsp;-&nbsp;1, or <i>n</i>, where 0 is the top of the queue.
<p>The behavior when a program attempts to increase a value's position in the ordering is undefined.
<br>
<hr>
<table>
<tr>
<td>Copyright&nbsp;&copy;&nbsp;2010</td>
<td>Daniel Trebbien (<a href="mailto:dtrebbien@gmail.com">dtrebbien@gmail.com</a>)
</td>
</tr>
</table>
</body>
</html>
-70
View File
@@ -1,70 +0,0 @@
<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>VertexAndEdgeListGraph</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:VertexAndEdgeListGraph"></A>
VertexAndEdgeListGraph
</H2>
The VertexAndEdgeListGraph concept refines the <a
href="./VertexListGraph.html">VertexListGraph</a> and the <a
href="./EdgeListGraph.html">EdgeListGraph</a> concepts. No further
requirements are added.
<H3>Refinement of</H3>
<a href="./VertexListGraph.html">VertexListGraph</a>,
<a href="./EdgeListGraph.html">EdgeListGraph</a>
<H3>Models</H3>
<UL>
<LI><TT>adjacency_list</TT></LI>
</UL>
<P>
<H3>See Also</H3>
<a href="./graph_concepts.html">Graph concepts</a>
<H3>Concept Checking Class</H3>
<P>
<PRE>
template &lt;class G&gt;
struct VertexAndEdgeListGraphConcept
{
void constraints() {
function_requires&lt; VertexListGraphConcept&lt;G&gt; &gt;();
function_requires&lt; EdgeListGraphConcept&lt;G&gt; &gt;();
}
};
</PRE>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-154
View File
@@ -1,154 +0,0 @@
<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>VertexListGraph</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:VertexListGraph">
VertexListGraph
</H2>
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="./Graph.html">Graph</a>
<H3>Associated Types</H3>
<Table border>
<tr>
<td><tt>boost::graph_traits&lt;G&gt;::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&lt;G&gt;::vertex_iterator</tt><br><br>
A vertex iterator (obtained via <TT>vertices(g)</TT>) provides access
to all of the vertices in a graph. A vertex iterator type must meet
the requirements of <a
href="../../utility/MultiPassInputIterator.html">MultiPassInputIterator</a>. The
value type of the vertex iterator must be the vertex descriptor of the
graph.
</TD>
</TR>
<tr>
<td><tt>boost::graph_traits&lt;G&gt;::vertices_size_type</tt><br><br>
The unsigned integer type used to represent the number of vertices
in the graph.
</td>
</tr>
</table>
<h3>Valid Expressions</h3>
<table border>
<tr>
<th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th>
</tr>
<tr>
<td>Vertex Set of the Graph</td>
<td><a name="sec:vertices"><TT>vertices(g)</TT></a></TD>
<TD><TT>std::pair&lt;vertex_iterator,&nbsp;vertex_iterator&gt;</TT></TD>
<TD>
Returns an iterator-range providing access to all the vertices in the
graph<TT>g</TT>.
</TD>
</TR>
<tr>
<td>Number of Vertices in the Graph </td>
<td><TT>num_vertices(g)</TT></TD>
<TD><TT>vertices_size_type</TT></TD>
<TD>Returns the number of vertices in the graph <TT>g</TT>.</TD>
</TR>
</TABLE>
<H3>Complexity guarantees</H3>
<P>
The <TT>vertices()</TT> function must return in constant time.
<H3>See Also</H3>
<a href="./graph_concepts.html">Graph concepts</a>
<H3>Design Rationale</H3>
One issue in the design of this concept is whether to include the
refinement from the <a href="./IncidenceGraph.html">IncidenceGraph</a>
and <a href="./AdjacencyGraph.html">AdjacencyGraph</a> concepts. The
ability to traverse the vertices of a graph is orthogonal to
traversing out-edges, so it would make sense to have a VertexListGraph
concept that only includes vertex traversal. However, such a concept
would no longer really be a graph, but would just be a set, and the
STL already has concepts for dealing with such things. However, there
are many BGL algorithms that need to traverse the vertices and
out-edges of a graph, so for convenience a concept is needed that
groups these requirements together, hence the VertexListGraph concept.
<H3>Concept Checking Class</H3>
<P>
<PRE>
template &lt;class G&gt;
struct VertexListGraphConcept
{
typedef typename boost::graph_traits&lt;G&gt;::vertex_iterator
vertex_iterator;
void constraints() {
function_requires&lt; IncidenceGraphConcept&lt;G&gt; &gt;();
function_requires&lt; AdjacencyGraphConcept&lt;G&gt; &gt;();
function_requires&lt; MultiPassInputIteratorConcept&lt;vertex_iterator&gt; &gt;();
p = vertices(g);
V = num_vertices(g);
v = *p.first;
const_constraints(g);
}
void const_constraints(const G&amp; g) {
p = vertices(g);
V = num_vertices(g);
v = *p.first;
}
std::pair&lt;vertex_iterator, vertex_iterator&gt; p;
typename boost::graph_traits&lt;G&gt;::vertex_descriptor v;
typename boost::graph_traits&lt;G&gt;::vertices_size_type V;
G g;
};
</PRE>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-83
View File
@@ -1,83 +0,0 @@
<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 &copy; 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>
-76
View File
@@ -1,76 +0,0 @@
<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: Acknowledgements</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>Acknowledgements</h1>
We owe many debts of thanks to a number of individuals who both
inspired and encouraged us in developing the Boost Graph Library.
<p>
A most profound thanks goes to Alexander Stepanov for his pioneering
work in generic programming, for his encouragement, and for his
algorithm contributions to the BGL. We thank Matthew Austern for his
work on documenting the concepts of STL which provided a foundation
for creating the concepts in the BGL. We thank Dietmar K&uuml;hl for
his work on generic graph algorithms and design patterns; especially
for the property map abstraction.
<p>
Dave Abrahams, Jens Maurer, Beman Dawes, Gary Powell, Greg Colvin,
Valentin Bonnard, and the rest of the group at Boost provided valuable
input to the BGL interface, numerous suggestions for improvement,
proof reads of the documentation, and help with polishing the code. A
special thanks to Dave Abrahams for managing the formal review.
<p>
We also thank the following BGL users whose questions helped to
improve the BGL: Gordon Woodhull, Dave Longhorn, Joel Phillips, and
Edward Luke.
<p>
A special thanks to Jeffrey Squyres for editing and proof reading
of the documentation.
<p>
Our original work on the Boost Graph Library was supported in part by
NSF grant ACI-9982205 and by the Director, Office of Science, Division
of Mathematical, Information, and Computational Sciences of the U.S.
Department of Energy under contract number DE-AC03-76SF00098.
<p>
In our work we also used resources of the National Energy Research
Scientific Computing Center, which is supported by the Office of
Science of the U.S. Department of Energy.
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-136
View File
@@ -1,136 +0,0 @@
<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">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Adjacency Iterator Adaptor Documentation</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<img src="../../../boost.png" alt="boost.png (6897 bytes)"
align="center" width="277" height="86">
<h1>Adjacency Iterator Adaptor</h1>
Defined in header
<a href="../../../boost/graph/adjacency_iterator.hpp">boost/graph/adjacency_iterator.hpp</a>
<p>
The adjacency iterator adaptor transforms an
<tt>out_edge_iterator</tt> into an adjacency iterator. That is, it
takes an iterator that traverses over edges, and creates an iterator
that traverses over the <b><i>target</i></b> vertices of those edges.
With this adaptor it is trivial to take a graph type that models <a
href="IncidenceGraph.html">Incidence Graph</a> and add the
capabilities required of <a href="AdjacencyGraph.html">Adjacency
Graph</a>.
<h2>Synopsis</h2>
<pre>
namespace boost {
template &lt;class Graph, class VertexDescriptor, class OutEdgeIter&gt;
class adjacency_iterator_generator {
public:
typedef <a href="../../iterator/doc/iterator_adaptor.html">iterator_adaptor</a>&lt;...&gt; type;
};
}
</pre>
<hr>
<h3>Example</h3>
<p>
The following is an example of how to use the
<tt>adjacency_iterator_generator</tt> class.
<p>
<PRE>
#include &lt;boost/graph/adjacency_iterator.hpp&gt;
class my_graph {
// ...
typedef ... out_edge_iterator;
typedef ... vertex_descriptor;
typedef boost::adjacency_iterator_generator&lt;my_graph, vertex_descriptor, out_edge_iterator&gt;::type adjacency_iterator;
// ...
};
</PRE>
<h3>Template Parameters</h3>
<Table border>
<TR>
<TH>Parameter</TH><TH>Description</TH>
</TR>
<TR>
<TD><tt>Graph</tt></TD>
<TD>The graph type, which must model <a
href="./IncidenceGraph.html">Incidence Graph</a>.</TD>
</TR>
<TR>
<TD><tt>VertexDescriptor</tt></TD>
<TD>This must be the same type as
<tt>graph_traits&lt;Graph&gt;::vertex_descriptor</tt>. The reason why
this is a template parameter is that the primary use of
<tt>adjacency_iterator_generator</tt> is <b><i>inside</i></b> the
definition of the graph class, and in that context we can not use
<tt>graph_traits</tt> on the not yet fully defined graph class.<br>
<b>Default:</b> <tt>graph_traits&lt;Graph&gt;::vertex_descriptor</tt></TD>
</TR>
<TR>
<TD><tt>OutEdgeIter</tt></TD>
<TD>This must be the same type as
<tt>graph_traits&lt;Graph&gt;::out_edge_iterator</tt>.<br>
<b>Default:</b> <tt>graph_traits&lt;Graph&gt;::out_edge_iterator
</TD>
</TR>
</Table>
<h3>Model of</h3>
The adjacency iterator adaptor (the type
<tt>adjacency_iterator_generator<...>::type</tt>) is a model of <a
href="../../utility/MultiPassInputIterator.html">Multi-Pass Input Iterator</a>
</a>.
<h3>Members</h3>
The adjacency iterator type implements the member functions and
operators required of the <a
href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">Random Access Iterator</a>
concept, except that the <tt>reference</tt> type is the same as the <tt>value_type</tt>
so <tt>operator*()</tt> returns by-value. In addition it has the following constructor:
<pre>
adjacency_iterator_generator::type(const OutEdgeIter&amp; it, const Graph* g)
</pre>
<hr>
<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 &quot;as is&quot;
without express or implied warranty, and with no claim as to its suitability for
any purpose.</p>
</body>
</html>
File diff suppressed because it is too large Load Diff
-158
View File
@@ -1,158 +0,0 @@
<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: Graph Traits</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=""></A>
<pre>
adjacency_list_traits&lt;EdgeList, VertexList, Directed&gt;
</pre>
</H1>
This class provides an alternate method for accessing some of the
associated types of the <tt>adjacency_list</tt> class. The main reason
for this class is that sometimes one would like to create graph
properties whose values are vertex or edge descriptors. If you try to
use <tt>graph_traits</tt> for this you will run into a problem with
mutually recursive types. To get around this problem, the
<tt>adjacency_list_traits</tt> class is provided, which gives the user
access to the vertex and edge descriptor types without requiring the
user to provide the property types for the graph.
<pre>
template &lt;class EdgeList, class VertexList, class Directed&gt;
struct adjacency_list_traits {
typedef ... vertex_descriptor;
typedef ... edge_descriptor;
typedef ... directed_category;
typedef ... edge_parallel_category;
};
</pre>
<h3>Where Defined</h3>
<a href="../../../boost/graph/adjacency_list.hpp"><tt>boost/graph/adjacency_list.hpp</tt></a>
<H3>Template Parameters</H3>
<P>
<TABLE border>
<TR>
<th>Parameter</th><th>Description</th><th>Default</th>
</tr>
<TR><TD><TT>EdgeList</TT></TD>
<TD>
The selector type for the edge container implementation.
</TD>
<td><tt>vecS</tt></td>
</TR>
<TR><TD><TT>VertexList</TT></TD>
<TD>
The selector type for the vertex container implementation.
</TD>
<td><tt>vecS</tt></td>
</TR>
<TR><TD><TT>Directed</TT></TD>
<TD>
The selector type whether the graph is directed or undirected.
</TD>
<td><tt>directedS</tt></td>
</TR>
</table>
<h3>Model of</h3>
<a
href="http://www.sgi.com/tech/stl/DefaultConstructible.html">DefaultConstructible</a> and
<a href="http://www.sgi.com/tech/stl/Assignable.html">Assignable</a>
<h3>Type Requirements</h3>
Under construction.
<H2>Members</H2>
<p>
<table border>
<tr>
<th>Member</th><th>Description</th>
</tr>
<tr>
<td><tt>
vertex_descriptor
</tt></td>
<td>
The type for the objects used to identify vertices in the graph.
</td>
</tr>
<tr>
<td><tt>
edge_descriptor
</tt></td>
<td>
The type for the objects used to identify edges in the graph.
</td>
</tr>
<tr>
<td><tt>
directed_category
</tt></td>
<td>
This says whether the graph is undirected (<tt>undirected_tag</tt>)
or directed (<tt>directed_tag</tt>).
</td>
</tr>
<tr>
<td><tt>
edge_parallel_category
</tt></td>
<td>
This says whether the graph allows parallel edges to be inserted
(<tt>allow_parallel_edge_tag</tt>) or if it automatically removes
parallel edges (<tt>disallow_parallel_edge_tag</tt>).
</td>
</tr>
</table>
<h3>See Also</h3>
<a href="./adjacency_list.html"><tt>adjacency_list</tt></a>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-584
View File
@@ -1,584 +0,0 @@
<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: Adjacency Matrix</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:adjacency-matrix-class"></A>
<pre>
adjacency_matrix&lt;Directed, VertexProperty,
EdgeProperty, GraphProperty,
Allocator&gt;
</pre>
</H1>
The <tt>adjacency_matrix</tt> class implements the BGL graph interface
using the traditional adjacency matrix storage format. For a graph
with <i>V</i> vertices, a <i>V x V</i> matrix is used, where each
element <i>a<sub>ij</sub></i> is a boolean flag that says whether
there is an edge from vertex <i>i</i> to vertex <i>j</i>. <a
href="#fig:adj-matrix-graph">Figure 1</a> shows the adjacency matrix
representation of a graph.
<P></P>
<DIV ALIGN="center"><A NAME="fig:adj-matrix-graph"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 1:</STRONG> Adjacency Matrix Representation of a Directed Graph.</CAPTION>
<TR><TD><IMG SRC="./figs/adj-matrix-graph3.gif" width="386" height="284"></TD>
<TD><IMG SRC="./figs/adj-matrix.gif" width="135" height="136"></TD></TR>
</TABLE>
</DIV><P></P>
The advantage of this matrix format over the adjacency list is that
edge insertion and removal is constant time. There are several
disadvantages. The first is that the amount of memory used is
<i>O(V<sup>2</sup>)</i> instead of <i>O(V + E)</i> (where <i>E</i> is
the number of edges). The second is that operations that traverse all
the out-edges of each vertex (such as breadth-first search) run in
<i>O(V<sup>2</sup>)</i> time instead of <i>O(V + E)</i> time for the
adjacency list. In short, it is better to use the
<tt>adjacency_matrix</tt> for dense graphs (where <i>E</i> is close to
<i>V<sup>2</sup></i>) and it is better to use <a
href="adjacency_list.html"><tt>adjacency_list</tt></a> for sparse
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 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>
matrix but instead uses a lower triangle (the diagonal and below)
since the matrix for an undirected graph is symmetric. This reduces
the storage to <i>(V<sup>2</sup>)/2</i>. <a
href="#fig:undir-adj-matrix-graph">Figure 2</a> shows an adjacency
matrix representation of an undirected graph.
<P></P>
<DIV ALIGN="center"><A NAME="fig:undir-adj-matrix-graph"></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-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>
<h3>Example</h3>
Creating the graph of <a href="#fig:adj-matrix-graph">Figure 1</a>.
<pre>
enum { A, B, C, D, E, F, N };
const char* name = "ABCDEF";
typedef boost::adjacency_matrix&lt;boost::directedS> Graph;
Graph g(N);
add_edge(B, C, g);
add_edge(B, F, g);
add_edge(C, A, g);
add_edge(C, C, g);
add_edge(D, E, g);
add_edge(E, D, g);
add_edge(F, A, g);
std::cout &lt;&lt; "vertex set: ";
boost::print_vertices(g, name);
std::cout &lt;&lt; std::endl;
std::cout &lt;&lt; "edge set: ";
boost::print_edges(g, name);
std::cout &lt;&lt; std::endl;
std::cout &lt;&lt; "out-edges: " &lt;&lt; std::endl;
boost::print_graph(g, name);
std::cout &lt;&lt; std::endl;
</pre>
The output is:
<pre>
vertex set: A B C D E F
edge set: (B,C) (B,F) (C,A) (C,C) (D,E) (E,D) (F,A)
out-edges:
A -->
B --> C F
C --> A C
D --> E
E --> D
F --> A
</pre>
Creating the graph of <a href="#fig:undir-adj-matrix-graph">Figure 2</a>.
<pre>
enum { A, B, C, D, E, F, N };
const char* name = "ABCDEF";
typedef boost::adjacency_matrix&lt;boost::undirectedS> UGraph;
UGraph ug(N);
add_edge(B, C, ug);
add_edge(B, F, ug);
add_edge(C, A, ug);
add_edge(D, E, ug);
add_edge(F, A, ug);
std::cout &lt;&lt; "vertex set: ";
boost::print_vertices(ug, name);
std::cout &lt;&lt; std::endl;
std::cout &lt;&lt; "edge set: ";
boost::print_edges(ug, name);
std::cout &lt;&lt; std::endl;
std::cout &lt;&lt; "incident edges: " &lt;&lt; std::endl;
boost::print_graph(ug, name);
std::cout &lt;&lt; std::endl;
</pre>
The output is:
<pre>
vertex set: A B C D E F
edge set: (C,A) (C,B) (E,D) (F,A) (F,B)
incident edges:
A &lt;--> C F
B &lt;--> C F
C &lt;--> A B
D &lt;--> E
E &lt;--> D
F &lt;--> A B
</pre>
<h3>Where Defined</h3>
<a href="../../../boost/graph/adjacency_matrix.hpp"><tt>boost/graph/adjacency_matrix.hpp</tt></a>
<h3>Template Parameters</h3>
<p>
<table border>
<TR>
<th>Parameter</th><th>Description</th><th>Default</th>
</tr>
<tr>
<td><tt>Directed</tt></td>
<td>A selector to choose whether the graph is directed or undirected. The options are <tt>directedS</tt> and <tt>undirectedS</tt>.</td>
<td><tt>directedS</tt></td>
</tr>
<tr>
<td><tt>VertexProperty</tt></td>
<td>for specifying internal property storage.</td>
<td><tt>no_property</tt></td>
</tr>
<tr>
<td><tt>EdgeProperty</tt></td>
<td>for specifying internal property storage.</td>
<td><tt>no_property</tt></td>
</tr>
<tr>
<td><tt>GraphProperty</tt></td>
<td>for specifying property storage for the graph object.</td>
<td><tt>no_property</tt></td>
</tr>
</table>
<h3>Model Of</h3>
<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>Associated Types</h3>
<hr>
<tt>graph_traits&lt;adjacency_matrix&gt;::vertex_descriptor</tt>
<br><br>
The type for the vertex descriptors associated with the
<tt>adjacency_matrix</tt>.<br>
(Required by <a href="./Graph.html">Graph</a>.)
<hr>
<tt>graph_traits&lt;adjacency_matrix&gt;::edge_descriptor</tt>
<br><br>
The type for the edge descriptors associated with the
<tt>adjacency_matrix</tt>.<br>
(Required by <a href="Graph.html">Graph</a>.)
<hr>
<tt>graph_traits&lt;adjacency_matrix&gt;::vertex_iterator</tt>
<br><br>
The type for the iterators returned by <tt>vertices()</tt>.
The vertex iterator models <a href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>. <br>
(Required by <a href="VertexListGraph.html">VertexListGraph</a>.)
<hr>
<tt>graph_traits&lt;adjacency_matrix&gt;::edge_iterator</tt>
<br><br>
The type for the iterators returned by <tt>edges()</tt>. This
iterator models <a href="../../utility/MultiPassInputIterator.html">MultiPassInputIterator</a>.<br>
(Required by <a href="EdgeListGraph.html">EdgeListGraph</a>.)
<hr>
<tt>graph_traits&lt;adjacency_matrix&gt;::out_edge_iterator</tt>
<br><br>
The type for the iterators returned by <tt>out_edges()</tt>. This
iterator models <a href="../../utility/MultiPassInputIterator.html">MultiPassInputIterator</a>. <br>
(Required by <a href="IncidenceGraph.html">IncidenceGraph</a>.)
<hr>
<tt>graph_traits&lt;adjacency_matrix&gt;::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&lt;adjacency_matrix&gt;::adjacency_iterator</tt>
<br><br>
The type for the iterators returned by <tt>adjacent_vertices()</tt>. This
iterator models the same concept as the out-edge iterator.<br>
(Required by <a href="AdjacencyGraph.html">AdjacencyGraph</a>.)
<hr>
<tt>graph_traits&lt;adjacency_matrix&gt;::directed_category</tt>
<br><br>
Provides information about whether the graph is directed
(<tt>directed_tag</tt>) or undirected (<tt>undirected_tag</tt>).<br>
(Required by <a href="Graph.html">Graph</a>.)
<hr>
<tt>graph_traits&lt;adjacency_matrix&gt;::edge_parallel_category</tt>
<br><br>
An adjacency matrix does not allow the insertion of
parallel edges, so this type is always
<tt>disallow_parallel_edge_tag</tt>. <br>
(Required by <a href="Graph.html">Graph</a>.)
<hr>
<tt>graph_traits&lt;adjacency_matrix&gt;::vertices_size_type</tt>
<br><br>
The type used for dealing with the number of vertices in
the graph.<br>
(Required by <a href="VertexListGraph.html">VertexListGraph</a>.)
<hr>
<tt>graph_traits&lt;adjacency_matrix&gt;::edges_size_type</tt>
<br><br>
The type used for dealing with the number of edges in the graph.<br>
(Required by <a href="EdgeListGraph.html">EdgeListGraph</a>.)
<hr>
<tt>graph_traits&lt;adjacency_matrix&gt;::degree_size_type</tt>
<br><br>
The type used for dealing with the number of out-edges of a vertex.<br>
(Required by <a href="IncidenceGraph.html">IncidenceGraph</a>.)
<hr>
<tt>property_map&lt;adjacency_matrix, PropertyTag&gt;::type</tt><br>
<tt>property_map&lt;adjacency_matrix, PropertyTag&gt;::const_type</tt>
<br><br>
The map type for vertex or edge properties in the graph. The
specific property is specified by the <tt>PropertyTag</tt> template
argument, and must match one of the properties specified in the
<tt>VertexProperty</tt> or <tt>EdgeProperty</tt> for the graph.<br>
(Required by <a href="PropertyGraph.html">PropertyGraph</a>.)
<hr>
<h3>Member Functions</h3>
<hr>
<pre>
adjacency_matrix(vertices_size_type n,
const GraphProperty& p = GraphProperty())
</pre>
Creates a graph object with <tt>n</tt> vertices and zero edges.<br>
(Required by <a href="MutableGraph.html">MutableGraph</a>.)
<hr>
<pre>
template &lt;typename EdgeIterator&gt;
adjacency_matrix(EdgeIterator first,
EdgeIterator last,
vertices_size_type n,
const GraphProperty& p = GraphProperty())
</pre>
Creates a graph object with <tt>n</tt> vertices with the edges
specified in the edge list given by the range <tt>[first, last)</tt>.
The value type of the <tt>EdgeIterator</tt> must be a
<tt>std::pair</tt>, where the type in the pair is an integer type. The
integers will correspond to vertices, and they must all fall in the
range of
<tt>[0, n)</tt>. <br>
(Required by <a href="IteratorConstructibleGraph.html">IteratorConstructibleGraph</a>.)
<hr>
<pre>
template &lt;typename EdgeIterator, typename EdgePropertyIterator&gt;
adjacency_matrix(EdgeIterator first, EdgeIterator last,
EdgePropertyIterator ep_iter,
vertices_size_type n,
const GraphProperty& p = GraphProperty())
</pre>
Creates a graph object with <tt>n</tt> vertices, with the edges
specified in the edge list given by the range <tt>[first, last)</tt>.
The value type of the <tt>EdgeIterator</tt> must be a
<tt>std::pair</tt>, where the type in the pair is an integer type. The
integers will correspond to vertices, and they must all fall in the
range of <tt>[0, n)</tt>. The <tt>value_type</tt> of the
<tt>ep_iter</tt> should be <tt>EdgeProperty</tt>.
<hr>
<h3>Non-Member Functions</h3>
<hr>
<pre>
std::pair&lt;vertex_iterator, vertex_iterator&gt;
vertices(const adjacency_matrix&amp; g)
</pre>
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&lt;edge_iterator, edge_iterator&gt;
edges(const adjacency_matrix&amp; g);
</pre>
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>
<pre>
std::pair&lt;adjacency_iterator, adjacency_iterator&gt;
adjacent_vertices(vertex_descriptor v, const adjacency_matrix&amp; g)
</pre>
Returns an iterator-range providing access to the vertices adjacent to
vertex <tt>v</tt> in graph <tt>g</tt>.<br>
(Required by <a href="AdjacencyGraph.html">AdjacencyGraph</a>.)
<hr>
<pre>
std::pair&lt;out_edge_iterator, out_edge_iterator&gt;
out_edges(vertex_descriptor v, const adjacency_matrix&amp; g)
</pre>
Returns an iterator-range providing access to the out-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="IncidenceGraph.html">IncidenceGraph</a>.)
<hr>
<pre>
vertex_descriptor
source(edge_descriptor e, const adjacency_matrix&amp; g)
</pre>
Returns the source vertex of edge <tt>e</tt>.<br>
(Required by <a href="IncidenceGraph.html">IncidenceGraph</a>.)
<hr>
<pre>
vertex_descriptor
target(edge_descriptor e, const adjacency_matrix&amp; g)
</pre>
Returns the target vertex of edge <tt>e</tt>.<br>
(Required by <a href="IncidenceGraph.html">IncidenceGraph</a>.)
<hr>
<pre>
degree_size_type
out_degree(vertex_descriptor u, const adjacency_matrix&amp; g)
</pre>
Returns the number of edges leaving vertex <tt>u</tt>.<br>
(Required by <a href="IncidenceGraph.html">IncidenceGraph</a>.)
<hr>
<hr>
<pre>
std::pair&lt;in_edge_iterator, in_edge_iterator&gt;
in_edges(vertex_descriptor v, const adjacency_matrix&amp; 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&amp; 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&amp; g)
</pre>
Returns the number of vertices in the graph <tt>g</tt>.<br>
(Required by <a href="VertexListGraph.html">VertexListGraph</a>.)
<hr>
<pre>
edges_size_type num_edges(const adjacency_matrix&amp; g)
</pre>
Returns the number of edges in the graph <tt>g</tt>.<br>
(Required by <a href="EdgeListGraph.html">EdgeListGraph</a>.)
<hr>
<pre>
vertex_descriptor vertex(vertices_size_type n, const adjacency_matrix&amp; g)
</pre>
Returns the nth vertex in the graph's vertex list.
<hr>
<pre>
std::pair&lt;edge_descriptor, bool&gt;
edge(vertex_descriptor u, vertex_descriptor v,
const adjacency_matrix&amp; g)
</pre>
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>
<pre>
std::pair&lt;edge_descriptor, bool&gt;
add_edge(vertex_descriptor u, vertex_descriptor v,
adjacency_matrix&amp; g)
</pre>
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
or descriptors.<br>
(Required by <a href="MutableGraph.html">MutableGraph</a>.)
<hr>
<pre>
std::pair&lt;edge_descriptor, bool&gt;
add_edge(vertex_descriptor u, vertex_descriptor v,
const EdgeProperty& p,
adjacency_matrix&amp; g)
</pre>
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.
<hr>
<pre>
void remove_edge(vertex_descriptor u, vertex_descriptor v,
adjacency_matrix&amp; g)
</pre>
Removes the edge <tt>(u,v)</tt> from the graph. <br>
(Required by <a href="MutableGraph.html">MutableGraph</a>.)
<hr>
<pre>
void remove_edge(edge_descriptor e, adjacency_matrix&amp; g)
</pre>
Removes the edge <tt>e</tt> from the graph. This is equivalent
to calling <tt>remove_edge(source(e, g), target(e, g), g)</tt>.<br>
(Required by <a href="MutableGraph.html">MutableGraph</a>.)
<hr>
<pre>
void clear_vertex(vertex_descriptor u, adjacency_matrix&amp; g)
</pre>
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>.)
<hr>
<pre>
template &lt;typename Property&gt;
property_map&lt;adjacency_matrix, Property&gt;::type
get(Property, adjacency_matrix&amp; g)
template &lt;typename Property&gt;
property_map&lt;adjacency_matrix, Property&gt;::const_type
get(Property, const adjacency_matrix&amp; g)
</pre>
Returns the property map object for the vertex property specified by
<tt>Property</tt>. The <tt>Property</tt> must match one of the
properties specified in the graph's <tt>VertexProperty</tt> template
argument.<br>
(Required by <a href="PropertyGraph.html">PropertyGraph</a>.)
<hr>
<pre>
template &lt;typename Property, typename X&gt;
typename property_traits&lt;
typename property_map&lt;adjacency_matrix, Property&gt;::const_type
&gt;::value_type
get(Property, const adjacency_matrix&amp; g, X x)
</pre>
This returns the property value for <tt>x</tt>, which is either
a vertex or edge descriptor.<br>
(Required by <a href="PropertyGraph.html">PropertyGraph</a>.)
<hr>
<pre>
template &lt;typename Property, typename X, typename Value&gt;
void
put(Property, const adjacency_matrix&amp; g, X x, const Value& value)
</pre>
This sets the property value for <tt>x</tt> to
<tt>value</tt>. <tt>x</tt> is either a vertex or edge descriptor.
<tt>Value</tt> must be convertible to
<tt>typename property_traits&lt;property_map&lt;adjacency_matrix, Property&gt;::type&gt;::value_type</tt>.<br>
(Required by <a href="PropertyGraph.html">PropertyGraph</a>.)
<hr>
<pre>
template &lt;typename GraphProperty, typename GraphProperty&gt;
typename property_value&lt;GraphProperty, GraphProperty&gt;::type&amp;
get_property(adjacency_matrix&amp; g, GraphProperty)
</pre>
Return the property specified by <tt>GraphProperty</tt> that is attached
to the graph object <tt>g</tt>. The <tt>property_value</tt> traits class
is defined in <tt>boost/pending/property.hpp</tt>.
<hr>
<pre>
template &lt;typename GraphProperty, typename GraphProperty&gt;
const typename property_value&lt;GraphProperty, GraphProperty&gt;::type&amp;
get_property(const adjacency_matrix&amp; g, GraphProperty)
</pre>
Return the property specified by <tt>GraphProperty</tt> that is
attached to the graph object <tt>g</tt>. The <tt>property_value</tt>
traits class is defined in <tt>boost/pending/property.hpp</tt>.
<hr>
+10
View File
@@ -0,0 +1,10 @@
name: graph
version: ~
title: Boost.Graph
start_page: index.adoc
asciidoc:
attributes:
source-language: cpp@
table-caption: false
nav:
- modules/ROOT/nav.adoc
-96
View File
@@ -1,96 +0,0 @@
<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&lt;Graph, CostType&gt;
</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&lt;Graph&gt;::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 &copy; 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>
-524
View File
@@ -1,524 +0,0 @@
<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 interfaces</i>
template &lt;typename VertexListGraph,
typename AStarHeuristic,
typename P, typename T, typename R&gt;
void
astar_search
(const VertexListGraph &amp;g,
typename graph_traits&lt;VertexListGraph&gt;::vertex_descriptor s,
<a href="AStarHeuristic.html">AStarHeuristic</a> h, const bgl_named_params&lt;P, T, R&gt;&amp; params);
template &lt;typename VertexListGraph,
typename AStarHeuristic,
typename P, typename T, typename R&gt;
void
astar_search_no_init
(const VertexListGraph &amp;g,
typename graph_traits&lt;VertexListGraph&gt;::vertex_descriptor s,
<a href="AStarHeuristic.html">AStarHeuristic</a> h, const bgl_named_params&lt;P, T, R&gt;&amp; params);
<i>// Non-named parameter interface</i>
template &lt;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&gt;
inline void
astar_search
(const VertexListGraph &amp;g,
typename graph_traits&lt;VertexListGraph&gt;::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 &lt;typename IncidenceGraph, 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&gt;
inline void
astar_search_no_init
(const IncidenceGraph &amp;g,
typename graph_traits&lt;IncidenceGraph&gt;::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);
<b>Note that the index_map and color parameters are swapped in
astar_search_no_init() relative to astar_search(); the named parameter
interfaces are not affected.</b>
</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 game-playing 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
the <a href="VertexListGraph.html">Vertex List Graph</a> concept. Both
versions
also require the graph type to model the <a
href="IncidenceGraph.html">Incidence Graph</a> concept.
</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 != &Oslash;</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] &lt; 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>const VertexListGraph&amp; g</tt>
<blockquote>
The graph object on which the algorithm will be applied for <tt>astar_search()</tt>. The type
<tt>VertexListGraph</tt> must be a model of the <a
href="VertexListGraph.html">
Vertex List Graph</a> and <a href="IncidenceGraph.html">Incidence Graph</a>
concepts.
</blockquote>
IN: <tt>const IncidenceGraph&amp; g</tt>
<blockquote>
The graph object on which the algorithm will be applied for <tt>astar_search_no_init()</tt>. The type
<tt>IncidenceGraph</tt> must be a model of the
<a href="IncidenceGraph.html">Incidence 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>adjacency_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>shared_array_property_map</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>shared_array_property_map</tt>
with the same value type as the
<tt>DistanceMap</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>shared_array_property_map</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&lt;D&gt;</tt> with <tt>D = typename
property_traits&lt;DistanceMap&gt;::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&lt;D&gt;</tt> with <tt>D = typename
property_traits&lt;DistanceMap&gt;::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&lt;D&gt;::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&lt;DistanceMap&gt;::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&lt;null_visitor&gt;</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) &lt; 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 &copy; 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>
-108
View File
@@ -1,108 +0,0 @@
<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&lt;EventVisitorList&gt;
</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 &lt;class EventVisitorList&gt;<br>
astar_visitor&lt;EventVisitorList&gt;<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 &copy; 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>
-6
View File
@@ -1,6 +0,0 @@
\DeclareOption{awpaper}
{\setlength\paperheight {9.25in}%
\setlength\paperwidth {7.375in}}
\DeclareOption*{\PassOptonsToPackage{\CurrentOption}{newsiambook}}
\ProcessOptions
\ExecuteOptions{awpaper}
-93
View File
@@ -1,93 +0,0 @@
<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: Bandwidth</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:bandwidth">
<TT>bandwidth</TT>
</H1>
<pre>
(1)
template &lt;typename Graph&gt;
typename graph_traits&lt;Graph&gt;::vertices_size_type
bandwidth(const Graph& g)
(2)
template &lt;typename Graph, typename VertexIndexMap&gt;
typename graph_traits&lt;Graph&gt;::vertices_size_type
bandwidth(const Graph& g, VertexIndexMap index_map)
</pre>
The <b><i>bandwidth</i></b> of an undirected graph is the maximum
distance between two adjacent vertices, with distance measured on a
line upon which the vertices have been placed at unit intervals. To
put it another way, if the vertices of an undirected graph
<i>G=(V,E)</i> are each assigned an index from zero to <i>|V| - 1</i>
given by <i>index[v]</i>, then the bandwidth of <i>G</i> is<br>
<br>
<i>B(G) = max { |index[u] - index[v]|&nbsp;&nbsp;| (u,v) in E }</i><br>
<h3>Defined in</h3>
<a href="../../../boost/graph/bandwidth.hpp"><tt>boost/graph/bandwidth.hpp</tt></a>
<hr>
<H1><A NAME="sec:ith-bandwidth">
<TT>ith_bandwidth</TT>
</H1>
<pre>
(1)
template &lt;typename Graph&gt;
typename graph_traits&lt;Graph&gt;::vertices_size_type
ith_bandwidth(typename graph_traits&lt;Graph&gt;::vertex_descriptor i,
const Graph&amp; g)
(2)
template &lt;typename Graph, typename VertexIndexMap&gt;
typename graph_traits&lt;Graph&gt;::vertices_size_type
ith_bandwidth(typename graph_traits&lt;Graph&gt;::vertex_descriptor i,
const Graph&amp; g,
VertexIndexMap index)
</pre>
The <b><i>i-th bandwidth</i></b> a graph is the maximum distance
between the <i>i-th</i> vertex and any of its neighbors.<br>
<br>
<i>B<sub>i</sub>(G) = max { |index[i] - index[j]|&nbsp;&nbsp;| (i,j) in E }</i><br>
<br>
So the bandwidth <i>B(G)</i> can be expressed as the maximum
of the i-th bandwidths <i>B<sub>i</sub>(G)</i>.<br>
<br>
<i>B(G) = max { B<sub>i</sub>(G) &nbsp;&nbsp;| i=0...|V|-1 }</i><br>
<h3>Defined in</h3>
<a href="../../../boost/graph/bandwidth.hpp"><tt>boost/graph/bandwidth.hpp</tt></a>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-151
View File
@@ -1,151 +0,0 @@
<!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 &mdash; 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>&lt;<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&gt;
<span class="type"><span class=
"bold"><b>void</b></span></span> betweenness_centrality_clustering(MutableGraph &amp; g, Done done,
EdgeCentralityMap edge_centrality,
VertexIndexMap vertex_index);
<span class="bold"><b>template</b></span>&lt;<span class=
"bold"><b>typename</b></span> MutableGraph, <span class=
"bold"><b>typename</b></span> Done, <span class=
"bold"><b>typename</b></span> EdgeCentralityMap&gt;
<span class="type"><span class=
"bold"><b>void</b></span></span> betweenness_centrality_clustering(MutableGraph &amp; g, Done done,
EdgeCentralityMap edge_centrality);
<span class="bold"><b>template</b></span>&lt;<span class=
"bold"><b>typename</b></span> MutableGraph, <span class=
"bold"><b>typename</b></span> Done&gt;
<span class="type"><span class=
"bold"><b>void</b></span></span> betweenness_centrality_clustering(MutableGraph &amp; 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 computes 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&amp; 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>
&lt;<a href=
"../../../boost/graph/bc_clustering.hpp">boost/graph/bc_clustering.hpp</a>&gt;
<hr>
<table>
<tr valign="top">
<td nowrap>Copyright &copy; 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>
-349
View File
@@ -1,349 +0,0 @@
<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>Bellman Ford 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: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 &lt;class <a href="./EdgeListGraph.html">EdgeListGraph</a>, class Size, class P, class T, class R&gt;
bool bellman_ford_shortest_paths(const EdgeListGraph&amp; g, Size N,
const bgl_named_params&lt;P, T, R&gt;&amp; params = <i>all defaults</i>);
template &lt;class <a href="./VertexAndEdgeListGraph.html">VertexAndEdgeListGraph</a>, class P, class T, class R&gt;
bool bellman_ford_shortest_paths(const VertexAndEdgeListGraph&amp; g,
const bgl_named_params&lt;P, T, R&gt;&amp; params = <i>all defaults</i>);
<i>// non-named parameter version</i>
template &lt;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>&gt;
bool bellman_ford_shortest_paths(EdgeListGraph&amp; g, Size N,
WeightMap weight, PredecessorMap pred, DistanceMap distance,
BinaryFunction combine, BinaryPredicate compare, BellmanFordVisitor v)
</PRE>
<P>
The Bellman-Ford algorithm&nbsp;[<A
HREF="bibliography.html#bellman58">4</A>,<A
HREF="bibliography.html#ford62:_flows">11</A>,<A
HREF="bibliography.html#lawler76:_comb_opt">20</A>,<A
HREF="bibliography.html#clr90">8</A>] solves the single-source
shortest paths problem for a graph with both positive and negative
edge weights. For the definition of the shortest paths problem see
Section <A
HREF="./graph_theory_review.html#sec:shortest-paths-algorithms">Shortest-Paths
Algorithms</A>.
If you only need to solve the shortest paths problem for positive edge
weights, Dijkstra's algorithm provides a more efficient
alternative. If all the edge weights are all equal to one then breadth-first
search provides an even more efficient alternative.
</p>
<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 <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
their weight, and <i>d</i> is a distance map that records the length
of the shortest path to each vertex seen so far. <i>p</i> is a
predecessor map which records the parent of each vertex, which will
ultimately be the parent in the shortest paths tree
</p>
<table>
<tr>
<td valign="top">
<pre>
RELAX(<i>u</i>, <i>v</i>, <i>w</i>, <i>d</i>, <i>p</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>
<b>else</b>
...
</pre>
</td>
<td valign="top">
<pre>
relax edge <i>(u,v)</i>
edge <i>(u,v)</i> is not relaxed
</pre>
</td>
</tr>
</table>
<p>
The algorithm repeats this loop <i>|V|</i> times after which it is
guaranteed that the distances to each vertex have been reduced to the
minimum possible unless there is a negative cycle in the graph. If
there is a negative cycle, then there will be edges in the graph that
were not properly minimized. That is, there will be edges <i>(u,v)</i> such
that <i>w(u,v) + d[u] < d[v]</i>. The algorithm loops over the edges in
the graph one final time to check if all the edges were minimized,
returning <tt>true</tt> if they were and returning <tt>false</tt>
otherwise.
</p>
<table>
<tr>
<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>
<b>end for</b>
<b>for</b> <i>i := 1</i> <b>to</b> <i>|V|-1</i>
<b>for</b> each edge <i>(u,v) in E</i>
RELAX(<i>u</i>, <i>v</i>, <i>w</i>, <i>d</i>, <i>p</i>)
<b>end for</b>
<b>end for</b>
<b>for</b> each edge <i>(u,v) in E</i>
<b>if</b> (<i>w(u,v) + d[u] < d[v]</i>)
<b>return</b> (false, , )
<b>else</b>
...
<b>end for</b>
<b>return</b> (true, <i>p</i>, <i>d</i>)
</pre>
</td>
<td valign="top">
<pre>
examine edge <i>(u,v)</i>
edge <i>(u,v)</i> was not minimized
edge <i>(u,v)</i> was minimized
</pre>
</td>
</tr>
</table>
There are two main options for obtaining output from the
<tt>bellman_ford_shortest_paths()</tt> function. If the user provides
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 (provided the
function returns <tt>true</tt>). The second option is recording the
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 her own
custom-made visitor that can take actions at any of the
algorithm's event points.
<P>
<h3>Parameters</h3>
IN: <tt>EdgeListGraph&amp; g</tt>
<blockquote>
A directed or undirected graph whose type must be a model of
<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.<br>
<b>Default:</b> <tt>num_vertices(g)</tt>.<br>
<b>Python</b>: Unsupported parameter.
</blockquote>
<h3>Named Parameters</h3>
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/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><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>
<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>
IN/OUT: <tt>distance_map(DistanceMap d)</tt>
<blockquote>
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/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><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>.
The visitor object is passed by value <a
href="#1">[1]</a>.
<br>
<b>Default:</b> <tt>bellman_visitor&lt;null_visitor&gt;</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>
<blockquote>
This function object replaces the role of addition in the relaxation
step. The first argument type must match the distance map's value
type and the second argument type must match the weight map's value
type. The result type must be the same as the distance map's value
type.<br>
<b>Default:</b><tt>std::plus&lt;D&gt;</tt>
with <tt>D=typename&nbsp;property_traits&lt;DistanceMap&gt;::value_type</tt>.<br>
<b>Python</b>: Unsupported parameter.
</blockquote>
IN: <tt>distance_compare(BinaryPredicate compare)</tt>
<blockquote>
This function object replaces the role of the less-than operator
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&lt;D&gt;</tt>
with <tt>D=typename&nbsp;property_traits&lt;DistanceMap&gt;::value_type</tt>.<br>
<b>Python</b>: Unsupported parameter.
</blockquote>
<P>
<H3>Complexity</H3>
<P>
The time complexity is <i>O(V E)</i>.
<h3>Visitor Event Points</h3>
<ul>
<li><b><tt>vis.examine_edge(e, g)</tt></b> is invoked on every edge in
the graph <i>|V|</i> times.
<li><b><tt>vis.edge_relaxed(e, g)</tt></b> is invoked when the distance
label for the target vertex is decreased. 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.edge_not_relaxed(e, g)</tt></b> is invoked if the distance label
for the target vertex is not decreased.
<li><b><tt>vis.edge_minimized(e, g)</tt></b> is invoked during the
second stage of the algorithm, during the test of whether each edge
was minimized. If the edge is minimized then this function
is invoked.
<li><b><tt>vis.edge_not_minimized(e, g)</tt></b> is also invoked during the
second stage of the algorithm, during the test of whether each edge
was minimized. If the edge was not minimized, this function is
invoked. This happens when there is a negative cycle in the graph.
</ul>
<H3>Example</H3>
<P>
An example of using the Bellman-Ford algorithm is in <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 &copy; 2000</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>
-111
View File
@@ -1,111 +0,0 @@
<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: bellman_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>
bellman_visitor&lt;EventVisitorList&gt;
</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="./BellmanFordVisitor.html">BellmanFordVisitor</a>.
<h3>Example</h3>
<h3>Model of</h3>
<a href="./BellmanFordVisitor.html">BellmanFordVisitor</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/bellman_ford_shortest_paths.hpp">
<TT>boost/graph/bellman_ford_shortest_paths.hpp</TT></a>
<h3>Member Functions</h3>
This class implements all of the member functions required by <a
href="./BellmanFordVisitor.html">BellmanFordVisitor</a>. In each function the
appropriate event is dispatched to the <a
href="./EventVisitor.html">EventVisitor</a> in the EventVisitorList.
<h3>Non-Member Functions</h3>
<table border>
<tr>
<th>Function</th><th>Description</th>
</tr>
<tr><td><tt>
template &lt;class EventVisitorList&gt;<br>
bellman_visitor&lt;EventVisitorList&gt;<br>
make_bellman_visitor(EventVisitorList ev_list);
</tt></td><td>
Returns the event visitor list adapted to be a BellmanFordVisitor.
</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 &copy; 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>
-307
View File
@@ -1,307 +0,0 @@
<!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&lt;typename Graph, typename Param, typename Tag, typename Rest&gt;
void
brandes_betweenness_centrality(const Graph&amp; g,
const bgl_named_params&lt;Param,Tag,Rest&gt;&amp; params);
template&lt;typename Graph, typename CentralityMap&gt;
void
brandes_betweenness_centrality(const Graph&amp; g, CentralityMap centrality_map);
template&lt;typename Graph, typename CentralityMap, typename EdgeCentralityMap&gt;
void
brandes_betweenness_centrality(const Graph&amp; g, CentralityMap centrality_map,
EdgeCentralityMap edge_centrality);
<em>// non-named parameter versions</em>
template&lt;typename Graph, typename CentralityMap, typename EdgeCentralityMap,
typename IncomingMap, typename DistanceMap, typename DependencyMap,
typename PathCountMap, typename VertexIndexMap&gt;
void
brandes_betweenness_centrality(const Graph&amp; g, CentralityMap centrality_map,
EdgeCentralityMap edge_centrality,
IncomingMap incoming,
DistanceMap distance, DependencyMap dependency,
PathCountMap path_count,
VertexIndexMap vertex_index);
template&lt;typename Graph, typename CentralityMap, typename EdgeCentralityMap,
typename IncomingMap, typename DistanceMap, typename DependencyMap,
typename PathCountMap, typename VertexIndexMap, typename WeightMap&gt;
void
brandes_betweenness_centrality(const Graph&amp; 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&lt;typename Graph, typename CentralityMap&gt;
void
relative_betweenness_centrality(const Graph&amp; g, CentralityMap centrality_map);
template&lt;typename Graph, typename CentralityMap&gt;
typename property_traits&lt;CentralityMap&gt;::value_type
central_point_dominance(const Graph&amp; g, CentralityMap centrality_map);
</pre>
<p>This algorithm&nbsp;[<a href="bibliography.html#brandes01">54</a>]
computes the <em>betweenness centrality</em>&nbsp;[<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>&nbsp;[<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&amp; 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&lt;Edge&gt;</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 &copy; 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>
-128
View File
@@ -1,128 +0,0 @@
<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: bfs_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>
bfs_visitor&lt;EventVisitorList&gt;
</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="./BFSVisitor.html">BFSVisitor</a>.
<h3>Example</h3>
This is an excerpt from <a
href="../example/bfs.cpp"><tt>examples/bfs.cpp</tt></a> where three
event-visitors are combined to make a BFS visitor. The functions
<tt>boost::record_distances</tt>, <tt>boost::record_predecessors</tt>,
and <tt>copy_graph</tt> are all functions that create an event
visitor.
<pre>
// Construct graph G and obtain the source vertex s ...
boost::breadth_first_search(G, s,
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()),
copy_graph(G_copy, boost::on_examine_edge())))) );
</pre>
<h3>Model of</h3>
<a href="./BFSVisitor.html">BFSVisitor</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><a href="./null_visitor.html"><tt>null_visitor</tt></a></TD>
</TR>
</table>
<H3>Where Defined</H3>
<P>
<a href="../../../boost/graph/breadth_first_search.hpp">
<TT>boost/graph/breadth_first_search.hpp</TT></a>
<h3>Member Functions</h3>
This class implements all of the member functions required by <a
href="./BFSVisitor.html">BFSVisitor</a>. In each function the
appropriate event is dispatched to the <a
href="./EventVisitor.html">EventVisitor</a> in the EventVisitorList.
<h3>Non-Member Functions</h3>
<table border>
<tr>
<th>Function</th><th>Description</th>
</tr>
<tr><td><tt>
template &lt;class EventVisitorList&gt;<br>
bfs_visitor&lt;EventVisitorList&gt;<br>
make_bfs_visitor(EventVisitorList ev_list);
</tt></td><td>
Returns the event visitor list adapted to be a BFS 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 &copy; 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>
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

-96
View File
@@ -1,96 +0,0 @@
<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: Named Parameters</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:bgl-named-params"></A>
<pre>
bgl_named_params&lt;Param, Type, Rest&gt;
</pre>
</H1>
<p>
Many of the Boost.Graph algorithms have a long list of parameters,
most of which have default values. This causes several problems.
First, C++ does not provide a mechanism for handling default
parameters of template functions. However, this can be overcome by
creating multiply version of an algorithm with different numbers of
parameters with each version providing defaults for some subset of
the parameters. This is the approach used in previous versions of
Boost.Graph. This solution is still unsatisfactory for several
reasons:
<ul>
<li>The defaults for parameters can only been used in a particular
order. If the ordering of the defaults does not fit the users situation
he or she has to resort to providing all the parameters.
<li>Since the list of parameters is long, it is easy to forget
the ordering.
</ul>
<p>
A better solution is provided by <tt>bgl_named_params</tt>. This class
allows users to provide parameters is any order, and matches
arguments to parameters based on parameter names.
<p>
The following code shows an example of calling
<tt>bellman_ford_shortest_paths</tt> using the named parameter
technique. Each of the arguments is passed to a function whose name
indicates which parameter the argument is for. Each of the named
parameters is separated by a <b>period</b>, not a comma.
<pre>
bool r = boost::bellman_ford_shortest_paths(g, int(N),
boost::weight_map(weight).
distance_map(&amp;distance[0]).
predecessor_map(&amp;parent[0]));
</pre>
<p>The order in which the arguments are provided does not matter as
long as they are matched with the correct parameter function. Here is
an call to <tt>bellman_ford_shortest_paths</tt> that is equivalent to
the one above.
<pre>
bool r = boost::bellman_ford_shortest_paths(g, int(N),
boost::predecessor_map(&amp;parent[0]).
distance_map(&amp;distance[0]).
weight_map(weight));
</pre>
<p>Typically the user never needs to deal with the
<tt>bgl_named_params</tt> class directly, since there are functions
like <tt>boost::weight_map</tt> that create an instance of
<tt>bgl_named_params</tt>.
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-452
View File
@@ -1,452 +0,0 @@
<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: Bibliography</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>Bibliography</H2>
<DL COMMapCT><DD><P></P><DT><A NAME="aho83:_data_struct_algo">1</A>
<DD>
A.&nbsp;V. Aho, J.&nbsp;E. Hopcroft, and J.&nbsp;D. Ullman.
<BR><EM>Data Structures and Algorithms</EM>.
<BR>Addison-Wesley, 1983.
<P></P><DT><A NAME="austern99:_gener_progr_stl">2</A>
<DD>
M.&nbsp;H. Austern.
<BR><EM>Generic Programming and the STL</EM>.
<BR>Professional computing series. Addison-Wesley, 1999.
<P></P><DT><A NAME="baumgartner95:_signatures">3</A>
<DD>
G.&nbsp;Baumgartner and V.&nbsp;F. Russo.
<BR>Signatures: A language extension for improving type abstraction and
subtype polymorphism in C++.
<BR><EM>Software-Practice and Experience</EM>, 25(8):863-889, August 1995.
<P></P><DT><A NAME="bellman58">4</A>
<DD>
R.&nbsp;Bellman.
<BR>On a routing problem.
<BR><EM>Quarterly of Applied Mathematics</EM>, 16(1):87-90, 1958.
<P></P><DT><A NAME="bruce95">5</A>
<DD>
K.&nbsp;B. Bruce, L.&nbsp;Cardelli, G.&nbsp;Castagna, the Hopkins Objects&nbsp;Group, G.&nbsp;T.
Leavens, and B.&nbsp;Pierce.
<BR>On binary methods.
<BR><EM>Theory and Practice of Object Systems</EM>, 1:221-242, 1995.
<P></P><DT><A NAME="coleman85:_algor">6</A>
<DD>
T.&nbsp;F. Coleman, B.&nbsp;S. Garbow, and J.&nbsp;J. Mor'e.
<BR>Algorithm 649: Fortran subroutines for estimating sparse hessian
matrices.
<BR><EM>ACM Transactions on Mathematical Software</EM>, 11(4):378, December
1985.
<P></P><DT><A NAME="coleman84:_estim_jacob">7</A>
<DD>
T.&nbsp;F. Coleman and J.&nbsp;J. Mor'e.
<BR>Estimation of sparse jacobian matrices and graph coloring problems.
<BR><EM>SIAM Journal on Numerical Analysis</EM>, 20:187-209,, 1984.
<P></P><DT><A NAME="clr90">8</A>
<DD>
T.&nbsp;Cormen, C.&nbsp;Leiserson, and R.&nbsp;Rivest.
<BR><EM>Introduction to Algorithms</EM>.
<BR>McGraw-Hill, 1990.
<P></P><DT><A NAME="curtis74:_jacob">9</A>
<DD>
A.&nbsp;Curtis, M.&nbsp;Powell, and J.&nbsp;Reid.
<BR>On the estimation of sparse jacobian matrices.
<BR><EM>Journal of the Institute of Mathematics and its Applications</EM>,
13:117-119, 1974.
<P></P><DT><A NAME="dijkstra59">10</A>
<DD>
E.&nbsp;Dijkstra.
<BR>A note on two problems in connexion with graphs.
<BR><EM>Numerische Mathematik</EM>, 1:269-271, 1959.
<P></P><DT><A NAME="ford62:_flows">11</A>
<DD>
L.&nbsp;R. Ford and D.&nbsp;R. Fulkerson.
<BR><EM>Flows in networks</EM>.
<BR>Princeton University Press, 1962.
<P></P><DT><A NAME="gamma95:_design_patterns">12</A>
<DD>
E.&nbsp;Gamma, R.&nbsp;Helm, R.&nbsp;Johnson, and J.&nbsp;Vlissides.
<BR><EM>Design Patterns: Elements of Reusable Object-Oriented Software</EM>.
<BR>Professional Computing. Addison-Welsey, 1995.
<P></P><DT><A NAME="george93:graphtheory">13</A>
<DD>
A.&nbsp;George, J.&nbsp;R. Gilbert, and J.&nbsp;W. Liu, editors.
<BR><EM>Graph Theory and Sparse Matrix Computation</EM>.
<BR>Springer-Verlag New York, Inc, 1993.
<P></P><DT><A NAME="george81:__sparse_pos_def">14</A>
<DD>
A.&nbsp;George and J.&nbsp;W.-H. Liu.
<BR><EM>Computer Solution of Large Sparse Positive Definite Systems</EM>.
<BR>Computational Mathematics. Prentice-Hall, 1981.
<P></P><DT><A NAME="graham85">15</A>
<DD>
R.&nbsp;Graham and P.&nbsp;Hell.
<BR>On the history of the minimum spanning tree problem.
<BR><EM>Annals of the History of Computing</EM>, 7(1):43-57, 1985.
<P></P><DT><A NAME="hart68">16</A>
<DD>
P.&nbsp;E. Hart, N.&nbsp;J. Nilsson, and B.&nbsp;Raphael.
<BR>A formal basis for the heuristic determination of minimum cost paths.
<BR><EM>IEEE Transactions on Systems Science and Cybernetics</EM>,
4(2):100-107, 1968.
<P></P><DT><A NAME="kruskal56">18</A>
<DD>
J.&nbsp;B. Kruskal.
<BR>On the shortest spanning subtree of a graph and the traveling
salesman problem.
<BR>In <EM>Proceedings of the American Mathematical Sofiety</EM>, volume&nbsp;7,
pages 48-50, 1956.
<P></P><DT><A NAME="kuehl96:_design_patterns_for_graph_algo">19</A>
<DD>
D.&nbsp;K&#252;hl.
<BR>Design patterns for the implementation of graph algorithms.
<BR>Master's thesis, Technische Universit&#228;t Berlin, July 1996.
<P></P><DT><A NAME="lawler76:_comb_opt">20</A>
<DD>
E.&nbsp;L. Lawler.
<BR><EM>Combinatorial Opimization: Networks and Matroids</EM>.
<BR>Holt, Rinehart, and Winston, 1976.
<P></P><DT><A NAME="LIU:MMD">21</A>
<DD>
J.&nbsp;W.&nbsp;H. Liu.
<BR>Modification of the minimum-degree algorithm by multiple elimination.
<BR><EM>ACM Transaction on Mathematical Software</EM>, 11(2):141-153, 1985.
<P></P><DT><A NAME="mehlhorn99:_leda">22</A>
<DD>
K.&nbsp;Mehlhorn and S.&nbsp;Näher.
<BR><EM>The LEDA Platform of Combinatorial and Geometric Computing</EM>.
<BR>Cambridge University Press, 1999.
<P></P><DT><A NAME="meyer88:_object_soft_const">23</A>
<DD>
B.&nbsp;Meyer.
<BR><EM>Object-oriented Software Construction</EM>.
<BR>Prentice Hall International Series in Computer Science. Prentice
Hall, 1988.
<P></P><DT><A NAME="myers95:_trait">24</A>
<DD>
N.&nbsp;C. Myers.
<BR>Traits: a new and useful template technique.
<BR><EM>C++ Report</EM>, June 1995.
<P></P><DT><A NAME="prim57:_short">25</A>
<DD>
R.&nbsp;Prim.
<BR>Shortest connection networks and some generalizations.
<BR><EM>Bell System Technical Journal</EM>, 36:1389-1401, 1957.
<P></P><DT><A NAME="saad96:imsms">26</A>
<DD>
Y.&nbsp;Saad.
<BR><EM>Iterative Methods for Sparse Minear System</EM>.
<BR>PWS Publishing Company, 1996.
<P></P><DT><A NAME="tarjan83:_data_struct_network_algo">27</A>
<DD>
R.&nbsp;E. Tarjan.
<BR><EM>Data Structures and Network Algorithms</EM>.
<BR>Society for Industrial and Applied Mathematics, 1983.
<P></P><DT><A NAME="parter61:_gauss">28</A>
<DD>
Seymour Parter.
<BR><EM>The use of linear graphs in Gauss elimination</EM>.
<BR>SIAM Review, 1961 3:119-130.
<P></P><DT><A NAME="matula72:_graph_theory_computing">29</A>
<DD>
D. Matula, G. Marble, and J. Isaacson
<BR><EM>Graph coloring algorithms in Graph Theory and
Computing</EM>.<BR>
Academic Press, pp.104-122, 1972.
<P></P><DT><A NAME="garey79:computers-and-intractability">30</a>
<DD>
M.R. Garey and D.S. Johnson<BR>
<EM>Computers and Intractibility: A Guide to the Theory of
NP-Completeness</EM><BR>
W.H. Freeman, New York, 1979.
<P></P><DT><A NAME="welsch67">31</a>
<DD>D. Welsch and M. B. Powel<BR>
<EM>An upper bound for the chromatic number of a graph and its
application to timetabling problems</EM>
Computer Journal, 10:85-86, 1967.
<P></P><DT><A NAME="brelaz79:_new">32</a>
<DD>D. Br'elaz<BR>
<EM>New methods to color the vertices of a graph</EM><br>
Communications of the ACM, vol. 22, 1979, pp. 251-256.
<P></P><DT><A NAME="heber99:_saw">33</a>
<DD>G. Heber, R. Biswas, G.R. Gao<BR>
<EM>Self-Avoiding Walks over Adaptive Unstructured Grids</EM><br>
Parallel and Distributed Processing, LNCS 1586,
Springer-Verlag, 1999, pp. 968-977
<P></P><DT><A NAME="ng-raghavan">34</a>
<DD>Esmond G. Ng amd Padma Raghavan<BR>
<EM>Performance of greedy ordering heuristics for sparse {C}holesky factorization</EM><br>
SIAM Journal on Matrix Analysis and Applications (To appear)
<P></P><DT><A NAME="George:evolution">35</a>
<DD>Alan George and Joseph W. H. Liu<BR>
<EM>The Evolution of the Minimum Degree Ordering Algorithm</EM><br>
SIAM Review, March 1989, vol. 31, num. 1, pp. 1-19.
<P></P><DT><A NAME="ford56:_maxim">36</a>
<DD>L. R. Ford and D. R. Fulkerson<BR>
<EM>Maximal flow through a network.</EM><br>
Can. Journal of Mathematics 1956 pp.399-404
<P></P><DT><A NAME="goldberg85:_new_max_flow_algor">37</a>
<DD>A. V. Goldberg<BR>
<EM>A New Max-Flow Algorithm.</EM><br>
MIT Tehnical report MIT/LCS/TM-291, 1985.
<P></P><DT><A NAME="karzanov74:_deter">38</a>
<DD>A. V. Karzanov<BR>
<EM>Determining the maximal flow in a network by the method of preflows.</EM><br>
Sov. Math. Dokl. 1974
<P></P><DT><A NAME="ahuja93:_network_flows">39</a>
<DD>Ravindra K. Ahuja and Thomas L. Magnanti and James B. Orlin<BR>
<EM>Network Flows: Theory, Algorithms, and Applications.</EM><br>
Prentice Hall, 1993.
<P></P><DT><A NAME="edmonds72:_improvements_netflow">40</a>
<DD>Jack Edmonds and Richard M. Karp<BR>
<EM>Theoretical improvements in the algorithmic efficiency for network flow problems.</EM><br>
Journal of the ACM, 1972 19:248-264
<P></P><DT><A NAME="tarjan72:dfs_and_linear_algo">41</a>
<DD>Robert E. Tarjan<BR>
<EM>Depth first search and linear graph algorithms.</EM><br>
SIAM Journal on Computing, 1(2):146-160, 1972
<P></P><DT><A NAME="eppstein97:dynamic_graph">42</a>
<DD>David Eppstein, Zvi Galil, and Giuseppe F. Italiano<BR>
<EM>Dynamic Graph Algorithms.</EM><br>
Chapter 22, CRC Handbook of Algorithms and Theory of Computation, 1997.
<P></P><DT><A NAME="cuthill69:reducing_bandwith">43</a>
<DD>E. Cuthill and J. McKee<BR>
<EM>Reducing the bandwidth of sparse symmetric matrices.</EM><br>
Proceedings of the 24th National Conference of the ACM, 1969.
<P></P><DT><A NAME="liu75:anal_cm_rcm">44</a>
<DD>J. Liu and A. Sherman<BR>
<EM>Comparative analysis of the Cuthill-Mckee and the reverse
Cuthill-Mckee ordering algorithms for sparse matrices.</EM><br>
SIAM Journal of Numerical Analysis. 13 (1975), pp. 198-213.
<P></P><DT><A NAME="george71:fem">45</a>
<DD>Alan George<BR>
<EM>Computer implementation of the finite element method</EM><br>
Technical Report STAN-CS-208, Stanford University (1971).
<P></P><DT><A NAME="fortin96:_graph_iso_prob">46</a>
<DD>Scott Fortin<BR>
<EM>The Graph Isomorphism Problem</EM><br>
TR 96-20, Dept. of Computer Science, University of Alberta (1996)
<P></P><DT><A NAME="mckay81:_pract_graph_iso">47</a>
<DD>Brendan D. McKay<BR>
<EM>Practical Graph Isomorphism</EM><br>
Congressus Numerantium (1981)
<P></P><DT><A NAME="reingold77:_combin_algo">48</a>
<DD>Reingold, Nievergelt, and Deo<BR>
<EM>Combinatorial Algorithms: Theory and Practice</EM><br>
Prentice Hall (1977)
<P></P><DT><A NAME="moore59">49</a>
<DD>Edward Moore<BR>
<EM>The shortest path through a maze</EM><br>
International Symposium on the Theory of Switching (1959)<br>
Harvard University Press
<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 &amp; 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&uuml;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 <em>IEEE Transactions on Pattern Analysis and Machine Intelligence</em>, 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.
<P></P><DT><A NAME="wilson96generating">73</A>
<DD>
David&nbsp;Bruce&nbsp;Wilson
<BR><em>Generating random spanning trees more quickly than the cover time</em>.
ACM Symposium on the Theory of Computing, pp. 296-303, 1996.
</dl>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-263
View File
@@ -1,263 +0,0 @@
<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 &lt;typename Graph, typename ComponentMap, typename OutputIterator,
typename P, typename T, typename R&gt;
std::pair&lt;std::size_t, OutputIterator&gt;
biconnected_components(const Graph& g, ComponentMap comp, OutputIterator out,
const bgl_named_params&lt;P, T, R&gt;&amp; params)
template &lt;typename Graph, typename ComponentMap,
typename P, typename T, typename R&gt;
std::size_t
biconnected_components(const Graph& g, ComponentMap comp,
const bgl_named_params&lt;P, T, R&gt;&amp; params)
template &lt;typename Graph, typename OutputIterator,
typename P, typename T, typename R&gt;
OutputIterator articulation_points(const Graph& g, OutputIterator out,
const bgl_named_params&lt;P, T, R&gt;&amp; params)
<i>// non-named parameter version</i>
template &lt;typename Graph, typename ComponentMap, typename OutputIterator,
typename DiscoverTimeMap, typename LowPointMap&gt;
std::pair&lt;std::size_t, OutputIterator&gt;
biconnected_components(const Graph& g, ComponentMap comp, OutputIterator out,
DiscoverTimeMap discover_time, LowPointMap lowpt);
template &lt;typename Graph, typename ComponentMap, typename OutputIterator&gt;
std::pair&lt;std::size_t, OutputIterator&gt;
biconnected_components(const Graph& g, ComponentMap comp, OutputIterator out);
template &lt;typename Graph, typename ComponentMap&gt;
std::size_t biconnected_components(const Graph& g, ComponentMap comp);
<a name="sec:articulation_points">
template &lt;typename Graph, typename OutputIterator&gt;
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&amp; 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&lt;null_visitor&gt;</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.
<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 &copy; 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>
-386
View File
@@ -1,386 +0,0 @@
\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
-259
View File
@@ -1,259 +0,0 @@
<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&amp; 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&lt;Graph&gt;::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 &copy; 2007 Aaron Windsor (<a href="mailto:aaron.windsor@gmail.com">
aaron.windsor@gmail.com</a>)
</BODY>
</HTML>
-395
View File
@@ -1,395 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-15">
<TITLE>Boost Graph Library: Boykov-Kolmogorov Maximum Flow</TITLE>
<META NAME="GENERATOR" CONTENT="OpenOffice.org 2.0 (Linux)">
<META NAME="CREATED" CONTENT="20060820;17315200">
<META NAME="CHANGEDBY" CONTENT="Stephan Diederich">
<META NAME="CHANGED" CONTENT="20060820;23125100">
<!--
// Copyright (c) 2006 Stephan Diederich
//
// This documentation may be used under either of the following two licences:
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE. OF SUCH DAMAGE.
//
// Or:
//
// 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)
-->
<STYLE>
<!--
TD P { color: #000000 }
H1 { color: #000000 }
P { color: #000000 }
PRE { color: #000000 }
H3 { color: #000000 }
BLOCKQUOTE { color: #000000 }
A:link { color: #0000ee }
A:visited { color: #551a8b }
-->
</STYLE>
</HEAD>
<BODY LANG="de-DE" TEXT="#000000" LINK="#0000ee" VLINK="#551a8b" BGCOLOR="#ffffff" DIR="LTR">
<P><IMG SRC="../../../boost.png" NAME="Grafik1" ALT="C++ Boost" ALIGN=BOTTOM WIDTH=277 HEIGHT=86 BORDER=0>
</P>
<H1><A NAME="sec:boykov_kolmogorov_max_flow"></A><TT>boykov_kolmogorov_max_flow</TT>
</H1>
<PRE><I>// named parameter version</I>
template &lt;class Graph, class P, class T, class R&gt;
typename property_traits&lt;typename property_map&lt;Graph, edge_capacity_t&gt;::const_type&gt;::value_type
boykov_kolmogorov_max_flow(Graph&amp; g,
typename graph_traits&lt;Graph&gt;::vertex_descriptor src,
typename graph_traits&lt;Graph&gt;::vertex_descriptor sink,
const bgl_named_params&lt;P, T, R&gt;&amp; params = <I>all defaults</I>)
<I>// non-named parameter version</I>
template &lt;class Graph, class CapacityEdgeMap, class ResidualCapacityEdgeMap, class ReverseEdgeMap,
class PredecessorMap, class ColorMap, class DistanceMap, class IndexMap&gt;
typename property_traits&lt;CapacityEdgeMap&gt;::value_type
boykov_kolmogorov_max_flow(Graph&amp; g,
CapacityEdgeMap cap,
ResidualCapacityEdgeMap res_cap,
ReverseEdgeMap rev_map,
PredecessorMap pre_map,
ColorMap color,
DistanceMap dist,
IndexMap idx,
typename graph_traits &lt;Graph&gt;::vertex_descriptor src,
typename graph_traits &lt;Graph &gt;::vertex_descriptor sink)</PRE><P>
<FONT SIZE=3>Additional overloaded versions for non-named parameters
are provided (without DistanceMap/ColorMap/DistanceMap; for those
iterator_property_maps with the provided index map are used)</FONT></P>
<P>The <TT>boykov_kolmogorov_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
maximum flow will be the return value of the function. The function
also calculates the flow values <I>f(u,v)</I> for all <I>(u,v)</I> in
<I>E</I>, which are returned in the form of the residual capacity
<I>r(u,v) = c(u,v) - f(u,v)</I>.
</P>
<P><B>Requirements:</B><BR>The directed graph <I>G=(V,E)</I> that
represents the network must include a reverse edge for every edge in
<I>E</I>. That is, the input graph should be <I>G<SUB>in</SUB> =
(V,{E U E<SUP>T</SUP>})</I>. The <TT>ReverseEdgeMap</TT> argument <TT>rev</TT>
must map each edge in the original graph to its reverse edge, that is
<I>(u,v) -&gt; (v,u)</I> for all <I>(u,v)</I> in <I>E</I>.
</P>
<P>Remarks: While the push-relabel method states that each edge in <I>E<SUP>T</SUP></I>
has to have capacity of 0, the reverse edges for this algorithm ARE
allowed to carry capacities. If there are already reverse edges in
the input Graph <I><FONT FACE="Courier New, monospace">G</FONT></I>,
those can be used. This can halve the amount of edges and will
noticeably increase the performance.</P>
<P>
<B>Algorithm description:</B><BR>The Boykov-Kolmogorov max-flow (or often
BK max-flow) algorithm is a variety of the augmenting-path algorithm. Standard
augmenting path algorithms find shortest paths from source to sink vertex and
augment them by substracting the bottleneck capacity found on that path from the
residual capacities of each edge and adding it to the total flow. Additionally
the minimum capacity is added to the residual capacity of the reverse edges. If
no more paths in the residual-edge tree are found, the algorithm terminates.
Instead of finding a new shortest path from source to sink in the graph in each
iteration, the Boykov-Kolmogorov algorithm keeps the already found paths as
follows:</P>
<P>The algorithm builds up two search trees, a source-tree and a
sink-tree. Each vertex has a label (stored in <I>ColorMap</I>) to
which tree it belongs and a status-flag if this vertex is active or
passive. In the beginning of the algorithm only the source and the
sink are colored (source==black, sink==white) and have active status.
All other vertices are colored gray. The algorithm consists of three
phases:</P>
<P><I>grow-phase</I>: In this phase active vertices are allowed to
acquire neighbor vertices that are connected through an edge that has
a capacity-value greater than zero. Acquiring means that those vertices
become active and belong now to the search tree of the current
active vertex. If there are no more valid connections to neighbor
vertices, the current vertex becomes passive and the grow phase
continues with the next active vertex. The grow phase terminates if
there are no more active vertices left or a vertex discovers a vertex
from the other search tree through an unsaturated edge. In this case
a path from source to sink is found.</P>
<P><I>augment-phase</I>: This phase augments the path that was found
in the grow phase. First it finds the bottleneck capacity of the
found path, and then it updates the residual-capacity of the edges
from this path by substracting the bottleneck capacity from the
residual capacity. Furthermore the residual capacity of the reverse
edges are updated by adding the bottleneck capacity. This phase can
destroy the built up search trees, as it creates at least one
saturated edge. That means, that the search trees collapse to
forests, because a condition for the search trees is, that each
vertex in them has a valid (=non-saturated) connection to a terminal.</P>
<P><I>adoption-phase</I>: Here the search trees are reconstructed. A
simple solution would be to mark all vertices coming after the first
orphan in the found path free vertices (gray). A more sophisticated
solution is to give those orphans new parents: The neighbor vertices
are checked if they have a valid connection to the same terminal like
this vertex had (a path with unsaturated edges). If there is one,
this vertex becomes the new parent of the current orphan and this
forest is re-included into the search tree. If no new valid parent is
found, this vertex becomes a free vertex (marked gray), and it's
children become orphans. The adoption phase terminates if there are
no more orphans.</P>
<P><IMG SRC="figs/bk_max_flow.gif" NAME="Grafik2" ALIGN=LEFT WIDTH=827 HEIGHT=311 BORDER=0><BR CLEAR=LEFT><B>Details:</B></P>
<UL>
<LI><P>Marking heuristics: A timestamp is stored for each vertex
which shows in which iteration of the algorithm the distance to the
corresponding terminal was calculated.
</P>
<UL>
<LI><P>This distance is used and gets calculated in the
adoption-phase. In order to find a valid new parent for an orphan,
the possible parent is checked for a connection to the terminal to
which tree it belongs. If there is such a connection, the path is
tagged with the current time-stamp, and the distance value. If
another orphan has to find a parent and it comes across a vertex
with a current timestamp, this information is used.</P>
<LI><P>The distance is also used in the grow-phase. If a vertex
comes across another vertex of the same tree while searching for
new vertices, the other's distance is compared to its distance. If
it is smaller, that other vertex becomes the new parent of the
current. This can decrease the length of the search paths, and so
amount of adoptions.</P>
</UL>
<LI><P>Ordering of orphans: As described above, the augment-phase
and the adoption phase can create orphans. The orphans the
augment-phase generates, are ordered according to their distance to
the terminals (smallest first). This combined with the
distance/timestamp heuristics results in the possibility for not
having to recheck terminal-connections too often. New orphans which
are generated in adoption phase are processed before orphans from
the main queue for the same reason.</P>
</UL>
<P><BR><B>Implementation notes:</B></P>
<P>The algorithm is mainly implemented as described by Boykov and Kolmogorov in
[<a href="bibliography.html#boykov-kolmogorov04">69</a>]. An extended version
can be found in the PhD Thesis of Kolmogorov [<A HREF="bibliography.html#kolmogorov03">68</a>].
The following changes are made to improve performance:</P>
<UL>
<LI>initialization: the algorithm first augments all paths from
source-&gt;sink and all paths from source-&gt;VERTEX-&gt;sink. This
improves especially graph-cuts used in image vision where nearly
each vertex has a source and sink connect. During this step, all
vertices that have an unsaturated connection from source are added
to the active vertex list and so the source is not.</LI>
<LI>active vertices: Boykov-Kolmogorov uses two lists for active nodes
and states that new active vertices are added to the rear of the
second. Fetching an active vertex is done from the beginning of the
first list. If the first list is empty, it is exchanged by the
second. This implementation uses just one list.</LI>
<LI>grow-phase: In the grow phase the first vertex in the
active-list is taken and all outgoing edges are checked if they are
unsaturated. This decreases performance for graphs with high-edge
density. This implementation stores the last accessed edge and
continues with it, if the first vertex in the active-list is the
same one as during the last grow-phase.</LI>
</UL>
<H3>Where Defined</H3>
<P><TT><A HREF="../../../boost/graph/boykov_kolmogorov_max_flow.hpp">boost/graph/boykov_kolmogorov_max_flow.hpp</A></TT>
</P>
<H3>Parameters</H3>
<P>IN: <TT>Graph&amp; g</TT>
</P>
<BLOCKQUOTE>A directed graph. The graph's type must be a model of
<A HREF="VertexListGraph.html">Vertex List Graph</A>, <A HREF="EdgeListGraph.html">Edge
List Graph</A> and <A HREF="IncidenceGraph.html">Incidence Graph</A>.
For each edge <I>(u,v)</I> in the graph, the reverse edge <I>(v,u)</I>
must also be in the graph. Performance of the algorithm will be slightly
improved if the graph type also models <a href="AdjacencyMatrix.html">Adjacency
Matrix</a>.
</BLOCKQUOTE>
<P>IN: <TT>vertex_descriptor src</TT>
</P>
<BLOCKQUOTE>The source vertex for the flow network graph.
</BLOCKQUOTE>
<P>IN: <TT>vertex_descriptor sink</TT>
</P>
<BLOCKQUOTE>The sink vertex for the flow network graph.
</BLOCKQUOTE>
<H3>Named Parameters</H3>
<P>IN: <TT>edge_capacity(EdgeCapacityMap cap)</TT>
</P>
<BLOCKQUOTE>The edge capacity property map. The type must be a model
of a 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_capacity, g)</TT>
</BLOCKQUOTE>
<P>OUT: <TT>edge_residual_capacity(ResidualCapacityEdgeMap res)</TT>
</P>
<BLOCKQUOTE>The edge residual capacity property map. The type must be
a model of a mutable <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_residual_capacity,
g)</TT>
</BLOCKQUOTE>
<P>IN: <TT>edge_reverse(ReverseEdgeMap rev)</TT>
</P>
<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/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>
</BLOCKQUOTE>
<P>UTIL: <TT>vertex_predecessor(PredecessorMap pre_map)</TT>
</P>
<BLOCKQUOTE>A vertex property map that stores the edge to the vertex'
predecessor. The map must be a model of mutable <A HREF="../../property_map/doc/LvaluePropertyMap.html">Lvalue
Property Map</A>. The key type of the map must be the graph's vertex
descriptor type.<BR><B>Default:</B> <TT>get(vertex_predecessor, g)</TT>
</BLOCKQUOTE>
<P>OUT/UTIL: <TT>vertex_color(ColorMap color)</TT>
</P>
<BLOCKQUOTE>A vertex property map that stores a color for edge
vertex. If the color of a vertex after running the algorithm is black
the vertex belongs to the source tree else it belongs to the
sink-tree (used for minimum cuts). The map must be a model of mutable
<A HREF="../../property_map/doc/LvaluePropertyMap.html">Lvalue Property
Map</A>. The key type of the map must be the graph's vertex
descriptor type.<BR><B>Default:</B> <TT>get(vertex_color, g)</TT>
</BLOCKQUOTE>
<P>UTIL: <TT>vertex_distance(DistanceMap dist)</TT>
</P>
<BLOCKQUOTE>A vertex property map that stores the distance to the
corresponding terminal. It's a utility-map for speeding up the
algorithm. The map must be a model of mutable <A HREF="../../property_map/doc/LvaluePropertyMap.html">Lvalue
Property Map</A>. The key type of the map must be the graph's vertex
descriptor type.<BR><B>Default:</B> <TT>get(vertex_distance, g)</TT>
</BLOCKQUOTE>
<P>IN: <TT>vertex_index(VertexIndexMap index_map)</TT>
</P>
<BLOCKQUOTE>Maps each vertex of the graph to a unique integer in the
range <TT>[0, num_vertices(g))</TT>. The map must be a model of
constant <A HREF="../../property_map/doc/LvaluePropertyMap.html">LvaluePropertyMap</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>
</BLOCKQUOTE>
<H3>Example</H3>
<P>This reads an example maximum flow problem (a graph with edge
capacities) from a file in the DIMACS format (<TT><A HREF="../example/max_flow.dat">example/max_flow.dat</A></TT>).
The source for this example can be found in
<TT><A HREF="../example/boykov_kolmogorov-eg.cpp">example/boykov_kolmogorov-eg.cpp</A></TT>.
</P>
<PRE>#include &lt;boost/config.hpp&gt;
#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;boost/graph/adjacency_list.hpp&gt;
#include &lt;boost/graph/boykov_kolmogorov_max_flow.hpp&gt;
#include &lt;boost/graph/read_dimacs.hpp&gt;
#include &lt;boost/graph/graph_utility.hpp&gt;
int
main()
{
using namespace boost;
typedef adjacency_list_traits &lt; vecS, vecS, directedS &gt; Traits;
typedef adjacency_list &lt; vecS, vecS, directedS,
property &lt; vertex_name_t, std::string,
property &lt; vertex_index_t, long,
property &lt; vertex_color_t, boost::default_color_type,
property &lt; vertex_distance_t, long,
property &lt; vertex_predecessor_t, Traits::edge_descriptor &gt; &gt; &gt; &gt; &gt;,
property &lt; edge_capacity_t, long,
property &lt; edge_residual_capacity_t, long,
property &lt; edge_reverse_t, Traits::edge_descriptor &gt; &gt; &gt; &gt; Graph;
Graph g;
property_map &lt; Graph, edge_capacity_t &gt;::type
capacity = get(edge_capacity, g);
property_map &lt; Graph, edge_residual_capacity_t &gt;::type
residual_capacity = get(edge_residual_capacity, g);
property_map &lt; Graph, edge_reverse_t &gt;::type rev = get(edge_reverse, g);
Traits::vertex_descriptor s, t;
read_dimacs_max_flow(g, capacity, rev, s, t);
std::vector&lt;default_color_type&gt; color(num_vertices(g));
std::vector&lt;long&gt; distance(num_vertices(g));
long flow = boykov_kolmogorov_max_flow(g ,s, t);
std::cout &lt;&lt; "c The total flow:" &lt;&lt; std::endl;
std::cout &lt;&lt; "s " &lt;&lt; flow &lt;&lt; std::endl &lt;&lt; std::endl;
std::cout &lt;&lt; "c flow values:" &lt;&lt; std::endl;
graph_traits &lt; Graph &gt;::vertex_iterator u_iter, u_end;
graph_traits &lt; Graph &gt;::out_edge_iterator ei, e_end;
for (tie(u_iter, u_end) = vertices(g); u_iter != u_end; ++u_iter)
for (tie(ei, e_end) = out_edges(*u_iter, g); ei != e_end; ++ei)
if (capacity[*ei] &gt; 0)
std::cout &lt;&lt; "f " &lt;&lt; *u_iter &lt;&lt; " " &lt;&lt; target(*ei, g) &lt;&lt; " "
&lt;&lt; (capacity[*ei] - residual_capacity[*ei]) &lt;&lt; std::endl;
return EXIT_SUCCESS;
}</PRE><P>
The output is:
</P>
<PRE>c The total flow:
s 13
c flow values:
f 0 6 3
f 0 1 0
f 0 2 10
f 1 5 1
f 1 0 0
f 1 3 0
f 2 4 4
f 2 3 6
f 2 0 0
f 3 7 5
f 3 2 0
f 3 1 1
f 4 5 4
f 4 6 0
f 5 4 0
f 5 7 5
f 6 7 3
f 6 4 0
f 7 6 0
f 7 5 0</PRE><H3>
See Also</H3>
<P STYLE="margin-bottom: 0cm">
<TT><A HREF="edmonds_karp_max_flow.html">edmonds_karp_max_flow()</A></TT>,
<TT><A HREF="push_relabel_max_flow.html">push_relabel_max_flow()</A></TT>.
</P>
<HR>
<TABLE CELLPADDING=2 CELLSPACING=2>
<TR VALIGN=TOP>
<TD>
<P>Copyright &copy; 2006</P>
</TD>
<TD>
<P>Stephan Diederich, University
Mannheim(<A HREF="mailto:diederich@ti.uni-manheim.de">diederich@ti.uni-manheim.de</A>)</P>
</TD>
</TR>
</TABLE>
<P><BR><BR>
</P>
</BODY>
</HTML>
-338
View File
@@ -1,338 +0,0 @@
<HTML>
<!--
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="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1><A NAME="sec:bfs">
<img src="figs/python.gif" alt="(Python)"/>
<TT>breadth_first_search</TT>
</H1>
<P>
<PRE>
<i>// named parameter version</i>
template &lt;class Graph, class P, class T, class R&gt;
void breadth_first_search(Graph& G,
typename graph_traits&lt;Graph&gt;::vertex_descriptor s,
const bgl_named_params&lt;P, T, R&gt;&amp; params);
<i>// non-named parameter version</i>
template &lt;class Graph, class Buffer, class BFSVisitor,
class ColorMap&gt;
void breadth_first_search(const Graph&amp; g,
typename graph_traits&lt;Graph&gt;::vertex_descriptor s,
Buffer&amp; Q, BFSVisitor vis, ColorMap color);
</PRE>
<p>
The <tt>breadth_first_search()</tt> function performs a breadth-first
traversal [<a href="./bibliography.html#moore59">49</a>] of a directed
or undirected graph. A breadth-first traversal visits vertices that
are closer to the source before visiting vertices that are further
away. In this context ``distance'' is defined as the number of edges
in the shortest path from the source vertex. The
<tt>breadth_first_search()</tt> function can be used to compute the
shortest path from the source to all reachable vertices and the
resulting shortest-path distances. For more definitions related to BFS
see section <a href="./graph_theory_review.html#sec:bfs-algorithm">
Breadth-First Search</a>.
</p>
<p>
BFS uses two data structures to to implement the traversal: a color
marker for each vertex and a queue. White vertices are undiscovered
while gray vertices are discovered but have undiscovered adjacent
vertices. Black vertices are discovered and are adjacent to only other
black or gray vertices. The algorithm proceeds by removing a vertex
</i>u</i> from the queue and examining each out-edge <i>(u,v)</i>. If an
adjacent vertex <i>v</i> is not already discovered, it is colored gray and
placed in the queue. After all of the out-edges are examined, vertex
<i>u</i> is colored black and the process is repeated. Pseudo-code for the
BFS algorithm is a listed below.
</p>
<table>
<tr>
<td valign="top">
<pre>
BFS(<i>G</i>, <i>s</i>)
<b>for</b> each vertex <i>u in V[G]</i>
<i>color[u] :=</i> WHITE
<i>d[u] := infinity</i>
<i>p[u] := u</i>
<b>end for</b>
<i>color[s] :=</i> GRAY
<i>d[s] := 0</i>
ENQUEUE(<i>Q</i>, <i>s</i>)
<b>while</b> (<i>Q != &Oslash;</i>)
<i>u :=</i> DEQUEUE(Q)
<b>for</b> each vertex <i>v in Adj[u]</i>
<b>if</b> (<i>color[v] =</i> WHITE)
<i>color[v] :=</i> GRAY
<i>d[v] := d[u] + 1</i>
<i>p[v] := u</i>
ENQUEUE(<i>Q</i>, <i>v</i>)
<b>else</b>
<b>if</b> (<i>color[v] =</i> GRAY)
...
<b>else</b>
...
<b>end for</b>
<i>color[u] :=</i> BLACK
<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>
<i>(u,v)</i> is a tree edge
discover vertex <i>v</i>
<i>(u,v)</i> is a non-tree edge
<i>(u,v)</i> has a gray target
<i>(u,v)</i> has a black target
finish vertex <i>u</i>
</pre>
</tr>
</table>
The <tt>breadth_first_search()</tt> function can be extended with
user-defined actions that will be called a certain event points. The
actions must be provided in the form of a visitor object, that is, an
object who's type meets the requirements for a <a
href="./BFSVisitor.html">BFS Visitor</a>. In the above pseudo-code,
the event points are the labels on the right. Also a description of
each event point is given below. By default, the
<tt>breadth_first_search()</tt> function does not carry out any
actions, not even recording distances or predecessors. However these
can be easily added using the <a
href="./distance_recorder.html"><tt>distance_recorder</tt></a> and <a
href="./predecessor_recorder.html"><tt>predecessor_recorder</tt></a>
event visitors.
<H3>Where Defined</H3>
<P>
<a href="../../../boost/graph/breadth_first_search.hpp"><TT>boost/graph/breadth_first_search.hpp</TT></a>
<P>
<h3>Parameters</h3>
IN: <tt>Graph&amp; g</tt>
<blockquote>
A directed or undirected graph. The graph type must
be a model of <a href="./VertexListGraph.html">Vertex List Graph</a>
and <a href="./IncidenceGraph.html">Incidence Graph</a>.<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.<br>
<b>Python</b>: The parameter is named <tt>root_vertex</tt>.
</blockquote>
<h3>Named Parameters</h3>
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. The visitor object is passed by value <a
href="#1">[1]</a>.<br> <b>Default:</b>
<tt>bfs_visitor&lt;null_visitor&gt;</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 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/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>
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 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/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>
UTIL: <tt>buffer(Buffer&amp; Q)</tt>
<blockquote>
The queue used to determine the order in which vertices will be
discovered. If a FIFO queue is used, then the traversal will
be according to the usual BFS ordering. Other types of queues
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> 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>
<H3><A NAME="SECTION001330300000000000000">
Complexity</A>
</H3>
<P>
The time complexity is <i>O(E + V)</i>.
<P>
<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.
<li><b><tt>vis.examine_edge(e, g)</tt></b> is invoked on every out-edge
of each vertex immediately after the vertex is removed from the queue.
<li><b><tt>vis.tree_edge(e, g)</tt></b> is invoked (in addition to
<tt>examine_edge()</tt>) if the edge is a tree edge. The
target vertex of edge <tt>e</tt> is discovered at this time.
<li><b><tt>vis.discover_vertex(u, g)</tt></b> is invoked the first time the
algorithm encounters vertex <i>u</i>. All vertices closer to the
source vertex have been discovered, and vertices further from the
source have not yet been discovered.
<li><b><tt>vis.non_tree_edge(e, g)</tt></b> is invoked (in addition to
<tt>examine_edge()</tt>) if the edge is not a tree edge.
<li><b><tt>vis.gray_target(e, g)</tt></b> is invoked (in addition to
<tt>non_tree_edge()</tt>) if the target vertex is colored gray at the
time of examination. The color gray indicates that
the vertex is currently in the queue.
<li><b><tt>vis.black_target(e, g)</tt></b> is invoked (in addition to
<tt>non_tree_edge()</tt>) if the target vertex is colored black at the
time of examination. The color black indicates that the
vertex is no longer in the queue.
<li><b><tt>vis.finish_vertex(u, g)</tt></b> is invoked after all of the out
edges of <i>u</i> have been examined and all of the adjacent vertices
have been discovered.
</ul>
<H3><A NAME="SECTION001330400000000000000">
Example</A>
</H3>
<P>
The example in <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>. 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 &copy; 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>
-186
View File
@@ -1,186 +0,0 @@
<HTML>
<!--
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="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1><A NAME="sec:bfv"><img src="figs/python.gif" alt="(Python)"/>
<TT>breadth_first_visit</TT>
</H1>
<P>
<PRE>
template &lt;class <a href="./IncidenceGraph.html">IncidenceGraph</a>, class P, class T, class R&gt;
void breadth_first_visit(IncidenceGraph& G,
typename graph_traits&lt;IncidenceGraph&gt;::vertex_descriptor s,
const bgl_named_params&lt;P, T, R&gt;&amp; params);
template &lt;class <a href="./IncidenceGraph.html">IncidenceGraph</a>, class <a href="./Buffer.html">Buffer</a>, class <a href="./BFSVisitor.html">BFSVisitor</a>, class ColorMap&gt;
void breadth_first_visit
(const IncidenceGraph&amp; g,
typename graph_traits&lt;IncidenceGraph&gt;::vertex_descriptor s,
Buffer&amp; Q, BFSVisitor vis, ColorMap color)
</PRE>
This function is basically the same as <tt>breadth_first_search()</tt>
except that the color markers are not initialized in the
algorithm. The user is responsible for making sure the color for every
vertex is white before calling the algorithm. With this difference,
the graph type is only required to be an <a
href="./IncidenceGraph.html">Incidence Graph</a> instead of a <a
href="./VertexListGraph.html">Vertex List Graph</a>. Also, this
difference allows for more flexibility in the color property map. For
example, one could use a map that only implements a partial function
on the vertices, which could be more space efficient when the search
only reaches a small portion of the graph.
<H3>Where Defined</H3>
<P>
<a href="../../../boost/graph/breadth_first_search.hpp"><TT>boost/graph/breadth_first_search.hpp</TT></a>
<h3>Parameters</h3>
IN: <tt>IncidenceGraph&amp; g</tt>
<blockquote>
A directed or undirected graph. The graph type must
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.<br>
<b>Python</b>: The parameter is named <tt>root_vertex</tt>.
</blockquote>
<h3>Named Parameters</h3>
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. The visitor object is passed by value <a
href="#1">[1]</a>.<br> <b>Default:</b>
<tt>bfs_visitor&lt;null_visitor&gt;</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/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><br>
<b>Python</b>: The color map must be a <tt>vertex_color_map</tt> for
the graph.
</blockquote>
UTIL: <tt>buffer(Buffer&amp; Q)</tt>
<blockquote>
The queue used to determine the order in which vertices will be
discovered. If a FIFO queue is used, then the traversal will
be according to the usual BFS ordering. Other types of queues
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><br>
<b>Python</b>: The buffer must derive from the <a
href="./Buffer.html">Buffer</a> type for the graph.
</blockquote>
<H3><A NAME="SECTION001330300000000000000">
Complexity</A>
</H3>
<P>
The time complexity is <i>O(E)</i>.
<P>
<h3>Visitor Event Points</h3>
<ul>
<li><b><tt>vis.examine_vertex(u, g)</tt></b>r is invoked in each
vertex as it is removed from the queue.
<li><b><tt>vis.examine_edge(e, g)</tt></b> is invoked on every out-edge
of each vertex immediately after the vertex is removed from the queue.
<li><b><tt>vis.tree_edge(e, g)</tt></b> is invoked (in addition to
<tt>examine_edge()</tt>) if the edge is a tree edge. The
target vertex of edge <tt>e</tt> is discovered at this time.
<li><b><tt>vis.discover_vertex(u, g)</tt></b> is invoked the first time the
algorithm encounters vertex <i>u</i>. All vertices closer to the
source vertex have been discovered, and vertices further from the
source have not yet been discovered.
<li><b><tt>vis.non_tree_edge(e, g)</tt></b> is invoked (in addition to
<tt>examine_edge()</tt>) if the edge is not a tree edge.
<li><b><tt>vis.gray_target(e, g)</tt></b> is invoked (in addition to
<tt>non_tree_edge()</tt>) if the target vertex is colored gray at the
time of examination. The color gray indicates that
the vertex is currently in the queue.
<li><b><tt>vis.black_target(e, g)</tt></b> is invoked (in addition to
<tt>non_tree_edge()</tt>) if the target vertex is colored black at the
time of examination. The color black indicates that the
vertex is no longer in the queue.
<li><b><tt>vis.finish_vertex(u, g)</tt></b> is invoked after all of the out
edges of <i>u</i> have been examined and all of the adjacent vertices
have been discovered.
</ul>
<h3>See Also</h3>
<a href="./breadth_first_search.html"><tt>breadth_first_search()</tt></a>,
<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 &copy; 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>
+30
View File
@@ -0,0 +1,30 @@
#!/bin/bash
#
# 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)
#
# Official repository: https://github.com/boostorg/graph
#
# Picked up by boostorg/release-tools' build_docs/{linuxdocs.sh,macosdocs.sh,
# windowsdocs.ps1} via auto-detection: presence of this file selects the
# Antora build pipeline. Output lands in doc/build/site/.
set -xe
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "$SCRIPT_DIR"
if [ $# -eq 0 ]; then
PLAYBOOK="playbook.yml"
else
PLAYBOOK="$1"
fi
echo "Installing npm dependencies..."
npm ci
echo "Building docs with Antora using $PLAYBOOK..."
PATH="$(pwd)/node_modules/.bin:${PATH}"
export PATH
npx antora --clean --fetch "$PLAYBOOK"
echo "Done"
+89
View File
@@ -0,0 +1,89 @@
#!/usr/bin/env bash
# Compiles every .cpp under modules/ROOT/examples/ with -std=c++14, runs it,
# and writes stdout to a sibling .txt file that Antora pages can include.
#
# Usage:
# BOOST_INCLUDE=/path/to/boost/include \
# BOOST_LIB=/path/to/boost/lib \
# ./build_example_outputs.sh
#
# Defaults below match the Conan-installed Boost 1.79 layout used for
# local development. CI overrides them.
set -u
HERE=$(cd "$(dirname "$0")" && pwd)
REPO_ROOT=$(cd "$HERE/.." && pwd)
EXAMPLES_ROOT="$HERE/modules/ROOT/examples"
: "${BOOST_INCLUDE:=$HOME/.conan/data/boost/1.79.0/_/_/package/2c7a64ca03ffe00ac4600bf373ea3ecf338b36d9/include}"
: "${BOOST_LIB:=}"
: "${CXX:=g++}"
: "${CXXFLAGS:=-std=c++14 -O1 -w}"
if [ ! -d "$BOOST_INCLUDE" ]; then
echo "BOOST_INCLUDE not found: $BOOST_INCLUDE" >&2
echo "Set BOOST_INCLUDE to the Boost include directory and re-run." >&2
exit 1
fi
# Per-example link flags. A handful of examples need the prebuilt
# boost_graph library (graphviz, graphml readers and the isomorphism
# example pull in non-header-only code).
extra_libs_for() {
case "$1" in
io/graphml.cpp|io/graphviz.cpp|algorithms/isomorphism/isomorphism.cpp)
echo "-lboost_graph"
;;
*)
echo ""
;;
esac
}
LDFLAGS=""
if [ -n "$BOOST_LIB" ]; then
LDFLAGS="-L$BOOST_LIB -Wl,-rpath,$BOOST_LIB"
fi
WORK=$(mktemp -d)
trap 'rm -rf "$WORK"' EXIT
ok=0
fail=0
fail_list=""
while IFS= read -r src; do
rel=${src#"$EXAMPLES_ROOT/"}
out_txt=${src%.cpp}.txt
bin="$WORK/$(basename "$src" .cpp).out"
extra=$(extra_libs_for "$rel")
if ! "$CXX" $CXXFLAGS \
-I"$REPO_ROOT/include" -I"$BOOST_INCLUDE" \
"$src" -o "$bin" $LDFLAGS $extra 2>/dev/null; then
printf ' [compile FAIL] %s\n' "$rel"
fail=$((fail + 1))
fail_list+="$rel (compile)\n"
continue
fi
if ! "$bin" > "$out_txt.tmp" 2>&1; then
printf ' [run FAIL] %s\n' "$rel"
rm -f "$out_txt.tmp"
fail=$((fail + 1))
fail_list+="$rel (run)\n"
continue
fi
mv "$out_txt.tmp" "$out_txt"
printf ' [OK] %s\n' "$rel"
ok=$((ok + 1))
done < <(find "$EXAMPLES_ROOT" -name '*.cpp' | sort)
echo
echo "Generated $ok .txt outputs, $fail failures."
if [ "$fail" -gt 0 ]; then
printf "Failing examples:\n$fail_list"
exit 1
fi
-228
View File
@@ -1,228 +0,0 @@
<!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&lt;int&gt; 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>With bundled properties, we can directly use the <code>City</code> and
<code>Highway</code> structures to define the graph:</p>
<pre>
typedef boost::adjacency_list&lt;
boost::listS, boost::vecS, boost::bidirectionalS,
City, Highway&gt;
Map;
</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&lt;
boost::listS, boost::vecS, boost::bidirectionalS,
// Vertex properties
boost::property&lt;boost::vertex_name_t, std::string,
boost::property&lt;population_t, int,
boost::property&lt;zipcodes_t, std::vector&lt;int&gt; &gt; &gt; &gt;,
// Edge properties
boost::property&lt;boost::edge_name_t, std::string,
boost::property&lt;boost::edge_length_t, double,
boost::property&lt;edge_speed_limit_t, int,
boost::property&lt;edge_lanes_t, int,
boost::property&lt;edge_divided, bool&gt; &gt; &gt; &gt; &gt; &gt;
Map;
</pre>
<p>
Bundling vertex and edge properties greatly simplifies the declaration of
graphs.
</p>
<p>
In addition to vertex and edge bundles, we can also bundle properties of the
graph itself. Suppopse we extend the application to include a portfolio of
route-planning maps for different countries. In addition to the <code>City</code>
and <code>Highway</code> bundles above, we can declare a graph bundle,
<code>Country</Code>.
</p>
<pre>
struct Country {
string name;
bool use_right; // Drive on the left or right
bool use_metric; // mph or km/h
};
</pre>
<p>The graph would now be declared as:</p>
<pre>
<pre>
typedef boost::adjacency_list&lt;
boost::listS, boost::vecS, boost::bidirectionalS,
City, Highway, Country&gt;
Map;
</pre>
</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>
<p>
The graph bundle, since it does not correspond to a vertex or edge descripor
is accessed using the graph_bundle object as a key.
</p>
<pre>
map[graph_bundle].name = "United States";
map[graph_bundle].use_right = true;
map[graph_bundle].use_metric = false;
</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&lt;double&gt; 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&lt;double&gt; distances(num_vertices(map));
dijkstra_shortest_paths(map, from,
weight_map(get(<font color="#ff0000">&amp;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&lt;Map, int Highway::*&gt;::type</code>
or <code>property_map&lt;Map, int Highway::*&gt;::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>Property maps for a graph bundle</h2>
There is currently no support for creating property maps from the bundled
properties of a graph.
<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&lt;Graph&gt;::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&lt;Graph&gt;::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 &copy; 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>
-120
View File
@@ -1,120 +0,0 @@
<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>Challenge</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>Boost Graph Library Challenge and To-Do Items</h2>
<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>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>
<li><tt>disjoint_sets</tt> </li>
</ul>
<li>Construct a set of planar graph algorithms.</li>
<ul>
<li> Is the graph planar?</li>
<li> &quot;Walk around the block&quot; and similar open and closed neighborhood
traversals. Note that edge traversals need to resolve to particular ends
and sides (see below), not just to the edge as a whole.</li>
<li> Given a point, find the nearest vertex, edge, or bounded polygon.
Again, edges are viewed as having left and right sides.</li>
<li> Given a line segment, find intersecting vertices, edges, or bounded
polygons.</li>
<li> Given a polygon, find intersecting whatever...</li>
<li> Various minimum bounding rectangle and clipping problems.</li>
<li> Construct a planar embedding of a planar graph.</li>
<li> Find a balanced separator of a graph.</li>
<li> Modify adjacency_list so that the out-edges can be ordered
according to a user defined comparison object.</li>
</ul>
<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>Explore the use of Algorithm Objects as an alternative to
the current approach with visitors.</li>
<li>Analyze the algorithms that do not yet have visitors, and
come up with visitor interfaces for them.</li>
<li>Add a check in the adjacency_list class to make sure
all the vertex property template arguments have kind=vertex_property_tag
and all edge property template arguments have kind=edge_property_tag.</li>
<li>Clean up the output functions in graph_utility.hpp to
use streams, and document all the utility functions. Replace
the random number stuff with calls to the boost random number generator.</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. 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.</li>
<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 &copy; 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>
-51
View File
@@ -1,51 +0,0 @@
<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 &#8212; 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>&lt;<span class="bold"><b>typename</b></span> VertexListGraph, <span class="bold"><b>typename</b></span> PositionMap, <span class="bold"><b>typename</b></span> Radius&gt;
  <span class="type"><span class="bold"><b>void</b></span></span> circle_graph_layout(<span class="bold"><b>const</b></span> VertexListGraph &amp; 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&amp; 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 &copy; 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>
Binary file not shown.
-971
View File
@@ -1,971 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<!--
Copyright (c) 2005-2009 Trustees of Indiana University
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
-->
<head>
<title>Compressed Sparse Row Graph</title>
<STYLE TYPE="text/css">
<!--
.indent
{
padding-left: 50pt;
padding-right: 50pt;
}
-->
</STYLE>
<script language="JavaScript" type="text/JavaScript">
<!--
function address(host, user) {
var atchar = '@';
var thingy = user+atchar+host;
thingy = '<a hre' + 'f=' + "mai" + "lto:" + thingy + '>' + user+atchar+host + '</a>';
document.write(thingy);
}
//-->
</script>
</head>
<body>
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86"></img>
<h1>Compressed Sparse Row Graph</h1>
<p>The class template <code>compressed_sparse_row_graph</code> is
a graph class that uses the compact Compressed Sparse Row (CSR)
format to store directed (and bidirectional) graphs. While CSR graphs have
much less
overhead than many other graph formats (e.g., <a
href="adjacency_list.html"><code>adjacency_list</code></a>), they
do not provide any mutability: one cannot add or remove vertices
or edges from a CSR graph. Use this format in high-performance
applications or for very large graphs that you do not need to
change.</p>
<p>The CSR format stores vertices and edges in separate arrays,
with the indices into these arrays corresponding to the identifier
for the vertex or edge, respectively. The edge array is sorted by
the source of each edge, but contains only the targets for the
edges. The vertex array stores offsets into the edge array,
providing the offset of the first edge outgoing from each
vertex. Iteration over the out-edges for the <i>i</i><sup>th</sup>
vertex in the graph is achieved by
visiting <tt>edge_array[vertex_array[i]]</tt>,
<tt>edge_array[vertex_array[i]+1]</tt>,
..., <tt>edge_array[vertex_array[i+1]]</tt>. This format minimizes
memory use to <i>O(n + m)</i>, where <i>n</i> and <i>m</i> are the
number of vertices and edges, respectively. The constants
multiplied by <i>n</i> and <i>m</i> are based on the size of the
integers needed to represent indices into the edge and vertex
arrays, respectively, which can be controlled using
the <a href="#template-parms">template parameters</a>. The
<tt>Directed</tt> template parameter controls whether one edge direction
(the default) or both directions are stored. A directed CSR graph has
<tt>Directed</tt> = <tt>directedS</tt> and a bidirectional CSR graph (with
a limited set of constructors)
has <tt>Directed</tt> = <tt>bidirectionalS</tt>.</p>
<ul>
<li><a href="#synopsis">Synopsis</a></li>
<li><a href="#where">Where Defined</a></li>
<li><a href="#models">Models</a></li>
<li><a href="#template-parms">Template parameters</a></li>
<li><a href="#properties">Properties</a></li>
<li><a href="#member-functions">Member functions</a>
<ul>
<li><a href="#constructors">Constructors</a></li>
<li><a href="#mutators">Mutators</a></li>
<li><a href="#property-access">Property access</a></li>
</ul></li>
<li><a href="#non-members">Non-member functions</a>
<ul>
<li><a href="#vertex-access">Vertex access</a></li>
<li><a href="#edge-access">Edge access</a></li>
<li><a href="#property-map-accessors">Property map accessors</a></li>
<li><a href="#incremental-construction-functions">Incremental construction functions</a></li>
</ul></li>
<li><a href="#example">Example</a></li>
</ul>
<a name="synopsis"></a><h2>Synopsis</h2>
<pre>
namespace boost {
template&lt;typename <a href="#Directed">Directed</a> = directedS, typename <a href="#VertexProperty">VertexProperty</a> = void,
typename <a href="#EdgeProperty">EdgeProperty</a> = void, typename <a href="#GraphProperty">GraphProperty</a> = no_property,
typename <a href="#Vertex">Vertex</a> = std::size_t, typename <a href="#EdgeIndex">EdgeIndex</a> = Vertex&gt;
class compressed_sparse_row_graph
{
public:
<i>// <a href="#constructors">Graph constructors</a></i>
<a href="#default-const">compressed_sparse_row_graph</a>();
<i>// Unsorted edge list constructors </i>
template&lt;typename InputIterator&gt;
<a href="#edge-const">compressed_sparse_row_graph</a>(edges_are_unsorted_t,
InputIterator edge_begin, InputIterator edge_end,
vertices_size_type numverts,
const GraphProperty&amp; prop = GraphProperty());
template&lt;typename InputIterator, typename EdgePropertyIterator&gt;
<a href="#edge-prop-const">compressed_sparse_row_graph</a>(edges_are_unsorted_t,
InputIterator edge_begin, InputIterator edge_end,
EdgePropertyIterator ep_iter,
vertices_size_type numverts,
const GraphProperty&amp; prop = GraphProperty());
template&lt;typename MultiPassInputIterator&gt;
<a href="#edge-multi-const">compressed_sparse_row_graph</a>(edges_are_unsorted_multi_pass_t,
MultiPassInputIterator edge_begin, MultiPassInputIterator edge_end,
vertices_size_type numverts,
const GraphProperty&amp; prop = GraphProperty());
template&lt;typename MultiPassInputIterator, typename EdgePropertyIterator&gt;
<a href="#edge-multi-prop-const">compressed_sparse_row_graph</a>(edges_are_unsorted_multi_pass_t,
MultiPassInputIterator edge_begin, MultiPassInputIterator edge_end,
EdgePropertyIterator ep_iter,
vertices_size_type numverts,
const GraphProperty&amp; prop = GraphProperty());
<i>// New sorted edge list constructors <b>(directed only)</b></i>
template&lt;typename InputIterator&gt;
<a href="#edge-sorted-const">compressed_sparse_row_graph</a>(edges_are_sorted_t,
InputIterator edge_begin, InputIterator edge_end,
vertices_size_type numverts,
edges_size_type numedges = 0,
const GraphProperty&amp; prop = GraphProperty());
template&lt;typename InputIterator, typename EdgePropertyIterator&gt;
<a href="#edge-sorted-prop-const">compressed_sparse_row_graph</a>(edges_are_sorted_t,
InputIterator edge_begin, InputIterator edge_end,
EdgePropertyIterator ep_iter,
vertices_size_type numverts,
edges_size_type numedges = 0,
const GraphProperty&amp; prop = GraphProperty());
<i>// In-place unsorted edge list constructors <b>(directed only)</b></i>
template&lt;typename InputIterator&gt;
<a href="#edge-inplace-const">compressed_sparse_row_graph</a>(construct_inplace_from_sources_and_targets_t,
std::vector&lt;vertex_descriptor&gt;&amp; sources,
std::vector&lt;vertex_descriptor&gt;&amp; targets,
vertices_size_type numverts,
const GraphProperty&amp; prop = GraphProperty());
template&lt;typename InputIterator&gt;
<a href="#edge-inplace-prop-const">compressed_sparse_row_graph</a>(construct_inplace_from_sources_and_targets_t,
std::vector&lt;vertex_descriptor&gt;&amp; sources,
std::vector&lt;vertex_descriptor&gt;&amp; targets,
std::vector&lt;EdgeProperty&gt;&amp; edge_props,
vertices_size_type numverts,
const GraphProperty&amp; prop = GraphProperty());
<i>// Miscellaneous constructors <b>(directed only)</b></i>
template&lt;typename Graph, typename VertexIndexMap&gt;
<a href="#graph-const">compressed_sparse_row_graph</a>(const Graph&amp; g, const VertexIndexMap&amp; vi,
vertices_size_type numverts,
edges_size_type numedges);
template&lt;typename Graph, typename VertexIndexMap&gt;
compressed_sparse_row_graph(const Graph&amp; g, const VertexIndexMap&amp; vi);
template&lt;typename Graph&gt;
explicit <a href="#graph-const">compressed_sparse_row_graph</a>(const Graph&amp; g);
<i>// <a href="#mutators">Graph mutators <b>(directed only)</b></a></i>
template&lt;typename Graph, typename VertexIndexMap&gt;
void <a href="#assign">assign</a>(const Graph&amp; g, const VertexIndexMap&amp; vi,
vertices_size_type numverts, edges_size_type numedges);
template&lt;typename Graph, typename VertexIndexMap&gt;
void <a href="#assign">assign</a>(const Graph&amp; g, const VertexIndexMap&amp; vi);
template&lt;typename Graph&gt;
void <a href="#assign">assign</a>(const Graph&amp; g);
<i>// <a href="#property-access">Property Access</a></i>
VertexProperty&amp; <a href="#vertex-subscript">operator[]</a>(vertex_descriptor v);
const VertexProperty&amp; <a href="#vertex-subscript">operator[]</a>(vertex_descriptor v) const;
EdgeProperty&amp; <a href="#edge-subscript">operator[]</a>(edge_descriptor v);
const EdgeProperty&amp; <a href="#edge-subscript">operator[]</a>(edge_descriptor v) const;
};
<i>// <a href="IncidenceGraph.html">Incidence Graph requirements</a></i>
vertex_descriptor source(edge_descriptor, const compressed_sparse_row_graph&amp;);
vertex_descriptor target(edge_descriptor, const compressed_sparse_row_graph&amp;);
std::pair&lt;out_edge_iterator, out_edge_iterator&gt;
out_edges(vertex_descriptor, const compressed_sparse_row_graph&amp;);
degree_size_type out_degree(vertex_descriptor v, const compressed_sparse_row_graph&amp;);
<i>// <a href="BidirectionalGraph.html">Bidirectional Graph requirements <b>(bidirectional only)</b></a></i>
std::pair&lt;in_edge_iterator, in_edge_iterator&gt;
in_edges(vertex_descriptor, const compressed_sparse_row_graph&amp;);
degree_size_type in_degree(vertex_descriptor v, const compressed_sparse_row_graph&amp;);
<i>// <a href="AdjacencyGraph.html">Adjacency Graph requirements</a></i>
std::pair&lt;adjacency_iterator, adjacency_iterator&gt;
adjacent_vertices(vertex_descriptor, const compressed_sparse_row_graph&amp;);
<i>// <a href="VertexListGraph.html">Vertex List Graph requirements</a></i>
std::pair&lt;vertex_iterator, vertex_iterator&gt; vertices(const compressed_sparse_row_graph&amp;);
vertices_size_type num_vertices(const compressed_sparse_row_graph&amp;);
<i>// <a href="EdgeListGraph.html">Edge List Graph requirements</a></i>
std::pair&lt;edge_iterator, edge_iterator&gt; edges(const compressed_sparse_row_graph&amp;);
edges_size_type num_edges(const compressed_sparse_row_graph&amp;);
<i>// <a href="#vertex-access">Vertex access</a></i>
vertex_descriptor <a href="#vertex-lookup">vertex</a>(vertices_size_type i, const compressed_sparse_row_graph&amp;);
<i>// <a href="#edge-access">Edge access</a></i>
std::pair&lt;edge_descriptor, bool&gt;
<a href="#edge">edge</a>(vertex_descriptor u, vertex_descriptor v, const compressed_sparse_row_graph&amp;);
edge_descriptor <a href="#edge_from_index">edge_from_index</a>(edges_size_type i, const compressed_sparse_row_graph&amp;);
<i>// <a href="#property-map-accessors">Property map accessors</a></i>
template&lt;typename <a href="./PropertyTag.html">PropertyTag</a>&gt;
property_map&lt;compressed_sparse_row_graph, PropertyTag&gt;::type
<a href="#get">get</a>(PropertyTag, compressed_sparse_row_graph&amp; g)
template&lt;typename <a href="./PropertyTag.html">PropertyTag</a>&gt;
property_map&lt;compressed_sparse_row_graph, Tag&gt;::const_type
<a href="#get">get</a>(PropertyTag, const compressed_sparse_row_graph&amp; g)
template&lt;typename <a href="./PropertyTag.html">PropertyTag</a>, class X&gt;
typename property_traits&lt;property_map&lt;compressed_sparse_row_graph, PropertyTag&gt;::const_type&gt;::value_type
<a href="#get-x">get</a>(PropertyTag, const compressed_sparse_row_graph&amp; g, X x)
template&lt;typename <a href="./PropertyTag.html">PropertyTag</a>, class X, class Value&gt;
void <a href="#put-x">put</a>(PropertyTag, const compressed_sparse_row_graph&amp; g, X x, const Value&amp; value);
template&lt;typename <a href="./PropertyTag.html#GraphPropertyTag">GraphPropertyTag</a>&gt;
typename graph_property&lt;compressed_sparse_row_graph, GraphPropertyTag&gt;::type&amp;
<a href="#get_property">get_property</a>(compressed_sparse_row_graph&amp; g, GraphPropertyTag);
template&lt;typename <a href="./PropertyTag.html#GraphPropertyTag">GraphPropertyTag</a>&gt;
typename graph_property&lt;compressed_sparse_row_graph, GraphPropertyTag&gt;::type const &amp;
<a href="#get_property">get_property</a>(const compressed_sparse_row_graph&amp; g, GraphPropertyTag);
template&lt;typename <a href="./PropertyTag.html#GraphPropertyTag">GraphPropertyTag</a>&gt;
void <a href="#set_property">set_property</a>(const compressed_sparse_row_graph&amp; g, GraphPropertyTag,
const typename graph_property&lt;compressed_sparse_row_graph, GraphPropertyTag&gt;::type&amp; value);
<i>// <a href="#incremental-construction-functions">Incremental construction functions</a></i>
<b>(directed only)</b>
template&lt;typename InputIterator, typename Graph&gt;
void <a href="#add_edges">add_edges</a>(InputIterator first, InputIterator last, compressed_sparse_row_graph&amp; g);
<b>(directed only)</b>
template&lt;typename InputIterator, typename EPIter, typename Graph&gt;
void <a href="#add_edges_prop">add_edges</a>(InputIterator first, InputIterator last, EPIter ep_first, EPIter ep_last, compressed_sparse_row_graph&amp; g);
<b>(directed only)</b>
template&lt;typename BidirectionalIterator, typename Graph&gt;
void <a href="#add_edges_sorted">add_edges_sorted</a>(BidirectionalIterator first, BidirectionalIterator last, compressed_sparse_row_graph&amp; g);
<b>(directed only)</b>
template&lt;typename BidirectionalIterator, typename EPIter, typename Graph&gt;
void <a href="#add_edges_sorted_prop">add_edges_sorted</a>(BidirectionalIterator first, BidirectionalIterator last, EPIter ep_iter, compressed_sparse_row_graph&amp; g);
} <i>// end namespace boost</i>
</pre>
<a name="where"></a><h2>Where Defined</h2>
<p><code>&lt;<a href="../../../boost/graph/compressed_sparse_row_graph.hpp">boost/graph/compressed_sparse_row_graph.hpp</a>&gt;</code></p>
<a name="models"></a><h2>Models</h2>
<p>The <tt>compressed_sparse_row_graph</tt> class template models
(i.e., implements the requirements of) many of the
BGL <a href="graph_concepts.html">graph concepts</a>, allowing it
to be used with most of the BGL algorithms. In particular, it
models the following specific graph concepts:</p>
<ul>
<li><a href="Graph.html">Graph</a></li>
<li><a href="IncidenceGraph.html">IncidenceGraph</a></li>
<li><a href="AdjacencyGraph.html">AdjacencyGraph</a></li>
<li><a href="VertexListGraph.html">VertexListGraph</a></li>
<li><a href="EdgeListGraph.html">EdgeListGraph</a></li>
<li><a href="PropertyGraph.html">PropertyGraph</a></li>
</ul>
<a name="template-parms"></a><h2>Template Parameters</h2>
<p>The <tt>compressed_sparse_row_graph</tt> class has several
template parameters that can customize the layout in memory and
what properties are attached to the graph itself. All
parameters have defaults, so users interested only in the
structure of a graph can use the
type <tt>compressed_sparse_row_graph&lt;&gt;</tt> and ignore
the parameters.</p>
<b>Parameters</b>
<br>
<br>
<a name="Directed"></a><code>Directed</code>
<blockquote>
A selector that determines whether the graph will be directed,
bidirectional or undirected. At this time, the CSR graph type
only supports directed and bidirectional graphs, so this value must
be either <code>boost::directedS</code> or
<code>boost::bidirectionalS</code>.<br>
<b>Default</b>: <code>boost::directedS</code>
</blockquote>
<a name="VertexProperty"></a><code>VertexProperty</code>
<blockquote>
A class type that will be
attached to each vertex in the graph. If this value
is <code>void</code>, no properties will be attached to
the vertices of the graph.<br>
<b>Default</b>: <code>void</code>
</blockquote>
<a name="EdgeProperty"></a><code>EdgeProperty</code>
<blockquote>
A class type that will be attached to each edge in the graph. If
this value is <code>void</code>, no properties will be
attached to the edges of the graph.<br>
<b>Default</b>: <code>void</code>
</blockquote>
<a name="GraphProperty"></a><code>GraphProperty</code>
<blockquote>
A nested set
of <code>property</code> templates that describe the
properties of the graph itself. If this value
is <code>no_property</code>, no properties will be attached to
the graph.<br>
<b>Default</b>: <code>no_property</code>
</blockquote>
<a name="Vertex"></a><code>Vertex</code>
<blockquote>
An unsigned integral type that will be
used as both the index into the array of vertices and as the
vertex descriptor itself. Larger types permit the CSR graph to
store more vertices; smaller types reduce the storage required
per vertex.<br>
<b>Default</b>: <code>std::size_t</code>
</blockquote>
<a name="EdgeIndex"></a><code>EdgeIndex</code>
<blockquote>
An unsigned integral type that will be used as the index into
the array of edges. As with the <code>Vertex</code> parameter,
larger types permit more edges whereas smaller types reduce
the amount of storage needed per
edge. The <code>EdgeIndex</code> type shall not be smaller
than the <code>Vertex</code> type, but it may be larger. For
instance, <code>Vertex</code> may be a 16-bit integer
(allowing 32,767 vertices in the graph)
whereas <code>EdgeIndex</code> could then be a 32-bit integer
to allow a complete graph to be stored in the CSR format.<br>
<b>Default</b>: <code>Vertex</code>
</blockquote>
<a name="properties"></a><h2>Interior Properties</h2>
<p> The <tt>compressed_sparse_row_graph</tt> allows properties to
be attached to its vertices, edges, or to the graph itself by way
of its <a href="#template-parms">template parameters</a>. These
properties may be accessed via
the <a href="#property-access">member</a>
and <a href="#property-map-accessors">non-member</a> property
access functions, using the <a href="bundles.html">bundled
properties</a> scheme.</p>
<p>The CSR graph provides two kinds of built-in
properties: <tt>vertex_index</tt>, which maps from vertices to
values in <tt>[0, n)</tt> and <tt>edge_index</tt>, which maps
from edges to values in <tt>[0, m)</tt>, where <tt>n</tt>
and <tt>m</tt> are the number of vertices and edges in the graph,
respectively. </p>
<a name="member-functions"></a><h2>Member Functions</h2>
<a name="constructors"></a><h3>Constructors</h3>
<pre><a name="default-const"></a>
compressed_sparse_row_graph();
</pre>
<p class="indent">Constructs a graph with no vertices or edges.</p>
<hr></hr>
<pre><a name="edge-const"></a>
template&lt;typename InputIterator&gt;
compressed_sparse_row_graph(edges_are_unsorted_t,
InputIterator edge_begin, InputIterator edge_end,
vertices_size_type numverts,
const GraphProperty&amp; prop = GraphProperty());
</pre>
<p class="indent">
Constructs a graph with <code>numverts</code> vertices whose
edges are specified by the iterator range <code>[edge_begin,
edge_end)</code>. The <tt>InputIterator</tt> must be a model of
<a
href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
whose <code>value_type</code> is an <code>std::pair</code> of
integer values. These integer values are the source and target
vertices for the edges, and must fall within the range <code>[0,
numverts)</code>. The edges in <code>[edge_begin,
edge_end)</code> do not need to be sorted. This constructor uses extra
memory to save the edge information before adding it to the graph,
avoiding the requirement for the iterator to have multi-pass capability.
</p>
<p class="indent">
The value <code>prop</code> will be used to initialize the graph
property.
</p>
<hr></hr>
<pre><a name="edge-prop-const"></a>
template&lt;typename InputIterator, typename EdgePropertyIterator&gt;
compressed_sparse_row_graph(edges_are_unsorted_t,
InputIterator edge_begin, InputIterator edge_end,
EdgePropertyIterator ep_iter,
vertices_size_type numverts,
const GraphProperty&amp; prop = GraphProperty());
</pre>
<p class="indent">
This constructor constructs a graph with <code>numverts</code>
vertices and the edges provided in the iterator range
<code>[edge_begin, edge_end)</code>. Its semantics are identical
to the <a href="#edge-const">edge range constructor</a>, except
that edge properties are also initialized. The type
<tt>EdgePropertyIterator</tt> must be a model of the <a
href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
concept whose <tt>value_type</tt> is convertible to
<tt>EdgeProperty</tt>. The iterator range <tt>[ep_iter, ep_ter +
m)</tt> will be used to initialize the properties on the edges
of the graph, where <tt>m</tt> is distance from
<tt>edge_begin</tt> to <tt>edge_end</tt>. This constructor uses extra
memory to save the edge information before adding it to the graph,
avoiding the requirement for the iterator to have multi-pass capability.
</p>
<hr></hr>
<pre><a name="edge-multi-const"></a>
template&lt;typename MultiPassInputIterator&gt;
compressed_sparse_row_graph(edges_are_unsorted_multi_pass_t,
MultiPassInputIterator edge_begin, MultiPassInputIterator edge_end,
vertices_size_type numverts,
const GraphProperty&amp; prop = GraphProperty());
</pre>
<p class="indent">
Constructs a graph with <code>numverts</code> vertices whose
edges are specified by the iterator range <code>[edge_begin,
edge_end)</code>. The <tt>MultiPassInputIterator</tt> must be a model of
<a
href="../../utility/MultiPassInputIterator.html">MultiPassInputIterator</a>
whose <code>value_type</code> is an <code>std::pair</code> of
integer values. These integer values are the source and target
vertices for the edges, and must fall within the range <code>[0,
numverts)</code>. The edges in <code>[edge_begin,
edge_end)</code> do not need to be sorted. Multiple passes will be made
over the edge range.
</p>
<p class="indent">
The value <code>prop</code> will be used to initialize the graph
property.
</p>
<hr></hr>
<pre><a name="edge-multi-prop-const"></a>
template&lt;typename MultiPassInputIterator, typename EdgePropertyIterator&gt;
compressed_sparse_row_graph(edges_are_unsorted_multi_pass_t,
MultiPassInputIterator edge_begin, MultiPassInputIterator edge_end,
EdgePropertyIterator ep_iter,
vertices_size_type numverts,
const GraphProperty&amp; prop = GraphProperty());
</pre>
<p class="indent">
This constructor constructs a graph with <code>numverts</code>
vertices and the edges provided in the iterator range
<code>[edge_begin, edge_end)</code>. Its semantics are identical
to the <a href="#edge-const">edge range constructor</a>, except
that edge properties are also initialized. The type
<tt>EdgePropertyIterator</tt> must be a model of the <a
href="../../utility/MultiPassInputIterator.html">MultiPassInputIterator</a>
concept whose <tt>value_type</tt> is convertible to
<tt>EdgeProperty</tt>. The iterator range <tt>[ep_iter, ep_ter +
m)</tt> will be used to initialize the properties on the edges
of the graph, where <tt>m</tt> is distance from
<tt>edge_begin</tt> to <tt>edge_end</tt>. Multiple passes will be made
over the edge and property ranges.
</p>
<hr></hr>
<pre><a name="edge-sorted-const"></a>
template&lt;typename InputIterator&gt;
compressed_sparse_row_graph(edges_are_sorted_t,
InputIterator edge_begin, InputIterator edge_end,
vertices_size_type numverts,
edges_size_type numedges = 0,
const GraphProperty&amp; prop = GraphProperty());
</pre>
<p class="indent">
Constructs a graph with <code>numverts</code> vertices whose
edges are specified by the iterator range <code>[edge_begin,
edge_end)</code>. The argument of type <code>edges_are_sorted_t</code> is
a tag used to distinguish this constructor; the value
<code>edges_are_sorted</code> can be used to initialize this parameter.
The <tt>InputIterator</tt> must be a model of
<a
href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
whose <code>value_type</code> is an <code>std::pair</code> of
integer values. These integer values are the source and target
vertices for the edges, and must fall within the range <code>[0,
numverts)</code>. The edges in <code>[edge_begin,
edge_end)</code> must be sorted so that all edges originating
from vertex <i>i</i> preceed any edges originating from all
vertices <i>j</i> where <i>j &gt; i</i>.
</p>
<p class="indent">
The value <code>numedges</code>, if provided, tells how many
edges are in the range <code>[edge_begin, edge_end)</code> and
will be used to preallocate data structures to save both memory
and time during construction.
</p>
<p class="indent">
The value <code>prop</code> will be used to initialize the graph
property.
</p>
<hr></hr>
<pre><a name="edge-sorted-prop-const"></a>
template&lt;typename InputIterator, typename EdgePropertyIterator&gt;
compressed_sparse_row_graph(edges_are_sorted_t,
InputIterator edge_begin, InputIterator edge_end,
EdgePropertyIterator ep_iter,
vertices_size_type numverts,
edges_size_type numedges = 0,
const GraphProperty&amp; prop = GraphProperty());
</pre>
<p class="indent">
This constructor constructs a graph with <code>numverts</code>
vertices and the edges provided in the iterator range
<code>[edge_begin, edge_end)</code>. Its semantics are identical
to the <a href="#edge-const">edge range constructor</a>, except
that edge properties are also initialized. The type
<tt>EdgePropertyIterator</tt> must be a model of the <a
href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
concept whose <tt>value_type</tt> is convertible to
<tt>EdgeProperty</tt>. The iterator range <tt>[ep_iter, ep_ter +
m)</tt> will be used to initialize the properties on the edges
of the graph, where <tt>m</tt> is distance from
<tt>edge_begin</tt> to <tt>edge_end</tt>.
</p>
<hr></hr>
<pre><a name="edge-inplace-const"></a>
template&lt;typename InputIterator&gt;
compressed_sparse_row_graph(construct_inplace_from_sources_and_targets_t,
std::vector&lt;vertex_descriptor&gt;&amp; sources,
std::vector&lt;vertex_descriptor&gt;&amp; targets,
vertices_size_type numverts,
const GraphProperty&amp; prop = GraphProperty());
</pre>
<p class="indent">
This constructor constructs a graph with <code>numverts</code> vertices
and the edges provided in the two vectors <code>sources</code> and
<code>targets</code>. The two vectors are mutated in-place to sort them
by source vertex. They are returned with unspecified values, but do not
share storage with the constructed graph (and so are safe to destroy).
The parameter <code>prop</code>, if provided, is used to initialize the
graph property.
</p>
<hr></hr>
<pre><a name="edge-inplace-prop-const"></a>
template&lt;typename InputIterator&gt;
compressed_sparse_row_graph(construct_inplace_from_sources_and_targets_t,
std::vector&lt;vertex_descriptor&gt;&amp; sources,
std::vector&lt;vertex_descriptor&gt;&amp; targets,
std::vector&lt;EdgeProperty&gt;&amp; edge_props,
vertices_size_type numverts,
const GraphProperty&amp; prop = GraphProperty());
</pre>
<p class="indent">
This constructor constructs a graph with <code>numverts</code> vertices
and the edges provided in the two vectors <code>sources</code> and
<code>targets</code>. Edge properties are initialized from the vector
<code>edge_props</code>. The three vectors are mutated in-place to sort
them by source vertex. They are returned with unspecified values, but do
not share storage with the constructed graph (and so are safe to
destroy). The parameter <code>prop</code>, if provided, is used to
initialize the graph property.
</p>
<hr></hr>
<pre><a name="graph-const"></a>
template&lt;typename Graph, typename VertexIndexMap&gt;
compressed_sparse_row_graph(const Graph&amp; g, const VertexIndexMap&amp; vi,
vertices_size_type numverts,
edges_size_type numedges);
template&lt;typename Graph, typename VertexIndexMap&gt;
compressed_sparse_row_graph(const Graph&amp; g, const VertexIndexMap&amp; vi);
template&lt;typename Graph&gt;
explicit compressed_sparse_row_graph(const Graph&amp; g);
</pre>
<p class="indent">
Calls the <a href="#assign"><tt>assign</tt></a> function with
all of the arguments it is given.
</p>
<hr></hr>
<a name="mutators"></a><h3>Mutators</h3>
<pre><a name="assign"></a>
template&lt;typename Graph, typename VertexIndexMap&gt;
void assign(const Graph&amp; g, const VertexIndexMap&amp; vi,
vertices_size_type numverts, edges_size_type numedges);
template&lt;typename Graph, typename VertexIndexMap&gt;
void assign(const Graph&amp; g, const VertexIndexMap&amp; vi);
template&lt;typename Graph&gt;
void assign(const Graph&amp; g);
</pre>
<p class="indent">
Clears the CSR graph and builds a CSR graph in place from the
structure of another graph. The graph type <tt>Graph</tt> must
be a model of <a href="IncidenceGraph.html">IncidenceGraph</a>.
<br><b>Parameters</b>
<ul>
<li><tt>g</tt>: The incoming graph.</li>
<li><tt>vi</tt>: A map from vertices to indices. If not
provided, <tt>get(vertex_index, g)</tt> will be used.</li>
<li><tt>numverts</tt>: The number of vertices in the graph
<tt>g</tt>. If not provided, <tt>Graph</tt> must be a model of
<a href="VertexListGraph.html">VertexListGraph</a>.</li>
<li><tt>numedges</tt>: The number of edges in the graph
<tt>g</tt>. If not provided, <tt>Graph</tt> must be a model of
<a href="EdgeListGraph.html">EdgeListGraph</a>.</li>
</ul>
</p>
<hr></hr>
<a name="property-access"></a><h3>Property Access</h3>
<pre><a name="vertex-subscript"></a>
VertexProperty&amp; operator[](vertex_descriptor v);
const VertexProperty&amp; operator[](vertex_descriptor v) const;
</pre>
<p class="indent">
Retrieves the property value associated with vertex
<tt>v</tt>. Only valid when <tt>VertexProperty</tt> is a class
type that is not <tt>no_property</tt>.
</p>
<hr></hr>
<pre><a name="edge-subscript">
EdgeProperty&amp; operator[](edge_descriptor v);
const EdgeProperty&amp; operator[](edge_descriptor v) const;
</pre>
<p class="indent">
Retrieves the property value associated with edge
<tt>v</tt>. Only valid when <tt>EdgeProperty</tt> is a class
type that is not <tt>no_property</tt>.
</p>
<hr></hr>
<a name="non-members"></a><h2>Non-member Functions</h2>
<a name="vertex-access"></a><h3>Vertex access</h3>
<pre><a name="vertex-lookup"></a>
vertex_descriptor vertex(vertices_size_type i, const compressed_sparse_row_graph&amp;);
</pre>
<p class="indent">
Retrieves the <i>i</i><sup>th</sup> vertex in the graph in
constant time.
</p>
<hr></hr>
<a name="edge-access"></a><h3>Edge access</h3>
<pre><a name="edge"></a>
std::pair&lt;edge_descriptor, bool&gt;
edge(vertex_descriptor u, vertex_descriptor v, const compressed_sparse_row_graph&amp;);
</pre>
<p class="indent">
If there exists an edge <i>(u, v)</i> in the graph, returns the
descriptor for that edge and <tt>true</tt>; otherwise, the
second value in the pair will be <tt>false</tt>. If multiple
edges exist from <tt>u</tt> to <tt>v</tt>, the first edge will
be returned; use <a href="IncidenceGraph.html"><tt>out_edges</tt></a> and a
conditional statement
to retrieve all edges to a given target. This function requires linear
time in the
number of edges outgoing from <tt>u</tt>.
</p>
<hr></hr>
<pre><a name="edge_from_index"></a>
edge_descriptor edge_from_index(edges_size_type i, const compressed_sparse_row_graph&amp;);
</pre>
<p class="indent">
Returns the <i>i</i><sup>th</sup> edge in the graph. This
operation requires logarithmic time in the number of vertices.
</p>
<hr></hr>
<h3><a name="property-map-accessors">Property Map Accessors</a></h3>
<pre><a name="get"></a>
template&lt;typename <a href="./PropertyTag.html">PropertyTag</a>&gt;
property_map&lt;compressed_sparse_row_graph, PropertyTag&gt;::type
get(PropertyTag, compressed_sparse_row_graph&amp; g)
template&lt;typename <a href="./PropertyTag.html">PropertyTag</a>&gt;
property_map&lt;compressed_sparse_row_graph, Tag&gt;::const_type
get(PropertyTag, const compressed_sparse_row_graph&amp; g)
</pre>
<p class="indent">
Returns the property map object for the vertex property
specified by <TT>PropertyTag</TT>. The <TT>PropertyTag</TT> must
be a member pointer to access one of the fields in
<tt>VertexProperty</tt> or <tt>EdgeProperty</tt>.
</p>
<hr></hr>
<pre><a name="get-x"></a>
template&lt;typename <a href="./PropertyTag.html">PropertyTag</a>, class X&gt;
typename property_traits&lt;property_map&lt;compressed_sparse_row_graph, PropertyTag&gt;::const_type&gt::value_type
get(PropertyTag, const compressed_sparse_row_graph&amp; g, X x)
</pre>
<p class="indent">
This returns the property value for <tt>x</tt>, where <tt>x</tt>
is either a vertex or edge descriptor.
</p>
<hr></hr>
<pre><a name="put-x"></a>
template&lt;typename <a href="./PropertyTag.html">PropertyTag</a>, class X, class Value&gt;
void put(PropertyTag, const compressed_sparse_row_graph&amp; g, X x, const Value&amp; value);
</pre>
<p class="indent">
This sets the property value for <tt>x</tt> to
<tt>value</tt>. <tt>x</tt> is either a vertex or edge
descriptor. <tt>Value</tt> must be convertible to <tt>typename
property_traits&lt;property_map&lt;compressed_sparse_row_graph,
PropertyTag&gt;::type&gt::value_type</tt>
</p>
<hr></hr>
<pre><a name="get_property"></a>
template&lt;typename <a href="./PropertyTag.html#GraphPropertyTag">GraphPropertyTag</a>&gt;
typename graph_property&lt;compressed_sparse_row_graph, GraphPropertyTag&gt;::type&amp;
get_property(compressed_sparse_row_graph&amp; g, GraphPropertyTag);
template&lt;typename <a href="./PropertyTag.html#GraphPropertyTag">GraphPropertyTag</a>&gt;
typename graph_property&lt;compressed_sparse_row_graph, GraphPropertyTag&gt;::type const &amp;
get_property(const compressed_sparse_row_graph&amp; g, GraphPropertyTag);
</pre>
<p class="indent">
Return the property specified by <tt>GraphPropertyTag</tt> that
is attached to the graph object <tt>g</tt>.
</p>
<hr></hr>
<pre><a name="set_property"></a>
template&lt;typename <a href="./PropertyTag.html#GraphPropertyTag">GraphPropertyTag</a>&gt;
void set_property(const compressed_sparse_row_graph&amp; g, GraphPropertyTag,
const typename graph_property&lt;compressed_sparse_row_graph, GraphPropertyTag&gt;::type&amp; value);
</pre>
<p class="indent">
Set the property specified by <tt>GraphPropertyTag</tt> that
is attached to the graph object <tt>g</tt>.
</p>
<hr></hr>
<h3><a name="incremental-construction-functions">Incremental construction functions</a></h3>
<pre><a name="add_edges"></a>
template&lt;typename InputIterator&gt;
void add_edges(InputIterator first, InputIterator last, compressed_sparse_row_graph&amp; g)
</pre>
<p class="indent">
Add a range of edges (from <tt>first</tt> to <tt>last</tt>) to the graph.
The <tt>InputIterator</tt> must be a model of <a
href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
whose <code>value_type</code> is an <code>std::pair</code> of integer
values. These integer values are the source and target vertices of the
new edges. The edges do not need to be sorted.
</p>
<hr></hr>
<pre><a name="add_edges_prop"></a>
template&lt;typename InputIterator, typename EPIter&gt;
void add_edges(InputIterator first, InputIterator last, EPIter ep_first, EPIter ep_last, compressed_sparse_row_graph&amp; g)
</pre>
<p class="indent">
Add a range of edges (from <tt>first</tt> to <tt>last</tt>) with
corresponding edge properties (from <tt>ep_first</tt> to
<tt>ep_last</tt>) to the graph. The <tt>InputIterator</tt> and
<tt>EPIter</tt> must be models of <a
href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>;
the <code>value_type</code> of <tt>InputIterator</tt> must be an
<code>std::pair</code> of integer values, and the <code>value_type</code>
of <tt>EPIter</tt> must be the edge property type of the graph. The
integer values produced by the <tt>InputIterator</tt> are the source and
target vertices of the new edges. The edges do not need to be sorted.
</p>
<hr></hr>
<pre><a name="add_edges_sorted"></a>
template&lt;typename BidirectionalIterator&gt;
void add_edges_sorted(BidirectionalIterator first, BidirectionalIterator last, compressed_sparse_row_graph&amp; g)
</pre>
<p class="indent">
Add a range of edges (from <tt>first</tt> to <tt>last</tt>) to the graph.
The <tt>BidirectionalIterator</tt> must be a model of <a
href="http://www.sgi.com/tech/stl/BidirectionalIterator.html">BidirectionalIterator</a>
whose <code>value_type</code> is an <code>std::pair</code> of integer
values. These integer values are the source and target vertices of the
new edges. The edges must be sorted in increasing order by source vertex
index.
</p>
<hr></hr>
<pre><a name="add_edges_sorted_prop"></a>
template&lt;typename BidirectionalIterator, typename EPIter&gt;
void add_edges_sorted(BidirectionalIterator first, BidirectionalIterator last, EPIter ep_iter, compressed_sparse_row_graph&amp; g)
</pre>
<p class="indent">
Add a range of edges (from <tt>first</tt> to <tt>last</tt>) to the graph.
The <tt>BidirectionalIterator</tt> and <tt>EPIter</tt> must be models of
<a
href="http://www.sgi.com/tech/stl/BidirectionalIterator.html">BidirectionalIterator</a>.
The <code>value_type</code> of the <tt>BidirectionalIterator</tt> must be
an <code>std::pair</code> of integer
values. These integer values are the source and target vertices of the
new edges.
The <code>value_type</code> of the <tt>EPIter</tt> must be the edge
property type of the graph.
The edges must be sorted in increasing order by source vertex
index.
</p>
<hr></hr>
<a name="example"></a><h2>Example</h2>
<br>[<a
href="../example/csr-example.cpp">libs/graph/example/csr-example.cpp</a>]
<p>We will use the <tt>compressed_sparse_row_graph</tt> graph
class to store a simple Web graph. In this web graph the vertices
represent web pages and the edges represent links from one web
page to another. With each web page we want to associate a URL, so
we initially create a <tt>WebPage</tt> class that stores the
URL. Then we can create our graph type by providing
<tt>WebPage</tt> as a parameter to the
<tt>compressed_sparse_row_graph</tt> class template.</p>
<pre>
class WebPage
{
public:
std::string url;
};
// ...
typedef compressed_sparse_row_graph&lt;directedS, WebPage&gt; WebGraph;
WebGraph g(&the_edges[0], &the_edges[0] + sizeof(the_edges)/sizeof(E), 6);
</pre>
<p>We can then set the properties on the vertices of the graph
using the <a href="bundles.html">bundled properties</a> syntax,
and display the edges for the user.</p>
<pre>
// Set the URLs of each vertex
int index = 0;
BGL_FORALL_VERTICES(v, g, WebGraph)
g[v].url = urls[index++];
// Output each of the links
std::cout &lt;&lt; "The web graph:" &lt;&lt; std::endl;
BGL_FORALL_EDGES(e, g, WebGraph)
std::cout &lt;&lt; " " &lt;&lt; g[source(e, g)].url &lt;&lt; " -> " &lt;&lt; g[target(e, g)].url
&lt;&lt; std::endl;
</pre>
<p>See the <a href="../example/csr-example.cpp">complete example
source</a> for other operations one can perform with a
<tt>compressed_sparse_row_graph</tt>.</p>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
Jeremiah Willcock, Indiana University (<script language="Javascript">address("osl.iu.edu", "jewillco")</script>)<br>
<A HREF="http://www.osl.iu.edu/~lums">Andrew Lumsdaine</A>,
Indiana University (<script language="Javascript">address("osl.iu.edu", "lums")</script>)
</TD></TR></TABLE>
</body>
</html>
-157
View File
@@ -1,157 +0,0 @@
<HTML>
<!--
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="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<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 &lt;class VertexListGraph, class ComponentMap, class P, class T, class R&gt;
typename property_traits&lt;ComponentMap&gt;::value_type
connected_components(VertexListGraph&amp; G, ComponentMap comp,
const bgl_named_params&lt;P, T, R&gt;&amp; params = <i>all defaults</i>);
<i>// there is not a non-named parameter version of this function</i>
</PRE>
<P>
The <TT>connected_components()</TT> functions compute the connected
components of an undirected graph using a DFS-based approach. A
<b><I>connected component</I></b> of an undirected graph is a set of
vertices that are all reachable from each other. If the connected
components need to be maintained while a graph is growing the
disjoint-set based approach of function <a
href="./incremental_components.html">
<TT>incremental_components()</TT></a> is faster. For ``static'' graphs
this DFS-based approach is faster&nbsp;[<A
HREF="bibliography.html#clr90">8</A>].
<P>
The output of the algorithm is recorded in the component property map
<TT>comp</TT>, which will contain numbers giving the component number
assigned to each vertex. The total number of components is the return
value of the function.
<H3>Where Defined</H3>
<P>
<a href="../../../boost/graph/connected_components.hpp"><TT>boost/graph/connected_components.hpp</TT></a>
<h3>Parameters</h3>
IN: <tt>const Graph&amp; 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 connected components are in the graph,
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/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.<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>
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/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/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>
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 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/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>
<H3>Complexity</H3>
<P>
The time complexity for the connected components algorithm is also
<i>O(V + E)</i>.
<P>
<h3>See Also</h3>
<a href="./strong_components.html"><tt>strong_components()</tt></a>
and <a href="./incremental_components.html"><tt>incremental_components()</tt></a>
<H3>Example</H3>
<P>
The file <a
href="../example/connected_components.cpp"><tt>examples/connected_components.cpp</tt></a>
contains an example of calculating the connected components of an
undirected graph.
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-183
View File
@@ -1,183 +0,0 @@
<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: Constructing Graph Algorithms</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>Constructing graph algorithms with BGL</H1>
<P>
The <I>main</I> goal of BGL is not to provide a nice graph class, or
to provide a comprehensive set of reusable graph algorithms (though
these are goals). The main goal of BGL is to encourage others to
write reusable graph algorithms. By reusable we mean maximally
reusable. Generic programming is a methodology for making algorithms
maximally reusable, and in this section we will discuss how to apply
generic programming to constructing graph algorithms.
<P>
To illustrate the generic programming process we will step though the
construction of a graph coloring algorithm. The graph coloring problem
(or more specifically, the vertex coloring problem) is to label each
vertex in a graph <i>G</i> with a color such that no two adjacent
vertices are labeled with the same color and such that the minimum
number of colors are used. In general, the graph coloring problem is
NP-complete, and therefore it is impossible to find an optimal
solution in a reasonable amount of time. However, there are many
algorithms that use heuristics to find colorings that are close to the
minimum.
<P>
The particular algorithm we present here is based on the linear time
<TT>SEQ</TT> subroutine that is used in the estimation of sparse
Jacobian and Hessian matrices&nbsp;[<A
HREF="bibliography.html#curtis74:_jacob">9</A>,<A
HREF="bibliography.html#coleman84:_estim_jacob">7</A>,<A
HREF="bibliography.html#coleman85:_algor">6</A>]. This algorithm
visits all of the vertices in the graph according to the order defined
by the input order. At each vertex the algorithm marks the colors of
the adjacent vertices, and then chooses the smallest unmarked color
for the color of the current vertex. If all of the colors are already
marked, a new color is created. A color is considered marked if its
mark number is equal to the current vertex number. This saves the
trouble of having to reset the marks for each vertex. The
effectiveness of this algorithm is highly dependent on the input
vertex order. There are several ordering algorithms, including the
<I>largest-first</I>&nbsp;[<A HREF="bibliography.html#welsch67">31</A>],
<I>smallest-last</I>&nbsp;[<a
href="bibliography.html#matula72:_graph_theory_computing">29</a>], and
<I>incidence degree</I>&nbsp;[<a
href="bibliography.html#brelaz79:_new">32</a>] algorithms, which
improve the effectiveness of this coloring algorithm.
<P>
The first decision to make when constructing a generic graph algorithm
is to decide what graph operations are necessary for implementing the
algorithm, and which graph concepts the operations map to. In this
algorithm we will need to traverse through all of the vertices to
intialize the vertex colors. We also need to access the adjacent
vertices. Therefore, we will choose the <a
href="./VertexListGraph.html">VertexListGraph</a> concept because it
is the minimum concept that includes these operations. The graph type
will be parameterized in the template function for this algorithm. We
do not restrict the graph type to a particular graph class, such as
the BGL <a href="./adjacency_list.html"><TT>adjacency_list</TT></a>,
for this would drastically limit the reusability of the algorithm (as
most algorithms written to date are). We do restrict the graph type to
those types that model <a
href="./VertexListGraph.html">VertexListGraph</a>. This is enforced by
the use of those graph operations in the algorithm, and furthermore by
our explicit requirement added as a concept check with
<TT>function_requires()</TT> (see Section <A
HREF="../../concept_check/concept_check.htm">Concept
Checking</A> for more details about concept checking).
<P>
Next we need to think about what vertex or edge properties will be
used in the algorithm. In this case, the only property is vertex
color. The most flexible way to specify access to vertex color is to
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/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/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
algorithm is the number of colors that were needed to color the graph,
hence the return type of the function is the graph's
<TT>vertices_size_type</TT>. The following code shows the interface for our
graph algorithm as a template function, the concept checks, and some
typedefs. The implementation is straightforward, the only step not
discussed above is the color initialization step, where we set the
color of all the vertices to ``uncolored''.
<P>
<PRE>
namespace boost {
template &lt;class VertexListGraph, class Order, class Color&gt;
typename graph_traits&lt;VertexListGraph&gt;::vertices_size_type
sequential_vertex_color_ting(const VertexListGraph&amp; G,
Order order, Color color)
{
typedef graph_traits&lt;VertexListGraph&gt; GraphTraits;
typedef typename GraphTraits::vertex_descriptor vertex_descriptor;
typedef typename GraphTraits::vertices_size_type size_type;
typedef typename property_traits&lt;Color&gt;::value_type ColorType;
typedef typename property_traits&lt;Order&gt;::value_type OrderType;
function_requires&lt; VertexListGraphConcept&lt;VertexListGraph&gt; &gt;();
function_requires&lt; ReadWritePropertyMapConcept&lt;Color, vertex_descriptor&gt; &gt;();
function_requires&lt; IntegerConcept&lt;ColorType&gt; &gt;();
function_requires&lt; size_type, ReadablePropertyMapConcept&lt;Order&gt; &gt;();
typedef typename same_type&lt;OrderType, vertex_descriptor&gt;::type req_same;
size_type max_color = 0;
const size_type V = num_vertices(G);
std::vector&lt;size_type&gt;
mark(V, numeric_limits_max(max_color));
typename GraphTraits::vertex_iterator v, vend;
for (tie(v, vend) = vertices(G); v != vend; ++v)
color[*v] = V - 1; // which means "not colored"
for (size_type i = 0; i &lt; V; i++) {
vertex_descriptor current = order[i];
// mark all the colors of the adjacent vertices
typename GraphTraits::adjacency_iterator ai, aend;
for (tie(ai, aend) = adjacent_vertices(current, G); ai != aend; ++ai)
mark[color[*ai]] = i;
// find the smallest color unused by the adjacent vertices
size_type smallest_color = 0;
while (smallest_color &lt; max_color &amp;&amp; mark[smallest_color] == i)
++smallest_color;
// if all the colors are used up, increase the number of colors
if (smallest_color == max_color)
++max_color;
color[current] = smallest_color;
}
return max_color;
}
} // namespace boost
</PRE>
<P>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-116
View File
@@ -1,116 +0,0 @@
<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: Copy 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>
<H1><TT>copy_graph</TT></H1>
<PRE>
template &lt;class <a href="./VertexListGraph.html">VertexListGraph</a>, class <a href="./MutableGraph.html">MutableGraph</a>&gt;
void copy_graph(const VertexListGraph&amp; G, MutableGraph&amp; G_copy,
const bgl_named_params&lt;P, T, R&gt;&amp; params = <i>all defaults</i>)
</PRE>
This function copies all of the vertices and edges from graph
<tt>G</tt> into <tt>G_copy</tt>. Also, it copies the vertex and edge
properties, either by using the <tt>vertex_all</tt> and
<tt>edge_all</tt> property maps, or by user-supplied copy functions.
<H3>Where Defined</H3>
<P>
<a href="../../../boost/graph/copy.hpp"><TT>boost/graph/copy.hpp</TT></a>
<P>
<H3>Parameters</H3>
IN: <tt>const VertexListGraph&amp; G</tt>
<blockquote>
A directed or undirected graph. The graph type must be a model of <a href="./VertexListGraph.html">Vertex List Graph</a>.
</blockquote>
OUT: <tt>MutableGraph&amp; 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>.
</blockquote>
<h3>Named Parameters</h3>
IN: <tt>vertex_copy(VertexCopier vc)</tt>
<blockquote>
This is a <a href="http://www.sgi.com/tech/stl/BinaryFunction.html">Binary Function</a> that copies the properties of a vertex in the original graph
into the corresponding vertex in the copy.<br>
<b>Default:</b> <tt>vertex_copier&lt;VertexListGraph, MutableGraph&gt;</tt>
which uses the property tag <tt>vertex_all</tt> to access a property
map from the graph.
</blockquote>
IN: <tt>edge_copy(EdgeCopier ec)</tt>
<blockquote>
This is a <a href="http://www.sgi.com/tech/stl/BinaryFunction.html">Binary Function</a> that copies the properties of an edge in the original graph
into the corresponding edge in the copy.<br>
<b>Default:</b> <tt>edge_copier&lt;VertexListGraph, MutableGraph&gt;</tt>
which uses the property tag <tt>edge_all</tt> to access a property
map from the graph.
</blockquote>
IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
<blockquote>
The vertex index map type must be a model of <a
href="../../property_map/doc/ReadablePropertyMap.html">Readable Property
Map</a> and must map the vertex descriptors of <tt>G</tt> to the
integers in the half-open range <tt>[0,num_vertices(G))</tt>.<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>
UTIL/OUT: <tt>orig_to_copy(Orig2CopyMap c)</tt>
<blockquote>
This maps vertices in the original graph to vertices in the copy.
<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 the output graph's vertex descriptor type of size
<tt>num_vertices(g)</tt> and using the <tt>i_map</tt> for the index
map.
</blockquote>
<H3>Complexity</H3>
<P>
The time complexity is <i>O(V + E)</i>.
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-248
View File
@@ -1,248 +0,0 @@
<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: Cuthill-Mckee Ordering</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>
<img src="figs/python.gif" alt="(Python)"/>
<TT>cuthill_mckee_ordering</TT>
</H1>
<P>
<DIV ALIGN="LEFT">
<TABLE CELLPADDING=3 border>
<TR><TH ALIGN="LEFT"><B>Graphs:</B></TH>
<TD ALIGN="LEFT">undirected</TD>
</TR>
<TR><TH ALIGN="LEFT"><B>Properties:</B></TH>
<TD ALIGN="LEFT">color, degree</TD>
</TR>
<TR><TH ALIGN="LEFT"><B>Complexity:</B></TH>
<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>
<pre>
(1)
template &lt;class IncidenceGraph, class OutputIterator,
class ColorMap, class DegreeMap&gt;
OutputIterator
cuthill_mckee_ordering(const IncidenceGraph&amp; g,
typename graph_traits&lt;IncidenceGraph&gt;::vertex_descriptor s,
OutputIterator inverse_permutation,
ColorMap color, DegreeMap degree)
(2)
template &lt;class VertexListGraph, class OutputIterator&gt;
OutputIterator
cuthill_mckee_ordering(const VertexListGraph&amp; g, OutputIterator inverse_permutation);
template &lt;class VertexListGraph, class OutputIterator, class VertexIndexMap&gt;
OutputIterator
cuthill_mckee_ordering(const VertexListGraph&amp; g, OutputIterator inverse_permutation,
VertexIndexMap index_map);
template &lt;class VertexListGraph, class OutputIterator,
class ColorMap, class DegreeMap&gt;
OutputIterator
cuthill_mckee_ordering(const VertexListGraph&amp; g, OutputIterator inverse_permutation,
ColorMap color, DegreeMap degree)
(3)
template &lt;class IncidenceGraph, class OutputIterator,
class ColorMap, class DegreeMap&gt;
OutputIterator
cuthill_mckee_ordering(const IncidenceGraph&amp; g,
std::deque&lt; typename
graph_traits&lt;IncidenceGraph&gt;::vertex_descriptor &gt; vertex_queue,
OutputIterator inverse_permutation,
ColorMap color, DegreeMap degree)
</pre>
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: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
works by a local minimization of the i-th bandwidths. The vertices are
basically assigned a breadth-first search order, except that at each
step, the adjacent vertices are placed in the queue in order of
increasing degree.
<p>
Version 1 of the algorithm lets the user choose the ``starting
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.
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&lt;vertex_descriptor&gt; inv_perm(num_vertices(G));
cuthill_mckee_ordering(G, inv_perm.rbegin(), ...);
</pre>
<p>
Either way, storing the output into a vector gives you the
permutation from the new ordering to the old ordering.
</p>
<pre>
inv_perm[new_index[u]] == u
</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[old_index[inv_perm[i]]] = i;
</pre>
<h3>Parameters</h3>
For version 1:
<ul>
<li> <tt>IncidenceGraph&amp; g</tt> &nbsp;(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>vertex_descriptor s</tt> &nbsp(IN) <br>
The starting vertex.<br>
<b>Python</b>: Unsupported parameter.
<li> <tt>OutputIterator inverse_permutation</tt> &nbsp(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> &nbsp(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> &nbsp(IN) <br>
This must map vertices to their degree.<br>
<b>Python</b>: Unsupported parameter.
</ul>
For version 2:
<ul>
<li> <tt>VertexListGraph&amp; g</tt> &nbsp;(IN) <br>
An undirected graph. The graph's type must be a model of <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> &nbsp(OUT) <br>
The new vertex ordering. The vertices are written to the
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> &nbsp(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> &nbsp(IN) <br>
This must map vertices to their degree.<br>
<b>Python</b>: Unsupported parameter.
</ul>
For version 3:
<ul>
<li> <tt>IncidenceGraph&amp; g</tt> &nbsp;(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&lt; typename graph_traits&lt;Graph&gt;::vertex_descriptor &gt; vertex_queue </tt> &nbsp(IN) <br>
The deque containing the starting vertices for each component.<br>
<b>Python</b>: Unsupported parameter.
<li> <tt>OutputIterator inverse_permutation</tt> &nbsp(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> &nbsp(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> &nbsp(IN) <br>
This must map vertices to their degree.<br>
<b>Python</b>: Unsupported parameter.
</ul>
<h3>Example</h3>
See <a
href="../example/cuthill_mckee_ordering.cpp"><tt>example/cuthill_mckee_ordering.cpp</tt></a>.
<h3>See Also</h3>
<a href="./bandwidth.html">bandwidth</tt></a>,
and <tt>degree_property_map</tt> in <tt>boost/graph/properties.hpp</tt>.
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 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>
-326
View File
@@ -1,326 +0,0 @@
<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 &lt;class VertexListGraph, class Param, class Tag, class Rest&gt;
void dag_shortest_paths(const VertexListGraph&amp; g,
typename graph_traits&lt;VertexListGraph&gt;::vertex_descriptor s,
const bgl_named_params&lt;Param,Tag,Rest&gt;&amp; params)
<i>// non-named parameter version</i>
template &lt;class VertexListGraph, class DijkstraVisitor,
class DistanceMap, class WeightMap, class ColorMap,
class PredecessorMap,
class Compare, class Combine,
class DistInf, class DistZero&gt;
void dag_shortest_paths(const VertexListGraph&amp; g,
typename graph_traits&lt;VertexListGraph&gt;::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&nbsp;[<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&amp; 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&lt;D&gt;</tt> with <tt>D=typename
property_traits&lt;DistanceMap&gt;::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&lt;D&gt;</tt> with
<tt>D=typename property_traits&lt;DistanceMap&gt;::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&lt;D&gt;::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&lt;null_visitor&gt;</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 &copy; 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>
Binary file not shown.
-314
View File
@@ -1,314 +0,0 @@
<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: Depth-First 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:depth-first-search"></A><img src="figs/python.gif" alt="(Python)"/>
<TT>depth_first_search</TT>
</H1>
<P>
<PRE>
<i>// named parameter version</i>
template &lt;class Graph, class class P, class T, class R&gt;
void depth_first_search(Graph&amp; G,
const bgl_named_params&lt;P, T, R&gt;&amp; params);
<i>// non-named parameter version</i>
template &lt;class Graph, class <a href="DFSVisitor.html">DFSVisitor</a>, class ColorMap&gt;
void depth_first_search(const Graph&amp; g, DFSVisitor vis, ColorMap color)
template &lt;class Graph, class <a href="DFSVisitor.html">DFSVisitor</a>, class ColorMap&gt;
void depth_first_search(const Graph&amp; g, DFSVisitor vis, ColorMap color,
typename graph_traits&lt;Graph&gt;::vertex_descriptor start)
</PRE>
<p>
The <tt>depth_first_search()</tt> function performs a depth-first
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
backtracks to the last vertex that had undiscovered neighbors. Once
all reachable vertices have been visited, the algorithm selects from
any remaining undiscovered vertices and continues the traversal. The
algorithm finishes when all vertices have been visited. Depth-first
search is useful for categorizing edges in a graph, and for imposing
an ordering on the vertices. Section <a
href="./graph_theory_review.html#sec:dfs-algorithm">Depth-First
Search</a> describes the various properties of DFS and walks through
an example.
</p>
<p>
Similar to BFS, color markers are used to keep track of which vertices
have been discovered. White marks vertices that have yet to be
discovered, gray marks a vertex that is discovered but still has
vertices adjacent to it that are undiscovered. A black vertex is
discovered vertex that is not adjacent to any white vertices.
<p>
<p>
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 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
we show the algorithm computing predecessors <i>p</i>, discover time
<i>d</i> and finish time <i>t</i>. By default, the
<tt>depth_first_search()</tt> function does not compute these
properties, however there are pre-defined visitors such as <a
href="./predecessor_recorder.html"><tt>predecessor_recorder</tt></a>
and <a href="./time_stamper.html"><tt>time_stamper</tt></a> that can
be used to do this.
</p>
<table>
<tr>
<td valign="top">
<pre>
DFS(<i>G</i>)
<b>for</b> each vertex <i>u in V</i>
<i>color[u] :=</i> WHITE
<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>) <br>
DFS-VISIT(<i>G</i>, <i>u</i>)
<i>color[u] :=</i> GRAY
<i>d_time[u] := time := time + 1</i>
<b>for</b> each <i>v in Adj[u]</i>
<b>if</b> (<i>color[v] =</i> WHITE)
<i>p[v] = u</i>
<b>call</b> DFS-VISIT(<i>G</i>, <i>v</i>)
<b>else if</b> (<i>color[v] =</i> GRAY)
<i>...</i>
<b>else if</b> (<i>color[v] =</i> BLACK)
<i>...</i>
<b>end for</b>
<i>color[u] :=</i> BLACK
<i>f_time[u] := time := time + 1</i>
<pre>
</td>
<td valign="top">
<pre>
-
-
initialize 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
-
finish vertex <i>u</i>
-
</pre>
</td>
</tr>
</table>
<H3>Where Defined</H3>
<P>
<a href="../../../boost/graph/depth_first_search.hpp"><TT>boost/graph/depth_first_search.hpp</TT></a>
<h3>Parameters</h3>
IN: <tt>Graph&amp; g</tt>
<blockquote>
A directed graph. The graph type must
be a model of <a href="./IncidenceGraph.html">Incidence Graph</a>
and <a href="./VertexListGraph.html">Vertex List Graph</a>.<br>
<b>Python</b>: The parameter is named <tt>graph</tt>.
</blockquote>
<h3>Named Parameters</h3>
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&lt;null_visitor&gt;</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/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/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>
IN: <tt>root_vertex(typename
graph_traits&lt;VertexListGraph&gt;::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>
<blockquote>
This maps each vertex to an integer in the range <tt>[0,
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/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>adjacency_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>
<H3><A NAME="SECTION001340300000000000000">
Complexity</A>
</H3>
<P>
The time complexity is <i>O(E + V)</i>.
<P>
<h3>Visitor Event Points</h3>
<ul>
<li><b><tt>vis.initialize_vertex(s, g)</tt></b> is invoked on every
vertex of the graph before the start of the graph search.
<li><b><tt>vis.start_vertex(s, g)</tt></b> is invoked on the source
vertex once before the start of the search.
<li><b><tt>vis.discover_vertex(u, g)</tt></b> is invoked when a vertex
is encountered for the first time.
<li><b><tt>vis.examine_edge(e, g)</tt></b> is invoked on every out-edge
of each vertex after it is discovered.
<li><b><tt>vis.tree_edge(e, g)</tt></b> is invoked on each edge as it
becomes a member of the edges that form the search tree. If you
wish to record predecessors, do so at this event point.
<li><b><tt>vis.back_edge(e, g)</tt></b> is invoked on the back edges in
the graph.
<li><b><tt>vis.forward_or_cross_edge(e, g)</tt></b> is invoked on
forward or cross edges in the graph. In an undirected graph this
method is never called.
<li><b><tt>vis.finish_vertex(u, g)</tt></b> is 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).
</ul>
<H3>Example</H3>
<P>
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 &copy; 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>

Some files were not shown because too many files have changed in this diff Show More