Compare commits

...

1909 Commits

Author SHA1 Message Date
Beman Dawes 4e4f0cc72f Release
[SVN r43921]
2008-03-29 11:50:24 +00:00
Douglas Gregor 23e8514ac7 Merge MPI/Graph documentation fixes from trunk
[SVN r43700]
2008-03-18 13:20:44 +00:00
Daniel James aa97fdc26a Merged revisions 43206,43208-43213 via svnmerge from
https://svn.boost.org/svn/boost/trunk

........
  r43206 | danieljames | 2008-02-10 09:55:03 +0000 (Sun, 10 Feb 2008) | 1 line
  
  Fix some broken links.
........
  r43209 | danieljames | 2008-02-10 14:56:22 +0000 (Sun, 10 Feb 2008) | 1 line
  
  Link to people pages on the website, as they've been removed from the download.
........
  r43210 | danieljames | 2008-02-10 15:02:17 +0000 (Sun, 10 Feb 2008) | 1 line
  
  Point links to the pages that used to be in 'more' to the site.
........
  r43212 | danieljames | 2008-02-10 16:10:16 +0000 (Sun, 10 Feb 2008) | 1 line
  
  Fix links on the home page as well.
........
  r43213 | danieljames | 2008-02-10 16:21:22 +0000 (Sun, 10 Feb 2008) | 1 line
  
  Generated documentation which is no longer generated.
........


[SVN r43214]
2008-02-10 16:39:38 +00:00
Douglas Gregor f865d6209e Merge fix for add_vertex in compressed_sparse_row with properties
[SVN r43167]
2008-02-07 21:29:02 +00:00
Beman Dawes 751f8b5b7c Full merge from trunk at revision 41356 of entire boost-root tree.
[SVN r41370]
2007-11-25 18:38:02 +00:00
Beman Dawes 73f24694dd Full merge from trunk at revision 41356 of entire boost-root tree.
[SVN r41369]
2007-11-25 18:07:19 +00:00
Beman Dawes 5255835126 config, detail, filesystem, system, tools, at 41278.
[SVN r41316]
2007-11-23 17:03:14 +00:00
Aaron Windsor 341a685ff1 Cleaning up #includes to avoid errors on gcc 4.1 and above.
[SVN r41227]
2007-11-19 15:28:26 +00:00
Aaron Windsor 6365afac60 Shortening file name of a graph test to < 32 characters
[SVN r40864]
2007-11-07 02:30:38 +00:00
Aaron Windsor c28a996668 Renaming planar graph test files to under 32 characters each.
[SVN r40836]
2007-11-06 13:55:05 +00:00
Douglas Gregor 23ca414964 Merge in Boost.Graph changes from RC_1_34_0 branch
[SVN r40813]
2007-11-05 21:43:24 +00:00
Douglas Gregor c09b24159b Removed ancient BGL-Python code
[SVN r40812]
2007-11-05 21:25:10 +00:00
Douglas Gregor eb60f8c235 Add copyright, 1.34.1 history
[SVN r40809]
2007-11-05 21:20:23 +00:00
Dave Abrahams 3884b842c6 Updated Concept Check library documentation.
Changed BOOST_CONCEPT_WHERE to BOOST_CONCEPT_REQUIRES to be more
consistent with the current C++0x proposal, which now uses a
"requires" keyword in lieu of "where."

Factored GCC workarounds into the BOOST_CONCEPT_USAGE macro.


[SVN r40769]
2007-11-05 03:54:19 +00:00
Douglas Gregor 05a4441935 Fix for Borland/CodeGear, from JongSoo Park
[SVN r40673]
2007-11-02 03:07:24 +00:00
Douglas Gregor 8e5d48c839 Use unsigned long long for the path count to avoid overflows. Fixes #1398
[SVN r40645]
2007-11-01 16:16:30 +00:00
Vladimir Prus da3b568cb4 Make sure every library can be installed by using
bjam stage|install

in libs/<library>/build.


[SVN r40475]
2007-10-26 09:04:25 +00:00
Aaron Windsor e9747c0143 Un-asserted two function calls - this was causing the function calls to turn into no-ops when the example was compiled with debugging off.
[SVN r40167]
2007-10-19 00:16:36 +00:00
Aaron Windsor e54f2934e1 Trying to clear some errors from Sun CC.
[SVN r39871]
2007-10-10 02:18:37 +00:00
Aaron Windsor c691ac49f7 Adding some missing typenames
[SVN r39773]
2007-10-07 23:49:07 +00:00
Aaron Windsor fa42d8aa92 Fix config issue for cycle ratio tests - the path to the input file used in the test should be relative to the graph test subdirectory.
[SVN r39767]
2007-10-07 18:43:16 +00:00
Aaron Windsor 40ffa294a2 Fixing some errors and warnings on the planar graph tests coming from Sun compilers.
[SVN r39763]
2007-10-07 16:52:39 +00:00
Beman Dawes b2be8e3dfc Starting point for releases
[SVN r39706]
2007-10-05 14:25:06 +00:00
Ronald Garcia 98d0755817 Made the output of the example program more realistic.
[SVN r39524]
2007-09-25 15:36:35 +00:00
Ronald Garcia 2f99e5b87f Initial Revision. Stolen from the write-graphviz.html docs.
[SVN r39523]
2007-09-25 15:32:23 +00:00
Aaron Windsor 1cc2f6e13a Some fixes for errors and warnings on HP cxx.
[SVN r39480]
2007-09-22 17:41:18 +00:00
Ronald Garcia 2006d41573 small html and grammar fixes.
[SVN r39442]
2007-09-21 12:33:31 +00:00
Ronald Garcia 4bda985420 A little note to minimize confusion (I know I was confused).
[SVN r39435]
2007-09-20 23:22:46 +00:00
Douglas Gregor 666a919f70 Fix the cycle ratio tests for real
[SVN r39286]
2007-09-14 21:17:06 +00:00
Douglas Gregor 03560ab9ae Teach cycle_ratio_tests to find its input files during regression testing
[SVN r39246]
2007-09-13 19:41:27 +00:00
Aaron Windsor a86a446429 Modified odd_components_counter to fix signed/unsigned mismatch on Sandi pgi-6.1 tests.
[SVN r39112]
2007-09-03 15:04:05 +00:00
Aaron Windsor 8dfc1ad52c merging planar graph algorithms into the BGL
[SVN r38956]
2007-08-25 21:11:06 +00:00
Douglas Gregor dcb43119d5 Revert inadvertent changes to csr_graph_test.cpp
[SVN r38741]
2007-08-17 14:57:54 +00:00
Vladimir Prus aa79cb6919 Remove V1 Jamfiles
[SVN r38516]
2007-08-08 19:02:26 +00:00
Douglas Gregor 9d3d4e9a44 Pointless change
[SVN r38493]
2007-08-07 13:05:43 +00:00
Douglas Gregor 5461181e7f relaxed_heap.hpp:
- Use boost::none in all the right places. Fixes #1072. Big thanks to
    David Gleich!


[SVN r38330]
2007-07-31 21:58:36 +00:00
Douglas Gregor d0432740ef Maximum and minimum cycle ratio
[SVN r38308]
2007-07-30 13:01:16 +00:00
Douglas Gregor e6cd5bc377 Fix minor typo
[SVN r38287]
2007-07-25 20:23:19 +00:00
nobody 148c441158 This commit was manufactured by cvs2svn to create tag
'Version_1_34_1'.

[SVN r38286]
2007-07-24 19:28:14 +00:00
Ronald Garcia a080a480ce Fixed an inconsistency between explicit graph properties and implicit
(without a "graph" keyword and brackets).


[SVN r38049]
2007-06-21 16:12:46 +00:00
Ronald Garcia 1dfcd0e6fb Fixed up the testing for graph names.
[SVN r38048]
2007-06-21 16:12:05 +00:00
Ronald Garcia f3c29e22d2 Added a test case to make sure that the contents of c-strings are not
subject to whitespace skipping.


[SVN r38045]
2007-06-20 16:28:50 +00:00
Ronald Garcia f6a8e8c66e Fixed a bug in c-style string parsing...need to turn whitespace
skipping off using lexeme_d.


[SVN r38044]
2007-06-20 16:24:06 +00:00
Aaron Windsor 54ff05ca06 added named parameters for vertex_invariant1, vertex_invariant2, and vertex_max_invariant, from isomorphism.hpp
[SVN r37995]
2007-06-15 12:38:13 +00:00
Aaron Windsor 1b69ebe5b5 documented the named parameters vertex_invariant1, vertex_invariant2, and vertex_max_invariant
[SVN r37994]
2007-06-15 12:34:32 +00:00
Thomas Witt efcb9317fc Patches from Trac #583.
[SVN r37846]
2007-06-01 16:12:08 +00:00
Douglas Gregor 96f923a52e Rename/remove some detail algorithms to avoid a conflict with the string algorithms library
[SVN r37828]
2007-05-31 12:14:31 +00:00
Douglas Gregor 45d0f1331b Fix handling of overflow in shortest-path algorithms
[SVN r37814]
2007-05-29 16:53:05 +00:00
Douglas Gregor 9445aff028 Fix overflow handling with negative values as reported in http://lists.boost.org/boost-users/2007/05/28205.php
[SVN r37812]
2007-05-29 15:22:29 +00:00
Jeremy Siek f65f09bba9 added preprocessor guards
[SVN r37432]
2007-04-13 16:05:53 +00:00
Douglas Gregor 43f0e01be5 Add include of <climits>
[SVN r37414]
2007-04-10 23:05:46 +00:00
Aaron Windsor 7fdb4af8f6 a few more bug fixes
[SVN r37222]
2007-03-18 16:21:46 +00:00
Douglas Gregor 660107b872 Pick up Aaron Windsor's fixes
[SVN r37191]
2007-03-15 14:12:41 +00:00
Douglas Gregor ee9b816984 Remove broken Fibonacci heap
[SVN r37190]
2007-03-15 14:03:06 +00:00
Stephan Diederich e79c27b97b changed coloring to be consistent with edmunds_karp_max_flow
[SVN r37167]
2007-03-11 11:56:10 +00:00
Dave Abrahams 3125c8577d Correct testing bugs:
either changing assert(...) or BOOST_ASSERT(...) to BOOST_TEST
    (in my code only)

    or adding "return boost::report_errors();" where it was clearly
    missing (and a pure bug, in anyone's code).

    or changing BOOST_TEST to BOOST_CHECK where the integer library
    was clearly using Boost.Test and not returning report_errors().


[SVN r37063]
2007-02-25 15:28:02 +00:00
Dave Abrahams b2bc98e410 Correct testing bugs:
either changing assert(...) or BOOST_ASSERT(...) to BOOST_TEST
    (in my code only)

    or adding "return boost::report_errors();" where it was clearly
    missing (and a pure bug, in anyone's code).


[SVN r37057]
2007-02-24 22:40:59 +00:00
Douglas Gregor 4c8c2403c8 Use simple string operations rather than the string algorithms library
[SVN r36909]
2007-02-08 04:13:07 +00:00
Douglas Gregor 02cdd5c0f8 Fix adjacency list and property map serialization
[SVN r36895]
2007-02-05 22:16:58 +00:00
Douglas Gregor 1f84c5b232 Remove old graphviz parser
[SVN r36842]
2007-01-29 22:16:07 +00:00
Douglas Gregor 78d2fd885f GraphML parser, from Tiago de Paula Peixoto
[SVN r36841]
2007-01-29 22:14:41 +00:00
Douglas Gregor efa2fe286f Adjacency list serialization fixes, from David Keller
[SVN r36838]
2007-01-29 19:54:47 +00:00
Douglas Gregor 45a2d06d94 Improvements to LEDA adaptors, from Jens Mueller
[SVN r36836]
2007-01-29 19:29:06 +00:00
Daniel James 55d57690f1 Remove a tab.
[SVN r36645]
2007-01-07 22:21:57 +00:00
Douglas Gregor 3f97161db1 Change library name to boost_graph
[SVN r36471]
2006-12-20 19:17:16 +00:00
Aaron Windsor 0f49c8dcb2 merged bug fix
[SVN r36462]
2006-12-20 01:22:24 +00:00
Ronald Garcia fcf80df5f9 Removed old dead code. dynamic_bitset supercedes these.
[SVN r36454]
2006-12-18 15:48:56 +00:00
Douglas Gregor 85dd95cf77 Remove none algorith, which is unused and conflicts with none.hpp
[SVN r36409]
2006-12-15 21:44:53 +00:00
Douglas Gregor 1d8d4322d2 Remove none algorith, which is unused and conflicts with none.hpp
[SVN r36409]
2006-12-15 21:44:53 +00:00
Douglas Gregor 15d8e1dc21 Remove makefile gooP
[SVN r36408]
2006-12-15 21:19:02 +00:00
Douglas Gregor 99a56222da Fix file dependency example
[SVN r36407]
2006-12-15 21:07:14 +00:00
Douglas Gregor 3bec282dbd Finish renaming bgl-viz to boost_graph
[SVN r36404]
2006-12-15 13:35:08 +00:00
Douglas Gregor 3d5661096c Handle temporaries passed to filtered_graph
[SVN r36403]
2006-12-15 13:17:58 +00:00
Douglas Gregor dfb49e339d Fix criterion
[SVN r36400]
2006-12-15 12:58:54 +00:00
Douglas Gregor b493c0ea47 Remove Python gook, rename library to boost_graph
[SVN r36399]
2006-12-15 12:55:36 +00:00
Aaron Windsor c4a7c8cd37 fixed a bug caused by parent pointers not being updated when two heaps are merged
[SVN r36398]
2006-12-15 02:26:08 +00:00
Aaron Windsor 64b6038f92 renaming sorted_erdos_renyi_generator.html and lengauer_tarjan_dominator_tree.htm so inspection reports won't complain
[SVN r36374]
2006-12-14 02:20:34 +00:00
Aaron Windsor 9d8f8ce0cd renaming sorted_erdos_renyi_generator.html and lengauer_tarjan_dominator_tree.htm so inspection reports won't complain
[SVN r36374]
2006-12-14 02:20:34 +00:00
Aaron Windsor fbd5c5120f merged file name changes from HEAD to RC_1_34_0
[SVN r36373]
2006-12-14 02:12:42 +00:00
nobody 46ae2cb6c1 This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r36372]
2006-12-14 02:08:05 +00:00
Aaron Windsor 83e26c7109 renaming sorted_erdos_renyi_generator.html and lengauer_tarjan_dominator_tree.htm so inspection reports won't complain
[SVN r36371]
2006-12-14 02:08:04 +00:00
Aaron Windsor d83d611b18 merging fix due to renaming maximum_cardinality_matching.hpp from HEAD to RC_1_34_0
[SVN r36370]
2006-12-14 01:06:01 +00:00
Aaron Windsor 4af336e307 fix due to renaming maximum_cardinality_matching.hpp
[SVN r36369]
2006-12-14 01:01:26 +00:00
Aaron Windsor e53d23d7d7 merging fix due to renaming maximum_cardinality_matching.hpp from HEAD to RC_1_34_0
[SVN r36368]
2006-12-14 00:59:19 +00:00
Aaron Windsor 401165fe0c merging filename fix for maximum_cardinality_matching.hpp from HEAD to RC_1_34_0
[SVN r36367]
2006-12-14 00:51:26 +00:00
Aaron Windsor 7e7359b330 changing name of maximum_cardinality_matching.hpp
[SVN r36366]
2006-12-14 00:49:22 +00:00
Aaron Windsor a728a94caa merged filename change for maximum_cardinality_matching from HEAD to RC_1_34_0
[SVN r36365]
2006-12-14 00:45:34 +00:00
nobody 833169b3a0 This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r36364]
2006-12-14 00:39:04 +00:00
Aaron Windsor 770cce09ef renaming maximum_cardinality_matching.hpp so inspection reports won't complain
[SVN r36363]
2006-12-14 00:39:03 +00:00
Ronald Garcia a237fb8cd9 Replaced uses of ct_if and friends (based on pending/ct_if.hpp) with
uses of mpl::if_ and friends.


[SVN r36269]
2006-12-04 23:23:08 +00:00
Andreas Huber 79a1ef7d8f Merged L & C issue fixes from trunk to branch.
[SVN r36225]
2006-12-01 11:34:43 +00:00
Andreas Huber dde01478fe Fixed license & copyright issues.
[SVN r36224]
2006-12-01 10:29:49 +00:00
Douglas Gregor 41051db37b Do not deduce Vertex in vertex function
[SVN r36202]
2006-11-29 20:30:27 +00:00
Douglas Gregor 0a8a6f0812 Do not deduce Vertex in vertex function
[SVN r36202]
2006-11-29 20:30:27 +00:00
Douglas Gregor 1cfa23497b Integrate Kolmogorov's max flow algorithm, from Stephan Diederich.
[SVN r36125]
2006-11-20 23:42:44 +00:00
Vladimir Prus 99d4f31d38 Merge from HEAD.
Allow building of shared versions of some Boost.Test libraries.
Adjust tests to use always use static linking to Boost.Test, since
linking to the shared version requires test changes.

Patch from Juergen Hunold.


[SVN r35990]
2006-11-10 19:59:52 +00:00
Vladimir Prus a86397fc34 Allow building of shared versions of some Boost.Test libraries.
Adjust tests to use always use static linking to Boost.Test, since
linking to the shared version requires test changes.

Patch from Juergen Hunold.


[SVN r35989]
2006-11-10 19:09:56 +00:00
Beman Dawes 2c884b70b7 Merged copyright and license addition
[SVN r35907]
2006-11-07 19:27:00 +00:00
Beman Dawes 3c852ac7a0 Add copyright, license
[SVN r35905]
2006-11-07 19:11:57 +00:00
Rene Rivera 0cb7bbf192 Remove obsolete Boost.Build v1 files.
[SVN r35880]
2006-11-06 17:10:46 +00:00
Douglas Gregor a306a8119f Cleanup lots of inspection failures
[SVN r35826]
2006-11-03 19:17:56 +00:00
Douglas Gregor 88edab5b45 Remove old Python cruft
[SVN r35825]
2006-11-03 19:10:49 +00:00
Douglas Gregor b0474f1dd9 Clear up copyright/license problems
[SVN r35824]
2006-11-03 18:55:11 +00:00
Roland Schwarz 21b9a9f799 Applied a fix, that will skip the serialization test for compilers that do not provide spirit (and serialization in turn)
[SVN r35670]
2006-10-20 08:28:10 +00:00
Ronald Garcia 59ba89640e Squashed some bugs: attribute list commas are optional. '#' was not
behaving properly (especially inside quoted strings).


[SVN r35667]
2006-10-19 23:37:01 +00:00
Ronald Garcia d1c241d77e comment typo.
[SVN r35666]
2006-10-19 21:46:00 +00:00
Ronald Garcia 83e6c4a9c3 Added an example.
[SVN r35638]
2006-10-16 18:08:03 +00:00
Ronald Garcia 3ae3292696 Initial Revision.
[SVN r35637]
2006-10-16 18:03:28 +00:00
Ronald Garcia e0367b4a21 Added a conditional around some debugging code.
[SVN r35635]
2006-10-16 17:54:23 +00:00
Ronald Garcia f1257a09d1 updated docs. Case-sensitivity is supported. Subgraphs at the BGL level
are not.


[SVN r35603]
2006-10-14 01:25:56 +00:00
Ronald Garcia f4e0af95f1 Added support for graph properties.
[SVN r35602]
2006-10-14 01:13:39 +00:00
Ronald Garcia 4c5c2fc303 Added hooks into the grammar to possibly catch graph properties.
[SVN r35601]
2006-10-13 22:51:17 +00:00
Douglas Gregor 344dd6b155 Fix handling of empty graphs
[SVN r35420]
2006-09-29 15:33:12 +00:00
Douglas Gregor 392f5fa635 Fix handling of empty graphs
[SVN r35420]
2006-09-29 15:33:12 +00:00
Douglas Gregor bf2f7f86fa Fix parameter name
[SVN r35419]
2006-09-29 15:30:07 +00:00
Douglas Gregor cc4f49d760 Fix parameter name
[SVN r35419]
2006-09-29 15:30:07 +00:00
Douglas Gregor 0d2d95b2f2 Do the DLL import/export dance for the GraphViz reader
[SVN r35336]
2006-09-26 13:10:59 +00:00
Douglas Gregor 58e287d115 Do the DLL import/export dance for the GraphViz reader.
[SVN r35335]
2006-09-26 12:52:08 +00:00
Douglas Gregor e505bf99db Test and fix serialization code
[SVN r35257]
2006-09-21 17:02:14 +00:00
Douglas Gregor d34d447b68 Test and fix serialization code
[SVN r35257]
2006-09-21 17:02:14 +00:00
Douglas Gregor a03ed0e26d Work around compiler optimizer bugs
[SVN r35225]
2006-09-20 13:55:16 +00:00
Dave Abrahams 9233499dbc Take advantage of BOOST_CONCEPT_USAGE for defining usage requirements:
Using this macro is better than simply defining a destructor because
usage patterns will be tested whenever associated types are accessed.


[SVN r35199]
2006-09-19 13:41:30 +00:00
Douglas Gregor f4b0928c2d Work around Sun CC bug
[SVN r35100]
2006-09-13 20:49:10 +00:00
Douglas Gregor 04fea004d9 Work around Sun CC bug
[SVN r35100]
2006-09-13 20:49:10 +00:00
Douglas Gregor bc49236ccc Work around MSVC 6, 7 bug
[SVN r35099]
2006-09-13 20:41:28 +00:00
Jeremy Siek 73b6ddc2d4 fixed has_cycle_dfs
[SVN r35026]
2006-09-06 17:26:48 +00:00
Daniel James d4db30f9d3 Merge tab removal.
[SVN r34995]
2006-08-29 20:59:37 +00:00
Daniel James 3a07fe7c22 Remove tabs.
[SVN r34994]
2006-08-29 20:55:58 +00:00
Douglas Gregor a7c753ded9 Move initialize_vertex before setting properties
[SVN r34862]
2006-08-10 13:45:12 +00:00
Douglas Gregor ac847ac715 Move initialize_vertex before setting properties
[SVN r34862]
2006-08-10 13:45:12 +00:00
Douglas Gregor 47214f4fdc Move initialize_vertex after setting properties
[SVN r34861]
2006-08-10 13:41:30 +00:00
Douglas Gregor ec2dcfddbb Move initialize_vertex after setting properties
[SVN r34861]
2006-08-10 13:41:30 +00:00
Douglas Gregor ec7156274d Give bundle_property_map a default constructor
[SVN r34812]
2006-08-03 18:30:26 +00:00
Douglas Gregor 9badc94845 Give bundle_property_map a default constructor
[SVN r34811]
2006-08-03 18:29:44 +00:00
Douglas Gregor 39b29f3d79 Give bundle_property_map a default constructor
[SVN r34811]
2006-08-03 18:29:44 +00:00
Douglas Gregor 65f63fecc1 Documentation fixes, from David Baird
[SVN r34810]
2006-08-03 18:20:43 +00:00
Douglas Gregor 7c5f9daa62 Documentation fixes, from David Baird
[SVN r34810]
2006-08-03 18:20:43 +00:00
Gennaro Prota 62cc164059 (merge from head)
fixed almost all issues reported by the inspect tool in boost/graph/


[SVN r34732]
2006-07-25 23:12:38 +00:00
Gennaro Prota fc6ec3f791 fixed almost all issues reported by the inspect tool in boost/graph/
[SVN r34731]
2006-07-25 21:14:19 +00:00
Gennaro Prota 560f485326 (merge from head)
tab removal


[SVN r34730]
2006-07-25 14:27:40 +00:00
Gennaro Prota b47cf53fcb tab removal
[SVN r34729]
2006-07-25 14:19:27 +00:00
Gennaro Prota 5898cc5bae (merge from head)
removed unnamed namespace reported by inspect tool


[SVN r34716]
2006-07-24 21:58:09 +00:00
Gennaro Prota 0d30a51129 removed unnamed namespace reported by inspect tool
[SVN r34715]
2006-07-24 21:56:37 +00:00
Douglas Gregor 1035ddac56 Work around MSVC 7.0 bug
[SVN r34656]
2006-07-21 20:25:50 +00:00
Douglas Gregor ce0f796b84 Work around VC7 bugs
[SVN r34456]
2006-07-03 18:03:34 +00:00
Rene Rivera 1b3a6936a2 Don't build old viz parser unless explicitly asked for. (merge from head)
[SVN r34442]
2006-07-02 16:43:58 +00:00
Rene Rivera ad8a07eb09 Don't build old viz parser unless explicitly asked for.
[SVN r34441]
2006-07-02 16:39:51 +00:00
Douglas Gregor b659351ea7 Fix locations of default constructors
[SVN r34422]
2006-06-28 20:00:27 +00:00
Douglas Gregor ff7a5d1282 Deal with GCC problems in updated concepts library
[SVN r34418]
2006-06-27 15:01:14 +00:00
Douglas Gregor cfe0e0b552 Include a main function
[SVN r34417]
2006-06-27 15:00:29 +00:00
Douglas Gregor 50b1f74b93 Fix parameter to add_vertices
[SVN r34414]
2006-06-27 13:53:47 +00:00
Douglas Gregor bf73135721 Fix parameter to add_vertices
[SVN r34413]
2006-06-27 13:46:36 +00:00
Caleb Epstein 826f7a33d8 boost/graph/{king_ordering,cuthill_mckee_ordering}.hpp: Fix for typedef conflict with DS macro on Solaris (merge from RC_1_34_0)
[SVN r34356]
2006-06-19 14:50:30 +00:00
Caleb Epstein 1b468cb8aa boost/graph/{king_ordering,cuthill_mckee_ordering}.hpp: Fix for typedef conflict with DS macro on Solaris
[SVN r34355]
2006-06-19 14:49:21 +00:00
Douglas Gregor fcd3996f0e Be consistent about initialize_vertex calls
[SVN r34135]
2006-06-02 15:52:46 +00:00
Douglas Gregor 05a7299c0e Be consistent about initialize_vertex calls
[SVN r34135]
2006-06-02 15:52:46 +00:00
Douglas Gregor e5848fee44 directed_category need only be convertible to one of directed_tag or undirected_tag
[SVN r34133]
2006-06-02 14:27:15 +00:00
Douglas Gregor fb06d7e38e directed_category need only be convertible to one of directed_tag or undirected_tag
[SVN r34133]
2006-06-02 14:27:15 +00:00
Dave Abrahams ebb6697936 Strip off "Concept" suffix on concept checking classes.
[SVN r33908]
2006-05-02 15:06:06 +00:00
Dave Abrahams 77e5f0701d Make it so the test will actually test something in release mode builds.
[SVN r33872]
2006-04-30 03:42:14 +00:00
Dave Abrahams 53f5645393 Fixes for concept checking; use destructors for checking classes, misc cleanup.
[SVN r33862]
2006-04-29 20:27:14 +00:00
Jeremy Siek 6b24966483 added info about iterators
[SVN r33815]
2006-04-25 15:37:53 +00:00
Jeremy Siek ac1e867af4 added edges_size_type to adjacency_list_traits
[SVN r33767]
2006-04-22 13:41:55 +00:00
Jeremy Siek 62c6d9ef2f added edges_size_type and vertices_size_type to the adjacency_list_traits
[SVN r33766]
2006-04-22 13:35:32 +00:00
Jeremy Siek 69c5cf732c added comparison operators (<,etc.) to the edge class
[SVN r33765]
2006-04-22 13:19:48 +00:00
Douglas Gregor 0b1a337f52 Don't generate self edges when asked not to, from Johan Oudinet
[SVN r33644]
2006-04-10 20:09:33 +00:00
Douglas Gregor f44af6dd2f Don't generate self edges when asked not to, from Johan Oudinet
[SVN r33644]
2006-04-10 20:09:33 +00:00
Douglas Gregor 891ec4e4e3 Move enum out of GraphParse::operator()
[SVN r33642]
2006-04-10 19:27:23 +00:00
Douglas Gregor 96a3f1fa67 Move enum out of GraphParse::operator()
[SVN r33642]
2006-04-10 19:27:23 +00:00
Douglas Gregor 64428fc074 Move enum out of GraphParse::operator()
[SVN r33641]
2006-04-10 19:24:49 +00:00
Vladimir Prus 9a10195600 Merge from trunk
[SVN r33595]
2006-04-07 13:49:45 +00:00
Vladimir Prus fcf5d92ca6 Disable debug symbols for intel
[SVN r33591]
2006-04-07 13:38:53 +00:00
nobody 0d52712c3d This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r33417]
2006-03-21 02:26:31 +00:00
Aaron Windsor 5597592ff5 Look at vertices with minimum degree 0 first instead of starting with those with minimum degree 1 (fix courtesy of Roman Dementiev)
[SVN r33414]
2006-03-21 00:26:19 +00:00
Aaron Windsor dea8296e5b Added link to maximum_cardinality_matching
[SVN r33400]
2006-03-20 00:10:43 +00:00
Aaron Windsor bcb16ef822 Bug fix from Roman Dementiev: when updating the degree of a vertex in the BucketSorter, that vertex could be moved to the wrong bucket.
[SVN r33374]
2006-03-18 17:28:50 +00:00
Aaron Windsor ce0ec9e236 Added bug fix for smallest_last_ordering.hpp from Roman Dementiev
[SVN r33373]
2006-03-18 17:26:22 +00:00
Douglas Gregor 9e359134a1 Moved to the Boost Software License
[SVN r33324]
2006-03-12 15:01:03 +00:00
Douglas Gregor be9ad03abe Update to Boost Software License
[SVN r33312]
2006-03-10 15:08:31 +00:00
Jeremy Siek dbe744f6e2 added superscript notation
[SVN r33296]
2006-03-09 22:15:41 +00:00
Jeremy Siek 9084e6ce9b added time complexity
[SVN r33294]
2006-03-09 22:13:42 +00:00
Douglas Gregor a4a5a1a42b Add dummy Directed parameter to the CSR graph
[SVN r33291]
2006-03-09 20:06:23 +00:00
Douglas Gregor f9da93dbe2 Add two_bit_color_map
[SVN r33290]
2006-03-09 19:55:13 +00:00
Douglas Gregor a0919bdff6 Fix CSR properties
[SVN r33289]
2006-03-09 19:52:39 +00:00
Douglas Gregor 573f424452 Update to Boost Software License
[SVN r33288]
2006-03-09 18:34:18 +00:00
Douglas Gregor 4a159ba118 Don't call boost::get qualified
[SVN r33286]
2006-03-09 16:23:36 +00:00
Ronald Garcia 0d6c5bb4e2 Removed unused function warning.
[SVN r33285]
2006-03-09 16:18:05 +00:00
Ronald Garcia 6616bdba33 adjusted namespace imports to be more localized.
[SVN r33284]
2006-03-09 16:16:09 +00:00
Ronald Garcia 7a6a6fcbb6 Remove unused variable warnings.
[SVN r33282]
2006-03-09 15:37:52 +00:00
Dave Abrahams 11f9e9b044 Stop using assert() in tests
[SVN r33181]
2006-02-28 22:56:33 +00:00
Douglas Gregor 399aa3b28a Give vector_as_graph a default vertex_index property
[SVN r33173]
2006-02-28 14:33:14 +00:00
Douglas Gregor a9e4925167 Tests for EdgeListS=setS
[SVN r33159]
2006-02-27 18:18:47 +00:00
Douglas Gregor 3eadd82c6b Fixes for EdgeListS=setS and static_asserts for broken functionality when EdgeListS=vecS
[SVN r33158]
2006-02-27 18:17:56 +00:00
Douglas Gregor 779274575b Properly support bundled properties for members stored in base classes of the bundle
[SVN r33156]
2006-02-27 16:35:26 +00:00
Douglas Gregor 5f28b0237a Add support for compare, combine, inf, and zero in johnson_all_pairs_shortest_paths
[SVN r33148]
2006-02-27 15:38:18 +00:00
Douglas Gregor 29a09c1fc0 Use compare and zero properly
[SVN r33146]
2006-02-27 15:15:13 +00:00
Douglas Gregor 7465bc2c20 Remove bidir_vec_remove_edge
[SVN r33145]
2006-02-27 14:33:49 +00:00
Vladimir Prus 36656fda3d Update Jamfile.v2
[SVN r33068]
2006-02-21 16:02:26 +00:00
Douglas Gregor 0245e863c8 Add some tests
[SVN r33040]
2006-02-20 21:26:46 +00:00
Alisdair Meredith af44a9cfa5 patch for infinite looping on Borland compilers
[SVN r33014]
2006-02-19 17:39:52 +00:00
Douglas Gregor 22ca266765 Improvements to biconnected components, from Janusz Piwowarski
[SVN r32902]
2006-02-13 18:42:30 +00:00
Jeremy Siek 12aa017c9f fixed url
[SVN r32830]
2006-02-11 16:07:16 +00:00
Jeremy Siek bb6401e096 tt
[SVN r32829]
2006-02-11 16:06:38 +00:00
Jeremy Siek 6cff97469a added note about serialization
[SVN r32828]
2006-02-11 16:05:22 +00:00
Jeremy Siek 75100306fe added name tag
[SVN r32827]
2006-02-11 15:48:57 +00:00
Jeremy Siek da3078ed52 added docs for serialization
[SVN r32826]
2006-02-11 15:44:14 +00:00
Douglas Gregor 70bbfe664b Some improvements from Jeremiah Willcock
[SVN r32743]
2006-02-08 16:15:16 +00:00
Douglas Gregor 3f81217fad Don't assume that null_vertex is the same type as vertices_size_type
[SVN r32740]
2006-02-08 15:37:02 +00:00
Douglas Gregor 3d7d3eb428 Work around x86 floating-point roundoff problems
[SVN r32737]
2006-02-08 14:47:35 +00:00
Douglas Gregor 7f05dc489b erdos_renyi_generator.hpp:
- Keep geometric_distribution happy by passing a non-zero probability

compressed_sparse_row_graph.hpp:
  - Weaken precondition for the Parallel BGL


[SVN r32712]
2006-02-07 17:11:29 +00:00
Douglas Gregor 70e0dd2d23 Add documentation, static_asserts for Bidirectional Graph support in adjacency_matrix
[SVN r32706]
2006-02-07 13:15:35 +00:00
Douglas Gregor 654e43a7ed Make adjacency_matrix model the BidirectionalGraph concept
[SVN r32688]
2006-02-07 04:02:22 +00:00
Douglas Gregor 4f36d52ec3 Update license
[SVN r32680]
2006-02-06 22:19:19 +00:00
Douglas Gregor 174d0d2dff Update copyrights
[SVN r32679]
2006-02-06 22:12:57 +00:00
Aaron Windsor f7db7b7771 Clean up
[SVN r32591]
2006-02-05 17:01:37 +00:00
Douglas Gregor d0176ea39d Fix call to dijkstra_shortest_paths_no_init
[SVN r32385]
2006-01-23 20:57:32 +00:00
Douglas Gregor 42b9c97d31 boost/config/stdlib/libstdcpp3.hpp:
- libstdc++ has hashed containers and slist; they're just in a different place

boost/graph/graph_utility.hpp, boost/pending/container_traits.hpp,
boost/graph/adjacency_list.hpp:
  - Deal with weird placement of slist and hash_set


[SVN r32384]
2006-01-23 20:50:27 +00:00
Douglas Gregor 0e08ed3d80 constify adjacency list write routines
[SVN r32382]
2006-01-23 19:32:55 +00:00
Douglas Gregor 665b330286 Fix a typo
[SVN r32381]
2006-01-23 19:29:16 +00:00
Vladimir Prus f36e7b9170 Update Jamfile.v2
[SVN r32351]
2006-01-18 12:46:30 +00:00
Jeremiah Willcock 7815e65261 Fixes to uses of shared_ptr
[SVN r32289]
2006-01-11 21:18:26 +00:00
Douglas Gregor eddae97983 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]
2006-01-10 13:53:48 +00:00
Douglas Gregor e96148194d Don't try to use the serialization library on GCC 2.95.3
[SVN r32274]
2006-01-10 13:43:38 +00:00
Jeremy Siek c668929a24 changed std::map to std::vector
[SVN r32252]
2006-01-06 22:16:39 +00:00
Jeremy Siek e5a0f4f5fc blah
[SVN r32251]
2006-01-06 22:09:01 +00:00
Jeremy Siek efd6f46383 changed to be compatible with old properties
[SVN r32250]
2006-01-06 22:03:54 +00:00
Jeremy Siek 61c59d9c1d added support for serialization
[SVN r32249]
2006-01-06 22:03:18 +00:00
Jeremy Siek 727a9d994d minor edit
[SVN r32248]
2006-01-06 22:02:52 +00:00
Jeremy Siek f836ed2531 updated version of the kevin bacon example to use serialization
[SVN r32246]
2006-01-06 21:44:58 +00:00
Jeremy Siek 5b572a82a3 first draft of serialization for adjacency_list
[SVN r32245]
2006-01-06 21:28:29 +00:00
Jeremiah Willcock a1b7e1cd95 Undid commit of altered version of dominator_tree.hpp
[SVN r32243]
2006-01-06 19:22:34 +00:00
Jeremiah Willcock 9df2b90f56 Refactored indexed property code into separate file
[SVN r32242]
2006-01-06 19:20:38 +00:00
Douglas Gregor 183d88cfb6 Oops, fix non-bundled properties support
[SVN r32236]
2006-01-06 14:14:57 +00:00
Douglas Gregor 472dba30ed Bundled properties now work with adjacency_list I/O
[SVN r32235]
2006-01-06 14:01:55 +00:00
Douglas Gregor d8fc6477d7 Start fixing adjacency_list I/O with bundled properties
[SVN r32234]
2006-01-06 13:17:35 +00:00
Douglas Gregor 2a204d5482 Pull in std::floor
[SVN r32229]
2006-01-05 21:57:36 +00:00
Douglas Gregor db9796ddfd sqrt is in namespace std
[SVN r32197]
2006-01-01 17:20:32 +00:00
Vladimir Prus d629b74d98 Update Jamfile.v2
[SVN r32138]
2005-12-22 10:40:28 +00:00
Vladimir Prus 421842272a Update Jamfile.v2: also compile read_graphviz_spirit.
[SVN r32137]
2005-12-22 10:38:18 +00:00
Vladimir Prus c4d72905bf Remove a couple of "signed/unsigned comparison" warnings from gcc.
Note sure how it went unnoticed.


[SVN r32136]
2005-12-22 09:50:23 +00:00
Aaron Windsor f497c3d195 Modified the predicate used by filtered_graph to avoid errors caused by default-initializing iterator property maps uncovered by gcc in _GLIBCXX_DEBUG mode. Included <algorithm> header for std::sort.
[SVN r32127]
2005-12-22 00:09:22 +00:00
Douglas Gregor 86e4dd21af Documentation updates from JongSoo
[SVN r32126]
2005-12-21 15:28:48 +00:00
Douglas Gregor c8ffc289d9 Overhead calculation
[SVN r32120]
2005-12-20 23:04:16 +00:00
Douglas Gregor 5879c83284 Add sorted_erdos_renyi_iterator, from Jeremiah Willcock
[SVN r32119]
2005-12-20 21:59:51 +00:00
Douglas Gregor 8041171b33 Documentation for JongSoo Park's dominator tree implementation
[SVN r32115]
2005-12-20 16:55:11 +00:00
Jeremiah Willcock 1e416130db Removed redundant copy of erdos_renyi_iterator
[SVN r32082]
2005-12-16 21:48:33 +00:00
Douglas Gregor 2e318dccc1 Don't allow the use of the libstdc++ debug mode with this test
[SVN r32009]
2005-12-12 22:01:08 +00:00
Douglas Gregor 02f8dbe592 Initialization fixes for Dijkstra's single-source shortest paths and breadth-first search
[SVN r32000]
2005-12-12 15:53:50 +00:00
Jeremiah Willcock 18586182a1 Fixed bug when running with _GLIBCXX_DEBUG on
[SVN r31972]
2005-12-10 00:50:17 +00:00
Jeremiah Willcock 0d93784f95 Fixed bug in dominator tree code (trying to increment iterator which was erased)
[SVN r31971]
2005-12-09 23:19:38 +00:00
Jeremiah Willcock 9225f94c4b Added qualification to std::time to fix CodeWarrior test failure
[SVN r31970]
2005-12-09 22:54:11 +00:00
Jeremiah Willcock 69317c5bdc Fixed some CSR and Kruskal bugs, plus trying to get more tests to pass
[SVN r31963]
2005-12-09 06:20:49 +00:00
Jeremiah Willcock ada2d70c01 Added extra qualification to try to fix CW9.4 regression failure
[SVN r31959]
2005-12-08 20:44:12 +00:00
Jeremiah Willcock 5271a6bef6 Used different names for different types to try to fix or isolate VC8 regression failures
[SVN r31958]
2005-12-08 20:43:34 +00:00
Douglas Gregor 6937336a09 Merged from Version_1_33_1
[SVN r31949]
2005-12-08 03:23:02 +00:00
Jeremiah Willcock 9ba47b4b7b Changed log2 to log_base_2 because log2 is a macro on some platforms
[SVN r31905]
2005-12-04 18:50:40 +00:00
Jeremiah Willcock bb1fba7555 Attempted portability fixes
[SVN r31903]
2005-12-04 18:45:47 +00:00
Douglas Gregor e87ac08817 Work around min/max stupidities in Visual C++ headers
[SVN r31899]
2005-12-04 17:24:50 +00:00
Jeremiah Willcock cc60980341 Tried to fix VC8 compatibility problem
[SVN r31898]
2005-12-04 05:41:13 +00:00
Jeremiah Willcock 6fe01d0c4c Added more comprehensive CSR tests, and fixed a few m_last_source-related bugs
[SVN r31897]
2005-12-04 05:28:26 +00:00
Jeremiah Willcock 29d60b8e6a Fixed bug in edge_from_index() when used with partially constructed CSR graphs
[SVN r31894]
2005-12-03 22:24:28 +00:00
Jeremiah Willcock 0e2f464666 Added incremental construction functions to compressed_sparse_row_graph, along with tests and documentation
[SVN r31893]
2005-12-03 21:18:49 +00:00
Douglas Gregor 1e42266075 Dominator tree computation, from JongSoo Park
[SVN r31881]
2005-12-02 16:05:55 +00:00
Douglas Gregor aa3dcfb2e1 Add example for CSR graph
[SVN r31880]
2005-12-02 15:24:02 +00:00
Douglas Gregor 9be555c4f5 Do the complete Where Defined thing
[SVN r31879]
2005-12-02 14:13:52 +00:00
Douglas Gregor 8899a047d4 Discuss actual CSR format
[SVN r31878]
2005-12-02 14:12:44 +00:00
Douglas Gregor 6c93d9b187 Improve documentation for CSR graph
[SVN r31877]
2005-12-02 13:58:18 +00:00
Douglas Gregor a5c1c8d953 Improvements and documentation for compressed_sparse_row_graph
[SVN r31871]
2005-12-01 23:42:01 +00:00
Douglas Gregor 80147f664b Add support for internal properties to the CSR graph
[SVN r31869]
2005-12-01 20:55:37 +00:00
Douglas Gregor 7ae0a8d974 Move constructor parameter to match adjacency_list
[SVN r31866]
2005-12-01 18:28:51 +00:00
Douglas Gregor 549f85c80f Compressed sparse row graph type
[SVN r31865]
2005-12-01 18:24:00 +00:00
Rene Rivera 4df63cf4f3 Merge from RC_1_33_0.
[SVN r31706]
2005-11-19 20:40:20 +00:00
Rene Rivera 6466795448 Merge from RC_1_33_0.
[SVN r31704]
2005-11-19 19:56:13 +00:00
Douglas Gregor 4373b57677 Fix typos
[SVN r31147]
2005-09-29 13:36:46 +00:00
Douglas Gregor 97e891fee0 Use named parameters where appropriate
[SVN r31132]
2005-09-27 14:01:18 +00:00
Jeremy Siek cd346002ea changed some stuff, rearranged and added example
[SVN r31022]
2005-09-18 15:18:19 +00:00
Aaron Windsor 48577cde2f Added external vertex index maps to two function calls where they were missing.
[SVN r31015]
2005-09-17 16:00:55 +00:00
Jeremy Siek 0a4891fcf0 added notes about vertex_index default
[SVN r30998]
2005-09-15 15:38:21 +00:00
Jeremy Siek 91e1935e1d added note about default for vertex_index
[SVN r30997]
2005-09-15 15:21:04 +00:00
Jeremy Siek 8fe7018793 fixed range
[SVN r30995]
2005-09-15 14:22:23 +00:00
Douglas Gregor 85e1d7e344 Remove unnecessary typename
[SVN r30990]
2005-09-15 02:05:00 +00:00
Aaron Windsor ca5bbacc2e Made a few cosmetic changes to the code and simplified the loop that walks up blossoms to find nearest common ancestors.
[SVN r30987]
2005-09-14 16:53:18 +00:00
Douglas Gregor b48254406d Add visitor and named parameter support to biconnected_componnets, from Janusz Piwowarski
[SVN r30919]
2005-09-12 15:25:09 +00:00
Douglas Gregor 49ca29e905 Always use log2
[SVN r30916]
2005-09-12 14:58:37 +00:00
Douglas Gregor e10fef2660 Use an integer log2 instead of the double version
[SVN r30892]
2005-09-09 22:15:05 +00:00
Douglas Gregor fddbb9b66e Add matching_test
[SVN r30859]
2005-09-07 19:12:17 +00:00
Douglas Gregor 48867ed3ab Add bibliography entry for Edmonds maximum cardinality matching algorithm
[SVN r30858]
2005-09-07 18:01:43 +00:00
Douglas Gregor 75d3e89442 Add/fix entry for edmonds_maximum_cardinality_matching
[SVN r30850]
2005-09-07 15:45:27 +00:00
Douglas Gregor ba824058ef edmonds_maximum_cardinality_matching, from Aaron Windsor
[SVN r30848]
2005-09-07 15:39:03 +00:00
Stefan Slapeta fe508c8c46 Turn off debug info for layout_test on intel
[SVN r30745]
2005-08-31 08:23:59 +00:00
Douglas Gregor 73a5b07661 Workaround for GCC 2.95.3
[SVN r30646]
2005-08-24 14:25:37 +00:00
Jeremy Siek bbe399a2b0 added default initialization for property::m_value to quiet warning from gcc 4.0.1
[SVN r30629]
2005-08-22 14:47:48 +00:00
Douglas Gregor 786336804e Fully qualify detail namespace
[SVN r30619]
2005-08-22 01:53:37 +00:00
Jeremy Siek 869dab48ef member functions -> free functions
[SVN r30603]
2005-08-18 14:33:47 +00:00
Vladimir Prus b62baf4ec1 Support null_vertex for filtered_graph.
Thanks to Tiago de Paula Peixoto for the bug report.


[SVN r30583]
2005-08-15 06:13:19 +00:00
Douglas Gregor cf9d1521d8 Merged from 1.33.0 release
[SVN r30540]
2005-08-12 13:02:37 +00:00
Douglas Gregor 6df693c448 get_property fix for subgraph
[SVN r30220]
2005-07-22 19:22:00 +00:00
Douglas Gregor 64f732195e Make vertices and edges support len()
[SVN r30189]
2005-07-20 17:05:47 +00:00
Douglas Gregor 034950f993 pickle.cpp: Work around MSVC 7.1 bugs
[SVN r30180]
2005-07-19 16:27:00 +00:00
Douglas Gregor 309f243ea1 Adorn vertex_descriptor
[SVN r30020]
2005-07-12 18:44:02 +00:00
Douglas Gregor 9294975522 Fix blips in inspection report
[SVN r29996]
2005-07-12 03:10:33 +00:00
Douglas Gregor 50bd84a168 Example
[SVN r29995]
2005-07-12 02:37:50 +00:00
Douglas Gregor 7ce3496b77 basic_graph.cpp:
- Fix bugs pointed out by Apple's GCC 4.0.0

page_rank.cpp:
  - Make the "done" version actually work

visitor.hpp:
  - Undefine BGL_VISITOR_EVENT properly


[SVN r29931]
2005-07-07 14:02:32 +00:00
Douglas Gregor 6aca595636 Eliminate unused output_heap function
[SVN r29929]
2005-07-07 13:57:16 +00:00
Douglas Gregor eaffe5d5d0 Eliminate need for unistd.h, isatty
[SVN r29928]
2005-07-07 13:08:00 +00:00
Douglas Gregor 39868b1498 Cannot write to a vec_adj_list_vertex_id_map
[SVN r29915]
2005-07-07 03:33:44 +00:00
Douglas Gregor f11b29f1e7 Add some necessary defines
[SVN r29906]
2005-07-06 13:04:17 +00:00
Douglas Gregor ad169e0261 Eat carriage returns, too
[SVN r29903]
2005-07-05 21:39:51 +00:00
Douglas Gregor 6bc7f34a38 silence a useless MSVC warning
[SVN r29897]
2005-07-05 11:52:49 +00:00
Douglas Gregor ce4eb73bfa Try to turn off optimization for Intel compiler, because it ICEs the compiler
[SVN r29896]
2005-07-05 11:38:39 +00:00
Douglas Gregor 6864b4cb77 Do not use bracket syntax when we're only reading a property map
[SVN r29847]
2005-06-30 18:41:02 +00:00
Douglas Gregor 72ad366ad3 Work around stupid min/max macros, AGAIN
[SVN r29774]
2005-06-24 14:33:32 +00:00
Douglas Gregor c113d0c078 Make relax work when we're searching for longest paths
[SVN r29760]
2005-06-23 19:12:02 +00:00
Douglas Gregor 82e676d99f Fix main signature
[SVN r29740]
2005-06-22 18:25:59 +00:00
Douglas Gregor f11331b2f1 Pickle support
[SVN r29735]
2005-06-22 14:58:25 +00:00
Douglas Gregor 9934fd8da4 Fix constructor call
[SVN r29560]
2005-06-14 13:52:02 +00:00
Douglas Gregor d745a537bf Fix conversion of Python objects to strings
[SVN r29515]
2005-06-10 11:55:59 +00:00
Douglas Gregor 4e3c936503 Deal with macroized max
[SVN r29494]
2005-06-09 15:49:08 +00:00
Douglas Gregor 0e295d01c3 Fix depth_first_search root_vertex for Digraph
[SVN r29476]
2005-06-08 14:05:08 +00:00
Douglas Gregor b9a10e2861 Support root_vertex in depth_first_search
[SVN r29473]
2005-06-08 05:59:57 +00:00
Rene Rivera d76004af71 Fixes to make things compile for CW, and possibly others.
* Makefile; don't output "#line" info to prevent some errors parsing file names.
* *parser.cpp; Remove problematic "#line" directives until these files get regenerated from source.
* *parser.cpp; Add "using namespace std;" as free/malloc, possible others, are used and other fail on more conforming compilers.


[SVN r29347]
2005-06-01 15:32:06 +00:00
Victor A. Wagner Jr. 0fbae0aeff Changed - some double constants to floats to stop data-loss warnings
[SVN r29079]
2005-05-19 22:05:48 +00:00
Douglas Gregor 63a3c9ce83 Update parameter names in non-named parameter version to match those in the named parameter version
[SVN r28775]
2005-05-10 00:19:01 +00:00
Eric Niebler 656907543a min/max fixes
[SVN r28750]
2005-05-09 01:00:41 +00:00
Douglas Gregor 52507c33cf Don't dereference NULL pointers, even though the code will never run
[SVN r28654]
2005-05-04 14:42:38 +00:00
Douglas Gregor 862343d802 Fix some typos
[SVN r28582]
2005-05-02 15:53:01 +00:00
Douglas Gregor c1503a89a5 Edmunds-Karp also requires IncidenceGraph
[SVN r28580]
2005-05-02 15:39:23 +00:00
Douglas Gregor 87588dd9ff Support set_property and get_property
[SVN r28579]
2005-05-02 15:33:35 +00:00
Douglas Gregor c3ec244c89 Documentation and example patch from Andreas Scherer
[SVN r28578]
2005-05-02 15:16:34 +00:00
Douglas Gregor 38b526762a Document which compilers work well with the BGL-Python bindings
[SVN r28418]
2005-04-22 14:28:55 +00:00
Douglas Gregor 41ebb5fbc1 boost/graph/king_ordering.hpp:
- Try to get bind invocation working on vc7

libs/graph/test/bellman-test.cpp:
  - Just don't run parts of this test on vc7 or older

libs/graph/test/gursoy_atun_layout_test.cpp:
  - Pull in names from ::boost so that vc7 can find them.


[SVN r28416]
2005-04-22 14:18:24 +00:00
Douglas Gregor 0a589fd44a Work around broken standard libraries
[SVN r28414]
2005-04-22 13:58:23 +00:00
Douglas Gregor 430aef4b59 Apply Joel's workaround for VC++ 8.0 as well as 7.1
[SVN r28409]
2005-04-22 11:47:48 +00:00
Douglas Gregor 66e61339b1 Turn off debug symbols by default
[SVN r28397]
2005-04-22 02:25:07 +00:00
Douglas Gregor 90f1ec41a4 Jamfile: Use -GR- instead of /GR- to keep bjam from flipping the slash to a backslash
python\Jamfile: Default to linking against the Boost.Python DLL, although we'll have to fix stuff on Mac OS X


[SVN r28396]
2005-04-22 00:32:14 +00:00
Douglas Gregor 289715b159 Turn off optimization for the visualization lib
[SVN r28395]
2005-04-21 23:58:14 +00:00
Douglas Gregor b904a829b6 king_ordering.hpp: Access colors vector with index, not vertex
[SVN r28383]
2005-04-21 14:47:55 +00:00
Joel de Guzman e184561762 Workaround for VC7.1
[SVN r28363]
2005-04-21 05:20:51 +00:00
Douglas Gregor 34bc3a8786 doc/*: Document Python bindings
src/python/basic_graph.cpp src/python/basic_graph.hpp:
  - Add ability to record the names of vertices input via the adjacency list
    reader.

example/python/breadth_first_search.py: Building a better example


[SVN r28350]
2005-04-20 23:45:55 +00:00
Douglas Gregor efc05efebd Document all of the BGL algorithms that are available in the Python bindings.
In some cases, tweak the implementations where they didn't make sense.


[SVN r28344]
2005-04-20 20:08:35 +00:00
Douglas Gregor 9fe51b2a58 cuthill_mckee_ordering.hpp, king_ordering.hpp:
- Use 3-parameter make_iterator_property_map, for stupid compilers

graph_traits.hpp:
  - Work around partial specialization bugs in GCC 2.95.3 and, potentially,
    CodeWarrior <= 9.4

properties.hpp:
  - I think Intel <= 7.1 can handle bundled properties...


[SVN r28338]
2005-04-20 14:57:00 +00:00
Douglas Gregor 631d35bcc2 Started documenting Python bindings
libs/graph/src/python/basic_graph.cpp, libs/graph/src/python/basic_graph.hpp:
  - Allow one to build a graph from anything that looks like a Python list or
    tuple.


[SVN r28324]
2005-04-19 17:01:07 +00:00
Douglas Gregor 003e90151e Deal with local/global issues with subgraph bundled properties
[SVN r28307]
2005-04-18 03:20:16 +00:00
Douglas Gregor 4bc19a1621 boost/graph/cuthill_mckee_ordering.hpp, boost/graph/king_ordering.hpp:
- Remove use of connected components, so we need only one color map
    running around
  - Provide simple overloads, requiring only the graph and the output iterator.

boost/graph/detail/sparse_ordering.hpp:
  - Move out_degree_property_map here

boost/graph/fruchterman_reingold.hpp:
  - Fix enumeration of pairs in grid_force_pairs to repulse vertices in
    adjacent grid cells (in addition to the current cell), so we don't get
    vertices forming crosses on grid lines.
  - Round up the number of rows/columns.

libs/graph/doc/cuthill_mckee_ordering.html, libs/graph/doc/king_ordering.html:
  - Document new overloads

libs/graph/doc/gursoy_atun_layout.html:
  - Add missing semicolon

libs/graph/src/python/cuthill_mckee_ordering.cpp,
libs/graph/test/cuthill_mckee_ordering.cpp:
  - Test and use the new overloads

libs/graph/build/python/Jamfile, libs/graph/src/python/module.cpp,
libs/graph/src/python/king_ordering.cpp:
  - Support King's ordering algorithm from Python

libs/graph/example/python/vis.py:
  - By default, do a "progressive" Fruchterman-Reingold layout

libs/graph/test/king_ordering.cpp:
  - Test new overload


[SVN r28306]
2005-04-17 23:50:43 +00:00
Douglas Gregor ea6d11a47e Fix bundled properties support in filtered_graph adaptor and add it to reverse_graph adaptor
[SVN r28291]
2005-04-17 13:47:52 +00:00
Douglas Gregor 041f615cc3 boost/graph/filtered_graph.hpp, boost/graph/graph_traits.hpp,
boost/graph/subgraph.hpp:
  - Support bundled properties in graph adaptors

libs/graph/test/bundled_properties.cpp:
  - Test subgraph with bundled properties

libs/graph/doc/history.html:
  - Document what we did


[SVN r28265]
2005-04-15 07:23:47 +00:00
Douglas Gregor cfb03e5e10 Work around MSVC6 bugs
[SVN r28258]
2005-04-14 23:14:00 +00:00
Douglas Gregor 5220440e86 Copyright statement and a using directive
[SVN r28257]
2005-04-14 23:08:24 +00:00
Douglas Gregor 9915f79681 Work around bugs in Intel 7.1 compiler and VC6 library
[SVN r28255]
2005-04-14 22:55:14 +00:00
Douglas Gregor 2e67897926 Workaround for standard libraries without templated iterator constructors
[SVN r28254]
2005-04-14 22:22:38 +00:00
Douglas Gregor 1a6a672c6e Prune back the betweenness centrality test graph size
[SVN r28253]
2005-04-14 21:52:57 +00:00
Douglas Gregor 1420cc346d Work around a very picky Tru64 compiler whose asserts don't like to convert
[SVN r28252]
2005-04-14 21:50:09 +00:00
Vladimir Prus 6b15ae6041 Change lib name to match V1
[SVN r28240]
2005-04-14 11:32:36 +00:00
Douglas Gregor 6ae80231b2 Lots of portability fixes throughout the graph library
[SVN r27997]
2005-04-06 03:48:20 +00:00
Douglas Gregor 8d1a7de32f Support mixed-case keywords in GraphViz parser
[SVN r27948]
2005-04-04 02:27:36 +00:00
Douglas Gregor 66ee37fbf4 Test sparse matrix ordering
[SVN r27909]
2005-04-01 20:45:39 +00:00
Douglas Gregor cfc4c1b7d1 Add Sparse Matrix Ordering section, with King, Cuthill-McKee, and MMO algorithms
[SVN r27908]
2005-04-01 20:22:08 +00:00
Douglas Gregor 9eb9501c27 boost/graph/cuthill_mckee_ordering.hpp:
- Support for multiple components
  - Recast as invocation of breadth_first_search

boost/graph/king_ordering.hpp:
  - King's algorithm for sparse matrix ordering

boost/graph/detail/sparse_ordering.hpp:
  - Details for the sparse matrix ordering algorithms

libs/graph/example/king_ordering.cpp,
libs/graph/example/cuthill_mckee_ordering.cpp:
  - Usage examples for the sparse matrix ordering algorithms

libs/graph/doc/bibliography.html, libs/graph/doc/cuthill_mckee_ordering.html,
libs/graph/doc/king_ordering.html:
  - Updated documentation to reflect new implementations

libs/graph/doc/history.html, index_1_33_0.htm:
  - Announcements


[SVN r27907]
2005-04-01 20:18:45 +00:00
Douglas Gregor e3455c28eb src/python/graphviz.cpp, src/python/module.cpp:
- Export GraphViz exceptions to Python

src/python/module.cpp:
  - Support directed graphs

example/python/vis.py:
  - Support directed graphs


[SVN r27890]
2005-03-30 23:35:21 +00:00
Douglas Gregor 08119fe298 Work around floating-point inaccuracy failures
[SVN r27877]
2005-03-30 04:38:23 +00:00
Douglas Gregor bbb0b30dd3 Fix issues with separate compilation of GraphViz reader
[SVN r27870]
2005-03-29 18:36:31 +00:00
Douglas Gregor 2242193f11 Boost Software License conversion
[SVN r27869]
2005-03-29 18:04:18 +00:00
Douglas Gregor 3623623cf9 Converted to Boost Software License
[SVN r27802]
2005-03-24 15:10:49 +00:00
Douglas Gregor e75984a2fb Converted to Boost Software License
[SVN r27801]
2005-03-24 15:06:43 +00:00
Douglas Gregor 2577136447 Converted to Boost Software License
[SVN r27800]
2005-03-24 14:54:12 +00:00
Douglas Gregor 1fa1cd881b Default stylesheet
[SVN r27799]
2005-03-24 14:24:11 +00:00
Douglas Gregor 63be68e1cb Undo a misguided optimization
[SVN r27798]
2005-03-24 14:12:37 +00:00
Douglas Gregor 88c47b4995 Document requirements on property values
[SVN r27786]
2005-03-23 18:53:58 +00:00
Douglas Gregor baea51cfa6 Add random graph generators
[SVN r27785]
2005-03-23 18:45:15 +00:00
Douglas Gregor c6b23e89cf Compiled version of the GraphViz reader
[SVN r27784]
2005-03-23 18:41:06 +00:00
Douglas Gregor 6f84b0e9c8 Compile the GraphViz reader separately, for sanity's sake
[SVN r27783]
2005-03-23 18:40:03 +00:00
Douglas Gregor 1d25fe6892 Be sure to compile with optimization
[SVN r27768]
2005-03-22 20:24:25 +00:00
Douglas Gregor c4b48cd144 Provide typedefs for the adjacency_list selectors
[SVN r27738]
2005-03-18 19:22:50 +00:00
Douglas Gregor fb4e0aebd6 Remove-last-vertex optimization (Vikram Shrowty)
[SVN r27731]
2005-03-18 04:47:40 +00:00
Douglas Gregor 91ccce062e Make bundled properties type accessible
[SVN r27730]
2005-03-18 04:31:29 +00:00
Douglas Gregor 1f0e952ff2 No need to print the JAMUNAME
[SVN r27714]
2005-03-16 22:24:30 +00:00
Douglas Gregor ce4275cf9b Link against boost_python statically, because it's easier
[SVN r27713]
2005-03-16 22:18:30 +00:00
Douglas Gregor 15b83ced14 Sequential vertex coloring
[SVN r27708]
2005-03-16 15:38:35 +00:00
Douglas Gregor e2649f122f Vis stuff
[SVN r27704]
2005-03-16 14:19:09 +00:00
Douglas Gregor 0d9a96fec4 Fixes and tweaks
[SVN r27703]
2005-03-16 14:15:25 +00:00
Douglas Gregor 0e0507520b Add graph generators
[SVN r27678]
2005-03-15 22:44:11 +00:00
Douglas Gregor 65339366d3 Random graph generators
[SVN r27677]
2005-03-15 20:02:54 +00:00
Douglas Gregor 4f9118a1d5 Forward iterators, not input iterators
[SVN r27668]
2005-03-15 14:11:33 +00:00
Douglas Gregor 8f2516eefb Fix typo
[SVN r27653]
2005-03-14 16:53:00 +00:00
Douglas Gregor 6e4ed79c88 More algorithms
[SVN r27652]
2005-03-14 16:39:34 +00:00
Douglas Gregor 5ce0418131 Added is_directed member function
[SVN r27651]
2005-03-14 16:27:52 +00:00
Douglas Gregor 426d8e1244 Don't copy singular iterators
[SVN r27650]
2005-03-14 16:23:54 +00:00
Douglas Gregor 972743058e Add clear() member
[SVN r27649]
2005-03-14 16:16:03 +00:00
Douglas Gregor 8b8d0183dc Scope not1
[SVN r27648]
2005-03-14 15:15:18 +00:00
Douglas Gregor fb2a029e97 Fix for very small graphs
[SVN r27647]
2005-03-14 15:10:27 +00:00
Douglas Gregor 896ddc7d95 ReadablePropertyMap fixes
[SVN r27605]
2005-03-10 19:50:45 +00:00
Douglas Gregor 3ba84d959e Fixes for VC 7.1 and some new algorithms
[SVN r27604]
2005-03-10 19:48:18 +00:00
Vladimir Prus 3c045dd60e Fix the issue with dag_shortest_paths discussed in
http://article.gmane.org/gmane.comp.lib.boost.devel/111573/


[SVN r27596]
2005-03-10 11:19:12 +00:00
Douglas Gregor 76483e6dcc Fix digraph typo
[SVN r27584]
2005-03-08 20:32:48 +00:00
Douglas Gregor 9203aaf140 Compiler workarounds
[SVN r27583]
2005-03-08 20:29:29 +00:00
Douglas Gregor 0c1817ada1 More tests
[SVN r27581]
2005-03-08 19:34:53 +00:00
Douglas Gregor 3bb1276271 Added new algorithms
[SVN r27580]
2005-03-08 19:12:16 +00:00
Douglas Gregor d3d9fdc0e5 Lots of new algorithms and cleanups of old ones
[SVN r27579]
2005-03-08 18:54:45 +00:00
Douglas Gregor 760b7f6c45 Some trivial cleanups
[SVN r27575]
2005-03-08 13:14:18 +00:00
Douglas Gregor 77ca9c37ca Works in progress
[SVN r27561]
2005-03-05 14:59:32 +00:00
Douglas Gregor 1e359e31ed Input file for biconnected_components example
[SVN r27558]
2005-03-04 23:47:57 +00:00
Douglas Gregor f237b9feee Biconnected components support
[SVN r27557]
2005-03-04 23:47:10 +00:00
Douglas Gregor 4167abcb5d Use vertex index maps
[SVN r27556]
2005-03-04 23:45:08 +00:00
Douglas Gregor 852cc06c85 lowpt stores indices, not values
[SVN r27555]
2005-03-04 23:26:26 +00:00
Douglas Gregor 4a0081feb3 BSF and Dijkstra example and test
[SVN r27553]
2005-03-04 15:01:50 +00:00
Douglas Gregor 7c446ad0d4 Copyrightify and licensify
[SVN r27552]
2005-03-04 14:53:56 +00:00
Douglas Gregor a882494f03 Support color maps properly
[SVN r27548]
2005-03-03 21:09:05 +00:00
Douglas Gregor d31c4b5a04 Finalize BFS
[SVN r27547]
2005-03-03 20:40:06 +00:00
Douglas Gregor 961a7d09cc Add support for dijkstra_shortest_paths
[SVN r27546]
2005-03-03 20:11:12 +00:00
Douglas Gregor a8488328b1 Fullly generic BFS, comin' at ya
[SVN r27541]
2005-03-03 17:22:17 +00:00
Douglas Gregor 3cca66df9c PageRank implementation
[SVN r27538]
2005-03-03 14:27:59 +00:00
Douglas Gregor 6bf503fa56 Initial version
[SVN r27536]
2005-03-03 14:06:42 +00:00
Douglas Gregor e88397d209 PageRank for Python
[SVN r27535]
2005-03-03 14:05:12 +00:00
Douglas Gregor cdc7c6fcc8 Build bgl extension module
[SVN r27534]
2005-03-03 13:53:43 +00:00
Douglas Gregor 5754d6d866 Fix directed/undirected checks
[SVN r27531]
2005-03-01 22:52:26 +00:00
Douglas Gregor b9f793cefd Fix a typo
[SVN r27530]
2005-03-01 19:15:05 +00:00
Douglas Gregor 4ebce62921 More qualification to protect against accidentally getting boost::bind instead of phoenix::bind
[SVN r27529]
2005-03-01 19:12:22 +00:00
Douglas Gregor 03368b302f Trivial rearrangement to work around an Apple GCC Bug
[SVN r27528]
2005-03-01 19:11:46 +00:00
Rene Rivera 3390d77e28 Apply typo fixes from Julio M. Merino Vidal
[SVN r27513]
2005-02-27 17:28:24 +00:00
Douglas Gregor c0783b62c0 DFS-based biconnected components, from Janusz Piwowarski
[SVN r27442]
2005-02-20 01:08:11 +00:00
Douglas Gregor 85daa2c5c6 Proofreading fixes from Rich Morin
[SVN r27427]
2005-02-19 16:00:56 +00:00
Douglas Gregor 429f5c9d25 Fix a typo
[SVN r27418]
2005-02-18 15:36:53 +00:00
Douglas Gregor c154f4ff95 Joel is da MAN
[SVN r27298]
2005-02-10 04:14:42 +00:00
Douglas Gregor 1f33664599 Broken example...
[SVN r27276]
2005-02-09 15:26:07 +00:00
Douglas Gregor cc462f60ec write_graphviz supports dynamic_properties now
[SVN r27275]
2005-02-09 15:24:49 +00:00
Douglas Gregor 4864d12d0c New GraphViz example
[SVN r27274]
2005-02-09 15:05:58 +00:00
Douglas Gregor 121f9b26c3 Fix handling of double-quoted property values
[SVN r27256]
2005-02-08 21:04:24 +00:00
Douglas Gregor 414d9cfeee Use minimal test tools
[SVN r27251]
2005-02-08 19:11:20 +00:00
Douglas Gregor a6f984b406 Add Ron Garcia's new GraphViz parser.
[SVN r27250]
2005-02-08 18:58:24 +00:00
Douglas Gregor b02d2011a8 Fix clear
[SVN r27242]
2005-02-08 15:59:42 +00:00
Douglas Gregor 60e424c882 Permit empty attribute lists
[SVN r27241]
2005-02-08 14:52:29 +00:00
Stefan Slapeta 81703b0fb5 fixed some minor issues
[SVN r27240]
2005-02-08 12:46:40 +00:00
Stefan Slapeta 534b3efa0a replaced BOOST_TEST
[SVN r27239]
2005-02-08 12:33:07 +00:00
Stefan Slapeta 500be67439 Replaced BOOST_TEST
[SVN r27050]
2005-02-03 12:27:14 +00:00
Douglas Gregor bbd352bd57 Give queue a swap()
[SVN r27043]
2005-02-02 18:59:11 +00:00
Douglas Gregor 558b1a2fef Always include algorithm header, for swap
[SVN r26939]
2005-01-30 17:14:46 +00:00
Douglas Gregor 216a5a7f12 Do not use atoi, atof
[SVN r26938]
2005-01-30 17:12:45 +00:00
Douglas Gregor 7fecf688bc Reduce reliance on test lib
[SVN r26894]
2005-01-28 08:08:18 +00:00
Douglas Gregor ef5fdd8cc6 Document some known problems
[SVN r26892]
2005-01-28 07:44:25 +00:00
Douglas Gregor bc931e3286 Remove extra template parameters
[SVN r26887]
2005-01-28 07:06:18 +00:00
Douglas Gregor 48d9ef8f54 Deal with min/max issues on Windows
[SVN r26797]
2005-01-21 22:47:58 +00:00
Douglas Gregor 0dc01eca8c Do not use log2, which is C99-only
[SVN r26765]
2005-01-20 21:21:44 +00:00
Douglas Gregor 111151a177 Add umlaut
[SVN r26764]
2005-01-20 20:53:58 +00:00
Douglas Gregor 56bfe6f4b7 Fix node movement for weighted graphs and update documentation
[SVN r26763]
2005-01-20 20:52:46 +00:00
Douglas Gregor 01f0eb9ad3 Fixes from François Dumont
[SVN r26693]
2005-01-14 05:33:42 +00:00
Douglas Gregor 02635807ce Added contains() method to check if a heap contains a certain element
[SVN r26625]
2005-01-04 15:17:40 +00:00
Douglas Gregor 2ffc396f29 boost/pending/relaxed_heap.hpp:
- Relaxed heap data structure implementation

boost/graph/dijkstra_shortest_paths.hpp:
  - Use relaxed heap, with a debugging option allowing one to use the binary
    heap instead

libs/graph/test/relaxed_heap_test.cpp:
  - Comprehensive test of the relaxed heap

libs/graph/test/dijkstra_heap_performance.cpp:
  - Test the performance of the relaxed heap against the binary heap via
    Erdos-Renyi graphs.

libs/graph/test/Jamfile:
  - Introduce tests of relaxed heap

libs/graph/doc/dijkstra_shortest_paths.html:
  - Updated complexity to O(V log V), finally!
  - Cite relaxed heaps paper

libs/graph/doc/bibliography.html:
  - Added relaxed heap reference

index.htm, libs/graph/doc/history.html:
  - Announce introduction of relaxed heap


[SVN r26623]
2005-01-04 14:34:45 +00:00
Douglas Gregor 77ff4c53b8 Fixes for x86 Solaris
[SVN r26622]
2005-01-04 14:20:02 +00:00
Douglas Gregor f2a49988ce Work around bug in GCC 2.95.3 standard library
[SVN r26604]
2004-12-29 16:53:05 +00:00
Douglas Gregor 867851b81f Try to work around GCC 2.95.3 issue with min
[SVN r26603]
2004-12-29 16:41:15 +00:00
Douglas Gregor 5c155ac7a5 Blindly try to work around a CW bug
[SVN r26602]
2004-12-29 16:36:56 +00:00
Douglas Gregor bec9d1c8df Switch random generator to minstd_rand
[SVN r26569]
2004-12-21 20:17:18 +00:00
Douglas Gregor bf9af6d93a Gursoy-Atun layout
[SVN r26567]
2004-12-21 19:59:37 +00:00
Douglas Gregor e92cb8cf50 Better describe the result of add_edge
[SVN r26565]
2004-12-21 16:21:38 +00:00
Douglas Gregor 5b13bec33a Deal with stupid compilers that have min and max macros
[SVN r26564]
2004-12-21 13:48:29 +00:00
Victor A. Wagner Jr. 65f8821e60 Changed - all the \r only to \r\n on windows. CVS should get things all fixed up now
[SVN r26561]
2004-12-20 22:43:49 +00:00
Douglas Gregor dff6200ce2 Make num_edges/num_vertices behavior much more explicit
[SVN r26554]
2004-12-20 15:40:35 +00:00
Douglas Gregor 1d39ccd924 Deal with max when it is a macro
[SVN r26551]
2004-12-20 04:57:04 +00:00
Douglas Gregor 28a1a88128 Bibliography entry for sequential_vertex_coloring
[SVN r26535]
2004-12-16 21:54:19 +00:00
Douglas Gregor 610cecce12 Work around issue with get() and GCC 3.4.3
[SVN r26534]
2004-12-16 16:50:52 +00:00
Douglas Gregor 5604226901 Fixed, documented, and tested sequential_vertex_coloring
[SVN r26533]
2004-12-16 15:50:31 +00:00
Douglas Gregor f27670da66 Move remove_directed_edge_dispatch up, thanks to Jurgen Hunold
[SVN r26529]
2004-12-16 14:03:02 +00:00
Vladimir Prus fc3c19c664 Fix a typo
[SVN r26527]
2004-12-16 12:59:56 +00:00
Douglas Gregor 6b12a2813a Deal with min/max appropriately
[SVN r26520]
2004-12-15 21:57:13 +00:00
Douglas Gregor ba2a9304e8 Don't include sys/time.h
[SVN r26519]
2004-12-15 21:41:43 +00:00
Douglas Gregor a6d2c98a5f Add support for vertex_id parameter to write_graphviz
[SVN r26517]
2004-12-15 20:57:35 +00:00
Douglas Gregor 4ce0965553 Add Hyperworx platform
[SVN r26516]
2004-12-15 20:32:47 +00:00
Douglas Gregor eae6dc4a8e - Fixed remove_out_edge_if for undirected graphs.
- Make in_degree work for undirected graphs


[SVN r26515]
2004-12-15 20:32:23 +00:00
Ronald Garcia 6a4cc8e537 missing close tag for betweenness_centrality link.
[SVN r26499]
2004-12-14 14:49:49 +00:00
Douglas Gregor f1278dca9f Rearrange detail namespace to get rid of order dependencies in function lookup, I hope
[SVN r26441]
2004-12-06 04:14:40 +00:00
Douglas Gregor 30ef8f84ff Graphs with zero vertices have zero connected components
[SVN r26403]
2004-12-02 16:32:05 +00:00
Douglas Gregor 604e5a7a45 Minor fixes and better output
[SVN r26402]
2004-12-02 16:29:55 +00:00
Aleksey Gurtovoy 3ec6d263b8 merge RC_1_32_0 tab fixes
[SVN r26327]
2004-11-28 03:27:25 +00:00
Douglas Gregor 48a0aff91d Add type -> const_type conversion to the challenge list
[SVN r26289]
2004-11-25 07:52:43 +00:00
Douglas Gregor a1078197fd Use union_set, not link, in incremental_components
[SVN r26288]
2004-11-25 07:39:21 +00:00
Douglas Gregor 2d2a71f7aa Add missing include
[SVN r26287]
2004-11-25 06:44:10 +00:00
Douglas Gregor f2a278fad5 Fix parallel edge removal bug
[SVN r26286]
2004-11-25 06:33:10 +00:00
Douglas Gregor 945fb8717c Mention change to undirected_dfs
[SVN r26285]
2004-11-24 17:23:47 +00:00
Douglas Gregor 98187feda4 Converted interior properties example to use bundled properties
[SVN r26284]
2004-11-24 17:23:31 +00:00
Douglas Gregor 9dd1992a9d Data-recursive undirected_dfs from Synge Todo
[SVN r26283]
2004-11-24 17:01:22 +00:00
Douglas Gregor 0c82c42f3d Initialize the predecessor map, dummy
[SVN r26232]
2004-11-18 15:51:29 +00:00
Douglas Gregor 9297879774 Fix for edge function provided by Eyal Farago
[SVN r26231]
2004-11-18 15:48:32 +00:00
Douglas Gregor d34fed2e2a Add root_vertex support to Bellman-Ford shortest paths
[SVN r26189]
2004-11-11 19:34:35 +00:00
Douglas Gregor 26e586237e Fix typos
[SVN r26188]
2004-11-11 18:30:05 +00:00
Douglas Gregor f59a9cdb42 Graph is always const
[SVN r26187]
2004-11-11 18:28:29 +00:00
Douglas Gregor 7d1c1f6c8a Close your tags, dummy
[SVN r26186]
2004-11-11 18:25:42 +00:00
Vladimir Prus 25e2a8e1d8 Fix typo
[SVN r26158]
2004-11-09 09:18:27 +00:00
Douglas Gregor 6229d096e5 Mark biconnected components
[SVN r26106]
2004-11-03 16:30:44 +00:00
Douglas Gregor 8c2a5290ad index.htm, libs/graph/doc/table_of_contents.html:
- Document the existence of the biconnected components algorithm

libs/graph/example/biconnected_components.cpp:
  - Clean up the GraphViz output a bit

libs/graph/doc/figs/biconnected.dot, libs/graph/doc/figs/biconnected.png,
libs/graph/doc/biconnected_components.html:
  - Documentation for biconnected components and articulation points

boost/graph/biconnected_components.hpp:
  - Minor type tweaks


[SVN r26105]
2004-11-03 15:40:09 +00:00
Douglas Gregor e7023ea88a boost/graph/biconnected_components.hpp:
- Fixed computation of articulation points

libs/graph/example/biconnected_components.cpp:
  - Remove the second example graph: we only need one for a good example

libs/graph/test/biconnected_components_test.cpp, libs/graph/test/Jamfile:
  - Randomized testcase verifying the biconnected components & articulation
    points computation. Biconnected components aren't thoroughly tested,
    but articulation points are.


[SVN r26094]
2004-11-03 05:02:30 +00:00
Douglas Gregor 6123fb57e9 boost/graph/biconnected_components.hpp:
- Added support for emitting articulation points (they come for free)
  - Eliminated unused parameters in public interface
  - Provided helper overloads that build the lowpt and discovertime property
    maps themselves.
  - Added articulation_points function that computes only articulation points
    (edge components not included)

libs/graph/example/biconnected_components.cpp:
  - Use some of the new overloads
  - Output articulation points as filled circles


[SVN r26091]
2004-11-02 22:34:26 +00:00
Douglas Gregor 5aa64b9cac Minor fixes
[SVN r26024]
2004-10-31 19:55:15 +00:00
Douglas Gregor 17985eaec5 Use appropriate grid cell size
[SVN r25918]
2004-10-28 15:31:42 +00:00
Douglas Gregor 4a11e36f85 Document FR example
[SVN r25904]
2004-10-27 18:22:57 +00:00
Douglas Gregor a07d79a8d3 Document FR example
[SVN r25903]
2004-10-27 18:21:39 +00:00
Douglas Gregor 048d40185d Fruchterman-Reingold layout example
[SVN r25902]
2004-10-27 18:20:11 +00:00
Douglas Gregor 5f9800a0a7 Testcase illustrating a problem with brittle edge indices in bidirectional graphs with EdgeListS=vecS
[SVN r25897]
2004-10-27 16:40:55 +00:00
Douglas Gregor f3ff95bdd8 build instructions
[SVN r25894]
2004-10-27 14:40:24 +00:00
Douglas Gregor 71b302bc49 Merge from graph_devel_1_33_0 branch
[SVN r25893]
2004-10-27 14:38:15 +00:00
Douglas Gregor 63cfb2e00b Perform fast removal of edges in bidirectional graphs
[SVN r25868]
2004-10-26 01:05:11 +00:00
Douglas Gregor 8d219e56bc Fix assignment from *this
[SVN r25820]
2004-10-21 15:52:28 +00:00
Jeremy Siek 9197a1028f added copyrights
[SVN r25810]
2004-10-20 13:20:19 +00:00
Jeremy Siek 4b6effe849 added copyrights
[SVN r25809]
2004-10-20 13:07:46 +00:00
Douglas Gregor f0057aaa80 Fix a typo
[SVN r25740]
2004-10-15 16:02:23 +00:00
Douglas Gregor 6d118a94d0 Correct a typo
[SVN r25739]
2004-10-15 15:37:34 +00:00
Douglas Gregor 2d5dab5647 Remove Floyd-Warshall from the challenge list
[SVN r25736]
2004-10-15 14:45:09 +00:00
Aleksey Gurtovoy 6593010f65 c++boost.gif -> boost.png replacement
[SVN r25573]
2004-10-05 15:45:52 +00:00
Vladimir Prus d3f694525e Remove calls to non-portable isatty function. Not really good idea to
edit generated files, but don't have time for a nicer solution.


[SVN r25567]
2004-10-05 09:53:15 +00:00
Vladimir Prus 77c424a53d Regenerate the parser again, the previous one used to crash on
some graphs.


[SVN r25477]
2004-09-29 14:28:31 +00:00
Douglas Gregor 896c715e35 using namespace boost should work around some issues for MIPSpro
[SVN r25401]
2004-09-25 13:20:24 +00:00
Douglas Gregor 961d3586a7 Fix interior properties link
[SVN r25379]
2004-09-23 20:30:15 +00:00
Joaquín M. López Muñoz 2341889e69 taken care of BOOST_NO_STDC_NAMESPACE
[SVN r25294]
2004-09-21 09:58:24 +00:00
Douglas Gregor 3b9071cf27 Stupid limits include
[SVN r25159]
2004-09-16 19:58:18 +00:00
Douglas Gregor e7706a3320 Need to have the betweenness centrality test here
[SVN r25158]
2004-09-16 19:57:58 +00:00
Douglas Gregor 0b782a2f7f Work around the lack of a <limits> header
[SVN r25091]
2004-09-14 21:28:18 +00:00
Douglas Gregor 6c7a79387a Work around VC library bug
[SVN r25089]
2004-09-14 21:23:36 +00:00
Douglas Gregor 264620c744 Try to deal with platforms that don't move sin and cos into namespace std
[SVN r25087]
2004-09-14 21:01:04 +00:00
Douglas Gregor b89568dcc5 Renamed
[SVN r25083]
2004-09-14 12:30:48 +00:00
Douglas Gregor fde46d6ee8 Fix BC include
[SVN r25060]
2004-09-13 18:14:14 +00:00
Douglas Gregor b7d9331f0e Make the Graph library pass inspection
[SVN r25045]
2004-09-13 15:36:39 +00:00
Douglas Gregor 1b13e37ec2 Attempt at IBM xlC workaround
[SVN r25024]
2004-09-13 00:16:35 +00:00
Douglas Gregor 41e4d297e8 Attempt at IBM xlC workaround
[SVN r25023]
2004-09-13 00:16:03 +00:00
Douglas Gregor d84342b076 Fix a silly typo
[SVN r24873]
2004-09-02 14:59:32 +00:00
Douglas Gregor 95eeae244b Various fixes for vc7 and Linux
[SVN r24853]
2004-09-01 16:35:57 +00:00
Douglas Gregor ed11fbce92 VC7 can handle member templates; let it
[SVN r24723]
2004-08-24 22:01:04 +00:00
Douglas Gregor e6c0a0b36e Use boost::optional to avoid copying singular iterators
[SVN r24721]
2004-08-24 22:00:33 +00:00
Douglas Gregor ce9e9e0d89 Fix a bunch of little bugs
[SVN r24720]
2004-08-24 21:40:31 +00:00
Douglas Gregor 103a676163 Show output for layout test
[SVN r24719]
2004-08-24 20:33:51 +00:00
John Maddock 0f54780d9b Converted files to the BSL.
[SVN r24614]
2004-08-20 11:10:24 +00:00
Douglas Gregor 5e84be1a7d boost/graph/kamada_kawai_spring_layout.hpp:
- Use T, not double, in layout_tolerance
  - Make layout_tolerance use _relative_ tolerances, only
  - Make default tolerance 0.001, which returns some pleasing graphs

libs/graph/doc/layout_tolerance.html:
  - Document changes


[SVN r24608]
2004-08-19 21:50:19 +00:00
Douglas Gregor 455dae4bfe Test for disconnected graphs and document the change
[SVN r24541]
2004-08-17 21:53:49 +00:00
Douglas Gregor 667f926d1c Really, don't use fabs
[SVN r24540]
2004-08-17 21:33:07 +00:00
Douglas Gregor 46e2920f70 Fix silly error pointed out by Gordon Smith
[SVN r24537]
2004-08-17 20:46:38 +00:00
Douglas Gregor f2a534bf12 Don't use fabs
[SVN r24505]
2004-08-16 14:12:14 +00:00
Douglas Gregor 3082cb5195 Add copyright/license
[SVN r24503]
2004-08-16 13:59:51 +00:00
Douglas Gregor 83ed711d3c Whackin' a few buglets
[SVN r24451]
2004-08-13 02:53:11 +00:00
Douglas Gregor e0356c30ca Moved to BSL
[SVN r24450]
2004-08-12 19:12:28 +00:00
Jeremy Siek 10008230eb changed the test to use Q.update(u) and to use indirect comparison
[SVN r24422]
2004-08-11 20:00:20 +00:00
Jeremy Siek d32278ed01 fixed bug, p == nil() instead of p != nil() in update
[SVN r24421]
2004-08-11 19:56:32 +00:00
Douglas Gregor 0b137f41e2 Fixed some minor errors, but it is still broken
[SVN r24415]
2004-08-11 17:02:09 +00:00
Douglas Gregor 836a69685b Merged the well-tested algorithms on the graph_devel branch to trunk
[SVN r24414]
2004-08-11 15:30:20 +00:00
Jeremy Siek 5de49c9ea3 added a copyright
[SVN r24393]
2004-08-10 18:44:34 +00:00
Douglas Gregor 6965fc78ba Ported to LEDA 4.5
[SVN r24302]
2004-08-05 13:38:36 +00:00
Douglas Gregor d1be6c2495 boost/graph/leda_graph.hpp:
- Ported to new iterator adaptors (actually, iterator_facade)
  - Ported to LEDA 4.5

libs/graph/example/leda-concept-check.cpp, libs/graph/example/leda-graph-eg.cpp
  - Ported to LEDA 4.5


[SVN r24301]
2004-08-05 13:37:22 +00:00
Douglas Gregor e4461f93d5 Qualify make_pair calls
[SVN r24265]
2004-08-03 10:50:26 +00:00
Douglas Gregor d017d8e9e7 Converted to Boost Software License, Version 1.0
[SVN r24096]
2004-07-27 03:43:34 +00:00
Douglas Gregor 34fefcd0f6 Converted to Boost Software License, Version 1.0
[SVN r24055]
2004-07-26 00:32:12 +00:00
Douglas Gregor 008a8c7168 johnson_all_pairs_shortest.hpp: When writing into the distance map, we need
to subtract one from the index in graph g2, which has an extra vertex "s" at
the beginning. Amazing how long this bug persisted...


[SVN r24044]
2004-07-25 17:25:54 +00:00
Rene Rivera db84792f9f Remove tabs in file.
[SVN r24043]
2004-07-25 17:12:17 +00:00
Rene Rivera f3d206f725 Remove tabs in file.
[SVN r24041]
2004-07-25 16:10:20 +00:00
Douglas Gregor 656b0ce32d Doug Gregor->Douglas Gregor
[SVN r24018]
2004-07-25 02:59:30 +00:00
Douglas Gregor 905969f542 Doug Gregor -> Douglas Gregor
[SVN r24016]
2004-07-25 02:29:29 +00:00
Douglas Gregor c3cddc3b96 size should return a size_type
[SVN r23959]
2004-07-22 15:16:38 +00:00
Jeremy Siek b1239433ae made explicit the time complexity requirement for edge
[SVN r23919]
2004-07-21 22:09:06 +00:00
Vladimir Prus 598c2d2478 Do not copy default-constructed interator, which might be signular.
[SVN r23841]
2004-07-20 13:25:48 +00:00
Guillaume Melquiond 145474f398 finally corrected the iterator so that it stops at end of the adjacency matrix, also corrected the get_edge behavior between const and non-const matrix
[SVN r23808]
2004-07-19 20:11:43 +00:00
Douglas Gregor d4125b58f9 Use Boost.Test
[SVN r23800]
2004-07-19 15:54:50 +00:00
Vladimir Prus 4adbd15346 More V2 Jamfile tweaks.
[SVN r23764]
2004-07-19 07:12:45 +00:00
Guillaume Melquiond 29f3336462 return u-1 edges (rather than a random number) for undirected adjacency matrices
[SVN r23694]
2004-07-17 15:46:38 +00:00
Guillaume Melquiond dd45b3d00f avoid dereferencing an end iterator
[SVN r23692]
2004-07-17 15:34:09 +00:00
Jeremy Siek d91f3ba421 changed to use bundled properties
[SVN r23553]
2004-07-14 16:22:33 +00:00
Jeremy Siek f8d6dccdf8 changed to bundled properties
[SVN r23552]
2004-07-14 16:18:38 +00:00
Jeremy Siek faaf1fdac9 changed to use bundled properties
[SVN r23551]
2004-07-14 16:13:49 +00:00
Jeremy Siek 96784e037d changed to use bundled properties
[SVN r23548]
2004-07-14 15:47:50 +00:00
Douglas Gregor e0435ccc26 dijkstra_shortest_paths.hpp: Fix no_init version invocation(Jürgen Hunold)
[SVN r23346]
2004-07-05 15:41:47 +00:00
Eric Niebler 7b66953776 move BOOST_USING_STD_MIN and _MAX and BOOST_PREVENT_MACRO_SUBSTITUTION to the config headers, remove boost/minmax.hpp, update coding guidelines
[SVN r23313]
2004-07-02 01:21:32 +00:00
Douglas Gregor 778835199f filtered_graph.hpp:
- Workaround for IBM Visual Age C++ 6.0 (Matthias Troyer)


[SVN r23303]
2004-07-01 14:46:02 +00:00
Douglas Gregor 220b44fe17 Need to include iostream to use cout
[SVN r23302]
2004-07-01 14:25:20 +00:00
Jeremy Siek 11ba494e4c new file, showing the use of get_property
[SVN r23290]
2004-06-30 16:57:10 +00:00
Jeremy Siek cfc41552e7 removed inf parameter for the no_init version of Dijkstra's
[SVN r23289]
2004-06-30 16:18:43 +00:00
Jeremy Siek 00a2844d66 fixed bug in remove_edge(e, g) for bidirectional graphs.
The problem was that the edge property was not removed from the edge list


[SVN r23288]
2004-06-30 16:09:17 +00:00
Jeremy Siek 4c469946fe added a second test with no properties
[SVN r23287]
2004-06-30 16:08:33 +00:00
Jeremy Siek 10b91f71d1 bug in bidirectional graph remove_edge(e, g)
[SVN r23286]
2004-06-30 15:48:20 +00:00
Douglas Gregor 51d60f9b43 libs/graph/test/edge_list_cc.cpp: Specify all parameters, for VC7 support
libs/graph/test/isomorphism.cpp: Deal with atoi/atof missing from std::
boost/graph//adjacency_matrix.hpp: deal with missing allocator<T>::rebind
boost/graph/graph_test.hpp: Remove unusable default constructor (workaround)
boost/graph/vector_as_graph.hpp: When we say remove, we mean std::remove
status/explicit-failures-markup.xml: mark everything I can't or won't fix


[SVN r23237]
2004-06-29 02:30:29 +00:00
Douglas Gregor cbfc6ec8ed Don't use std::atoi and std::atof directly
[SVN r23217]
2004-06-27 21:06:37 +00:00
Douglas Gregor 73ad3cb092 adjacency_list.hpp:
- Add some more qualification to help VC7 along...


[SVN r23215]
2004-06-27 19:15:55 +00:00
Douglas Gregor eedac55a7d Need to include <cctype> to get std::isspace
[SVN r23214]
2004-06-27 19:01:09 +00:00
Douglas Gregor 34f46c045a graph_test.hpp:
- Change the mysterious x's to v's.
  - Get the constness of the Graphs correct for
    test_readable_vertex_property_graph.


[SVN r23211]
2004-06-27 18:35:37 +00:00
Douglas Gregor 9d467c8df1 properties.hpp:
- Use is_convertible inside is_vertex_bundle. We lose some checking in
    pathological cases, but it's not worth the effort.


[SVN r23172]
2004-06-23 20:55:31 +00:00
Douglas Gregor 9613d2dd8c Disable bundled properties for EDG 2.38, which can't seem to handle
is_vertex_bundle.


[SVN r23171]
2004-06-23 16:49:55 +00:00
Eric Niebler e3dd9042b1 remove std_min and std_max, update minmax coding guidelines
[SVN r23162]
2004-06-23 04:49:48 +00:00
Douglas Gregor cf24fa4ca0 Fix a silly typo
[SVN r23129]
2004-06-20 22:15:40 +00:00
Douglas Gregor 23b3545c8d Overall: Second, more complete and better tested version of bundled properties.
The ->* syntax has been removed. Instead, one may use the member pointer as
the key for the standard get/put functions of property maps. This makes
graph adaptors work with bundled properties (automagically). Also added
support for bundled properties in adjacency_matrix.

index.htm: Announce the addition of bundled properties.

boost/graph/adjacency_list.hpp: Updated to support get/put for bundled
properties.

boost/graph/adjacency_matrix.hpp: Added support for bundled properties.
Suppressed some warnings and fixed a minor bug in add_edge(u, v, ep, g).

boost/graph/properties.hpp: Added property_map specialization for bundled
properties.

libs/graph/doc/*.html: Document uses of bundled properties and direct anyone
not using a broken compiler to bundled properties instead of property lists.

libs/graph/test/bundled_properties.cpp: Test both adjacency_list and
adjacency_matrix, along with filtered_graph. Makes sure all of the bundled
properties operations work.


[SVN r23125]
2004-06-20 03:37:09 +00:00
Douglas Gregor c5b4dccdf4 Directed adjacency_lists don't model Adjacency Matrix
[SVN r23121]
2004-06-18 20:05:11 +00:00
Douglas Gregor 5bc28643d3 Graph concept doesn't include num_vertices or num_edges functions
[SVN r23120]
2004-06-18 16:05:11 +00:00
Douglas Gregor 59d480bd8d Synchronize example description with example code
[SVN r23114]
2004-06-17 15:46:38 +00:00
Vladimir Prus e8d775f806 Update
[SVN r23087]
2004-06-11 11:38:37 +00:00
Douglas Gregor f68d704b60 pending/property.hpp: retag_property_list just shouldn't exist for compilers without partial specialization.
graph/adjacency_list.hpp: Totally turn off bundling for VC++ < 7.1


[SVN r22889]
2004-05-21 16:54:20 +00:00
Douglas Gregor 31b1be9154 adjacency_list.hpp: Work around VC++ 7.1 bug where the compiler thinks that a typedef in a template won't be a class type.
[SVN r22880]
2004-05-21 02:27:56 +00:00
Douglas Gregor ce8344e9ad Overall: introduce bundled properties
index.htm:
  - Announce bundled properties

libs/graph/doc/bundles.html:
  - Document bundled properties

libs/graph/doc/adjacency_list.html:
  - Refer to bundled properties

boost/graph/properties.hpp:
  - Added vertex_bundle and edge_bundle properties for bundling
  - Added bundle_property_map for directly handling bundles

boost/pending/property.hpp:
  - Added retag_property_list metafunction that allows us to add a tag
    to the non-property<> element at the end of a property<> list.

boost/graph/adjacency_list.hpp:
  - Implement bundled properties

libs/graph/test/Jamfile, libs/graph/test/bundled_properties.cpp:
  - Test bundled properties


[SVN r22819]
2004-05-14 05:53:33 +00:00
Douglas Gregor 89476c57dd reverse_graph.hpp: Add null_vertex() to traits
[SVN r22818]
2004-05-14 05:41:53 +00:00
Douglas Gregor 20548378ed graphviz.hpp: Fix output of vertex descriptors for edges
(Mark Purtill  <mpurtill@softwarerevolution.com>)


[SVN r22767]
2004-05-08 16:00:24 +00:00
Jeremy Siek bd8397897e changed the download URL for boost
[SVN r22753]
2004-05-06 21:00:38 +00:00
Jeremy Siek 16cc6fed3c added inv_adjacent_vertices
[SVN r22726]
2004-05-03 20:03:17 +00:00
Jeremy Siek 5e09a7498b added List of BGL Users
[SVN r22664]
2004-04-18 20:46:55 +00:00
Jeremy Siek 6a9e86bb5c added url for KGraph
[SVN r22663]
2004-04-18 20:45:55 +00:00
Jeremy Siek bd938c930f new file
[SVN r22662]
2004-04-18 20:42:32 +00:00
Vladimir Prus edf7ef8641 Subgraph tweaks.
- copy m_global_edge member in copy constructor
- add BOOST_STATIC_ASSERT for (hopefully) better error reporting when
  user forgot to provide edge_index property.


[SVN r22635]
2004-04-15 07:26:57 +00:00
Jeremy Siek b4a9b406c2 changed the concept check for Distance Matrix, and changed to
use vertex index to lookup into the distance matrix


[SVN r22601]
2004-04-04 18:02:00 +00:00
Jeremy Siek 1ef454e8c1 changed vertex_descriptor to vertices_size_type for Distance Matrix
[SVN r22600]
2004-04-04 18:01:16 +00:00
Jeremy Siek 844a2019a9 changed to use get() for accessing w1
[SVN r22599]
2004-04-04 17:32:26 +00:00
Jeremy Siek d965824092 Fixed bug in is_flow() caught by Arun Bhalla.
[SVN r22598]
2004-04-04 13:55:26 +00:00
Jeremy Siek cb1091cae1 filled out documentation
[SVN r22580]
2004-04-02 14:53:15 +00:00
Jeremy Siek 9ae3a8d6d2 added "Where Defined"
[SVN r22577]
2004-04-01 14:04:50 +00:00
Jeremy Siek 1a95b1fff0 fixed remove_edge for bidirectional graphs
[SVN r22576]
2004-04-01 01:30:44 +00:00
Vladimir Prus b6c9531d22 HMTL-encode < and >
[SVN r22572]
2004-03-31 12:40:13 +00:00
Vladimir Prus a9e4a158fe Fix typo
[SVN r22563]
2004-03-29 10:40:32 +00:00
Vladimir Prus ff0ea074ab Add 'null_vertex' support to subgraph.
[SVN r22558]
2004-03-26 16:35:19 +00:00
Vladimir Prus 91b24b6363 An attempt to unbreak vc6.
[SVN r22557]
2004-03-26 16:25:08 +00:00
Vladimir Prus 24403e3f19 Fix build problems with different bison versions.
[SVN r22540]
2004-03-22 06:31:24 +00:00
Jeremy Siek 3ada410bc9 fixed issue about vertices in G^T
[SVN r22538]
2004-03-21 23:32:33 +00:00
Jeremy Siek 2a1889d012 fixed typo
[SVN r22515]
2004-03-17 17:36:31 +00:00
Jeremy Siek 21d9026dbb fixed num_edges() to work with undirected graphs, and also to be O(1)
[SVN r22514]
2004-03-17 17:21:31 +00:00
Jeremy Siek b3cb4f8037 fixed Reference type for inv_adjacency_iterator
[SVN r22480]
2004-03-11 13:39:42 +00:00
Jeremy Siek 279466a85d new file
[SVN r22475]
2004-03-10 13:55:57 +00:00
Jeremy Siek e70fc391b8 fixed the constructor
[SVN r22474]
2004-03-10 13:53:26 +00:00
Jeremy Siek 687befe638 added defaults to inv_adjacency_iterator_generator
[SVN r22473]
2004-03-10 13:52:09 +00:00
Jeremy Siek 32497ce2a2 fixed inv_adjacency_iterator
[SVN r22472]
2004-03-10 13:46:17 +00:00
Eric Niebler d1b0ceea22 remove minmax hack from win32.hpp and fix all places that could be affected by the minmax macros
[SVN r22394]
2004-02-26 18:27:02 +00:00
Jeremy Siek e29266e8a5 removed redundant initialization of member c
[SVN r22264]
2004-02-15 15:50:03 +00:00
Jeremy Siek 3c641d4ec2 EdgeList -> OutEdgeList
[SVN r22240]
2004-02-11 16:12:31 +00:00
Jeremy Siek 04d0248a5a changed vecS to listS for default of EdgeList
[SVN r22239]
2004-02-11 16:07:54 +00:00
Jeremy Siek 02ab786074 added #include <boost/graph/graph_utility.hpp>
[SVN r22231]
2004-02-09 18:45:50 +00:00
Jeremy Siek 17fd766fa5 moved SGB and LEDA stuff to the end
[SVN r22230]
2004-02-09 18:43:01 +00:00
Jeremy Siek de777b9164 added #include <iostream>
[SVN r22229]
2004-02-09 18:39:36 +00:00
Jeremy Siek 1825798f2a added #include <fstream>
[SVN r22228]
2004-02-09 18:37:33 +00:00
Jeremy Siek 508526c98d added #include <boost/graph/graph_utility.hpp>
[SVN r22227]
2004-02-09 18:36:59 +00:00
Jeremy Siek 550aa7d162 fixed size type issues
[SVN r22226]
2004-02-09 18:35:04 +00:00
Jeremy Siek 7a9d91ec88 fixed subgraph_local_property_map::operator[]
m_g -> *m_g


[SVN r22225]
2004-02-09 18:29:31 +00:00
Jeremy Siek b9b9aa5782 removed unused variable
[SVN r22224]
2004-02-09 18:27:27 +00:00
Jeremy Siek d45205e37d int -> size_type
[SVN r22223]
2004-02-09 18:25:32 +00:00
Jeremy Siek d4e507bab8 fixed bug with regards to in_edge_list for undirected graphs
[SVN r22222]
2004-02-09 18:21:05 +00:00
Jeremy Siek 9b53c7b81b changed order of initialization to avoid warnings
[SVN r22221]
2004-02-09 18:17:59 +00:00
Jeremy Siek 30d756a5f6 changed type of u1 and u2 in edge_cmp from vertex1_t to int so that they match the return type of dfs_num[...]
[SVN r22220]
2004-02-09 18:12:00 +00:00
Jeremy Siek e40de5b395 added #include <boost/graph/graph_utility.hpp>
[SVN r22219]
2004-02-09 17:50:41 +00:00
Jeremy Siek 206c17b1e2 added #include <iostream>
[SVN r22218]
2004-02-09 17:01:30 +00:00
Jeremy Siek 6a70bb518f added #include <boost/graph/graph_utility.hpp>
[SVN r22217]
2004-02-09 16:59:26 +00:00
Jeremy Siek 66aa8548f7 added #include <iostream> // needed by graph_utility. -Jeremy
[SVN r22216]
2004-02-09 16:55:51 +00:00
Jeremy Siek a5c6b3d272 added #include <boost/graph/graph_utility.hpp>
[SVN r22215]
2004-02-09 16:52:10 +00:00
Jeremy Siek 60004ef651 added #include <iostream>
[SVN r22214]
2004-02-09 16:49:36 +00:00
Jeremy Siek 0e14818262 changed std::queue to boost::queue
[SVN r22213]
2004-02-09 16:45:42 +00:00
Jeremy Siek 542bf4520b added #include for graph_utility.hpp
[SVN r22212]
2004-02-09 16:38:20 +00:00
Jeremy Siek 5133c85054 fixed bug in get_property, changed -> to .
[SVN r22211]
2004-02-09 16:29:53 +00:00
Jeremy Siek abf4ba7df9 removed unused variable
[SVN r22210]
2004-02-09 16:26:31 +00:00
Jeremy Siek 2cebf15b79 moved the implementation of
bidirectional_graph_helper_with_property::remove_edge
into the class definition to avoid VC++ bug.


[SVN r22189]
2004-02-06 21:39:42 +00:00
Jeremy Siek 3390833f0c new file
[SVN r22179]
2004-02-05 20:48:46 +00:00
Jeremy Siek 12feb5896f added more :'s
[SVN r22178]
2004-02-05 20:48:30 +00:00
Jeremy Siek 71a7b595ad added adjacency_matrix_test
[SVN r22177]
2004-02-05 20:47:49 +00:00
Jeremy Siek b5ded5174e fixed bug in undirected out edge iterator, missing initialization of m_inc
[SVN r22176]
2004-02-05 20:20:55 +00:00
Jeremy Siek 2044110d76 added subgraph_properties.cpp
[SVN r22152]
2004-02-03 14:12:10 +00:00
Jeremy Siek 4110bf69a1 new example
[SVN r22151]
2004-02-03 14:11:56 +00:00
Jeremy Siek 60f612a532 Fixed bug in properties. Global and local properties were not shared,
but they are suppose to be. The problem was that I was using the property
map from the local subgraphs instead of from the global graph.


[SVN r22150]
2004-02-03 14:10:39 +00:00
Jeremy Siek 05888905a8 decreasing running time
[SVN r22139]
2004-02-02 16:17:34 +00:00
Jeremy Siek d755f8f5c3 changed iterator to const_iterator
[SVN r22136]
2004-02-02 14:25:51 +00:00
Jeremy Siek f7fa2e2942 changed to mutable iterator, to match return type of std::set::find, just
in case the std implementation does not provide constant to mutable
iterator conversions for std::set.


[SVN r22081]
2004-01-30 14:29:52 +00:00
Jeremy Siek ad20c88c20 changed back to using std::set::find instead of std::find in edge_dispatch
[SVN r22080]
2004-01-30 14:27:32 +00:00
Jeremy Siek 70a7c5ce02 some edits
[SVN r22055]
2004-01-29 16:27:02 +00:00
Jeremy Siek 8a24790a12 fixed figure reference
[SVN r22036]
2004-01-29 00:42:08 +00:00
Jeremy Siek 697f856843 added -kb
[SVN r22035]
2004-01-29 00:38:05 +00:00
Jeremy Siek 1ad3a206d0 changing to binary
[SVN r22033]
2004-01-29 00:36:50 +00:00
Jeremy Siek 26ccf90eb1 fixed figure reference
[SVN r22030]
2004-01-29 00:25:19 +00:00
Vladimir Prus a11e93caa4 Fix (or rather workaround) the bug which caused second reading
of graphviz file to fail. Looks like the parser is not reenterant.

Patch from anynymous user.


[SVN r21951]
2004-01-26 09:16:16 +00:00
Vladimir Prus 547cd77748 Regenerated bison/flex output.
[SVN r21950]
2004-01-26 09:08:02 +00:00
Vladimir Prus df87cf35fc Clean graphviz parser build a little bit. Include parser files generated
by corresponding bison invocation.

Patch from anonymous user.


[SVN r21949]
2004-01-26 08:58:43 +00:00
Vladimir Prus 9e39cceb5a Remove unused files.
[SVN r21948]
2004-01-26 08:45:57 +00:00
Vladimir Prus 315d6e4196 Remove unneeded files
[SVN r21947]
2004-01-26 08:29:41 +00:00
Vladimir Prus 57a2bff506 Patch from anonymous user to make Makefile work.
[SVN r21945]
2004-01-26 08:13:22 +00:00
Jeremy Siek 23c981d632 performance bug fix
[SVN r21870]
2004-01-21 20:38:59 +00:00
Jeremy Siek ccd8ecee09 fixed more bugs triggered by the changes in input_iterator_archetype
[SVN r21867]
2004-01-21 19:04:09 +00:00
Jeremy Siek c3ad6d91cf fixed a bug brought to light by the change in input_iterator_archetype
[SVN r21865]
2004-01-21 18:55:16 +00:00
Jeremy Siek fbe0af0831 fixed some bugs due to changes in iterator_adaptor::base()
[SVN r21864]
2004-01-21 18:46:08 +00:00
Vladimir Prus 72df35f1fa Set proper licence.
[SVN r21490]
2004-01-05 06:39:42 +00:00
Rene Rivera abd8f2aa84 Fix tabs in file.
[SVN r21399]
2003-12-26 23:26:49 +00:00
Vladimir Prus 9d583a1a91 Fix property_map_iterator.
Patch from Jurgen Hunold.


[SVN r21398]
2003-12-26 07:13:43 +00:00
Vladimir Prus ffce9c06c9 Add V2 Jamfile.
[SVN r21397]
2003-12-26 07:08:15 +00:00
Douglas Gregor aa9b63ba07 Deal with BOOST_NO_STD_ITERATOR_TRAITS
[SVN r21345]
2003-12-20 01:58:52 +00:00
Douglas Gregor 818dcc73b0 dfs.cpp: Don't use ADL; fixes this test for VC7
[SVN r21344]
2003-12-20 01:41:40 +00:00
Vladimir Prus b6201b1288 Fix typos.
[SVN r21315]
2003-12-18 05:36:17 +00:00
Beman Dawes e0f1e4c036 fix missing std:: plus 3 2-phase name lookup errors on Metrowerks
[SVN r21308]
2003-12-17 19:59:39 +00:00
Douglas Gregor 324d895dd9 transitive_closure.hpp: Use Bind instead of Compose
[SVN r21306]
2003-12-17 17:41:11 +00:00
Vladimir Prus 7f51375fc2 Add BGL to regression tests.
[SVN r21297]
2003-12-17 06:04:09 +00:00
Vladimir Prus 890769706d Don't run tests which require external components by default.
Patch from Jurgen Hunold.


[SVN r21284]
2003-12-16 12:41:39 +00:00
Beman Dawes 0fd24218e9 fix links broken by index.htm to index.html renaming
[SVN r21233]
2003-12-12 00:00:13 +00:00
Vladimir Prus 42a08f3ca5 Adjust for changes in BGL Jamfile
[SVN r21187]
2003-12-09 06:12:27 +00:00
Douglas Gregor 278ba5a845 Link to sloan_ordering.htm
[SVN r21067]
2003-12-02 06:31:32 +00:00
Douglas Gregor decc08bb0e Patch up Graph library so that it is (almost) clean w.r.t. Beman's
inspection script


[SVN r21066]
2003-12-02 06:28:12 +00:00
Vladimir Prus 33913b20ea Account for the fact that ostream is not template, and basic_ostream
should be used instread. Have no idea how it worked before.


[SVN r20976]
2003-11-27 16:10:09 +00:00
Jeremy Siek 811cf59a54 moving to sandbox
[SVN r20941]
2003-11-24 19:31:35 +00:00
Dave Abrahams 40644bc5ed Removed access category tags from iterator library, made corresponding
changes elsewhere.

boost/iterator and libs/iterator/test were updated from
branch "simplify"


[SVN r20905]
2003-11-22 01:18:37 +00:00
Jeremy Siek 40e3b28909 more fixes to the test
[SVN r20576]
2003-10-31 07:26:52 +00:00
Vladimir Prus 924e1b1d9a Removed tabs
[SVN r20572]
2003-10-31 06:49:23 +00:00
Jeremy Siek e60f34fca2 tightened up the test
[SVN r20570]
2003-10-31 01:30:35 +00:00
Jeremy Siek 07fe2aafa3 untabify
[SVN r20569]
2003-10-31 01:30:10 +00:00
Jeremy Siek 276e86d0a6 added an edge(u,v,g) function
[SVN r20556]
2003-10-29 23:40:45 +00:00
Jeremy Siek d11130909b fix from Volodya
[SVN r20553]
2003-10-29 21:10:45 +00:00
Jeremy Siek 668d9c7599 added second part of iff test in check_transitive_closure
[SVN r20552]
2003-10-29 21:10:02 +00:00
Vladimir Prus 0658669b79 Make it work on Borland.
Patch from Hugo Duncan.


[SVN r20473]
2003-10-24 11:35:04 +00:00
Jeremy Siek 291b56aba0 spell check
[SVN r20427]
2003-10-20 15:48:37 +00:00
Jeremy Siek b21c4393ae updated to match example from the book
[SVN r20426]
2003-10-20 15:45:43 +00:00
Jeremy Siek e7a047c5b1 updates to sync with the BGL book
[SVN r20425]
2003-10-20 15:18:32 +00:00
Jeremy Siek 196baddc84 kevin_bacon.dat -> kevin-bacon.dat
[SVN r20383]
2003-10-14 22:14:53 +00:00
Jeremy Siek 6bd9634bda changed name
[SVN r20382]
2003-10-14 22:08:52 +00:00
Vladimir Prus 8febef8989 Update for <implicit-dependency> addition in Boost.Build.
[SVN r20287]
2003-10-07 15:13:50 +00:00
Jeremy Siek a8a1df5ff2 fixed the fix to source and target for filtered_graph
[SVN r20265]
2003-10-06 17:27:45 +00:00
Jeremy Siek 63a8ee23c5 changes to make vector_as_graph and filtered_graph work together
[SVN r20196]
2003-09-26 22:15:23 +00:00
Jeremy Siek 5a1526cc3b added filtered_vec_as_graph
[SVN r20195]
2003-09-26 22:13:21 +00:00
Jeremy Siek 5b84611a39 new file
[SVN r20194]
2003-09-26 22:12:27 +00:00
Dave Abrahams 7fbc23e3dd Use the import rule
[SVN r19968]
2003-09-08 17:38:49 +00:00
Vladimir Prus b39891a708 Fix typo. Thanks to Janusz Piwowarski.
[SVN r19890]
2003-09-01 05:41:55 +00:00
Vladimir Prus 3577a626b0 Rename *y and *l to *yy and *ll so that V2 knows to compile output with
C++ compiler, not with C one, which fails.


[SVN r19848]
2003-08-29 07:02:59 +00:00
Douglas Gregor a5abf00cc7 Make the default TerminatorFunc nontruth2 instead of truth2, because we need
it to return false (i.e., don't abort) all the time, not true (which aborts
early).


[SVN r19839]
2003-08-28 16:34:20 +00:00
Vladimir Prus 121bb31837 Implement depth_first_visit variant which allows to stop the search at
certain vertices.


[SVN r19827]
2003-08-28 11:49:00 +00:00
Vladimir Prus 49e55bc606 Remove unused code.
Patch from Janusz Piwowarski.


[SVN r19818]
2003-08-28 04:56:32 +00:00
Vladimir Prus fd543d5fae Implement remove_vertex function for vector_as_graph.
Patch from Janusz Piwowarski.


[SVN r19817]
2003-08-28 04:52:10 +00:00
Vladimir Prus f52b93625f Fix compilation warning, reported by Janusz Piwowarski.
[SVN r19795]
2003-08-27 06:40:49 +00:00
Jeremy Siek 87bc680518 class -> struct
[SVN r19679]
2003-08-18 15:50:11 +00:00
Jeremy Siek 49d479632c EdgeList -> OutEdgeList
and then added EdgeList


[SVN r19607]
2003-08-14 19:22:56 +00:00
Jeremy Siek 3c65d754ee fixed mispelling
[SVN r19606]
2003-08-14 19:17:35 +00:00
Jeremy Siek 096c3d9eb2 fixed call to get()
[SVN r19605]
2003-08-14 17:15:02 +00:00
Jeremy Siek 6b3a136853 added stuff about vertex_index internal property
[SVN r19540]
2003-08-12 01:18:08 +00:00
Jeremy Siek c0fde285cd changed to print the vertex_index instead of the vertex_descriptor
[SVN r19539]
2003-08-12 01:15:37 +00:00
Jeremy Siek e830cec2bf fix to example
[SVN r19502]
2003-08-10 01:11:47 +00:00
Jeremy Siek a2c237a85d got rid of unnecessary complication
[SVN r19501]
2003-08-10 01:11:22 +00:00
Jeremy Siek ca79276a10 fixed rank value type from Vertex to size_type
[SVN r19500]
2003-08-10 01:06:42 +00:00
Rene Rivera edaf9a56b3 Add setting of the needed defines on a per source basis. This gives this Jamfile at least a chance of working.
[SVN r19491]
2003-08-09 15:53:49 +00:00
Jeremy Siek 9b195bb299 Fixed vertex_index to return local index instead of global index.
This is important when running a graph algorithm on a subgraph.


[SVN r19479]
2003-08-06 16:52:25 +00:00
Jeremy Siek 9a6f00eb12 fixed to match implementation and the BGL book
[SVN r19478]
2003-08-06 16:26:59 +00:00
Beman Dawes 487bb3ad72 Add missing inlines (Solomon Gibbs)
[SVN r19463]
2003-08-05 16:13:08 +00:00
Jeremy Siek b174cc0adf added a call to const_constraints(g) that was missing from
IncidenceGraphConcept::constraints


[SVN r19452]
2003-08-05 02:13:27 +00:00
Dave Abrahams 5f98c9923c boost/graph/graph_traits.hpp -- workaround for a vc6 ICE
boost/graph/adjacency_matrix.hpp,
boost/graph/detail/adjacency_list.hpp -- use boost/limits.hpp instead of <limits>, for portability.


[SVN r19388]
2003-07-31 15:06:00 +00:00
Dave Abrahams fd2844b35a Improved support for BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
[SVN r19386]
2003-07-31 01:27:41 +00:00
Dave Abrahams 81a1368fab Workarounds for broken compilers
[SVN r19379]
2003-07-31 00:34:58 +00:00
Dave Abrahams 50270ae7ba Add missing backslashes
[SVN r19346]
2003-07-29 16:32:03 +00:00
Vladimir Prus 894905388c Wrap boost/pending/container_traits.hpp in boost::graph_detail namespace,
to avoid conflicts with container_traits.hpp from boost sandbox.


[SVN r19337]
2003-07-29 08:41:54 +00:00
Vladimir Prus 09488ccbbc Implement 'null_vertex' notion.
[SVN r19336]
2003-07-29 08:31:01 +00:00
Dave Abrahams 8121e5394a Patched for Borland on Hugo Duncan's say-so
[SVN r19333]
2003-07-28 23:01:27 +00:00
Dave Abrahams d8e0253233 make all the iterator adaptors override only access category; add missing std:: qualification
[SVN r19234]
2003-07-21 01:48:49 +00:00
Dave Abrahams ab5cb5e51d GCC 2.x workarounds
[SVN r19229]
2003-07-20 19:04:54 +00:00
Dave Abrahams e530bade5b Apply fix from "Janusz Piwowarski" <jpiw-at-go2.pl>
[SVN r19155]
2003-07-16 15:45:11 +00:00
Douglas Gregor b352541b14 doc/read-graphviz.html: refer to the right graphviz library
example/undirected_dfs.cpp: include <iostream>


[SVN r19137]
2003-07-16 04:43:15 +00:00
Dave Abrahams 4b9b46cf49 Stop using non-existent std::is_heap
[SVN r19075]
2003-07-11 22:19:24 +00:00
Dave Abrahams dac729c926 Add missing next/prior.hpp
[SVN r19073]
2003-07-11 22:18:41 +00:00
Dave Abrahams 03b8ab6734 Move to new iterator adaptors, except for LEDA and standford graph
support.  Also fix many small bugs.


[SVN r19070]
2003-07-11 21:26:08 +00:00
Douglas Gregor 015276d003 depth_first_visit now calls start_vertex
[SVN r19060]
2003-07-11 16:06:07 +00:00
Jens Maurer f4d8b68e0e adjust to Boost.Random interface change for C++ library TR
[SVN r19008]
2003-07-09 22:55:21 +00:00
Vladimir Prus 6715b847ca Add non-recursive dfs, from Bruce Barr.
[SVN r18862]
2003-06-24 09:59:03 +00:00
Douglas Gregor 925ab9b163 Allow easy visitor creation with do_on_XXX member functions.
[SVN r18853]
2003-06-23 04:38:16 +00:00
Beman Dawes 5dfedd00db Comeau and Metrowerks say randomize_property must follow detail::randomize_property
[SVN r18527]
2003-05-24 12:10:13 +00:00
Vladimir Prus bc232d0067 Add missing typenames.
[SVN r18464]
2003-05-20 06:02:51 +00:00
Vladimir Prus 0f7fc74966 Add missing includes.
[SVN r18463]
2003-05-20 06:02:24 +00:00
Vladimir Prus fa46936c98 Add missing include.
[SVN r18462]
2003-05-20 05:09:55 +00:00
Dave Abrahams f84665b72d Fixed a typo.
[SVN r18454]
2003-05-19 19:20:18 +00:00
Vladimir Prus f8e19bd4e4 Apply patch from Chuck Messenger to add missing 'typename's.
[SVN r18433]
2003-05-19 05:14:46 +00:00
Vladimir Prus 659b99dec8 Bugfix from Alexey Nikitin.
* boost/graph/adjacency_list.hpp
  Register multisetS as container selector.


[SVN r18394]
2003-05-14 09:51:20 +00:00
Vladimir Prus 2bab353870 Fix graphviz parser build. Don't know how, but neither the current version,
nor the one before my V2 tweaks did not compile --- while it did compile
previosly.

* yystype.h
  (YYSTYPE_IS_DECLARED): Define this, so that generated parser don't try
  to redefine YYSTYPE to be int.

* graphviz_lex.l: Include 'yystype.h' right at the beginning, before generated
  parser header, so that the above change takes effect.


[SVN r18248]
2003-04-14 08:44:50 +00:00
Jeremy Siek e6b7dfe69f fixed some type requirements for the Graph type
[SVN r18246]
2003-04-13 16:23:32 +00:00
Ronald Garcia 566ded5df3 Grammatical corrections.
[SVN r18223]
2003-04-09 15:48:37 +00:00
Vladimir Prus df7037fba6 Switch to pass-by-reference.
[SVN r17854]
2003-03-12 15:39:31 +00:00
Vladimir Prus c62a911429 Minor bugfix.
* boost/graph/properties.hpp
  (property_traits<default_color_type>{}): Add 'reference' typedef.


[SVN r17765]
2003-03-07 16:13:04 +00:00
Vladimir Prus a1d45dfb0b Correct the name of header.
[SVN r17730]
2003-03-05 13:27:24 +00:00
Ronald Garcia 04f72dd932 Some typos corrected.
[SVN r17703]
2003-03-03 15:16:51 +00:00
Ronald Garcia 134e931fbc Fixed some documentation nits.
[SVN r17678]
2003-02-27 23:25:33 +00:00
Jeremy Siek 7e7074703d fixed req's for graph
[SVN r17486]
2003-02-17 14:52:16 +00:00
Vladimir Prus ad6d5c75cd Use BOOST_STATIC_CONSTANT.
[SVN r17475]
2003-02-17 07:58:00 +00:00
Vladimir Prus 91f7d0d42d Bugfix.
[SVN r17474]
2003-02-17 07:36:18 +00:00
Björn Karlsson 55581ff209 Added copyright and untabified
[SVN r17323]
2003-02-12 08:51:11 +00:00
Vladimir Prus 0fab95269c Assert that connected_component is called on undirected graph, per docs.
[SVN r17261]
2003-02-07 08:56:15 +00:00
Vladimir Prus e5f983c453 Improve random graph utilities.
* boost/graph/random.hpp: New file.
    (random_vertex, random_edge): Moved from graph_utility.hpp
    (generate_random_graph): Moved from graph_utility.hpp and
     added 'allow_parallel' parameter.
    (randomize_property): New function.

* lib/graph/doc/random.html: New file.


[SVN r17233]
2003-02-05 15:17:47 +00:00
Vladimir Prus e655580dcb Update to use the correct Boost.Test library name. Compile "copy" as well.
[SVN r17231]
2003-02-05 13:03:00 +00:00
Vladimir Prus c275c502b6 Make 'copy_graph' version with named parameters work.
[SVN r17227]
2003-02-05 12:02:02 +00:00
Jeremy Siek 508e8bcbed moved over from sandbox
[SVN r17180]
2003-02-03 18:13:57 +00:00
Jeremy Siek 3e006dd6ea moving over from sandbox
[SVN r17179]
2003-02-03 18:10:26 +00:00
Vladimir Prus 661eca78a1 Add missing typename.
[SVN r17178]
2003-02-03 16:34:10 +00:00
Vladimir Prus 1adbc147f1 Don't segfault on empty graph.
[SVN r17174]
2003-02-03 14:21:55 +00:00
Jeremy Siek 0e88c8cf7a fixed LvaluePropertyGraphConcept
[SVN r17079]
2003-01-29 15:18:45 +00:00
Vladimir Prus e5a5be0d1d Fix typo.
[SVN r17076]
2003-01-29 07:10:21 +00:00
Vladimir Prus ceb987e999 Improve property writers documentation.
[SVN r17075]
2003-01-29 07:06:56 +00:00
Vladimir Prus aaf7b3191f Fix docs and example for topological_sort.
[SVN r17070]
2003-01-28 16:56:02 +00:00
Vladimir Prus f5bf31f89d Minor concept docfixes.
* boost/graph/graph_concepts.hpp
    (VertexAndEdgeListGraphConcept): New class.

* libs/graph/doc/BidirectionalGraph.html: Doc fixes.

* libs/graph/doc/VertexAndEdgeListGraph.html: Doc fixes.


[SVN r17069]
2003-01-28 16:38:27 +00:00
Jeremy Siek bf177b12af changed 0 to infinity for the zero parameter to dijkstra
[SVN r17028]
2003-01-24 14:48:24 +00:00
Björn Karlsson 8ec64fdd02 Added missing include; named_function_params.hpp
[SVN r16885]
2003-01-13 13:43:00 +00:00
Jeremy Siek 8840131daf added tests that exhibit bug from Pavel
[SVN r16118]
2002-11-05 17:57:06 +00:00
Jeremy Siek e055b2625c bug fix thanks to Nepomnyachiy Pavel!
[SVN r16117]
2002-11-05 17:56:35 +00:00
Jeremy Siek 37f92a391c pass by reference to fix add_edge bug
thanks Helge Jensen!


[SVN r16116]
2002-11-05 17:48:16 +00:00
Jeremy Siek 8a6fe44c8a blah
[SVN r16042]
2002-11-01 15:52:37 +00:00
Jeremy Siek eefda06d3d added copyright statement
[SVN r16008]
2002-10-28 15:10:10 +00:00
Jeremy Siek de72dd0fae added std:: qualification to string
[SVN r15956]
2002-10-19 16:55:45 +00:00
Vladimir Prus 3e954fede7 Made BGL buildable with Boost.Build v2.
[SVN r15855]
2002-10-10 12:50:30 +00:00
Jeremy Siek 90a09357c7 added include for graph_utility
[SVN r15673]
2002-10-03 14:04:55 +00:00
Jeremy Siek 1501df6386 added includes for random stuff
[SVN r15672]
2002-10-03 14:03:27 +00:00
Jeremy Siek 329d43b6c6 removed dependency on graph_utility
[SVN r15671]
2002-10-03 14:03:06 +00:00
Jeremy Siek f7de068589 changed to const reference in breadth_first_visit
[SVN r15670]
2002-10-03 14:02:24 +00:00
Jeremy Siek 42852a6cf9 added another answer
[SVN r15669]
2002-10-03 14:01:44 +00:00
Jeremy Siek f16a9890bf added typename in a few places
[SVN r15668]
2002-10-03 13:30:50 +00:00
Jeremy Siek 39104a5514 added this-> to access graph member since the base class is dependent
[SVN r15271]
2002-09-12 02:29:28 +00:00
Jeremy Siek 25dcd6f92c added this-> to access m_vis, since the base class is dependent
[SVN r15270]
2002-09-12 02:27:46 +00:00
Jeremy Siek 1b25060368 fixed broken URL links
[SVN r15122]
2002-08-31 12:34:27 +00:00
Jeremy Siek 2b6b96b97d removed the assertion about self edges
[SVN r15105]
2002-08-27 17:22:37 +00:00
Jeremy Siek 4e687216b7 added more specializations of hash
[SVN r15103]
2002-08-26 17:10:28 +00:00
Jeremy Siek fdb0f8e6b4 updated
[SVN r14997]
2002-08-20 15:55:52 +00:00
Jeremy Siek b3e7396c37 added typename
[SVN r14996]
2002-08-20 15:54:59 +00:00
Jeremy Siek 397ddb31ea blah
[SVN r14995]
2002-08-20 15:54:39 +00:00
Jeremy Siek ea1bc03f71 this is broken...
[SVN r14994]
2002-08-20 15:54:18 +00:00
Jeremy Siek 69762c75ec added "typename" in some places
[SVN r14991]
2002-08-20 15:45:33 +00:00
Jeremy Siek 58c22c7cf9 removed verify_isomorphism, it is now in isomorphism.hpp
[SVN r14989]
2002-08-20 15:25:04 +00:00
Jeremy Siek a976e279a4 *** empty log message ***
[SVN r14988]
2002-08-20 15:22:24 +00:00
Beman Dawes b50bae2b22 init commit
[SVN r14977]
2002-08-19 23:29:18 +00:00
Jeremy Siek cfbf43e814 added edge color
[SVN r14974]
2002-08-19 22:17:00 +00:00
Jeremy Siek a22326d2b5 hmm, forget what I changed...
[SVN r14973]
2002-08-19 22:16:50 +00:00
Jeremy Siek bb9e4ebe4a added undirected_dfs.cpp
[SVN r14972]
2002-08-19 22:16:32 +00:00
Jeremy Siek 49488dd54a various changes
[SVN r14971]
2002-08-19 22:16:15 +00:00
Jeremy Siek 5c190c2da5 forget what
[SVN r14970]
2002-08-19 22:16:05 +00:00
Jeremy Siek 6a35e532d7 added edge_color_map
[SVN r14969]
2002-08-19 22:15:44 +00:00
Jeremy Siek e9152d8d8d changed to be directed only
[SVN r14962]
2002-08-19 18:14:33 +00:00
Jeremy Siek 8608ebaf0a fixed edge coloring
[SVN r14961]
2002-08-19 18:12:14 +00:00
Jeremy Siek 258587e952 updated algo
[SVN r14960]
2002-08-19 18:11:26 +00:00
Jeremy Siek 8fc0b12e34 added link to undirected dfs
[SVN r14958]
2002-08-19 17:01:23 +00:00
Jeremy Siek 8d4aaff25f small edit
[SVN r14957]
2002-08-19 16:59:46 +00:00
Jeremy Siek cad149a5de new file
[SVN r14956]
2002-08-19 16:59:33 +00:00
Jeremy Siek 08bb638505 new file
[SVN r14954]
2002-08-19 16:45:01 +00:00
Jeremy Siek 9f7c65022d updated to new unit test stuff
[SVN r14861]
2002-08-14 21:28:15 +00:00
Jeremy Siek 4c668211c7 changed back to old order, fixed iteration macro problem in isomorphism.hpp instead
[SVN r14860]
2002-08-14 21:18:58 +00:00
Jeremy Siek 54a5a4a7a3 fixed how undef was used
[SVN r14859]
2002-08-14 21:17:59 +00:00
Jeremy Siek 019cfbf502 move #include of iteration_macros.hpp to come last (after isomorphism.hpp)
[SVN r14858]
2002-08-14 21:14:30 +00:00
Jeremy Siek 6668dc65b8 changed 2nd i to j
[SVN r14855]
2002-08-14 20:55:59 +00:00
Jeremy Siek 6fea41727d Fixed check for negative edges. Hurrah for concept archetypes!
[SVN r14853]
2002-08-14 20:53:27 +00:00
Jeremy Siek 4333f4c3f2 changed checking for directedness to use is_convertible
[SVN r14796]
2002-08-12 19:13:18 +00:00
Jeremy Siek 0415430b37 spelling, grammar
[SVN r14778]
2002-08-11 22:26:15 +00:00
Jeremy Siek ed7f263840 added answer to question about design decision to use free functions
[SVN r14777]
2002-08-11 20:08:30 +00:00
Jeremy Siek dfb53a9695 updated diameter result
[SVN r14715]
2002-08-06 15:51:39 +00:00
Jeremy Siek 274a57af77 added edge_range
[SVN r14713]
2002-08-06 15:00:16 +00:00
Jeremy Siek 185c8b4c66 added edge_range
[SVN r14712]
2002-08-06 14:55:12 +00:00
Jeremy Siek de3cf1c17c new file
[SVN r14711]
2002-08-06 14:54:52 +00:00
Jeremy Siek 8e398e19c2 changed "the" to "an" in docs for the edge(u,v,g) function
[SVN r14710]
2002-08-06 14:39:06 +00:00
Jeremy Siek 2647cb69a5 added MSVC version
[SVN r14637]
2002-07-29 19:11:05 +00:00
Jeremy Siek 6778c5eaed added the non-named parameter version
[SVN r14612]
2002-07-25 20:37:23 +00:00
Jeremy Siek 85e8916e35 added non-named parameter version
[SVN r14611]
2002-07-25 20:34:36 +00:00
Jeremy Siek 9dc4ef0c22 new file
[SVN r14610]
2002-07-25 19:54:01 +00:00
Jeremy Siek f4392384c1 added stuff for undirected edges
[SVN r14609]
2002-07-25 19:53:38 +00:00
Jeremy Siek 60d885a95f new file
[SVN r14608]
2002-07-25 19:29:06 +00:00
Jeremy Siek 7578421de9 removed two property map parameters
[SVN r14607]
2002-07-25 19:26:18 +00:00
Jeremy Siek b1fd572469 fixed bug, forgot to create the modifed graph with an extra vertex
[SVN r14606]
2002-07-25 19:25:50 +00:00
Jeremy Siek 42e13e2f11 removed bogus vertex and edges, cleaned up output a bit
[SVN r14604]
2002-07-25 18:52:00 +00:00
Jeremy Siek 149b84cb99 fixed book link
[SVN r14601]
2002-07-25 16:22:22 +00:00
Jeremy Siek ac633fd8e5 new file
[SVN r14524]
2002-07-18 17:00:41 +00:00
Jeremy Siek 6b08404083 moved call to postorder
[SVN r14523]
2002-07-18 17:00:25 +00:00
Jeremy Siek 22cb1e04ca added property map access
[SVN r14522]
2002-07-18 16:59:57 +00:00
Jeremy Siek 87f63c1241 added a tree parameter to the visitor functions
[SVN r14521]
2002-07-18 16:24:54 +00:00
Jeremy Siek 7085a2c7d9 small style change
[SVN r14492]
2002-07-17 13:23:17 +00:00
Jeremy Siek e4582d5118 added leda_ prefix to the node_map and node_array
[SVN r14482]
2002-07-16 14:57:08 +00:00
Jeremy Siek f18494eb54 new file, variation on dijkstra-example.cpp
[SVN r14480]
2002-07-16 14:50:11 +00:00
Jeremy Siek 9d978e16b2 fixed buggy call to graph edge iterator constructor
[SVN r14479]
2002-07-16 14:32:42 +00:00
Jeremy Siek 74a679b769 removed tabs
[SVN r14443]
2002-07-13 21:03:06 +00:00
Jeremy Siek ccaaef7a72 fixed typename bug
[SVN r14442]
2002-07-13 20:28:44 +00:00
Jeremy Siek 0bbfbb9bdd added version number check to #if BOOST_MSVC
[SVN r14440]
2002-07-13 17:23:25 +00:00
Jeremy Siek d9686745b8 added version number test for BOOST_MSVC #if's
[SVN r14439]
2002-07-13 17:21:37 +00:00
Jeremy Siek 73f3dc1a92 put #ifdef around templated edge iter constructors
[SVN r14438]
2002-07-13 17:12:55 +00:00
Dave Abrahams a500eba00d Fix unversioned VC++ checks
[SVN r14436]
2002-07-13 12:26:19 +00:00
Jeremy Siek 39e27bc6a7 fixed bug in set_difference
[SVN r14416]
2002-07-11 22:08:17 +00:00
Jeremy Siek 0f0cc3de96 fixed bug in remove_edge due to use of invalid iterator
(this bug was exposed by STLport)


[SVN r14406]
2002-07-11 19:07:45 +00:00
Jeremy Siek 7b96312a72 updated the refinement relationship for VertexListGraph to match the BGL book
[SVN r14233]
2002-06-24 16:37:02 +00:00
Jeremy Siek f16dfaf309 added ordered out edge answer
[SVN r14182]
2002-06-19 14:37:47 +00:00
Jeremy Siek 595c3708ed added set_subset function
[SVN r14142]
2002-06-14 00:41:01 +00:00
Ronald Garcia 877606cb52 Fixed a bug in property map creation.
[SVN r14128]
2002-06-10 18:35:24 +00:00
Ronald Garcia 802453b397 small fix
[SVN r14127]
2002-06-10 17:28:42 +00:00
Jeremy Siek 63cedbcc9c model of additions
[SVN r14126]
2002-06-10 17:05:42 +00:00
Jeremy Siek c36c15cd47 added model of CopyConstructible and Assignable
[SVN r14125]
2002-06-10 17:03:28 +00:00
Jeremy Siek e0620c90c0 fixed typo
[SVN r14123]
2002-06-10 16:21:44 +00:00
Jeremy Siek 2d62520f3a trying to fix figures
[SVN r14121]
2002-06-10 15:16:29 +00:00
Jeremy Siek e7056e65de trying to fix figures in adjacency_list
[SVN r14120]
2002-06-10 15:12:39 +00:00
Jeremy Siek 7fb2d45363 trying to fix pictures in adjacency_list doc
[SVN r14119]
2002-06-10 15:11:53 +00:00
Ronald Garcia 99fc1b170d fixed typo in name
[SVN r14104]
2002-06-07 17:42:22 +00:00
Jeremy Siek 42526b9ca5 changed Edge and Vertex to const& in topo_sort_visitor
[SVN r14026]
2002-05-23 16:28:02 +00:00
Jeremy Siek d70300766c added copyright notice
[SVN r14009]
2002-05-22 18:28:38 +00:00
Jeremy Siek d5573da050 added std:: prefix to invalid_argument
[SVN r14008]
2002-05-22 18:27:10 +00:00
Jeremy Siek b2ac4c2743 added std:: prefix to string
[SVN r14007]
2002-05-22 16:18:23 +00:00
Dave Abrahams eeefccf435 respect <sysinclude>
[SVN r13995]
2002-05-21 16:24:07 +00:00
Jeremy Siek 834d6ad8fd added some exceptions
[SVN r13978]
2002-05-19 16:26:37 +00:00
Jeremy Siek 63290266da added optimization of stopping as soon as relaxation is done
(thanks Herve for the suggestion!)


[SVN r13977]
2002-05-19 15:42:14 +00:00
Jeremy Siek ad88071877 did workaround, avoiding using default parameters in constructors for visitors
[SVN r13945]
2002-05-16 02:13:32 +00:00
Jeremy Siek 1efa4097a2 fix for dealing with leda macros
[SVN r13786]
2002-05-09 17:41:58 +00:00
Jeremy Siek 2d30710ee0 forgot to include <vector> and added is_sorted (meaning to check this in
for a while)


[SVN r13785]
2002-05-09 17:38:38 +00:00
John Maddock 76054ca8be Commented out duplicated function def.
changed <ctime> to <time.h> as clock and clock_t are used without std:: qualifiers


[SVN r13294]
2002-03-28 12:47:07 +00:00
Darin Adler a78fe97664 Add missing <cassert> includes.
[SVN r13264]
2002-03-24 19:05:41 +00:00
Jeremy Siek 1ef5b2d0f9 new example
[SVN r12988]
2002-02-28 20:37:14 +00:00
Jeremy Siek 44ced84aa0 removed tabs
[SVN r12707]
2002-02-04 20:29:35 +00:00
Jeremy Siek 443172599b new cover image, and added link to BGL book errata
[SVN r12703]
2002-02-04 20:12:27 +00:00
Douglas Gregor 3ef6deec39 Trivial fix to find compute_in_degree in boost::detail namespace
[SVN r12648]
2002-02-02 18:50:30 +00:00
Dave Abrahams ab2cb2b3d7 remove local rule usage for the time being.
[SVN r12626]
2002-02-02 00:49:24 +00:00
Jeremy Siek 6394da10fb fixed warning about comparison of signed and unsigned
[SVN r12533]
2002-01-28 15:25:28 +00:00
Douglas Gregor 64f6b89c03 eg1-iso.cpp:
- There is no isomorphism-v3.cpp


[SVN r12519]
2002-01-26 18:43:03 +00:00
Jeremy Siek 261dd8ab7b added clause in finish_vertex for the case when u is a leaf in the DFS-tree
[SVN r12512]
2002-01-25 16:45:46 +00:00
Jeremy Siek c265a5d47c corrected description of finish_vertex for DFSVisitor and improved wording
for BFSVisitor


[SVN r12511]
2002-01-25 16:14:06 +00:00
Jeremy Siek f66b70570f improved wording for finish_vertex
[SVN r12507]
2002-01-25 15:43:49 +00:00
Jeremy Siek 41d9380175 fixed name conflict with "Property" template parameter names for buggy compilers
[SVN r12493]
2002-01-25 01:58:56 +00:00
Jeremy Siek fc7d71789b better solution for operator<<
[SVN r12459]
2002-01-23 15:51:18 +00:00
Jeremy Siek 3f735f2066 blah
[SVN r12450]
2002-01-23 03:24:26 +00:00
Jeremy Siek b98e1687c2 moved the make_dfs_visitor function and the visitor class to above
where it first gets used


[SVN r12444]
2002-01-22 15:01:48 +00:00
Dave Abrahams 49cf35b0ea simplification
[SVN r12389]
2002-01-21 01:21:34 +00:00
Jeremy Siek 0604ad7274 *** empty log message ***
[SVN r12376]
2002-01-20 18:17:11 +00:00
Jeremy Siek e58e655b29 making the code prettier
[SVN r12344]
2002-01-18 03:33:53 +00:00
Jeremy Siek 55581ebe44 resolved more conflicts
[SVN r12343]
2002-01-18 03:19:20 +00:00
Jeremy Siek c5e6fda4de resolved merge
[SVN r12342]
2002-01-18 03:18:10 +00:00
Jeremy Siek 5ccae0f486 reorganized a bit
[SVN r12341]
2002-01-18 03:16:59 +00:00
Jeremy Siek f700be45cb added concept check for DistanceMatrix
[SVN r12340]
2002-01-18 03:12:23 +00:00
Jeremy Siek 2b112dcc11 fixed documentation for the DistanceMatrix in johnson's
[SVN r12339]
2002-01-18 01:11:55 +00:00
Lie-Quan Lee 50bd678384 change tabs to spaces
[SVN r12337]
2002-01-17 15:57:53 +00:00
Jeremy Siek 9c5a05fba6 updated the example link
[SVN r12327]
2002-01-15 20:35:15 +00:00
Jeremy Siek 2c0ed06838 added dynamic graph algorithms
[SVN r12324]
2002-01-15 15:45:37 +00:00
Lie-Quan Lee 9c82870ba5 replace tabs by proper number of spaces
[SVN r12323]
2002-01-15 03:43:22 +00:00
Lie-Quan Lee 256fe97529 change tabs to spaces
[SVN r12322]
2002-01-15 03:33:26 +00:00
Dave Abrahams d6c4087341 changed nested "bind" templates to "bind_" for MSVC.
[SVN r12319]
2002-01-14 21:29:55 +00:00
Dave Abrahams 3f58e4d848 Work with more libraries due to boost::detail::iterator_traits
[SVN r12317]
2002-01-14 21:25:17 +00:00
Jeremy Siek f0ef1e67c2 added a bunch of the property tags
[SVN r12316]
2002-01-14 19:34:22 +00:00
Jeremy Siek f49745c09c added:
The <tt>value_type</tt> of the buffer must be the <tt>vertex_descriptor</tt>
type for the graph.


[SVN r12315]
2002-01-14 19:13:59 +00:00
Jeremy Siek 5df6b464fd note about relation between vertex and edge descriptors of the original and filtered graph
[SVN r12314]
2002-01-14 19:08:01 +00:00
Lie-Quan Lee f458bf4b08 put boost:: before make_bfs_vistor in the example to make full qulification everywhere.
[SVN r12288]
2002-01-12 17:00:42 +00:00
Lie-Quan Lee bef01875bd *** empty log message ***
[SVN r12281]
2002-01-11 05:21:12 +00:00
Lie-Quan Lee a671d97270 fix copyright and email for David Abrahams
[SVN r12280]
2002-01-11 04:50:59 +00:00
Lie-Quan Lee e5b75b438e add new file
[SVN r12279]
2002-01-11 03:15:46 +00:00
Dave Abrahams aeb2d4a45c Modified Files:
boost/graph/breadth_first_search.hpp

		MSVC workaround

	boost/python/reference.hpp boost/python/converter/type_id.hpp
	boost/python/converter/unwrap.hpp
	boost/python/converter/wrap.hpp
	boost/python/converter/wrapper.hpp
	boost/python/detail/config.hpp libs/python/Jamfile
	libs/python/src/converter/registry.cpp
	libs/python/src/converter/type_id.cpp
	libs/python/src/converter/unwrap.cpp libs/python/test/m1.cpp
Added Files:
	boost/python/converter/wrapper_base.hpp


		CXX 6.x fixes


[SVN r12271]
2002-01-10 19:28:16 +00:00
Lie-Quan Lee e33c3b85f7 add traversal_category for Graph concept.
[SVN r12259]
2002-01-09 16:44:21 +00:00
Lie-Quan Lee cff7729134 add the choices for traversal_category
[SVN r12258]
2002-01-09 16:34:52 +00:00
Lie-Quan Lee a49d3b463c fix a typo
[SVN r12257]
2002-01-09 16:13:42 +00:00
Jeremy Siek de0a153c53 finished change, attributes[e] -> seq in write_attribute()
[SVN r12158]
2001-12-28 02:31:44 +00:00
Jeremy Siek 8dc5ae74ee Added Doug's write_all_attributes function and related changes
[SVN r12157]
2001-12-28 02:26:20 +00:00
Jeremy Siek cf7d296292 fixed put() function. Thanks Doug!
[SVN r12156]
2001-12-28 02:15:54 +00:00
Jeremy Siek c6976a6822 fixed some bugs in the test code
[SVN r12118]
2001-12-18 20:55:23 +00:00
Jeremy Siek 152ed87d83 removed #include of malloc.h
[SVN r12115]
2001-12-18 17:29:57 +00:00
Jeremy Siek 130f137390 added instructions and sample output
[SVN r12114]
2001-12-18 17:21:43 +00:00
Jeremy Siek 537acfbe1d added some instructions for running the program
[SVN r12113]
2001-12-18 17:19:28 +00:00
Jeremy Siek c2fa135465 added instructions at the top of the file, and also sample output
[SVN r12112]
2001-12-18 16:30:31 +00:00
Jeremy Siek 4bb358841d merged differences
[SVN r12108]
2001-12-18 16:14:42 +00:00
Jeremy Siek 6fa4c596fd subgraph related changes
[SVN r12107]
2001-12-18 16:08:06 +00:00
Jeremy Siek e4fa3d9e19 some fixes to subgraph
[SVN r12106]
2001-12-18 16:07:44 +00:00
Jeremy Siek 49c91d57a5 some progress, still far from done
[SVN r12105]
2001-12-18 16:07:23 +00:00
Jeremy Siek fce3fe6ca6 changed passing convention for the edge_set
[SVN r12103]
2001-12-18 03:53:10 +00:00
Jeremy Siek 4d9bc14e69 changed to const graph pointer
[SVN r12102]
2001-12-18 03:51:59 +00:00
Jeremy Siek d1f60541d9 const correctness fix, changed graph to const
[SVN r12100]
2001-12-18 02:43:16 +00:00
Jeremy Siek 22e8f37c3c fixed call to BFS
[SVN r12099]
2001-12-17 23:08:36 +00:00
Jeremy Siek 97cab7e93e fixed infinite loop caused by a typo
[SVN r12098]
2001-12-17 23:07:55 +00:00
Jeremy Siek b496ac4ede updated example to match the change to the data file
[SVN r12097]
2001-12-17 23:07:21 +00:00
Jeremy Siek f4f24955cb Removed the self-edge.
[SVN r12096]
2001-12-17 23:06:33 +00:00
Jeremy Siek b1c0d0f6c1 added a note about the origin of the example
[SVN r12089]
2001-12-17 19:48:15 +00:00
Jeremy Siek c2cc2f1530 made output prettier
[SVN r12088]
2001-12-17 19:38:55 +00:00
Jeremy Siek dcb0dd0aa5 example was trying to add a self edge to an undirected graph,
should have been a directed graph anyways, so I changed it.


[SVN r12087]
2001-12-17 19:24:58 +00:00
Jeremy Siek e7c0d34a98 fixed a bug concerning g_to_tc_map
[SVN r12059]
2001-12-14 15:02:31 +00:00
Jeremy Siek b160dcdba8 fixed a bug in g_to_tc_map
[SVN r12058]
2001-12-14 15:01:49 +00:00
Jeremy Siek ed4bdc2417 added clear_vertex test
[SVN r12037]
2001-12-13 16:52:47 +00:00
Jeremy Siek 6849cde487 added cleaar_vertex test
[SVN r12036]
2001-12-13 16:52:25 +00:00
Jeremy Siek df3219f2cb added a thing about using -ftemplate-depth-NN for g++
[SVN r12035]
2001-12-13 16:42:00 +00:00
Jeremy Siek 750bd9a13d fixed some typos
[SVN r12034]
2001-12-13 16:25:15 +00:00
Jeremy Siek b1784b9ebb added another test
[SVN r12031]
2001-12-13 16:00:37 +00:00
Jeremy Siek 7a31d48962 got basic add_vertex and add_edge tests working
[SVN r12029]
2001-12-13 06:09:25 +00:00
Jeremy Siek 54f558ea0e made some progress, got basic add_vertex and add_edge test working
[SVN r12028]
2001-12-13 06:08:45 +00:00
Jeremy Siek efa71a63bc new file
[SVN r12027]
2001-12-13 04:40:20 +00:00
Jeremy Siek ab6d7a4b45 new file, modularized generic graph tests
[SVN r12026]
2001-12-13 03:23:18 +00:00
Jeremy Siek b656236dfe added subgraph
[SVN r12025]
2001-12-13 01:41:18 +00:00
Jeremy Siek 64a41688bf added subgraph docs
[SVN r12024]
2001-12-13 01:39:41 +00:00
Jeremy Siek 097001da6a added indirect_pmap
[SVN r12003]
2001-12-10 16:24:39 +00:00
Jeremy Siek 6fda589723 added a note at the top
[SVN r12002]
2001-12-10 04:11:58 +00:00
Jeremy Siek 08b26e3f3b additions from the Wiki
[SVN r12001]
2001-12-10 04:10:00 +00:00
Jeremy Siek b761b44a0d any_equal -> contains
and moved iota to detail/algorithm.hpp


[SVN r12000]
2001-12-10 03:58:15 +00:00
Jeremy Siek 68b55f244d any_equal -> contains
[SVN r11999]
2001-12-10 03:57:49 +00:00
Jeremy Siek 02ac6db93d moved algorithm.hpp again
[SVN r11998]
2001-12-10 03:44:04 +00:00
Jeremy Siek 12e472b741 moved to boost/detail
[SVN r11997]
2001-12-10 03:40:27 +00:00
Jeremy Siek 994bbd5f4a this is getting used in the isomorphism algorithm.
This will eventually develop into the Boost.Algorithm library


[SVN r11996]
2001-12-10 03:39:57 +00:00
Jeremy Siek b18c5360ae changed header location for algorithm.hpp
[SVN r11995]
2001-12-10 03:35:08 +00:00
Jeremy Siek 73f8ed8f4c changed location of the algorithm.hpp header
[SVN r11994]
2001-12-10 03:33:46 +00:00
Jeremy Siek 36a92c7f3b being used in isomorphism.hpp
[SVN r11993]
2001-12-10 03:32:57 +00:00
Jeremy Siek aa0d999d15 finished isomorphism
[SVN r11991]
2001-12-09 16:50:45 +00:00
Jeremy Siek 33cca10d36 new file
[SVN r11990]
2001-12-09 16:50:19 +00:00
Jeremy Siek 6f93b9d06d new version
[SVN r11989]
2001-12-09 16:46:12 +00:00
Jeremy Siek fef88c6398 finished!
[SVN r11988]
2001-12-09 16:44:17 +00:00
Jeremy Siek bab22e8995 cleaned up implementation a bit, started debugging again
[SVN r11983]
2001-12-08 21:44:44 +00:00
Jeremy Siek 320200fbc5 added a make function
[SVN r11982]
2001-12-08 20:42:36 +00:00
Jeremy Siek a2bf3d5d57 new file
[SVN r11978]
2001-12-08 06:26:02 +00:00
Lie-Quan Lee 53c4b7e6cd add document for write/read graphviz
[SVN r11977]
2001-12-07 22:43:19 +00:00
Jeremy Siek 2f2c90247e some additions
[SVN r11976]
2001-12-07 19:26:34 +00:00
Jeremy Siek ec25450524 new example
[SVN r11975]
2001-12-07 19:23:42 +00:00
Jeremy Siek a0061ba07e ADJACENT -> ADJ
[SVN r11974]
2001-12-07 17:34:56 +00:00
Jeremy Siek 5de2e1da53 fixed
[SVN r11973]
2001-12-07 16:04:17 +00:00
Jeremy Siek 980ba2c8ad new file, version 3, hope this is the last!
[SVN r11969]
2001-12-07 09:01:13 +00:00
Jeremy Siek cc16790818 more description
[SVN r11968]
2001-12-07 07:58:28 +00:00
Jeremy Siek d843017353 added vertex invariant stuff for isomorphism
[SVN r11967]
2001-12-07 07:55:12 +00:00
Jeremy Siek 303d7671d8 some fixes
[SVN r11966]
2001-12-07 03:16:43 +00:00
Jeremy Siek db43b1c850 few minor mods
[SVN r11965]
2001-12-07 03:15:12 +00:00
Jeremy Siek 7a1792c83c more documentation
[SVN r11964]
2001-12-06 23:10:27 +00:00
Jeremy Siek c07cc82a4f removed _T in a couple places
[SVN r11961]
2001-12-06 20:41:06 +00:00
Jeremy Siek 14864367bd implementation is now clean and general! (and works too!)
[SVN r11960]
2001-12-06 20:20:23 +00:00
Jeremy Siek 0a47324e23 starting cleanup, and generalization
[SVN r11959]
2001-12-06 17:36:12 +00:00
Jeremy Siek ab92236d78 typo
[SVN r11958]
2001-12-06 17:08:47 +00:00
Jeremy Siek ff79797a30 changed to safer two for-loop mechanism
[SVN r11957]
2001-12-06 17:07:51 +00:00
Jeremy Siek 8ddcdfd33e added more warnings and examples
[SVN r11956]
2001-12-06 16:20:33 +00:00
Jeremy Siek dcde366d0e added a warning
[SVN r11955]
2001-12-06 16:17:33 +00:00
Jeremy Siek 91d0af6c3c added eg1-iso.cpp
[SVN r11950]
2001-12-06 07:07:47 +00:00
Jeremy Siek fbb9320ea5 new file
[SVN r11949]
2001-12-06 07:07:26 +00:00
Jeremy Siek f59476b6bf huge progress!
[SVN r11948]
2001-12-06 07:07:01 +00:00
Jeremy Siek 170c7d20fb hopelessly lost
[SVN r11945]
2001-12-05 23:08:46 +00:00
Jeremy Siek 25302ccbd7 fixed bug, edge -> edges
[SVN r11934]
2001-12-05 20:27:12 +00:00
Jeremy Siek ed5bbee076 more progress
[SVN r11932]
2001-12-05 17:08:16 +00:00
Jeremy Siek 449d4a1155 added make for isomorphism.cpp
[SVN r11929]
2001-12-05 15:50:25 +00:00
Jeremy Siek a722c03e20 fixed comment, G1 -> G2
[SVN r11928]
2001-12-05 15:25:00 +00:00
Jeremy Siek 05ca32e656 making slow progress
[SVN r11927]
2001-12-05 05:13:50 +00:00
Jeremy Siek 7234e21211 added some default constructors to property maps
[SVN r11925]
2001-12-05 03:41:40 +00:00
Jeremy Siek 14df1ae19d new file
[SVN r11924]
2001-12-05 03:40:43 +00:00
Jeremy Siek 571a855bbc fixed a bug in some of them, can't assign to edge or vertex var in the
initialization part, might be an empty sequence


[SVN r11923]
2001-12-05 03:40:10 +00:00
Jeremy Siek d54ebbf4bb fixed a bug
[SVN r11922]
2001-12-05 00:54:55 +00:00
Jeremy Siek c31151437a added some stuff
[SVN r11921]
2001-12-05 00:47:34 +00:00
Jeremy Siek 9177957cfc added a comment to document how the macros work
[SVN r11920]
2001-12-05 00:36:14 +00:00
Jeremy Siek c8d186e50b new files
[SVN r11919]
2001-12-04 23:07:03 +00:00
Jeremy Siek 352099dc87 progress towards version 2
[SVN r11918]
2001-12-04 23:06:15 +00:00
Jeremy Siek 0d9e90200b removed use of iota()
[SVN r11917]
2001-12-04 22:25:14 +00:00
Jeremy Siek 28d9222735 changed to use better invariant
[SVN r11913]
2001-12-04 18:51:15 +00:00
Jeremy Siek 6503c7a8bc some fixes
[SVN r11903]
2001-12-04 02:01:39 +00:00
Jeremy Siek 63cefa95f7 added a bibliography
[SVN r11902]
2001-12-04 01:46:52 +00:00
Jeremy Siek 80b5933e0a makefile for creating literate docs
[SVN r11901]
2001-12-04 01:32:34 +00:00
Jeremy Siek 80d971a7ab new file
[SVN r11900]
2001-12-04 01:29:42 +00:00
Jeremy Siek 49fd1e8397 added another citation
[SVN r11899]
2001-12-04 01:20:50 +00:00
Jeremy Siek 385f6886ad update, changed simple_isomorphism to isomorphism in a couple places
[SVN r11897]
2001-12-03 22:48:37 +00:00
Jeremy Siek 28946e60d2 change simple_isomorphism to isomorphism in a couple places
[SVN r11896]
2001-12-03 22:47:00 +00:00
Jeremy Siek fea0a73313 added a link to the literate doc for the implementation
[SVN r11895]
2001-12-03 22:44:10 +00:00
Jeremy Siek 7d838ee7a4 added a note to the top of the header file
[SVN r11894]
2001-12-03 22:43:33 +00:00
Jeremy Siek 7ecf6f59a6 improved and simplified version, matching the literate doc
[SVN r11893]
2001-12-03 22:43:11 +00:00
Jeremy Siek bf33e66413 new file
[SVN r11891]
2001-12-03 22:34:23 +00:00
Jeremy Siek 877f0d3b04 finished!
[SVN r11890]
2001-12-03 22:32:02 +00:00
Jeremy Siek e88bd871cb mostly finished now
[SVN r11882]
2001-12-03 21:19:32 +00:00
Jeremy Siek 01a7242fc0 corrected some of the commentary, still have a little more to go
[SVN r11876]
2001-12-03 17:14:20 +00:00
Jeremy Siek 04c9f2a7d0 code is working, need to reword some of the commentary based on tonight's
lessons learned


[SVN r11867]
2001-12-03 04:53:48 +00:00
Jeremy Siek 1ee576fea0 added some stuff
[SVN r11854]
2001-12-02 18:51:31 +00:00
Jeremy Siek 2f33232ea8 more progress, simplified the main function
[SVN r11850]
2001-12-01 23:13:57 +00:00
Jeremy Siek f31e26f473 added some figures
[SVN r11848]
2001-12-01 19:42:36 +00:00
Douglas Gregor cd177c8c15 isomorphism.cpp:
- Added timing of isomorphism algorithm
  - Output both graphs if there is a verification failure


[SVN r11847]
2001-12-01 16:34:14 +00:00
Jeremy Siek dfab7321dd more progress
[SVN r11843]
2001-12-01 02:39:35 +00:00
Jeremy Siek 4ac3b7c269 new files
[SVN r11834]
2001-11-30 16:01:51 +00:00
Jeremy Siek ffc5a92b41 made some more progress
[SVN r11821]
2001-11-30 05:59:28 +00:00
Jeremy Siek 96fb1f3fac made some progress
[SVN r11818]
2001-11-29 23:47:51 +00:00
Jeremy Siek 2af0e49c87 removed debug print stuff
[SVN r11817]
2001-11-29 23:37:25 +00:00
Jeremy Siek 4585685c64 fixed another bug
[SVN r11816]
2001-11-29 23:27:47 +00:00
Douglas Gregor f576c1828d isomorphism.cpp:
- Output the failed graph when an error occurs.


[SVN r11812]
2001-11-29 20:33:31 +00:00
Jeremy Siek 0be3562844 new file
[SVN r11808]
2001-11-29 16:40:09 +00:00
Douglas Gregor 79847fd163 isomorphism.cpp:
- Made standard test less CPU intensive
  - Make graph types different


[SVN r11806]
2001-11-29 13:34:10 +00:00
Douglas Gregor 1a29ad2c7a isomorphism.hpp:
- Fixed small typo - used Graph1 instead of Graph2 to get VertexG2


[SVN r11805]
2001-11-29 13:33:23 +00:00
Jeremy Siek 294cf572a3 changed to use boost random number library
[SVN r11804]
2001-11-29 07:14:57 +00:00
Jeremy Siek 7385173288 fixed several bugs
[SVN r11803]
2001-11-29 07:08:17 +00:00
Douglas Gregor 04ef43e4ac graph/isomorphism.hpp:
- Added some missing "typename"s

random/uniform_int.hpp:
  - Don't include <limits> directly


[SVN r11802]
2001-11-29 04:03:52 +00:00
Douglas Gregor cba36c6033 isomorphism.cpp:
- Tests for isomorphism algorithm


[SVN r11801]
2001-11-29 04:02:57 +00:00
Jeremy Siek 95120649d2 changed to use dijkstra_shortest_paths_no_init
[SVN r11799]
2001-11-28 21:59:15 +00:00
Jeremy Siek 6b3b2d1c0c added dijkstra_shortest_paths_no_init
[SVN r11798]
2001-11-28 21:58:53 +00:00
Jeremy Siek 6605341a1e new file
[SVN r11795]
2001-11-28 21:31:09 +00:00
Douglas Gregor ec28f6c8ee depth_first_search.html:
- Describe root_vertex parameter and form with starting vertex


[SVN r11794]
2001-11-28 07:21:01 +00:00
Douglas Gregor 0385bca4b7 depth_first_search.hpp:
- Added ability to specify starting vertex for depth_first_search


[SVN r11793]
2001-11-28 06:55:46 +00:00
Jeremy Siek 3601ab7b4a added link to new example, and fixed link to old example
[SVN r11758]
2001-11-21 04:30:51 +00:00
Jeremy Siek 73f41b8785 new file
[SVN r11756]
2001-11-21 04:14:29 +00:00
Jeremy Siek e579bf2cd1 fixed bug in make_filtered_graph with respect to the VertexPredicate
[SVN r11646]
2001-11-09 20:55:45 +00:00
Jeremy Siek e4eb759d59 new file, simple test for a bug in filtered_graph
[SVN r11645]
2001-11-09 20:54:56 +00:00
Jeremy Siek 076be173e2 changed subgraph constructor
[SVN r11643]
2001-11-09 14:52:23 +00:00
Jeremy Siek 04bc75cd40 some bug fixes from Rich
[SVN r11641]
2001-11-09 14:41:02 +00:00
Jeremy Siek 90cc4a95b4 changed to digraph to match input file
[SVN r11640]
2001-11-09 14:18:01 +00:00
Jeremy Siek f664ee3baf added #defines for GRAPHVIZ_GRAPH so user doesn't have to specify them
at the command line


[SVN r11621]
2001-11-07 03:25:12 +00:00
Jeremy Siek 140de98250 make sure #include <boost/config.hpp> comes first
[SVN r11617]
2001-11-06 21:45:27 +00:00
Jeremy Siek 43efa28d29 *** empty log message ***
[SVN r11607]
2001-11-06 04:18:10 +00:00
Jeremy Siek 74c9fa60de linked in some files tothe TOC
fixed some transitive closure stuff
removed obsolete file using_graph_algorithms.html
added a jamfile to the test/ dir


[SVN r11599]
2001-11-05 20:33:47 +00:00
Jeremy Siek 90e70dce7b special case for empty graph and sixed a problem with orig_to_copy
[SVN r11598]
2001-11-05 20:28:41 +00:00
Jeremy Siek ea5aa3d107 fixed get() constness
[SVN r11597]
2001-11-05 20:13:55 +00:00
Jeremy Siek 01b3ee1c64 new file
[SVN r11596]
2001-11-05 20:06:35 +00:00
Jeremy Siek 7eef43cea8 added a note about the num_vertices, and added explanation in docs
[SVN r11594]
2001-11-05 17:22:34 +00:00
Jeremy Siek 2c10480b28 changed to take const graph in constructor
[SVN r11593]
2001-11-05 17:22:01 +00:00
Jeremy Siek 7162fea287 fixed lexical cast g++ sstream problem
[SVN r11592]
2001-11-05 16:43:43 +00:00
Jeremy Siek 304765a5ca a few g++ fixes
[SVN r11591]
2001-11-05 16:41:38 +00:00
Jeremy Siek 4e958ba352 changed to use vecS for the EdgeList type
[SVN r11580]
2001-11-05 04:04:35 +00:00
Jeremy Siek 1c9b7a86f5 finished changes for random acces edge list
[SVN r11579]
2001-11-05 03:51:41 +00:00
Jeremy Siek 2d22a32f3a added random access option for the edge list
[SVN r11578]
2001-11-05 03:40:55 +00:00
Jeremy Siek f3ddfbfead finished adding non-named parameter (forgot one thing)
[SVN r11577]
2001-11-05 01:07:04 +00:00
Jeremy Siek 3ddd054124 non-named parameter version of some BGL algorithms
some VC++ compiler stuff


[SVN r11576]
2001-11-04 23:24:12 +00:00
Jeremy Siek 7d403bc6c7 non-named parameter versions of the algorithms
[SVN r11575]
2001-11-04 23:23:28 +00:00
Jeremy Siek cb16f8a63e added a copy constructor to do deep copy of the list of children
[SVN r11564]
2001-11-04 05:13:14 +00:00
Jeremy Siek a2fa9cf2cb avoid warnings about not being initialized
[SVN r11562]
2001-11-04 04:08:46 +00:00
Jeremy Siek df1d831cdf moved a file to sgb-regression
[SVN r11561]
2001-11-04 04:07:06 +00:00
Jeremy Siek 6fb684c821 iterator adaptor change
[SVN r11559]
2001-11-04 03:28:19 +00:00
Jeremy Siek 561ac6b939 new lists
[SVN r11558]
2001-11-04 03:21:28 +00:00
Jeremy Siek d65232abaa removed slistS from the list of configurations to test
[SVN r11557]
2001-11-04 03:16:56 +00:00
Jeremy Siek e6aa3b06b0 changed slistS to listS so as to not rely on non-std stuff
[SVN r11556]
2001-11-04 03:15:24 +00:00
Jeremy Siek 1c31f8cafa some more iterator adaptor changes
[SVN r11555]
2001-11-04 03:07:53 +00:00
Jeremy Siek 1ffe30f89b iterator adaptor update and related changes
[SVN r11554]
2001-11-04 02:50:10 +00:00
Jeremy Siek e7dda7eb6d *** empty log message ***
[SVN r11553]
2001-11-04 00:26:55 +00:00
Jeremy Siek 4b7aa8fc4b *** empty log message ***
[SVN r11552]
2001-11-03 19:13:47 +00:00
Jeremy Siek 86e7e07e2e *** empty log message ***
[SVN r11551]
2001-11-03 17:20:30 +00:00
Jeremy Siek fbe3b430e0 *** empty log message ***
[SVN r11550]
2001-11-03 16:38:55 +00:00
Jeremy Siek 048cf582e2 *** empty log message ***
[SVN r11549]
2001-11-03 06:40:35 +00:00
Jeremy Siek 21ba3be83c *** empty log message ***
[SVN r11548]
2001-11-03 06:20:59 +00:00
Jeremy Siek 2caa382c9d *** empty log message ***
[SVN r11545]
2001-11-03 05:07:46 +00:00
Jeremy Siek af826c7074 new files
[SVN r11544]
2001-11-03 04:54:54 +00:00
Jeremy Siek 8c5fc2a96e *** empty log message ***
[SVN r11543]
2001-11-03 04:43:33 +00:00
Jeremy Siek 8888e44a0f *** empty log message ***
[SVN r11542]
2001-11-03 01:46:24 +00:00
Jeremy Siek d5d69d0c82 *** empty log message ***
[SVN r11539]
2001-11-02 22:51:24 +00:00
Jeremy Siek 44c8e75c2e *** empty log message ***
[SVN r11538]
2001-11-02 21:35:44 +00:00
Jeremy Siek 98f6b487bd fixes for KCC
[SVN r11535]
2001-11-02 14:47:00 +00:00
Jeremy Siek f67afc52c8 new file
[SVN r11534]
2001-11-02 06:28:35 +00:00
Jeremy Siek deb9d39027 kcc fixes
[SVN r11533]
2001-11-02 06:21:32 +00:00
Jeremy Siek e52aa12a74 iKCC fixes
[SVN r11532]
2001-11-02 06:21:01 +00:00
Jeremy Siek 398aad812f only build the debug versions of the library, the optimized version takes too much memory to compile (over 1GB! on a linux box)
[SVN r11527]
2001-11-02 04:07:01 +00:00
Jeremy Siek 1dd9c54a19 various fixes and work on the Jamfiles
[SVN r11525]
2001-11-02 02:00:54 +00:00
Jeremy Siek bb278dfd8b updated to change in prim interface
[SVN r11520]
2001-11-01 23:23:29 +00:00
Jeremy Siek d265125e8f fixed isomoprhism
[SVN r11519]
2001-11-01 22:43:20 +00:00
Jeremy Siek 91afa63044 working on jam
[SVN r11518]
2001-11-01 22:32:08 +00:00
Jeremy Siek c0176700a6 removed some redundant files
[SVN r11514]
2001-11-01 20:59:19 +00:00
Jeremy Siek bb0fc3a38c various fixes
[SVN r11513]
2001-11-01 20:30:32 +00:00
Jeremy Siek 36e2a3074f fixed signed/unsigned compares
[SVN r11512]
2001-11-01 20:10:30 +00:00
Jeremy Siek 3ec7cee5e2 updated Andrew's web page URL
[SVN r11509]
2001-11-01 17:24:53 +00:00
Jeremy Siek f79bd7ef42 updated email addresses
[SVN r11507]
2001-11-01 17:22:28 +00:00
Jeremy Siek 4b772c3f03 changes to some example file names
[SVN r11506]
2001-11-01 17:13:28 +00:00
Jeremy Siek e3afc20360 changed name of these files
[SVN r11505]
2001-11-01 17:10:15 +00:00
Jeremy Siek 5390ee0f7d indent screwed up
[SVN r11504]
2001-11-01 17:05:55 +00:00
Jeremy Siek 5215e9b4f2 examples from the book
[SVN r11503]
2001-11-01 16:56:10 +00:00
Jeremy Siek d5f559e652 added link to AWL book page
[SVN r11446]
2001-10-26 00:10:43 +00:00
Jeremy Siek 3bbe76382d new file
[SVN r11445]
2001-10-26 00:10:01 +00:00
Jeremy Siek 393fa73878 fixed bug in constructor
[SVN r11434]
2001-10-24 19:00:22 +00:00
Darin Adler b32f7d7176 Fix spelling error: "occurances" -> "occurrences".
[SVN r11376]
2001-10-11 17:26:04 +00:00
Jeremy Siek 3521815d8c fixed include of bucket sorter
[SVN r11343]
2001-10-04 22:47:31 +00:00
Jeremy Siek ce7f13f760 fixed
[SVN r11342]
2001-10-04 22:46:41 +00:00
Jeremy Siek 1dd8aff67f changed NAME tag
[SVN r11335]
2001-10-02 17:55:59 +00:00
Jeremy Siek 35c92a9f40 changed indenting
[SVN r11334]
2001-10-02 17:37:24 +00:00
Jeremy Siek 167cd7ec62 obsolete file
[SVN r11333]
2001-10-02 17:19:34 +00:00
Jeremy Siek 77172b101e obsolete files
[SVN r11332]
2001-10-02 17:19:03 +00:00
Jeremy Siek c32f22631b removed uniform cost stuff
[SVN r11331]
2001-10-02 17:18:16 +00:00
Jeremy Siek 223235a0f1 removed 's'
[SVN r11330]
2001-10-02 17:17:53 +00:00
Beman Dawes 04c4df910d 1.25.0 Final runup
[SVN r11315]
2001-10-01 15:54:23 +00:00
Jeremy Siek 36da83ffe1 visitor stuff
[SVN r11280]
2001-09-26 15:28:51 +00:00
Jeremy Siek c78cc61a52 added default_bfs_visitor
[SVN r11279]
2001-09-26 15:28:41 +00:00
Jeremy Siek d08fbf9e34 added link to downloads
[SVN r11262]
2001-09-25 21:18:20 +00:00
Darin Adler 0d833d261b Fix to work with non-std extensions namespace.
[SVN r11193]
2001-09-22 02:55:45 +00:00
Darin Adler b6df85d0ff Fix to work properly with non-std extensions namespace.
[SVN r11192]
2001-09-22 02:55:10 +00:00
Jeremy Siek 2c4ae14fbf changed ar
[SVN r11188]
2001-09-21 21:51:09 +00:00
Jeremy Siek 61ba919d47 bye bye
[SVN r11185]
2001-09-21 17:16:21 +00:00
Jeremy Siek f96a2347c0 changed #include of tree_structure.hpp to tree_traits.hpp
[SVN r11171]
2001-09-20 15:37:29 +00:00
Jeremy Siek e60c67fa0c added named parameters
[SVN r11126]
2001-09-14 18:41:39 +00:00
Jeremy Siek 14dee94585 added named parameter version
[SVN r11124]
2001-09-14 17:01:16 +00:00
Jeremy Siek 1af19ce75c removed the -d for the output
[SVN r11108]
2001-09-12 20:52:17 +00:00
Jeremy Siek 918a13fd5d new file
[SVN r11107]
2001-09-12 20:48:21 +00:00
Jeremy Siek 5254133ebc finished implementation of bcc
[SVN r11106]
2001-09-12 20:40:18 +00:00
Jeremy Siek bac38fd476 worked on intro, etc.
[SVN r11104]
2001-09-12 16:21:50 +00:00
Jeremy Siek b5cbee0b18 1st draft of the algorithm
[SVN r11101]
2001-09-12 04:58:07 +00:00
Jeremy Siek ea0713d477 more work on the correctness proof
[SVN r11100]
2001-09-12 01:43:38 +00:00
Jeremy Siek d01e32a0c8 moved source(pair) and target(pair) into namespace std
[SVN r11096]
2001-09-11 15:28:50 +00:00
Jeremy Siek f41fc4c8b0 some additions
[SVN r11095]
2001-09-11 15:04:41 +00:00
Jeremy Siek 02f68e8e0c new file
[SVN r11093]
2001-09-11 01:10:33 +00:00
Jeremy Siek da4c8f3c59 added a public non-NTP version
[SVN r11048]
2001-09-06 05:23:21 +00:00
Jeremy Siek a8ccda6a94 switch to use simpler version of BFS
[SVN r11047]
2001-09-06 05:20:45 +00:00
Jeremy Siek 78e6dc44cd fixed breadth_first_search
[SVN r11046]
2001-09-06 05:12:42 +00:00
Jeremy Siek eb75d45b7d added docs for non-named template param versions
[SVN r11045]
2001-09-06 05:08:48 +00:00
Jeremy Siek cac9c7c670 changed the name of bfs_impl to breadth_first_visit and made it public
(moved out of detail namespace)


[SVN r11044]
2001-09-06 04:57:00 +00:00
Jeremy Siek 741ac3cc5d swap unqualified is not working for builtins on the MacOS X c++
[SVN r11043]
2001-09-06 04:14:38 +00:00
Jeremy Siek 37cfe92cd1 call abs() unqualified
[SVN r11031]
2001-09-05 15:04:39 +00:00
Jeremy Siek be7fdbbc90 call std::swap unqualified
[SVN r11030]
2001-09-05 15:03:28 +00:00
Jeremy Siek 65c4f217e1 updates for Dijkstra's
[SVN r11014]
2001-09-03 23:16:55 +00:00
Jeremy Siek 0adf317473 updates for dijkstra's
[SVN r11013]
2001-09-03 23:16:37 +00:00
Jeremy Siek 80d97db4d4 removed inf and zero generator, just passing in objects instead
[SVN r11012]
2001-09-03 23:15:55 +00:00
Jeremy Siek 1490d11dc1 updated to use Monoid
[SVN r11011]
2001-09-03 23:15:17 +00:00
Jeremy Siek 108ac662db new file
[SVN r11010]
2001-09-03 23:14:55 +00:00
Jeremy Siek 63cb03ee66 updated to dijkstra change
[SVN r11009]
2001-09-03 21:17:45 +00:00
Jeremy Siek 936ea6d201 small edit
[SVN r11008]
2001-09-03 21:14:37 +00:00
Jeremy Siek 0868a30bf4 added abs() overloads for dist_value and size_t
[SVN r11007]
2001-09-03 20:38:19 +00:00
Jeremy Siek 753f3deacc switched to closed plus
[SVN r11006]
2001-09-03 20:36:51 +00:00
Jeremy Siek 020fff0e68 added closed plus
[SVN r11005]
2001-09-03 20:36:22 +00:00
Jeremy Siek 8e55436641 reverted the change to use expand/summarize. That abstraction doesn't
work for the implementation because the compare is really required,
for the queue in Dijkstra's and for checking for neg cycles in Bellman.


[SVN r11004]
2001-09-03 20:25:49 +00:00
Jeremy Siek e49c09dbcc removed unused parameter
[SVN r11000]
2001-09-03 16:01:43 +00:00
Jeremy Siek 9f189ea251 changed from DOS to UNIX line endings
[SVN r10963]
2001-08-30 01:14:23 +00:00
Jeremy Siek 06e257cca1 fixes from Rich Lee
[SVN r10962]
2001-08-30 01:06:28 +00:00
Jeremy Siek 585bdc4581 now this is auto-generated
[SVN r10958]
2001-08-29 16:58:38 +00:00
Jeremy Siek 92f34d87cf fixed a few things and added appendix
[SVN r10957]
2001-08-29 16:57:03 +00:00
Jeremy Siek 4978760586 fixed hash_setS by adding a specialization of hash<> for stored edge
[SVN r10956]
2001-08-29 03:18:47 +00:00
Jeremy Siek 78221a7d9d avoid warning about un-init var
[SVN r10955]
2001-08-28 22:17:56 +00:00
Jeremy Siek f1218f29c1 fixed leda_node_property_map
[SVN r10954]
2001-08-28 22:17:13 +00:00
Jeremy Siek 8e883f6b8d changed handling of zero element
[SVN r10945]
2001-08-28 02:00:54 +00:00
Jeremy Siek ebc42db0ac dijkstra change updates
[SVN r10944]
2001-08-28 01:03:34 +00:00
Jeremy Siek a8169117e7 removed some unused parameter names
[SVN r10943]
2001-08-28 01:01:02 +00:00
Jeremy Siek 38d9e1c16a added a missing typename
[SVN r10942]
2001-08-28 00:56:44 +00:00
Jeremy Siek fce1e474de changed dijkstra's and bellman_ford to reflect closed semiring abstraction
[SVN r10941]
2001-08-27 22:31:48 +00:00
Jeremy Siek 79c23ef37c changed from #include <boost/utility.hpp> to #include <boost/tuple/tuple.hpp>
to get tie()


[SVN r10940]
2001-08-27 14:08:52 +00:00
Jeremy Siek 8dbcb2cc35 removed #include of map and hash_map
[SVN r10937]
2001-08-26 19:17:57 +00:00
Jeremy Siek 3633d698d5 edge iterators qualify as forward iterators
[SVN r10933]
2001-08-24 20:29:24 +00:00
Jeremy Siek f4bee8e49d added #include of <cmath> for std::abs(float)
[SVN r10932]
2001-08-24 20:05:55 +00:00
Beman Dawes 62e5677397 Misc; mostly fix links to hard disk locations
[SVN r10902]
2001-08-20 13:04:43 +00:00
Beman Dawes 2b15915418 Fix broken hyperlink
[SVN r10896]
2001-08-19 15:08:33 +00:00
Jeremy Siek 866581da18 blah
[SVN r10885]
2001-08-17 18:07:57 +00:00
Jeremy Siek a53afa3f85 made condensation graph separate
[SVN r10879]
2001-08-16 18:57:48 +00:00
Jeremy Siek d7fef57674 made build_component_lists a separate function
[SVN r10878]
2001-08-16 15:28:37 +00:00
Jeremy Siek cc7bb99dab added build_components_lists
[SVN r10877]
2001-08-16 15:27:58 +00:00
Jeremy Siek 2161263943 comment about is_reachable
[SVN r10871]
2001-08-15 13:39:49 +00:00
Jeremy Siek 96f1e05c68 removed check for adding self edges... self edges ok if a non-triv path exists
[SVN r10870]
2001-08-15 13:17:31 +00:00
Jeremy Siek 3573eca026 removed check for self edges in final stage
[SVN r10869]
2001-08-15 13:16:56 +00:00
Jeremy Siek 74f52fff4f removed a blank line!
[SVN r10868]
2001-08-15 03:37:31 +00:00
Jeremy Siek 1217a3640e some more edits
[SVN r10867]
2001-08-15 03:27:28 +00:00
Jeremy Siek b7e10fba1e changed * to +
[SVN r10866]
2001-08-15 03:26:35 +00:00
Jeremy Siek 63801dee89 added concept check of the VertexIndexMap
[SVN r10865]
2001-08-15 03:25:07 +00:00
Jeremy Siek 2dd42cbdec added comment about path needs to be of at least one edge
[SVN r10864]
2001-08-15 02:05:58 +00:00
Jeremy Siek 377af01609 make component_number a property map
[SVN r10863]
2001-08-15 02:01:12 +00:00
Jeremy Siek 6dba429c3c new file, implementation docs for tc
[SVN r10862]
2001-08-15 01:55:06 +00:00
Jeremy Siek 1cf5ee7e9a changed the test criteria to be definition based and updated to new tc algo
[SVN r10861]
2001-08-15 01:54:19 +00:00
Jeremy Siek ee45d0c93b update to new tc algo and change graph type
[SVN r10860]
2001-08-15 01:53:49 +00:00
Jeremy Siek 1c27e7e1d7 added another concept check
[SVN r10859]
2001-08-15 01:53:27 +00:00
Jeremy Siek a28c64e02b changed the implementation a bunch
[SVN r10858]
2001-08-15 01:49:40 +00:00
Jeremy Siek cab2ffe94b fixed num_vertices(G) == 0 case
[SVN r10826]
2001-08-09 14:37:10 +00:00
Jeremy Siek af8a8a7515 fixed some grammar/spelling and complexity
[SVN r10825]
2001-08-09 13:40:56 +00:00
Jeremy Siek 3bd53a6cb9 compiles now
[SVN r10824]
2001-08-09 13:40:30 +00:00
Jeremy Siek 87ada367fc improved descriptions of chains
[SVN r10823]
2001-08-09 13:39:33 +00:00
Jeremy Siek 298381d563 added citation for purdom
[SVN r10819]
2001-08-08 19:23:10 +00:00
Jeremy Siek a37ace5bd1 added transitive closure
[SVN r10818]
2001-08-08 18:39:02 +00:00
Jeremy Siek 66e3331645 MutableGraph -> EdgeMutableGraph
[SVN r10808]
2001-08-07 20:34:37 +00:00
Jeremy Siek 11143f35ed new files
[SVN r10807]
2001-08-07 20:23:25 +00:00
Jeremy Siek a91c4c778d added include for fstream
[SVN r10806]
2001-08-07 20:20:34 +00:00
Jeremy Siek 1b5044517d some half fixes
[SVN r10805]
2001-08-07 20:16:12 +00:00
Jeremy Siek 56ea9ab04f various small edits and fixes
[SVN r10804]
2001-08-07 20:13:14 +00:00
Jeremy Siek fca2523c70 new file
[SVN r10803]
2001-08-07 20:12:44 +00:00
Jeremy Siek f0b9143ff4 new file
[SVN r10802]
2001-08-07 18:06:21 +00:00
Jeremy Siek fe0e452635 new file
[SVN r10801]
2001-08-07 17:47:12 +00:00
Darin Adler 1f770d8cd5 Spell things consistently. Add some bits of Mac stuff to the tests.
Use std::size_t where needed.


[SVN r10800]
2001-08-07 17:22:02 +00:00
Jeremy Siek ca4b4c2b95 changed to use add_edge() instead of push_back()
[SVN r10740]
2001-08-03 18:29:50 +00:00
Jeremy Siek 7c4b90d3a5 added Vladimir's functions
[SVN r10739]
2001-08-03 18:29:12 +00:00
Jeremy Siek df74e82f30 added workaround for abs
[SVN r10738]
2001-08-03 16:33:45 +00:00
Jeremy Siek 3be7ee713c changed to use neighbor_bfs_visitor
[SVN r10737]
2001-08-02 16:27:04 +00:00
Jeremy Siek 8496830250 fixed the _visit() versions
[SVN r10736]
2001-08-02 16:26:38 +00:00
Jeremy Siek 1b2fdeaa9a rolling back, splitting out the neighbor bfs
[SVN r10735]
2001-08-02 15:56:57 +00:00
Jeremy Siek df57d4ff71 split from breadth_first_search.hpp
[SVN r10734]
2001-08-02 15:56:39 +00:00
Jeremy Siek 888fd95090 new file
[SVN r10723]
2001-07-30 15:33:28 +00:00
Jeremy Siek cb8b64e33f added neighbor_breadth_first_visit
[SVN r10722]
2001-07-30 15:30:31 +00:00
Jeremy Siek f380608408 added comment about color initialization
[SVN r10721]
2001-07-30 15:30:04 +00:00
Jeremy Siek c4c208cec5 new file
[SVN r10711]
2001-07-27 21:28:06 +00:00
Jeremy Siek c609181bad added neighbor_breadth_first_search
[SVN r10710]
2001-07-27 21:27:44 +00:00
Jeremy Siek 76de551288 added check for directed graph
[SVN r10709]
2001-07-27 14:26:08 +00:00
Jeremy Siek 637c6d4b63 fixed memory leak in ~adj_list_impl()
[SVN r10703]
2001-07-25 15:11:21 +00:00
Jeremy Siek 8aa0fb3e96 changed to const graph parameter for print_network()
[SVN r10702]
2001-07-25 14:58:20 +00:00
Jeremy Siek 565759091a discussed ambiguity of back_edge for undirected graph
[SVN r10700]
2001-07-24 21:29:57 +00:00
Jeremy Siek 06984ec09b added discussion of back_edge ambiguity in dfs
[SVN r10699]
2001-07-24 21:23:43 +00:00
Jeremy Siek 6f356bf76d fix a memory leak
[SVN r10698]
2001-07-24 18:16:22 +00:00
Jeremy Siek e415495f7a updated to the file Boost.Test interface (had been using pre-review version)
[SVN r10697]
2001-07-23 18:07:05 +00:00
Jeremy Siek 2af0b6c3e9 [Francios Faure]
I have added a new functionality to adjacency_list_io: now it is                possible to input/output subsets of properties. This is useful when the         nodes and edges contain auxiliary data which is irrelevant in a                 description file.


[SVN r10666]
2001-07-19 15:30:00 +00:00
Jeremy Siek d4d81791c3 new files, example of using adjacency_list I/O
[SVN r10665]
2001-07-19 13:20:54 +00:00
Jeremy Siek b4cd14409b added clear_out_edges()
[SVN r10663]
2001-07-18 22:49:33 +00:00
Jeremy Siek ead0a2ab0c fixed use of first_vertex_name_t
[SVN r10658]
2001-07-18 13:31:54 +00:00
Beman Dawes 0d06c41821 Change absolute URL's to relative
[SVN r10594]
2001-07-12 15:31:15 +00:00
Jeremy Siek 55cda1fbf2 fixed typo, an -> and
[SVN r10590]
2001-07-11 17:56:49 +00:00
Jeremy Siek b97932bca6 added warning about how visitors are passed by value
[SVN r10589]
2001-07-11 17:54:23 +00:00
Jeremy Siek dd69c282a0 fixed typo
[SVN r10583]
2001-07-10 17:34:52 +00:00
Jeremy Siek 5e537cd741 updated a comment in kevin_bacon
[SVN r10582]
2001-07-10 14:54:58 +00:00
Jeremy Siek 32166306cc removed some refs to uniform cost search
[SVN r10581]
2001-07-10 14:54:31 +00:00
Jeremy Siek 10e4fe85dd another use of Dijkstra's
[SVN r10580]
2001-07-10 14:48:27 +00:00
Jeremy Siek 55f4d9f571 brought some docs relating to Dijkstra's up to date
[SVN r10579]
2001-07-10 14:44:44 +00:00
Jeremy Siek 9c6f2e13b1 new file
[SVN r10578]
2001-07-10 14:25:15 +00:00
Jeremy Siek d56e2dcca3 removed use of color_vec[0] to avoid problems when num_vertices(g) == 0
[SVN r10572]
2001-07-09 14:10:56 +00:00
Jeremy Siek d3afb05747 fixed broken link
[SVN r10516]
2001-07-03 14:42:53 +00:00
Jeremy Siek 1ae3184d72 removed unused parameter
[SVN r10474]
2001-06-28 19:28:17 +00:00
Jeremy Siek 03c5d4bd5d new file
[SVN r10473]
2001-06-28 19:21:47 +00:00
Jeremy Siek 3f2ba8e6c5 removed unused parameter
[SVN r10471]
2001-06-28 17:53:58 +00:00
Jeremy Siek efb7469f57 fixed warning
[SVN r10470]
2001-06-28 17:45:06 +00:00
Jeremy Siek 1a0b0ad901 removed some unused parameters
[SVN r10469]
2001-06-28 17:44:18 +00:00
Jeremy Siek 71b616180a fixed some g++ warnings, unused variables, etc.
[SVN r10467]
2001-06-28 17:29:46 +00:00
Jeremy Siek 310050bc6a forgot to commit fix to the traversal_category
[SVN r10466]
2001-06-28 15:14:42 +00:00
Jeremy Siek 7c75d7dfce fixed typo: discover_time -> discover_time_map
[SVN r10465]
2001-06-28 14:29:39 +00:00
Dave Abrahams 8235b88eed untabified
[SVN r10356]
2001-06-18 13:13:35 +00:00
Jeremy Siek 02a997f4be added some instructions
[SVN r10346]
2001-06-15 18:40:02 +00:00
Jeremy Siek c2f7b66d73 example graph for min degree
[SVN r10345]
2001-06-15 18:35:13 +00:00
Jeremy Siek 6180f6a138 files needed by minimum_degree_ordering.cpp
[SVN r10344]
2001-06-15 18:28:36 +00:00
Jeremy Siek f9001b444a various cleanup
[SVN r10335]
2001-06-14 19:19:00 +00:00
Jeremy Siek 68335c5b4c new algorithm thanks to Lie-Quan Lee
[SVN r10334]
2001-06-14 18:40:45 +00:00
Jeremy Siek 4452ae08bb example/test for minimum_degree_ordering
[SVN r10333]
2001-06-14 18:38:52 +00:00
Jeremy Siek b528c8d862 new algorithm, thanks to Lie-Quan Lee!
[SVN r10332]
2001-06-14 18:38:16 +00:00
Jeremy Siek 28696f5d5f fixed bug in constructor of the edge iterator
[SVN r10309]
2001-06-11 15:36:28 +00:00
Jeremy Siek 3babab2bc3 added link to adjacency_matrix class
[SVN r10270]
2001-06-04 21:40:13 +00:00
Jeremy Siek 36e574eeaa fixed search-replace error that munged the name of sgb_vertex_name_map
[SVN r10256]
2001-06-02 17:10:00 +00:00
Jeremy Siek 475917ad0c updated for change in VertexListGraph
[SVN r10255]
2001-06-01 21:15:25 +00:00
Jeremy Siek d3fe34a860 changed "gen" to "bind" inside slistS
[SVN r10241]
2001-05-29 18:03:09 +00:00
Jeremy Siek 009b171767 removed initialize()
[SVN r10203]
2001-05-23 18:39:00 +00:00
Jeremy Siek 8be1db0687 removed vis.initialize
[SVN r10202]
2001-05-23 18:38:49 +00:00
Jeremy Siek ad26f14c4d new file
[SVN r10200]
2001-05-23 16:46:14 +00:00
Jeremy Siek f861bff900 only do overflow check when w_e > 0
[SVN r10199]
2001-05-23 16:44:07 +00:00
Jeremy Siek bed761e2c2 added check for overflow
[SVN r10198]
2001-05-23 16:40:46 +00:00
Jeremy Siek db5a2b138d fixed to do topological order (not reverse topo)
[SVN r10197]
2001-05-23 16:39:49 +00:00
Jeremy Siek 27960ba125 put initialize back in
[SVN r10196]
2001-05-23 16:01:14 +00:00
Jeremy Siek 2251bbcb88 fixed property map, added default constructor
[SVN r10195]
2001-05-23 15:37:57 +00:00
Jeremy Siek c657912300 forgot to remove a comment
[SVN r10186]
2001-05-22 15:25:03 +00:00
Jeremy Siek 7530c853c1 changed to use vertex_property and edge_property traits classes
[SVN r10185]
2001-05-22 03:59:43 +00:00
Jeremy Siek 93cdbc1d92 added vertex and edge mutable
[SVN r10184]
2001-05-22 02:04:37 +00:00
Jeremy Siek 6509b5286c added specialization of vertex_property and edge_property traits classes
[SVN r10183]
2001-05-22 02:04:19 +00:00
Jeremy Siek 26229bc41d added vertex_property and edge_property
[SVN r10182]
2001-05-22 01:55:52 +00:00
Jeremy Siek 61a1d47e50 added some property graph features
[SVN r10181]
2001-05-22 01:17:36 +00:00
Jeremy Siek b4b3d54454 added some property graph features to the leda interface
[SVN r10180]
2001-05-22 01:17:16 +00:00
Jeremy Siek e2a15d933f fixed reference type for adjacency_iterator and added adjacency_graph_tag
to the traversal category


[SVN r10179]
2001-05-21 20:07:21 +00:00
Jeremy Siek ccd4026450 removed const casts
[SVN r10178]
2001-05-21 19:35:01 +00:00
Jeremy Siek 0e5921515b moved to the /test directory
[SVN r10177]
2001-05-21 19:26:25 +00:00
Jeremy Siek ce55233841 new file
[SVN r10176]
2001-05-21 19:25:47 +00:00
Jeremy Siek 7762b3049e added checks for const Graph*
[SVN r10175]
2001-05-21 19:17:30 +00:00
Jeremy Siek 75c8652d82 fixed source() and target() functions to take a const graph ptr
[SVN r10174]
2001-05-21 19:17:08 +00:00
Jeremy Siek 6d9d3154ab added include of <iostream>
[SVN r10173]
2001-05-21 18:35:44 +00:00
Jeremy Siek e662337924 more fixes for const correctness
[SVN r10172]
2001-05-21 18:35:25 +00:00
Jeremy Siek f71a3a3ec1 changed default predecessor map to the dummy property map
[SVN r10171]
2001-05-21 18:32:26 +00:00
Jeremy Siek 71c875133a some changes to the mutable graph concepts
[SVN r10169]
2001-05-21 18:13:33 +00:00
Jeremy Siek 00979a015f no change
[SVN r10168]
2001-05-21 18:12:44 +00:00
Jeremy Siek 7f90a53c3f added doc for traversal category
[SVN r10167]
2001-05-21 18:04:23 +00:00
Jeremy Siek 796580e232 updated the traversal tag
[SVN r10166]
2001-05-21 17:28:08 +00:00
Jeremy Siek abe493726d changed VertexAndEdgeList to VertexList and EdgeList
[SVN r10162]
2001-05-21 00:47:11 +00:00
Jeremy Siek b7584b6716 updated for change in MutablePropertyGraphConcept
[SVN r10156]
2001-05-19 17:02:43 +00:00
Jeremy Siek 8e26b31654 changed traversal tags to take into account change in VertexListGraph
[SVN r10151]
2001-05-19 02:36:19 +00:00
Jeremy Siek 62d252cf30 updated traversal tags to take into account change in VertexListGraph
[SVN r10150]
2001-05-19 02:35:55 +00:00
Jeremy Siek 6112510ccc updated for change in VertexListGraph
[SVN r10149]
2001-05-19 02:31:15 +00:00
Jeremy Siek 03bdb90920 updated for removal of vertex_and_edge_list_graph_tag
[SVN r10148]
2001-05-19 02:30:41 +00:00
Jeremy Siek 770d1be136 vertex and edge list removed
[SVN r10147]
2001-05-19 02:29:32 +00:00
Jeremy Siek 1d119b7e06 changed VertexListGraph
[SVN r10146]
2001-05-19 02:25:47 +00:00
Jeremy Siek f93174117d updated for VertexListGraph change
[SVN r10145]
2001-05-19 02:21:10 +00:00
Jeremy Siek dd326e44e1 fixed some property map constructors
[SVN r10144]
2001-05-19 02:08:46 +00:00
Jeremy Siek 46c4758971 added default constructor to property maps
[SVN r10143]
2001-05-19 01:29:36 +00:00
Jeremy Siek 08ebd39282 fixed the property maps
[SVN r10142]
2001-05-19 01:26:23 +00:00
Jeremy Siek 19ba74383b updated, dummy_cons removed
[SVN r10141]
2001-05-18 22:50:17 +00:00
Jeremy Siek b6d8de4cf9 fixed some get color compare issues
[SVN r10140]
2001-05-18 22:49:44 +00:00
Jeremy Siek 2ddd8e0d87 fixed color comparison
[SVN r10139]
2001-05-18 22:47:04 +00:00
Jeremy Siek 0263065191 updated for put_get_helper
[SVN r10137]
2001-05-18 22:43:59 +00:00
Jeremy Siek 4e539c158a fixed LvaluePropertyGraphConcept
[SVN r10136]
2001-05-18 22:43:33 +00:00
Jeremy Siek 2466d4a818 updated for put_get_helper
[SVN r10135]
2001-05-18 22:35:51 +00:00
Jeremy Siek 980457c573 updated degree_property_map
[SVN r10134]
2001-05-18 22:31:13 +00:00
Jeremy Siek 5615f1a34c updated property maps
[SVN r10133]
2001-05-18 22:30:40 +00:00
Jeremy Siek 66220c880f fixed the property maps
[SVN r10132]
2001-05-18 22:28:41 +00:00
Jeremy Siek 2b3b105bf8 fixed random functions to handle num_vertices(g) == 1 case correctly
[SVN r10105]
2001-05-13 14:17:48 +00:00
Jeremy Siek 49a7b57153 updated random functions
[SVN r10104]
2001-05-13 14:17:17 +00:00
Jeremy Siek c0c2fa34e6 used boost random library
[SVN r10103]
2001-05-13 14:11:31 +00:00
Jeremy Siek 6d14ca4278 added RandNumGen parameter to the random graph functions
[SVN r10102]
2001-05-13 14:10:16 +00:00
Jeremy Siek d2e2138c91 updates to random_vertex for using boost random number gen library
[SVN r10101]
2001-05-13 14:09:20 +00:00
Jeremy Siek 80c5421f5f added BidirectionalGraphConcept check
[SVN r10093]
2001-05-11 16:05:16 +00:00
Jeremy Siek ce5ff30b1b added in_degree()
[SVN r10092]
2001-05-11 16:04:35 +00:00
Jeremy Siek a1932a87df fixed property_map for filtered_graph
[SVN r10084]
2001-05-10 08:26:26 +00:00
Jeremy Siek a81199c4e8 few fixes
[SVN r10077]
2001-05-09 05:14:16 +00:00
Jeremy Siek c39e9ba90d removed excess template parameters from the strong_components() with
all defaults


[SVN r10075]
2001-05-09 03:00:40 +00:00
Jeremy Siek 96c4ead801 tweaked a comment
[SVN r10074]
2001-05-08 21:07:15 +00:00
Jeremy Siek fd57957914 mored vertex_root here
[SVN r10073]
2001-05-08 20:30:06 +00:00
Jeremy Siek da9b33a3d7 moved vertex_root_t
[SVN r10072]
2001-05-08 20:29:46 +00:00
Jeremy Siek aefe4d6b63 added link to girth and roget components
[SVN r10071]
2001-05-08 20:29:09 +00:00
Jeremy Siek c6f11d4bb7 new file
[SVN r10070]
2001-05-08 20:26:31 +00:00
Jeremy Siek f4448a194c dummy_cons -> static_object<detail::dummy_constructor>::get()
[SVN r10056]
2001-05-07 21:28:32 +00:00
Jeremy Siek 8209340d08 removed comment about variant 2 of bfs
[SVN r10055]
2001-05-07 21:27:19 +00:00
Jeremy Siek af755d81cc updated call to breadth first search
[SVN r10054]
2001-05-07 21:26:49 +00:00
Jeremy Siek c11c698bec fixed constness of property maps to not depend on the constness of
the property map object itself


[SVN r10053]
2001-05-07 21:26:16 +00:00
Jeremy Siek ad8fc9ca0d added comments about num_vertices()
[SVN r10047]
2001-05-07 20:36:15 +00:00
Jeremy Siek e0b96232d1 changed num_vertices and num_edges
[SVN r10046]
2001-05-07 20:21:04 +00:00
Jeremy Siek 70a5ab79dd fixed num_vertices() and num_edges()
[SVN r10045]
2001-05-07 15:50:16 +00:00
Jeremy Siek fc1154b36e fixed in_edges, typo in creating the in_edge_iter_policy
[SVN r10044]
2001-05-07 15:47:23 +00:00
Jeremy Siek 64bbd3a721 added root_vertex_num
[SVN r10042]
2001-05-07 04:19:22 +00:00
Jeremy Siek c23f3afebe added root_vertex()
[SVN r10041]
2001-05-07 04:19:07 +00:00
Jeremy Siek 7824b8c5aa added pseudo-code for the algorithm
[SVN r10040]
2001-05-07 04:15:47 +00:00
Jeremy Siek eb9d16cd24 updated prim interface
[SVN r10039]
2001-05-07 04:10:57 +00:00
Jeremy Siek 6447f3e0c1 changed interface to emphasize importance of the predecessor map
[SVN r10038]
2001-05-07 04:10:38 +00:00
Jeremy Siek ff68b1284a added some categories
[SVN r10037]
2001-05-06 21:00:44 +00:00
Jeremy Siek 66504e2668 property map fixes
[SVN r10036]
2001-05-06 20:21:42 +00:00
Jeremy Siek 4e87a15181 added property_iterator.cpp
[SVN r10034]
2001-05-06 17:37:43 +00:00
Jeremy Siek 28e89ff16d new file
[SVN r10033]
2001-05-06 17:36:17 +00:00
Jeremy Siek 10e21dd82f changed from 0 to 1 for size of temporary vector
[SVN r10016]
2001-05-05 18:02:05 +00:00
Jeremy Siek 43a267a1a3 changed to creating size 0 to size 1 temporary vectors
[SVN r10015]
2001-05-05 17:58:56 +00:00
Jeremy Siek e459d66d3f new file
[SVN r10014]
2001-05-05 16:37:14 +00:00
Jeremy Siek d2259781a1 added reference to property maps
[SVN r10013]
2001-05-05 16:36:42 +00:00
Jeremy Siek 1c74d2312d vc++ workarounds
[SVN r9989]
2001-04-27 15:58:57 +00:00
Jeremy Siek b0e3fe0c55 VC++ internal compiler error workaround (and a few more workarands too)
[SVN r9988]
2001-04-27 15:58:18 +00:00
Jeremy Siek 8ba27d50f6 added Brad's text to Qhull challenge
[SVN r9985]
2001-04-27 01:59:23 +00:00
Beman Dawes 62e49d786b Change all eGroups references to YahooGroups
[SVN r9979]
2001-04-25 00:24:50 +00:00
Jeremy Siek 1f8de0f4da replaced use of iterators with the use of pointers to avoid problems when the iterators
are STLport iterators


[SVN r9976]
2001-04-24 14:19:07 +00:00
Jeremy Siek d869963bf3 moved operator<< for edge_desc_impl to namespace std to fix bug showing up when using STLport
[SVN r9975]
2001-04-24 14:14:49 +00:00
Jeremy Siek 051abb6a53 This material is out of date and needs to be rewritten!!
[SVN r9974]
2001-04-24 04:33:11 +00:00
Jeremy Siek 92015a0945 commented out the tutorial on using algorithms, it is out of date and
needs to be rewritten


[SVN r9973]
2001-04-24 04:32:56 +00:00
Jeremy Siek 4a62f87add updated for named params
[SVN r9972]
2001-04-24 04:12:57 +00:00
Jeremy Siek 8faad7f551 update for named params
[SVN r9971]
2001-04-24 04:08:57 +00:00
Jeremy Siek f2810ee881 access violation, changed class result to a struct
[SVN r9970]
2001-04-24 03:56:46 +00:00
Jeremy Siek 836eadc96e added graph.cpp to the test
[SVN r9969]
2001-04-24 03:44:33 +00:00
Jeremy Siek c68ee918eb added specialization of numeric_limits for dist_value
[SVN r9968]
2001-04-24 03:41:21 +00:00
Jeremy Siek bc5483502c VC++ workaround
[SVN r9967]
2001-04-24 03:33:05 +00:00
Jeremy Siek cdb4c44d6a some VC++ workarounds
[SVN r9966]
2001-04-24 03:21:34 +00:00
Jeremy Siek 5f1921c974 added some files
[SVN r9965]
2001-04-24 03:21:03 +00:00
Jeremy Siek cedf8c9a0b new file
[SVN r9964]
2001-04-24 03:09:36 +00:00
Jeremy Siek 41393743d6 vc++ workarounds
[SVN r9963]
2001-04-24 02:58:39 +00:00
Jeremy Siek 911c3c3f08 removed erroneous return
[SVN r9962]
2001-04-24 02:21:09 +00:00
Jeremy Siek 5e9b1cd0d8 VC++ workaround
[SVN r9961]
2001-04-24 02:20:19 +00:00
Jeremy Siek f234453512 vc++ workarounds
[SVN r9960]
2001-04-24 02:08:45 +00:00
Jeremy Siek 177fcbdf4a vc++ workarounds and named parameter changes
[SVN r9959]
2001-04-24 01:46:38 +00:00
Jeremy Siek c73e2920ee named parameters changes and VC++ workarounds
[SVN r9958]
2001-04-24 01:46:13 +00:00
Jeremy Siek 5bc0e8ee5b VC++ workaround
[SVN r9957]
2001-04-23 23:45:31 +00:00
Jeremy Siek 0cdcd94e5b fixed call to dfs visit
CV: ----------------------------------------------------------------------


[SVN r9956]
2001-04-23 23:42:08 +00:00
Jeremy Siek 49a1e57f72 updated for named parameters
[SVN r9955]
2001-04-23 23:39:02 +00:00
Jeremy Siek 4a8f1ea897 updated for named params
[SVN r9954]
2001-04-23 23:35:10 +00:00
Jeremy Siek dfcc95bc76 VC++ workaround
[SVN r9953]
2001-04-23 23:30:57 +00:00
Jeremy Siek 95ca715167 removed #if 0
[SVN r9952]
2001-04-23 23:25:04 +00:00
Jeremy Siek beae839fea more vc++ workarounds
[SVN r9951]
2001-04-23 23:23:21 +00:00
Jeremy Siek 96fe03b71e VC++ workarounds
[SVN r9950]
2001-04-23 22:27:56 +00:00
Jeremy Siek 8a1daa735b vc++ workaround
[SVN r9949]
2001-04-23 22:27:34 +00:00
Jeremy Siek 3e773ebaf7 workaround for VC++ bug, confusion from the type<> class
[SVN r9948]
2001-04-23 21:42:14 +00:00
Jeremy Siek 12e4efbd39 updated for named parameters
[SVN r9947]
2001-04-23 21:19:37 +00:00
Jeremy Siek e28fd145c1 updated to use named parameters
[SVN r9946]
2001-04-23 21:16:07 +00:00
Jeremy Siek ae3bdc2893 fixed get() for const graphs
[SVN r9945]
2001-04-23 20:01:25 +00:00
Jeremy Siek 3df72bcb26 named parameters changes
[SVN r9942]
2001-04-23 19:47:08 +00:00
Jeremy Siek 5fa95ae668 updated named params
[SVN r9941]
2001-04-23 19:46:37 +00:00
Jeremy Siek 064b8ae9a2 updated to named params
[SVN r9940]
2001-04-23 19:46:07 +00:00
Jeremy Siek 53d0c78393 moved edge_capacity_value into this file
[SVN r9939]
2001-04-23 19:45:04 +00:00
Jeremy Siek 60dc2f1a1f named parameters changes
[SVN r9938]
2001-04-23 19:31:26 +00:00
Jeremy Siek 65cf0ac5fc added link to bgl_named_params
[SVN r9937]
2001-04-23 19:29:53 +00:00
Jeremy Siek 1be45c6e8e new file
[SVN r9936]
2001-04-23 19:27:05 +00:00
Jeremy Siek 6adb05834e whitespace change
[SVN r9935]
2001-04-23 19:07:28 +00:00
Jeremy Siek fd02bd8c17 updated for named paramters
[SVN r9934]
2001-04-23 19:04:35 +00:00
Jeremy Siek 1078af6c86 simplified code
[SVN r9933]
2001-04-23 19:00:20 +00:00
Jeremy Siek 960dc10fcd small edits
[SVN r9932]
2001-04-23 18:54:54 +00:00
Jeremy Siek 8a187ca541 updated for named parameters
[SVN r9931]
2001-04-23 18:53:46 +00:00
Jeremy Siek 9d302516af new file
[SVN r9930]
2001-04-23 18:53:28 +00:00
Jeremy Siek a33577dfe9 fixed a typo
[SVN r9929]
2001-04-23 18:49:27 +00:00
Jeremy Siek 17328ea518 small edits
[SVN r9928]
2001-04-23 18:48:59 +00:00
Jeremy Siek f992486a6a small edit
[SVN r9927]
2001-04-23 18:30:00 +00:00
Jeremy Siek 9073419fcb updated for named params
[SVN r9926]
2001-04-23 18:26:21 +00:00
Jeremy Siek fbd0726225 updated for named parameters
[SVN r9925]
2001-04-23 18:24:40 +00:00
Jeremy Siek f11e0c7736 added "type" to the default_param
[SVN r9924]
2001-04-23 18:21:31 +00:00
Jeremy Siek 8fb64a1adf fixed by in return type compile-time computation
[SVN r9923]
2001-04-23 18:20:16 +00:00
Jeremy Siek c0fe0b2432 provide access to unqualified pmap
[SVN r9922]
2001-04-23 18:19:56 +00:00
Jeremy Siek 61f5b67f8b updated for named parameters
[SVN r9921]
2001-04-23 18:19:31 +00:00
Jeremy Siek d11dcda3d8 updated for named params
[SVN r9920]
2001-04-23 18:08:39 +00:00
Jeremy Siek 1420a46386 added specialization of graph_traits for Graph*const
[SVN r9919]
2001-04-23 18:06:30 +00:00
Jeremy Siek a040577d74 updated to named params
[SVN r9918]
2001-04-23 18:02:06 +00:00
Jeremy Siek c413e7ead7 switched to BFS and named params
[SVN r9917]
2001-04-23 17:55:31 +00:00
Jeremy Siek 7580614986 named params
[SVN r9916]
2001-04-23 17:51:15 +00:00
Jeremy Siek dc4101b2fd resolved name conflict
[SVN r9915]
2001-04-23 17:48:33 +00:00
Jeremy Siek 44fa77830e new file
[SVN r9914]
2001-04-23 17:17:58 +00:00
Jeremy Siek 81dfa0a162 choose_pmap to choose_const_pmap for vertex index
[SVN r9913]
2001-04-23 17:15:53 +00:00
Jeremy Siek e6ac5e2e5b changed [] to get()
[SVN r9910]
2001-04-23 16:51:18 +00:00
Jeremy Siek 1c33e688e6 updated to use named parameters
[SVN r9909]
2001-04-23 16:41:36 +00:00
Jeremy Siek 7f005bdc7c updated to use named parameters
[SVN r9908]
2001-04-23 16:36:30 +00:00
Jeremy Siek ee3e58358a updated for named parameters (use all defaults)
[SVN r9907]
2001-04-23 16:35:27 +00:00
Jeremy Siek c54553c136 fixed links to incremental components
[SVN r9906]
2001-04-23 15:13:33 +00:00
Jeremy Siek b1039f3430 few edits
[SVN r9905]
2001-04-23 15:13:09 +00:00
Jeremy Siek 7010aaa5c0 apply sed to yacc files as well
[SVN r9903]
2001-04-23 06:24:24 +00:00
Jeremy Siek 86c2394491 added yyrestart
[SVN r9902]
2001-04-23 06:23:58 +00:00
Jeremy Siek 90dcb85b49 updated for named parameters
[SVN r9901]
2001-04-23 06:21:21 +00:00
Jeremy Siek 221e9f053d fixed graphviz_io_traits
[SVN r9900]
2001-04-23 05:50:16 +00:00
Jeremy Siek 0d402ae6f5 removed reference vertex_index in case when color_map param is provided
[SVN r9899]
2001-04-23 05:41:03 +00:00
Jeremy Siek 4a200f9c7c untabify
[SVN r9898]
2001-04-23 05:40:06 +00:00
Jeremy Siek e9fafbf8e4 new file
[SVN r9897]
2001-04-23 05:39:13 +00:00
Jeremy Siek 7146fd319c fixed handling of vertex_index when color_map param is provided
[SVN r9896]
2001-04-23 05:27:35 +00:00
Jeremy Siek fd7ed3fbff pass by value for inf and zero to allow for functions
[SVN r9895]
2001-04-23 04:28:22 +00:00
Jeremy Siek 74f877d9a7 added weight2
[SVN r9894]
2001-04-23 03:53:02 +00:00
Jeremy Siek ff49f4bf4f removed init of predecessors
[SVN r9893]
2001-04-23 03:44:27 +00:00
Jeremy Siek f3986e9966 changed to pass-by-value for distance_compare/combine so we can pass
functions (in addition to function objects)


[SVN r9892]
2001-04-23 03:44:02 +00:00
Jeremy Siek 317695052b new file
[SVN r9891]
2001-04-23 03:42:24 +00:00
Jeremy Siek 39a0c79d64 updated to use named parameter for predecessor map
[SVN r9890]
2001-04-23 03:26:12 +00:00
Jeremy Siek 9f02e67a86 updated to use named parameters
[SVN r9889]
2001-04-23 01:54:17 +00:00
Jeremy Siek ece11913e9 using default color map
[SVN r9888]
2001-04-23 01:51:20 +00:00
Jeremy Siek ceb2bfadf2 updated to named parameters
[SVN r9887]
2001-04-23 01:50:52 +00:00
Jeremy Siek 404ed90019 named parameters and some related changes
[SVN r9886]
2001-04-23 01:24:03 +00:00
Jeremy Siek 66f660709a added def. of MST
[SVN r9885]
2001-04-23 01:23:00 +00:00
Jeremy Siek 6631c93e76 updated for named parameters
[SVN r9884]
2001-04-22 22:12:29 +00:00
Jeremy Siek 027f7d6b5b new file, replacing Uniform Cost Visitor
[SVN r9883]
2001-04-22 22:11:53 +00:00
Jeremy Siek dda7b5b40b updated for named parameters
[SVN r9882]
2001-04-22 22:06:22 +00:00
Jeremy Siek 1cf743abfd added some more parameters
[SVN r9881]
2001-04-22 22:06:03 +00:00
Jeremy Siek beb7b3d5c0 update for named parameters
[SVN r9880]
2001-04-22 22:05:46 +00:00
Jeremy Siek a462655804 choose_pmap -> choose_const_pmap
[SVN r9879]
2001-04-22 22:05:22 +00:00
Jeremy Siek 5cc0fa180f cleaned up a bit
[SVN r9878]
2001-04-22 21:41:51 +00:00
Jeremy Siek 7a543fcd41 added algorithm and edited parameters a bit
[SVN r9877]
2001-04-22 21:41:20 +00:00
Jeremy Siek 07b169eaaa removed rank and predecessor map params
[SVN r9876]
2001-04-22 21:39:15 +00:00
Jeremy Siek 4643560dc6 switched to named params
[SVN r9875]
2001-04-22 21:04:45 +00:00
Jeremy Siek 84dc415618 small edit
[SVN r9874]
2001-04-22 20:46:37 +00:00
Jeremy Siek fb9ac62539 added predecessor_map() to named params
[SVN r9873]
2001-04-22 20:44:50 +00:00
Jeremy Siek 96eaf05b11 switched to used predecessor_map() named param
[SVN r9872]
2001-04-22 20:41:34 +00:00
Jeremy Siek b30541503b updated for named params
[SVN r9871]
2001-04-22 20:38:28 +00:00
Jeremy Siek 4144c36acf blah
[SVN r9870]
2001-04-22 19:03:48 +00:00
Jeremy Siek fb5826ced0 added name for referencing
[SVN r9869]
2001-04-22 18:29:10 +00:00
Jeremy Siek 33291eaf83 new file
[SVN r9868]
2001-04-22 18:28:50 +00:00
Jeremy Siek 66b0464770 added algorithm and more description
[SVN r9867]
2001-04-22 18:19:59 +00:00
Jeremy Siek e5751f31f5 fixed degree_vertex_invariant
[SVN r9866]
2001-04-22 16:57:43 +00:00
Jeremy Siek 9780c3f430 new file
[SVN r9865]
2001-04-22 16:55:14 +00:00
Jeremy Siek 318d4b042a added visitor event points
[SVN r9864]
2001-04-22 16:46:58 +00:00
Jeremy Siek a7efb3cf0d fixed html bug
[SVN r9863]
2001-04-22 16:40:32 +00:00
Jeremy Siek 8f51b15f85 added algorithm pseudo code and more description
[SVN r9862]
2001-04-22 16:38:48 +00:00
Jeremy Siek 34c2f27450 0 -> &Oslash;
[SVN r9861]
2001-04-22 16:22:20 +00:00
Jeremy Siek d8d186bfe5 updated for named params and added lots of description
[SVN r9860]
2001-04-22 16:05:04 +00:00
Jeremy Siek 8c28c4f116 updated parameter docs
[SVN r9858]
2001-04-21 22:10:17 +00:00
Jeremy Siek e676e8ee2a updated for named params
[SVN r9857]
2001-04-21 22:02:49 +00:00
Jeremy Siek 095b01eb3f updated choose_pmap
[SVN r9856]
2001-04-21 22:02:23 +00:00
Jeremy Siek a6cdd2cf65 updated to named params
[SVN r9855]
2001-04-21 21:54:41 +00:00
Jeremy Siek 55f6411bb9 updated to named parameters
[SVN r9854]
2001-04-21 21:51:55 +00:00
Jeremy Siek e80eb85175 changed to use get() function
[SVN r9853]
2001-04-21 21:28:38 +00:00
Jeremy Siek ca5c8ad7f0 changed names
[SVN r9852]
2001-04-21 21:28:24 +00:00
Jeremy Siek 69357fe4bb added operator() to property maps so they can be used as function objects
[SVN r9851]
2001-04-21 21:28:00 +00:00
Jeremy Siek 99ce28beaf added stuff for isomorphism
[SVN r9850]
2001-04-21 21:27:20 +00:00
Jeremy Siek 1e55bc3aa6 added refs for isomorphism
[SVN r9849]
2001-04-21 21:26:25 +00:00
Jeremy Siek dec1eebc00 added isomorphism
[SVN r9848]
2001-04-21 21:26:08 +00:00
Jeremy Siek e55726ffad finished 1st draft
[SVN r9847]
2001-04-21 21:25:54 +00:00
Jeremy Siek bdc78ab436 new file
[SVN r9846]
2001-04-21 21:23:07 +00:00
Jeremy Siek 7dbf526742 improved the isomorphism algorithm
[SVN r9845]
2001-04-21 20:32:08 +00:00
Jeremy Siek 23f017862e various changes
[SVN r9844]
2001-04-21 20:30:59 +00:00
Jeremy Siek 654872e2a0 x.remove(a) -> x.erase(a)
[SVN r9843]
2001-04-21 17:09:47 +00:00
Jeremy Siek 4951f7b3c8 added docs for the property maps for accessing the utility fields, etc.
[SVN r9841]
2001-04-20 16:05:00 +00:00
Jeremy Siek 5a724284d0 named parameter changes
[SVN r9804]
2001-04-16 17:14:19 +00:00
Jeremy Siek 778b4970d9 working on named parameters for kruskal, etc.
[SVN r9777]
2001-04-13 22:02:41 +00:00
Jeremy Siek 41959ed25b archetype tests for bfs
[SVN r9776]
2001-04-13 20:03:16 +00:00
Jeremy Siek 3b2a833749 change to an implementation that uses copy_graph and the reverse_graph
adaptor


[SVN r9773]
2001-04-12 22:10:16 +00:00
Jeremy Siek 6637e0681c untabify
[SVN r9772]
2001-04-12 22:08:08 +00:00
Jeremy Siek 729f743711 almost added reverse_edge(), but then didn't
[SVN r9771]
2001-04-12 22:06:35 +00:00
Jeremy Siek 14cbbf71b6 added edge_iterator, edges(), and num_edges()
[SVN r9770]
2001-04-12 22:04:54 +00:00
Jeremy Siek 27d93257f5 added vertex_copy_num, etc.
[SVN r9769]
2001-04-12 20:49:32 +00:00
Jeremy Siek be50fa129c added vertex_copy() etc.
[SVN r9768]
2001-04-12 20:49:15 +00:00
Jeremy Siek 3a4ebf174d much improved with named parameters and better defaults
[SVN r9767]
2001-04-12 20:47:43 +00:00
Jeremy Siek 51645430ea changed color default handling to avoid initialization loop
[SVN r9766]
2001-04-12 19:55:40 +00:00
Jeremy Siek c03b438253 switching to named parameters
[SVN r9764]
2001-04-12 04:02:19 +00:00
Jeremy Siek c3c09c0b99 added named parameter variant
[SVN r9763]
2001-04-11 21:52:07 +00:00
Jeremy Siek 5c6fa4c0cf added breadth_first_visit
[SVN r9762]
2001-04-11 19:53:51 +00:00
Jeremy Siek 6d07a3a5e8 new file
[SVN r9761]
2001-04-11 06:07:01 +00:00
Jeremy Siek 29c92f9043 added buffer_param_num
[SVN r9760]
2001-04-11 04:44:03 +00:00
Jeremy Siek 7d2d242856 added named parameter variant of BFS
[SVN r9759]
2001-04-11 04:43:43 +00:00
Jeremy Siek 5ba5e64d00 added buffer()
[SVN r9758]
2001-04-11 04:43:11 +00:00
Jeremy Siek 433eb40bb6 had to use sed on the lex output
[SVN r9751]
2001-04-09 20:26:11 +00:00
Jeremy Siek 7d700ec514 new file
[SVN r9750]
2001-04-09 20:25:08 +00:00
Jeremy Siek 423e0ccef1 new file
[SVN r9749]
2001-04-09 15:11:47 +00:00
Jeremy Siek 2b0bba5ab7 added target for building shared object
[SVN r9748]
2001-04-09 15:11:31 +00:00
Jeremy Siek 65e10bc39f switch to using reentrant "pure_parser". Changed
decl for yylex, changed graph yylval to lvalp param.


[SVN r9747]
2001-04-09 15:11:01 +00:00
Jeremy Siek 8401f69cbb switch to use reentrant "pure_parser"
[SVN r9746]
2001-04-09 15:10:16 +00:00
Jeremy Siek d1a819c8ae '#' -> "#" (more portable that way)
[SVN r9745]
2001-04-09 14:46:27 +00:00
Jeremy Siek 381100c372 added dijkstra visitor stuff
[SVN r9742]
2001-04-08 20:13:05 +00:00
Jeremy Siek d5c5dd61f7 added distance infinity and zero
[SVN r9741]
2001-04-08 20:03:43 +00:00
Jeremy Siek 70750cdc9a made named parameter variant more powerful, it will replace uniform_cost_search
[SVN r9740]
2001-04-08 20:03:14 +00:00
Jeremy Siek ae3c899bfa changed choose_pmap() so that is really does what it is suppose to
[SVN r9739]
2001-04-08 19:11:31 +00:00
Jeremy Siek fc9e23bad1 made some functions static
[SVN r9738]
2001-04-08 17:54:31 +00:00
Jeremy Siek a1dfaeab00 added choose_pmap()
[SVN r9737]
2001-04-07 17:35:29 +00:00
Jeremy Siek 9df1764497 changed to use choose_pmap in a couple places
[SVN r9736]
2001-04-07 17:35:09 +00:00
Jeremy Siek 7c8dd99dab removed unnecessary color vertex property
[SVN r9735]
2001-04-07 17:30:57 +00:00
Jeremy Siek 47fa4e6e65 updated get_property_value()
[SVN r9734]
2001-04-05 20:28:58 +00:00
Jeremy Siek 4efaed6988 update get_property_value
[SVN r9733]
2001-04-05 20:26:56 +00:00
Jeremy Siek ed7aa0ad30 removed uneccessary argument from get_property_value
[SVN r9732]
2001-04-05 20:23:20 +00:00
Jeremy Siek 3ae90ab840 added recursion stop to get_value() and const_get_value()
[SVN r9731]
2001-04-05 20:22:31 +00:00
Jeremy Siek fb1d5b6a7a updated named parameter mechanism
[SVN r9730]
2001-04-05 20:21:37 +00:00
Jeremy Siek bb22d80a95 changed to use "property" style recursion
[SVN r9729]
2001-04-05 20:21:16 +00:00
Jeremy Siek 977de50af6 changed initialization of parents
[SVN r9728]
2001-04-05 20:09:04 +00:00
Jeremy Siek 6a42658199 added LvaluePropertyMap requirement to LvaleuPropertyGraph
[SVN r9726]
2001-04-05 17:22:24 +00:00
Jeremy Siek 2912e632e4 new file
[SVN r9725]
2001-04-05 17:21:49 +00:00
Jeremy Siek 0a7f838911 fixed reference/const-reference problems with property maps
[SVN r9724]
2001-04-05 17:20:23 +00:00
Jeremy Siek 744ef42a60 use named function params
[SVN r9717]
2001-04-05 04:59:44 +00:00
Jeremy Siek 38b2aecf97 use_visitor -> visitor
[SVN r9716]
2001-04-05 04:59:27 +00:00
Jeremy Siek b712b85d2b Added named parameter variant.
[SVN r9715]
2001-04-05 04:54:29 +00:00
Jeremy Siek cfbd495345 new file
[SVN r9714]
2001-04-05 04:53:36 +00:00
Jeremy Siek 5fa6b2bf2d protected use of std::iterator_traits with #ifdef
[SVN r9713]
2001-04-05 03:15:47 +00:00
Jeremy Siek 6b112523c7 added note about requirement for Default Constructible
[SVN r9712]
2001-04-05 02:58:03 +00:00
Jeremy Siek 3b5fdbec36 added LvaluePropertyGraphConcept
[SVN r9710]
2001-04-05 02:11:11 +00:00
Jeremy Siek c0227802dc Property -> PropertyTag
[SVN r9709]
2001-04-05 02:10:19 +00:00
Jeremy Siek bd93c66090 renamed PropertyTag.html
[SVN r9708]
2001-04-05 02:08:58 +00:00
Jeremy Siek bf75444970 Property to PropertyTag
[SVN r9707]
2001-04-05 02:05:07 +00:00
Jeremy Siek 94c390e51b changed to LvaluePropertyGraph
[SVN r9706]
2001-04-05 02:03:30 +00:00
Jeremy Siek d485334e75 new file
[SVN r9705]
2001-04-05 02:02:44 +00:00
Jeremy Siek 0735bf5a73 added reference to PropertyTag concept
[SVN r9704]
2001-04-05 02:00:11 +00:00
Jeremy Siek 0d1e4daf0b fixed concept for property maps (changed to Lvalue)
[SVN r9703]
2001-04-05 01:43:14 +00:00
Jeremy Siek 14f85b8986 fixed template parameters
[SVN r9701]
2001-04-04 21:29:38 +00:00
Jeremy Siek 13fe19c49b added requirements for parameter T in property class
[SVN r9700]
2001-04-03 17:06:11 +00:00
Jeremy Siek 64ef954373 fixed docs for creating custom tags
[SVN r9699]
2001-04-03 16:55:41 +00:00
Jeremy Siek 5e41c529cf added #include of graph_traits.hpp to make properties.hpp self-contained
[SVN r9698]
2001-04-03 16:04:47 +00:00
Jeremy Siek 1a31f705af added #include for properties.hpp
[SVN r9697]
2001-04-03 16:01:36 +00:00
John Maddock b9c6708852 Added boost-wide <limits> woraround
[SVN r9688]
2001-04-01 11:59:18 +00:00
Jeremy Siek c34f602abb added copy cons
[SVN r9680]
2001-03-29 04:57:19 +00:00
Jeremy Siek 88e9336be9 added copy cons req
[SVN r9679]
2001-03-29 04:56:29 +00:00
Jeremy Siek 514acdfa7c added spaces in concept names
[SVN r9678]
2001-03-29 04:56:03 +00:00
Jeremy Siek 8934559187 added req for copy cons
[SVN r9677]
2001-03-29 04:52:33 +00:00
Jeremy Siek 93ba158730 added copy constructible requirement
[SVN r9676]
2001-03-29 04:50:18 +00:00
Jeremy Siek fc01bb9c72 added traversal category
[SVN r9675]
2001-03-29 04:49:10 +00:00
Jeremy Siek 5d27919240 added refinement of Copy Constructible
[SVN r9674]
2001-03-29 04:09:57 +00:00
Jeremy Siek 8590ee9b64 added traversal_category
[SVN r9672]
2001-03-29 02:04:10 +00:00
Jeremy Siek 55eb406cac added traversal_category to graph concepts
[SVN r9671]
2001-03-29 01:56:49 +00:00
Jeremy Siek d5a7d42929 added traversal categories
[SVN r9670]
2001-03-29 01:55:17 +00:00
Jeremy Siek f6d0b7ea44 added traversal_category
[SVN r9669]
2001-03-29 01:54:18 +00:00
Jeremy Siek eae9b22a8d added traversal category
[SVN r9668]
2001-03-29 01:46:17 +00:00
Jeremy Siek ea705ac53f added traversal_category
[SVN r9667]
2001-03-29 01:42:33 +00:00
Jeremy Siek 19ed2331fd added traversal category
[SVN r9666]
2001-03-29 01:36:46 +00:00
Jeremy Siek 850f2b1e7d added adjacency_matrix to the models list
[SVN r9665]
2001-03-29 01:26:41 +00:00
Jeremy Siek c1cb9240cf added some more generating functions
[SVN r9660]
2001-03-28 00:57:56 +00:00
Jeremy Siek db00049b35 added some Iterator Property Map Generating Functions contributed by
Kevin Vanhorn


[SVN r9659]
2001-03-28 00:54:05 +00:00
Jeremy Siek 636bc74d90 added note about using BFS for edge weight == 1
[SVN r9658]
2001-03-28 00:44:39 +00:00
Jeremy Siek 94e9e262d3 added note about property map library
[SVN r9657]
2001-03-28 00:32:46 +00:00
Jeremy Siek 48892971bf added link to property map library
[SVN r9656]
2001-03-28 00:31:43 +00:00
Jeremy Siek d87c810127 moved TOC ref to the top
[SVN r9641]
2001-03-25 18:15:16 +00:00
Jeremy Siek b9f21c77ad updated example
[SVN r9634]
2001-03-22 18:10:10 +00:00
Jeremy Siek bd9f720581 updated sample output
[SVN r9633]
2001-03-22 18:07:49 +00:00
Jeremy Siek a99bad2398 removed self loop (1,1)
[SVN r9632]
2001-03-22 18:05:03 +00:00
Jeremy Siek a6dc03773e fixed is_isomorphic()
[SVN r9611]
2001-03-20 05:23:16 +00:00
Jeremy Siek e3a8ba103a port to KAI C++
[SVN r9610]
2001-03-20 05:15:11 +00:00
Jeremy Siek 3f97794d58 port to KCC
[SVN r9609]
2001-03-20 05:14:53 +00:00
Jeremy Siek a0bf8389ce new file
[SVN r9608]
2001-03-20 05:13:36 +00:00
Jeremy Siek 29a34b199d new file, fixes shadow_iterator
[SVN r9607]
2001-03-20 05:12:35 +00:00
Jeremy Siek 0e550aee82 fixed bug in filtered graph
finished simple isomorphism algorithm
added some #include's to adjacency_iterator


[SVN r9606]
2001-03-20 04:58:13 +00:00
Jeremy Siek 4e29fa0497 work on isomorphism, fixed some bugs
[SVN r9605]
2001-03-20 04:55:39 +00:00
Jeremy Siek 90ea3b2441 removed shadow iterator
[SVN r9596]
2001-03-19 22:50:31 +00:00
Jeremy Siek a156259d75 oops
[SVN r9595]
2001-03-19 22:50:05 +00:00
Jeremy Siek b327f08b86 new files
[SVN r9594]
2001-03-19 22:49:56 +00:00
Jeremy Siek 6a85d72962 blah
[SVN r9590]
2001-03-19 20:23:25 +00:00
Jeremy Siek 7e7cad34fa new files, and changes to bitset
[SVN r9589]
2001-03-19 20:23:12 +00:00
Jeremy Siek 531cbf475e removed incident_to
[SVN r9580]
2001-03-18 20:12:15 +00:00
Jeremy Siek b9e27e9e73 changed name of 1st incident_on() to incident_edges() to avoid
conflict with 2nd incident_on()


[SVN r9579]
2001-03-18 20:11:52 +00:00
Jeremy Siek 701e70d99f removed has_target, now using incident_to from graph_utility.hpp
[SVN r9576]
2001-03-18 16:30:59 +00:00
Jeremy Siek 6932248ef4 changed has_target() to incident_to(), and added incident_on() and
connects()


[SVN r9575]
2001-03-18 16:30:14 +00:00
Jeremy Siek 392bf86290 removed #include of iterator_macros.hpp, was just experimenting with them
[SVN r9574]
2001-03-18 16:21:35 +00:00
Jeremy Siek 73f9128f12 worked on dyn_size_bitset
[SVN r9543]
2001-03-11 17:10:49 +00:00
Jeremy Siek ed1001219a added link to FAQ from TOC and removed obsolete file using_boost_graph_library.html
[SVN r9542]
2001-03-11 17:05:15 +00:00
Beman Dawes 246387fe74 Minor fixes
[SVN r9541]
2001-03-11 13:45:46 +00:00
Jeremy Siek 020754d41b new file
[SVN r9535]
2001-03-10 02:59:53 +00:00
Jeremy Siek 019e7d59a4 new files, under construction
[SVN r9534]
2001-03-10 02:49:09 +00:00
Jeremy Siek 613594cc4b added link to adjacency_iterator
[SVN r9529]
2001-03-09 18:28:48 +00:00
Jeremy Siek 60799c4d99 added defaults
[SVN r9528]
2001-03-09 18:26:53 +00:00
Jeremy Siek aea2ef0bce added some &nbsp; to prevent unwanted wrapping
[SVN r9527]
2001-03-09 18:17:07 +00:00
Jeremy Siek 572382815b fixed dynamic_components
[SVN r9526]
2001-03-09 16:30:00 +00:00
Beman Dawes ee6e39cbf9 1.21.0 run up including fixing broken links
[SVN r9523]
2001-03-09 14:36:41 +00:00
Jeremy Siek 3ed034416a fixed use of edge_descriptor
[SVN r9501]
2001-03-08 20:16:28 +00:00
Jeremy Siek abd95021fb new file
[SVN r9493]
2001-03-08 17:39:51 +00:00
Jeremy Siek 9263d22520 added adjacency_iterator
[SVN r9492]
2001-03-08 17:39:28 +00:00
Jeremy Siek f0c213150c fixed width and height of figure
[SVN r9481]
2001-03-07 21:32:07 +00:00
Jeremy Siek 2ed00fe129 fixed adjacency_list.html figure size
[SVN r9480]
2001-03-07 21:31:06 +00:00
Jeremy Siek a25a678a60 fixed remove_vertex for bidirectional graph, needed to reindex the
edge list


[SVN r9466]
2001-03-06 05:57:19 +00:00
Jeremy Siek 0c8db5bd23 added inv_adjacency_iterator_generator
[SVN r9465]
2001-03-06 05:36:51 +00:00
Jeremy Siek 9b81ec002e large change due to subtle edge::operator== bugs with multigraphs
simplified the implementation considerably, at some cost to space complexity


[SVN r9464]
2001-03-06 05:33:55 +00:00
Jeremy Siek 9a92335451 changed edge equality to be based on property object so we will get
correct behaviour with multi graphs


[SVN r9463]
2001-03-06 05:32:01 +00:00
Jeremy Siek 202ab00774 added allows_parallel_edges()
[SVN r9462]
2001-03-06 05:31:12 +00:00
Jeremy Siek 5561613f00 new files
[SVN r9435]
2001-03-04 19:00:42 +00:00
Jeremy Siek ad856f3fd4 changed namespace
[SVN r9434]
2001-03-04 18:53:02 +00:00
Jeremy Siek 51d4f166cf added edgesum
[SVN r9433]
2001-03-04 18:52:30 +00:00
Jeremy Siek aa869df676 changed MutableGraph
[SVN r9431]
2001-03-04 18:50:32 +00:00
Jeremy Siek f79f66db8f brought up to date
[SVN r9430]
2001-03-04 18:36:39 +00:00
Jeremy Siek d2608cc258 fixed named clash with distance
[SVN r9429]
2001-03-04 18:11:05 +00:00
Jeremy Siek 775da4350a fixed edge length and color_triats problems, thanks Andreas
[SVN r9428]
2001-03-04 18:07:35 +00:00
Jeremy Siek ae1d55dfee changed color traits default to use enums
[SVN r9427]
2001-03-04 18:07:05 +00:00
Jeremy Siek 3e82ea3625 fixed clear() function to handle case with no edge property
[SVN r9401]
2001-03-03 18:53:13 +00:00
Jeremy Siek c391a5e79c avoid internal compiler error with MSVC and STLport
[SVN r9382]
2001-03-02 23:39:17 +00:00
Jeremy Siek bd22fe7c87 avoid internal compiler error on MSVC with STLport
[SVN r9381]
2001-03-02 23:38:53 +00:00
Jeremy Siek 13cda0a4df fixed bug in add vertices to subgraphs
[SVN r9379]
2001-03-02 15:57:14 +00:00
Jeremy Siek 1feee2a564 added a couple functions
[SVN r9376]
2001-03-02 03:34:11 +00:00
Jeremy Siek b41490bdc8 auto-gen version with slist had accidentally been checked in.
Changed to a graph type using list instead


[SVN r9373]
2001-03-02 01:07:18 +00:00
Beman Dawes 1911f0e3ad Boost Test Library initial commit
[SVN r9364]
2001-02-28 21:39:56 +00:00
Jeremy Siek 6d38d384d0 indenting
[SVN r9362]
2001-02-28 04:20:51 +00:00
Jeremy Siek 646965f4ca few edits
[SVN r9361]
2001-02-28 04:20:20 +00:00
Jeremy Siek df1190bca6 dynamic -> incremental
[SVN r9360]
2001-02-28 03:51:52 +00:00
Jeremy Siek fae733fb9b changed paths
[SVN r9359]
2001-02-28 03:14:49 +00:00
Jeremy Siek 69f205fd74 fixed default_writer
[SVN r9357]
2001-02-27 17:46:27 +00:00
Jeremy Siek 8192915c4f fixed some bugs brought out by STLport debug mode
[SVN r9355]
2001-02-27 06:38:04 +00:00
Jeremy Siek 230e30aee3 fixed g++ with STLport problem with source(std::pair<T,T>,G)
[SVN r9354]
2001-02-27 06:33:08 +00:00
Jeremy Siek 37f4440d1d fixed access of filter iterator policies type
[SVN r9353]
2001-02-27 06:14:02 +00:00
Jeremy Siek 243d74572e fixed access to filter iterator policies type
[SVN r9352]
2001-02-27 06:12:29 +00:00
Jeremy Siek 11edc80fb1 some edits
[SVN r9349]
2001-02-27 02:20:47 +00:00
Jeremy Siek aa8e953574 new file
[SVN r9346]
2001-02-26 23:17:47 +00:00
Jeremy Siek 1df5e72394 more edits
[SVN r9345]
2001-02-26 23:17:15 +00:00
Jeremy Siek a79b674ccf worked on docs for cuthill mckee
[SVN r9344]
2001-02-26 23:16:39 +00:00
Jeremy Siek 3632e499c9 new files
[SVN r9343]
2001-02-26 23:13:05 +00:00
Jeremy Siek 41b167816f added degree_property_map
[SVN r9342]
2001-02-26 23:08:45 +00:00
Jeremy Siek b2f02dfc15 stopped using fenced queue, just makes it harder to understand
[SVN r9341]
2001-02-26 21:49:19 +00:00
Jeremy Siek 803a0b1fca more dynamic->incremental changes
[SVN r9340]
2001-02-26 18:33:51 +00:00
Jeremy Siek 807302b982 separated concept_checks.cpp into peices and moved to test/ directory
[SVN r9339]
2001-02-26 18:14:46 +00:00
Jeremy Siek e843876765 stanford graph update from Andreas
renamed dynamic components to incremental components


[SVN r9338]
2001-02-26 18:13:00 +00:00
Jeremy Siek 296884f7d9 moved concept checking stuff from example/ to test/ directory
renamed dynamic components to incremental components
added regression.cfg file to test/


[SVN r9337]
2001-02-26 18:12:20 +00:00
Jeremy Siek 88d1bbe387 removed #if 0's
[SVN r9336]
2001-02-26 03:29:53 +00:00
Jeremy Siek 01e3d04946 work on connected components, and various fixes
[SVN r9335]
2001-02-26 03:29:07 +00:00
Jeremy Siek a5d2a5b391 added undirected graph
[SVN r9334]
2001-02-26 02:27:11 +00:00
Jeremy Siek fc8e4d8ffa working version
[SVN r9332]
2001-02-25 22:06:23 +00:00
Jeremy Siek 0f9043b2ee added strong components, changed connected_components
[SVN r9331]
2001-02-25 21:32:23 +00:00
Jeremy Siek 6cba5f9690 reorganizing connected components stuff
[SVN r9330]
2001-02-25 21:02:15 +00:00
Jeremy Siek f568f28714 broke this up into several files, separated out strong components
[SVN r9329]
2001-02-25 21:01:06 +00:00
Jeremy Siek 18620374e9 work on connected components
[SVN r9328]
2001-02-25 21:00:13 +00:00
Jeremy Siek 81b9c05023 new file
[SVN r9327]
2001-02-25 20:56:16 +00:00
Jeremy Siek a00f975f0f added docs from Andreas Scherer for Stanford GraphBase
[SVN r9326]
2001-02-25 20:16:42 +00:00
Jeremy Siek 754bf68739 first checkin of BGL interface to SGB documentation
[SVN r9325]
2001-02-25 20:08:06 +00:00
Jeremy Siek ba3379e5f2 fixed adjacent_vertices()
[SVN r9322]
2001-02-24 20:58:29 +00:00
Jeremy Siek fa461fe18a new file
[SVN r9320]
2001-02-24 07:31:37 +00:00
Jeremy Siek bf40cfee24 add test for edge_length to the SGB section
[SVN r9318]
2001-02-23 15:35:42 +00:00
Jeremy Siek c3530c9922 encorporated more changes from Andreas Scherer:
(a) reduce code redundancy by applying some more preproc macros
(b) make some class definitions more consistent (in regard of "self",
    bool friends, and protected data members)
(c) hand over several sgb_edges by (const) reference instead of by value
(d) remove the compiler-dependency for __GNUC__

and made some more changes:

  - made sgb_edge_util_map a friend of sgb_edge, and put it inside
    a #if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
  - removed redundant inline's
  - changed passing by sgb_edge& to const sgb_edge& is a few places.
  - changed edge_length to edge_length_t so that the naming is
    consistent with the rest of the BGL.
  - added get()/put() shortcuts to sgb_edge_length_map


[SVN r9317]
2001-02-23 15:35:00 +00:00
Jeremy Siek 5587566c0c added a constructor
[SVN r9314]
2001-02-23 00:58:05 +00:00
Jeremy Siek 7e9e7069db graph_node to graph_vertex
[SVN r9311]
2001-02-22 04:18:29 +00:00
Jeremy Siek 81ba240349 changes for the all property and graphviz stuff
[SVN r9310]
2001-02-22 04:14:51 +00:00
Jeremy Siek 0310203b92 new file
[SVN r9309]
2001-02-22 04:13:27 +00:00
Jeremy Siek 81bb1d06c0 added GraphRef parameter to allow reverse_graph to be constant or mutable
[SVN r9268]
2001-02-19 05:42:46 +00:00
Jeremy Siek 1ea3cd7c9f update #include path to adjacency_iterator
[SVN r9267]
2001-02-19 05:27:56 +00:00
Jeremy Siek 5707461397 added some property graph checks to stanford graph base
[SVN r9262]
2001-02-18 20:10:48 +00:00
Jeremy Siek b53ceab41a more from Andreas's patch
fixed it property map stuff


[SVN r9261]
2001-02-18 20:09:43 +00:00
Jeremy Siek c13d4c8017 removed bad size specifications from figures
[SVN r9258]
2001-02-18 19:10:11 +00:00
Jeremy Siek 653aeaf9be applied Andreas's patch and added out_degree()
[SVN r9256]
2001-02-18 18:09:19 +00:00
Jeremy Siek 9420c5ef82 used -kb this time
[SVN r9245]
2001-02-17 22:01:23 +00:00
Jeremy Siek 19b9c60b0f removing again
[SVN r9244]
2001-02-17 22:00:36 +00:00
Jeremy Siek 97c6b57fbb re-added, this time using -ko flag
[SVN r9242]
2001-02-17 20:21:56 +00:00
Jeremy Siek 4abe5ed59a need to add in binary mode
[SVN r9241]
2001-02-17 20:17:53 +00:00
Jeremy Siek 06b6ee6849 added two workarounds
[SVN r9212]
2001-02-15 15:57:35 +00:00
Jeremy Siek 2924dd1086 fix from Rich
[SVN r9202]
2001-02-15 03:35:17 +00:00
Jeremy Siek b06af1b71d fix from Rich Lee
[SVN r9201]
2001-02-15 03:34:45 +00:00
Jeremy Siek 113f42064a some fixes from Rich
[SVN r9200]
2001-02-15 03:34:13 +00:00
Jeremy Siek d368ee932e changes in graphviz, small fix to subgraph
[SVN r9175]
2001-02-12 20:51:10 +00:00
Jeremy Siek e2cda00cd7 graphviz changes
[SVN r9174]
2001-02-12 20:49:42 +00:00
Jeremy Siek fa3090baa7 more changes
[SVN r9173]
2001-02-12 20:31:15 +00:00
Jeremy Siek 0facc36866 updated to changes in graphviz.hpp
[SVN r9168]
2001-02-12 19:05:20 +00:00
Jeremy Siek 643bbaaafb moved subgraph version of write_graphviz here
[SVN r9167]
2001-02-12 19:01:05 +00:00
Jeremy Siek d58d53c73c moved write_graphviz() function to the graphviz.hpp header
[SVN r9166]
2001-02-12 19:00:32 +00:00
Jeremy Siek 3498b74625 this gets generated
[SVN r9162]
2001-02-12 18:21:02 +00:00
Jeremy Siek ae7c6cdd96 new files
[SVN r9161]
2001-02-12 18:13:59 +00:00
Jeremy Siek c73f757b5e new file
[SVN r9160]
2001-02-12 18:10:34 +00:00
Jeremy Siek c67fd6fb60 Various fixes thanks to Lie-Quan
[SVN r9159]
2001-02-12 16:39:31 +00:00
Jeremy Siek 6554a1e32b fixed incomplete name change over for some template parameters
[SVN r9142]
2001-02-12 00:49:45 +00:00
Jeremy Siek 0b9b227105 updated for iterator_adaptor changes
[SVN r9141]
2001-02-12 00:36:32 +00:00
Jeremy Siek 4bfb9f8c8c updated for change in iterator adaptor
[SVN r9140]
2001-02-12 00:35:48 +00:00
Jeremy Siek 37436fb7d1 updated with respect to iterator_adaptor
[SVN r9139]
2001-02-12 00:21:20 +00:00
Jeremy Siek fb1d480100 updated use of iterator_adaptor
[SVN r9138]
2001-02-11 23:55:07 +00:00
Jeremy Siek e10a70cb34 < to &lt;
[SVN r9089]
2001-02-10 20:10:21 +00:00
Jeremy Siek f5e2426677 inlined detail::is_directed to avoid multiple-def problems
[SVN r9088]
2001-02-10 20:07:35 +00:00
Jeremy Siek 199bf7e18b use new create_subgraph()
[SVN r9087]
2001-02-10 19:26:19 +00:00
Jeremy Siek c423fe07e6 fixed create_subgraph()
[SVN r9086]
2001-02-10 19:26:00 +00:00
Jeremy Siek 067c5ad7bb the main graph is now responsible for the subgraph memory management
[SVN r9085]
2001-02-10 19:16:13 +00:00
Jeremy Siek 7c8ac36115 refer to policies in detail::
[SVN r9084]
2001-02-10 19:11:27 +00:00
Jeremy Siek 6245f43a0a added IteratorConstructibleGraph.html and updated SGI STL URL
[SVN r9083]
2001-02-10 18:48:19 +00:00
Jeremy Siek afdfa1a52f moved adjacency_iterator_generator out of the detail namespace
[SVN r9082]
2001-02-10 18:27:33 +00:00
Jeremy Siek 76efd12e1d added "tests passed" report
[SVN r9081]
2001-02-10 18:21:00 +00:00
Jeremy Siek ebae5c8873 update for iterator_adaptor and make use of boost::detail::iterator_traits
[SVN r9080]
2001-02-10 18:20:41 +00:00
Jeremy Siek 8a03201821 iterator_adaptor update
[SVN r9079]
2001-02-10 18:17:45 +00:00
Jeremy Siek e406d2fae7 cleaned up for public consumption
[SVN r9078]
2001-02-10 18:15:42 +00:00
Jeremy Siek 438b752fb4 moving out of detail
[SVN r9077]
2001-02-10 18:02:10 +00:00
Jeremy Siek 028a12ad27 #if'd out traversal_category stuff for now
[SVN r9075]
2001-02-10 17:06:17 +00:00
Jeremy Siek b05969ef6a added is_directed()
[SVN r9074]
2001-02-10 17:05:32 +00:00
Beman Dawes ad33e4a22e All final 1.20.2 changes, including fixing broken hyperlinks
[SVN r9071]
2001-02-10 14:42:14 +00:00
Jeremy Siek e0f256559b updated to change in indirect_iterator
[SVN r9028]
2001-02-08 03:43:33 +00:00
Jeremy Siek 8f6db8c5ad fixed add_vertex() problem and updated to indirect_iterator_generator
[SVN r9014]
2001-02-07 22:22:44 +00:00
Jeremy Siek 86ef707164 added is_connected
[SVN r8986]
2001-02-06 19:40:26 +00:00
Jeremy Siek 06d42a60d7 changed is_descendant to use get() instead of op[]
[SVN r8983]
2001-02-06 19:02:24 +00:00
Jeremy Siek 647877fa4a color_traits
[SVN r8982]
2001-02-06 18:42:48 +00:00
Jeremy Siek 9ad28a9dfa changed to use color_traits
[SVN r8981]
2001-02-06 18:02:30 +00:00
Jeremy Siek 3a3fcb6c6a added buffer_archetype
[SVN r8980]
2001-02-06 18:02:07 +00:00
Jeremy Siek 21b923a7a1 added undirected graph test
[SVN r8979]
2001-02-06 18:01:49 +00:00
Jeremy Siek c1d54e7453 added compile-time requirement checks
[SVN r8978]
2001-02-06 17:55:06 +00:00
Jeremy Siek cdd890cf62 changed to use color_traits
[SVN r8977]
2001-02-06 17:52:18 +00:00
Jeremy Siek fa3510315b added is_reachable (using dfs)
[SVN r8976]
2001-02-06 17:43:28 +00:00
Jeremy Siek 9e8c1e8fad untabify
[SVN r8975]
2001-02-06 17:41:04 +00:00
Jeremy Siek 65488f886d new file
[SVN r8974]
2001-02-06 17:39:42 +00:00
Jeremy Siek ffe084cded moved call to tree_edge before color gray for consistency with DFS
[SVN r8969]
2001-02-06 03:25:28 +00:00
Jeremy Siek 265a05b189 changed color access to use color_traits
[SVN r8967]
2001-02-06 02:03:51 +00:00
Jeremy Siek 022acc9531 added generate_random_graph
[SVN r8966]
2001-02-06 02:02:33 +00:00
Jeremy Siek cfa4f5c4a1 removed #include
[SVN r8965]
2001-02-06 02:02:13 +00:00
Jeremy Siek accc191da3 finished 1st draft
[SVN r8964]
2001-02-06 02:01:14 +00:00
Jeremy Siek f00f096e69 added a check on the color_value_archetype
[SVN r8961]
2001-02-06 01:51:20 +00:00
Jeremy Siek 223399ed54 added some stuff to color_value_archetype
[SVN r8960]
2001-02-06 01:50:56 +00:00
Jeremy Siek 77e07e01c0 changed ColorValueConcept
[SVN r8959]
2001-02-06 01:50:31 +00:00
Jeremy Siek 1afa60a8c5 added template<>
[SVN r8958]
2001-02-06 01:42:17 +00:00
Jeremy Siek cc508a1489 added checking of archetypes
[SVN r8957]
2001-02-06 01:37:52 +00:00
Jeremy Siek 1a23716343 new file
[SVN r8956]
2001-02-06 01:37:25 +00:00
Jeremy Siek 059525402f new file, test for DFS
[SVN r8946]
2001-02-05 20:38:38 +00:00
Jeremy Siek 4a1e3392b9 added edge() function
[SVN r8943]
2001-02-05 16:52:31 +00:00
Jeremy Siek 0cfab20daf new .expected file and update to filtered_graph.cpp
[SVN r8912]
2001-02-04 05:00:38 +00:00
Jeremy Siek f3d631220d updated filtered_edge_graph -> filtered_graph
[SVN r8911]
2001-02-04 04:56:47 +00:00
Jeremy Siek 6327cf5298 fixed edge_iter_policy and added in_edge_iter_policy
[SVN r8910]
2001-02-04 04:45:30 +00:00
Jeremy Siek 6f120cab78 added in_edges()
[SVN r8909]
2001-02-04 04:39:59 +00:00
Jeremy Siek 5b708ae608 changes in event points for BFSVisitor
removed some completed items from challenge


[SVN r8908]
2001-02-04 04:38:52 +00:00
Jeremy Siek 03d520c3e6 few edits
[SVN r8906]
2001-02-04 04:34:29 +00:00
Jeremy Siek 8f790672c6 added some refs
[SVN r8905]
2001-02-04 04:33:57 +00:00
Jeremy Siek 69e3ef232c some trivial changes
[SVN r8904]
2001-02-04 04:33:30 +00:00
Jeremy Siek 451496b3db finished 1st draft
[SVN r8903]
2001-02-04 04:32:40 +00:00
Jeremy Siek 6b2ea41e4e finished first draft
[SVN r8902]
2001-02-04 04:32:14 +00:00
Jeremy Siek 81e1ffc806 new file
[SVN r8901]
2001-02-04 04:02:26 +00:00
Jeremy Siek 4450f4cc26 fixed typo
[SVN r8900]
2001-02-04 03:56:34 +00:00
Jeremy Siek 3c1ad89057 new files
[SVN r8899]
2001-02-04 03:52:37 +00:00
Jeremy Siek 8e7dcf7b03 new file
[SVN r8898]
2001-02-04 03:51:02 +00:00
Jeremy Siek efd172b0bb added description of maximum flow
[SVN r8897]
2001-02-04 03:43:28 +00:00
Jeremy Siek c34af68b3b added use of children()
[SVN r8896]
2001-02-04 03:15:20 +00:00
Jeremy Siek 9c5660d432 new file
[SVN r8895]
2001-02-04 03:13:40 +00:00
Jeremy Siek 929df2bcdd got some property stuff working, and added children()
[SVN r8894]
2001-02-04 03:12:40 +00:00
Jeremy Siek 1bb18dfc5e moved graph_property to properties.hpp
[SVN r8893]
2001-02-04 03:11:42 +00:00
Jeremy Siek 1a58adf027 added graph_property traits class (moved from adjacency_list)
[SVN r8892]
2001-02-04 03:11:15 +00:00
Jeremy Siek 4d860edaa9 vec_adj_list_vertex_id_map is a read write property map, not lvalue
[SVN r8891]
2001-02-04 03:08:29 +00:00
Jeremy Siek b11e09d46a added some algos and classes
[SVN r8883]
2001-02-02 21:58:59 +00:00
Jeremy Siek dd67268acf new file
[SVN r8882]
2001-02-02 21:58:05 +00:00
Jeremy Siek c4b46b14a1 added some functions
[SVN r8881]
2001-02-02 21:47:02 +00:00
Jeremy Siek 28ab969e24 added figures
[SVN r8880]
2001-02-02 21:42:52 +00:00
Jeremy Siek 324e2b5247 new file
[SVN r8878]
2001-02-02 21:34:58 +00:00
Jeremy Siek 20c3c22786 some new files
[SVN r8877]
2001-02-02 21:33:17 +00:00
Jeremy Siek cadab548e8 new files
[SVN r8872]
2001-02-02 20:23:01 +00:00
Jeremy Siek 09f684d24e blah
[SVN r8866]
2001-02-02 19:51:34 +00:00
Jeremy Siek 5111085358 moved from above dir
[SVN r8865]
2001-02-02 19:37:42 +00:00
Jeremy Siek 10dc120342 moved to figs
[SVN r8864]
2001-02-02 19:37:15 +00:00
Jeremy Siek 77c862da72 new file
[SVN r8863]
2001-02-02 19:35:31 +00:00
Jeremy Siek ad87ccbcea new file
[SVN r8862]
2001-02-02 18:58:59 +00:00
Jeremy Siek 02071c6f7c filtered_edge_graph -> filtered_graph
[SVN r8859]
2001-02-02 16:11:23 +00:00
Jeremy Siek f4e797844a moved some files
[SVN r8858]
2001-02-02 16:09:13 +00:00
Jeremy Siek 382ffba2d9 changed name to filtered_graph, added vertex predicate
[SVN r8857]
2001-02-02 16:06:43 +00:00
Jeremy Siek 4a77da43cd new name for filtered_edge_graph, added vertex predicate
[SVN r8856]
2001-02-02 16:06:07 +00:00
Jeremy Siek 61632c8358 added design rationale
[SVN r8855]
2001-02-02 15:37:31 +00:00
Jeremy Siek e342992729 added design rationale
[SVN r8854]
2001-02-02 15:30:33 +00:00
Jeremy Siek 694df0dfab added refinement from IncidenceGraph
[SVN r8853]
2001-02-02 15:23:26 +00:00
Jeremy Siek f9feb604f8 changed to using enum vertex indices
[SVN r8852]
2001-02-02 04:41:38 +00:00
Jeremy Siek b0dbc39dfc added some comments and a copyright
[SVN r8851]
2001-02-02 04:38:17 +00:00
Jeremy Siek 7aa8610f4d new file
[SVN r8845]
2001-02-01 21:27:45 +00:00
Jeremy Siek d4d05e4578 added public parent() function
[SVN r8844]
2001-02-01 21:27:23 +00:00
Jeremy Siek 6bf1049b36 mostly working now, but only lightly tested
[SVN r8843]
2001-02-01 21:16:04 +00:00
Jeremy Siek 310da54aad specified vertex order for in-edges
[SVN r8842]
2001-02-01 20:24:47 +00:00
Jeremy Siek 277a3dc24e specified vertex ordering for in-edges and out-edges
[SVN r8841]
2001-02-01 20:21:58 +00:00
Jeremy Siek d38cc95153 no change
[SVN r8840]
2001-02-01 20:13:48 +00:00
Jeremy Siek 0be673aaf7 specified out-edge ordering for undirected graphs
[SVN r8839]
2001-02-01 20:13:31 +00:00
Jeremy Siek 724c0ec33e added explanation of the semantics of add_edge() in the undirected graph
case


[SVN r8838]
2001-02-01 17:55:01 +00:00
Jeremy Siek 1ed4660eeb new file
[SVN r8823]
2001-01-31 02:26:16 +00:00
Jeremy Siek f865949f88 switched to using namespace boost;
[SVN r8812]
2001-01-29 19:36:12 +00:00
Jeremy Siek 7e9bbc2dd0 new files
[SVN r8811]
2001-01-29 19:17:09 +00:00
Jeremy Siek 3e81c3d721 added default to adjacency_matrix_traits Directed parameter
[SVN r8809]
2001-01-29 17:52:07 +00:00
Jeremy Siek b81c6a1295 added directed part of edge_iterator and fixed target()
[SVN r8807]
2001-01-28 21:28:57 +00:00
Jeremy Siek 375d4babf8 added checks for adjacency_matrix
[SVN r8805]
2001-01-28 02:35:46 +00:00
Jeremy Siek 60a5e33e58 cycle_edge -> non_tree_edge
[SVN r8804]
2001-01-28 02:34:55 +00:00
Jeremy Siek 1d6b555089 changed name of property to avoid clash
[SVN r8803]
2001-01-28 02:34:22 +00:00
Jeremy Siek f0a69e09fc added constructor requirement to MutableGraph
[SVN r8802]
2001-01-28 02:25:44 +00:00
Jeremy Siek 9a2f59e810 changed #ifdef protect macro name to match file name
[SVN r8801]
2001-01-28 02:25:02 +00:00
Jeremy Siek 859c2cfe53 moved is_residual_edge predicate from edmunds_karp to filtered_edge_graph.hpp
[SVN r8800]
2001-01-28 02:23:59 +00:00
Jeremy Siek 20dedbca41 some KAI port fixes
[SVN r8799]
2001-01-28 02:23:09 +00:00
Jeremy Siek e7a18e1974 cycle_edge -> non_tree_edge
[SVN r8798]
2001-01-28 02:22:42 +00:00
Jeremy Siek 2305f4d132 changing name of "cycle_edge" to "non_tree_edge" for BFSVisitor
[SVN r8797]
2001-01-28 02:21:49 +00:00
Jeremy Siek e9ac0156c9 added note about add_vertex()
[SVN r8796]
2001-01-28 02:15:20 +00:00
Jeremy Siek d9bf2c41e8 removed #include <cmath>, no longer needed
[SVN r8795]
2001-01-28 02:12:53 +00:00
Jeremy Siek 663ac09003 new graph class
[SVN r8794]
2001-01-28 02:12:02 +00:00
Jeremy Siek f0c68c9003 added #include of graph_selectors
[SVN r8793]
2001-01-27 21:21:36 +00:00
Jeremy Siek c5ba516e61 new file
[SVN r8792]
2001-01-27 21:20:49 +00:00
Jeremy Siek 15b4af5e2b no change
[SVN r8791]
2001-01-27 21:19:55 +00:00
Jeremy Siek 7523d6dc5d moved has_property from here to boost/pending/property.hpp
[SVN r8790]
2001-01-27 18:14:21 +00:00
Jeremy Siek cdb94cdbd5 moved has_property from detail/adjacency_list.hpp to here
[SVN r8789]
2001-01-27 18:13:55 +00:00
Jeremy Siek f39d175888 simplified a bit and made it more generic
[SVN r8776]
2001-01-27 03:14:27 +00:00
Jeremy Siek 4015378172 fixed bug in the bidirectional remove_out_edge_if and
remove_in_edge_if. Needed to consider the without property case.


[SVN r8774]
2001-01-26 18:35:29 +00:00
Jeremy Siek 5d6cec7c5d changed order of tree edge and discover vertex
[SVN r8769]
2001-01-25 21:18:49 +00:00
Jeremy Siek 4ab7a58de0 fixed compiler error with VERBOSE=1
[SVN r8766]
2001-01-25 04:54:10 +00:00
Jeremy Siek c4886e3a2f new file
[SVN r8762]
2001-01-24 22:43:08 +00:00
Jeremy Siek cd02f9c2a3 new file
[SVN r8760]
2001-01-24 22:34:20 +00:00
Jeremy Siek 8f8fe50b93 changed max_flow.dat file to a more demanding example graph
[SVN r8756]
2001-01-24 16:54:31 +00:00
Jeremy Siek 9283cf2f26 fixed bug in converting preflow to flow
[SVN r8755]
2001-01-24 16:19:39 +00:00
Jeremy Siek 0d61d68ec5 working on filter graph and max flow
[SVN r8750]
2001-01-24 04:28:17 +00:00
Jeremy Siek 43d91e1160 new file
[SVN r8749]
2001-01-24 04:26:16 +00:00
Jeremy Siek 92fb2b9965 changed name of maximum_flow to push_relabel_max_flow
[SVN r8740]
2001-01-23 19:17:15 +00:00
Jeremy Siek fa7bd23cc2 new file
[SVN r8739]
2001-01-23 19:12:12 +00:00
Jeremy Siek 786a500615 added copyright
[SVN r8738]
2001-01-23 19:11:24 +00:00
Jeremy Siek a1525a3cc3 finished
[SVN r8737]
2001-01-23 19:10:50 +00:00
Jeremy Siek 4d25336a81 removed cause of warnings for KCC
[SVN r8734]
2001-01-23 19:08:30 +00:00
Jeremy Siek 4912f811de version (2) and (3) now take a const graph
[SVN r8733]
2001-01-23 18:04:59 +00:00
Jeremy Siek d7ebce6bd6 changed variant (2) and (3) to take a const graph
[SVN r8732]
2001-01-23 18:04:21 +00:00
Jeremy Siek 2e395b9db4 updated, added out_degree and num_vertices
[SVN r8731]
2001-01-23 18:02:36 +00:00
Jeremy Siek 09d50f47cd new graph adaptor
[SVN r8729]
2001-01-23 17:09:43 +00:00
Jeremy Siek 5313b59936 moved adjacency_iterator implementation into a separate file
[SVN r8726]
2001-01-23 05:18:06 +00:00
Jeremy Siek 9cd6e0909b changed docs for get_property
[SVN r8723]
2001-01-22 21:46:40 +00:00
Jeremy Siek 13ddcb4eef changed get_property return type to use graph_property
[SVN r8721]
2001-01-22 21:46:09 +00:00
Jeremy Siek 229e724e1f fixed more Comaeu problems
[SVN r8712]
2001-01-22 20:34:22 +00:00
Jeremy Siek be00c4913d added out_degree() to IncidenceGraphConcept and in_degree() to
BidirectionalGraphConcept


[SVN r8711]
2001-01-22 17:16:08 +00:00
Jeremy Siek cd99c65465 finished implementation of max flow
[SVN r8700]
2001-01-22 02:46:05 +00:00
Jeremy Siek 3c7f8e8389 finished max flow example
[SVN r8699]
2001-01-22 02:45:23 +00:00
Jeremy Siek d6d4090450 Comeau fixes
[SVN r8691]
2001-01-21 21:00:10 +00:00
Jeremy Siek dd5e92c262 removed unused variables
[SVN r8687]
2001-01-21 20:19:09 +00:00
Jeremy Siek 0d49f17875 made private default cons, and added copy cons to output_iterator archetype,
some indenting changes to container_traits


[SVN r8681]
2001-01-21 18:50:42 +00:00
Jeremy Siek d5530745fa added property map checks for vertex_index and edge_index
into concept_checks.cpp


[SVN r8647]
2001-01-19 18:20:10 +00:00
Jeremy Siek d7bf176f41 added get() shortcut for edge_list to edge_list.hpp
added ReadablePropertyGraphConcept to graph_concepts.hpp


[SVN r8646]
2001-01-19 18:19:09 +00:00
Jeremy Siek 3571c728c2 removed unnecessary access of ::Directed type from edge_property_map
[SVN r8644]
2001-01-19 16:29:42 +00:00
Jeremy Siek e44bd607c9 added get() function for edge_index property to edge_list classes
[SVN r8643]
2001-01-19 16:28:51 +00:00
Jeremy Siek cb809502f8 added examine_vertex() to fill the old spot of discover_vertex()
[SVN r8637]
2001-01-18 04:07:48 +00:00
Jeremy Siek 19e37ef272 BFS added examine_vertex
[SVN r8635]
2001-01-18 04:06:40 +00:00
Jeremy Siek f85a60382b discover_vertex -> examine_vertex
[SVN r8634]
2001-01-18 04:04:58 +00:00
Jeremy Siek 77e8a3261b added on_examine_vertex
[SVN r8633]
2001-01-18 04:04:23 +00:00
Jeremy Siek 0ab1e60f23 discover_vertex() -> examine_vertex()
[SVN r8632]
2001-01-18 04:01:36 +00:00
Jeremy Siek 81d1a4eb72 got it working
[SVN r8629]
2001-01-17 19:02:25 +00:00
Jeremy Siek a0201de5d1 new file
[SVN r8628]
2001-01-17 19:01:30 +00:00
Jeremy Siek bc020d0f37 first discover_vertex needs to take s
[SVN r8627]
2001-01-17 18:54:56 +00:00
Jeremy Siek 8e736d3a5c indenting
[SVN r8626]
2001-01-17 18:14:06 +00:00
Jeremy Siek ee9cb34524 untabify
[SVN r8625]
2001-01-17 05:53:23 +00:00
Jeremy Siek 25f755aa90 removed start_vertex()
[SVN r8624]
2001-01-17 05:53:22 +00:00
Jeremy Siek d5efa4eac5 discovering vertex v now, not u
[SVN r8623]
2001-01-17 04:27:15 +00:00
Jeremy Siek 1e41917003 changed the location of discover_vertex
[SVN r8622]
2001-01-17 04:26:38 +00:00
Jeremy Siek c9bf3d72eb new file, example use of bfs
[SVN r8621]
2001-01-16 20:24:22 +00:00
Jeremy Siek b85839c838 new file
[SVN r8620]
2001-01-16 19:46:27 +00:00
Jeremy Siek bda0391cf8 just use portable property stule in edge_property.cpp, and go back
to using vecS as edge list in max_flow.cpp, now that it is safe to
do so: edge properties no longer stored directly in the vector.


[SVN r8619]
2001-01-16 02:21:12 +00:00
Jeremy Siek 76a3eaf8b9 a little cleanup
[SVN r8618]
2001-01-16 02:17:18 +00:00
Jeremy Siek bc4436fb64 still under construction
[SVN r8617]
2001-01-16 02:13:20 +00:00
Jeremy Siek 2d1c56c56b get property #ifdef's around the property_num stuff
[SVN r8616]
2001-01-16 02:11:38 +00:00
Jeremy Siek a3f2c25bd9 *** empty log message ***
[SVN r8615]
2001-01-16 02:08:36 +00:00
Jeremy Siek ccf57a4ef3 added some comments
[SVN r8614]
2001-01-16 01:44:10 +00:00
Jeremy Siek faee73eadc removed examine_edge()
[SVN r8613]
2001-01-16 01:35:30 +00:00
Jeremy Siek a13ce4535a cleaned up a few things
[SVN r8612]
2001-01-16 01:30:32 +00:00
Jeremy Siek b2fe5a80e9 fixed resize() of distance_list
[SVN r8611]
2001-01-15 23:29:12 +00:00
Jeremy Siek 403346272e example from stanford graph base
[SVN r8610]
2001-01-15 23:25:56 +00:00
Jeremy Siek ac33db402e fixed vertices(), needed to return an sgb_vertex_iterator
[SVN r8609]
2001-01-15 22:54:20 +00:00
Jeremy Siek c093f45545 changed slistS to listS to make it a portable test
[SVN r8602]
2001-01-15 03:39:30 +00:00
Jeremy Siek 07868b795a opps, property_num is needed
[SVN r8601]
2001-01-15 03:21:36 +00:00
Jeremy Siek 60ca63f417 fixed some warnings under g++
[SVN r8600]
2001-01-15 03:10:11 +00:00
Jeremy Siek 45ad377d31 fixed check_edge_added to properly account for when a parallel edge is added
[SVN r8589]
2001-01-14 01:51:23 +00:00
Jeremy Siek febfcfd580 added std:: to ofstream
[SVN r8588]
2001-01-14 01:31:26 +00:00
Jeremy Siek 5ae3739a7b MIPSpro port
[SVN r8585]
2001-01-14 01:15:10 +00:00
Jeremy Siek 3640e80d37 fixes for SGI MIPSpro C++ and STLport. Mostly had to do with members
being compiled even when they are not called. Still need fixes for
iterator adaptors


[SVN r8583]
2001-01-13 21:51:14 +00:00
Jeremy Siek 38a3312384 no change
[SVN r8582]
2001-01-13 18:25:43 +00:00
Jeremy Siek e6f1759887 added version 2 of add_vertex fo the vec_adj_list
[SVN r8581]
2001-01-13 18:25:24 +00:00
Jeremy Siek f082a7dcf2 added MutablePropertyGraph checks
[SVN r8580]
2001-01-13 18:24:57 +00:00
Jeremy Siek 453e67aba6 added second version of add_vertex()
[SVN r8579]
2001-01-13 18:19:21 +00:00
Jeremy Siek 772e901723 changed add_edge()
[SVN r8578]
2001-01-13 18:14:38 +00:00
Jeremy Siek 79864c4de2 add_edge() now returns a valid edge descriptor whether or not the
edge was added


[SVN r8577]
2001-01-13 18:09:39 +00:00
Jeremy Siek df9b4add99 add_edge() now returns a valid edge descriptor whether or not the
edge is added


[SVN r8576]
2001-01-13 18:08:08 +00:00
Jeremy Siek 10de7f9078 added a property object version of add_vertex()
[SVN r8575]
2001-01-13 17:54:24 +00:00
Jeremy Siek 34632115f7 changed to use property object version of add_vertex()
[SVN r8574]
2001-01-13 17:53:53 +00:00
Jeremy Siek 3fcdd2f793 took out non-portable version of creating custom property
[SVN r8573]
2001-01-13 17:32:36 +00:00
Jeremy Siek 3579cb83af trying to fix blank pdf
[SVN r8572]
2001-01-13 17:05:37 +00:00
Jeremy Siek 9176af4e92 fixed SGI MIPSpro problems
[SVN r8558]
2001-01-12 02:35:36 +00:00
Jeremy Siek acacc9e1c2 added a link to Erdos numbers
[SVN r8549]
2001-01-10 18:59:51 +00:00
Jeremy Siek c4a156e0fe graph arg should have come last
[SVN r8546]
2001-01-10 17:51:08 +00:00
Jeremy Siek 5ffd82ed12 fixed problem in remove_out_edges_if and remove_in_edges_if in the bidir
case, was deleting edge property objects prematurely


[SVN r8545]
2001-01-10 17:03:26 +00:00
Jeremy Siek 6a4400cf97 added clear_vertex example
[SVN r8544]
2001-01-10 17:02:35 +00:00
Jeremy Siek ea61223225 new file
[SVN r8542]
2001-01-10 04:15:07 +00:00
Jeremy Siek 51dbf4868e untabified detail/adjacency_list.hpp
[SVN r8541]
2001-01-10 04:14:31 +00:00
Jeremy Siek f227265694 runs through all posibilities, still needs portability work
[SVN r8540]
2001-01-10 00:33:26 +00:00
Jeremy Siek b2e9983a13 fixed bidir remove edge, and changed in_edges() to given better error
messages when used with directedS graph


[SVN r8539]
2001-01-10 00:29:55 +00:00
Jeremy Siek ec6a1186b1 added edge_index_t
[SVN r8533]
2001-01-08 19:17:08 +00:00
Jeremy Siek 1e5dcbdd06 fixed default constructor for bfs_visitor, etc.
[SVN r8511]
2001-01-03 16:23:43 +00:00
Jeremy Siek 1a29852156 *** empty log message ***
[SVN r8510]
2001-01-03 16:10:18 +00:00
Jeremy Siek 48d486929f working on shortening symbol names
[SVN r8488]
2000-12-22 16:04:09 +00:00
Jeremy Siek fd7f5d5a0e fixed edge_descriptor stability problem for case of EdgeList=vecS by
changing stored_edge_property to hold the properties object by auto_ptr
instead of by value


[SVN r8487]
2000-12-22 15:30:22 +00:00
Jeremy Siek 2d5fcd13e3 cvs makes my head hurt...
[SVN r8484]
2000-12-20 02:42:38 +00:00
Jeremy Siek d62f527dad oops, forgot about the examples/ -> example/ dir name change
[SVN r8483]
2000-12-20 02:41:55 +00:00
Jeremy Siek ef54d3af08 oops, got confused and accidentally re-added these, so now removing again
[SVN r8482]
2000-12-20 02:40:40 +00:00
Jeremy Siek b19244f4f4 fixed mixup in edge direction
[SVN r8481]
2000-12-19 20:53:04 +00:00
Jeremy Siek 80a715d0b0 re-adding these files
[SVN r8480]
2000-12-19 19:30:01 +00:00
Jeremy Siek c674611c22 removed output unless VERBOSE is defined
[SVN r8472]
2000-12-17 21:01:09 +00:00
1790 changed files with 171815 additions and 12303 deletions
+55
View File
@@ -0,0 +1,55 @@
# Copyright (c) 2002 Trustees of Indiana University
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
project boost/graph
: requirements <include>../src
: source-location ../src
;
local optional_sources ;
local optional_reqs ;
if [ modules.peek : EXPAT_INCLUDE ] && [ modules.peek : EXPAT_LIBPATH ]
{
local EXPAT_INCLUDE = [ modules.peek : EXPAT_INCLUDE ] ;
local EXPAT_LIBPATH = [ modules.peek : EXPAT_LIBPATH ] ;
if --debug-configuration in [ modules.peek : ARGV ]
{
ECHO "Expat include directory: $(EXPAT_INCLUDE)" ;
ECHO "Expat library directory: $(EXPAT_LIBPATH)" ;
}
optional_sources += graphml.cpp ;
optional_reqs += <include>$(EXPAT_INCLUDE)
<library-path>$(EXPAT_LIBPATH)
<find-static-library>expat
;
}
else
{
ECHO "warning: Graph library does not contain optional GraphML reader." ;
ECHO "note: to enable GraphML support, set EXPAT_INCLUDE and EXPAT_LIBPATH to the" ;
ECHO "note: directories containing the Expat headers and libraries, respectively." ;
}
lib boost_graph
:
read_graphviz_spirit.cpp
$(optional_sources)
:
<define>BOOST_GRAPH_NO_LIB=1
<link>shared:<define>BOOST_GRAPH_DYN_LINK=1
# # Intel compiler ICEs if we turn optimization on
<toolset>intel-vc71-win-9.1:<optimization>off
# Without these flags, MSVC 7.1 and 8.0 crash
<toolset>msvc-7.1:<cxxflags>-GR-
<toolset>msvc-8.0:<cxxflags>-GR-
# Requirements for any "optional" sources
$(optional_reqs)
;
boost-install boost_graph ;
+138
View File
@@ -0,0 +1,138 @@
<HTML>
<!--
-- Copyright (c) 2004 Kris Beevers
--
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: AStarHeuristic</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1>AStar Heuristic Concept</H1>
This concept defines the interface for the heuristic function of an A*
search, which is responsible for estimating the remaining cost from
some vertex to a goal. The user can create a class that matches this
interface, and then pass objects of the class into <a
href="./astar_search.html"><tt>astar_search()</tt></a> to guide the
order of vertex examination of the search. The heuristic instance
must incorporate any necessary information about goal vertices in the
graph.
For further discussion of the use of heuristics in an A* search, see
the documentation of <a
href="./astar_search.html">astar_search()</a>.
<h3>Refinement of</h3>
<a href="http://www.sgi.com/tech/stl/UnaryFunction.html">Unary
Function</a> (must take a single argument -- a graph vertex -- and
return a cost value) and <a
href="../../utility/CopyConstructible.html">Copy Constructible</a>
(copying a heuristic should be a lightweight operation).
<h3>Notation</h3>
<Table>
<TR>
<TD><tt>H</tt></TD>
<TD>A type that is a model of AStar Heuristic.</TD>
</TR>
<TR>
<TD><tt>h</tt></TD>
<TD>An object of type <tt>H</tt>.</TD>
</TR>
<TR>
<TD><tt>G</tt></TD>
<TD>A type that is a model of Graph.</TD>
</TR>
<TR>
<TD><tt>g</tt></TD>
<TD>An object of type <tt>G</tt>.</TD>
</TR>
<TR>
<TD><tt>u</tt></TD>
<TD>An object of type <tt>boost::graph_traits&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
@@ -0,0 +1,213 @@
<HTML>
<!--
-- Copyright (c) 2004 Kris Beevers
--
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: AStarVisitor</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1>AStar Visitor Concept</H1>
This concept defines the visitor interface for <a
href="./astar_search.html"><tt>astar_search()</tt></a>. Users can
define a class with the AStar Visitor interface and pass an object of
the class to <tt>astar_search()</tt>, thereby augmenting the actions
taken during the graph search.
<h3>Refinement of</h3>
<a href="../../utility/CopyConstructible.html">Copy Constructible</a>
(copying a visitor should be a lightweight operation).
<h3>Notation</h3>
<Table>
<TR>
<TD><tt>V</tt></TD>
<TD>A type that is a model of AStar Visitor.</TD>
</TR>
<TR>
<TD><tt>vis</tt></TD>
<TD>An object of type <tt>V</tt>.</TD>
</TR>
<TR>
<TD><tt>G</tt></TD>
<TD>A type that is a model of Graph.</TD>
</TR>
<TR>
<TD><tt>g</tt></TD>
<TD>An object of type <tt>G</tt>.</TD>
</TR>
<TR>
<TD><tt>e</tt></TD>
<TD>An object of type <tt>boost::graph_traits&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/ReadablePropertyMap.html">Readable Property
Map</a>.</TD>
</TR>
<TR>
<TD><tt>w</tt></TD>
<TD>An object of type <tt>WeightMap</tt>.</TD>
</TR>
</table>
<h3>Associated Types</h3>
none
<p>
<h3>Valid Expressions</h3>
<table border>
<tr>
<th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th>
</tr>
<tr>
<td>Initialize Vertex</td>
<td><tt>vis.initialize_vertex(u, g)</tt></td>
<td><tt>void</tt></td>
<td>
This is invoked on each vertex of the graph when it is first
initialized (i.e., when its property maps are initialized).
</td>
</tr>
<tr>
<td>Discover Vertex</td>
<td><tt>vis.discover_vertex(u, g)</tt></td>
<td><tt>void</tt></td>
<td>
This is invoked when a vertex is first discovered and is added to the
OPEN list.
</td>
</tr>
<tr>
<td>Examine Vertex</td>
<td><tt>vis.examine_vertex(u, g)</tt></td>
<td><tt>void</tt></td>
<td>
This is invoked on a vertex as it is popped from the queue (i.e. it
has the lowest cost on the OPEN list). This happens immediately before
<tt>examine_edge()</tt> is invoked on each of the out-edges of vertex
<tt>u</tt>.
</td>
</tr>
<tr>
<td>Examine Edge</td>
<td><tt>vis.examine_edge(e, g)</tt></td>
<td><tt>void</tt></td>
<td>
This is invoked on every out-edge of each vertex after it is
examined.
</td>
</tr>
<tr>
<td>Edge Relaxed</td>
<td><tt>vis.edge_relaxed(e, g)</tt></td>
<td><tt>void</tt></td>
<td>
Upon examination, if the following condition holds then the edge is
relaxed (the distance of its target vertex is reduced) and this method
is invoked:
<blockquote>
<pre>
tie(u, s) = incident(e, g);
D d_u = get(d, u), d_v = get(d, s);
W w_e = get(w, e);
assert(compare(combine(d_u, w_e), d_s));
</pre>
</blockquote>
</td>
</tr>
<tr>
<td>Edge Not Relaxed</td>
<td><tt>vis.edge_not_relaxed(e, g)</tt></td>
<td><tt>void</tt></td>
<td>
Upon examination, if an edge is not relaxed (see above), then this
method is invoked.
</td>
</tr>
<tr>
<td>Black Target</td>
<td><tt>vis.black_target(e, g)</tt></td>
<td><tt>void</tt></td>
<td>
This is invoked when a vertex that is on the CLOSED list is
``rediscovered'' via a more efficient path, and is re-added to the
OPEN list.
</td>
</tr>
<tr>
<td>Finish Vertex</td>
<td><tt>vis.finish_vertex(u, g)</tt></td>
<td><tt>void</tt></td>
<td>
This is invoked on a vertex when it is added to the CLOSED list, which
happens after all of its out edges have been examined.
</td>
</tr>
</table>
<h3>Models</h3>
<ul>
<li><a href="./astar_visitor.html"><tt>astar_visitor</tt></a>
</ul>
<h3>See also</h3>
<a href="./visitor_concepts.html">Visitor concepts</a>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &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
@@ -0,0 +1,130 @@
<html>
<head>
<!-- Copyright 2007 Aaron Windsor
--
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
--
-->
<title>AddEdgeVisitor Concept</title>
</head>
<body alink="#ff0000"
bgcolor="#ffffff"
link="#0000ee"
text="#000000"
vlink="#551a8b">
<img src="../../../boost.png" alt="C++ Boost" height="86" width="277">
<br clear="">
<h1>AddEdgeVisitor Concept</h1>
The AddEdgeVisitor concept exists to allow for some indirection in algorithms
that modify graphs by adding edges. In such algorithms, it may be convenient
to perform additional operations (such as updating an edge index map) at
points in the algorithm where an edge addition occurs. Replacing calls to
to <tt>add_edge</tt> with calls to <tt>AddEdgeVisitor::visit_vertex_pair</tt>
allows for such operations to be defined independently from the algorithm.
<h3>Notation</h3>
<table>
<tbody>
<tr>
<td> <tt>Visitor</tt> </td>
<td> is a type that models the AddEdgeVisitor concept </td>
</tr>
<tr>
<td> <tt>vis</tt> </td>
<td> is an object of type Visitor </td>
</tr>
<tr>
<td> <tt>Graph</tt> </td>
<td> is the type of a graph </td>
</tr>
<tr>
<td> <tt>u,v</tt> </td>
<td> are objects of type <tt>graph_traits&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/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>
+31 -13
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>AdjacencyGraph</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -61,6 +57,12 @@ vertices, whereas in other contexts the edges are also important.
<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
@@ -82,8 +84,11 @@ href="../../utility/MultiPassInputIterator.html">MultiPassInputIterator</a>.
<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="adjacencygraph.html#1">[1]</a><br>
Return type: <TT>std::pair&lt;adjacency_iterator,&nbsp;adjacency_iterator&gt;</TT>
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>
@@ -95,7 +100,8 @@ 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="./graph_concepts.html">Graph concepts</a>,
<a href="./adjacency_iterator.html"><tt>adjacency_iterator</tt></a>
<H3>Concept Checking Class</H3>
@@ -122,6 +128,18 @@ The <TT>adjacent_vertices()</TT> function must return in constant time.
};
</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>
@@ -142,8 +160,8 @@ experience with graph algorithm implementations.
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+24 -11
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>AdjacencyMatrix</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -37,6 +33,18 @@ concept.
<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>
@@ -57,9 +65,14 @@ consisting of the edge descriptor if the edge was found.
</TR>
</TABLE>
<H3>Complexity guarantees</H3>
The <TT>edge()</TT> function must return in constant time.
<H3>Models</H3>
No models of this concept are currently in the Boost Graph Library.
<a href="./adjacency_matrix.html"><tt>adjacency_matrix</tt></a>
<H3>Concept Checking Class</H3>
@@ -82,8 +95,8 @@ No models of this concept are currently in the Boost Graph Library.
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+55 -36
View File
@@ -2,42 +2,39 @@
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. We make no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: BFSVisitor</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1>BFSVisitor Concept</H1>
<H1><img src="figs/python.gif" alt="(Python)"/>BFS Visitor Concept</H1>
This concept defines the visitor interface for <a
href="./breadth_first_search.html"><tt>breadth_first_search()</tt></a>.
Users can define a class with the BFSVisitor interface and pass and
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>
none
<p>
<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 BFSVisitor.</TD>
<TD>A type that is a model of BFS Visitor.</TD>
</TR>
<TR>
@@ -89,16 +86,6 @@ 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>
@@ -108,6 +95,17 @@ 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>
@@ -128,8 +126,8 @@ form the search tree.</td>
</tr>
<tr>
<td>Cycle Edge</td>
<td><tt>vis.cycle_edge(e, g)</tt></td>
<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
@@ -142,7 +140,7 @@ edges for undirected graphs.
<td><tt>vis.gray_target(e, g)</tt></td>
<td><tt>void</tt></td>
<td>
This is invoked on the subset of cycle edges who's target vertex is
This is invoked on the subset of non-tree edges who's target vertex is
colored gray at the time of examination. The color gray indicates
that the vertex is currently in the queue.
</td>
@@ -153,7 +151,7 @@ that the vertex is currently in the queue.
<td><tt>vis.black_target(e, g)</tt></td>
<td><tt>void</tt></td>
<td>
This is invoked on the subset of cycle edges who's target vertex is
This is invoked on the subset of non-tree edges who's target vertex is
colored black at the time of examination. The color black indicates
that the vertex has been removed from the queue.
</td>
@@ -166,7 +164,7 @@ that the vertex has been removed from the queue.
<td>
This invoked on a vertex after all of its out edges have been added to the
search tree and all of the adjacent vertices have been discovered
(but before their out-edges have been examined).
(but before the out-edges of the adjacent vertices have been examined).
</td>
</tr>
@@ -178,6 +176,27 @@ search tree and all of the adjacent vertices have been discovered
<li><a href="./bfs_visitor.html"><tt>bfs_visitor</tt></a>
</ul>
<a name="python"></a><h3>Python</h3>
To implement a model of the <tt>BFSVisitor</tt> concept in Python,
create a new class that derives from the <tt>BFSVisitor</tt> type of
the graph, which will be
named <tt><i>GraphType</i>.BFSVisitor</tt>. The events and syntax are
the same as with visitors in C++. Here is an example for the
Python <tt>bgl.Graph</tt> graph type:
<pre>
class count_tree_edges_bfs_visitor(bgl.Graph.BFSVisitor):
def __init__(self, name_map):
bgl.Graph.BFSVisitor.__init__(self)
self.name_map = name_map
def tree_edge(self, e, g):
(u, v) = (g.source(e), g.target(e))
print "Tree edge ",
print self.name_map[u],
print " -> ",
print self.name_map[v]
</pre>
<h3>See also</h3>
@@ -187,14 +206,14 @@ search tree and all of the adjacent vertices have been discovered
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
Univ.of Notre Dame (<A
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
Univ.of Notre Dame (<A
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+103
View File
@@ -0,0 +1,103 @@
<HTML>
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
--
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>BasicMatrix</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1><A NAME="concept:BasicMatrix"></A>
BasicMatrix
</H1>
The BasicMatrix concept provides a minimalist interface for
accessing elements from a 2 dimensional table of values.
<H3>Refinement of</H3>
none
<h3>Notation</h3>
<Table>
<TR>
<TD>{<tt>M,I,V</tt>}</TD>
<TD>The matrix, index, and values types that together model the BasicMatrix concept.</TD>
</TR>
<TR>
<TD><tt>A</tt></TD>
<TD>An object of type <tt>M</tt>.</TD>
</TR>
<TR>
<TD><tt>i, j</tt></TD>
<TD>Objects of type <tt>I</tt>.</TD>
</TR>
</table>
<H3>Associated Types</H3>
none
<h3>Valid Expressions</h3>
<Table border>
<tr>
<td><a name="sec:elt-access"><TT>A[i][j]</TT></a></TD>
<TD>Returns a reference to the element object stored at index <tt>(i,j)</tt><br>
Return type: <TT>V&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>
+41 -32
View File
@@ -2,42 +2,38 @@
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. We make no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: BellmanFordVisitor</Title>
<Title>Boost Graph Library: Bellman Ford Visitor</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1>BellmanFordVisitor Concept</H1>
<H1><img src="figs/python.gif" alt="(Python)"/>Bellman Ford Visitor Concept</H1>
This concept defines the visitor interface for <a
href="./bellman_ford_shortest.html"><tt>bellman_ford_shortest_paths()</tt></a>.
Users can define a class with the BellmanFordVisitor interface and
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>
none
<p>
<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 BellmanFordVisitor.</TD>
<TD>A type that is a model of Bellman Ford Visitor.</TD>
</TR>
<TR>
@@ -79,16 +75,6 @@ none
<th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th>
</tr>
<tr>
<td>Initialize Vertex</td>
<td><tt>vis.initialize_vertex(s, g)</tt></td>
<td><tt>void</tt></td>
<td>
This is invoked on every vertex of the graph before the start of the
graph search.
</td>
</tr>
<tr>
<td>Examine Edge</td>
<td><tt>vis.examine_edge(e, g)</tt></td>
@@ -156,19 +142,42 @@ when there is a negative cycle in the graph.
<li><a href="./bellman_visitor.html"><tt>bellman_visitor</tt></a>
</ul>
<a name="python"></a>
<h3>Python</h3>
To implement a model of the <tt>BellmanFordVisitor</tt> concept in Python,
create a new class that derives from the <tt>BellmanFordVisitor</tt> type of
the graph, which will be
named <tt><i>GraphType</i>.BellmanFordVisitor</tt>. The events and syntax are
the same as with visitors in C++. Here is an example for the
Python <tt>bgl.Graph</tt> graph type:
<pre>
class count_tree_edges_bellman_ford_visitor(bgl.Graph.BellmanFordVisitor):
def __init__(self, name_map):
bgl.Graph.BellmanFordVisitor.__init__(self)
self.name_map = name_map
def edge_relaxed(self, e, g):
(u, v) = (g.source(e), g.target(e))
print "Relaxed edge ",
print self.name_map[u],
print " -> ",
print self.name_map[v]
</pre>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
Univ.of Notre Dame (<A
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
Univ.of Notre Dame (<A
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+18 -12
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Bidirectional</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -65,6 +61,12 @@ edges incident to the vertex.
<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
@@ -85,7 +87,11 @@ meet the requirements of <a href="../../utility/MultiPassInputIterator.html">Mul
<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>.<br>
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>
@@ -134,7 +140,7 @@ undirected graphs).
<PRE>
template &lt;class G&gt;
struct BidirectionalGraph_concept
struct BidirectionalGraphConcept
{
typedef typename boost::graph_traits&lt;G&gt;::in_edge_iterator
in_edge_iterator;
@@ -161,8 +167,8 @@ undirected graphs).
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+10 -15
View File
@@ -2,20 +2,16 @@
<!--
-- Copyright (c) Jeremy Siek 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Buffer</Title>
</HEAD>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -49,7 +45,7 @@ For a type to model the Buffer concept it must have the following members.
<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/Technology/STL/Assignable.html">Assignable</a>.</td>
must be <A href="http://www.sgi.com/tech/stl/Assignable.html">Assignable</a>.</td>
</tr>
<tr> <td> <tt>size_type</tt> </td>
@@ -78,7 +74,7 @@ For a type to model the Buffer concept it must have the following members.
Precondition: <tt>empty()</tt> is <tt>false</tt>.</td>
</tr>
<tr> <td> <tt>void size() const</tt> </td>
<tr> <td> <tt>size_type size() const</tt> </td>
<td> Returns the number of objects in the Buffer.
Invariant: <tt>size() >= 0</tt>. </td>
</tr>
@@ -103,9 +99,8 @@ most linear time complexity in the size of the Generalized Queue.
<h3>Models</h3>
<UL>
<LI><a href="http://www.sgi.com/Technology/STL/stack.html"><tt>std::stack</tt></a>
<LI><a href="../../pri_queue/queue.html"><tt>boost::queue</tt></a>
<LI><a href="../../pri_queue/p_queue.html"><tt>boost::priority_queue</tt></a>
<LI><a href="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>
@@ -114,8 +109,8 @@ most linear time complexity in the size of the Generalized Queue.
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame and C++ Library & Compiler Group/SGI (<A HREF="mailto:jsiek@engr.sgi.com">jsiek@engr.sgi.com</A>)
<TD nowrap>Copyright &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>
+17 -21
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. We make no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: ColorValue Concept</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -32,9 +28,9 @@ mark which vertices have been visited.
<P>
<h3>Refinement of</h3> <a
href="http://www.sgi.com/Technology/STL/EqualityComparable.html">EqualityComparable</a>
href="http://www.sgi.com/tech/stl/EqualityComparable.html">EqualityComparable</a>
and <a
href="http://www.sgi.com/Technology/STL/DefaultConstructible.html">DefaultConstructible</a>
href="http://www.sgi.com/tech/stl/DefaultConstructible.html">DefaultConstructible</a>
<h3>Notation</h3>
@@ -62,21 +58,21 @@ href="http://www.sgi.com/Technology/STL/DefaultConstructible.html">DefaultConstr
<tr>
<td>Get Color White </td>
<TD><TT>white(cv)</TT></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>gray(cv)</TT></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>black(cv)</TT></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>
@@ -98,14 +94,14 @@ href="http://www.sgi.com/Technology/STL/DefaultConstructible.html">DefaultConstr
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
Univ.of Notre Dame (<A
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
Univ.of Notre Dame (<A
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+54 -26
View File
@@ -2,42 +2,38 @@
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. We make no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>DFSVisitor</Title>
<Title>DFS Visitor</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1>DFSVisitor Concept</H1>
<H1><img src="figs/python.gif" alt="(Python)"/>DFS Visitor Concept</H1>
This concept defines the visitor interface for <a
href="./depth_first_search.html"><tt>depth_first_search()</tt></a>.
Users can define a class with the DFSVisitor interface and pass and
Users can define a class with the DFS Visitor interface and pass an
object of the class to <tt>depth_first_search()</tt>, thereby
augmenting the actions taken during the graph search.
<h3>Refinement of</h3>
none
<p>
<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 DFSVisitor.</TD>
<TD>A type that is a model of DFS Visitor.</TD>
</TR>
<TR>
@@ -132,7 +128,14 @@ form the search tree.</td>
<td><tt>vis.back_edge(e, g)</tt></td>
<td><tt>void</tt></td>
<td>
This is invoked on the back edges in the graph.
This is invoked on the back edges in the graph. For an undirected
graph there is some ambiguity between tree edges and back edges since
the edge <i>(u,v)</i> and <i>(v,u)</i> are the same edge, but both the
<tt>tree_edge()</tt> and <tt>back_edge()</tt> functions will be
invoked. One way to resolve this ambiguity is to record the tree
edges, and then disregard the back-edges that are already marked as
tree edges. An easy way to record tree edges is to record
predecessors at the <tt>tree_edge</tt> event point.
</td>
</tr>
@@ -151,9 +154,11 @@ undirected graph this method is never called.
<td><tt>vis.finish_vertex(u, g)</tt></td>
<td><tt>void</tt></td>
<td>
This invoked on a vertex after all of its out edges have been added to the
search tree and all of the adjacent vertices have been discovered
(but before their out-edges have been examined).
This is invoked on vertex <tt>u</tt> after <tt>finish_vertex</tt> has
been called for all the vertices in the DFS-tree rooted at vertex
<tt>u</tt>. If vertex <tt>u</tt> is a leaf in the DFS-tree, then
the <tt>finish_vertex</tt> function is call on <tt>u</tt> after
all the out-edges of <tt>u</tt> have been examined.
</td>
</tr>
@@ -165,19 +170,42 @@ search tree and all of the adjacent vertices have been discovered
<li><a href="./dfs_visitor.html"><tt>dfs_visitor</tt></a>
</ul>
<a name="python"></a>
<h3>Python</h3>
To implement a model of the <tt>DFSVisitor</tt> concept in Python,
create a new class that derives from the <tt>DFSVisitor</tt> type of
the graph, which will be
named <tt><i>GraphType</i>.DFSVisitor</tt>. The events and syntax are
the same as with visitors in C++. Here is an example for the
Python <tt>bgl.Graph</tt> graph type:
<pre>
class count_tree_edges_dfs_visitor(bgl.Graph.DFSVisitor):
def __init__(self, name_map):
bgl.Graph.DFSVisitor.__init__(self)
self.name_map = name_map
def tree_edge(self, e, g):
(u, v) = (g.source(e), g.target(e))
print "Tree edge ",
print self.name_map[u],
print " -> ",
print self.name_map[v]
</pre>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
Univ.of Notre Dame (<A
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
Univ.of Notre Dame (<A
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
@@ -2,43 +2,40 @@
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. We make no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: UniformCostVisitor</Title>
<Title>Boost Graph Library: Dijkstra Visitor</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1>UniformCostVisitor Concept</H1>
<H1><img src="figs/python.gif" alt="(Python)"/>Dijkstra Visitor Concept</H1>
This concept defines the visitor interface for <a
href="./uniform_cost_search.html"><tt>uniform_cost_search()</tt></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>uniform_cost_search()</tt> to augment the actions taken during the
search.
<tt>dijkstra_shortest_paths()</tt> to augment the actions taken during
the search.
<h3>Refinement of</h3>
none
<p>
<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 UniformCostVisitor.</TD>
<TD>A type that is a model of Dijkstra Visitor.</TD>
</TR>
<TR>
@@ -68,7 +65,7 @@ none
<TR>
<TD><tt>DistanceMap</tt></TD>
<TD>A type that is a model of <a href="../../property_map/ReadWritePropertyMap.html">ReadWritePropertyMap</a>.</TD>
<TD>A type that is a model of <a href="../../property_map/ReadWritePropertyMap.html">Read/Write Property Map</a>.</TD>
</TR>
<TR>
@@ -78,7 +75,7 @@ none
<TR>
<TD><tt>WeightMap</tt></TD>
<TD>A type that is a model of <a href="../../property_map/ReadWritePropertyMap.html">ReadablePropertyMap</a>.</TD>
<TD>A type that is a model of <a href="../../property_map/ReadWritePropertyMap.html">Readable Property Map</a>.</TD>
</TR>
<TR>
@@ -110,20 +107,13 @@ This is invoked one each vertex of the graph when it is initialized.
</tr>
<tr>
<td>Start Vertex</td>
<td><tt>vis.start_vertex(u, g)</tt></td>
<td>Examine Vertex</td>
<td><tt>vis.examine_vertex(u, g)</tt></td>
<td><tt>void</tt></td>
<td>
This is invoked on the source vertex at the beginning of the algorithm.
</td>
</tr>
<tr>
<td>Discover Vertex</td>
<td><tt>vis.discover_vertex(u, g)</tt></td>
<td><tt>void</tt></td>
<td>
This is invoked when a vertex is encountered for the first time.
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>
@@ -136,6 +126,15 @@ 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>
@@ -178,21 +177,45 @@ search tree and all of the adjacent vertices have been discovered
<h3>Models</h3>
<ul>
<li><a href="./ucs_visitor.html"><tt>ucs_visitor</tt></a>
<li><a href="./dijkstra_visitor.html"><tt>dijkstra_visitor</tt></a>
</ul>
<a name="python"></a>
<h3>Python</h3>
To implement a model of the <tt>DijkstraVisitor</tt> concept in Python,
create a new class that derives from the <tt>DijkstraVisitor</tt> type of
the graph, which will be
named <tt><i>GraphType</i>.DijkstraVisitor</tt>. The events and syntax are
the same as with visitors in C++. Here is an example for the
Python <tt>bgl.Graph</tt> graph type:
<pre>
class count_tree_edges_dijkstra_visitor(bgl.Graph.DijkstraVisitor):
def __init__(self, name_map):
bgl.Graph.DijkstraVisitor.__init__(self)
self.name_map = name_map
def edge_relaxed(self, e, g):
(u, v) = (g.source(e), g.target(e))
print "Relaxed edge ",
print self.name_map[u],
print " -> ",
print self.name_map[v]
</pre>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
Univ.of Notre Dame (<A
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
Univ.of Notre Dame (<A
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+12 -10
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>EdgeListGraph</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -58,6 +54,12 @@ edges in the graph.
<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
@@ -174,8 +176,8 @@ must all return in constant time.
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+108
View File
@@ -0,0 +1,108 @@
<HTML>
<!--
-- Copyright (c) Jeremy Siek 2001
--
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Edge Mutable Graph</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H2><A NAME="concept:EdgeMutableGraph">
Edge Mutable Graph
</H2>
The <I>Edge Mutable Graph</I> concept defines the interface for a
graph that supports the addition and removal of edges.
<H3>Refinement of</H3>
<a href="./Graph.html">Graph</a>
<H3>Associated Types</H3>
No additional associated types.
<h3>Valid Expressions</h3>
<ul>
<li><a name="sec:add_edge"><TT>add_edge(u, v, g)</TT></a>
<b>returns</b> <TT>std::pair&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>
+14 -18
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. We make no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: EventVisitor</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -60,8 +56,8 @@ namespace boost {
<h3>Refinement of</h3>
none
<p>
<a href="../../utility/CopyConstructible.html">Copy Constructible</a>
(copying a visitor should be a lightweight operation).
<h3>Notation</h3>
@@ -151,14 +147,14 @@ either a vertex or edge descriptor of the graph.
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
Univ.of Notre Dame (<A
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
Univ.of Notre Dame (<A
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+12 -16
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. We make no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: EventVisitorList</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -117,14 +113,14 @@ std::make_pair(<i>visitor1</i>,
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
Univ.of Notre Dame (<A
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
Univ.of Notre Dame (<A
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+37 -21
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Graph</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -26,10 +22,9 @@ Graph
<P>
The Graph concept contains a few requirements that are common to all
the graph concepts. These include some associated types for
<tt>vertex_descriptor</tt>, <tt>edge_descriptor</tt>, etc., and the
<tt>num_vertices()</tt> and <tt>num_edges()</tt> functions. One should
<tt>vertex_descriptor</tt>, <tt>edge_descriptor</tt>, etc. One should
note that a model of Graph is <B>not</B> required to be a model of <a
href="http://www.sgi.com/Technology/STL/Assignable.html">Assignable</a>,
href="http://www.sgi.com/tech/stl/Assignable.html">Assignable</a>,
so algorithms should pass graph objects by reference.
<P>
@@ -56,9 +51,9 @@ so algorithms should pass graph objects by reference.
A vertex descriptor corresponds to a unique vertex in an abstract
graph instance. A vertex descriptor must be
<a
href="http://www.sgi.com/Technology/STL/DefaultConstructible.html">DefaultConstructible</a>,
<a href="http://www.sgi.com/Technology/STL/Assignable.html">Assignable</a>, and
<a href="http://www.sgi.com/Technology/STL/EqualityComparable.html">EqualityComparable</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>
@@ -66,16 +61,16 @@ href="http://www.sgi.com/Technology/STL/DefaultConstructible.html">DefaultConstr
<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/Technology/STL/DefaultConstructible.html">DefaultConstructible</I>,
href="http://www.sgi.com/tech/stl/DefaultConstructible.html">Default Constructible</I>,
<a
href="http://www.sgi.com/Technology/STL/Assignable.html">Assignable</a>,
and <a href="http://www.sgi.com/Technology/STL/EqualityComparable.html">EqualityComparable</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>
The choices are <TT>directed_tag</TT> and <TT>undirected_tag</TT>.
This type shall be convertible to <TT>directed_tag</TT> or <TT>undirected_tag</TT>.
</td>
</tr>
@@ -87,12 +82,32 @@ 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>
None required.
<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>
@@ -104,6 +119,7 @@ None required.
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;();
@@ -125,8 +141,8 @@ None required.
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+49 -28
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. We make no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>IncidenceGraph</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -50,8 +46,8 @@ efficient access to the out-edges of each vertex in the graph.
</TR>
<TR>
<TD><tt>v</tt></TD>
<TD>An object of type <tt>boost::graph_traits&lt;G&gt;::vertex_descriptor</tt>.</TD>
<TD><tt>u, v</tt></TD>
<TD>Are objects of type <tt>boost::graph_traits&lt;G&gt;::vertex_descriptor</tt>.</TD>
</TR>
</table>
@@ -60,6 +56,13 @@ efficient access to the out-edges of each vertex in the graph.
<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>
@@ -85,7 +88,7 @@ out-edges or incident edges of a vertex.
<Table border>
<tr>
<td><a name="sec:source"><TT>source(e, g)</TT></a></TD>
<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>
@@ -93,24 +96,29 @@ Return type: <TT>vertex_descriptor</TT>
<tr>
<td><a name="sec:target"><TT>target(e, g)</TT></a></TD>
<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(v, 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>v</TT> in graph <TT>g</TT>.<br>
<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 the 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(v, g)</TT></TD>
<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>v</TT>
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>
@@ -133,6 +141,19 @@ function must be linear in the number of out-edges.
<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>
@@ -144,13 +165,13 @@ function must be linear in the number of out-edges.
function_requires&lt; GraphConcept&lt;G&gt; &gt;();
function_requires&lt; MultiPassInputIteratorConcept&lt;out_edge_iterator&gt; &gt;();
p = out_edges(v, g);
p = out_edges(u, g);
e = *p.first;
u = source(e, g);
v = target(e, g);
}
void const_constraints(const G&amp; g) {
p = out_edges(v, g);
p = out_edges(u, g);
e = *p.first;
u = source(e, g);
v = target(e, g);
@@ -167,14 +188,14 @@ function must be linear in the number of out-edges.
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
Univ.of Notre Dame (<A
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
Univ.of Notre Dame (<A
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+161
View File
@@ -0,0 +1,161 @@
<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>
+101
View File
@@ -0,0 +1,101 @@
# Copyright (c) 2002 Trustees of Indiana University
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
DVIPS = dvips
LATEX = latex
LATEXOUT = dvi
RESULT = ps
LATEX = pdflatex
LATEXOUT = pdf
RESULT = pdf
.SUFFIXES: .tex .dvi .ps .pdf .c .lg .eps .fig .gif .dot .w .cpp .o .exe
.tex.$(LATEXOUT):
@ if test ! -f $*.ind; then echo "" > $*.ind; fi
@ $(LATEX) $*
@ if ( grep 'LaTeX Warning: Label(s) may' $*.log > /dev/null ); \
then $(LATEX) $* ; fi
@ if ( grep 'LaTeX Warning: Citation' $*.log > /dev/null ); \
then bibtex $* ; $(LATEX) $* ; fi
@ if ( grep 'LaTeX Warning: Label(s) may' $*.log > /dev/null ); \
then $(LATEX) $* ; fi
@ if ( grep 'LaTeX Warning: Label(s) may' $*.log > /dev/null ); \
then $(LATEX) $* ; fi
@ if ( grep 'Writing index file' $*.log > /dev/null ); \
then makeindex $* ; $(LATEX) $* ; fi
@ if ( grep 'LaTeX Warning: Label(s) may' $*.log > /dev/null ); \
then $(LATEX) $* ; fi
@ if ( grep 'LaTeX Warning: Label(s) may' $*.log > /dev/null ); \
then $(LATEX) $* ; fi
.dvi.ps:
$(DVIPS) -t letter -o $*.ps $*
.eps.pdf:
epstopdf $*.eps
.dot.eps:
dot -Tps -o $*.eps $*.dot
.w.tex: /afs/nd.edu/user11/jsiek/.jweb
jweb -np $*.w
BOOST = $(HOME)/boost
BOOST_ALGO = $(HOME)/boost.algorithm
CXX = c++
INCLUDES = -I$(BOOST) -I$(BOOST_ALGO)
#OPT = +K2 --display_error_number --diag_suppress=186
OPT = -Wall -Wno-long-double -ftemplate-depth-30
CXXFLAGS = $(OPT) $(INCLUDES)
.cpp.o:
$(CXX) $(CXXFLAGS) $< -c
JWEB = isomorphism-impl.w isomorphism-impl-v3.w
DOT = out.dot in.dot iso-eg.dot iso-eg2.dot
EPS_GEN = $(DOT:.dot=.eps)
WEBTEX = $(JWEB:.w=.tex)
PDFPICT = $(EPS_GEN:.eps=.pdf)
default: isomorphism-impl-v3.$(RESULT)
final: isomorphism-impl-v3.$(RESULT)
$(LATEX) isomorphism-impl-v3
csh ./mungeaux.csh *.aux
$(LATEX) isomorphism-impl-v3
#isomorphism-impl.dvi: $(EPS_GEN) $(WEBTEX)
#isomorphism-impl.ps: isomorphism-impl.dvi
#isomorphism-impl.pdf: $(EPS_GEN) $(PDFPICT) $(WEBTEX)
#isomorphism.hpp: isomorphism-impl.w isomorphism-impl.tex
isomorphism-impl-v3.dvi: $(DOT) $(EPS_GEN) $(WEBTEX)
isomorphism-impl-v3.ps: isomorphism-impl-v3.dvi
isomorphism-impl-v3.pdf: $(EPS_GEN) $(PDFPICT) $(WEBTEX)
isomorphism-v3.hpp: isomorphism-impl-v3.w isomorphism-impl-v3.tex
out.dot: isomorphism-impl.tex
in.dot: isomorphism-impl.tex
isomorphism.o: isomorphism-v3.hpp isomorphism-impl-v3.w
isomorphism: isomorphism.o
$(CXX) $(CXXFLAGS) $< -o $@ $(LIBS)
isomorphism-v3.hpp: isomorphism-impl-v3.tex isomorphism-impl-v3.w
eg1-iso.o: isomorphism-impl-v3.tex isomorphism-impl-v3.w
eg1-iso: eg1-iso.o
$(CXX) $(CXXFLAGS) $< -o $@ $(LIBS)
clean:
rm *.aux *.dvi $(EPS_GEN) $(PDFPICT)
+122
View File
@@ -0,0 +1,122 @@
<HTML>
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2001
--
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Monoid</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1><A NAME="concept:Monoid"></A>
Monoid
</H1>
A <i>Monoid</i> is a concept that describes a simple kind of algebraic
system. A <b>monoid</b> consists of a set of elements <i>S</i>, a
binary operation, and an identity element. The C++ representation of a
monoid consists of a function object that implements the binary
operation, a set of objects that represent the elements of <i>S</i>,
and an object that represents the identity element.
<H3>Refinement of</H3>
The element type must be a model of <a
href="../../utility/Assignable.html">Assignable</a> and <a
href="../../utility/CopyConstructible.html">CopyConstructible</a>.
The function object type must be a model of <a
href="http://www.sgi.com/tech/stl/BinaryFunction.html">BinaryFunction</a>.
<h3>Notation</h3>
<Table>
<TR>
<TD><tt>X</tt></TD>
<TD>Is the element type of the Monoid.</TD>
</TR>
<TR>
<TD><tt>a, b</tt></TD>
<TD>are objects of type <tt>X</tt>.</TD>
</TR>
<TR>
<TD><tt>op</tt></TD>
<TD>Is the function object implementing the Monoid operation.</TD>
</TR>
<TR>
<TD><tt>i</tt></TD>
<TD>is an object of type <tt>X</tt> and is the identity element
for the Monoid.</TD>
</TR>
</table>
<h3>Valid Expressions</h3>
<Table border>
<tr>
<td><a name="sec:source"><TT>op(a,&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>
+20 -13
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>MutableGraph</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -62,7 +58,7 @@ edges and vertices.
<TR>
<TD><tt>p</tt></TD>
<TD>is an object of a type that models <a
href="http://www.sgi.com/Technology/STL/Predicate.html">Predicate</a>
href="http://www.sgi.com/tech/stl/Predicate.html">Predicate</a>
and whose argument type matches the <tt>edge_descriptor</tt> type.
</TR>
@@ -75,7 +71,18 @@ and whose argument type matches the <tt>edge_descriptor</tt> type.
<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.<br>
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>
@@ -84,7 +91,7 @@ Return type: <TT>std::pair&lt;edge_descriptor, bool&gt;</TT>
<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 occurances of
graph allows parallel edges this remove all occurrences of
<i>(u,v)</i>.<br>
Return type: <TT>void</TT><br>
Precondition: <i>u</i> and <i>v</i> are vertices in the graph.<br>
@@ -284,8 +291,8 @@ is no longer a valid vertex descriptor.
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+12 -16
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>MutablePropertyGraph</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -95,16 +91,16 @@ the value of the properties can be given.
<table border>
<tr>
<TD><TT>add_edge(g,&nbsp;u,&nbsp;v,&nbsp;ep)</TT></TD>
<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 property for that edge.<br>
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(g,&nbsp;vp)</TT></TD>
<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
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>
@@ -130,8 +126,8 @@ Return type: <TT>vertex_descriptor</TT>
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(g, vp);
p = add_edge(g, u, v, ep);
v = add_vertex(vp, g);
p = add_edge(u, v, ep, g);
}
G g;
std::pair&lt;edge_descriptor, bool&gt; p;
@@ -146,8 +142,8 @@ Return type: <TT>vertex_descriptor</TT>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+178
View File
@@ -0,0 +1,178 @@
<html><head><!-- Copyright 2007 Aaron Windsor
--
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
--
-->
<title>Planar Embedding Concept</title>
</head>
<body alink="#ff0000"
bgcolor="#ffffff"
link="#0000ee"
text="#000000"
vlink="#551a8b">
<img src="../../../boost.png" alt="C++ Boost" height="86" width="277">
<br clear="">
<h1>Planar Embedding Concept</h1>
A planar embedding is an important intermediate representation of a drawing
of a planar graph. Instead of specifying the absolute positions of the vertices
and edges in the plane, a planar embedding specifies their positions relative
to one another. A planar embedding consists of a sequence, for each vertex in
the graph, of all of the edges incident on that vertex in the order in which
they are to be drawn around that vertex.
<p>
A planar embedding is a refinement of
<a href="../../property_map/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.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
@@ -0,0 +1,148 @@
<HTML>
<!-- Copyright 2007 Aaron Windsor
--
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
--
-->
<HEAD>
<TITLE>Planar Face Visitor Concept</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1>Planar Face Visitor Concept</H1>
This concept defines the visitor interface for
<a href="./planar_face_traversal.html"><tt>planar_face_traversal</tt></a>.
Users can define a class with the Planar Face Visitor interface and pass an
object of the class to <tt>planar_face_traversal</tt>, thereby augmenting the
actions taken during the traversal. Note that objects passed to
<tt>planar_face_traversal</tt> are passed by reference.
<h3>Notation</h3>
<table>
<tbody><tr>
<td><tt>V</tt></td>
<td>A type that is a model of Planar Face Visitor.</td>
</tr>
<tr>
<td><tt>vis</tt></td>
<td>An object of type <tt>V</tt>.</td>
</tr>
<tr>
<td><tt>G</tt></td>
<td>A type that is a model of Graph.</td>
</tr>
<tr>
<td><tt>e</tt></td>
<td>An object of type <tt>boost::graph_traits&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>
+29 -32
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>PropertyGraph</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -70,13 +66,13 @@ function which returns a property map object.
</TR>
<TR>
<TD><tt>Property</tt></TD>
<TD>A type that models the <a href="./Property.html">Property</a> concept.</TD>
<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>Property</tt>.</td>
<TD>An object of type <tt>PropertyTag</tt>.</td>
</TR>
<TR>
@@ -91,17 +87,18 @@ function which returns a property map object.
<table border>
<tr>
<td><pre>boost::property_map&lt;G, Property&gt;::type</pre>
<td><pre>boost::property_map&lt;G, PropertyTag&gt;::type</pre>
The type of the property map for the property specified by
<TT>Property</TT>. This type must be a model of <a
href="../../property_map/ReadWritePropertyMap.html">ReadWritePropertyMap</a> with a key type the same as the graph's vertex or descriptor type.
<TT>PropertyTag</TT>. This type must be a model of <a
href="../../property_map/ReadWritePropertyMap.html">ReadWritePropertyMap</a>
with a key type the same as the graph's vertex or edge descriptor type.
</td>
</tr>
<tr>
<td><pre>boost::property_map&lt;G, Property&gt;::const_type</pre>
<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>Property</TT>. This type must be a model of <a
<TT>PropertyTag</TT>. This type must be a model of <a
href="../../property_map/ReadablePropertyMap.html">ReadablePropertyMap</a>
with a key type the same as the graph's vertex or edge descriptor type.
</td>
@@ -117,16 +114,16 @@ with a key type the same as the graph's vertex or edge descriptor type.
<td> <TT>get(p,&nbsp;g)</TT> </td>
<td>
Returns the property map for the property specified by the
<tt>Property</tt> type. The object <tt>p</tt> is only used to
<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;Property&gt;::type</TT> if <TT>g</TT> is mutable and <br><TT>boost::property_map&lt;G,&nbsp;Property&gt;::const_type</TT> otherwise.
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>Property</tt> type)
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>
@@ -138,7 +135,7 @@ Return type: <tt>boost::property_traits&lt;Map&gt;::value_type</tt>
<tr>
<td> <TT>put(p,&nbsp;g,&nbsp;x,&nbsp;v)</TT> </td>
<td>
Set the property (specified by the <tt>Property</tt> type)
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>
@@ -162,32 +159,32 @@ The <tt>get()</tt> property map function must be constant time.
<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>Property=vertex_distance_t</tt>.</li>
<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>Property=vertex_in_degree_t</tt>.</li>
<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 Property&gt;
template &lt;class Graph, class X, class PropertyTag&gt;
struct PropertyGraphConcept
{
typedef typename property_map&lt;G, Property&gt;::type Map;
typedef typename property_map&lt;G, Property&gt;::const_type const_Map;
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(Property(), g);
pval = get(Property(), g, x);
put(Property(), g, x, pval);
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(Property(), g);
pval = get(Property(), g, x);
const_Map pmap = get(PropertyTag(), g);
pval = get(PropertyTag(), g, x);
ignore_unused_variable_warning(pmap);
}
G g;
@@ -205,8 +202,8 @@ The <tt>get()</tt> property map function must be constant time.
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+34 -22
View File
@@ -2,32 +2,32 @@
<!--
-- Copyright (c) Jeremy Siek 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Property</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H2><A NAME="concept:Property"></A>
Property
<H2><A NAME="concept:PropertyTag"></A>
PropertyTag
</H2>
A Property type is a type used to name or identify properties that are
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.
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>
@@ -35,32 +35,44 @@ property.
<tr>
<td>Property Kind </td>
<td><TT>property_kind&lt;Property&gt;::type</TT> </td>
<td><TT>property_kind&lt;PropertyTag&gt;::type</TT> </td>
<td>
This specifies whether the property is a <a
name="VertexProperty">VertexProperty</a>
name="VertexPropertyTag"><b>Vertex Property Tag</b></a>
(<tt>vertex_property_tag</tt>), an <a
name="EdgeProperty">EdgeProperty</a> (<tt>edge_property_tag</tt>), or
a <a name="GraphProperty">GraphProperty</a> which is attached to the
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>
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/Technology/STL/DefaultConstructible.html">DefaultConstructible</a>
href="http://www.sgi.com/tech/stl/DefaultConstructible.html">Default Constructible</a>
<h3>Models</h3>
The following models of the Property concept are defined
The following models of the Property Tag concept are defined
in <a
href="../../../boost/graph/properties.hpp"><tt>boost/graph/properties.hpp</tt></a>.
@@ -90,15 +102,15 @@ and
On compilers that do not support partial specialization, each Property
type is also required to specialize
<tt>property_num&lt;Property&gt;</tt> to contain an enum named
<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</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+7 -11
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>VertexAndEdgeListGraph</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -52,7 +48,7 @@ requirements are added.
<P>
<PRE>
template &lt;class G&gt;
struct VertexAndEdgeListGraph
struct VertexAndEdgeListGraphConcept
{
void constraints() {
function_requires&lt; VertexListGraphConcept&lt;G&gt; &gt;();
@@ -66,8 +62,8 @@ requirements are added.
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+32 -14
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>VertexListGraph</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -24,18 +20,24 @@
VertexListGraph
</H2>
The VertexListGraph</I> concept refines the <a
href="./AdjacencyGraph.html">AdjacencyGraph</a> concept, and adds the
requirement for efficient traversal of all the vertices in the graph.
The <I>VertexListGraph</I> concept refines the <a
href="./Graph.html">Graph</a> concept, and adds the requirement for
efficient traversal of all the vertices in the graph.
<H3>Refinement of</H3>
<a href="./AdjacencyGraph.html">AdjacencyGraph</a>
<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
@@ -94,6 +96,21 @@ The <TT>vertices()</TT> function must return in constant time.
<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>
@@ -104,6 +121,7 @@ The <TT>vertices()</TT> function must return in constant time.
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;();
@@ -128,8 +146,8 @@ The <TT>vertices()</TT> function must return in constant time.
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+83
View File
@@ -0,0 +1,83 @@
<HTML>
<!--
-- Copyright (c) Jeremy Siek 2001
--
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Vertex Mutable Graph</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H2><A NAME="concept:VertexMutableGraph">
Vertex Mutable Graph
</H2>
A vertex mutable graph can be changed by adding or removing
vertices. The memory management is the responsibility of the graph
implementation. The graph user need only make calls to
<TT>add_vertex</TT> and <TT>remove_vertex</TT> and the graph
implementation does the rest.
<H3>Refinement of</H3>
<a href="./Graph.html">Graph</a> and <a
href="http://www.sgi.com/tech/stl/DefaultConstructible.html">DefaultConstructible</a>
<H3>Associated Types</H3>
No additional associated types.
<h3>Valid Expressions</h3>
<ul>
<li><a name="sec:add_vertex"><TT>add_vertex(g)</TT></a>
<b>returns</b> <TT>vertex_descriptor</TT>
<br><br>
<b>Semantics:</b> Add a new vertex to the graph. The
<TT>vertex_descriptor</TT> for the new vertex is returned.<br>
</li>
<li><a name="sec:remove_vertex"><tt>remove_vertex(u, g)</tt></a>
<b>returns</b> <tt>void</tt><br><br>
<b> Semantics:</b> Remove <i>u</i> from the vertex set of the graph.
<br>
<b> Preconditions:</b> <i>u</i> is a valid vertex descriptor of graph <i>g</i>
and there are no edges incident to vertex <i>u</i>. The function
<TT>clear_vertex</TT> can be used to remove all incident edges.
<br>
<b> Postconditions: </b> <TT>num_vertices(g)</TT> is one less; <i>u</i>
no longer appears in the vertex set of the graph and it
is no longer a valid vertex descriptor.
</li>
</ul>
<H3>Complexity guarantees</H3>
<ul>
<li> Vertex insertion is guaranteed to be amortized constant time.
<li> Vertex removal is at most <TT>O(|E| + |V|)</TT>.
</ul>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &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>
+12 -16
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. We make no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: Acknowledgements</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -66,14 +62,14 @@ Science of the U.S. Department of Energy.
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
Univ.of Notre Dame (<A
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
Univ.of Notre Dame (<A
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+136
View File
@@ -0,0 +1,136 @@
<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>
+276 -170
View File
@@ -2,30 +2,24 @@
<!--
-- Copyright (c) Jeremy Siek 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Jeremy Siek makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: Adjacency List</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1><A NAME="sec:adjacency-list-class"></A>
<pre>
adjacency_list&lt;EdgeList, VertexList, Directed,
adjacency_list&lt;OutEdgeList, VertexList, Directed,
VertexProperties, EdgeProperties,
GraphProperties&gt;
GraphProperties, EdgeList&gt;
</pre>
</H1>
@@ -38,12 +32,25 @@ best meets your needs. An <a
href="graph_theory_review.html#sec:adjacency-list-representation">adjacency-list</a>
is basically a two-dimensional structure, where each element of the
first dimension represents a vertex, and each of the vertices contains
a one-dimensional structure that is its edge list. The
a one-dimensional structure that is its edge list. <a
href="#fig:adj-list-graph">Figure 1</a> shows an adjacency list
representation of a directed graph.
<P></P>
<DIV ALIGN="center"><A NAME="fig:adj-list-graph"></A><A NAME="1509"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 1:</STRONG> Adjacency List Representation of a Directed Graph.</CAPTION>
<TR><TD><IMG SRC="./figs/adj-matrix-graph2.gif" width="386" height="284"></TD>
<TD><IMG SRC="./figs/adj-list2.gif" width="62" height="122"></TD></TR>
</TABLE>
</DIV><P></P>
The
<TT>VertexList</TT> template parameter of the <TT>adjacency_list</TT>
class controls what kind of container is used to represent the outer
two-dimensional container. The <TT>EdgeList</TT> template parameter
two-dimensional container. The <TT>OutEdgeList</TT> template parameter
controls what kind of container is used to represent the edge
lists. The choices for <TT>EdgeList</TT> and <TT>VertexList</TT> will
lists. The choices for <TT>OutEdgeList</TT> and <TT>VertexList</TT> will
determine the space complexity of the graph structure, and will
determine the time complexity of the various graph operations. The
possible choices and tradeoffs are discussed in Section <A
@@ -55,7 +62,18 @@ The <TT>Directed</TT> template parameter controls whether the graph is
directed, undirected, or directed with access to both the in-edges and
out-edges (which we call bidirectional). The bidirectional graph takes
up twice the space (per edge) of a directed graph since each edge will
appear in both an out-edge and in-edge list.
appear in both an out-edge and in-edge list. <a
href="#fig:undir-adj-list-graph">Figure 2</a> shows an adjacency list
representation of an undirected graph.
<P></P>
<DIV ALIGN="center"><A NAME="fig:undir-adj-list-graph"></A><A NAME="1509"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 2:</STRONG> Adjacency List Representation of an Undirected Graph.</CAPTION>
<TR><TD><IMG SRC="./figs/undir-adj-matrix-graph2.gif" width="260" height="240"></TD>
<TD><IMG SRC="./figs/undir-adj-list.gif" width="62" height="122"></TD></TR>
</TABLE>
</DIV><P></P>
<P>
A tutorial on how to use the <TT>adjacency_list</TT> class is in
@@ -67,61 +85,9 @@ Section <A HREF="./using_adjacency_list.html">Using
<H3>Example</H3>
<P>
A graph used to represent a family tree. The complete source code is
in the file <a
href="../example/family_tree.cpp"><tt>examples/family_tree.cpp</tt></a>.
<PRE>
enum { Jeanie, Debbie, Rick, John, Amanda,
Margaret, Benjamin, N };
std::vector&lt;std::string&gt; name(N);
name[Jeanie] = "Jeanie";
name[Debbie] = "Debbie";
name[Rick] = "Rick";
name[John] = "John";
name[Amanda] = "Amanda";
name[Margaret] = "Margaret";
name[Benjamin] = "Benjamin";
adjacency_list&lt;&gt; G(N);
add_edge(Jeanie, Debbie, G);
add_edge(Jeanie, Rick, G);
add_edge(Jeanie, John, G);
add_edge(Debbie, Amanda, G);
add_edge(Rick, Margaret, G);
add_edge(John, Benjamin, G);
graph_traits&lt; adjacency_list&lt;&gt; &gt;::vertex_iterator i, end;
graph_traits&lt; adjacency_list&lt;&gt; &gt;::adjacency_iterator ai, a_end;
property_map&lt;adjacency_list&lt;&gt;, vertex_index_t&gt;::type
id = get(vertex_index, G);
for(tie(i,end) = vertices(G); i != end; ++i) {
cout &lt;&lt; name[get(id, *i)];
tie(ai, a_end) = adjacent_vertices(*i, G);
if (ai == a_end)
cout &lt;&lt; " has no children";
else
cout &lt;&lt; " is the parent of ";
for (; ai != a_end; ++ai)
cout &lt;&lt; name[get(id, *ai)] &lt;&lt; " ";
cout &lt;&lt; endl;
}
</PRE>
The output is:
<PRE>
Jeanie is the parent of Debbie Rick John
Debbie is the parent of Amanda
Rick is the parent of Margaret
John is the parent of Benjamin
Amanda has no children
Margaret has no children
Benjamin has no children
</PRE>
<P>
The example in <a
href="../example/family-tree-eg.cpp"><tt>examples/family-tree-eg.cpp</tt></a>
shows how to represent a family tree with a graph.
<H3>Template Parameters</H3>
@@ -131,7 +97,7 @@ The output is:
<th>Parameter</th><th>Description</th><th>Default</th>
</tr>
<TR><TD><TT>EdgeList</TT></TD>
<TR><TD><TT>OutEdgeList</TT></TD>
<TD>The selector for the container used to represent the
edge-list for each of the vertices.</TD>
<TD><TT>vecS</TT></TD>
@@ -168,6 +134,12 @@ The output is:
<TD><TT>no_property</TT></TD>
</TR>
<TR><TD><TT>EdgeList</TT></TD>
<TD>The selector for the container used to represent the
edge-list for the graph.</TD>
<TD><TT>listS</TT></TD>
</TR>
</TABLE>
<P>
@@ -175,15 +147,20 @@ The output is:
<P>
<a href="./VertexAndEdgeListGraph.html">VertexAndEdgeListGraph</a>,
<a href="./MutablePropertyGraph.html">MutablePropertyGraph</a>
<a href="./MutablePropertyGraph.html">MutablePropertyGraph</a>,
<a href="../../utility/CopyConstructible.html">CopyConstructible</a>,
<a href="../../utility/Assignable.html">Assignable</a>,
and <a href="../../serialization/doc/index.html">Serializable</a>.
<P>
<H3>Where Defined</H3>
<P>
<a href="../../../boost/graph/adjacency_list.hpp"><TT>boost/graph/adjacency_list.hpp</TT></a>
<a href="../../../boost/graph/adjacency_list.hpp"><TT>boost/graph/adjacency_list.hpp</TT></a><br><br>
Also, the serialization functionality is in
<a href="../../../boost/graph/adj_list_serialize.hpp"><tt>boost/graph/adj_list_serialize.hpp</tt></a>.
<P>
<H2>Vertex and Edge Properties</H2>
@@ -199,13 +176,15 @@ HREF="./using_adjacency_list.html#sec:adjacency-list-properties">Internal
Properties </A>. The property maps are objects that implement the
interface defined in Section <A
HREF="../../property_map/property_map.html">Property Map
Concepts</A>. The property maps obtained from a const
<TT>adjacency_list</TT> graph object are models of the <a
href="../../property_map/ReadablePropertyMap.html">ReadablePropertyMap</a>
concept. The property maps obtained from a mutable graph object are
models of the <a
href="../../property_map/ReadWritePropertyMap.html">ReadWritePropertyMap</a>
concept.
Concepts</A> or may be <a href="bundles.html">bundled properties</a>,
which have a more succinct syntax. The types of all property values
must be Copy Constructible, Assignable, and Default Constructible.
The property maps obtained from the
<TT>adjacency_list</TT> class are models of the <a
href="../../property_map/LvaluePropertyMap.html">Lvalue Property
Map</a> concept. If the <TT>adjacency_list</TT> is const,
then the property map is constant, otherwise the property
map is mutable.
<P>
If the <TT>VertexList</TT> of the graph is <TT>vecS</TT>, then the
@@ -214,7 +193,9 @@ the <TT>vertex_index_t</TT> property. The indices fall in the range
<TT>[0, num_vertices(g))</TT> and are contiguous. When a vertex is
removed the indices are adjusted so that they retain these
properties. Some care must be taken when using these indices to access
exterior property storage.
exterior property storage. The property map for vertex index is a
model of <a href="../../property_map/ReadablePropertyMap.html">Readable
Property Map</a>.
<P>
@@ -284,7 +265,7 @@ The stability issue also affects vertex and edge descriptors. For
example, suppose you use vector of vertex descriptors to keep track of
the parents (or predecessors) of vertices in a shortest paths tree
(see <a
href="../example/dijkstra.cpp"><tt>examples/dijkstra.cpp</tt></a>).
href="../example/dijkstra-example.cpp"><tt>examples/dijkstra-example.cpp</tt></a>).
You create the parent vector with a call to
<tt>dijkstra_shortest_paths()</tt>, and then remove a vertex from the
graph. Subsequently you try to use the parent vector, but since all
@@ -294,8 +275,8 @@ vertex descriptors have become invalid, the result is incorrect.
std::vector&lt;Vertex&gt; parent(num_vertices(G));
std::vector&lt;Vertex&gt; distance(num_vertices(G));
dijkstra_shortest_paths(G, s, &amp;distance[0],
make_ucs_visitor(record_predecessors(&amp;parent[0], on_edge_relaxed())));
dijkstra_shortest_paths(G, s, distance_map(&amp;distance[0]).
predecessor_map(&amp;parent[0]));
remove_vertex(s, G); <b>// Bad idea! Invalidates vertex descriptors in parent vector.</b>
@@ -319,16 +300,16 @@ iterators that point to other edges (not <i>(u,v)</i>).
<p>
In general, if you want your vertex and edge descriptors to be stable
(never invalidated) then use <tt>listS</tt> or <tt>setS</tt> for the
<tt>VertexList</tt> and <tt>EdgeList</tt> template parameters of
<tt>VertexList</tt> and <tt>OutEdgeList</tt> template parameters of
<tt>adjacency_list</tt>. If you are not as concerned about descriptor
and iterator stability, and are more concerned about memory
consumption and graph traversal speed, use <tt>vecS</tt> for the
<tt>VertexList</tt> and/or <tt>EdgeList</tt> template parameters.
<tt>VertexList</tt> and/or <tt>OutEdgeList</tt> template parameters.
<p>
The following table summarizes which operations cause descriptors and
iterators to become invalid. In the table, <tt>EL</tt> is an
abbreviation for <tt>EdgeList</tt> and <tt>VL</tt> means
abbreviation for <tt>OutEdgeList</tt> and <tt>VL</tt> means
<tt>VertexList</tt>. The <b>Adj Iter</b> category includes the
<tt>out_edge_iterator</tt>, <tt>in_edge_iterator</tt>, and
<tt>adjacency_iterator</tt> types. A more detailed description of
@@ -373,7 +354,7 @@ align=center><tt>OK</tt></td><td align=center><tt>OK</tt></td>
<br>
and
<br>
<tt>adjacency_list_traits&lt;EdgeList, VertexList, Directed&gt;::vertex_descriptor</tt>
<tt>adjacency_list_traits&lt;OutEdgeList, VertexList, Directed, EdgeList&gt;::vertex_descriptor</tt>
<br><br>
The type for the vertex descriptors associated with the
<TT>adjacency_list</TT>.
@@ -382,7 +363,7 @@ The type for the vertex descriptors associated with the
<tt>graph_traits&lt;adjacency_list&gt;::edge_descriptor</tt><br>
and<br>
<tt>adjacency_list_traits&lt;EdgeList, VertexList, Directed&gt;::edge_descriptor</tt>
<tt>adjacency_list_traits&lt;OutEdgeList, VertexList, Directed, EdgeList&gt;::edge_descriptor</tt>
<br><br>
The type for the edge descriptors associated with the
<TT>adjacency_list</TT>.
@@ -395,9 +376,9 @@ The type for the iterators returned by <TT>vertices()</TT>.
When <tt>VertexList=vecS</tt> then the <tt>vertex_iterator</tt> models
<a
href="http://www.sgi.com/Technology/STL/RandomAccessIterator.html">RandomAccessIterator</a>. Otherwise
href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>. Otherwise
the <tt>vertex_iterator</tt> models <a
href="http://www.sgi.com/Technology/STL/BidirectionalIterator.html">BidirectionalIterator</a>.
href="http://www.sgi.com/tech/stl/BidirectionalIterator.html">BidirectionalIterator</a>.
<hr>
@@ -405,7 +386,7 @@ href="http://www.sgi.com/Technology/STL/BidirectionalIterator.html">Bidirectiona
<br><br>
The type for the iterators returned by <TT>edges()</TT>.
The <tt>edge_iterator</tt> models <a
href="http://www.sgi.com/Technology/STL/BidirectionalIterator.html">BidirectionalIterator</a>.
href="http://www.sgi.com/tech/stl/BidirectionalIterator.html">BidirectionalIterator</a>.
<hr>
@@ -415,14 +396,14 @@ href="http://www.sgi.com/Technology/STL/BidirectionalIterator.html">Bidirectiona
<br><br>
The type for the iterators returned by <TT>out_edges()</TT>.
When <tt>EdgeList=vecS</tt> then the <tt>out_edge_iterator</tt> models
<a href="http://www.sgi.com/Technology/STL/RandomAccessIterator.html">
RandomAccessIterator</a>. When <tt>EdgeList=slistS</tt> then the
When <tt>OutEdgeList=vecS</tt> then the <tt>out_edge_iterator</tt> models
<a href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">
RandomAccessIterator</a>. When <tt>OutEdgeList=slistS</tt> then the
<tt>out_edge_iterator</tt> models <a
href="http://www.sgi.com/Technology/STL/ForwardIterator.html">
href="http://www.sgi.com/tech/stl/ForwardIterator.html">
ForwardIterator</a>. Otherwise the <tt>out_edge_iterator</tt> models
<a
href="http://www.sgi.com/Technology/STL/BidirectionalIterator.html">
href="http://www.sgi.com/tech/stl/BidirectionalIterator.html">
BidirectionalIterator</a>.
<hr>
@@ -434,9 +415,16 @@ The <tt>adjacency_iterator</tt> models the same iterator concept
as <tt>out_edge_iterator</tt>.
<hr>
<tt>adjacency_list::inv_adjacency_iterator</tt>
<br><br>
The type for the iterators returned by <TT>inv_adjacent_vertices()</TT>.
The <tt>inv_adjacency_iterator</tt> models the same iterator concept
as <tt>out_edge_iterator</tt>.
<hr>
<tt>graph_traits&lt;adjacency_list&gt;::directed_category</tt><br>
and<br>
<tt>adjacency_list_traits&lt;EdgeList, VertexList, Directed&gt;::directed_category</tt>
<tt>adjacency_list_traits&lt;OutEdgeList, VertexList, Directed, EdgeList&gt;::directed_category</tt>
<br><br>
Provides information about whether the graph is
directed (<TT>directed_tag</TT>) or undirected
@@ -446,7 +434,7 @@ directed (<TT>directed_tag</TT>) or undirected
<tt>graph_traits&lt;adjacency_list&gt;::edge_parallel_category</tt><br>
and<br>
<tt>adjacency_list_traits&lt;EdgeList, VertexList, Directed&gt;::edge_parallel_category</tt>
<tt>adjacency_list_traits&lt;OutEdgeList, VertexList, Directed, EdgeList&gt;::edge_parallel_category</tt>
<br><br>
This describes whether the graph class allows the insertion of
parallel edges (edges with the same source and target). The two tags
@@ -457,13 +445,17 @@ parallel edges while the others allow parallel edges.
<hr>
<tt>graph_traits&lt;adjacency_list&gt;::vertices_size_type</tt>
<tt>graph_traits&lt;adjacency_list&gt;::vertices_size_type</tt><br>
and<br>
<tt>adjacency_list_traits&lt;OutEdgeList, VertexList, Directed_list, EdgeList&gt;::vertices_size_type</tt><br>
<br><br>
The type used for dealing with the number of vertices in the graph.
<hr>
<tt>graph_traits&lt;adjacency_list&gt;::edge_size_type</tt>
<tt>graph_traits&lt;adjacency_list&gt;::edge_size_type</tt><br>
and<br>
<tt>adjacency_list_traits&lt;OutEdgeList, VertexList, Directed_list, EdgeList&gt;::edge_size_type</tt><br>
<br><br>
The type used for dealing with the number of edges in the graph.
@@ -483,10 +475,40 @@ and<br>
The property map type for vertex or edge properties in the graph. The
specific property is specified by the <TT>Property</TT> template argument,
and must match one of the properties specified in the
<TT>VertexProperty</TT> or <TT>EdgeProperty</TT> for the graph.
<TT>VertexProperties</TT> or <TT>EdgeProperties</TT> for the graph.
<hr>
<tt>graph_property&lt;adjacency_list, Property&gt;::type</tt>
<br><br>
The property value type for the graph property specified by the
<tt>Property</tt> tag.
<hr>
<tt>adjacency_list::out_edge_list_selector</tt>
<br><br>
The type <tt>OutEdgeListS</tt>.
<hr>
<tt>adjacency_list::vertex_list_selector</tt>
<br><br>
The type <tt>VertexListS</tt>.
<hr>
<tt>adjacency_list::directed_selector</tt>
<br><br>
The type <tt>DirectedS</tt>.
<hr>
<tt>adjacency_list::edge_list_selector</tt>
<br><br>
The type <tt>EdgeListS</tt>.
<hr>
<H2>Member Functions</H2>
@@ -527,14 +549,15 @@ Creates a graph object with <TT>n</TT> vertices and zero edges.
<a name="sec:iterator-constructor">
<pre>
template &lt;class&nbsp;EdgeIterator&gt;
adjacency_list(vertices_size_type&nbsp;n,
EdgeIterator&nbsp;first, EdgeIterator&nbsp;last,
adjacency_list(EdgeIterator&nbsp;first, EdgeIterator&nbsp;last,
vertices_size_type&nbsp;n,
edges_size_type&nbsp;m = 0,
const&nbsp;GraphProperty&amp;&nbsp;p&nbsp;=&nbsp;GraphProperty())
</pre>
Creates a graph object with <TT>n</TT> vertices and with the edges
specified in the edge list given by the range <TT>[first, last)</TT>.
The <tt>EdgeIterator</tt> must be a model of <a
href="http://www.sgi.com/Technology/STL/InputIterator.html">InputIterator</a>.
href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>.
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
@@ -545,21 +568,22 @@ range of <TT>[0, n)</TT>.
<pre>
template &lt;class&nbsp;EdgeIterator, class&nbsp;EdgePropertyIterator&gt;
adjacency_list(vertices_size_type&nbsp;num_vertices,
EdgeIterator&nbsp;first, EdgeIterator&nbsp;last,
adjacency_list(EdgeIterator&nbsp;first, EdgeIterator&nbsp;last,
EdgePropertyIterator&nbsp;ep_iter,
vertices_size_type&nbsp;n,
vertices_size_type&nbsp;m = 0,
const&nbsp;GraphProperty&amp;&nbsp;p&nbsp;=&nbsp;GraphProperty())
</pre>
Creates a graph object with <TT>n</TT> vertices and with the edges
specified in the edge list given by the range <TT>[first, last)</TT>.
The <tt>EdgeIterator</tt> and <tt>EdgePropertyIterator</tt> must be a
model of <a
href="http://www.sgi.com/Technology/STL/InputIterator.html">InputIterator</a>.
href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>.
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>.
<TT>ep_iter</TT> should be <TT>EdgeProperties</TT>.
<hr>
@@ -606,22 +630,38 @@ Returns an iterator-range providing access to the edge set of graph
<pre>
std::pair&lt;adjacency_iterator,&nbsp;adjacency_iterator&gt;
adjacent_vertices(vertex_descriptor&nbsp;v, const&nbsp;adjacency_list&amp;&nbsp;g)
adjacent_vertices(vertex_descriptor&nbsp;u, const&nbsp;adjacency_list&amp;&nbsp;g)
</pre>
Returns an iterator-range providing access to the vertices adjacent to
vertex <tt>v</tt> in graph <tt>g</tt>.
vertex <tt>u</tt> in graph <tt>g</tt>. For example, if <tt>u -> v</tt>
is an edge in the graph, then <tt>v</tt> will be in this iterator-range.
<hr>
<pre>
std::pair&lt;inv_adjacency_iterator,&nbsp;inv_adjacency_iterator&gt;
inv_adjacent_vertices(vertex_descriptor&nbsp;u, const&nbsp;adjacency_list&amp;&nbsp;g)
</pre>
Returns an iterator-range providing access to the vertices in graph
<tt>g</tt> to which <tt>u</tt> is adjacent. (<tt>inv</tt> is for
inverse.) For example, if <tt>v -> u</tt> is an edge in the graph,
then <tt>v</tt> will be in this iterator range. This function is only
available for bidirectional and undirected <tt>adjacency_list</tt>'s.
<hr>
<pre>
std::pair&lt;out_edge_iterator,&nbsp;out_edge_iterator&gt;
out_edges(vertex_descriptor&nbsp;v, const&nbsp;adjacency_list&amp;&nbsp;g)
out_edges(vertex_descriptor&nbsp;u, const&nbsp;adjacency_list&amp;&nbsp;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 edge incident on vertex
<tt>v</tt>.
<tt>u</tt> in graph <tt>g</tt>. If the graph is undirected, this
iterator-range provides access to all edges incident on vertex
<tt>u</tt>. For both directed and undirected graphs, for an out-edge
<tt>e</tt>, <tt>source(e, g) == u</tt> and <tt>target(e, g) == v</tt>
where <tt>v</tt> is a vertex adjacent to <tt>u</tt>.
<hr>
@@ -632,7 +672,9 @@ in_edges(vertex_descriptor&nbsp;v, const&nbsp;adjacency_list&amp;&nbsp;g)
Returns an iterator-range providing access to the in-edges of vertex
<tt>v</tt> in graph <tt>g</tt>. This operation is only available if
<TT>bidirectionalS</TT> was specified for the <TT>Directed</TT>
template parameter.
template parameter. For an in-edge <tt>e</tt>, <tt>target(e, g) == v</tt>
and <tt>source(e, g) == u</tt> for some vertex <tt>u</tt> that is
adjacent to <tt>v</tt>, whether the graph is directed or undirected.
<hr>
@@ -700,7 +742,7 @@ std::pair&lt;edge_descriptor, bool&gt;
edge(vertex_descriptor&nbsp;u, vertex_descriptor&nbsp;v,
const&nbsp;adjacency_list&amp;&nbsp;g)
</pre>
Returns the edge connecting vertex <tt>u</tt> to vertex <tt>v</tt> in
Returns an edge connecting vertex <tt>u</tt> to vertex <tt>v</tt> in
graph <tt>g</tt>.
<hr>
@@ -712,7 +754,7 @@ edge_range(vertex_descriptor&nbsp;u, vertex_descriptor&nbsp;v,
</pre>
Returns a pair of out-edge iterators that give the range for
all the parallel edges from <tt>u</tt> to <tt>v</tt>. This
function only works when the <tt>EdgeList</tt> for the
function only works when the <tt>OutEdgeList</tt> for the
<tt>adjacency_list</tt> is a container that sorts the
out edges according to target vertex, and allows for
parallel edges. The <tt>multisetS</tt> selector chooses
@@ -732,16 +774,14 @@ add_edge(vertex_descriptor&nbsp;u, vertex_descriptor&nbsp;v,
Adds edge <i>(u,v)</i> to the graph and returns the edge descriptor
for the new edge. For graphs that do not allow parallel edges, if the
edge is already in the graph then a duplicate will not be added and
the <TT>bool</TT> flag will be <TT>false</TT>. Also, if <i>u</i> and
<i>v</i> are descriptors for the same vertex (creating a self loop)
and the graph is undirected, then the edge will not be added and the
flag will be <TT>false</TT>. When the flag is <TT>false</TT>, the
edge descriptor is invalid and any use of it is undefined.
the <TT>bool</TT> flag will be <TT>false</TT>. When the flag is
<TT>false</TT>, the
returned edge descriptor points to the already existing edge.
<p>
The placement of the new edge in the out-edge list is in general
unspecified, though ordering of the out-edge list can be accomplished
through the choice of <tt>EdgeList</tt>.
through the choice of <tt>OutEdgeList</tt>.
If the <tt>VertexList</tt> selector is
<tt>vecS</tt>, and if either vertex descriptor <tt>u</tt> or
@@ -750,9 +790,9 @@ number of vertices in the graph, the graph is enlarged so that the
number of vertices is <tt>std::max(u,v) + 1</tt>.
<p>
If the <TT>EdgeList</TT> selector is <TT>vecS</TT> then this operation
If the <TT>OutEdgeList</TT> selector is <TT>vecS</TT> then this operation
will invalidate any <tt>out_edge_iterator</tt> for vertex
<i>u</i>. This also applies if the <TT>EdgeList</TT> is a user-defined
<i>u</i>. This also applies if the <TT>OutEdgeList</TT> is a user-defined
container that invalidates its iterators when <TT>push(container,
x)</TT> is invoked (see Section <A
HREF="./using_adjacency_list.html#sec:custom-storage">Customizing the
@@ -768,7 +808,7 @@ then <tt>add_edge()</tt> also invalidates any <tt>edge_iterator</tt>.
<pre>
std::pair&lt;edge_descriptor,&nbsp;bool&gt;
add_edge(vertex_descriptor&nbsp;u, vertex_descriptor&nbsp;v,
const&nbsp;EdgeProperty&amp;&nbsp;p,
const&nbsp;EdgeProperties&amp;&nbsp;p,
adjacency_list&amp;&nbsp;g)
</pre>
Adds edge <i>(u,v)</i> to the graph and attaches <TT>p</TT> as the
@@ -785,7 +825,7 @@ Removes the edge <i>(u,v)</i> from the graph.
<p>
This operation causes any outstanding edge descriptors or iterators
that point to edge <i>(u,v)</i> to become invalid. In addition, if
the <TT>EdgeList</TT> selector is <TT>vecS</TT> then this operation
the <TT>OutEdgeList</TT> selector is <TT>vecS</TT> then this operation
will invalidate any iterators that point into the edge-list for vertex
<i>u</i> and also for vertex <i>v</i> in the undirected and
bidirectional case. Also, for directed graphs this invalidates any
@@ -821,7 +861,7 @@ has time complexity <i>O(E/V)</i>.
<hr>
<pre>
template &lt;class <a href="http://www.sgi.com/Technology/STL/Predicate.html">Predicate</a>&gt;
template &lt;class <a href="http://www.sgi.com/tech/stl/Predicate.html">Predicate</a>&gt;
void remove_out_edge_if(vertex_descriptor u, Predicate predicate,
adjacency_list&amp; g)
</pre>
@@ -836,7 +876,7 @@ invoking <tt>remove_edge()</tt> on each of the removed edges.
<pre>
template &lt;class <a
href="http://www.sgi.com/Technology/STL/Predicate.html">Predicate</a>&gt;
href="http://www.sgi.com/tech/stl/Predicate.html">Predicate</a>&gt;
void remove_in_edge_if(vertex_descriptor v, Predicate predicate,
adjacency_list&amp; g)
</pre>
@@ -854,7 +894,7 @@ This operation is available for undirected and bidirectional
<hr>
<pre>
template &lt;class <a href="http://www.sgi.com/Technology/STL/Predicate.html">Predicate</a>&gt;
template &lt;class <a href="http://www.sgi.com/tech/stl/Predicate.html">Predicate</a>&gt;
void remove_edge_if(Predicate predicate, adjacency_list&amp; g)
</pre>
Removes all edges from the graph that satisfy
@@ -877,6 +917,17 @@ new vertex.
<hr>
<pre>
vertex_descriptor
add_vertex(const&nbsp;VertexProperties&amp;&nbsp;p,
adjacency_list&amp; g)
</pre>
Adds a vertex to the graph with the specified properties. Returns the
vertex descriptor for the new vertex.
</a>
<hr>
<pre>
void clear_vertex(vertex_descriptor u, adjacency_list&amp; g)
</pre>
@@ -889,6 +940,35 @@ the edges that have <tt>u</tt> as the source or target.
<hr>
<pre>
void clear_out_edges(vertex_descriptor u, adjacency_list&amp; g)
</pre>
Removes all out-edges from vertex <i>u</i>. The vertex still appears
in the vertex set of the graph.
<p>
The affect on descriptor and iterator stability is the
same as that of invoking <tt>remove_edge()</tt> for all of
the edges that have <tt>u</tt> as the source.
<p>
This operation is not applicable to undirected graphs
(use <tt>clear_vertex()</tt> instead).
<hr>
<pre>
void clear_in_edges(vertex_descriptor u, adjacency_list&amp; g)
</pre>
Removes all in-edges from vertex <i>u</i>. The vertex still appears
in the vertex set of the graph.
<p>
The affect on descriptor and iterator stability is the
same as that of invoking <tt>remove_edge()</tt> for all of
the edges that have <tt>u</tt> as the target.
<p>
This operation is only applicable to bidirectional graphs.
<hr>
<pre>
void remove_vertex(vertex_descriptor u, adjacency_list&amp; g)
</pre>
@@ -913,73 +993,99 @@ much better choice for the <TT>VertexList</TT> template parameter.
<hr>
<h4>Property Map Access</h4>
<h4><a name="property-map-accessors">Property Map Accessors</a></h4>
<hr>
<pre>
template &lt;class <a href="./Property.html">Property</a>&gt;
property_map&lt;adjacency_list, Property&gt;::type
get(Property, adjacency_list&amp; g)
template &lt;class <a href="./PropertyTag.html">PropertyTag</a>&gt;
property_map&lt;adjacency_list, PropertyTag&gt;::type
get(PropertyTag, adjacency_list&amp; g)
template &lt;class <a href="./Property.html">Property</a>&gt;
template &lt;class <a href="./PropertyTag.html">PropertyTag</a>&gt;
property_map&lt;adjacency_list, Tag&gt;::const_type
get(Property, const adjacency_list&amp; g)
get(PropertyTag, const adjacency_list&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
<TT>PropertyTag</TT>. The <TT>PropertyTag</TT> must match one of the
properties specified in the graph's <TT>VertexProperty</TT> template
argument.
<hr>
<pre>
template &lt;class <a href="./Property.html">Property</a>, class X&gt;
typename property_traits&lt;property_map&lt;adjacency_list, Property&gt;::const_type&gt::value_type
get(Property, const adjacency_list&amp; g, X x)
template &lt;class <a href="./PropertyTag.html">PropertyTag</a>, class X&gt;
typename property_traits&lt;property_map&lt;adjacency_list, PropertyTag&gt;::const_type&gt::value_type
get(PropertyTag, const adjacency_list&amp; g, X x)
</pre>
This returns the property value for <tt>x</tt>, where <tt>x</tt> is either
a vertex or edge descriptor.
<hr>
<pre>
template &lt;class <a href="./Property.html">Property</a>, class X, class Value&gt;
template &lt;class <a href="./PropertyTag.html">PropertyTag</a>, class X, class Value&gt;
void
put(Property, const adjacency_list&amp; g, X x, const Value& value)
put(PropertyTag, const adjacency_list&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_list, Property&gt;::type&gt::value_type</tt>
<tt>typename property_traits&lt;property_map&lt;adjacency_list, PropertyTag&gt;::type&gt::value_type</tt>
<hr>
<pre>
template &lt;class GraphProperties, class <a href="./Property.html#GraphProperty">GraphProperty</a>&gt;
typename property_value&lt;GraphProperties, GraphProperty&gt;::type&amp;
get_property(adjacency_list&amp; g, GraphProperty);
template &lt;class GraphProperties, class <a href="./PropertyTag.html#GraphPropertyTag">GraphPropertyTag</a>&gt;
typename graph_property&lt;adjacency_list, GraphPropertyTag&gt;::type&amp;
get_property(adjacency_list&amp; g, GraphPropertyTag);
</pre>
Return the property specified by <tt>GraphProperty</tt> that is
attached to the graph object <tt>g</tt>. The <tt>property_value</tt>
Return the property specified by <tt>GraphPropertyTag</tt> that is
attached to the graph object <tt>g</tt>. The <tt>graph_property</tt>
traits class is defined in <a
href="../../../boost/pending/property.hpp"><tt>boost/pending/property.hpp</tt></a>.
href="../../../boost/graph/adjacency_list.hpp"><tt>boost/graph/adjacency_list.hpp</tt></a>.
<hr>
<pre>
template &lt;class GraphProperties, class <a href="./Property.html#GraphProperty">GraphProperty</a>&gt;
const typename property_value&lt;GraphProperties, GraphProperty&gt;::type&amp;
get_property(const adjacency_list&amp; g, GraphProperty);
template &lt;class GraphProperties, class <a href="./PropertyTag.html#GraphPropertyTag">GraphPropertyTag</a>&gt;
const typename graph_property&lt;adjacency_list, GraphPropertyTag&gt;::type&amp;
get_property(const adjacency_list&amp; g, GraphPropertyTag);
</pre>
Return the property specified by <tt>GraphProperty</tt> that is
attached to the graph object <tt>g</tt>. The <tt>property_value</tt>
Return the property specified by <tt>GraphPropertyTag</tt> that is
attached to the graph object <tt>g</tt>. The <tt>graph_property</tt>
traits class is defined in <a
href="../../../boost/pending/property.hpp"><tt>boost/pending/property.hpp</tt></a>.
<hr>
href="../../../boost/graph/adjacency_list.hpp"><tt>boost/graph/adjacency_list.hpp</tt></a>.
<!-- add the shortcut property functions -->
<hr>
<h4><a name="serialization">Serialization</a></h4>
<hr>
<pre>
template&lt;class <a href="../../serialization/doc/archives.html#saving_interface">SavingArchive</a>&gt;
SavingArchive&amp; operator<<(SavingArchive&amp; ar, const adjacency_list&amp graph);
</pre>
Serializes the graph into the archive. Requires the vertex and edge properties of the
graph to be <a href="../../serialization/doc/index.html">Serializable</a>.
<br>
Include <a href="../../../boost/graph/adj_list_serialize.hpp"><tt>boost/graph/adj_list_serialize.hpp</tt></a>.
<hr>
<pre>
template&lt;class <a href="../../serialization/doc/archives.html#loading_interface">LoadingArchive</a>&gt;
LoadingArchive&amp; operator>>(LoadingArchive&amp; ar, const adjacency_list&amp graph);
</pre>
Reads the graph from the archive. Requires the vertex and edge properties of the
graph to be <a href="../../serialization/doc/index.html">Serializable</a>.
<br>
Include <a href="../../../boost/graph/adj_list_serialize.hpp"><tt>boost/graph/adj_list_serialize.hpp</tt></a>.
<hr>
<h3>See Also</h3>
@@ -993,21 +1099,21 @@ href="../../../boost/pending/property.hpp"><tt>boost/pending/property.hpp</tt></
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
Univ.of Notre Dame (<A
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
Univ.of Notre Dame (<A
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
<!-- LocalWords: gif ALT EdgeList VertexList html VertexProperty EdgeProperty
<!-- LocalWords: gif ALT OutEdgeList EdgeList VertexList html VertexProperties EdgeProperties
-->
<!-- LocalWords: GraphProperty cpp enum ai cout endl VertexAndEdgeListGraph
<!-- LocalWords: GraphPropertyTag cpp enum ai cout endl VertexAndEdgeListGraph
-->
<!-- LocalWords: MutablePropertyGraph hpp const ReadablePropertyMap listS num
-->
+14 -18
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. We make no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: Graph Traits</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -83,8 +79,8 @@ The selector type whether the graph is directed or undirected.
<h3>Model of</h3>
<a
href="http://www.sgi.com/Technology/STL/DefaultConstructible.html">DefaultConstructible</a> and
<a href="http://www.sgi.com/Technology/STL/Assignable.html">Assignable</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>
@@ -148,14 +144,14 @@ parallel edges (<tt>disallow_parallel_edge_tag</tt>).
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
Univ.of Notre Dame (<A
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
Univ.of Notre Dame (<A
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+584
View File
@@ -0,0 +1,584 @@
<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><A NAME="1509"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 1:</STRONG> Adjacency Matrix Representation of a Directed Graph.</CAPTION>
<TR><TD><IMG SRC="./figs/adj-matrix-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><A NAME="1509"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 1:</STRONG> Adjacency Matrix Representation of an Undirected Graph.</CAPTION>
<TR><TD><IMG SRC="./figs/undir-adj-matrix-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>Associates 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>
+96
View File
@@ -0,0 +1,96 @@
<HTML>
<!--
-- Copyright (c) 2004 Kris Beevers
--
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: astar_heuristic</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1>
<pre>
astar_heuristic&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>
+477
View File
@@ -0,0 +1,477 @@
<HTML>
<!--
-- Copyright (c) 2004 Kris Beevers
--
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: A* Heuristic Search</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1><A NAME="sec:astar"></A>
<TT>astar_search</TT>
</H1>
<P>
<PRE>
<i>// Named parameter interface</i>
template &lt;typename VertexListGraph,
typename AStarHeuristic,
typename P, typename T, typename R&gt;
void
astar_search
(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
(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);
</PRE>
<P>
This algorithm implements a heuristic search on a weighted, directed
or undirected graph for the case where all edge weights are
non-negative.
</P>
<P>
The A* algorithm is a <i>heuristic graph search algorithm</i>: an A*
search is "guided" by a <i>heuristic function</i>. A heuristic
function <i>h(v)</i> is one which estimates the cost from a non-goal
state (<i>v</i>) in the graph to some goal state, <i>g</i>.
Intuitively, A* follows paths (through the graph) to the goal that are
estimated by the heuristic function to be the best paths. Unlike
best-first search, A* takes into account the known cost from the start
of the search to <i>v</i>; the paths A* takes are guided by a function
<i>f(v) = g(v) + h(v)</i>, where <i>h(v)</i> is the heuristic
function, and <i>g(v)</i> (sometimes denoted <i>c(s, v)</i>) is the
known cost from the start to <i>v</i>. Clearly, the efficiency of A*
is highly dependent on the heuristic function with which it is used.
</P>
<P>
The A* algorithm is very similar to Dijkstra's Shortest Paths
algorithm. This implementation finds all the shortest paths from the
start vertex to every other vertex by creating a search tree,
examining vertices according to their remaining cost to some goal, as
estimated by a heuristic function. Most commonly, A* is used to find
some specific goal vertex or vertices in a graph, after which the
search is terminated.
</P>
<P>
A* is particularly useful for searching <i>implicit</i> graphs.
Implicit graphs are graphs that are not completely known at the
beginning of the search. Upon visiting a vertex, its neighbors are
"generated" and added to the search. Implicit graphs are particularly
useful for searching large state spaces -- in gameplaying scenarios
(e.g. chess), for example -- in which it may not be possible to store
the entire graph. Implicit searches can be performed with this
implementation of A* by creating special visitors that generate
neighbors of newly-expanded vertices.
</P>
<P>
This implementation of A* is based on an OPEN/CLOSED list formulation
of the algorithm. Vertices on the OPEN list have been ``discovered''
by the algorithm, but not ``expanded'' (we have not discovered their
adjacent vertices). Vertices on the CLOSED list have been completely
examined by our search (we have expanded them and added their children
to the OPEN list). Vertices that are on neither list have not been
encountered in any context so far in our search. A major advantage of
this formulation of the A* algorithm over other approaches is that it
avoids ``cycles'' in the state space; the search will not become
trapped by loops in the graph. The OPEN/CLOSED lists are implemented
using BGL's vertex coloring mechanisms. Vertices in OPEN are colored
gray, vertices in CLOSED are colored black, and undiscovered vertices
are colored white.
</P>
<P>
The criteria for expanding a vertex on the OPEN list is that it has
the lowest <i>f(v) = g(v) + h(v)</i> value of all vertices on OPEN.
Cost information about vertices is stored in a property map.
</P>
<P>
The following is the pseudocode for the A* heuristic search algorithm.
In the pseudocode, <i>h</i> is the heuristic function, <i>w</i> is the
edge weight, <i>d</i> is the distance of a vertex from <i>s</i>, and
<i>Q</i> is a priority queue, sorted by <i>f</i>, the estimated cost
to the goal of the path through a vertex. <i>p</i> is a predecessor
map. The visitor event points for the algorithm are indicated by the
labels on the right.
</P>
<table>
<tr>
<td valign="top">
<pre>
A*(<i>G</i>, <i>s</i>, <i>h</i>)
<b>for</b> each vertex <i>u in V</i>
<i>d[u] := f[u] := infinity</i>
<i>color[u] :=</i> WHITE
<i>p[u] := u</i>
<b>end for</b>
<i>color[s] :=</i> GRAY
<i>d[s] := 0</i>
<i>f[s] := h(s)</i>
INSERT(<i>Q, s</i>)
<b>while</b> (<i>Q != &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>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 the <a
href="VertexListGraph.html">
Vertex List Graph</a> concept.
</blockquote>
IN: <tt>vertex_descriptor s</tt>
<blockquote>
The start vertex for the search. All distances will be calculated
from this vertex, and the shortest paths tree (recorded in the
predecessor map) will be rooted at this vertex.
</blockquote>
IN: <tt>AStarHeuristic h</tt>
<blockquote>
The heuristic function that guides the search. The type
<tt>AStarHeuristic</tt> must be a model of the <a href="AStarHeuristic.html">AStarHeuristic</a>
concept.
</blockquote>
<h3>Named Parameters</h3>
IN: <tt>weight_map(WeightMap w_map)</tt>
<blockquote>
The weight or ``length'' of each edge in the graph. The weights
must all be non-negative; the algorithm will throw a <a
href="./exception.html#negative_edge"><tt>negative_edge</tt></a>
exception if one of the edges is negative. The type
<tt>WeightMap</tt> must be a model of <a
href="../../property_map/ReadablePropertyMap.html"><tt>Readable
Property Map</tt></a>. The edge descriptor type of the graph needs
to be usable as the key type for the weight map. The value type
for this map must be the same as the value type of the distance
map.<br>
<b>Default:</b> <tt>get(edge\_weight, g)</tt>
</blockquote>
IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
<blockquote>
This maps each vertex to an integer in the range <tt>[0,
num_vertices(g))</tt>. This is necessary for efficient updates of
the heap data structure when an edge is relaxed. The type
<tt>VertexIndexMap</tt> must be a model of <a
href="../../property_map/ReadablePropertyMap.html"><tt>Readable
Property Map</tt></a>. The value type of the map must be an integer
type. The vertex descriptor type of the graph needs to be usable as
the key type of the map.<br>
<b>Default:</b> <tt>get(vertex_index, g)</tt>.
Note: if you use this default, make sure your graph has
an internal <tt>vertex_index</tt> property. For example,
<tt>adjacenty_list</tt> with <tt>VertexList=listS</tt> does
not have an internal <tt>vertex_index</tt> property.
</blockquote>
OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
<blockquote>
The predecessor map records the edges in the minimum spanning tree.
Upon completion of the algorithm, the edges <tt>(p[u],u)</tt> for
all <tt>u</tt> in <tt>V</tt> are in the minimum spanning tree. If
<tt>p[u] = u</tt> then <tt>u</tt> is either the start vertex or a
vertex that is not reachable from the start. The
<tt>PredecessorMap</tt> type must be a <a
href="../../property_map/ReadWritePropertyMap.html"><tt>Read/Write
Property Map</tt></a> with key and vertex types the same as the
vertex descriptor type of the graph.<br>
<b>Default:</b> <tt>dummy_property_map</tt>
</blockquote>
UTIL/OUT: <tt>distance_map(DistanceMap d_map)</tt>
<blockquote>
The shortest path weight from the start vertex <tt>s</tt> to each
vertex in the graph <tt>g</tt> is recorded in this property map.
The shortest path weight is the sum of the edge weights along the
shortest path. The type <tt>DistanceMap</tt> must be a model of <a
href="../../property_map/ReadWritePropertyMap.html"><tt>Read/Write
Property Map</tt></a>. The vertex descriptor type of the graph
needs to be usable as the key type of the distance map. The value
type of the distance map is the element type of a <a
href="./Monoid.html"><tt>Monoid</tt></a> formed with the
<tt>combine</tt> function object and the zero object for the
identity element. Also the distance value type must have a <a
href="http://www.sgi.com/tech/stl/StrictWeakOrdering.html"><tt>StrictWeakOrdering</tt></a>
provided by the <tt>compare</tt> function object.<br>
<b>Default:</b> <tt>iterator_property_map</tt> created from a
<tt>std::vector</tt> with the same value type as the
<tt>WeightMap</tt>, and of size <tt>num_vertices(g)</tt>, and using
the <tt>i_map</tt> for the index map.
</blockquote>
UTIL/OUT: <tt>rank_map(CostMap c_map)</tt>
<blockquote>
The <i>f</i>-value for each vertex. The <i>f</i>-value is defined
as the sum of the cost to get to a vertex from the start vertex, and
the estimated cost (as returned by the heuristic function
<tt>h</tt>) from the vertex to a goal. The type <tt>CostMap</tt>
must be a model of <a
href="../../property_map/ReadWritePropertyMap.html"><tt>Read/Write
Property Map</tt></a>. The vertex descriptor type of the graph
needs to be usable as the key type of the distance map. The value
type of the distance map is the element type of a <a
href="./Monoid.html"><tt>Monoid</tt></a> formed with the
<tt>combine</tt> function object and the zero object for the
identity element. Also the distance value type must have a <a
href="http://www.sgi.com/tech/stl/StrictWeakOrdering.html"><tt>StrictWeakOrdering</tt></a>
provided by the <tt>compare</tt> function object. The value type
for this map must be the same as the value type for the distance
map.<br>
<b>Default:</b> <tt>iterator_property_map</tt> created from a
<tt>std::vector</tt> with the same value type as the
<tt>WeightMap</tt>, and of size <tt>num_vertices(g)</tt>, and using
the <tt>i_map</tt> for the index map.
</blockquote>
UTIL/OUT: <tt>color_map(ColorMap c_map)</tt>
<blockquote>
This is used during the execution of the algorithm to mark the
vertices, indicating whether they are on the OPEN or CLOSED lists.
The vertices start out white and become gray when they are inserted
into the OPEN list. They then turn black when they are examined and
placed on the CLOSED list. At the end of the algorithm, vertices
reachable from the source vertex will have been colored black. All
other vertices will still be white. The type <tt>ColorMap</tt> must
be a model of <a
href="../../property_map/ReadWritePropertyMap.html"><tt>Read/Write
Property Map</tt></a>. A vertex descriptor must be usable as the
key type of the map, and the value type of the map must be a model
of <a href="./ColorValue.html"><tt>Color Value</tt></a>.<br>
<b>Default:</b> <tt>iterator_property_map</tt> created from a
<tt>std::vector</tt> of value type <tt>default_color_type</tt>, with
size <tt>num_vertices(g)</tt>, and using the <tt>i_map</tt> for the
index map.
</blockquote>
IN: <tt>distance_compare(CompareFunction cmp)</tt>
<blockquote>
This function is use to compare distances to determine which vertex
is closer to the start vertex, and to compare <i>f</i>-values to
determine which vertex on the OPEN list to examine next. The
<tt>CompareFunction</tt> type must be a model of <a
href="http://www.sgi.com/tech/stl/BinaryPredicate.html"><tt>Binary
Predicate</tt></a> and have argument types that match the value type
of the <tt>DistanceMap</tt> property map.<br>
<b>Default:</b> <tt>std::less&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) < 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
@@ -0,0 +1,108 @@
<HTML>
<!--
-- Copyright (c) 2004 Kris Beevers
--
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: astar_visitor</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1>
<pre>
astar_visitor&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
@@ -0,0 +1,6 @@
\DeclareOption{awpaper}
{\setlength\paperheight {9.25in}%
\setlength\paperwidth {7.375in}}
\DeclareOption*{\PassOptonsToPackage{\CurrentOption}{newsiambook}}
\ProcessOptions
\ExecuteOptions{awpaper}
+93
View File
@@ -0,0 +1,93 @@
<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
@@ -0,0 +1,151 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--
-- Copyright (c) 2004 Trustees of Indiana University
--
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<html>
<head>
<meta name="generator" content=
"HTML Tidy for Mac OS X (vers 12 April 2005), see www.w3.org">
<meta http-equiv="Content-Type" content=
"text/html; charset=us-ascii">
<title>Function betweenness_centrality_clustering</title>
</head>
<body>
<div class="titlepage"></div>
<div class="refnamediv">
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<h1><img src="figs/python.gif" alt="(Python)"/><span class="refentrytitle">Function
betweenness_centrality_clustering</span></h1>
<p>boost::betweenness_centrality_clustering &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 compute the edge betweenness centrality (via <a href=
"betweenness_centrality.html">brandes_betweenness_centrality</a>) and
removes the edge with the maximum betweenness centrality. The
<tt class="computeroutput">done</tt> function object determines
when the algorithm terminates (the edge found when the algorithm
terminates will not be removed).</p>
<h2>Parameters</h2>
IN: <tt>const Graph&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/ReadWritePropertyMap.html">Read/Write
Property Map</a>, with the graph's edge descriptor type as its key
type. The value type of this property map should be the same as the
value type of the <tt>CentralityMap</tt> property map.<br>
<b>Default:</b> a <tt>dummy_property_map</tt>, which requires no
work to compute and returns no answer.<br>
<b>Python</b>: The color map must be a <tt>edge_double_map</tt> for
the graph.<br>
<b>Python default</b>: <tt>graph.get_edge_double_map("centrality")</tt>
</blockquote>
IN: <tt>VertexIndexMap vertex_index</tt>
<blockquote>
This maps each vertex to an integer in the range <tt>[0,
num_vertices(g))</tt>. This is necessary for efficient updates of the
heap data structure when an edge is relaxed. The type
<tt>VertexIndexMap</tt> must be a model of
<a href="../../property_map/ReadablePropertyMap.html">Readable Property Map</a>. The value type of the map must be an
integer type. The vertex descriptor type of the graph needs to be
usable as the key type of the map.<br>
<b>Default:</b> <tt>get(vertex_index, g)</tt>.
Note: if you use this default, make sure your graph has
an internal <tt>vertex_index</tt> property. For example,
<tt>adjacenty_list</tt> with <tt>VertexList=listS</tt> does
not have an internal <tt>vertex_index</tt> property.<br>
<b>Python</b>: Unsupported parameter.
</blockquote>
<table xmlns:rev=
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width=
"100%">
<tr>
<td align="left"></td>
<td align="right"></td>
</tr>
</table>
<h3>Where Defined</h3>
&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>
+291 -122
View File
@@ -2,59 +2,43 @@
<!--
-- Copyright (c) Jeremy Siek 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Bellman Ford Shortest Paths</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1><A NAME="sec:bellman-ford"></A>
<H1><A NAME="sec:bellman-ford"></A><img src="figs/python.gif" alt="(Python)"/>
<TT>bellman_ford_shortest_paths</TT>
</H1>
<P>
<DIV ALIGN="left">
<TABLE CELLPADDING=3 border>
<TR><TH ALIGN="LEFT"><B>Graphs:</B></TH>
<TD ALIGN="LEFT">directed or undirected</TD>
</TR>
<TR><TH ALIGN="LEFT"><B>Properties:</B></TH>
<TD ALIGN="LEFT">distance, weight</TD>
</TR>
<TR><TH ALIGN="LEFT"><B>Complexity:</B></TH>
<TD ALIGN="LEFT"><i>O(V E)</i></TD>
</TR>
<TR><TH ALIGN="LEFT"><B>Where Defined:</B></TH>
<TD ALIGN="LEFT">
<a href="../../../boost/graph/bellman_ford_shortest_paths.hpp"><TT>boost/graph/bellman_ford_shortest_paths.hpp</TT></a>
</TD>
</TR></TABLE>
</DIV>
<P>
<PRE>
(1)
template &lt;class <a href="./EdgeListGraph.html">EdgeListGraph</a>, class Size, class WeightMap, class DistanceMap&gt;
bool bellman_ford_shortest_paths(EdgeListGraph&amp; g, Size N,
WeightMap w, DistanceMap d)
<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>);
(2)
template &lt;class <a href="./EdgeListGraph.html">EdgeListGraph</a>, class Size, class WeightMap, class DistanceMap,
class <a href="./BellmanFordVisitor.html">BellmanFordVisitor</a>&gt;
bool bellman_ford_shortest_paths(EdgeListGraph&amp; g, Size N, WeightMap w,
DistanceMap d, BellmanFordVisitor visit)
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>
@@ -64,48 +48,250 @@ 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. See Section <A
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> for a description of the single-source shortest paths
problem. If a cycle with negative length is detected, the algorithm
returns <TT>false</TT>. The argument <TT>N</TT> should be the number
of vertices in the graph. The source vertex is indicated by
initializing the distance of the source vertex to zero and the
distances of the rest of the vertices to
<TT>std::numeric_limits&lt;T&gt;::max()</TT>.
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>Requirements on Types</H3>
<h3>Parameters</h3>
<P>
<UL>
<LI>The type <TT>EdgeListGraph</TT> must be a model of
<a href="./EdgeListGraph.html">EdgeListGraph</a>.
</LI>
<LI>The type <TT>Distance</TT> must be a model of <a
href="../../property_map/ReadWritePropertyMap.html">ReadWritePropertyMap</a>. The
vertex descriptor type of the graph needs to be usable as the key
type of the distance map. The value type of the distance
map must be <a
href="http://www.sgi.com/Technology/STL/LessThanComparable.html">LessThanComparable</a>.
</LI>
<LI>The <TT>Weight</TT> type must be a model of
<a href="../../property_map/ReadablePropertyMap.html">ReadablePropertyMap</a>.
The edge descriptor of the graph needs to be usable as the key
type for the weight map. The value type for the
weight map must be <I>Addable</I> with the
distance map's value type.
</LI>
<LI>The <TT>Parent</TT> type must be a model of <a
href="../../property_map/ReadWritePropertyMap.html">ReadWritePropertyMap</a>. The
value type and key type should be the graph's vertex descriptor
type.
</LI>
<LI>The type <TT>BellmanFordVisitor</TT> must be a model of <a href="./BellmanFordVisitor.html">BellmanFordVisitor</a>.
</LI>
</UL>
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/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/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/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>
@@ -114,66 +300,49 @@ distances of the rest of the vertices to
<P>
The time complexity is <i>O(V E)</i>.
<P>
<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>
The source code for this example is in <a
href="../example/bellman_ford.cpp"><TT>examples/bellman_ford.cpp</TT></a>.
An example of using the Bellman-Ford algorithm is in <a
href="../example/bellman-example.cpp"><TT>examples/bellman-example.cpp</TT></a>.
<P>
<PRE>
enum { u, v, x, y, z, N };
char name[] = { 'u', 'v', 'x', 'y', 'z' };
typedef std::pair&lt;int,int&gt; E;
E edges[] = { E(u,y), E(u,x), E(u,v),
E(v,u),
E(x,y), E(x,v),
E(y,v), E(y,z),
E(z,u), E(z,x) };
int weight[] = { -4, 8, 5,
-2,
9, -3,
7, 2,
6, 7 };
typedef edge_list&lt;E*,E,ptrdiff_t&gt; Graph;
Graph g(edges, edges + sizeof(edges)/sizeof(E));
vector&lt;int&gt; distance(N,std::numeric_limits&lt;short&gt;::max());
vector&lt;int&gt; parent(N,-1);
distance[z] = 0;
parent[z] = z;
bool r = bellman_ford_shortest_paths(g, int(N), weight,
distance.begin(),
parent.begin());
if (r)
for (int i = 0; i &lt; N; ++i)
std::cout &lt;&lt; name[i] &lt;&lt; ": " &lt;&lt; distance[i]
&lt;&lt; " " &lt;&lt; name[parent[i]] &lt;&lt; std::endl;
else
std::cout &lt;&lt; "negative cycle" &lt;&lt; std::endl;
</PRE>
The distance and predecessor for each vertex is:
<PRE>
u: 2 v
v: 4 x
x: 7 z
y: -2 u
z: 0 z
</PRE>
<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="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+12 -16
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. We make no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: bellman_visitor</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -101,14 +97,14 @@ and <a href="./property_writer.html"><tt>property_writer</tt></a>.
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
Univ.of Notre Dame (<A
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
Univ.of Notre Dame (<A
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+307
View File
@@ -0,0 +1,307 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<!--
-- Copyright (c) 2004 Trustees of Indiana University
--
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<head>
<title>Boost Graph Library: Brandes' Betweenness Centrality</title>
</head>
<body>
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<h1><img src="figs/python.gif" alt="(Python)"/><tt>brandes_betweenness_centrality</tt></h1>
<p>
<pre>
<em>// named parameter versions</em>
template&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/LvaluePropertyMap.html">Lvalue Property
Map</a> whose key type is the same as the vertex descriptor type of
the graph and whose value type is a Sequence (e.g., an
<tt>std::vector</tt>) containing edge descriptors.<br>
<b>Default:</b> <a
href="../../property_map/iterator_property_map.html">
<tt>iterator_property_map</tt></a> created from a
<tt>std::vector</tt> of <tt>std::vector&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/ReadWritePropertyMap.html">Read/Write
Property Map</a>. The vertex descriptor type of the graph needs to
be usable as the key type of the distance map. The value type of the
distance map is the element type of a <a
href="./Monoid.html">Monoid</a>.<br>
<b>Default:</b> <a
href="../../property_map/iterator_property_map.html">
<tt>iterator_property_map</tt></a> created from a
<tt>std::vector</tt> of the <tt>WeightMap</tt>'s value type (or the
<tt>vertices_size_type</tt> of the graph when no weight map exists)
of size <tt>num_vertices(g)</tt> and using the <tt>vertex_index</tt> for
the index map.<br>
<b>Python</b>: Unsupported parameter.
</blockquote>
UTIL: <tt>DependencyMap dependency</tt>
<blockquote>
Property map used internally to accumulate partial betweenness
centrality results. The type <tt>DependencyMap</tt> must be a model
of <a href="../../property_map/ReadWritePropertyMap.html">Read/Write
Property Map</a>. The vertex descriptor type of the graph needs to
be usable as the key type of the dependency map. The value type of
the dependency map must be compatible with the value type of the
centrality map.<br>
<b>Default:</b> <a
href="../../property_map/iterator_property_map.html">
<tt>iterator_property_map</tt></a> created from a
<tt>std::vector</tt> of the <tt>CentralityMap</tt>'s value type of
size <tt>num_vertices(g)</tt> and using the <tt>vertex_index</tt>
for the index map.<br>
<b>Python</b>: Unsupported parameter.
</blockquote>
UTIL: <tt>PathCountMap path_count</tt>
<blockquote>
Property map used internally to accumulate the number of paths that
pass through each particular vertex. The type <tt>PathCountMap</tt>
must be a model of <a
href="../../property_map/ReadWritePropertyMap.html">Read/Write
Property Map</a>. The vertex descriptor type of the graph needs to
be usable as the key type of the dependency map. The value type of
the dependency map must be an integral type large enough to store
the number of paths in the graph.<br>
<b>Default:</b> <a
href="../../property_map/iterator_property_map.html">
<tt>iterator_property_map</tt></a> created from a
<tt>std::vector</tt> of the <tt>degree_size_type</tt> of the graph of
size <tt>num_vertices(g)</tt> and using the <tt>vertex_index</tt>
for the index map.<br>
<b>Python</b>: Unsupported parameter.
</blockquote>
<h3>Named parameters</h3>
OUT/UTIL: <tt>CentralityMap centrality_map</tt>
<blockquote>
This property map is used to accumulate the betweenness centrality
of each vertex, and is the primary output of the algorithm. The type
<tt>CentralityMap</tt> must be a model of <a
href="../../property_map/ReadWritePropertyMap.html">Read/Write
Property Map</a>, with the graph's vertex descriptor type as its key
type. The value type of this property map should be a floating-point
or rational type.<br>
<b>Default:</b> a <tt>dummy_property_map</tt>, which requires no
work to compute and returns no answer.<br>
<b>Python</b>: The color map must be a <tt>vertex_double_map</tt> for
the graph.<br>
<b>Python default</b>: <tt>graph.get_vertex_double_map("centrality")</tt>
</blockquote>
OUT/UTIL: <tt>EdgeCentralityMap edge_centrality_map</tt>
<blockquote>
This property map is used to accumulate the betweenness centrality
of each edge, and is a secondary form of output for the
algorithm. The type <tt>EdgeCentralityMap</tt> must be a model of <a
href="../../property_map/ReadWritePropertyMap.html">Read/Write
Property Map</a>, with the graph's edge descriptor type as its key
type. The value type of this property map should be the same as the
value type of the <tt>CentralityMap</tt> property map.<br>
<b>Default:</b> a <tt>dummy_property_map</tt>, which requires no
work to compute and returns no answer.<br>
<b>Python</b>: The color map must be a <tt>edge_double_map</tt> for
the graph.<br>
<b>Python default</b>: <tt>graph.get_edge_double_map("centrality")</tt>
</blockquote>
IN: <tt>vertex_index_map(VertexIndexMap vertex_index)</tt>
<blockquote>
This maps each vertex to an integer in the range <tt>[0,
num_vertices(g))</tt>. This is necessary for efficient updates of the
heap data structure when an edge is relaxed. The type
<tt>VertexIndexMap</tt> must be a model of
<a href="../../property_map/ReadablePropertyMap.html">Readable Property Map</a>. The value type of the map must be an
integer type. The vertex descriptor type of the graph needs to be
usable as the key type of the map.<br>
<b>Default:</b> <tt>get(vertex_index, g)</tt>.
Note: if you use this default, make sure your graph has
an internal <tt>vertex_index</tt> property. For example,
<tt>adjacenty_list</tt> with <tt>VertexList=listS</tt> does
not have an internal <tt>vertex_index</tt> property.<br>
<b>Python</b>: Unsupported parameter.
</blockquote>
IN: <tt>weight_map(WeightMap w_map)</tt>
<blockquote>
The weight or ``length'' of each edge in the graph. The weights
must all be non-negative, and the algorithm will throw a
<a href="./exception.html#negative_edge"><tt>negative_edge</tt></a>
exception is one of the edges is negative.
The type <tt>WeightMap</tt> must be a model of
<a href="../../property_map/ReadablePropertyMap.html">Readable Property Map</a>. The edge descriptor type of
the graph needs to be usable as the key type for the weight
map. The value type for this map must be
the same as the value type of the distance map.<br>
<b>Default:</b> All edge weights are assumed to be equivalent.
<b>Python</b>: If supplied, must be an <tt>edge_double_map</tt> for the graph.
</blockquote>
<h3>Complexity</h3>
The time complexity is <em>O(VE)</em> for unweighted graphs and
<em>O(VE + V(V+E) log V)</em> for weighted graphs. The space complexity
is <em>O(VE)</em>.
<hr>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &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>
+13 -17
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. We make no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: bfs_visitor</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -43,7 +39,7 @@ visitor.
// Construct graph G and obtain the source vertex s ...
boost::breadth_first_search(G, s,
make_bfs_visitor(
boost::make_bfs_visitor(
std::make_pair(boost::record_distances(d, boost::on_tree_edge()),
std::make_pair(boost::record_predecessors(p.begin(),
boost::on_tree_edge()),
@@ -118,14 +114,14 @@ and <a href="./property_writer.html"><tt>property_writer</tt></a>.
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
Univ.of Notre Dame (<A
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
Univ.of Notre Dame (<A
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

+96
View File
@@ -0,0 +1,96 @@
<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>
+208 -11
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: Bibliography</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -235,14 +231,215 @@ SIAM Journal on Matrix Analysis and Applications (To appear)
<EM>The Evolution of the Minimum Degree Ordering Algorithm</EM><br>
SIAM Review, March 1989, vol. 31, num. 1, pp. 1-19.
</DL>
<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 & 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 IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 26, no. 9, pp. 1124-1137, Sept. 2004.
<p></p><dt><a name="boyermyrvold04">70</a>
<dd>John M. Boyer and Wendy J. Myrvold<br>
<em><a href="http://www.emis.de/journals/JGAA/accepted/2004/BoyerMyrvold2004.8.3.pdf">
On the Cutting Edge: Simplified O(n) Planarity by Edge Addition</a>
</em><br>
Journal of Graph Algorithms and Applications, 8(2): 241-273, 2004.
<p></p><dt><a name="chrobakpayne95">71</a>
<dd>M. Chrobak, T. Payne<br>
<em>
A Linear-time Algorithm for Drawing a Planar Graph on the Grid
</em><br>
Information Processing Letters 54: 241-246, 1995.
<p></p><dt><a name="defraysseixpachpollack90">72</a>
<dd>H. de Fraysseix, J. Pach, R. Pollack<br>
<em>
How to Draw a Planar Graph on a Grid
</em><br>
Combinatorica 10: 41-51, 1990.
</dl>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+254
View File
@@ -0,0 +1,254 @@
<HTML>
<!--
-- Copyright 2001-2004 The Trustees of Indiana University.
--
-- Use, modification and distribution is subject to the Boost Software
-- License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
--
-- Authors: Douglas Gregor
-- Jeremy Siek
-- Andrew Lumsdaine
-->
<Head>
<Title>Boost Graph Library: Biconnected Components and Articulation Points</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<h1>
<TT>
<img src="figs/python.gif" alt="(Python)"/>
<A NAME="sec:biconnected-components">biconnected_components
</A>
</TT>
and
<tt>articulation_points</tt>
</h1>
<PRE>
<i>// named parameter version</i>
template &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/WritablePropertyMap.html">Writable Property
Map</a>. The value type shouch be an integer type, preferably the same
as the <tt>edges_size_type</tt> of the graph. The key type must be
the graph's edge descriptor type.<br>
<b>Default</b>: <tt>dummy_property_map</tt>.<br>
<b>Python</b>: Must be an <tt>edge_int_map</tt> for the graph.<br>
<b>Python default</b>: <tt>graph.get_edge_int_map("bicomponent")</tt>
</blockquote>
OUT: <tt>OutputIterator out</tt>
<blockquote>
The algorithm writes articulation points via this output
iterator and returns the resulting iterator.<br>
<b>Default</b>: a dummy iterator that ignores values written to it.<br>
<b>Python</b>: this parameter is not used in Python. Instead, both
algorithms return a Python <tt>list</tt> containing the articulation
points.
</blockquote>
<h3>Named Parameters</h3>
IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
<blockquote>
This maps each vertex to an integer in the range <tt>[0,
num_vertices(g))</tt>. The type
<tt>VertexIndexMap</tt> must be a model of
<a href="../../property_map/ReadablePropertyMap.html">Readable Property Map</a>. The value type of the map must be an
integer type. The vertex descriptor type of the graph needs to be
usable as the key type of the map.<br>
<b>Default:</b> <tt>get(vertex_index, g)</tt><br>
<b>Python</b>: Unsupported parameter.
</blockquote>
UTIL/OUT: <tt>discover_time_map(DiscoverTimeMap discover_time)</tt>
<blockquote>
The discovery time of each vertex in the depth-first search. The
type <tt>DiscoverTimeMap</tt> must be a model of <a
href="../../property_map/ReadWritePropertyMap.html">Read/Write
Property Map</a>. The value type of the map must be an integer
type. The vertex descriptor type of the graph needs to be usable as
the key type of the map.<br>
<b>Default</b>: an <a
href="../../property_map/iterator_property_map.html">
</tt>iterator_property_map</tt></a> created from a
<tt>std::vector</tt> of <tt>vertices_size_type</tt> of size
<tt>num_vertices(g)</tt> and using <tt>get(vertex_index, g)</tt> for
the index map.<br>
<b>Python</b>: Unsupported parameter.
</blockquote>
UTIL/OUT: <tt>lowpoint_map(LowPointMap lowpt)</tt>
<blockquote>
The low point of each vertex in the depth-first search, which is the
smallest vertex reachable from a given vertex with at most one back
edge. The type <tt>LowPointMap</tt> must be a model of <a
href="../../property_map/ReadWritePropertyMap.html">Read/Write
Property Map</a>. The value type of the map must be an integer
type. The vertex descriptor type of the graph needs to be usable as
the key type of the map.<br>
<b>Default</b>: an <a
href="../../property_map/iterator_property_map.html">
</tt>iterator_property_map</tt></a> created from a
<tt>std::vector</tt> of <tt>vertices_size_type</tt> of size
<tt>num_vertices(g)</tt> and using <tt>get(vertex_index, g)</tt> for
the index map.<br>
<b>Python</b>: Unsupported parameter.
</blockquote>
UTIL/OUT: <tt>predecessor_map(PredecessorMap p_map)</tt>
<blockquote>
The predecessor map records the depth first search tree.
The <tt>PredecessorMap</tt> type
must be a <a
href="../../property_map/ReadWritePropertyMap.html">Read/Write
Property Map</a> whose key and value types are the same as the vertex
descriptor type of the graph.<br>
<b>Default:</b> an <a
href="../../property_map/iterator_property_map.html">
</tt>iterator_property_map</tt></a> created from a
<tt>std::vector</tt> of <tt>vertex_descriptor</tt> of size
<tt>num_vertices(g)</tt> and using <tt>get(vertex_index, g)</tt> for
the index map.<br>
<b>Python</b>: Must be a <tt>vertex_vertex_map</tt> for the graph.<br>
</blockquote>
IN: <tt>visitor(DFSVisitor vis)</tt>
<blockquote>
A visitor object that is invoked inside the algorithm at the
event-points specified by the <a href="./DFSVisitor.html">DFS
Visitor</a> concept. The visitor object is passed by value <a
href="#1">[1]</a>. <br> <b>Default:</b>
<tt>dfs_visitor&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.
<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
@@ -0,0 +1,386 @@
\documentclass[11pt]{report}
\usepackage[leqno]{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{latexsym}
\usepackage{jweb}
\usepackage{times}
\usepackage{graphicx}
\usepackage[nolineno]{lgrind}
\newif\ifpdf
\ifx\pdfoutput\undefined
\pdffalse
\else
\pdfoutput=1
\pdftrue
\fi
\ifpdf
\usepackage[
pdftex,
colorlinks=true, % change to true for the electronic version
linkcolor=blue,filecolor=blue,pagecolor=blue,urlcolor=blue
]{hyperref}
\newcommand{\myhyperref}[2]{\hyperref[#1]{#2}}
\fi
\newcommand{\mtlfig}[2]{\centerline{\includegraphics*[#2]{#1.pdf}}}
\newcommand{\Path}{\rightsquigarrow}
\newcommand{\ancestor}{\overset{T}{\rightsquigarrow}}
\newcommand{\descendant}{\ancestor^{-1}}
\newcommand{\backedge}{\overset{B}{\rightarrow}}
\newcommand{\edge}{\rightarrow}
\DeclareMathOperator{\suchthat}{s.t.}
\newcommand{\code}[1]{{\small{\em \textbf{#1}}}}
\newcommand{\concept}[1]{\textsf{#1}}
\begin{document}
\title{An Implementation of Biconnected Components}
\author{Jeremy Siek}
\maketitle
\section{Introduction}
This paper documents the implementation of the
\code{biconnected\_components()} function of the Boost Graph
Library. The function was implemented by Jeremy Siek.
The algorithm used to implement the \code{biconnected\_components()}
function is the one based on depth-first search described
by Tarjan~\cite{tarjan72:dfs_and_linear_algo}.
An undirected graph $G = (V,E)$ is \emph{biconnected} if for each
triple of distinct vertices $v, w, a \in V$ there is a path $p : v
\Path w$ such that $a$ is not on the path $p$. An \emph{articulation
point} of $G = (V,E)$ is a vertex $a \in V$ where there are two other
distinct vertices $v,w \in V$ such that $a$ is on any path $p:v \Path
w$ and there is at least one such path. If $a$ were to be removed from
$G$, then $v$ and $w$ would no longer be reachable from each other.
So articulation points act as bridges between biconnected components;
the only path from one biconnected component to another is through an
articulation point.
The algorithm finds articulation points based on information provided
by depth-first search. During a DFS, we label each vertex $v \in G$
with its discover time, denoted $d[v]$. During the DFS we also
compute the $lowpt(v)$, which is the smallest (in terms of discover
time) vertex reachable from $v$ by traversing zero or more DFS-tree
edges followed by at most one back edge. Tree edges and back edges can
be identified based on discover time because for tree edge $(u,v)$ we
have $d[u] < d[v]$ and for back edge $(u,v)$ we have $d[u] >
d[v]$. The $lowpt(v)$ is computed for $v$ by taking the minimum
$lowpt$ of the vertices to which $v$ is adjacent. The $lowpt(v)$ is
computed after the recursive DFS call so the $lowpt$ has already been
computed for the adjacent vertices by the time $lowpt(v)$ is computed.
Now it turns out that $lowpt$ can be used to identify articulation
points. Suppose $a,v,w$ are distinct vertices in $G$ such that $(a,v)$
is a tree edge and $w$ is not a descendant of $v$. If $d[lowpt(v)]
\geq d[a]$, then $a$ is an articulation point and removal of $a$
disconnects $v$ and $w$. The reason this works is that if $d[lowpt(v)]
\geq d[a]$, then we know all paths starting from $v$ stay within the
sub-tree $T_v$ rooted at $v$. If a path were to escape from the
sub-tree, then consider the first vertex $w$ in that path outside of
$T_v$. $v \Path w$ must be considered for $lowpt(v)$, so $d[lowpt(v)]
< d[w]$. Now $d[w] < d[a]$ due the structure of the DFS, so
transitively $d[lowpt(v)] < d[a]$.
\section{The Implementation}
The implementation consists of a recursive DFS-like function named
\code{biconnect()} and the public interface function
\code{biconnected\-\_components()}. The \code{Graph} type must be a
model of \concept{VertexListGraph} and of \concept{IncidenceGraph}.
The result of the algorithm is recorded in the \code{ComponentMap},
which maps edges to the biconnected component that they belong to
(components are labeled with integers from zero on up). The
\code{ComponentMap} type must be a model of
\concept{WritablePropertyMap}, which the graph's
\code{edge\-\_descriptor} type as the key type and an unsigned integer
type as the value type. We do not record which component each vertex
belongs to because vertices that are articulation points belong to
multiple biconnected components. The number of biconnected components
is returned in the \code{num\_components} parameter. The
\code{discover\_time} parameter is used internally to keep track of
the DFS discover time for each vertex. It must be a
\concept{ReadWritePropertyMap} with the graph's
\code{vertex\_\-descriptor} type as the key type and an unsigned
integer as the value type. The \code{lowpt} parameter is used
internally to keep track of the $d[lowpt(v)]$ for each vertex $v$. It
must be a \concept{ReadWritePropertyMap} with the graph's
\code{vertex\_\-descriptor} type is the key type and the value type is
the same unsigned integer type as the value type in the
\code{discover\-\_time} map.
@d Biconnected Components Algorithm
@{
namespace detail {
@<Recursive Biconnect Function@>
}
template <typename Graph, typename ComponentMap,
typename DiscoverTimeMap, typename LowPointMap>
void biconnected_components
(typename graph_traits<Graph>::vertex_descriptor v,
typename graph_traits<Graph>::vertex_descriptor u,
const Graph& g,
ComponentMap comp,
std::size_t& num_components,
DiscoverTimeMap discover_time,
LowPointMap lowpt)
{
typedef graph_traits<Graph>::vertex_descriptor vertex_t;
typedef graph_traits<Graph>::edge_descriptor edge_t;
@<Concept checking of type parameters@>
typedef typename property_traits<DiscoverTimeMap>::value_type D;
num_components = 0;
std::size_t dfs_time = 0;
std::stack<edge_t> S;
@<Initialize discover times to infinity@>
@<Process each connected component@>
}
@}
\noindent In the following code we use the Boost Concept Checking
Library to provide better error messages in the event that the user
makes a mistake in the kind of parameter used in the function
template.
@d Concept checking of type parameters
@{
function_requires< VertexListGraphConcept<Graph> >();
function_requires< IncidenceGraphConcept<Graph> >();
function_requires< WritablePropertyMapConcept<ComponentMap, edge_t> >();
function_requires< ReadWritePropertyMapConcept<DiscoverTimeMap, vertex_t> >();
function_requires< ReadWritePropertyMapConcept<LowPointMap, vertex_t> >();
@}
The first step of the algorithm is to initialize the discover times of
all the vertices to infinity. This marks the vertices as undiscovered.
@d Initialize discover times to infinity
@{
typename graph_traits<Graph>::vertex_iterator wi, wi_end;
std::size_t infinity = std::numeric_limits<std::size_t>::max();
for (tie(wi, wi_end) = vertices(g); wi != wi_end; ++wi)
put(discover_time, *wi, infinity);
@}
\noindent Next we invoke \code{biconnect()} on every vertex in the
graph, making sure that all connected components within the graph are
searched (\code{biconnect()} only processes a single connected
component).
@d Process each connected component
@{
for (tie(wi, wi_end) = vertices(g); wi != wi_end; ++wi)
if (get(discover_time, *wi) == std::numeric_limits<D>::max())
detail::biconnect(*wi, *wi, true,
g, comp, num_components,
discover_time, dfs_time, lowpt, S);
@}
The recursive \code{biconnect()} function is shown below. The
\code{v} parameter is where the DFS is started. The \code{u}
parameter is the parent of \code{v} in the DFS-tree if \code{at\_top
== false} or if \code{at\_top == true} the \code{u} is not used.
\code{S} is a stack of edges that is used to collect all edges in a
biconnected component. The way this works is that on ``the way down''
edges are pushed into the stack. ``On the way back up'', when an
articulation point $v$ is found (identified because $d[lowpt(w)] \geq
d[v]$) we know that a contiguous portion of the stack (starting at the
top) contains the edges in the sub-tree $T_v$ which is the biconnected
component. We therefore pop these edges off of the stack (until we
find an edge $e$ where $d[lowpt(source(e))] < d[w]$) and mark them as
belonging to the same component. The code below also includes the
bookkeeping details such as recording the discover times and computing
$lowpt$. When a back edge $(v,w)$ is encountered, we do not use
$lowpt(w)$ in calculating $lowpt(v)$ since $lowpt(w)$ has not yet been
computed. Also, we ignore the edge $(v,w)$ if $w$ is the parent of $v$
in the DFS-tree, meaning that $(w,v)$ has already been examined and
categorized as a tree edge (not a back edge).
@d Recursive Biconnect Function
@{
template <typename Graph, typename ComponentMap,
typename DiscoverTimeMap, typename LowPointMap, typename Stack>
void biconnect(typename graph_traits<Graph>::vertex_descriptor v,
typename graph_traits<Graph>::vertex_descriptor u,
bool at_top,
const Graph& g,
ComponentMap comp,
std::size_t& c,
DiscoverTimeMap d,
std::size_t& dfs_time,
LowPointMap lowpt,
Stack& S)
{
typedef typename graph_traits<Graph>::vertex_descriptor vertex_t;
typedef typename property_traits<DiscoverTimeMap>::value_type D;
D infinity = std::numeric_limits<D>::max();
put(d, v, ++dfs_time);
put(lowpt, v, get(d, v));
typename graph_traits<Graph>::out_edge_iterator ei, ei_end;
for (tie(ei, ei_end) = out_edges(v, g); ei != ei_end; ++ei) {
vertex_t w = target(*ei, g);
if (get(d, w) == infinity) {
S.push(*ei);
biconnect(w, v, false, g, comp, c, d, dfs_time, lowpt, S);
put(lowpt, v, std::min(get(lowpt, v), get(lowpt, w)));
if (get(lowpt, w) >= get(d, v)) {
@<Record the biconnected component@>
}
} else if (get(d, w) < get(d, v) && (!at_top && w != u)) {
S.push(*ei);
put(lowpt, v, std::min(get(lowpt, v), get(d, w)));
}
}
}
@}
\noindent The following is the code for popping the edges of sub-tree
$T_v$ off of the stack and recording them as being in the same
biconnected component.
@d Record the biconnected component
@{
while (d[source(S.top(), g)] >= d[w]) {
put(comp, S.top(), c);
S.pop();
}
put(comp, S.top(), c);
S.pop();
++c;
@}
\section{Appendix}
@o biconnected-components.hpp
@{
// Copyright (c) Jeremy Siek 2001
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and this permission notice appear
// in supporting documentation. Silicon Graphics makes no
// representations about the suitability of this software for any
// purpose. It is provided "as is" without express or implied warranty.
// NOTE: this final is generated by libs/graph/doc/biconnected_components.w
#ifndef BOOST_GRAPH_BICONNECTED_COMPONENTS_HPP
#define BOOST_GRAPH_BICONNECTED_COMPONENTS_HPP
#include <stack>
#include <boost/limits.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/graph_concepts.hpp>
#include <boost/property_map.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
@@ -0,0 +1,259 @@
<HTML>
<!-- Copyright 2007 Aaron Windsor
--
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
--
-->
<Head>
<Title>Boost Graph Library: Boyer-Myrvold Planarity Testing/Embedding</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1>Boyer-Myrvold Planarity Testing/Embedding</H1>
<p>
A graph is <a href="./planar_graphs.html#planar"><i>planar</i></a> if it can
be drawn in two-dimensional space without any of its edges crossing. Such a
drawing of a planar graph is called a
<a href="./planar_graphs.html#plane_drawing"><i>plane drawing</i></a>. Each
plane drawing belongs to an equivalence class called a <i>planar embedding</i>
<a href="#1">[1]</a> that is defined by the clockwise ordering of adjacent
edges around each vertex in the graph. A planar embedding is a convenient
intermediate representation of an actual drawing of a planar graph, and many
planar graph drawing algorithms are formulated as functions mapping a planar
embedding to a plane drawing.
<br>
<br>
<table align="center" class="image">
<caption align="bottom"><h5>A planar graph (top left), along with a planar
embedding of that graph (bottom left) can be used to create a plane drawing
(right) by embedding edges around each vertex in the order in which they
appear in the planar embedding.
</h5></caption>
<tr><td>
<img src="./figs/embedding_illustration.png">
</td></tr>
<tr></tr>
<tr></tr>
</table>
<br>
<p>
The function <tt>boyer_myrvold_planarity_test</tt> implements the planarity
testing/embedding algorithm of Boyer and Myrvold
[<a href="./bibliography.html#boyermyrvold04">70</a>].
<tt>boyer_myrvold_planarity_test</tt> returns <tt>true</tt> if the input graph
is planar and <tt>false</tt> otherwise. As a side-effect of this test, a planar
embedding can be constructed if the graph is planar or a minimal set of edges
that form a <a href = "./planar_graphs.html#kuratowskisubgraphs">Kuratowski
subgraph</a> can be found if the graph is not planar.
<tt>boyer_myrvold_planarity_test</tt> uses named parameter arguments (courtesy
of the <a href="../../parameter/doc/html/index.html">Boost.Parameter</a>
library) to specify what the function actually does. Some examples are:
<ul>
<li>Testing whether or not a graph is planar:
<pre>
bool is_planar = boyer_myrvold_planarity_test(g);
</pre>
<li>Computing a planar embedding for a graph if it is planar, otherwise finding
a set of edges that forms an obstructing Kuratowski subgraph:
<pre>
if (boyer_myrvold_planarity_test(boyer_myrvold_params::graph = g,
boyer_myrvold_params::embedding = embedding_pmap,
boyer_myrvold_params::kuratowski_subgraph = out_itr
)
)
{
//do something with the embedding in embedding_pmap
}
else
{
//do something with the kuratowski subgraph output to out_itr
}
</pre>
</ul>
<p>
The parameters passed to <tt>boyer_myrvold_planarity_test</tt> in the examples
above do more than just carry the data structures used for input and output -
the algorithm is optimized at compile time based on which parameters are
present. A complete list of parameters accepted and their interactions are
described below.
<p>
<tt>boyer_myrvold_planarity_test</tt> accepts as input any undirected graph,
even those with self-loops and multiple edges.
However, many planar graph drawing algorithms make additional restrictions
on the structure of the input graph - for example, requiring that the input
graph is connected, biconnected, or even maximal planar (triangulated.)
Fortunately, any planar graph on <i>n</i> vertices that lacks one of these
properties can be augmented with additional edges so that it satisfies that
property in <i>O(n)</i> time - the functions
<tt><a href="./make_connected.html">make_connected</a></tt>,
<tt><a href="./make_biconnected_planar.html">make_biconnected_planar</a></tt>,
and <tt><a href="./make_maximal_planar.html">make_maximal_planar</a></tt>
exist for this purpose. If the graph drawing algorithm you're using requires,
say, a biconnected graph, then you must make your input graph biconnected
<i>before</i> passing it into <tt>boyer_myrvold_planarity_test</tt> so that the
computed planar embedding includes these additional edges. This may require
more than one call to <tt>boyer_myrvold_planarity_test</tt> depending on the
structure of the graph you begin with, since both
<tt>make_biconnected_planar</tt> and <tt>make_maximal_planar</tt> require a
planar embedding of the existing graph as an input parameter.
<p><p>
The named parameters accepted by <tt>boyer_myrvold_planarity_test</tt> are:
<ul>
<li><b><tt>graph</tt></b> : The input graph - this is the only required
parameter.
<li><b><tt>vertex_index_map</tt></b> : A mapping from vertices of the input
graph to indexes in the range <tt>[0..num_vertices(g))</tt>. If this parameter
is not provided, the vertex index map is assumed to be available as an interior
property of the graph, accessible by calling <tt>get(vertex_index, g)</tt>.
<li><b><tt>edge_index_map</tt></b>: A mapping from the edges of the input graph
to indexes in the range <tt>[0..num_edges(g))</tt>. This parameter is only
needed if the <tt>kuratowski_subgraph</tt> argument is provided. If the
<tt>kuratowski_subgraph</tt> argument is provided and this parameter is not
provided, the EdgeIndexMap is assumed to be available as an interior property
accessible by calling <tt>get(edge_index, g)</tt>.
<li><b><tt>embedding</tt></b> : If the graph is planar, this will be populated
with a mapping from vertices to the clockwise order of neighbors in the planar
embedding.
<li><b><tt>kuratowski_subgraph</tt></b> : If the graph is not planar, a minimal
set of edges that form the obstructing Kuratowski subgraph will be written to
this iterator.
</ul>
These named parameters all belong to the namespace
<tt>boyer_myrvold_params</tt>. See below for more information on the concepts
required for these arguments.
<H3>Verifying the output</H3>
Whether or not the input graph is planar, <tt>boyer_myrvold_planarity_test</tt>
can produce a certificate that can be automatically checked to verify that the
function is working properly.
<p>
If the graph is planar, a planar embedding can be produced. The
planar embedding can be verified by passing it to a plane drawing routine
(such as <tt><a href="straight_line_drawing.html">
chrobak_payne_straight_line_drawing</a></tt>) and using the function
<tt><a href="is_straight_line_drawing.html">is_straight_line_drawing</a></tt>
to verify that the resulting graph is planar.
<p>
If the graph is not planar, a set of edges that forms a Kuratowski subgraph in
the original graph can be produced. This set of edges can be passed to the
function <tt><a href="is_kuratowski_subgraph.html">is_kuratowski_subgraph</a>
</tt> to verify that they can be contracted into a <i>K<sub>5</sub></i> or
<i>K<sub>3,3</sub></i>. <tt>boyer_myrvold_planarity_test</tt> chooses the set
of edges forming the Kuratowski subgraph in such a way that the contraction to
a <i>K<sub>5</sub></i> or <i>K<sub>3,3</sub></i> can be done by a simple
deterministic process which is described in the documentation to
<tt>is_kuratowski_subgraph</tt>.
<H3>Where Defined</H3>
<P>
<a href="../../../boost/graph/boyer_myrvold_planar_test.hpp">
<TT>boost/graph/boyer_myrvold_planar_test.hpp</TT>
</a>
<H3>Parameters</H3>
IN: <tt>Graph&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/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/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>
+269 -177
View File
@@ -1,120 +1,145 @@
<HTML>
<!--
-- Copyright (c) Jeremy Siek 2000
-- Copyright (c) Jeremy Siek 2000, 2001
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: Breadth-First Search</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1><A NAME="sec:bfs">
<img src="figs/python.gif" alt="(Python)"/>
<TT>breadth_first_search</TT>
</H1>
<P>
<DIV ALIGN="LEFT">
<TABLE CELLPADDING=3 border>
<TR><TH ALIGN="LEFT"><B>Graphs:</B></TH>
<TD ALIGN="LEFT">directed and undirected</TD>
</TR>
<TR><TH ALIGN="LEFT"><B>Properties:</B></TH>
<TD ALIGN="LEFT">color</TD>
</TR>
<TR><TH ALIGN="LEFT"><B>Complexity:</B></TH>
<TD ALIGN="LEFT">time: <i>O(V + E)</i></TD>
</TR>
</TABLE>
</DIV>
<P>
<PRE>
(1)
template &lt;class <a href="./VertexListGraph.html">VertexListGraph</a>, class <a href="./BFSVisitor.html">BFSVisitor</a>&gt;
void breadth_first_search(VertexListGraph& G,
typename graph_traits&lt;VertexListGraph&gt;::vertex_descriptor s,
BFSVisitor vis);
<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);
(2)
template &lt;class <a href="./VertexListGraph.html">VertexListGraph</a>, class <a href="./BFSVisitor.html">BFSVisitor</a>, class <a href="#ColorMap">ColorMap</a>&gt;
void breadth_first_search(VertexListGraph& g,
typename graph_traits&lt;VertexListGraph&gt;::vertex_descriptor s,
BFSVisitor vis, ColorMap color);
(3)
template &lt;class <a href="./IncidenceGraph.html">IncidenceGraph</a>, class <a href="./Buffer.html">Buffer</a>, <a href="./BFSVisitor.html">BFSVisitor</a>, class <a href="#ColorMap">ColorMap</a>&gt;
void breadth_first_search(VertexListGraph& g,
typename graph_traits&lt;VertexListGraph&gt;::vertex_descriptor s,
Buffer& Q, BFSVisitor vis, ColorMap color)
<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 breadth-first search (BFS) algorithm is not really an algorithm in
the sense that it has a particular purpose. Instead BFS is more like
an algorithm <I>pattern</I>. One can do many different things with
BFS. For example, the BFS pattern is used in the BGL to build several
other algorithms: Dijkstra's shortest paths, Prim's Minimum Spanning
Tree and best-first search. The definition of a <I>breadth-first
search</I> is given in Section <A
HREF="./graph_theory_review.html#sec:bfs-algorithm">Breadth-First
Search</A>.
<P>
The BGL BFS functions are highly parameterized so that they can be
used in a wide variety of places. The way to customize the BFS
algorithm to perform different operations is to supply a visitor,
which is a function object with multiple functions. Each member
function of the visitor gets invoked at special times during the
algorithm as specified by <a
href="./BFSVisitor.html">BFSVisitor</a>. Also, visitors can be layered
on top of each other so that one can do lots of things during a single
run of BFS. See the <a href="./bfs_visitor.html">bfs_visitor</a> class
and the <A HREF="./EventVisitor.html">EventVisitor</A> concept for
more details.
<P>
Another way to customize the BFS algorithm is change the type of queue
used. For instance, <TT>dijkstra_shortest_paths()</TT> uses a priority
queue.
<p>
The <tt>ColorMap</tt> is used by BFS to keep track of which vertices
have been visited. At the beginning of the algorithm all vertices are
white. As the algorithm proceeds, vertices are colored gray as they
are inserted into the queue, and then colored black when they are
finished and removed from queue.
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>
<P>
Version 1 of the algorithm takes only three arguments: the graph
object, the source vertex, and a visitor to specify the actions to be
taken during the graph search. The algorithm will need to use a color
property which must be provided by the graph object (through a vertex
color property).
<P>
Version 2 of the algorithm adds a color property argument to
accommodate the use of an external property map.
<P>
Version 3 of the algorithm is the most generalized. It adds a
parameter for the queue. This version does not initialize the color of
all the vertices to white at the start of the algorithm or invoke the
<tt>initialize_vertex()</tt> visitor method, so that must be taken
care of before calling this versin of <tt>breadth_first_search()</tt>.
<P>
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>
@@ -123,34 +148,104 @@ care of before calling this versin of <tt>breadth_first_search()</tt>.
<P>
<H3>Requirements on Types</H3>
<h3>Parameters</h3>
<P>
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>
<UL>
<LI>The type <TT>IncidenceGraph</TT> must be a model of <a href="./IncidenceGraph.html">IncidenceGraph</a>.
</LI>
<LI>The type <TT>VertexListGraph</TT> must be a model of <a href="./VertexListGraph.html">VertexListGraph</a>.
</LI>
<LI>The type <TT>BFSVisitor</TT> must be a model of <a href="./BFSVisitor.html">BFSVisitor</a>.
</LI>
<LI>In version (1) of the algorithm the graph must be a model
of <a href="./PropertyGraph.html">PropertyGraph</a> for
<TT>vertex_color_t</TT> and
the color property map for the graph must meet the
same requirements as <TT>ColorMap</TT>.
</LI>
<LI><a name="ColorMap">The type <TT>ColorMap</TT> must be a model of <a
href="../../property_map/ReadWritePropertyMap.html">ReadWritePropertyMap</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">ColorValue</a>.</a>
</LI>
<LI>The type <TT>Buffer</TT> must be a model of <a href="./Buffer.html">Buffer</a>.
</LI>
</UL>
<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/ReadWritePropertyMap.html">Read/Write
Property Map</a> and its key type must be the graph's vertex
descriptor type and the value type of the color map must model
<a href="./ColorValue.html">ColorValue</a>.<br>
<b>Default:</b> an <a
href="../../property_map/iterator_property_map.html">
</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/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>
<P>
<H3><A NAME="SECTION001330300000000000000">
Complexity</A>
@@ -161,85 +256,82 @@ 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>
This example 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
source code for this example is in <a
href="../example/bfs_basics.cpp"><TT>examples/bfs_basics.cpp</TT></a>.
<P>
<PRE>
// Select the graph type we wish to use
typedef adjacency_list&lt;vecS, undirectedS&gt; Graph;
// Set up the vertex ID's and names
enum { r, s, t, u, v, w, x, y, N };
char name[] = { 'r', 's', 't', 'u', 'v', 'w', 'x', 'y' };
// Specify the edges in the graph
typedef pair&lt;int,int&gt; E;
E edge_array[] = { E(r,s), E(r,v), E(s,w), E(w,r), E(w,t),
E(w,x), E(x,t), E(t,u), E(x,y), E(u,y) };
// Create the graph object
Graph G(N, edge_array, edge_array + sizeof(edge_array)/sizeof(E));
// Some typedef's to save a little typing
typedef Graph::vertex_descriptor Vertex;
typedef std::vector&lt;Vertex&gt;::iterator Piter;
typedef std::vector&lt;Graph::size_type&gt;::iterator Iiter;
// vectors to hold color, discover time, and finish time properties
std::vector&lt;default_color_type&gt; color(num_vertices(G));
std::vector&lt;Graph::size_type&gt; dtime(num_vertices(G));
std::vector&lt;Graph::size_type&gt; ftime(num_vertices(G));
breadth_first_search(G, vertex(s,G),
visit_timestamp(dtime.begin(), ftime.begin()),
color.begin());
// Use std::sort to order the vertices by their discover time
vector&lt;Graph::size_type&gt; discover_order(N);
iota(discover_order.begin(), discover_order.end(), 0);
std::sort(discover_order.begin(), discover_order.end(),
indirect_cmp&lt;Iiter, std::less&lt;Graph::size_type&gt; &gt;(dtime.begin()));
cout &lt;&lt; "order of discovery: ";
for (int i = 0; i &lt; N; ++i)
cout &lt;&lt; name[ discover_order[i] ] &lt;&lt; " ";
vector&lt;Graph::size_type&gt; finish_order(N);
iota(finish_order.begin(), finish_order.end(), 0);
std::sort(finish_order.begin(), finish_order.end(),
indirect_cmp&lt;Iiter, std::less&lt;Graph::size_type&gt; &gt;(ftime.begin()));
cout &lt;&lt; endl &lt;&lt; "order of finish: ";
for (int i = 0; i &lt; N; ++i)
cout &lt;&lt; name[ finish_order[i] ] &lt;&lt; " ";
cout &lt;&lt; endl;
</PRE>
The output is:
<PRE>
order of discovery: s r w v t x u y
order of finish: s r w v t x u y
</PRE>
<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</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+186
View File
@@ -0,0 +1,186 @@
<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/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>
+178
View File
@@ -0,0 +1,178 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<!--
-- Copyright Doug Gregor 2004. Use, modification and
-- distribution is subject to the Boost Software License, Version
-- 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-- For more information, see http://www.boost.org
-->
<head>
<title>Bundled Properties</title>
</head>
<body BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86"/>
<h1>Bundled Properties</h1>
<p>Class templates <code><a
href="adjacency_list.html">adjacency_list</a></code> and
<code><a href="adjacency_matrix.html">adjacency_matrix</a></code> support
the introduction of named properties via <a
href="using_adjacency_list.html#sec:adjacency-list-properties">internal
properties</a>. However, this method is cumbersome in many uses,
where it would be more intuitive to just specify a structure or
class that contains internal properties for edges or
vertices. Bundled properties allow one to use
<code>adjacency_list</code> and <code>adjacency_matrix</code> in this
manner, providing a simple
way to introduce and access any number of internal properties
for vertices and edges.</p>
<p>One can introduce bundled properties into an
either graph type by providing a user-defined class
type for the <code>VertexProperties</code> or
<code>EdgeProperties</code> template arguments. The user-defined
class may alternatively be placed at the end of a
<code>property</code> list, replacing the (implicit)
<code>boost::no_property</code> argument.</p>
<h2>Example: Route planning</h2>
<p>Consider the implementation of a simple route planner that
should find the shortest directions from one city to another
via a set of highways. The vertices of the graph are cities,
and we may wish to store several bits of information about the
city within each vertex:</p>
<pre>
struct City
{
string name;
int population;
vector&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>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>With bundled properties, we can directly use the
<code>City</code> and <code>Highway</code> structures:</p>
<pre>
typedef boost::adjacency_list&lt;
boost::listS, boost::vecS, boost::bidirectionalS,
City, Highway&gt; Map;
</pre>
<h2>Accessing bundled properties</h2>
<p>To access a bundled property for a particular edge or vertex,
subscript your graph with the descriptor of the edge or vertex
whose bundled property you wish to access. For instance:</p>
<pre>
Map map; // load the map
Map::vertex_descriptor v = *vertices(map).first;
map[v].name = "Troy";
map[v].population = 49170;
map[v].zipcodes.push_back(12180);
Map::edge_descriptor e = *out_edges(v, map).first;
map[e].name = "I-87";
map[e].miles = 10;
map[e].speed_limit = 65;
map[e].lanes = 4;
map[e].divided = true;
</pre>
<h2>Properties maps from bundled properties</h2>
<p>Often one needs to create a property map from an internal
property for use in a generic algorithm. For instance, using the
graph without bundled properties we might invoke <a
href="dijkstra_shortest_paths.html">Dijkstra's shortest
paths</a> algorithm like this:</p>
<pre>
vector&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/LvaluePropertyMap.html">Lvalue Property Map</a> providing access to the
<code>City</code> values stored in each vertex.
<h2>Getting the type of bundled properties</h2>
<p>To get the type of the vertex or edge bundle for a given graph
type <tt>Graph</tt>, you can use the trait
classes <tt>vertex_bundle_type</tt>
and <tt>edge_bundle_type</tt>. The
type <tt>vertex_bundle_type&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>
+34 -35
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Challenge</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -25,30 +21,25 @@
<ul>
<li>Dynamic graph algorithms such as described in <a
href="http://citeseer.ist.psu.edu/eppstein99dynamic.html">Dynamic Graph
Algorithms</a> and <a
href="http://citeseer.ist.psu.edu/alberts98software.html">A Software
Library of Dynamic Graph Algorithms</a>.
<li>Polish up code/docs for pending items and champion the formal
review. The pending items are:</li>
<ul>
<li><tt>container_traits.hpp</tt> (this should also include
the work Matt Austern is doing on this topic)</li>
<li><tt>concept_checks.hpp</tt> </li>
<li><tt>property.hpp</tt></li>
<li>The queues and heaps: <tt>queue.hpp</tt>,
<tt>mutable_queue.hpp</tt>, <tt>fibonacci_heap.hpp</tt>.
Somehow merge implementation with Dietmer's heaps and queues.</li>
<li><tt>iterator_adaptor.hpp</tt> (need to figure out
why this causes problems for VC++)</li>
<li><tt>disjoint_sets</tt> </li>
</ul>
<li>Port the graph library to Borland C++</li>
<li>Port the graph library to Metrowerks C++</li>
<li>Construct a set of planar graph algorithms.</li>
<ul>
<li> Is the graph planar?</li>
@@ -67,15 +58,19 @@ polygons.</li>
according to a user defined comparison object.</li>
</ul>
<li>Finish and test Maximum Flow algorithm.</li>
<li>Rewrite the Qhull algorithm using the Boost Graph Library (this is
high difficulty challenge). Or, for a more manageable challenge,
write an interface for Qhull with the BGL. <a
href="http://www.geom.umn.edu/locate/qhull">Qhull</a> computes the
convex hull, Delaunay triangulation, Voronoi diagram, and halfspace
intersection about a point. Qhull runs in 2-d, 3-d, 4-d, and higher
dimensions. Qhull is used for collision detection, animation, plate
tectonics, 3-d modeling, robot motion planning, and other <a
href="http://www.geom.umn.edu/~bradb/qhull-news.html#use">applications</a>.
It is currently difficult to use from a C++ program.
<li>Create an <tt>adjacency_matrix</tt> class that models
the <a href="./AdjacencyMatrix.html">AdjacencyMatrix</a>
concept.</li>
</li>
<li>Floyd-Warshall algorithm.</li>
<li>Rewrite the Qhull algorithm using the Boost Graph Library.</li>
<li>Explore the use of Algorithm Objects as an alternative to
the current approach with visitors.</li>
@@ -94,27 +89,31 @@ polygons.</li>
<li>Modularize the tests in test/graph.cpp to apply to particular
concepts. Make sure there are run-time tests for every BGL concept.</li>
<li>Write tests for the BGL algorithms. Currently the examples
are used as a sanity check, but they do not constitute a real test. </li>
<li>Write tests for the BGL algorithms. There are a few, but
more are needed. The example provide a sanity check but do not
provide full coverage.</li>
<li>Write up the examples from Knuth's <i>Stanford GraphBase</i> using
the BGL. The file <a
href="../example/miles_span.cpp"><tt>examples/miles_span.cpp</tt></a>
is a start.
is a start.</li>
<li>Create a class to support sub-graph views of a graph, where a
sub-graph behaves just like a graph, but shares vertex and edge
properties with the original graph. Perhaps even support sub-graphs
of sub-graphs, etc.
<li>Further testing of the <tt>subgraph</tt> class and add more
features.</li>
<li>Implement a minimum-cost maximum-flow algorithm.</li>
<li>Make the <tt>type</tt> of all (internal) property maps convertible to the <tt>const_type</tt> of the property maps.<li>
<li>Add static functions to <tt>adjacency_list</tt> to return the per-vertex, per-edge, and per-graph overhead.</li>
</ul>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+51
View File
@@ -0,0 +1,51 @@
<html><!--
-- Copyright (c) 2004 Trustees of Indiana University
--
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Function template circle_graph_layout</title></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table cellpadding="2" width="100%"><td valign="top"><img src="../../../boost.png" alt="boost.png (6897 bytes)" width="277" height="86"></td><td align="center"><a href="../../../index.htm">Home</a></td><td align="center"><a href="../../libraries.htm">Libraries</a></td><td align="center"><a href="http://www.boost.org/people/people.htm">People</a></td><td align="center"><a href="http://www.boost.org/more/faq.htm">FAQ</a></td><td align="center"><a href="../../../more/index.htm">More</a></td></table><hr><div class="refentry" lang="en"><a name="id103562-bb"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><img src="figs/python.gif" alt="(Python)"/><span class="refentrytitle">Function template circle_graph_layout</span></h2><p>boost::circle_graph_layout &#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/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.
+720
View File
@@ -0,0 +1,720 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<!--
-- Copyright (c) 2005 Trustees of Indiana University
--
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<head>
<title>Compressed Sparse Row Graph</title>
<STYLE TYPE="text/css">
<!--
.indent
{
padding-left: 50pt;
padding-right: 50pt;
}
-->
</STYLE>
<script language="JavaScript" type="text/JavaScript">
<!--
function address(host, user) {
var atchar = '@';
var thingy = user+atchar+host;
thingy = '<a hre' + 'f=' + "mai" + "lto:" + thingy + '>' + user+atchar+host + '</a>';
document.write(thingy);
}
//-->
</script>
</head>
<body>
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86"></img>
<h1>Compressed Sparse Row Graph</h1>
<p>The class template <code>compressed_sparse_row_graph</code> is
a graph class that uses the compact Compressed Sparse Row (CSR)
format to store directed graphs. While CSR graphs have much less
overhead than many other graph formats (e.g., <a
href="adjacency_list.html"><code>adjacency_list</code></a>), they
do not provide any mutability: one cannot add or remove vertices
or edges from a CSR graph. Use this format in high-performance
applications or for very large graphs that you do not need to
change.</p>
<p>The CSR format stores vertices and edges in separate arrays,
with the indices into these arrays corresponding to the identifier
for the vertex or edge, respectively. The edge array is sorted by
the source of each edge, but contains only the targets for the
edges. The vertex array stores offsets into the edge array,
providing the offset of the first edge outgoing from each
vertex. Iteration over the out-edges for the <i>i</i><sup>th</sup>
vertex in the graph is achieved by
visiting <tt>edge_array[vertex_array[i]]</tt>, <tt>edge_array[vertex_array[i]+1]</tt>,
..., <tt>edge_array[vertex_array[i+1]]</tt>. This format minimizes
memory use to <i>O(n + m)</i>, where <i>n</i> and <i>m</i> are the
number of vertices and edges, respectively. The constants
multiplied by <i>n</i> and <i>m</i> are based on the size of the
integers needed to represent indices into the edge and vertex
arrays, respectively, which can be controlled using
the <a href="#template-parms">template parameters</a>.</p>
<ul>
<li><a href="#synopsis">Synopsis</a></li>
<li><a href="#where">Where Defined</a></li>
<li><a href="#models">Models</a></li>
<li><a href="#template-parms">Template parameters</a></li>
<li><a href="#properties">Properties</a></li>
<li><a href="#member-functions">Member functions</a>
<ul>
<li><a href="#constructors">Constructors</a></li>
<li><a href="#mutators">Mutators</a></li>
<li><a href="#property-access">Property access</a></li>
</ul></li>
<li><a href="#non-members">Non-member functions</a>
<ul>
<li><a href="#vertex-access">Vertex access</a></li>
<li><a href="#edge-access">Edge access</a></li>
<li><a href="#property-map-accessors">Property map accessors</a></li>
<li><a href="#incremental-construction-functions">Incremental construction functions</a></li>
</ul></li>
<li><a href="#example">Example</a></li>
</ul>
<a name="synopsis"></a><h2>Synopsis</h2>
<pre>
namespace boost {
template&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>();
template&lt;typename InputIterator&gt;
<a href="#edge-const">compressed_sparse_row_graph</a>(InputIterator edge_begin, InputIterator edge_end,
vertices_size_type numverts,
edges_size_type numedges = 0,
const GraphProperty&amp; prop = GraphProperty());
template&lt;typename InputIterator, typename EdgePropertyIterator&gt;
<a href="#edge-prop-const">compressed_sparse_row_graph</a>(InputIterator edge_begin, InputIterator edge_end,
EdgePropertyIterator ep_iter,
vertices_size_type numverts,
edges_size_type numedges = 0,
const GraphProperty&amp; prop = GraphProperty());
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</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="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">vertex</a>(vertices_size_type i, const compressed_sparse_row_graph&amp;);
<i>// <a href="#edge-access">Edge access</a></i>
std::pair&lt;out_edge_iterator, out_edge_iterator&gt;
<a href="#edge_range">edge_range</a>(vertex_descriptor u, vertex_descriptor v, const compressed_sparse_row_graph&amp;);
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>
template&lt;typename Graph&gt;
vertex_descriptor <a href=#add_vertex">add_vertex</a>(compressed_sparse_row_graph&amp; g);
template&lt;typename Graph&gt;
vertex_descriptor <a href=#add_vertices">add_vertices</a>(vertices_size_type count, compressed_sparse_row_graph&amp; g);
template&lt;typename Graph&gt;
edge_descriptor <a href=#add_edge">add_vertices</a>(vertex_descriptor src, vertex_descriptor tgt, 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 graphs, so this value must
be <code>boost::directedS</code>.<br>
<b>Default</b>: <code>boost::directedS</code>
</blockquote>
<a name="VertexProperty"></a><code>VertexProperty</code>
<blockquote>
A class type that will be
attached to each vertex in the graph. If this value
is <code>void</code>, no properties will be attached to
the vertices of the graph.<br>
<b>Default</b>: <code>void</code>
</blockquote>
<a name="EdgeProperty"></a><code>EdgeProperty</code>
<blockquote>
A class type that will be attached to each edge in the graph. If
this value is <code>void</code>, no properties will be
attached to the edges of the graph.<br>
<b>Default</b>: <code>void</code>
</blockquote>
<a name="GraphProperty"></a><code>GraphProperty</code>
<blockquote>
A nested set
of <code>property</code> templates that describe the
properties of the graph itself. If this value
is <code>no_property</code>, no properties will be attached to
the graph.<br>
<b>Default</b>: <code>no_property</code>
</blockquote>
<a name="Vertex"></a><code>Vertex</code>
<blockquote>
An unsigned integral type that will be
used as both the index into the array of vertices and as the
vertex descriptor itself. Larger types permit the CSR graph to
store more vertices; smaller types reduce the storage required
per vertex.<br>
<b>Default</b>: <code>std::size_t</code>
</blockquote>
<a name="EdgeIndex"></a><code>EdgeIndex</code>
<blockquote>
An unsigned integral type that will be used as the index into
the array of edges. As with the <code>Vertex</code> parameter,
larger types permit more edges whereas smaller types reduce
the amount of storage needed per
edge. The <code>EdgeIndex</code> type shall not be smaller
than the <code>Vertex</code> type, but it may be larger. For
instance, <code>Vertex</code> may be a 16-bit integer
(allowing 32,767 vertices in the graph)
whereas <code>EdgeIndex</code> could then be a 32-bit integer
to allow a complete graph to be stored in the CSR format.<br>
<b>Default</b>: <code>Vertex</code>
</blockquote>
<a name="properties"></a><h2>Interior Properties</h2>
<p> The <tt>compressed_sparse_row_graph</tt> allows properties to
be attached to its vertices, edges, or to the graph itself by way
of its <a href="#template-parms">template parameters</a>. These
properties may be accessed via
the <a href="#property-access">member</a>
and <a href="#property-map-accessors">non-member</a> property
access functions, using the <a href="bundles.html">bundled
properties</a> scheme.</p>
<p>The CSR graph provides two kinds of built-in
properties: <tt>vertex_index</tt>, which maps from vertices to
values in <tt>[0, n)</tt> and <tt>edge_index</tt>, which maps
from edges to values in <tt>[0, m)</tt>, where <tt>n</tt>
and <tt>m</tt> are the number of vertices and edges in the graph,
respectively. </p>
<a name="member-functions"></a><h2>Member Functions</h2>
<a name="constructors"></a><h3>Constructors</h3>
<pre><a name="default-const"></a>
compressed_sparse_row_graph();
</pre>
<p class="indent">Constructs a graph with no vertices or edges.</p>
<hr></hr>
<pre><a name="edge-const"></a>
template&lt;typename InputIterator&gt;
compressed_sparse_row_graph(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 <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-prop-const"></a>
template&lt;typename InputIterator, typename EdgePropertyIterator&gt;
compressed_sparse_row_graph(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="#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>
and have a <tt>vertex(i, g)</tt> function that retrieves the
<i>i</i><sup>th</sup> vertex in the graph.
<br><b>Parameters</b>
<ul>
<li><tt>g</tt>: The incoming graph.</li>
<li><tt>vi</tt>: A map from vertices to indices. If not
provided, <tt>get(vertex_index, g)</tt> will be used.</li>
<li><tt>numverts</tt>: The number of vertices in the graph
<tt>g</tt>. If not provided, <tt>Graph</tt> must be a model of
<a href="VertexListGraph.html">VertexListGraph</a>.</li>
<li><tt>numedges</tt>: The number of edges in the graph
<tt>g</tt>. If not provided, <tt>Graph</tt> must be a model of
<a href="EdgeListGraph.html">EdgeListGraph</a>.</li>
</ul>
</p>
<hr></hr>
<a name="property-access"></a><h3>Property Access</h3>
<pre><a name="vertex-subscript"></a>
VertexProperty&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"></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_range"></a>
std::pair&lt;out_edge_iterator, out_edge_iterator&gt;
edge_range(vertex_descriptor u, vertex_descriptor v, const compressed_sparse_row_graph&amp;);
</pre>
<p class="indent">
Returns all edges from <tt>u</tt> to <tt>v</tt>. Requires time
linear in the number of edges outgoing from <tt>u</tt>.
</p>
<hr></hr>
<pre><a name="edge"></a>
std::pair&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="#edge_range"><tt>edge_range</tt></a>
to retrieve all edges.
</p>
<hr></hr>
<pre><a name="edge_from_index"></a>
edge_descriptor edge_from_index(edges_size_type i, const compressed_sparse_row_graph&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_vertex"></a>
vertex_descriptor add_vertex(compressed_sparse_row_graph&amp; g)
</pre>
<p class="indent">
Add a new vertex to the end of the graph <tt>g</tt>, and return a
descriptor for that vertex. The new vertex will be greater than any of
the previous vertices in <tt>g</tt>.
</p>
<hr></hr>
<pre><a name="add_vertices"></a>
vertex_descriptor add_vertices(vertices_size_type count, compressed_sparse_row_graph&amp; g)
</pre>
<p class="indent">
Add <tt>count</tt> new vertices to the end of the graph <tt>g</tt>, and
return a descriptor for the smallest new vertex. The new vertices will
be greater than any of the previous vertices in <tt>g</tt>.
</p>
<hr></hr>
<pre><a name="add_edge"></a>
edge_descriptor add_edge(vertex_descriptor src, vertex_descriptor tgt, compressed_sparse_row_graph&amp; g)
</pre>
<p class="indent">
Add a new edge from <tt>src</tt> to <tt>tgt</tt> in the graph <tt>g</tt>,
and return a descriptor for it. There must not be an edge in <tt>g</tt>
whose source vertex is greater than <tt>src</tt>. If the vertex
<tt>src</tt> has out edges before this operation is called, there must be
none whose target is larger than <tt>tgt</tt>.
</p>
<hr></hr>
<a name="example"></a><h2>Example</h2>
<br>[<a
href="../example/csr-example.cpp">libs/graph/example/csr-example.cpp</a>]
<p>We will use the <tt>compressed_sparse_row_graph</tt> graph
class to store a simple Web graph. In this web graph the vertices
represent web pages and the edges represent links from one web
page to another. With each web page we want to associate a URL, so
we initially create a <tt>WebPage</tt> class that stores the
URL. Then we can create our graph type by providing
<tt>WebPage</tt> as a parameter to the
<tt>compressed_sparse_row_graph</tt> class template.</p>
<pre>
class WebPage
{
public:
std::string url;
};
// ...
typedef compressed_sparse_row_graph&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>
+102 -212
View File
@@ -1,266 +1,156 @@
<HTML>
<!--
-- Copyright (c) Jeremy Siek 2000
-- Copyright (c) Jeremy Siek 2000-2001
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Jeremy Siek makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: Connected Components</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1>
<A NAME="sec:connected-components"></A><A NAME="sec:strongly-connected-components"></A>
<TT>connected_components</TT>
<A NAME="sec:connected-components">
<img src="figs/python.gif" alt="(Python)"/>
<TT>connected_components</TT></A>
</H1>
<P>
<DIV ALIGN="left">
<TABLE CELLPADDING=3 border>
<TR><TH ALIGN="LEFT"><B>Graphs:</B></TH>
<TD ALIGN="LEFT">see below</TD>
</TR>
<TR><TH ALIGN="LEFT"><B>Properties:</B></TH>
<TD ALIGN="LEFT">components, color, discover time, finish time</TD>
</TR>
<TR><TH ALIGN="LEFT"><B>Complexity:</B></TH>
<TD ALIGN="LEFT"><i>O(V + E)</i></TD>
</TR>
</TABLE>
</DIV>
<P>
<PRE>
(1)
template &lt;class VertexListGraph, class Visitor,
class Components&gt;
typename property_traits&lt; Components &gt;::value_type
connected_components(VertexListGraph&amp; G, Components c,
Visitor v);
<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>);
(2)
template &lt;class VertexListGraph, class Visitor,
class Components, class Color&gt;
typename property_traits&lt;Components&gt;::value_type
connected_components(VertexListGraph&amp; G, Components c,
Color color, Visitor v);
(3)
template &lt;class VertexListGraph, class Visitor,
class Components, class DiscoverTime,
class FinishTime, class Color&gt;
typename property_traits&lt;Components&gt;::value_type
connected_components(VertexListGraph&amp; G, Components c,
DiscoverTime d, FinishTime f,
Color color, Visitor v);
<i>// there is not a non-named parameter version of this function</i>
</PRE>
<P>
The <TT>connected_component()</TT> function dispatches to two different
algorithms depending on whether the graph in question is directed or
undirected.
<P>
<UL>
<LI>Computes the strongly connected components of a directed graph
using the DFS/transpose/DFS algorithm&nbsp;[<A
HREF="bibliography.html#aho83:_data_struct_algo">1</A>,<A
HREF="bibliography.html#clr90">8</A>].
<P>
</LI>
<LI>Computes the connected components of an undirected graph using
a DFS-based approach. If the connected-components are to be
calculated over and over while a graph is changing the disjoint-set
based approach of function
<TT>dynamic_connected_components()</TT> is faster. For
``static'' graphs this DFS-based approach is faster&nbsp;[<A
HREF="bibliography.html#clr90">8</A>].
</LI>
</UL>
<P>
The output of the algorithm is recorded in the component property
map <TT>c</TT>, which will contain numbers giving the component ID
assigned to each vertex. The number of components is the return value
of the function.
<P>
The algorithm requires the use of several property maps: color,
discover time, and finish time. There are several versions of this
algorithm to accommodate whether you wish to use interior or exterior
property maps.
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>
<P>
<H3>Definitions</H3>
<h3>Parameters</h3>
<P>
A <I>connected component</I> of an undirected graph is a set of
vertices that are all reachable from each other. A <I>strongly
connected component</I> of a directed graph <i>G=(V,E)</i> is a
maximal set of vertices <i>U</i> which is in <i>V</i> such that for
every pair of vertices <i>u</i> and <i>v</i> in <i>U</i>, we have both
a path from <i>u</i> to <i>v</i> and path from <i>v</i> to
<i>u</i>. That is to say that <i>u</i> and <i>v</i> are reachable from
each other.
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>
<P>
<b>Python</b>: The parameter is named <tt>graph</tt>.
</blockquote>
<H3>Requirements on Types</H3>
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/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>
<P>
<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>
<UL>
<LI>The graph type must be a model of <a
href="./VertexListGraph.html">VertexListGraph</a>.
</LI>
<LI><TT>DiscoverTime</TT> and <TT>FinishTime</TT> must be models of <a
href="../../property_map/WritablePropertyMap.html">WritablePropertyMap</a>
and their value type must be an integer type. Vertex descriptors from
the graph should be usable as the key type for these maps.
</LI>
<LI>The <TT>Color</TT> map must be a <a
href="../../property_map/ReadWritePropertyMap.html">ReadWritePropertyMap</a>
and the graph's vertex descriptor type should be usable as the
map's key type. The value type of the map must be a
model of <I>ColorValue</I>.
</LI>
<LI>The <TT>Components</TT> type must be a model of <a
href="../../property_map/ReadWritePropertyMap.html">ReadWritePropertyMap</a>. The
value type of the <TT>Components</TT> property map should be
an integer type, preferably the same as the <TT>size_type</TT> of
the graph. The key type should be the graph's vertex descriptor
type.
</LI>
</UL>
<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/ReadWritePropertyMap.html">Read/Write
Property Map</a> and its key type must be the graph's vertex
descriptor type and the value type of the color map must model
<a href="./ColorValue.html">ColorValue</a>.<br>
<b>Default:</b> an <a
href="../../property_map/iterator_property_map.html">
</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/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>
<P>
<H3>Complexity</H3>
<P>
The time complexity for the strongly connected components algorithm is
<i>O(V + E)</i>. The time complexity for the connected components
algorithm is also <i>O(V + E)</i>.
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>
Calculating the connected components of an undirected graph. The
complete source is in file <a
href="../example/connected_components.cpp"><tt>examples/connected_components.cpp</tt></a>.
<P>
<PRE>
typedef discover_time_property&lt; finish_time_property
&lt; color_property&lt;&gt; &gt; &gt; VertexProperty;
typedef adjacency_list &lt;vecS, vecS, undirectedS, VertexProperty&gt; Graph;
typedef graph_traits&lt;Graph&gt;::vertex_descriptor Vertex;
const int N = 6;
Graph G(N);
add_edge(0, 1, G);
add_edge(1, 4, G);
add_edge(4, 0, G);
add_edge(2, 5, G);
std::vector&lt;int&gt; c(num_vertices(G));
int num = connected_components(G, c.begin(),
get_color_map(G), null_visitor());
cout &lt;&lt; endl;
std::vector&lt;int&gt;::iterator i;
cout &lt;&lt; "Total number of components: " &lt;&lt; num &lt;&lt; endl;
for (i = c.begin(); i != c.end(); ++i)
cout &lt;&lt; "Vertex " &lt;&lt; i - c.begin()
&lt;&lt; " is in component " &lt;&lt; *i &lt;&lt; endl;
cout &lt;&lt; endl;
</PRE>
The output is:
<PRE>
Total number of components: 3
Vertex 0 is in component 1
Vertex 1 is in component 1
Vertex 2 is in component 2
Vertex 3 is in component 3
Vertex 4 is in component 1
Vertex 5 is in component 2
</PRE>
<P>
Calculating the strongly connected components of a directed graph.
<PRE>
typedef discover_time_property&lt; finish_time_property
&lt; color_property&lt;&gt; &gt; &gt; VertexProperty;
typedef adjacency_list&lt; vecS, vecS, directedS, VertexProperty &gt; Graph;
const int N = 6;
Graph G(N);
add_edge(0, 1, G);
add_edge(1, 1, G);
add_edge(1, 3, G);
add_edge(1, 4, G);
add_edge(4, 3, G);
add_edge(3, 4, G);
add_edge(3, 0, G);
add_edge(5, 2, G);
typedef graph_traits&lt;Graph&gt;::vertex_descriptor Vertex;
std::vector&lt;int&gt; c(N);
int num = connected_components(G, c.begin(),
get_color_map(G), null_visitor());
cout &lt;&lt; endl;
cout &lt;&lt; "Total number of components: " &lt;&lt; num &lt;&lt; endl;
std::vector&lt;int&gt;::iterator i;
for (i = c.begin(); i != c.end(); ++i)
cout &lt;&lt; "Vertex " &lt;&lt; i - c.begin()
&lt;&lt; " is in component " &lt;&lt; *i &lt;&lt; endl;
}
</PRE>
The output is:
<PRE>
Total number of components: 3
Vertex 0 is in component 3
Vertex 1 is in component 3
Vertex 2 is in component 2
Vertex 3 is in component 3
Vertex 4 is in component 3
Vertex 5 is in component 1
</PRE>
<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</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+12 -16
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: Constructing Graph Algorithms</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -173,14 +169,14 @@ namespace boost {
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
Univ.of Notre Dame (<A
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
Univ.of Notre Dame (<A
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+116
View File
@@ -0,0 +1,116 @@
<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/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/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>
+247
View File
@@ -0,0 +1,247 @@
<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;Graph&gt;::vertex_descriptor s,
OutputIterator inverse_permutation,
ColorMap color, DegreeMap degree)
(2)
template &lt;class VertexListGraph, class OutputIterator&gt;
OutputIterator
cuthill_mckee_ordering(const VertexIndexMap&amp; G, OutputIterator inverse_permutation);
template &lt;class VertexListGraph, class OutputIterator, class VertexIndexMap&gt;
OutputIterator
cuthill_mckee_ordering(const VertexIndexMap&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;Graph&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>.<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
@@ -0,0 +1,326 @@
<HTML>
<!--
-- Copyright (c) Jeremy Siek 2000
--
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: Directed Acyclic Graph Shortest Paths</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1><A NAME="sec:dag_shortest_paths"></A>
<img src="figs/python.gif" alt="(Python)"/>
<TT>dag_shortest_paths</TT>
</H1>
<P>
<PRE>
<i>// named paramter version</i>
template &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/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/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/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/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/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/ReadWritePropertyMap.html">Read/Write
Property Map</a>. A vertex descriptor must be usable as the key type
of the map, and the value type of the map must be a model of
<a href="./ColorValue.html">Color Value</a>.<br>
<b>Default:</b> an <a
href="../../property_map/iterator_property_map.html">
<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.
+231
View File
@@ -0,0 +1,231 @@
/*
:Author: David Goodger
:Contact: goodger@users.sourceforge.net
:date: $Date$
:version: $Revision$
:copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
-- Copyright (c) 2005 Trustees of Indiana University
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
.first {
margin-top: 0 }
.last {
margin-bottom: 0 }
a.toc-backref {
text-decoration: none ;
color: black }
dd {
margin-bottom: 0.5em }
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.attention, div.caution, div.danger, div.error, div.hint,
div.important, div.note, div.tip, div.warning, div.admonition {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title {
color: red ;
font-weight: bold ;
font-family: sans-serif }
div.hint p.admonition-title, div.important p.admonition-title,
div.note p.admonition-title, div.tip p.admonition-title,
div.admonition p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em }
div.footer, div.header {
font-size: smaller }
div.sidebar {
margin-left: 1em ;
border: medium outset ;
padding: 0em 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr {
width: 75% }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font-family: serif ;
font-size: 100% }
pre.line-block {
font-family: serif ;
font-size: 100% }
pre.literal-block, pre.doctest-block {
margin-left: 2em ;
margin-right: 2em ;
background-color: #eeeeee }
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.option-argument {
font-style: italic }
span.pre {
white-space: pre }
span.problematic {
color: red }
table {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.citation {
border-left: solid thin gray ;
padding-left: 0.5ex }
table.docinfo {
margin: 2em 4em }
table.footnote {
border-left: solid thin black ;
padding-left: 0.5ex }
td, th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
th.docinfo-name, th.field-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap }
h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
font-size: 100% }
tt {
background-color: #eeeeee }
ul.auto-toc {
list-style-type: none }
+254 -163
View File
@@ -2,117 +2,232 @@
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. We make no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: Depth-First Search</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1><A NAME="sec:depth-first-search"></A>
<H1><A NAME="sec:depth-first-search"></A><img src="figs/python.gif" alt="(Python)"/>
<TT>depth_first_search</TT>
</H1>
<P>
<DIV ALIGN="LEFT">
<TABLE CELLPADDING=3 border>
<TR><TH ALIGN="LEFT"><B>Graphs:</B></TH>
<TD ALIGN="LEFT">directed and undirected</TD>
</TR>
<TR><TH ALIGN="LEFT"><B>Properties:</B></TH>
<TD ALIGN="LEFT">color</TD>
</TR>
<TR><TH ALIGN="LEFT"><B>Complexity:</B></TH>
<TD ALIGN="LEFT">time: <i>O(V + E)</i></TD>
</TR>
<TR><TH ALIGN="LEFT"><B>Where Defined:</B></TH>
<TD ALIGN="LEFT">
<a href="../../../boost/graph/depth_first_search.hpp"><TT>boost/graph/depth_first_search.hpp</TT></a>
</TD>
</TR>
</TABLE>
</DIV>
<P>
<PRE>
(1)
template &lt;class <a href="./VertexListGraph.html">VertexListGraph</a>, class <a href="./DFSVisitor.html">DFSVisitor</a>&gt;
void depth_first_search(VertexListGraph&amp; G, DFSVisitor v);
<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)
(2)
template &lt;class <a href="./VertexListGraph.html">VertexListGraph</a>, class <a href="./DFSVisitor.html">DFSVisitor</a>, class <a href="#ColorMap">ColorMap</a>&gt;
void depth_first_search(VertexListGraph&amp; G, DFSVisitor v, ColorMap c);
</PRE>
<P>
The <TT>depth_first_search()</TT> algorithm performs a depth-first
search (DFS) on a graph, invoking the methods of the graph search
visitor at the appropriate event-points. A depth-first search visits
all the vertices in a graph, starting with some arbitrary vertex and
then always choosing the next adjacent unvisited vertex. Once the DFS
reaches a vertex with no unvisited neighbors it backtracks to one of
the previous vertices and continues from there. Once all of the
vertices in the same connected component have been visited, another
arbitrary unvisited vertex is choosen and the depth-first search
resumes. A more detailed explanation of DFS is given in Section <A
HREF="./graph_theory_review.html#sec:dfs-algorithm">Depth-First
Search</A>. The depth-first exploration of each connected component is
implemented by the function <a
href="./depth_first_visit.html"><tt>depth_first_visit()</tt></a>.
<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>
The <tt>DFSVisitor</tt> supplied by the user determines what
actions are taken at each event-point within the algorithm.
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>ColorMap</tt> is used by the algorithm to keep track
of which vertices have been visited.
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>
DFS is used as the kernel for several other graph algorithms,
including <a
href="./topological_sort.html"><tt>topological_sort</tt></a> and two
of the connected component algorithms.
<a href="../../../boost/graph/depth_first_search.hpp"><TT>boost/graph/depth_first_search.hpp</TT></a>
<P>
<h3>Parameters</h3>
<H3>Requirements on Types</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>
<P>
<b>Python</b>: The parameter is named <tt>graph</tt>.
</blockquote>
<UL>
<LI>The type <TT>VertexListGraph</TT> must be a model of <a
href="./VertexListGraph.html">VertexListGraph</a>.
</LI>
<LI>In version (1) of the algorithm the graph must be a model of <a
href="./PropertyGraph.html">PropertyGraph</a> for
<TT>vertex_color_t</TT> and the color property map for the graph
must meet the same requirements as <TT>ColorMap</TT>.
</LI>
<LI><a name="ColorMap">The type <TT>ColorMap</TT> must be a model of <a
href="../../property_map/ReadWritePropertyMap.html">ReadWritePropertyMap</a>. The key type of <tt>ColorMap</tt> must be the vertex descriptor type for the graph and the value type of <TT>ColorMap</TT> must be a model of
<a href="./ColorValue.html">ColorValue</a>.</a>
</LI>
<LI>The <tt>DFSVisitor</tt> type must be a model of <a
href="./DFSVisitor.html">DFSVisitor</a>.
</LI>
</UL>
<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/ReadWritePropertyMap.html">Read/Write
Property Map</a> and its key type must be the graph's vertex
descriptor type and the value type of the color map must model
<a href="./ColorValue.html">ColorValue</a>.<br>
<b>Default:</b> an <a
href="../../property_map/iterator_property_map.html">
</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/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>
<P>
@@ -125,98 +240,74 @@ 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>
This example shows DFS applied to the graph in <A
HREF="./graph_theory_review.html#fig:dfs-example">Figure 1</A>. The
source code for this example is in <a
href="../example/dfs_basics.cpp"><TT>examples/dfs_basics.cpp</TT></a>.
<P>
<p></p>
<DIV ALIGN="CENTER"><A NAME="fig:dfs-example"></A></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 1:</STRONG>
Depth-first search spreading through a graph.
</CAPTION>
<TR><TD><IMG SRC="./figs/dfs_example.gif" width="166" height="91"></TD></TR>
</TABLE>
</DIV>
<p></p>
<P>
<PRE>
// Select the graph type we wish to use
typedef boost::adjacency_list&lt;boost::vecS, boost::vecS, boost::directedS&gt; Graph;
// Set up the vertex names
enum { u, v, w, x, y, z, N };
char name[] = { 'u', 'v', 'w', 'x', 'y', 'z' };
// Specify the edges in the graph
typedef std::pair&lt;int,int&gt; E;
E edge_array[] = { E(u,v), E(u,x), E(x,v), E(y,x),
E(v,y), E(w,y), E(w,z), E(z,z) };
Graph G(N, edge_array, edge_array + sizeof(edge_array)/sizeof(E));
// Some typedef's to save a little typing
typedef boost::graph_traits&lt;Graph&gt;::vertex_descriptor Vertex;
typedef boost::graph_traits&lt;Graph&gt;::vertices_size_type size_type;
typedef std::vector&lt;Vertex&gt;::iterator Piter;
typedef std::vector&lt;size_type&gt;::iterator Iiter;
// color, discover time, and finish time properties
std::vector&lt;default_color_type&gt; color(num_vertices(G));
std::vector&lt;size_type&gt; dtime(num_vertices(G));
std::vector&lt;size_type&gt; ftime(num_vertices(G));
boost::depth_first_search(G, boost::visit_timestamp(dtime.begin(), ftime.begin()),
color.begin());
// use std::sort to order the vertices by their discover time
std::vector&lt;size_type&gt; discover_order(N);
boost::iota(discover_order.begin(), discover_order.end(), 0);
std::sort(discover_order.begin(), discover_order.end(),
boost::indirect_cmp&lt;Iiter, std::less&lt;size_type&gt; &gt;(dtime.begin()));
std::cout &lt;&lt; "order of discovery: ";
for (int i = 0; i &lt; N; ++i)
std::cout &lt;&lt; name[ discover_order[i] ] &lt;&lt; " ";
std::vector&lt;size_type&gt; finish_order(N);
boost::iota(finish_order.begin(), finish_order.end(), 0);
std::sort(finish_order.begin(), finish_order.end(),
boost::indirect_cmp&lt;Iiter, std::less&lt;size_type&gt; &gt;(ftime.begin()));
std::cout &lt;&lt; endl &lt;&lt; "order of finish: ";
for (size_type i = 0; i &lt; N; ++i)
std::cout &lt;&lt; name[ finish_order[i] ] &lt;&lt; " ";
std::cout &lt;&lt; std::endl;
</PRE>
The output is:
<PRE>
order of discovery: u v y x w z
order of finish: x y v u z w
</PRE>
<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</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
Univ.of Notre Dame (<A
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
Univ.of Notre Dame (<A
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+86 -49
View File
@@ -2,58 +2,37 @@
<!--
-- Copyright (c) Jeremy Siek 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: Depth-First Visit</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H2><A NAME="sec:dfs"></A>
<img src="figs/python.gif" alt="(Python)"/>
<TT>depth_first_visit</TT>
</H2>
<P>
<DIV ALIGN="LEFT">
<TABLE CELLPADDING=3 border>
<TR><TH ALIGN="LEFT"><B>Graphs:</B></TH>
<TD ALIGN="LEFT">directed and undirected</TD>
</TR>
<TR><TH ALIGN="LEFT"><B>Properties:</B></TH>
<TD ALIGN="LEFT">color</TD>
</TR>
<TR><TH ALIGN="LEFT"><B>Complexity:</B></TH>
<TD ALIGN="LEFT">time: <i>O(E)</i></TD>
</TR>
<TR><TH ALIGN="LEFT"><B>Where Defined:</B></TH>
<TD ALIGN="LEFT">
<a href="../../../boost/graph/depth_first_search.hpp"><TT>boost/graph/depth_first_search.hpp</TT></a>
</TD>
</TR>
</TABLE>
</DIV>
<P>
<PRE>
template &lt;class <a href="./IncidenceGraph.html">IncidenceGraph</a>, class <a href="./DFSVisitor.html">DFSVisitor</a>, class <a href="#ColorMap">ColorMap</a>&gt;
template &lt;class <a href="./IncidenceGraph.html">IncidenceGraph</a>, class <a href="./DFSVisitor.html">DFSVisitor</a>, class ColorMap&gt;
void depth_first_visit(IncidenceGraph& g,
typename graph_traits&lt;IncidenceGraph&gt;::vertex_descriptor s,
DFSVisitor&amp; vis, ColorMap color)
template &lt;class <a href="./IncidenceGraph.html">IncidenceGraph</a>, class <a href="./DFSVisitor.html">DFSVisitor</a>, class ColorMap,
class TerminatorFunc&gt;
void depth_first_visit(IncidenceGraph& g,
typename graph_traits&lt;IncidenceGraph&gt;::vertex_descriptor s,
DFSVisitor&amp; vis, ColorMap color, TerminatorFunc func = TerminatorFunc())
</PRE>
<P>
@@ -72,35 +51,93 @@ actions are taken at each event-point within the algorithm.
The <tt>ColorMap</tt> is used by the algorithm to keep track
of which vertices have been visited.
<P>
<p>The second variant can be used, for example, to find all marked vertices
reachable from a start vertex by a path which does not contain any another
marked vertices.
<H3>Requirements on Types</H3>
<P>
<UL>
<LI>The type <TT>IncidenceGraph</TT> must be a model of
<a href="./IncidenceGraph.html">IncidenceGraph</a>.
</LI>
<LI>The type <TT>DFSVisitor</TT> must be a model of <a
href="./DFSVisitor.html">DFSVisitor</a>.
</LI>
<LI><a name="ColorMap">The type <TT>ColorMap</TT> must be a model of <a
href="../../property_map/ReadWritePropertyMap.html">ReadWritePropertyMap</a>. The key type of <tt>ColorMap</tt> must be the vertex descriptor type for the graph and the value type of <TT>ColorMap</TT> must be a model of
<a href="./ColorValue.html">ColorValue</a>.</a>
</LI>
<h3>Where Defined:</h3>
</UL>
<a href="../../../boost/graph/depth_first_search.hpp"><TT>boost/graph/depth_first_search.hpp</TT></a>
<h3>Parameters</h3>
IN <tt>IncidenceGraph&amp; g</tt>
<blockquote>
A directed or undirected graph. The graph's 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 from which to start the search.<br>
<b>Python</b>: The parameter is named <tt>root_vertex</tt>.
</blockquote>
IN: <tt>DFSVisitor visitor</tt>
<blockquote>
A visitor object that is invoked inside the algorithm at the
event-points specified by the <a href="./DFSVisitor.html">DFS
Visitor</a> concept. The visitor object is passed by value <a
href="#1">[1]</a>.<br>
<b>Python</b>: The parameter should be an object that derives from
the <a href="DFSVisitor.html#python"><tt>DFSVisitor</tt></a> type of
the graph.
</blockquote>
UTIL: <tt>ColorMap color</tt>
<blockquote>
This is used by the algorithm to keep track of its progress through
the graph. The type <tt>ColorMap</tt> must be a model of <a
href="../../property_map/ReadWritePropertyMap.html">Read/Write
Property Map</a> and its key type must be the graph's vertex
descriptor type and the value type of the color map map must model
<a href="./ColorValue.html">Color Value</a>.<br>
<b>Python</b>: The color map must be a <tt>vertex_color_map</tt> for
the graph.
</blockquote>
IN: <tt>TerminatorFunc func</tt>
<blockquote>
A function object callable with two parameters - the descriptor of
vertex and the graph instance - and returning bool. The call is made
immediately after call to 'discover_vertex' visitor
event. If <tt>true</tt> is returned, the out edges of the vertex are
not examined, as if they don't exist.<br>
<b>Python</b>: Unsupported parameter.
</blockquote>
<P>
<h3>Complexity</h3>
Time complexity is <i>O(E)</i>.
<h3>Notes</h3>
<p><a name="1">[1]</a>
Since the visitor parameter is passed by value, if your visitor
contains state then any changes to the state during the algorithm
will be made to a copy of the visitor object, not the visitor object
passed in. Therefore you may want the visitor to hold this state by
pointer or reference.
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+12 -16
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. We make no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: dfs_visitor</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -101,14 +97,14 @@ and <a href="./property_writer.html"><tt>property_writer</tt></a>.
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
Univ.of Notre Dame (<A
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
Univ.of Notre Dame (<A
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+389 -182
View File
@@ -2,234 +2,441 @@
<!--
-- Copyright (c) Jeremy Siek 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Jeremy Siek makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: Dijkstra's Shortest Paths</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1><A NAME="sec:dijkstra"></A>
<H1><A NAME="sec:dijkstra"></A><img src="figs/python.gif" alt="(Python)"/>
<TT>dijkstra_shortest_paths</TT>
</H1>
<P>
<DIV ALIGN="left">
<TABLE CELLPADDING=3 border>
<TR><TH ALIGN="LEFT"><B>Graphs:</B></TH>
<TD ALIGN="LEFT">directed and undirected</TD>
</TR>
<TR><TH ALIGN="LEFT"><B>Properties:</B></TH>
<TD ALIGN="LEFT">color, distance, weight, vertex index</TD>
</TR>
<TR><TH ALIGN="LEFT"><B>Complexity:</B></TH>
<TD ALIGN="LEFT"><i>O((V + E) log V)</i>
</TD>
</TR>
<TR><TH ALIGN="LEFT"><B>Where Defined:</B></TH>
<TD ALIGN="LEFT">
<a href="../../../boost/graph/dijkstra_shortest_paths.hpp"><TT>boost/graph/dijkstra_shortest_paths.hpp</TT></a>
</TD>
</TR>
</TABLE>
</DIV>
<P>
<PRE>
(1)
template &lt;class <a href="./VertexListGraph.html">VertexListGraph</a>&gt;
<i>// named parameter version</i>
template &lt;typename Graph, typename P, typename T, typename R&gt;
void
dijkstra_shortest_paths(VertexListGraph& g,
typename graph_traits&lt;VertexListGraph&gt;::vertex_descriptor s);
dijkstra_shortest_paths(Graph&amp; g,
typename graph_traits&lt;Graph&gt;::vertex_descriptor s,
const bgl_named_params&lt;P, T, R&gt;&amp; params);
(2)
template &lt;class <a href="./VertexListGraph.html">VertexListGraph</a>, class <a href="#DistanceMap">DistanceMap</a>&gt;
void
dijkstra_shortest_paths(VertexListGraph& g,
typename graph_traits&lt;VertexListGraph&gt;::vertex_descriptor s,
DistanceMap d);
(3)
template &lt;class <a href="./VertexListGraph.html">VertexListGraph</a>, class <a href="#DistanceMap">DistanceMap</a>, class <a href="./UniformCostVisitor.html">UniformCostVisitor</a>&gt;
void
dijkstra_shortest_paths(VertexListGraph& g,
typename graph_traits&lt;VertexListGraph&gt;::vertex_descriptor s,
DistanceMap d, UniformCostVisitor visit);
(4)
template &lt;class <a href="./VertexListGraph.html">VertexListGraph</a>, class <a href="./UniformCostVisitor.html">UniformCostVisitor</a>,
class <a href="#DistanceMap">DistanceMap</a>, class <a href="#WeightMap">WeightMap</a>, class <a href="#ColorMap">ColorMap</a>, class <a href="#VertexIndexMap">VertexIndexMap</a>&gt;
void
dijkstra_shortest_paths(VertexListGraph& g,
typename graph_traits&lt;VertexListGraph&gt;::vertex_descriptor s,
DistanceMap distance, WeightMap weight, ColorMap color, VertexIndexMap id,
UniformCostVisitor vis);
<i>// non-named parameter version</i>
template &lt;typename Graph, typename <a href="DijkstraVisitor.html">DijkstraVisitor</a>,
typename PredecessorMap, typename DistanceMap,
typename WeightMap, typename VertexIndexMap, typename <a href="http://www.sgi.com/tech/stl/BinaryPredicate.html">CompareFunction</a>, typename <a href="http://www.sgi.com/tech/stl/BinaryFunction.html">CombineFunction</a>,
typename DistInf, typename DistZero, typename ColorMap = <i>default</i>&gt;
void dijkstra_shortest_paths
(const Graph&amp; g,
typename graph_traits&lt;Graph&gt;::vertex_descriptor s,
PredecessorMap predecessor, DistanceMap distance, WeightMap weight,
VertexIndexMap index_map,
CompareFunction compare, CombineFunction combine, DistInf inf, DistZero zero,
DijkstraVisitor vis, ColorMap color = <i>default</i>)
</PRE>
<P>
This is the modified Dijkstra algorithm&nbsp;[<A
HREF="bibliography.html#dijkstra59">10</A>,<A
HREF="bibliography.html#clr90">8</A>] which solves the single-source
shortest-paths problem on a weighted, directed graph for the case
where all edge weights are nonnegative. See Section <A
HREF="graph_theory_review.html#sec:shortest-path-algorithms">Shortest-Paths Algorithms</A>
for some background to the shortest-path problem. The priority queue
used inside the algorithm is implemented with a heap for efficiency.
This algorithm&nbsp;[<A HREF="bibliography.html#dijkstra59">10</A>,<A
HREF="bibliography.html#clr90">8</A>] solves the single-source
shortest-paths problem on a weighted, directed or undirected graph for
the case where all edge weights are nonnegative. Use the Bellman-Ford
algorithm for the case when some edge weights are negative. Use
breadth-first search instead of Dijkstra's algorithm when all edge
weights are equal to one. For the definition of the shortest-path
problem see Section <A
HREF="graph_theory_review.html#sec:shortest-paths-algorithms">Shortest-Paths
Algorithms</A> for some background to the shortest-path problem.
</P>
<P>
There are four versions of the algorithm to accommodate whether the
necessary graph properties will be supplied by the graph object or
externally via a argument to this function. The properties needed by
the algorithm are distance, weight, color, and vertex index. Version 3
and 4 of the algorithm also include a visitor argument for added
extensibility.
There are two main options for obtaining output from the
<tt>dijkstra_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>
<P>
<H3>Requirements on Types</H3>
Dijkstra's algorithm finds all the shortest paths from the source
vertex to every other vertex by iteratively ``growing'' the set of
vertices <i>S</i> to which it knows the shortest path. At each step of
the algorithm, the next vertex added to <i>S</i> is determined by a
priority queue. The queue contains the vertices in <i>V - S</i><a
href="#1">[1]</a> prioritized by their distance label, which is the
length of the shortest path seen so far for each vertex. The vertex
<i>u</i> at the top of the priority queue is then added to <i>S</i>,
and each of its out-edges is relaxed: if the distance to <i>u</i> plus
the weight of the out-edge <i>(u,v)</i> is less than the distance
label for <i>v</i> then the estimated distance for vertex <i>v</i> is
reduced. The algorithm then loops back, processing the next vertex at
the top of the priority queue. The algorithm finishes when the
priority queue is empty.
</P>
<P>
The algorithm uses color markers (white, gray, and black) to keep
track of which set each vertex is in. Vertices colored black are in
<i>S</i>. Vertices colored white or gray are in <i>V-S</i>. White vertices have
not yet been discovered and gray vertices are in the priority queue.
By default, the algorithm will allocate an array to store a color
marker for each vertex in the graph. You can provide you own storage
and access for colors with the <tt>color_map()</tt> parameter.
</P>
<p>
The following is the pseudo-code for Dijkstra's single-source shortest
paths algorithm. <i>w</i> is the edge weight, <i>d</i> is the distance label,
and <i>p</i> is the predecessor of each vertex which is used to encode
the shortest paths tree. <i>Q</i> is a priority queue that supports the
DECREASE-KEY operation. The visitor event points for the algorithm are
indicated by the labels on the right.
</p>
<UL>
<LI>The type <TT>VertexListGraph</TT> must be a model of <a href="./VertexListGraph.html">VertexListGraph</a>.
</LI>
<li>In version (1) of the algorithm, the graph must be a <a href="./PropertyGraph.html">PropertyGraph</a> with respect to <tt>vertex_color_t</tt>,
<tt>vertex_distance_t</tt>, <tt>edge_weight_t</tt>, and <tt>vertex_index_t</tt></li>
<table>
<tr>
<td valign="top">
<pre>
DIJKSTRA(<i>G</i>, <i>s</i>, <i>w</i>)
<b>for</b> each vertex <i>u in V</i>
<i>d[u] := infinity</i>
<i>p[u] := u</i>
<i>color[u] :=</i> WHITE
<b>end for</b>
<i>color[s] := </i>GRAY
<i>d[s] := 0</i>
INSERT(<i>Q</i>, <i>s</i>)
<b>while</b> (<i>Q != &Oslash;</i>)
<i>u :=</i> EXTRACT-MIN(<i>Q</i>)
<i>S := S U { u }</i>
<b>for</b> each vertex <i>v in Adj[u]</i>
<b>if</b> (<i>w(u,v) + d[u] < d[v]</i>)
<i>d[v] := w(u,v) + d[u]</i>
<i>p[v] := u</i>
<b>if</b> (<i>color[v] =</i> WHITE)
<i>color[v] :=</i> GRAY
INSERT(<i>Q</i>, <i>v</i>)
<b>else if</b> (<i>color[v] =</i> GRAY)
DECREASE-KEY(<i>Q</i>, <i>v</i>)
<b>else</b>
<i>...</i>
<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>
<li>In version (2) of the algorithm, the graph must be a <a href="./PropertyGraph.html">PropertyGraph</a> with respect to <tt>vertex_color_t</tt>,
<tt>edge_weight_t</tt>, and <tt>vertex_index_t</tt></li>
initialize vertex <i>u</i>
<li>In version (3) of the algorithm, the graph must be a <a href="./PropertyGraph.html">PropertyGraph</a> with respect to <tt>vertex_color_t</tt>,
<tt>edge_weight_t</tt>, and <tt>vertex_index_t</tt></li>
<LI>The type <TT>UniformCostVisitor</TT> must be a model of <a href="./UniformCostVisitor.html">UniformCostVisitor</a>.
</LI>
<LI><a name="DistanceMap">The type <TT>DistanceMap</TT> must be a model of <a
href="../../property_map/ReadWritePropertyMap.html">ReadWritePropertyMap</a>. The
vertex descriptor type of the graph needs to be usable as the key
type of the distance map. The value type of the distance
map must be <a href="http://www.sgi.com/Technology/STL/LessThanComparable.html">LessThanComparable</a>.</a>
</LI>
<LI><a name="WeightMap">The type <TT>WeightMap</TT> must be a model of <a
href="../../property_map/ReadablePropertyMap.html">ReadablePropertyMap</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.</a>
</LI>
<LI><a name="ColorMap">The type <TT>ColorMap</TT> must be a model of
<a href="../../property_map/ReadWritePropertyMap.html">ReadWritePropertyMap</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">ColorValue</a>.</a>
</LI>
<LI><a name="VertexIndexMap">The type <TT>VertexIndexMap</TT> must be a model of <a
href="../../property_map/ReadablePropertyMap.html">ReadablePropertyMap</a>. The
value type of <TT>VertexIndexMap</TT> must be an integer type. The
integers must map vertex descriptors to the integers zero through
<tt>num_vertices(g) - 1</tt>. The vertex
descriptor type of the graph needs to be usable as the key type
of the vertex index map.</a>
</LI>
</UL>
<P>
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>
edge <i>(u,v)</i> not relaxed
finish vertex <i>u</i>
</pre>
</td>
</tr>
</table>
<h3>Where Defined</h3>
<a href="../../../boost/graph/dijkstra_shortest_paths.hpp"><tt>boost/graph/dijkstra_shortest_paths.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>.<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 weights
must all be non-negative, and the algorithm will throw a
<a href="./exception.html#negative_edge"><tt>negative_edge</tt></a>
exception is one of the edges is negative.
The type <tt>WeightMap</tt> must be a model of
<a href="../../property_map/ReadablePropertyMap.html">Readable Property Map</a>. The edge descriptor type of
the graph needs to be usable as the key type for the weight
map. The value type for this map must be
the same as the value type of the distance map.<br>
<b>Default:</b> <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&nbsp;[<A
HREF="bibliography.html#driscoll88">61</A>] when an edge is relaxed.
The type
<tt>VertexIndexMap</tt> must be a model of
<a href="../../property_map/ReadablePropertyMap.html">Readable Property Map</a>. The value type of the map must be an
integer type. The vertex descriptor type of the graph needs to be
usable as the key type of the map.<br>
<b>Default:</b> <tt>get(vertex_index, g)</tt>.
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/ReadWritePropertyMap.html">Read/Write
Property Map</a> whose key and value types are the same as the vertex
descriptor type of the graph.<br>
<b>Default:</b> <tt>dummy_property_map</tt><br>
<b>Python</b>: Must be a <tt>vertex_vertex_map</tt> for the graph.<br>
</blockquote>
UTIL/OUT: <tt>distance_map(DistanceMap 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/ReadWritePropertyMap.html">Read/Write
Property Map</a>. The vertex descriptor type of the graph needs to
be usable as the key type of the distance map.
The value type of the distance map is the element type of a <a
href="./Monoid.html">Monoid</a> formed with the <tt>combine</tt>
function object and the <tt>zero</tt> object for the identity
element. Also the distance value type must have a <a
href="http://www.sgi.com/tech/stl/StrictWeakOrdering.html">
StrictWeakOrdering</a> provided by the <tt>compare</tt> function
object.<br>
<b>Default:</b> <a
href="../../property_map/iterator_property_map.html">
<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.<br>
</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 <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><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/ReadWritePropertyMap.html">Read/Write
Property Map</a>. A vertex descriptor must be usable as the key type
of the map, and the value type of the map must be a model of
<a href="./ColorValue.html">Color Value</a>.<br>
<b>Default:</b> an <a
href="../../property_map/iterator_property_map.html">
<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="#2">[2]</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) log V)</i>, or just <i>O(E log V)</i>
if all vertices are reachable from the source.
The time complexity is <i>O(V log V)</i>.
<h3>Visitor Event Points</h3>
<ul>
<li><b><tt>vis.initialize_vertex(u, g)</tt></b>
is invoked on each vertex in the graph before the start of the
algorithm.
<li><b><tt>vis.examine_vertex(u, g)</tt></b>
is invoked on a vertex as it is removed from the priority queue
and added to set <i>S</i>. At this point we know that <i>(p[u],u)</i>
is a shortest-paths tree edge so
<i>d[u] = delta(s,u) = d[p[u]] + w(p[u],u)</i>. Also, the distances
of the examined vertices is monotonically increasing
<i>d[u<sub>1</sub>] <= d[u<sub>2</sub>] <= d[u<sub>n</sub>]</i>.
<li><b><tt>vis.examine_edge(e, g)</tt></b>
is invoked on each out-edge of a vertex immediately after it has
been added to set <i>S</i>.
<li><b><tt>vis.edge_relaxed(e, g)</tt></b>
is invoked on edge <i>(u,v)</i> if <i>d[u] + w(u,v) < d[v]</i>.
The edge <i>(u,v)</i> that participated in the last
relaxation for vertex <i>v</i> is an edge in the shortest paths tree.
<li><b><tt>vis.discover_vertex(v, g)</tt></b>
is invoked on vertex <i>v</i> when the edge
<i>(u,v)</i> is examined and <i>v</i> is WHITE. Since
a vertex is colored GRAY when it is discovered,
each reacable vertex is discovered exactly once. This
is also when the vertex is inserted into the priority queue.
<li><b><tt>vis.edge_not_relaxed(e, g)</tt></b>
is invoked if the edge is not relaxed (see above).
<li><b><tt>vis.finish_vertex(u, g)</tt></b>
is invoked on a vertex after all of its out edges have
been examined.
</ul>
<H3>Example</H3>
<P>
The source code for this example is in <a
href="../example/dijkstra.cpp"><TT>examples/dijkstra.cpp</TT></a>.
See <a href="../example/dijkstra-example.cpp">
<TT>example/dijkstra-example.cpp</TT></a> for an example of using Dijkstra's
algorithm.
<P>
<PRE>
int
main(int , char* [])
{
using namespace boost;
<H3>Notes</H3>
typedef property&lt;edge_weight_t, int&gt; weightp;
typedef adjacency_list&lt; listS, vecS, directedS,
property&lt;vertex_color_t,default_color_type&gt;, weightp &gt; Graph;
typedef graph_traits&lt;Graph&gt;::vertex_descriptor Vertex;
typedef std::pair&lt;int,int&gt; E;
const int num_nodes = 5;
E edges[] = { E(0,2),
E(1,1), E(1,3), E(1,4),
E(2,1), E(2,3),
E(3,4),
E(4,0), E(4,1) };
int weights[] = { 1, 2, 1, 2, 7, 3, 1, 1, 1};
Graph G(num_nodes, edges, edges + sizeof(edges)/sizeof(E), weights);
std::vector&lt;Vertex&gt; p(num_vertices(G));
std::vector&lt;int&gt; d(num_vertices(G));
Vertex s = *(vertices(G).first);
p[s] = s;
dijkstra_shortest_paths(G, s, &d[0],
make_ucs_visitor(record_predecessors(&p[0], on_edge_relaxed())));
std::cout &lt;&lt; "distances from start vertex:" &lt;&lt; std::endl;
graph_traits&lt;Graph&gt;::vertex_iterator vi, vend;
for(tie(vi,vend) = vertices(G); vi != vend; ++vi)
std::cout &lt;&lt; "distance(" &lt;&lt; *vi &lt;&lt; ") = " &lt;&lt; d[*vi] &lt;&lt; std::endl;
std::cout &lt;&lt; std::endl;
std::cout &lt;&lt; "shortest paths tree" &lt;&lt; std::endl;
adjacency_list&lt;&gt; tree(num_nodes);
for(tie(vi,vend) = vertices(G); vi != vend; ++vi)
if (*vi != p[*vi])
add_edge(p[*vi], *vi, tree);
print_graph(tree);
return 0;
}
</PRE>
The output is:
<PRE>
distances from start vertex:
distance(0) = 0
distance(1) = 6
distance(2) = 1
distance(3) = 4
distance(4) = 5
shortest paths tree
0 --> 2
1 -->
2 --> 3
3 --> 4
4 --> 1
</PRE>
<a name="1">[1]</a>
The algorithm used here saves a little space by not putting all <i>V -
S</i> vertices in the priority queue at once, but instead only those
vertices in <i>V - S</i> that are discovered and therefore have a
distance less than infinity.
<p><a name="2">[2]</a>
Since the visitor parameter is passed by value, if your visitor
contains state then any changes to the state during the algorithm
will be made to a copy of the visitor object, not the visitor object
passed in. Therefore you may want the visitor to hold this state by
pointer or reference.
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+125
View File
@@ -0,0 +1,125 @@
<HTML>
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
--
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: dijkstra_visitor</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H1>
<pre>
dijkstra_visitor&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="./DijkstraVisitor.html">DijkstraVisitor</a>.
<h3>Example</h3>
This is an excerpt from <a
href="../example/dave.cpp"><tt>examples/dave.cpp</tt></a>
where the <tt>copy_graph</tt> single-event visitor
is used to create a copy the shortest-paths search-tree calculated
by Dijkstra's algorithm.
<pre>
boost::dijkstra_shortest_paths
(G, vertex(a, G),
distance_map(make_iterator_property_map(distance.begin(), vertex_id, distance[0])).
predecessor_map(make_iterator_property_map(parent.begin(), vertex_id, parent[0])).
visitor(make_dijkstra_visitor(copy_graph(G_copy, on_examine_edge()))));
</pre>
<h3>Model of</h3>
<a href="./DijkstraVisitor.html">Dijkstra Visitor</a>
<H3>Template Parameters</H3>
<P>
<TABLE border>
<TR>
<th>Parameter</th><th>Description</th><th>Default</th>
</tr>
<TR><TD><TT>EventVisitorList</TT></TD>
<TD>
A list of <a href="./EventVisitor.html">EventVisitor</a>'s created
with <tt>std::pair</tt>.
</TD>
<TD><TT><a href="./null_visitor.html"><tt>null_visitor</tt></a></TT></TD>
</TR>
</table>
<H3>Where Defined</H3>
<P>
<a href="../../../boost/graph/dijkstra_shortest_paths.hpp">
<TT>boost/graph/dijkstra_shortest_paths.hpp</TT></a>
<h3>Member Functions</h3>
This class implements all of the member functions required by <a
href="./DijkstraVisitor.html">DijkstraVisitor</a>. In each
function the appropriate event is dispatched to the <a
href="./EventVisitor.html">EventVisitor</a>'s in the EventVisitorList.
<h3>Non-Member Functions</h3>
<table border>
<tr>
<th>Function</th><th>Description</th>
</tr>
<tr><td><tt>
template &lt;class EventVisitorList&gt;<br>
dijkstra_visitor&lt;EventVisitorList&gt;<br>
make_dijkstra_visitor(EventVisitorList ev_list);
</tt></td><td>
Returns the event visitor list adapted to be a Dijkstra Visitor.
</td></tr>
</table>
<h3>See Also</h3>
<a href="./visitor_concepts.html">Visitor concepts</a>
<p>
The following are event visitors: <a
href="./predecessor_recorder.html"><tt>predecessor_recorder</tt></a>,
<a href="./distance_recorder.html"><tt>distance_recorder</tt></a>
<a href="./time_stamper.html"><tt>time_stamper</tt></a>,
and <a href="./property_writer.html"><tt>property_writer</tt></a>.
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &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>
+12 -16
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. We make no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: distance_recorder</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -166,14 +162,14 @@ and <a href="./property_writer.html"><tt>property_writer</tt></a>.
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
Univ.of Notre Dame (<A
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
Univ.of Notre Dame (<A
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+13 -17
View File
@@ -2,19 +2,15 @@
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. Silicon Graphics makes no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: Edge List Class</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
@@ -108,7 +104,7 @@ of each vertex in the shortest paths tree.
</tr>
<TR><TD><TT>EdgeIterator</TT></TD> <TD>Must be model of <a
href="http://www.sgi.com/Technology/STL/InputIterator.html">InputIterator</a>
href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>
who's <TT>value_type</TT> must be a pair of vertex descriptors.</TD>
</TR>
@@ -211,14 +207,14 @@ Returns the target vertex of edge <TT>e</TT>.
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
Univ.of Notre Dame (<A
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
Univ.of Notre Dame (<A
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
<TD nowrap>Copyright &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>
+247
View File
@@ -0,0 +1,247 @@
<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: Edmunds-Karp Maximum Flow</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:edmunds_karp_max_flow">
<TT>edmunds_karp_max_flow</TT>
</H1>
<PRE>
<i>// named paramter version</i>
template &lt;class <a href="./Graph.html">Graph</a>, class P, class T, class R&gt;
typename detail::edge_capacity_value&lt;Graph, P, T, R&gt;::value_type
edmunds_karp_max_flow(Graph& 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 <a href="./Graph.html">Graph</a>,
class CapacityEdgeMap, class ResidualCapacityEdgeMap,
class ReverseEdgeMap, class ColorMap, class PredEdgeMap&gt;
typename property_traits&lt;CapacityEdgeMap&gt;::value_type
edmunds_karp_max_flow(Graph&amp; g,
typename graph_traits&lt;Graph&gt;::vertex_descriptor src,
typename graph_traits&lt;Graph&gt;::vertex_descriptor sink,
CapacityEdgeMap cap, ResidualCapacityEdgeMap res, ReverseEdgeMap rev,
ColorMap color, PredEdgeMap pred)
</PRE>
<P>
The <tt>edmunds_karp_max_flow()</tt> function calculates the maximum flow
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>
There are several special requirements on the input graph and property
map parameters for this algorithm. First, the directed graph
<i>G=(V,E)</i> that represents the network must be augmented to
include the 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) -> (v,u)</i> for all <i>(u,v)</i> in <i>E</i>. The
<tt>CapacityEdgeMap</tt> argument <tt>cap</tt> must map each edge in
<i>E</i> to a positive number, and each edge in <i>E<sup>T</sup></i>
to 0.
<p>
The algorithm is due to <a
href="./bibliography.html#edmonds72:_improvements_netflow">Edmonds and
Karp</a>, though we are using the variation called the ``labeling
algorithm'' described in <a
href="./bibliography.html#ahuja93:_network_flows">Network Flows</a>.
<p>
This algorithm provides a very simple and easy to implement solution to
the maximum flow problem. However, there are several reasons why this
algorithm is not as good as the <a
href="./push_relabel_max_flow.html"><tt>push_relabel_max_flow()</tt></a>
or the <a
href="./kolmogorov_max_flow.html"><tt>kolmogorov_max_flow()</tt></a>
algorithm.
<ul>
<li>In the non-integer capacity case, the time complexity is <i>O(V
E<sup>2</sup>)</i> which is worse than the time complexity of the
push-relabel algorithm <i>O(V<sup>2</sup>E<sup>1/2</sup>)</i>
for all but the sparsest of graphs.</li>
<li>In the integer capacity case, if the capacity bound <i>U</i> is
very large then the algorithm will take a long time.</li>
</ul>
<H3>Where Defined</H3>
<P>
<a href="../../../boost/graph/edmunds_karp_max_flow.hpp"><TT>boost/graph/edmunds_karp_max_flow.hpp</TT></a>
<P>
<h3>Parameters</h3>
IN: <tt>Graph&amp; g</tt>
<blockquote>
A directed graph. The
graph's type must be a model of <a
href="./VertexListGraph.html">VertexListGraph</a> and <a href="./IncidenceGraph.html">IncidenceGraph</a> For each edge
<i>(u,v)</i> in the graph, the reverse edge <i>(v,u)</i> must also
be in the graph.
</blockquote>
IN: <tt>vertex_descriptor src</tt>
<blockquote>
The source vertex for the flow network graph.
</blockquote>
IN: <tt>vertex_descriptor sink</tt>
<blockquote>
The sink vertex for the flow network graph.
</blockquote>
<h3>Named Parameters</h3>
IN: <tt>capacity_map(CapacityEdgeMap cap)</tt>
<blockquote>
The edge capacity property map. The type must be a model of a
constant <a
href="../../property_map/LvaluePropertyMap.html">Lvalue Property Map</a>. The
key type of the map must be the graph's edge descriptor type.<br>
<b>Default:</b> <tt>get(edge_capacity, g)</tt>
</blockquote>
OUT: <tt>residual_capacity_map(ResidualCapacityEdgeMap res)</tt>
<blockquote>
This maps edges to their residual capacity. The type must be a model
of a mutable <a
href="../../property_map/LvaluePropertyMap.html">Lvalue Property
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>
IN: <tt>reverse_edge_map(ReverseEdgeMap rev)</tt>
<blockquote>
An edge property map that maps every edge <i>(u,v)</i> in the graph
to the reverse edge <i>(v,u)</i>. The map must be a model of
constant <a href="../../property_map/LvaluePropertyMap.html">Lvalue
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>
UTIL: <tt>color_map(ColorMap color)</tt>
<blockquote>
Used by the algorithm to keep track of progress during the
breadth-first search stage. At the end of the algorithm, the white
vertices define the minimum cut set. The map must be a model of
mutable <a
href="../../property_map/LvaluePropertyMap.html">Lvalue Property Map</a>.
The key type of the map should be the graph's vertex descriptor type, and
the value type must be a model of <a
href="./ColorValue.html">ColorValue</a>.<br>
<b>Default:</b> an <a
href="../../property_map/iterator_property_map.html">
<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.
</blockquote>
UTIL: <tt>predecessor_map(PredEdgeMap pred)</tt>
<blockquote>
Use by the algorithm to store augmenting paths. The map must be a
model of mutable <a
href="../../property_map/LvaluePropertyMap.html">Lvalue Property Map</a>.
The key type must be the graph's vertex descriptor type and the
value type must be the graph's edge descriptor type.<br>
<b>Default:</b> an <a
href="../../property_map/iterator_property_map.html">
<tt>iterator_property_map</tt></a> created from a <tt>std::vector</tt>
of edge descriptors of size <tt>num_vertices(g)</tt> and
using the <tt>i_map</tt> for the index map.
</blockquote>
IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
<blockquote>
Maps each vertex of the graph to a unique integer in the range
<tt>[0, num_vertices(g))</tt>. This property map is only needed
if the default for the color or predecessor map is used.
The vertex index map must be a model of <a
href="../../property_map/ReadablePropertyMap.html">Readable Property
Map</a>. The key type of the map must be the graph's vertex
descriptor type.<br>
<b>Default:</b> <tt>get(vertex_index, g)</tt>
Note: if you use this default, make sure your graph has
an internal <tt>vertex_index</tt> property. For example,
<tt>adjacenty_list</tt> with <tt>VertexList=listS</tt> does
not have an internal <tt>vertex_index</tt> property.
</blockquote>
<h3>Complexity</h3>
The time complexity is <i>O(V E<sup>2</sup>)</i> in the general case
or <i>O(V E U)</i> if capacity values are integers bounded by
some constant <i>U</i>.
<h3>Example</h3>
The program in <a
href="../example/edmunds-karp-eg.cpp"><tt>example/edmunds-karp-eg.cpp</tt></a>
reads an example maximum flow problem (a graph with edge capacities)
from a file in the DIMACS format and computes the maximum flow.
<h3>See Also</h3>
<a href="./push_relabel_max_flow.html"><tt>push_relabel_max_flow()</tt></a><br>
<a href="./kolmogorov_max_flow.html"><tt>kolmogorov_max_flow()</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>
<!-- LocalWords: HTML Siek Edmunds BGCOLOR ffffff ee VLINK ALINK ff IMG SRC
-->
<!-- LocalWords: gif ALT BR sec edmunds karp TT DIV CELLPADDING TR TD PRE lt
-->
<!-- LocalWords: typename VertexListGraph CapacityEdgeMap ReverseEdgeMap gt
-->
<!-- LocalWords: ResidualCapacityEdgeMap VertexIndexMap src rev ColorMap pred
-->
<!-- LocalWords: PredEdgeMap tt href html hpp ul li nbsp br LvaluePropertyMap
-->
<!-- LocalWords: num ColorValue DIMACS cpp pre config iostream dimacs int std
-->
<!-- LocalWords: namespace vecS directedS cout endl iter ei HR valign nowrap
-->
<!-- LocalWords: jeremy siek htm Univ mailto jsiek lsc edu
p -->
+106
View File
@@ -0,0 +1,106 @@
// Boost.Graph library isomorphism test
// Copyright (C) 2001 Douglas Gregor (gregod@cs.rpi.edu)
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// For more information, see http://www.boost.org
//
// Revision History:
//
// 29 Nov 2001 Jeremy Siek
// Changed to use Boost.Random.
// 29 Nov 2001 Doug Gregor
// Initial checkin.
#define BOOST_INCLUDE_MAIN
#include <boost/test/test_tools.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/isomorphism.hpp>
//#include "isomorphism-v3.hpp"
#include <boost/property_map.hpp>
#include <iostream>
#include <fstream>
#include <map>
#include <algorithm>
#include <cstdlib>
#include <ctime>
using namespace boost;
enum { a, b, c, d, e, f, g, h };
enum { _1, _2, _3, _4, _5, _6, _7, _8 };
void test_isomorphism()
{
typedef adjacency_list<vecS, vecS, bidirectionalS> GraphA;
typedef adjacency_list<vecS, vecS, bidirectionalS> GraphB;
char a_names[] = "abcdefgh";
char b_names[] = "12345678";
GraphA Ga(8);
add_edge(a, d, Ga);
add_edge(a, h, Ga);
add_edge(b, c, Ga);
add_edge(b, e, Ga);
add_edge(c, f, Ga);
add_edge(d, a, Ga);
add_edge(d, h, Ga);
add_edge(e, b, Ga);
add_edge(f, b, Ga);
add_edge(f, e, Ga);
add_edge(g, d, Ga);
add_edge(g, f, Ga);
add_edge(h, c, Ga);
add_edge(h, g, Ga);
GraphB Gb(8);
add_edge(_1, _6, Gb);
add_edge(_2, _1, Gb);
add_edge(_2, _5, Gb);
add_edge(_3, _2, Gb);
add_edge(_3, _4, Gb);
add_edge(_4, _2, Gb);
add_edge(_4, _3, Gb);
add_edge(_5, _4, Gb);
add_edge(_5, _6, Gb);
add_edge(_6, _7, Gb);
add_edge(_6, _8, Gb);
add_edge(_7, _8, Gb);
add_edge(_8, _1, Gb);
add_edge(_8, _7, Gb);
std::vector<std::size_t> in_degree_A(num_vertices(Ga));
boost::detail::compute_in_degree(Ga, &in_degree_A[0]);
std::vector<std::size_t> in_degree_B(num_vertices(Gb));
boost::detail::compute_in_degree(Gb, &in_degree_B[0]);
degree_vertex_invariant<std::size_t*, GraphA>
invariantA(&in_degree_A[0], Ga);
degree_vertex_invariant<std::size_t*, GraphB>
invariantB(&in_degree_B[0], Gb);
std::vector<graph_traits<GraphB>::vertex_descriptor> f(num_vertices(Ga));
bool ret = isomorphism(Ga, Gb, &f[0], invariantA, invariantB,
(invariantB.max)(),
get(vertex_index, Ga), get(vertex_index, Gb));
assert(ret == true);
for (std::size_t i = 0; i < num_vertices(Ga); ++i)
std::cout << "f(" << a_names[i] << ")=" << b_names[f[i]] << std::endl;
BOOST_TEST(verify_isomorphism(Ga, Gb, &f[0]));
}
int test_main(int, char* [])
{
test_isomorphism();
return boost::report_errors();
}
+152
View File
@@ -0,0 +1,152 @@
<HTML>
<!--
-- Copyright (c) 2004, 2005 The Trustees of Indiana University
--
-- Use, modification and distribution is subject to the Boost Software
-- License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
--
-- Authors: Douglas Gregor
-- Jeremiah Willcock
-- Andrew Lumsdaine
-->
<Head>
<Title>Boost Graph Library: Erd&ouml;s-Renyi Generator</Title>
<script language="JavaScript" type="text/JavaScript">
<!--
function address(host, user) {
var atchar = '@';
var thingy = user+atchar+host;
thingy = '<a hre' + 'f=' + "mai" + "lto:" + thingy + '>' + user+atchar+host + '</a>';
document.write(thingy);
}
//-->
</script>
</head>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<tt>erdos_renyi_iterator</tt>
<br>
<PRE>
template&lt;typename RandomGenerator, typename Graph&gt;
class erdos_renyi_iterator
{
public:
typedef std::input_iterator_tag iterator_category;
typedef std::pair&lt;vertices_size_type, vertices_size_type&gt; value_type;
typedef const value_type&amp; reference;
typedef const value_type* pointer;
typedef void difference_type;
erdos_renyi_iterator();
erdos_renyi_iterator(RandomGenerator&amp; gen, vertices_size_type n,
double fraction = 0.0, bool allow_self_loops = false);
erdos_renyi_iterator(RandomGenerator&amp; gen, vertices_size_type n,
edges_size_type m, bool allow_self_loops = false);
// Iterator operations
reference operator*() const;
pointer operator-&gt;() const;
erdos_renyi_iterator&amp; operator++();
erdos_renyi_iterator operator++(int);
bool operator==(const erdos_renyi_iterator&amp; other) const;
bool operator!=(const erdos_renyi_iterator&amp; other) const;
};
</PRE>
<p> This class template implements a generator for Erd&ouml;s-Renyi
graphs, suitable for initializing an <a
href="adjacency_list.html"><tt>adjacency_list</tt></a> or other graph
structure with iterator-based initialization. An Erd&ouml;s-Renyi
graph <em>G = (n, p)</em> is a graph with <em>n</em> vertices
that. The probability of having an edge <em>(u, v)</em> in <em>G</em>
is <em>p</em> for any vertices <em>u</em> and <em>v</em>. Typically,
there are no self-loops, but the generator can optionally introduce
self-loops with probability <em>p</em>. This generator will not
produce any parallel edges and will produce edges in sorted order (as
required by, e.g., the <a
href="compressed_sparse_row.html"><tt>compressed_sparse_row_graph</tt></a>).</p>
<p>Erd&ouml;s-Renyi graphs typically exhibit very little
structure. For this reason, they are rarely useful in modeling
real-world problems. However, they are often used when determining
the theoretical complexity of complex graph algorithms.</p>
<p>If you want the possibility of generating parallel edges and don't
care about sorted order, use the <a
href="erdos_renyi_generator.html"><tt>erdos_renyi_iterator</tt></a>.</p>
<h3>Where Defined</h3>
<a href="../../../boost/graph/erdos_renyi_generator.hpp"><tt>boost/graph/erdos_renyi_generator.hpp</tt></a>
<h3>Constructors</h3>
<a name="default-constructor"/>
<pre>erdos_renyi_iterator();</pre>
<blockquote>
Constructs a past-the-end iterator.
</blockquote>
<pre>
erdos_renyi_iterator(RandomGenerator&amp; gen, vertices_size_type n,
double fraction = 0.0, bool allow_self_loops = false);
</pre>
<blockquote>
Constructs an Erd&ouml;s-Renyi generator iterator that creates a
graph with <tt>n</tt> vertices and a given <tt>fraction</tt> of the
total number of edges that a simple graph may have.
<tt>probability</tt>. Random vertices and edges are selected using the
random number generator <tt>gen</tt>. Self-loops are permitted only when
<tt>allow_self_loops</tt> is <tt>true</tt>.
</blockquote>
<pre>
erdos_renyi_iterator(RandomGenerator&amp; gen, vertices_size_type n,
edges_size_type m, bool allow_self_loops = false);
</pre>
<blockquote>
Constructs an Erd&ouml;s-Renyi generator iterator that creates a
graph with <tt>n</tt> vertices and <tt>m</tt> edges.
<tt>probability</tt>. Random vertices and edges are selected using the
random number generator <tt>gen</tt>. Self-loops are permitted only when
<tt>allow_self_loops</tt> is <tt>true</tt>.
</blockquote>
<H3>Example</H3>
<pre>
#include &lt;boost/graph/adjacency_list.hpp&gt;
#include &lt;boost/graph/erdos_renyi_generator.hpp&gt;
#include &lt;boost/random/linear_congruential.hpp&gt;
typedef boost::adjacency_list&lt;&gt; Graph;
typedef boost::erdos_renyi_iterator&lt;boost::minstd_rand, Graph&gt; ERGen;
int main()
{
boost::minstd_rand gen;
// Create graph with 100 nodes and edges with probability 0.05
Graph g(ERGen(gen, 100, 0.05), ERGen(), 100);
return 0;
}
</pre>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &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>
<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>
+46
View File
@@ -0,0 +1,46 @@
<HTML>
<!--
-- Copyright (c) Jeremy Siek 2002
--
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: Exceptions</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<h1><a href="../../../boost/graph/exception.hpp"><tt>boost/graph/exception.hpp</tt></a></h1>
<P>
The BGL defines several exception classes for reporting errors from
BGL algorithms. Many of the BGL algorithms place certain requirements
on the input graph. If these requirements are not met then the
algorithm can not successfully complete, and instead throws the
appropriate exception.
</P>
<h3>Synopsis</h3>
<pre>
struct <a name="bad_graph">bad_graph</a> : public invalid_argument {
bad_graph(const string& what_arg);
};
struct <a name="not_a_dag">not_a_dag</a> : public bad_graph {
not_a_dag();
};
struct <a name="negative_edge">negative_edge</a> : public bad_graph {
negative_edge();
};
struct <a name="negative_cycle">negative_cycle</a> : public bad_graph {
negative_cycle();
};
struct <a name="not_connected">not_connected</a> : public bad_graph {
not_connected();
};
</pre>
+83 -9
View File
@@ -2,28 +2,96 @@
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
--
-- Permission to use, copy, modify, distribute and sell this software
-- and its documentation for any purpose is hereby granted without fee,
-- provided that the above copyright notice appears in all copies and
-- that both that copyright notice and this permission notice appear
-- in supporting documentation. We make no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Boost Graph Library: FAQ</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../c++boost.gif"
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<h1>Frequently Asked Questions</h1>
<ol>
<li>
How do I perform an early exit from an algorithm such as BFS?<br>
<p>
Create a visitor that throws an exception when you want to cut off the
search, then put your call to <tt>breadth_first_search</tt> inside of
an appropriate try/catch block. This strikes many programmers as a
misuse of exceptions, however, much thought was put into the decision
to have exceptions has the preferred way to exit early. See boost
email discussions for more details.
</p>
<li>
Why is the visitor parameter passed by value rather than reference
in the various BGL algorithms?<br>
<p>
One of the usage scenarios that we wanted to support with the
algorithms was creating visitor objects on the fly, within the
argument list of the call to the graph algorithm. In this situation,
the visitor object is a temporary object. Now there is a truly
unfortunate rule in the C++ standard that says a temporary cannot be
bound to a non-const reference parameter. So we had to decide whether
we wanted to support this kind of usage and call-by-value, or not and
call-by-reference. We chose call-by-value, following in the footsteps
of the STL (which passes functors by value). The disadvantage of this
decision is that if your visitor contains state and changes that state
during the algorithm, the change will be made to a copy of the visitor
object, not the visitor object passed in. Therefore you may want the
visitor to hold this state by pointer or reference.
</p>
<li>Why does the BGL interface use friend functions (or free functions)
instead of member functions?<br>
<p>
For the most part, the differences between member functions and free
functions are syntactic, and not very important, though people can get
religious about them. However, we had one technical reason for
favoring free functions. A programmer can overload a free function for
a type coming from a 3rd party without modifying the source
code/definition of that type. There are several uses of this in the
BGL. For example, Stanford GraphBase and LEDA graphs can both be used
in BGL algorithms because of overloads in <tt>stanford_graph.hpp</tt>
and <tt>leda_graph.hpp</tt>. One can even use
<tt>std::vector&lt;std::list&gt;</tt> as a graph due to the overloads
in <tt>vector_as_graph.hpp</tt>.
</p>
<p>
Of course, there is a way to adapt 3rd party classes into an interface
with member functions. You create an adaptor class. However, the
disadvantage of an adaptor class (compared to overloaded functions) is
that one has to physically wrap and unwrap the objects as they go
into/out of BGL algorithms. So the overloaded function route is more
convenient. Granted, this is not a huge difference, but since there
weren't other strong reasons, it was enough for us to choose free
functions.
</p>
<p>
Our religious reason for choosing free functions is to send the message
that BGL is a generic library, and not a traditional object-oriented
library. OO was hip in the 80s and 90s, but its time we moved beyond!
</p>
</li>
<li>How do I create a graph where the edges are sorted/ordered? <br>
<p>The example <a href="../example/ordered_out_edges.cpp">
<tt>ordered_out_edges.cpp</tt></a> shows how to do this.</p>
</li>
<li>Why does the algorithm X work with <tt>adjacency_list</tt> where
<tt>VertexList=vecS</tt> but not when <tt>VertexList=listS</tt>? <br><br>
Often the reason is that the algorithm expects to find the
@@ -76,3 +144,9 @@ argument to the algorithm.</li>
</ol>
<!-- LocalWords: gif ALT BGL std const STL GraphBase LEDA BFS stanford hpp OO
-->
<!-- LocalWords: leda cpp VertexList vecS listS undirectedS num cnt struct
-->
<!-- LocalWords: enum
-->
+5
View File
@@ -1,4 +1,9 @@
# -*- makefile -*-
# Copyright (c) 2002 Trustees of Indiana University
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
.SUFFIXES: .fig .gif .tif .jpeg
Binary file not shown.

After

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 968 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

+17
View File
@@ -0,0 +1,17 @@
graph A {
node[shape="circle"]
B [ style="filled", fillcolor="red" ];
G [ style="filled", fillcolor="red" ];
A [ style="filled", fillcolor="red" ];
A -- F[label="1"]
A -- B[label="1"]
A -- G[label="3"]
B -- C[label="0"]
B -- D[label="0"]
B -- E[label="1"]
C -- D[label="0"]
E -- F[label="1"]
G -- I[label="2"]
G -- H[label="2"]
H -- I[label="2"]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 786 B

+12 -15
View File
@@ -10,9 +10,6 @@ Single
2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
1 1 1.00 60.00 120.00
6975 3150 7500 3000
2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
1 1 1.00 60.00 120.00
6525 3825 7650 3075
2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
1 1 1.00 60.00 120.00
6975 2175 7575 2775
@@ -22,23 +19,23 @@ Single
2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
1 1 1.00 60.00 120.00
6975 2625 7575 2850
2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
1 1 1.00 60.00 120.00
4350 2625 4800 2625
2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
1 1 1.00 60.00 120.00
4350 2550 5175 2100
2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
1 1 1.00 60.00 120.00
2250 3075 2850 2700
2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
1 1 1.00 60.00 120.00
3900 3225 4875 3225
4 0 0 100 0 19 18 0.0000 4 255 2070 4350 3900 AdacencyMatrix\001
2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 1 0 2
1 1 1.00 60.00 120.00
6525 4350 7650 3150
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
1 1 1.00 60.00 120.00
3900 3225 4575 3825
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
1 1 1.00 60.00 120.00
6525 3900 7575 3075
4 0 0 100 0 19 18 0.0000 4 255 2040 5175 2100 IncidenceGraph\001
4 0 0 100 0 19 18 0.0000 4 255 2430 900 2100 BidirectionalGraph\001
4 0 0 100 0 19 18 0.0000 4 255 1935 4950 3300 EdgeListGraph\001
4 0 0 100 0 19 18 0.0000 4 255 795 7575 3000 Graph\001
4 0 0 100 0 19 18 0.0000 4 255 2145 4800 2700 AdjacencyGraph\001
4 0 0 100 0 19 18 0.0000 4 255 2100 2175 2700 VertexListGraph\001
4 0 0 100 0 19 18 0.0000 4 255 3285 600 3300 VertexAndEdgeListGraph\001
4 0 0 100 0 19 18 0.0000 4 255 1935 4575 3975 EdgeListGraph\001
4 0 0 100 0 19 18 0.0000 4 255 2100 4800 3300 VertexListGraph\001
4 0 0 100 0 19 18 0.0000 4 255 2145 4350 4500 AdjacencyMatrix\001
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

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