Compare commits

...

277 Commits

Author SHA1 Message Date
Jeremy W. Murphy 54a94911e6 Merge pull request #417 from boostorg/develop
Merge September 2024 to early February 2025
2025-02-15 20:07:27 +11:00
Jeremy W. Murphy 167ac18ae7 Merge pull request #400 from jorisvr/matching_joris
Replace implementation of maximum_weighted_matching()

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

Also remove requirement for a mutable graph on vertex_by_property().
2025-01-22 20:11:39 +11:00
Anthony Van Herrewege 15b587adb8 Fix vector insertion complexity from O(N) to O(1) 2025-01-16 11:49:58 +01:00
Anthony Van Herrewege 9096f61b27 Allow getting vertex property from const graph object 2025-01-16 11:49:58 +01:00
Joris van Rantwijk 5fa8626155 Add weighted_matching_example to Jamfile 2025-01-13 21:35:19 +01:00
Joris van Rantwijk 059365ffe8 Update maximum_weighted_matching documentation 2025-01-13 21:35:19 +01:00
Joris van Rantwijk fb66ac492f Replace maximum_weighted_matching implementation
The new code runs in O(V^3).
It also solves a number of known issues.
2025-01-13 21:35:19 +01:00
Joris van Rantwijk f30ba13a24 Add more tests for maximum_weighted_matching
- Hand-picked graphs to explore basic functionality.
- Graphs that are known to trigger bugs in the old
  implementation of maximum_weighted_matching().
- Random small graphs.
2025-01-13 21:32:38 +01:00
Jeremy W. Murphy 9176040132 Refactor the geometry details out into make and crosses 2025-01-02 09:35:40 +11:00
Jeremy W. Murphy 3244b38788 Use numeric_cast because size_t -> double is narrowing 2024-12-28 09:50:18 +11:00
Jeremy W. Murphy ce1daebc3d Merge pull request #405 from murraycu/develop-murrayc-examples-modern-cpp-attempt2
Examples: Fix minor warnings
2024-12-21 08:30:02 +11:00
Jeremy W. Murphy 68b08e32a0 Merge pull request #407 from samolisov/dominator-tree-deque-to-vector
Replace std::deque with std::vector for Lengauer-Tarjan
2024-12-21 08:27:48 +11:00
Pavel Samolysov ca7741a8d8 Replace std::deque with std::vector for Lengauer-Tarjan
Issue: #383
2024-12-19 13:39:44 +03:00
Jeremy W. Murphy 87b862c191 Fix #388 by using Boost.Geometry
"crosses" fits the requirement as it means that the interior parts of the
geometry share some common points, not exterior parts such as
end-points, and it means "not within".
2024-12-19 08:43:00 +11:00
Murray Cumming 350e8d74c4 Examples: Avoid signed/unsigned comparison warnings. 2024-12-15 17:32:17 +01:00
Murray Cumming c3868dcdb7 Example: Avoid unused variable warning. 2024-12-15 17:31:56 +01:00
Jeremy W. Murphy bdeaf549ec Merge pull request #402 from jorisvr/fix_doc_vertex
Fix time complexity spec of vertex()
2024-12-10 08:32:58 +11:00
Joris van Rantwijk ce24b257ca Fix time complexity spec of vertex() 2024-12-08 11:37:24 +01:00
Joris van Rantwijk f98edae416 weighted_matching_test check input file
Without this check, the test program declares all tests passed if it
fails to open the input file.
2024-12-03 21:38:27 +01:00
Jeremy W. Murphy 33b6802023 Merge pull request #394 from tsnorri/fix/cycle-canceling-dispatch1-call
Fix missing detail:: namespace qualification on call to cycle_canceling_dispatch1.
2024-11-19 23:51:59 +11:00
Tuukka Norri 98e541c930 Fix missing namespace name 2024-11-08 12:21:28 +02:00
Peter Dimov f1e51a0857 Add CMake subdir and install tests to ci.yml 2024-11-07 10:36:23 +02:00
Jeremy W. Murphy fdc6199b6d Merge pull request #393 from JulienDelacroix/warning
bron_kerbosch_all_cliques: Fix unused parameter/variable warnings
2024-11-01 16:14:55 +11:00
Julien DELACROIX 5c753bedae Fix unused parameter/variable warnings 2024-10-31 17:27:35 +01:00
Jeremy W. Murphy 4d6a196d04 Merge pull request #390 from danielyxyang/fix/undirected_dfs
fixed incorrect callbacks to finish_edge in undirected_dfs
2024-10-30 17:47:54 +11:00
Hermann Stamm-Wilbrandt 8a60b5a259 Merge branch 'boostorg:develop' into issue_is_straight_line_drawing 2024-10-12 19:37:00 +02:00
Hermann-SW bda28c863a add failing is_straight_line_drawing testcase 2024-10-12 19:35:43 +02:00
Daniel Yang b671e3d5e6 added test for checking dfs_visitor callbacks in undirected_dfs 2024-10-09 09:29:28 +02:00
Daniel Yang 0b63c6896a fixed advancement of the edge iterator 2024-10-09 08:44:02 +02:00
Daniel Yang 6f2e223c7d fixed incorrect callbacks to finish_edge in undirected_dfs 2024-10-09 08:41:09 +02:00
Jeremy W. Murphy d108c967a1 Fix Clang 7 std, remove 1z 2024-10-09 14:17:22 +11:00
Jeremy W. Murphy ba3022a97d Remove C++11 from GitHub Actions 2024-10-08 10:44:57 +11:00
Jeremy W. Murphy 8a52339716 Remove C++11 builds 2024-10-08 10:43:21 +11:00
Jeremy W. Murphy 41c1c56860 Merge pull request #386 from brunom/patch-1
Update publications.html
2024-09-23 06:25:14 +10:00
Bruno Martinez e0e3731ca6 Update publications.html 2024-09-22 12:22:44 -03:00
Jeremy W. Murphy 98019df3fd Merge pull request #385 from boostorg/disjoint_set_doc_fixes
Fix issue #384: broken links between disjoint_sets and incremental connected components
2024-09-12 09:54:26 +10:00
Jeremy W. Murphy 41d39a5162 Update disjoint_sets.html
Remove unnecessary dir prefix
2024-09-12 09:51:00 +10:00
Jeremy W. Murphy 3184d9a084 Fix broken link to disjoint_sets 2024-09-12 09:49:54 +10:00
Jeremy W. Murphy 212451425d Fix broken links to incremental components 2024-09-12 09:43:39 +10:00
Jeremy W. Murphy 198616d896 Merge pull request #377 from boostorg/develop
Merge a few years worth of changes
2024-05-20 16:12:26 +10:00
Jeremy W. Murphy 5557ccf921 Merge pull request #376 from sehe/pr-364
Fix security issue #364 and non-keyword subgraph parsing
2024-05-10 16:09:02 +10:00
Jeremy W. Murphy 17acf25da7 Merge pull request #375 from sehe/graphviz_test-refactor
Refactoring graphviz_test for review
2024-05-09 15:00:01 +10:00
Jeremy W. Murphy 64a3bae4f2 Merge pull request #374 from sehe/workaround-373
Fix and restore broken test_basic_csr_directed_graph
2024-05-09 14:50:52 +10:00
sehe 05aa9fd816 Include test for subgraph nesting limit
Eliminating need for manual re-test after review updates PR #376
2024-05-08 15:41:04 +02:00
sehe c71ceb8486 max_subgraph_nesting_level in read_graphviz_new 2024-05-08 14:48:06 +02:00
sehe 9c0ceda4c8 test_subgraphs verifies (keyword) subgraphs parse 2024-05-08 14:48:06 +02:00
sehe 5007b01ad5 Fix non-keyword subgraph parsing
Non-keyword graphs never worked (!). This was uncovered because of
security issue #364.

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

I've seperated fixtures (sample input + expected output) and this will
simplify invoking the ComparisonDriver (test_graph).
2024-05-08 14:43:53 +02:00
sehe 2154398906 Review comments 2024-05-08 14:39:27 +02:00
sehe b8150fac82 Restore broken test_basic_csr_directed_graph
Works around invalidation of bundle property maps (see #373).

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Inserting a `break` avoids static analysis warnings and avoids potentially calling the assertion handler twice.
2020-01-31 14:48:21 +00:00
Valentyn Shtronda 7c0a9d2998 One more correction of "Elementary Graph Theory" 2019-12-03 16:13:54 +02:00
Valentyn Shtronda c1803bbb4f Some vertices were omitted 2019-11-27 04:26:23 +02:00
Valentyn Shtronda 545428a4d0 Grammar/formatting 2019-11-27 04:25:30 +02:00
Valentyn Shtronda 53d0e93e43 Added missing parts.
Added parts that seems were lost long time ago during conversion to HTML.
2019-11-27 04:22:38 +02:00
Valentyn Shtronda 1eb8c16a76 Fixed HTML. 2019-11-27 04:17:17 +02:00
Billy K. Poon b9c3b14d39 Second file with forward iterator issue 2019-10-16 15:30:58 -07:00
Billy K. Poon 80b88a32e9 Use boost::first_max_element instead of std::max_element to avoid issue with forward iterator (#175) 2019-10-16 15:30:11 -07:00
246 changed files with 5448 additions and 3243 deletions
+64
View File
@@ -0,0 +1,64 @@
# Use, modification, and distribution are
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE.txt)
#
# Copyright Rene Rivera 2020.
# For Drone CI we use the Starlark scripting language to reduce duplication.
# As the yaml syntax for Drone CI is rather limited.
#
#
globalenv={}
linuxglobalimage="cppalliance/droneubuntu1604:1"
windowsglobalimage="cppalliance/dronevs2019"
def main(ctx):
return [
linux_cxx("g++-5 14", "g++-5", packages="g++-5", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-5', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("g++-5 1z", "g++-5", packages="g++-5", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-5', 'CXXSTD': '1z', }, globalenv=globalenv),
linux_cxx("g++-6 14", "g++-6", packages="g++-6", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-6', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("g++-6 1z", "g++-6", packages="g++-6", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-6', 'CXXSTD': '1z', }, globalenv=globalenv),
linux_cxx("g++-7 14", "g++-7", packages="g++-7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("g++-7 17", "g++-7", packages="g++-7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("g++-8 14", "g++-8", packages="g++-8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-8', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("g++-8 17", "g++-8", packages="g++-8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-8', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("g++-9 14", "g++-9", packages="g++-9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("g++-9 17", "g++-9", packages="g++-9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("g++-9 2a", "g++-9", packages="g++-9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': '2a', }, globalenv=globalenv),
linux_cxx("g++-10 14", "g++-10", packages="g++-10", image="cppalliance/droneubuntu2004:1", buildtype="boost", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("g++-10 17", "g++-10", packages="g++-10", image="cppalliance/droneubuntu2004:1", buildtype="boost", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("g++-10 20", "g++-10", packages="g++-10", image="cppalliance/droneubuntu2004:1", buildtype="boost", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': '20', }, globalenv=globalenv),
linux_cxx("clang++-4.0 14", "clang++-4.0", packages="clang-4.0", llvm_os="xenial", llvm_ver="4.0", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-4.0', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("clang++-5.0 14", "clang++-5.0", packages="clang-5.0", llvm_os="xenial", llvm_ver="5.0", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-5.0', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("clang++-6.0 14", "clang++-6.0", packages="clang-6.0", llvm_os="xenial", llvm_ver="6.0", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-6.0', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("clang++-7 14", "clang++-7", packages="clang-7", llvm_os="xenial", llvm_ver="7", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-7', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("clang++-7 17", "clang++-7", packages="clang-7", llvm_os="xenial", llvm_ver="7", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-7', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("clang++-8 14", "clang++-8", packages="clang-8", llvm_os="xenial", llvm_ver="8", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("clang++-8 17", "clang++-8", packages="clang-8", llvm_os="xenial", llvm_ver="8", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("clang++-8 2a", "clang++-8", packages="clang-8", llvm_os="xenial", llvm_ver="8", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': '2a', }, globalenv=globalenv),
linux_cxx("clang++-9 14", "clang++-9", packages="clang-9", llvm_os="xenial", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("clang++-9 17", "clang++-9", packages="clang-9", llvm_os="xenial", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("clang++-9 2a", "clang++-9", packages="clang-9", llvm_os="xenial", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': '2a', }, globalenv=globalenv),
linux_cxx("clang++-10 14", "clang++-10", packages="clang-10", llvm_os="xenial", llvm_ver="10", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': '14', }, globalenv=globalenv),
linux_cxx("clang++-10 17", "clang++-10", packages="clang-10", llvm_os="xenial", llvm_ver="10", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': '17', }, globalenv=globalenv),
linux_cxx("clang++-10 20", "clang++-10", packages="clang-10", llvm_os="xenial", llvm_ver="10", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': '20', }, globalenv=globalenv),
osx_cxx("XCode-11.7 14", "clang++", packages="", buildtype="boost", xcode_version="11.7", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '14', }, globalenv=globalenv),
osx_cxx("XCode-11.7 17", "clang++", packages="", buildtype="boost", xcode_version="11.7", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '17', }, globalenv=globalenv),
osx_cxx("XCode-11.7 2a", "clang++", packages="", buildtype="boost", xcode_version="11.7", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '2a', }, globalenv=globalenv),
]
# from https://github.com/boostorg/boost-ci
load("@boost_ci//ci/drone/:functions.star", "linux_cxx","windows_cxx","osx_cxx","freebsd_cxx")
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
+42
View File
@@ -0,0 +1,42 @@
#!/bin/bash
set -ex
export TRAVIS_BUILD_DIR=$(pwd)
export DRONE_BUILD_DIR=$(pwd)
export TRAVIS_BRANCH=$DRONE_BRANCH
export VCS_COMMIT_ID=$DRONE_COMMIT
export GIT_COMMIT=$DRONE_COMMIT
export PATH=~/.local/bin:/usr/local/bin:$PATH
echo '==================================> BEFORE_INSTALL'
. .drone/before-install.sh
echo '==================================> INSTALL'
cd ..
git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule update --init tools/build
git submodule update --init libs/config
git submodule update --init tools/boost_install
git submodule update --init libs/headers
git submodule update --init tools/boostdep
cp -r $TRAVIS_BUILD_DIR/* libs/graph
python tools/boostdep/depinst/depinst.py graph
./bootstrap.sh
./b2 headers
echo '==================================> BEFORE_SCRIPT'
. $DRONE_BUILD_DIR/.drone/before-script.sh
echo '==================================> SCRIPT'
echo "using $TOOLSET : : $COMPILER : $OPTIONS ;" > ~/user-config.jam
(cd libs/config/test && ../../../b2 cxxstd=$CXXSTD config_info_travis_install toolset=$TOOLSET && ./config_info_travis)
(cd libs/graph/test && ../../../b2 -j3 cxxstd=$CXXSTD toolset=$TOOLSET define=CI_SUPPRESS_KNOWN_ISSUES)
echo '==================================> AFTER_SUCCESS'
. $DRONE_BUILD_DIR/.drone/after-success.sh
+402
View File
@@ -0,0 +1,402 @@
# Copyright 2020 Evan Miller
# Copyright 2020 Matt Borland
# Copyright 2021 John Maddock
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
name: CI
on: [ push, pull_request ]
jobs:
ubuntu-focal:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
# Removed g++-10 because of an ICE; meant to be fixed in 10.2?
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94938
compiler: [ g++-9, clang++-10 ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: mstachniuk/ci-skip@v1
with:
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE]'
commit-filter-separator: ';'
fail-fast: true
- name: Set TOOLSET
run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV
- name: Add repository
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
- name: Install packages
run: sudo apt install g++-9 clang-10
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: cp -r $GITHUB_WORKSPACE/* libs/graph
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py graph
working-directory: ../boost-root
- name: Bootstrap
run: ./bootstrap.sh
working-directory: ../boost-root
- name: Generate headers
run: ./b2 headers
working-directory: ../boost-root
- name: Generate user config
run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} ;" > ~/user-config.jam'
working-directory: ../boost-root
- name: Config info
run: ../../../b2 print_config_info toolset=$TOOLSET cxxstd=14,17,2a
working-directory: ../boost-root/libs/config/test
- name: Test
run: ../../../b2 toolset=$TOOLSET cxxstd=14,17,2a
working-directory: ../boost-root/libs/graph/test
macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
toolset: [ clang ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: mstachniuk/ci-skip@v1
with:
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[linux];[Linux];[LINUX]'
commit-filter-separator: ';'
fail-fast: true
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: cp -r $GITHUB_WORKSPACE/* libs/graph
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py graph
working-directory: ../boost-root
- name: Bootstrap
run: ./bootstrap.sh
working-directory: ../boost-root
- name: Generate headers
run: ./b2 headers
working-directory: ../boost-root
- name: Config info
run: ../../../b2 print_config_info toolset=${{ matrix.toolset }} cxxstd=14,17,2a
working-directory: ../boost-root/libs/config/test
- name: Test
run: ../../../b2 toolset=${{ matrix.toolset }} cxxstd=14,17,2a define=CI_SUPPRESS_KNOWN_ISSUES
working-directory: ../boost-root/libs/graph/test
windows_msvc_14_2:
runs-on: windows-2019
defaults:
run:
shell: cmd
strategy:
fail-fast: false
matrix:
toolset: [ msvc-14.2 ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: mstachniuk/ci-skip@v1
with:
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX]'
commit-filter-separator: ';'
fail-fast: true
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\graph
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py graph
working-directory: ../boost-root
- name: Bootstrap
run: bootstrap
working-directory: ../boost-root
- name: Generate headers
run: b2 headers
working-directory: ../boost-root
- name: Config info
run: ..\..\..\b2 print_config_info cxxstd=14,17,20 address-model=64 toolset=msvc-14.2
working-directory: ../boost-root/libs/config/test
- name: Test
run: ..\..\..\b2 --hash address-model=64 cxxstd=14,17,20 toolset=msvc-14.2
working-directory: ../boost-root/libs/graph/test
windows_msvc_14_3:
runs-on: windows-2022
defaults:
run:
shell: cmd
strategy:
fail-fast: false
matrix:
toolset: [ msvc-14.3 ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: mstachniuk/ci-skip@v1
with:
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX]'
commit-filter-separator: ';'
fail-fast: true
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\graph
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py graph
working-directory: ../boost-root
- name: Bootstrap
run: bootstrap
working-directory: ../boost-root
- name: Generate headers
run: b2 headers
working-directory: ../boost-root
- name: Config info
run: ..\..\..\b2 print_config_info cxxstd=14,17,20 address-model=64 toolset=msvc-14.3
working-directory: ../boost-root/libs/config/test
- name: Test
run: ..\..\..\b2 --hash address-model=64 cxxstd=14,17,20 toolset=msvc-14.3
working-directory: ../boost-root/libs/graph/test
posix-cmake-subdir:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
- os: ubuntu-22.04
- os: ubuntu-24.04
- os: macos-13
- os: macos-14
- os: macos-15
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Install packages
if: matrix.install
run: sudo apt-get -y install ${{matrix.install}}
- name: Setup Boost
run: |
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
LIBRARY=${GITHUB_REPOSITORY#*/}
echo LIBRARY: $LIBRARY
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
echo GITHUB_REF: $GITHUB_REF
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}
echo REF: $REF
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
- name: Use library with add_subdirectory
run: |
cd ../boost-root/libs/$LIBRARY/test/cmake_subdir_test
mkdir __build__ && cd __build__
cmake ..
cmake --build .
ctest --output-on-failure --no-tests=error
posix-cmake-install:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
- os: ubuntu-22.04
- os: ubuntu-24.04
- os: macos-13
- os: macos-14
- os: macos-15
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Install packages
if: matrix.install
run: sudo apt-get -y install ${{matrix.install}}
- name: Setup Boost
run: |
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
LIBRARY=${GITHUB_REPOSITORY#*/}
echo LIBRARY: $LIBRARY
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
echo GITHUB_REF: $GITHUB_REF
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}
echo REF: $REF
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
- name: Configure
run: |
cd ../boost-root
mkdir __build__ && cd __build__
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DCMAKE_INSTALL_PREFIX=~/.local ..
- name: Install
run: |
cd ../boost-root/__build__
cmake --build . --target install
- name: Use the installed library
run: |
cd ../boost-root/libs/$LIBRARY/test/cmake_install_test && mkdir __build__ && cd __build__
cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
cmake --build .
ctest --output-on-failure --no-tests=error
windows-cmake-subdir:
strategy:
fail-fast: false
matrix:
include:
- os: windows-2019
- os: windows-2022
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Setup Boost
shell: cmd
run: |
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
echo LIBRARY: %LIBRARY%
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
echo GITHUB_REF: %GITHUB_REF%
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
set BOOST_BRANCH=develop
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
echo BOOST_BRANCH: %BOOST_BRANCH%
cd ..
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
- name: Use library with add_subdirectory (Debug)
shell: cmd
run: |
cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test
mkdir __build__ && cd __build__
cmake ..
cmake --build . --config Debug
ctest --output-on-failure --no-tests=error -C Debug
- name: Use library with add_subdirectory (Release)
shell: cmd
run: |
cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test/__build__
cmake --build . --config Release
ctest --output-on-failure --no-tests=error -C Release
windows-cmake-install:
strategy:
fail-fast: false
matrix:
include:
- os: windows-2019
- os: windows-2022
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Setup Boost
shell: cmd
run: |
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
echo LIBRARY: %LIBRARY%
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
echo GITHUB_REF: %GITHUB_REF%
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
set BOOST_BRANCH=develop
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
echo BOOST_BRANCH: %BOOST_BRANCH%
cd ..
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
- name: Configure
shell: cmd
run: |
cd ../boost-root
mkdir __build__ && cd __build__
cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix ..
- name: Install (Debug)
shell: cmd
run: |
cd ../boost-root/__build__
cmake --build . --target install --config Debug
- name: Install (Release)
shell: cmd
run: |
cd ../boost-root/__build__
cmake --build . --target install --config Release
- name: Use the installed library (Debug)
shell: cmd
run: |
cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test && mkdir __build__ && cd __build__
cmake -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix ..
cmake --build . --config Debug
ctest --output-on-failure --no-tests=error -C Debug
- name: Use the installed library (Release)
shell: cmd
run: |
cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test/__build__
cmake --build . --config Release
ctest --output-on-failure --no-tests=error -C Release
+4
View File
@@ -6,3 +6,7 @@ kevin-bacon2.dat
random.dot
triangular-fr.dot
triangular-kk.dot
test/*.dot
example/routing-table.dat
example/figs/ospf-sptree.dot
CMakeFiles/
-334
View File
@@ -1,334 +0,0 @@
# Copyright 2016, 2017 Peter Dimov
# Copyright 2018 Joh Maddock
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
language: cpp
python: "2.7"
dist : xenial
os:
- linux
- osx
branches:
only:
- master
- develop
- /feature\/.*/
env:
matrix:
- BOGUS_JOB=true
matrix:
exclude:
- env: BOGUS_JOB=true
include:
- os: linux
compiler: g++-4.4
env: TOOLSET=gcc COMPILER=g++-4.4 CXXSTD=98,0x
addons:
apt:
packages:
- g++-4.4
sources:
- ubuntu-toolchain-r-test
- os: linux
compiler: g++-4.6
env: TOOLSET=gcc COMPILER=g++-4.6 CXXSTD=03,0x
addons:
apt:
packages:
- g++-4.6
sources:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=03,11
addons:
apt:
packages:
- g++-4.7
sources:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=03,11
addons:
apt:
packages:
- g++-4.8
sources:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=03,11
addons:
apt:
packages:
- g++-4.9
sources:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=03,14
addons:
apt:
packages:
- g++-5
sources:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11
addons:
apt:
packages:
- g++-6
sources:
- ubuntu-toolchain-r-test
- os: linux
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=14,1z
addons:
apt:
packages:
- g++-6
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
compiler: g++-7
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11
addons:
apt:
packages:
- g++-7
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
compiler: g++-7
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=14,17
addons:
apt:
packages:
- g++-7
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
compiler: g++-8
env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=03,11
addons:
apt:
packages:
- g++-8
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
compiler: g++-8
env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=14,17
addons:
apt:
packages:
- g++-8
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
compiler: g++-9
env: TOOLSET=gcc COMPILER=g++-9 CXXSTD=14,2a
addons:
apt:
packages:
- g++-9
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=03,11
addons:
apt:
packages:
- clang-3.5
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.5
- os: linux
dist: trusty
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=03,11,14
addons:
apt:
packages:
- clang-3.6
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.6
- os: linux
dist: trusty
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03,11,14
addons:
apt:
packages:
- clang-3.7
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.7
- os: linux
dist: trusty
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03,11
addons:
apt:
packages:
- clang-3.8
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
- os: linux
dist: trusty
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03,11
addons:
apt:
packages:
- clang-3.9
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.9
- os: linux
compiler: clang++-4.0
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03,11,14
addons:
apt:
packages:
- clang-4.0
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-4.0
- os: linux
compiler: clang++-5.0
env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=11,14,1z
addons:
apt:
packages:
- clang-5.0
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-5.0
- os: linux
compiler: clang++-6.0
env: TOOLSET=clang COMPILER=clang++-6.0 CXXSTD=14,1z
addons:
apt:
packages:
- clang-6.0
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-6.0
- os: linux
compiler: clang++-7
env: TOOLSET=clang COMPILER=clang++-7 CXXSTD=14,1z
addons:
apt:
packages:
- clang-7
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-7
- os: linux
compiler: clang++-8
env: TOOLSET=clang COMPILER=clang++-8 CXXSTD=14,17,2a
addons:
apt:
packages:
- clang-8
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-8
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03
osx_image: xcode7.3
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=11
osx_image: xcode7.3
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=14,1z
osx_image: xcode7.3
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03
osx_image: xcode8.3
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=11
osx_image: xcode8.3
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=14,1z
osx_image: xcode8.3
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03
osx_image: xcode9.4.1
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=11
osx_image: xcode9.4.1
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=14,1z
osx_image: xcode9.4.1
install:
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
- cd ..
- git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update --init tools/boost_install
- git submodule update --init libs/headers
- git submodule update --init tools/build
- git submodule update --init libs/config
- git submodule update --init tools/boostdep
- cp -r $TRAVIS_BUILD_DIR/* libs/graph
- python tools/boostdep/depinst/depinst.py graph
- ./bootstrap.sh
- ./b2 headers
script:
- |-
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
- IFS=','
- for CXXLOCAL in $CXXSTD; do (cd libs/config/test && ../../../b2 config_info_travis_install toolset=$TOOLSET cxxstd=$CXXLOCAL && ./config_info_travis && rm ./config_info_travis) done
- unset IFS
- ./b2 -j3 libs/graph/test toolset=$TOOLSET cxxstd=$CXXSTD
notifications:
email:
on_success: always
+80
View File
@@ -0,0 +1,80 @@
# Copyright 2020, 2021 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.5...3.16)
project(boost_graph VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
add_library(boost_graph
src/graphml.cpp
src/read_graphviz_new.cpp
)
add_library(Boost::graph ALIAS boost_graph)
target_include_directories(boost_graph PUBLIC include)
target_link_libraries(boost_graph
PUBLIC
Boost::algorithm
Boost::any
Boost::array
Boost::assert
Boost::bimap
Boost::bind
Boost::concept_check
Boost::config
Boost::container_hash
Boost::conversion
Boost::core
Boost::detail
Boost::foreach
Boost::function
Boost::integer
Boost::iterator
Boost::lexical_cast
Boost::math
Boost::move
Boost::mpl
Boost::multi_index
Boost::optional
Boost::parameter
Boost::preprocessor
Boost::property_map
Boost::property_tree
Boost::random
Boost::range
Boost::serialization
Boost::smart_ptr
Boost::spirit
Boost::static_assert
Boost::throw_exception
Boost::tti
Boost::tuple
Boost::type_traits
Boost::typeof
Boost::unordered
Boost::utility
Boost::xpressive
PRIVATE
Boost::regex
)
target_compile_definitions(boost_graph
PUBLIC BOOST_GRAPH_NO_LIB
# Source files already define BOOST_GRAPH_SOURCE
# PRIVATE BOOST_GRAPH_SOURCE
)
if(BUILD_SHARED_LIBS)
target_compile_definitions(boost_graph PUBLIC BOOST_GRAPH_DYN_LINK)
else()
target_compile_definitions(boost_graph PUBLIC BOOST_GRAPH_STATIC_LINK)
endif()
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
add_subdirectory(test)
endif()
+9 -7
View File
@@ -1,11 +1,12 @@
Boost Graph Library [![Build Status](https://travis-ci.org/boostorg/graph.svg?branch=develop)](https://travis-ci.org/boostorg/graph)
# Boost Graph Library
===================
A generic interface for traversing graphs, using C++ templates.
The full documentation is available on [boost.org](http://www.boost.org/doc/libs/release/libs/graph/doc/index.html).
## Support, bugs and feature requests ##
## Support, bugs and feature requests
Bugs and feature requests can be reported through the [Github issue page](https://github.com/boostorg/graph/issues).
@@ -14,20 +15,21 @@ See also:
* [Current open issues](https://github.com/boostorg/graph/issues)
* [Closed issues](https://github.com/boostorg/graph/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aclosed)
* Old issues still open on [Trac](https://svn.boost.org/trac/boost/query?status=!closed&component=graph&desc=1&order=id)
* Closed issues on [Trac](https://svn.boost.org/trac/boost/query?status=closed&component=graph&col=id&col=summary&col=status&col=owner&col=type&col=milestone&col=version&desc=1&order=id)).
* Closed issues on [Trac](https://svn.boost.org/trac/boost/query?status=closed&component=graph&col=id&col=summary&col=status&col=owner&col=type&col=milestone&col=version&desc=1&order=id)
You can submit your changes through a [pull request](https://github.com/boostorg/graph/pulls). One of the maintainers will take a look (remember that it can take some time).
There is no mailing-list specific to Boost Graph, although you can use the general-purpose Boost [mailing-list](http://lists.boost.org/mailman/listinfo.cgi/boost-users) using the tag [graph].
## Development ##
### Build Status
| | Master | Develop |
|------------------|----------|-------------|
| Travis | [![Build Status](https://travis-ci.org/boostorg/graph.svg?branch=master)](https://travis-ci.org/boostorg/graph) | [![Build Status](https://travis-ci.org/boostorg/graph.svg)](https://travis-ci.org/boostorg/graph) |
| Appveyor | [![Build status](https://ci.appveyor.com/api/projects/status/78gegk21tc1g3v8d/branch/master?svg=true)](https://ci.appveyor.com/project/jzmaddock/graph/branch/master) | [![Build status](https://ci.appveyor.com/api/projects/status/78gegk21tc1g3v8d/branch/develop?svg=true)](https://ci.appveyor.com/project/jzmaddock/graph/branch/develop) |
| Github Actions | [![Build Status](https://github.com/boostorg/graph/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/boostorg/graph/actions) | [![Build Status](https://github.com/boostorg/graph/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/boostorg/graph/actions) |
|Drone | [![Build Status](https://drone.cpp.al/api/badges/boostorg/graph/status.svg?ref=refs/heads/master)](https://drone.cpp.al/boostorg/graph) | [![Build Status](https://drone.cpp.al/api/badges/boostorg/graph/status.svg)](https:/drone.cpp.al/boostorg/graph) |
## Development
Clone the whole boost project, which includes the individual Boost projects as submodules ([see boost+git doc](https://github.com/boostorg/boost/wiki/Getting-Started)):
@@ -45,7 +47,7 @@ Boost Graph Library is mostly made of headers but also contains some compiled co
**Note:** The Boost Graph Library cannot currently be built outside of Boost itself.
### Running tests ###
### Running tests
First, make sure you are in `libs/graph/test`.
You can either run all the 300+ tests listed in `Jamfile.v2` or run a single test:
-64
View File
@@ -1,64 +0,0 @@
# Copyright 2016 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
version: 1.0.{build}-{branch}
shallow_clone: true
branches:
only:
- master
- develop
platform:
- x64
environment:
matrix:
- ARGS: --toolset=msvc-9.0 address-model=32
- ARGS: --toolset=msvc-10.0 address-model=32
- ARGS: --toolset=msvc-11.0 address-model=32
- ARGS: --toolset=msvc-12.0 address-model=32
- ARGS: --toolset=msvc-14.0 address-model=32
- ARGS: --toolset=msvc-12.0 address-model=64
- ARGS: --toolset=msvc-14.0 address-model=64
- ARGS: --toolset=msvc-14.0 address-model=64 cxxflags=-std:c++latest
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
ARGS: --toolset=msvc-14.1 address-model=64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
ARGS: --toolset=msvc-14.1 address-model=32
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
ARGS: --toolset=msvc-14.1 address-model=64 cxxflags=-std:c++latest
- ARGS: --toolset=gcc address-model=64
PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
- ARGS: --toolset=gcc address-model=64 cxxflags=-std=gnu++1z
PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
- ARGS: --toolset=gcc address-model=32
PATH: C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;%PATH%
- ARGS: --toolset=gcc address-model=32 linkflags=-Wl,-allow-multiple-definition
PATH: C:\MinGW\bin;%PATH%
install:
- cd ..
- git clone -b %APPVEYOR_REPO_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule update --init tools/boost_install
- git submodule update --init libs/headers
- git submodule update --init tools/build
- git submodule update --init libs/config
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\graph
- git submodule update --init tools/boostdep
- python tools/boostdep/depinst/depinst.py graph
- bootstrap
- b2 headers
build: off
test_script:
- cd libs\config\test
- ..\..\..\b2 config_info_travis_install %ARGS%
- config_info_travis
- cd ..\..\graph\test
- ..\..\..\b2 -j3 --hash %ARGS%
-1
View File
@@ -16,7 +16,6 @@ lib boost_graph
read_graphviz_new.cpp
graphml.cpp
:
<library>../../regex/build//boost_regex
<link>shared:<define>BOOST_GRAPH_DYN_LINK=1
# Without these flags, MSVC 7.1 and 8.0 crash
# User reports that VC++ 8.0 does not fail anymore, so that is removed
+1 -1
View File
@@ -21,7 +21,7 @@
AdjacencyGraph
</H2>
The AdjacencyGraph concept provides and interface for efficient access
The AdjacencyGraph concept provides an interface for efficient access
of the adjacent vertices to a vertex in a graph. This is quite similar
to the <a href="./IncidenceGraph.html">IncidenceGraph</a> concept (the
target of an out-edge is an adjacent vertex). Both concepts are
+2 -1
View File
@@ -87,7 +87,8 @@ 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>.
<TT>adjacency_matrix_tag</TT>. You can also create your own
tag which should inherit from one or more of the above.
</td>
</tr>
+5
View File
@@ -453,6 +453,11 @@ Journal of the ACM (JACM), 23(2): 221-234, 1976.
<em>Data Structures for Weighted Matching and Nearest Common Ancestors with Linking</em><br>
Proceedings of the First Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 434-443, 1990.
<p></p><dt><a name="galil86">77</a>
<dd>Zvi Galil<br>
<em><a href="https://dl.acm.org/doi/pdf/10.1145/6462.6502">Efficient Algorithms for Finding Maximum Matching in Graphs</a></em><br>
ACM Computing Surveys (CSUR), 18(1), 23-38, 1986.
</dl>
<br>
+1 -1
View File
@@ -37,7 +37,7 @@ review. The pending items are:</li>
<tt>mutable_queue.hpp</tt>, <tt>fibonacci_heap.hpp</tt>.
Somehow merge implementation with Dietmer's heaps and queues.</li>
<li><tt>disjoint_sets</tt> (see <a href="disjoint_sets.html">)</li>
<li><tt>disjoint_sets</tt> (see <a href="disjoint_sets.html">Disjoint Sets</a>)</li>
</ul>
<li>Construct a set of planar graph algorithms.</li>
+2 -2
View File
@@ -169,7 +169,7 @@ disjoint_sets&lt;Rank, Parent, FindCompress&gt;
very slowly, much more slowly than the <i>log</i> function.</p>
<h3>See Also</h3><a href=
"../graph/doc/incremental_components.html"><tt>incremental_connected_components()</tt></a>
"incremental_components.html"><tt>incremental_connected_components()</tt></a>
<hr>
<pre>
disjoint_sets_with_storage&lt;ID,InverseID,FindCompress&gt;
@@ -181,7 +181,7 @@ disjoint_sets_with_storage&lt;ID,InverseID,FindCompress&gt;
The rank and parent properties are initialized during construction so the
each element is in a set by itself (so it is not necessary to initialize
objects of this class with the <a href=
"../graph/doc/incremental_components.html#sec:initialize-incremental-components">
"incremental_components.html#sec:initialize-incremental-components">
<tt>initialize_incremental_components()</tt></a> function). This class is
especially useful when computing the (dynamic) connected components of an
<tt>edge_list</tt> graph which does not provide a place to store vertex
+2 -2
View File
@@ -52,7 +52,7 @@ colors c<sub>1</sub>, c<sub>2</sub>, ..., c<sub>n</sub> in a way
that no vertex connects with 2 edges of the same color. Furthermore
at most m + 1 colors are used.
<!-- King, I.P. An automatic reordering scheme for simultaneous equations derived from network analysis. Int. J. Numer. Methods Engrg. 2 (1970), 523-533 -->
<!-- Misra, J., & Gries, D. (1992). A constructive proof of Vizing's theorem. In Information Processing Letters. -->
<h3>Where defined</h3>
<a href="../../../boost/graph/edge_coloring.hpp"><tt>boost/graph/edge_coloring.hpp</tt></a>
@@ -80,7 +80,7 @@ OUT: <tt>ColorMap color</tt>
<h3>Example</h3>
See <A
href="../example/edge_coloring.cpp"><tt>example/king_ordering.cpp</tt></A>.
href="../example/edge_coloring.cpp"><tt>example/edge_coloring.cpp</tt></A>.
<h3>See Also</h3>
+20 -21
View File
@@ -69,7 +69,6 @@ pair of letters. Now we can write down an example of a directed graph
as follows:
<P>
<BR>
<DIV ALIGN="center">
<table><tr><td><tt>
V = {v, b, x, z, a, y } <br>
@@ -103,17 +102,16 @@ Example of a directed graph.</CAPTION>
Next we have a similar graph, though this time it is undirected. <A
HREF="#fig:undirected-graph">Figure 2</A> gives the pictorial view.
Self loops are not allowed in undirected graphs. This graph is the <a
name="def:undirected-version"><I>undirected version</i></a. of the the
name="def:undirected-version"><i>undirected version</i></a> of the the
previous graph (minus the parallel edge <i>(b,y)</i>), meaning it has
the same vertices and the same edges with their directions removed.
Also the self edge has been removed, and edges such as <i>(a,z)</i>
and <i>(z,a)</i> are collapsed into one edge. One can go the other
way, and make a <a name="def:directed-version"><I>directed version</i>
way, and make a <a name="def:directed-version"><i>directed version</i>
of an undirected graph be replacing each edge by two edges, one
pointing in each direction.
<P>
<BR>
<DIV ALIGN="CENTER">
<table><tr><td><tt>
V = {v, b, x, z, a, y }<br>
@@ -136,7 +134,7 @@ Example of an undirected graph.</CAPTION>
<P>
Now for some more graph terminology. If some edge <i>(u,v)</i> is in
graph , then vertex <i>v</i> is <a
graph <i>G</i>, then vertex <i>v</i> is <a
name="def:adjacent"><I>adjacent</I></a> to vertex <i>u</i>. In a
directed graph, edge <i>(u,v)</i> is an <a
name="def:out-edge"><I>out-edge</I></a> of vertex <i>u</i> and an <a
@@ -175,7 +173,7 @@ name="def:simple-path"><I>simple</I></a> if none of the vertices in
the sequence are repeated. The path &lt;(b,x), (x,v)&gt; is simple,
while the path &lt;(a,z), (z,a)&gt; is not. Also, the path &lt;(a,z),
(z,a)&gt; is called a <a name="def:cycle"><I>cycle</I></a> because the
first and last vertex in the path are the same. A graph with no cycles
first and last vertices in the path are the same. A graph with no cycles
is <a name="def:acyclic"><I>acyclic</I></a>.
<P>
@@ -353,12 +351,12 @@ Breadth-first search spreading through a graph.</CAPTION>
<P>
<PRE>
order of discovery: s r w v t x u y
order of finish: s r w v t x u y
order of finish: s r w v t x u y
</PRE>
<P>
We start at vertex <i>s</i>, and first visit <i>r</i> and <i>w</i> (the two
neighbors of <i>s</i>). Once both neighbors of are visited, we visit the
neighbors of <i>s</i>). Once both neighbors of <i>s</i> are visited, we visit the
neighbor of <i>r</i> (vertex <i>v</i>), then the neighbors of <i>w</i>
(the discovery order between <i>r</i> and <i>w</i> does not matter)
which are <i>t</i> and <i>x</i>. Finally we visit the neighbors of
@@ -404,7 +402,8 @@ properly nested set of parenthesis. <A
HREF="#fig:dfs-example">Figure 7</A> shows
DFS applied to an undirected graph, with the edges labeled in the
order they were explored. Below we list the vertices of the graph
ordered by discover and finish time, as well as show the parenthesis structure. DFS is used as the kernel for several other graph
ordered by discover and finish time, as well as show the parenthesis
structure. DFS is used as the kernel for several other graph
algorithms, including topological sort and two of the connected
component algorithms. It can also be used to detect cycles (see the <A
HREF="file_dependency_example.html#sec:cycles">Cylic Dependencies </a>
@@ -424,7 +423,7 @@ Depth-first search on an undirected graph.</CAPTION>
<P>
<PRE>
order of discovery: a b e d c f g h i
order of finish: d f c e b a
order of finish: d f c e b a i h g
parenthesis: (a (b (e (d d) (c (f f) c) e) b) a) (g (h (i i) h) g)
</PRE>
@@ -442,8 +441,7 @@ total weight is given by
<i>w(T)</i> = sum of <i>w(u,v)</i> over all <i>(u,v)</i> in <i>T</i>,
where <i>w(u,v)</i> is the weight on the edge <i>(u,v)</i>
</DIV>
<BR CLEAR="ALL">
<P></P>
<BR CLEAR="ALL"><P></P>
<i>T</i> is called the <I>spanning tree</I>.
<!--
@@ -480,7 +478,7 @@ of a path</I><BR>
<p></p>
<DIV ALIGN="left">
<i>w(p) = sum from i=1..k of w(v<sub>i-1</sub>,v<sub>i</sub>)</i>
<i>w(p) = sum of w(v<sub>i-1</sub>,v<sub>i</sub>) for i=1..k</i>
</DIV>
<BR CLEAR="ALL"><P></P>
@@ -495,7 +493,7 @@ The <I>shortest path weight</I> from vertex <i>u</i> to <i>v</i> is then
</DIV>
<BR CLEAR="ALL"><P></P>
A <I>shortest path</I> is any path who's path weight is equal to the
A <I>shortest path</I> is any path whose path weight is equal to the
<I>shortest path weight</I>.
<P>
@@ -509,12 +507,12 @@ problem that are asymptotically faster than algorithms that solve the
single-source problem.
<P>
A <I>shortest-paths tree</I> rooted at vertex in graph <i>G=(V,E)</i>
is a directed subgraph <G'> where <i>V'</i> is a subset
A <I>shortest-paths tree</I> rooted at vertex <i>r</i> in graph <i>G=(V,E)</i>
is a directed subgraph <I>G'=(V',E')</I> where <i>V'</i> is a subset
of <i>V</i> and <i>E'</i> is a subset of <i>E</i>, <i>V'</i> is the
set of vertices reachable from , <i>G'</i> forms a rooted tree with
root , and for all <i>v</i> in <i>V'</i> the unique simple path from
to <i>v</i> in <i>G'</i> is a shortest path from to <i>v</i> in . The
set of vertices reachable from <i>r</i>, <i>G'</i> forms a rooted tree with
root <i>r</i>, and for all <i>v</i> in <i>V'</i> the unique simple path from <i>r</i>
to <i>v</i> in <i>G'</i> is a shortest path from <i>r</i> to <i>v</i> in <i>G</i>. The
result of a single-source algorithm is a shortest-paths tree.
<P>
@@ -532,7 +530,7 @@ constraints:
<p>
<i>f(u,v) <= c(u,v) for all (u,v) in V x V</i> (Capacity constraint) <br>
<i>f(u,v) = - f(v,u) for all (u,v) in V x V</i> (Skew symmetry)<br>
<i>sum<sub>v in V</sub> f(u,v) = 0 for all u in V - {s,t}</i> (Flow conservation)
<i>sum<sub>v in V</sub> f(u,v) = 0 for all v in V - {s,t}</i> (Flow conservation)
<p>
The <b><i>flow</i></b> of the network is the net flow entering the
@@ -553,7 +551,8 @@ The <b><i>maximum flow problem</i></b> is to determine the maximum
possible value for <i>|f|</i> and the corresponding flow values for
every vertex pair in the graph.
<p>
The <b><i>minimum cost maximum flow problem</i></b> is to determine the maximum flow which minimizes <i> sum<sub>(u,v) in E</sub>
The <b><i>minimum cost maximum flow problem</i></b> is to determine
the maximum flow which minimizes <i> sum<sub>(u,v) in E</sub>
cost(u,v) * f(u,v) </i>.
<p>
+2 -2
View File
@@ -200,9 +200,9 @@ The ways in which the vertices in the graph can be traversed.
The traversal category tags are:
<tt>incidence_graph_tag, adjacency_graph_tag,
bidirectional_graph_tag, vertex_list_graph_tag,
edge_list_graph_tag, vertex_and_edge_list_graph_tag,
edge_list_graph_tag,
adjacency_matrix_tag</tt>. You can also create your own
tag which should inherit from one of the above.
tag which should inherit from one or more of the above.
</td>
</tr>
+9 -3
View File
@@ -13,13 +13,13 @@
<h1 id="hawick_circuits"><code>hawick_circuits</code></h1>
<pre><code>template &lt;typename Graph, typename Visitor, typename VertexIndexMap&gt;
void hawick_circuits(Graph const&amp; graph, Visitor visitor, VertexIndexMap const&amp; vim = get(vertex_index, graph));
void hawick_circuits(Graph const&amp; graph, Visitor visitor, VertexIndexMap const&amp; vim = get(vertex_index, graph), unsigned int max_length = 0);
template &lt;typename Graph, typename Visitor, typename VertexIndexMap&gt;
void hawick_unique_circuits(Graph const&amp; graph, Visitor visitor, VertexIndexMap const&amp; vim = get(vertex_index, graph));
void hawick_unique_circuits(Graph const&amp; graph, Visitor visitor, VertexIndexMap const&amp; vim = get(vertex_index, graph), unsigned int max_length = 0);
</code></pre>
<p>Enumerate all the elementary circuits in a directed multigraph. Specifically,
<p>Enumerate all the elementary circuits (of length &le; <code>max_length</code>, if nonzero) in a directed multigraph. Specifically,
self-loops and redundant circuits caused by parallel edges are enumerated too.
<code>hawick_unique_circuits</code> may be used if redundant circuits caused by parallel
edges are not desired.</p>
@@ -59,6 +59,12 @@ edges are not desired.</p>
the vertex index map provided by the <code>graph</code>.</p>
</blockquote>
<p><strong>IN:</strong> <code>unsigned int max_length = 0</code></p>
<blockquote>
<p>The maximum circuit length to consider. Beyond this it truncates the depth-first search, reducing the computation time by ignoring longer circuits. The default value of <code>max_length = 0</code> implies no maximum.</p>
</blockquote>
<hr />
<div class="footer">
+1 -1
View File
@@ -44,7 +44,7 @@
incident(typename graph_traits&lt;Graph&gt;::edge_descriptor e, Graph& g)
</pre>
This function takes and edge descriptor and returns the pair of
This function takes an edge descriptor and returns the pair of
vertices that are <i>incident</i> to the edge. For directed graphs,
the <tt>first</tt> vertex is the source and the <tt>second</tt> vertex
is the target. This function is equivalent to the expression
+1 -1
View File
@@ -43,7 +43,7 @@ the situation where edges are both added and removed from the graph,
hence it is called <b><i>incremental</i></b><a
href="bibliography.html#eppstein97:dynamic_graph">[42]</a> (and not
fully dynamic). The disjoint-sets class is described in Section <A
HREF="../../disjoint_sets/disjoint_sets.html">Disjoint Sets</A>.
HREF="disjoint_sets.html">Disjoint Sets</A>.
<P>
The following five operations are the primary functions that you will
+1 -1
View File
@@ -17,7 +17,7 @@
alt="C++ Boost" width="277" height="86">
<h1>The Boost Graph Library (BGL)
<a href="http://www.awprofessional.com/title/0201729148">
<a href="https://www.informit.com/store/boost-graph-library-user-guide-and-reference-manual-9780132651837">
<img src="bgl-cover.jpg" alt="BGL Book" align="RIGHT"></a>
</h1>
+8 -15
View File
@@ -92,8 +92,8 @@ href="./VertexListGraph.html">Vertex List Graph</a>.
OUT: <tt>isomorphism_map(IsoMap f)</tt>
<blockquote>
The mapping from vertices in graph 1 to vertices in graph 2. This must
be a <a href="../../property_map/doc/ReadWritePropertyMap.html">Read/Write
The mapping from vertices in graph 1 to vertices in graph 2. <tt>IsoMap</tt>
must be a <a href="../../property_map/doc/ReadWritePropertyMap.html">Read/Write
Property Map</a>.<br> <b>Default:</b> an <a
href="../../property_map/doc/iterator_property_map.html"><tt>iterator_property_map</tt></a>
constructed from a <tt>std::vector</tt> of graph 2's vertex
@@ -111,12 +111,11 @@ This mapping can be used either to speed up the search (as is done by the
default value, which requires that the degrees of <i>v1</i> and <i>v2</i> are
equal) or to impose extra conditions on the result. The
<tt>VertexInvariant1</tt> and <tt>VertexInvariant2</tt> types must model <a
href="http://www.boost.org/sgi/stl/UnaryFunction.html">UnaryFunction</a>, with
the argument type of <tt>vertex_invariant1</tt> being <tt>Graph1</tt>'s vertex
href="http://www.boost.org/sgi/stl/AdaptableUnaryFunction.html">AdaptableUnaryFunction</a>,
with the argument type of <tt>vertex_invariant1</tt> being <tt>Graph1</tt>'s vertex
descriptor type, the argument type of <tt>vertex_invariant2</tt> being
<tt>Graph2</tt>'s vertex descriptor type, and both functions having integral
result types. The values returned by these two functions must be in the range
[0, <tt>vertex_max_invariant</tt>).
<tt>Graph2</tt>'s vertex descriptor type, and both functions sharing a
result type that is totally ordered and hashable, such as an integer.
<br>
<b>Default:</b> <tt>degree_vertex_invariant</tt> for both arguments<br>
<b>Python</b>: Unsupported parameter.
@@ -124,14 +123,8 @@ result types. The values returned by these two functions must be in the range
IN: <tt>vertex_max_invariant(std::size_t max_invariant)</tt>
<blockquote>
An upper bound on the possible values returned from either
vertex_invariant1 or vertex_invariant2.
<br>
<b>Default:</b> <tt>vertex_invariant2.max()</tt>. The default
<tt>vertex_invariant2</tt> parameter, an instance of
<tt>degree_vertex_invariant</tt>, defines this function to
return <tt>num_vertices(g2) * (num_vertices(g2)+1)</tt>.<br>
<b>Python</b>: Unsupported parameter.
This parameter is ignored as it is no longer necessary, but kept for backwards
compatibility.
</blockquote>
IN: <tt>vertex_index1_map(VertexIndex1Map i1_map)</tt>
+109 -51
View File
@@ -1,5 +1,6 @@
<html><head><!--
Copyright 2018 Yi Ji
Copyright 2025 Joris van Rantwijk
Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -20,6 +21,9 @@ void maximum_weighted_matching(const Graph&amp; g, MateMap mate);
template &lt;typename Graph, typename MateMap, typename VertexIndexMap&gt;
void maximum_weighted_matching(const Graph&amp; g, MateMap mate, VertexIndexMap vm);
template &lt;typename Graph, typename MateMap, typename VertexIndexMap, typename EdgeWeightMap&gt;
void maximum_weighted_matching(const Graph&amp; g, MateMap mate, VertexIndexMap vm, EdgeWeightMap weights);
template &lt;typename Graph, typename MateMap&gt;
void brute_force_maximum_weighted_matching(const Graph&amp; g, MateMap mate);
@@ -56,77 +60,126 @@ maximum weighted matching in any undirected graph. The matching is returned in a
<a href="../../property_map/doc/ReadWritePropertyMap.html">ReadWritePropertyMap</a>
that maps vertices to vertices. In the mapping returned, each vertex is either mapped
to the vertex it's matched to, or to <tt>graph_traits&lt;Graph&gt;::null_vertex()</tt> if it
doesn't participate in the matching. If no <tt>VertexIndexMap</tt> is provided, both functions
assume that the <tt>VertexIndexMap</tt> is provided as an internal graph property accessible
by calling <tt>get(vertex_index, g)</tt>.
doesn't participate in the matching.
</p>
<h3>Algorithm Description</h3>
<p>
The maximum weighted matching problem was solved by Edmonds in [<a href="bibliography.html#edmonds65:_max_weighted_match">74</a>].
The implementation of <tt>maximum_weighted_matching</tt> followed Chapter 6, Section 10 of [<a href="bibliography.html#lawler76:_comb_opt">20</a>] and
was written in a consistent style with <tt>edmonds_maximum_cardinality_matching</tt> because of their algorithmic similarity.
In addition, a brute-force verifier <tt>brute_force_maximum_weighted_matching</tt> simply searches all possible matchings in any graph and selects one with the maximum weight sum.
</p><h3>Algorithm Description</h3>
Primal-dual method in linear programming is introduced to solve weighted matching problems. Edmonds proved that for any graph,
the maximum number of edges in a matching is equal to the minimum capacity of an odd-set cover; this further enable us to prove a max-min duality theorem for weighted matching.
Let <i>H<sub>k-1</sub></i> denote any graph obtained from G by contracting odd sets of three or more nodes and deleting single nodes,
where the capacity of the family of odd sets (not necessarily a cover of G) is <i>k-1</i>. Let <i>X<sub>k</sub></i> denote any matching containing <i>k</i> edges.
Each edge <i>(i, j)</i> has a weight <i>w<sub>ij</sub></i>. We have:
<math>
max<i><sub>X<sub>k</sub></sub></i> min {<i>w<sub>ij</sub>|(i, j) ϵ X<sub>k</sub></i>} = min<i><sub>H<sub>k-1</sub></sub></i> max {<i>w<sub>ij</sub>|(i, j) ϵ H<sub>k-1</sub></i>}.
</math>
This matching duality theorem gives an indication of how the matching problem should be formulated as a linear programming problem. That is,
the theorem suggests a set of linear inequalities which are satisfied by any matching, and it is anticipated that these inequalities describe a convex polyhedron
with integer vertices corresponding to feasible matchings.
The maximum weighted matching problem was solved by Edmonds in
[<a href="bibliography.html#edmonds65:_max_weighted_match">74</a>].
Subsequently, Gabow [<a href="bibliography.html#gabow76">75</a>] and
Lawler [<a href="bibliography.html#lawler76:_comb_opt">20</a>] developed methods
to reduce the run time from <i>O(V<sup>4</sup>)</i> to <i>O(V<sup>3</sup>)</i>.
The implementation of <tt>maximum_weighted_matching</tt> follows a description
of the <i>O(V<sup>3</sup>)</i> algorithm by Galil [<a href="bibliography.html#galil86">77</a>].
</p>
<p>
For <tt>maximum_weighted_matching</tt>, the management of blossoms is much more involved than in the case of <tt>max_cardinality_matching</tt>.
It is not sufficient to record only the outermost blossoms. When an outermost blossom is expanded,
it is necessary to know which blossom are nested immediately with it, so that these blossoms can be restored to the status of the outermost blossoms.
When augmentation occurs, blossoms with strictly positive dual variables must be maintained for use in the next application of the labeling procedure.
Starting from an empty matching, the algorithm repeatedly augments the matching until no further improvement is possible.
Alternating trees and blossoms are used to find an augmenting path, in a way that is similar to maximum cardinality matching.
A linear programming technique is used to ensure that the selected augmenting path has maximum weight.
This involves assigning dual variables to vertices and blossoms, and computing slack values for edges.
</p>
<p>
The outline of the algorithm is as follow:
The outline of the algorithm is as follows:
</p>
<ol start="0">
<li>Start with an empty matching and initialize dual variables as a half of maximum edge weight.</li>
<li>(Labeling) Root an alternate tree at each exposed node, and proceed to construct alternate trees by labeling, using only edges with zero slack value.
<li>Start with an empty matching and initialize dual variables to half of the maximum edge weight.</li>
<li>(Labeling) Root a tree at each non-matched vertex, and proceed to construct alternating trees by labeling, using only edges with zero slack value.
If an augmenting path is found, go to step 2. If a blossom is formed, go to step 3. Otherwise, go to step 4. </li>
<li>(Augmentation) Find the augmenting path, tracing the path through shrunken blossoms. Augment the matching,
correct labels on nodes in the augmenting path, expand blossoms with zero dual variables and remove labels from all base nodes. Go to step 1.</li>
<li>(Blossoming) Determine the membership and base node of the new blossom and supply missing labels for all non-base nodes in the blossom.
<li>(Augmentation) Find the augmenting path, tracing the path through shrunken blossoms. Augment the matching.
Deconstruct and unlabel the alternating trees traversed by the augmenting path.
Go to step 1.</li>
<li>(Blossoming) Identify the blossoms in the alternating cycle and shrink these into a newly formed blossom.
Return to step 1.</li>
<li>(Revision of Dual Solution) Adjust the dual variables based on the primal-dual method. Go to step 1 or halt, accordingly.</li>
<li>(Updating dual variables) Adjust the dual variables based on the primal-dual method.
If this enables further growth of the alternating trees, return to step 1.
Otherwise, halt the algorithm; the matching has maximum weight.</li>
</ol>
Note that in <tt>maximum_weighted_matching</tt>, all edge weights are multiplied by 4, so that all dual variables always remain as integers if all edge weights are integers.
Unlike <tt>max_cardinality_matching</tt>, the initial matching and augmenting path finder are not parameterized,
because the algorithm maintains blossoms, dual variables and node labels across all augmentations.
<p>
The implementation deviates from the description in [<a href="bibliography.html#galil86">77</a>] on a few points:
</p>
The algorithm's time complexity is reduced from <i>O(V<sup>4</sup>)</i> (naive implementation of [<a href="bibliography.html#edmonds65:_max_weighted_match">74</a>])
to <i>O(V<sup>3</sup>)</i>, by a delicate labeling procedure [<a href="bibliography.html#gabow76">75</a>] to avoid re-scanning labels after revision of the dual solution.
Special variables <i>pi, tau, gamma</i> and two arrays <i>critical_edge, tau_idx</i> are introduced for this purpose.
Please refer to [<a href="bibliography.html#lawler76:_comb_opt">20</a>] and code comments for more implementation details.
<ul>
<li>
After augmenting the matching, [<a href="bibliography.html#galil86">77</a>] expands all blossoms with zero dual.
This is correct but potentially unnecessary; some of the expanded blossoms will be recreated during the next stage.
The implementation holds off on the expansion of such blossoms.
In any scenario where a blossom <i>must</i> be expanded to make progress, label T will be assigned to it.
At that point, the blossom will be expanded through a zero-delta dual step.
The additional cost is <i>O(V)</i> per expanded blossom, and the total number of blossom expansions is <i>O(V<sup>2</sup>)</i>,
therefore this does not change the overall time complexity of the algorithm.
</li>
<li>
The algorithm records a minimum-slack edge <i>e<sub>k,l</sub></i> for every pair of blossoms <i>B<sub>k</sub>, B<sub>l</sub></i>.
Storing these edges in a 2-dimensional array would increase the space complexity to <i>O(V<sup>2</sup>)</i>;
an unfortunate cost for large sparse graphs.
The implementation of <tt>maximum_weighted_matching</tt> avoids this by maintaining, for each blossom <i>B<sub>k</sub></i>,
a list <tt>B<sub>k</sub>.best_edge_set</tt> that contains the non-empty elements of <i>e<sub>k,l</sub></i>,
plus edges between <i>B<sub>k</sub></i> and <i>B<sub>l</sub></i> discovered after shrinking <i>B<sub>k</sub></i>.
The combined length of these lists is <i>O(E)</i>, since any edge is contained in at most two lists.
The algorithm only ever examines <i>e<sub>k,l</sub></i> during the process of merging <i>B<sub>k</sub></i> into a larger blossom.
In that case, it sequentially examines <i>e<sub>k,l</sub></i> for all <i>l</i>, taking time <i>O(V)</i>.
The implementation handles this by examining every element of <tt>B<sub>k</sub>.best_edge_set</tt>,
taking time <i>O(V)</i> plus a constant time per newly discovered edge.
This does not change the overall time complexity of the algorithm.
</li>
<li>
After augmenting, [<a href="bibliography.html#galil86">77</a>] removes all labels and alternating trees.
This keeps the algorithm simple, but it causes many trees and labels to be rediscovered at the beginning of the new stage.
To avoid such redundent work, <tt>maximum_weighted_matching</tt> removes labels only from the two alternating trees that are touched by the augmenting path.
All other labels and trees are reused in the next stage.
Erasing labels from a subset of the graph, requires updating the data structures that track minimum-slack edges.
This involves examining all edges that either touch a blossom which loses its label or touch a vertex which depended on a lost label.
These steps take <i>O(V + E)</i> per stage, adding up to <i>O(V<sup>3</sup>)</i> in total.
Although this strategy does not improve the worst-case time complexity of the algorithm, it achieves a significant speedup in benchmarks on random graphs.
</li>
</ul>
<p>
If edge weights are integers, the algorithm uses only integer computations.
This is achieved by internally multiplying edge weights by 2, which ensures that all dual variables are also integers.
</p>
<p>
A brute-force implementation <tt>brute_force_maximum_weighted_matching</tt> is also provided.
This algorithm simply searches all possible matchings and selects one with the maximum weight sum.
</p>
</p><h3>Where Defined</h3>
<p>
<a href="../../../boost/graph/maximum_weighted_matching.hpp"><tt>boost/graph/maximum_weighted_matching.hpp</tt></a>
</p>
</p><h3>Parameters</h3>
<h3>Parameters</h3>
IN: <tt>const Graph&amp; g</tt>
<blockquote>
An undirected graph. The graph type must be a model of
<a href="VertexAndEdgeListGraph.html">Vertex and Edge List Graph</a> and
<a href="IncidenceGraph.html">Incidence Graph</a>.
The edge property of the graph <tt>property_map&lt;Graph, edge_weight_t&gt;</tt> must exist and have numeric value type.<br>
The graph may not contain parallel edges.
</blockquote>
IN: <tt>VertexIndexMap vm</tt>
<blockquote>
Must be a model of <a href="../../property_map/doc/ReadablePropertyMap.html">ReadablePropertyMap</a>, mapping vertices to integer indices.
Must be a model of <a href="../../property_map/doc/ReadablePropertyMap.html">ReadablePropertyMap</a>,
mapping vertices to integer indices in the range <tt>[0, num_vertices(g))</tt>.
If this parameter is not explicitly specified, it is obtained from the internal vertex property of the graph
by calling <tt>get(vertex_index, g)</tt>.
</blockquote>
IN: <tt>EdgeWeightMap weights</tt>
<blockquote>
Must be a model of <a href="../../property_map/doc/ReadablePropertyMap.html">ReadablePropertyMap</a>, mapping edges to weights.
Edge weights must be integers or floating point values.
If this parameter is not explicitly specified, it is obtained from the internal edge property of the graph
by calling <tt>get(edge_weight, g)</tt>.
</blockquote>
OUT: <tt>MateMap mate</tt>
@@ -140,24 +193,29 @@ vertices to vertices. For any vertex v in the graph, <tt>get(mate,v)</tt> will b
<p>
Let <i>m</i> and <i>n</i> be the number of edges and vertices in the input graph, respectively. Assuming the
<tt>VertexIndexMap</tt> supplied allows constant-time lookup, the time complexity for
<tt>maximum_weighted_matching</tt> is <i>O(n<sup>3</sup>)</i>. For <tt>brute_force_maximum_weighted_matching</tt>, the time complexity is exponential of <i>m</i>.
<tt>VertexIndexMap</tt> and <tt>EdgeWeightMap</tt> both provide constant-time lookup, the time complexity for
<tt>maximum_weighted_matching</tt> is <i>O(n<sup>3</sup>)</i>.
For <tt>brute_force_maximum_weighted_matching</tt>, the time complexity is exponential in <i>m</i>.
</p>
<p>
Note that the best known time complexity for maximum weighted matching in general graph
is <i>O(nm+n<sup>2</sup>log(n))</i> by [<a href="bibliography.html#gabow90">76</a>], but relies on an
efficient algorithm for solving nearest ancestor problem on trees, which is not provided in Boost C++ libraries.
</p><p>
</p>
</p><h3>Example</h3>
<h3>Example</h3>
<p> The file <a href="../example/weighted_matching_example.cpp"><tt>example/weighted_matching_example.cpp</tt></a>
<p>The file <a href="../example/weighted_matching_example.cpp"><tt>example/weighted_matching_example.cpp</tt></a>
contains an example.
</p>
<br>
</p><hr>
<hr>
<table>
<tbody><tr valign="top">
<td nowrap="nowrap">Copyright © 2018</td><td>
Yi Ji (<a href="mailto:jiy@pku.edu.cn">jiy@pku.edu.cn</a>)<br>
<td nowrap="nowrap">Copyright © 2018, 2025</td><td>
Yi Ji (<a href="mailto:jiy@pku.edu.cn">jiy@pku.edu.cn</a>),
Joris van Rantwijk
</td></tr></tbody></table>
</body></html>
+1 -1
View File
@@ -19,7 +19,7 @@
<ul>
<li><a href="http://www.ddj.com/articles/2000/0009/0009toc.htm">Dr. Dobb's Sept. 2000 Article</a></a></li>
<li><a href="https://jacobfilipp.com/DrDobbs/articles/DDJ/2000/0009/0009b/0009b.htm">Dr. Dobb's Sept. 2000 Article</a></a></li>
<li><a href="http://www.acm.org/pubs/citations/proceedings/oops/320384/p399-siek/">OOPSLA'99 GGCL Paper</a></li>
<li>Lie-Quan Lee's Master's Thesis about GGCL<a href="https://web.archive.org/web/20030824105142/http://www.lsc.nd.edu/downloads/research/ggcl/papers/thesis.ps">(ps)</a> <a href="https://web.archive.org/web/20030824113405/http://www.lsc.nd.edu/downloads/research/ggcl/papers/thesis.pdf">(pdf)</a></li>
<li><a href="http://www.dietmar-kuehl.de/generic-graph-algorithms.pdf">Dietmar K&uuml;hl's Master's Thesis: Design Pattern for the Implementation of Graph Algorithms</a></li>
+3 -3
View File
@@ -57,7 +57,7 @@ void r_c_shortest_paths( const Graph&amp; g,
typename graph_traits&lt;Graph&gt;::vertex_descriptor s,
typename graph_traits&lt;Graph&gt;::vertex_descriptor t,
std::vector&lt;typename graph_traits&lt;Graph&gt;::edge_descriptor&gt;&amp; pareto_optimal_solution,
Resource_Container&gt;&amp; pareto_optimal_resource_container,
Resource_Container&amp; pareto_optimal_resource_container,
const Resource_Container&amp; rc,
const Resource_Extension_Function&amp; ref,
const Dominance_Function&amp; dominance,
@@ -93,7 +93,7 @@ void r_c_shortest_paths( const Graph&amp; g,
typename graph_traits&lt;Graph&gt;::vertex_descriptor s,
typename graph_traits&lt;Graph&gt;::vertex_descriptor t,
std::vector&lt;typename graph_traits&lt;Graph&gt;::edge_descriptor&gt;&amp; pareto_optimal_solution,
Resource_Container&gt;&amp; pareto_optimal_resource_container,
Resource_Container&amp; pareto_optimal_resource_container,
const Resource_Container&amp; rc,
const Resource_Extension_Function&amp; ref,
const Dominance_Function&amp; dominance )
@@ -554,7 +554,7 @@ When <tt>b_result_must_be_equal_to_desired_final_resource_levels==true</tt> (<tt
<p>
The file <a href="../example/r_c_shortest_paths_example.cpp">
<rr>example/r_c_shortest_paths_example.cpp</tt></a> provides examples for how SPPRCs can be solved with the <tt>r_c_shortest_paths</tt> functions. There is an example for an SPP without resource constraints and an example for a shortest path problem with time windows.<br>
<tt>example/r_c_shortest_paths_example.cpp</tt></a> provides examples for how SPPRCs can be solved with the <tt>r_c_shortest_paths</tt> functions. There is an example for an SPP without resource constraints and an example for a shortest path problem with time windows.<br>
It is obvious that one would not use the algorithm for SPPs without resource constraints, because there are faster algorithms for this problem, but one would expect a code for the SPP with resource constraints to be able to handle such a case.
</p>
+1 -1
View File
@@ -39,7 +39,7 @@ void random_spanning_tree(const Graph&amp; g, Gen&amp; gen, vertex_descriptor ro
<p>
The <tt>random_spanning_tree()</tt> function generates a random spanning tree
on a directed or undirected graph. The algorithm used is Wilson's algorithm (<a
href="bibliography.html#wilson96generating">73</a>, based on <!-- (FIXME: add
href="bibliography.html#wilson96generating">73</a>), based on <!-- (FIXME: add
documentation for loop_erased_random_walk()) <a
href="loop_erased_random_walk.html"> -->loop-erased random walks<!-- </a> -->. There must
be a path from every non-root vertex of the graph to the root;
+2 -2
View File
@@ -181,8 +181,8 @@ bool status = read_graphviz(gvgraph,graph,dp,&quot;node_id&quot;);
<div class="section" id="building-the-graphviz-readers">
<h1><a class="toc-backref" href="#id5">Building the GraphViz Readers</a></h1>
<p>To use the GraphViz readers, you will need to build and link against
the &quot;boost_graph&quot; and &quot;boost_regex&quot; libraries. These libraries can be built by following the
<a class="reference external" href="../../../more/getting_started.html#Build_Install">Boost Jam Build Instructions</a> for the subdirectories <tt class="docutils literal"><span class="pre">libs/graph/build</span></tt> and <tt class="docutils literal"><span class="pre">libs/regex/build</span></tt>.</p>
the &quot;boost_graph&quot; library. This library can be built by following the
<a class="reference external" href="../../../more/getting_started.html#Build_Install">Boost Jam Build Instructions</a> for the subdirectory <tt class="docutils literal"><span class="pre">libs/graph/build</span></tt>.</p>
</div>
<div class="section" id="notes">
<h1><a class="toc-backref" href="#id6">Notes</a></h1>
+2 -2
View File
@@ -182,8 +182,8 @@ GraphViz reader to populate an ``adjacency_list`` graph
Building the GraphViz Readers
-----------------------------
To use the GraphViz readers, you will need to build and link against
the "boost_graph" and "boost_regex" libraries. These libraries can be built by following the
`Boost Jam Build Instructions`_ for the subdirectories ``libs/graph/build`` and ``libs/regex/build``.
the "boost_graph" library. This library can be built by following the
`Boost Jam Build Instructions`_ for the subdirectory ``libs/graph/build``.
Notes
+1 -1
View File
@@ -33,7 +33,7 @@ way to obtain a transposed view of a graph.
<H3>Example</H3>
The example from <a
href="../example/reverse-graph-eg.cpp"><tt>examples/reverse-graph-eg.cpp</tt></a>.
href="../example/reverse_graph.cpp"><tt>example/reverse_graph.cpp</tt></a>.
<pre>
int
+1 -1
View File
@@ -17,7 +17,7 @@
ALT="C++ Boost" width="277" height="86">
<h1>Table of Contents: the Boost Graph Library
<a href="http://www.awprofessional.com/title/0201729148">
<a href="https://www.informit.com/store/boost-graph-library-user-guide-and-reference-manual-9780132651837">
<img src="bgl-cover.jpg" ALT="BGL Book" ALIGN="RIGHT"></a>
</h1>
+1
View File
@@ -40,6 +40,7 @@ or form.</p>
<li><a href="http://www.vrjuggler.org/">VR Juggler: Virtual Reality Tools</a></li>
<li><a href="http://hyperworx.org">Hyperworx Platform Project</a></li>
<li><a href="http://www.opencog.org/">OpenCog, an open source Artificial General Intelligence framework</a></li>
<li><a href="https://www.pgRouting.org/">pgRouting extends the PostGIS/PostgreSQL geospatial database to provide geospatial routing functionality.</a></li>
</ul>
</body>
+1 -1
View File
@@ -133,7 +133,7 @@ out-edges for the whole graph.
<PRE>
vertex()
</PRE>
This operation is constant time for <TT>vecS</TT> and for
This operation is constant time for <TT>vecS</TT> and <i>O(V)</i> for
<TT>listS</TT>.
</ul>
+2 -1
View File
@@ -75,7 +75,7 @@ run filtered_graph.cpp ;
run filtered_graph_edge_range.cpp ;
run filtered_vec_as_graph.cpp ;
run filtered-copy-example.cpp ;
exe fr_layout : fr_layout.cpp ;
exe fr_layout : fr_layout.cpp : [ requires cxx11_noexcept cxx11_rvalue_references sfinae_expr cxx11_auto_declarations cxx11_lambdas cxx11_unified_initialization_syntax cxx11_hdr_tuple cxx11_hdr_initializer_list cxx11_hdr_chrono cxx11_thread_local cxx11_constexpr cxx11_nullptr cxx11_numeric_limits cxx11_decltype cxx11_hdr_array cxx11_hdr_atomic cxx11_hdr_type_traits cxx11_allocator cxx11_explicit_conversion_operators ] ;
run gerdemann.cpp ;
run graph.cpp ;
run graph_as_tree.cpp ;
@@ -163,6 +163,7 @@ run vertex-name-property.cpp : $(TEST_DIR)/makefile-dependencies.dat $(TEST_DIR)
run vf2_sub_graph_iso_example.cpp ;
run vf2_sub_graph_iso_multi_example.cpp ;
run visitor.cpp ;
run weighted_matching_example.cpp ;
run write_graphviz.cpp ;
#
+2 -6
View File
@@ -72,12 +72,8 @@ int main(int argc, const char** argv)
file_dep_graph2 g(input_begin, input_end, n_vertices);
#endif
typedef property_map< file_dep_graph2, vertex_name_t >::type name_map_t;
typedef property_map< file_dep_graph2, vertex_compile_cost_t >::type
compile_cost_map_t;
name_map_t name_map = get(vertex_name, g);
compile_cost_map_t compile_cost_map = get(vertex_compile_cost, g);
auto name_map = get(vertex_name, g);
auto compile_cost_map = get(vertex_compile_cost, g);
std::ifstream name_in(argc >= 3 ? argv[2] : "makefile-target-names.dat");
std::ifstream compile_cost_in(
+8 -12
View File
@@ -52,13 +52,13 @@ void load_actor_graph(std::istream& in, ActorGraph& g)
// Map from the actor numbers on this line to the actor vertices
typedef tokenizer< char_separator< char > > Tok;
Tok tok(line, char_separator< char >(" "));
for (Tok::iterator id = tok.begin(); id != tok.end(); ++id)
for (auto const & id : tok)
{
int actor_id = lexical_cast< int >(*id);
std::map< int, Vertex >::iterator v = actors.find(actor_id);
auto actor_id = lexical_cast< int >(id);
auto v = actors.find(actor_id);
if (v == actors.end())
{
Vertex new_vertex = add_vertex(Actor(actor_id), g);
auto new_vertex = add_vertex(Actor(actor_id), g);
actors[actor_id] = new_vertex;
actors_in_movie.push_back(new_vertex);
}
@@ -68,11 +68,9 @@ void load_actor_graph(std::istream& in, ActorGraph& g)
}
}
for (std::vector< Vertex >::iterator i = actors_in_movie.begin();
i != actors_in_movie.end(); ++i)
for (auto i = actors_in_movie.begin(); i != actors_in_movie.end(); ++i)
{
for (std::vector< Vertex >::iterator j = i + 1;
j != actors_in_movie.end(); ++j)
for (auto j = i + 1; j != actors_in_movie.end(); ++j)
{
if (!edge(*i, *j, g).second)
add_edge(*i, *j, g);
@@ -86,16 +84,14 @@ std::ostream& write_pajek_graph(std::ostream& out, const Graph& g,
VertexIndexMap vertex_index, VertexNameMap vertex_name)
{
out << "*Vertices " << num_vertices(g) << '\n';
typedef typename graph_traits< Graph >::vertex_iterator vertex_iterator;
for (vertex_iterator v = vertices(g).first; v != vertices(g).second; ++v)
for (auto v = vertices(g).first; v != vertices(g).second; ++v)
{
out << get(vertex_index, *v) + 1 << " \"" << get(vertex_name, *v)
<< "\"\n";
}
out << "*Edges\n";
typedef typename graph_traits< Graph >::edge_iterator edge_iterator;
for (edge_iterator e = edges(g).first; e != edges(g).second; ++e)
for (auto e = edges(g).first; e != edges(g).second; ++e)
{
out << get(vertex_index, source(*e, g)) + 1 << ' '
<< get(vertex_index, target(*e, g)) + 1 << " 1.0\n"; // HACK!
+2 -4
View File
@@ -61,10 +61,8 @@ int main(int, char*[])
const int V = 5;
Graph g(V);
property_map< Graph, std::size_t VertexProperties::* >::type id
= get(&VertexProperties::index, g);
property_map< Graph, std::string EdgeProperties::* >::type name
= get(&EdgeProperties::name, g);
auto id = get(&VertexProperties::index, g);
auto name = get(&EdgeProperties::name, g);
boost::graph_traits< Graph >::vertex_iterator vi, viend;
int vnum = 0;
+8 -8
View File
@@ -86,8 +86,8 @@ public:
distance_heuristic(LocMap l, Vertex goal) : m_location(l), m_goal(goal) {}
CostType operator()(Vertex u)
{
CostType dx = m_location[m_goal].x - m_location[u].x;
CostType dy = m_location[m_goal].y - m_location[u].y;
auto dx = m_location[m_goal].x - m_location[u].x;
auto dy = m_location[m_goal].y - m_location[u].y;
return ::sqrt(dx * dx + dy * dy);
}
@@ -174,7 +174,7 @@ int main(int argc, char** argv)
// create graph
mygraph_t g(N);
WeightMap weightmap = get(edge_weight, g);
auto weightmap = get(edge_weight, g);
for (std::size_t j = 0; j < num_edges; ++j)
{
edge_descriptor e;
@@ -185,9 +185,9 @@ int main(int argc, char** argv)
}
// pick random start/goal
boost::mt19937 gen(std::time(0));
vertex start = random_vertex(g, gen);
vertex goal = random_vertex(g, gen);
boost::mt19937 gen(time(0));
auto start = random_vertex(g, gen);
auto goal = random_vertex(g, gen);
cout << "Start vertex: " << name[start] << endl;
cout << "Goal vertex: " << name[goal] << endl;
@@ -215,7 +215,7 @@ int main(int argc, char** argv)
catch (found_goal fg)
{ // found a path to the goal
list< vertex > shortest_path;
for (vertex v = goal;; v = p[v])
for (auto v = goal;; v = p[v])
{
shortest_path.push_front(v);
if (p[v] == v)
@@ -223,7 +223,7 @@ int main(int argc, char** argv)
}
cout << "Shortest path from " << name[start] << " to " << name[goal]
<< ": ";
list< vertex >::iterator spi = shortest_path.begin();
auto spi = shortest_path.begin();
cout << name[start];
for (++spi; spi != shortest_path.end(); ++spi)
cout << " -> " << name[*spi];
+8 -8
View File
@@ -201,8 +201,8 @@ bool maze::solve()
dist_map distance;
boost::associative_property_map< dist_map > dist_pmap(distance);
vertex_descriptor s = source();
vertex_descriptor g = goal();
auto s = source();
auto g = goal();
euclidean_heuristic heuristic(g);
astar_goal_visitor visitor(g);
@@ -218,7 +218,7 @@ bool maze::solve()
{
// Walk backwards from the goal through the predecessor chain adding
// vertices to the solution path.
for (vertex_descriptor u = g; u != s; u = predecessor[u])
for (auto u = g; u != s; u = predecessor[u])
m_solution.insert(u);
m_solution.insert(s);
m_solution_length = distance[g];
@@ -285,9 +285,9 @@ std::size_t random_int(std::size_t a, std::size_t b)
// Generate a maze with a random assignment of barriers.
void random_maze(maze& m)
{
vertices_size_type n = num_vertices(m.m_grid);
vertex_descriptor s = m.source();
vertex_descriptor g = m.goal();
auto n = num_vertices(m.m_grid);
auto s = m.source();
auto g = m.goal();
// One quarter of the cells in the maze should be barriers.
int barriers = n / 4;
while (barriers > 0)
@@ -297,7 +297,7 @@ void random_maze(maze& m)
// Walls range up to one quarter the dimension length in this direction.
vertices_size_type wall = random_int(1, m.length(direction) / 4);
// Create the wall while decrementing the total barrier count.
vertex_descriptor u = vertex(random_int(0, n - 1), m.m_grid);
auto u = vertex(random_int(0, n - 1), m.m_grid);
while (wall)
{
// Start and goal spaces should never be barriers.
@@ -310,7 +310,7 @@ void random_maze(maze& m)
barriers--;
}
}
vertex_descriptor v = m.m_grid.next(u, direction);
auto v = m.m_grid.next(u, direction);
// Stop creating this wall if we reached the maze's edge.
if (u == v)
break;
+4 -7
View File
@@ -23,8 +23,7 @@ template < typename Graph, typename ParentMap > struct edge_writer
void operator()(std::ostream& out, const Edge& e) const
{
out << "[label=\"" << get(edge_weight, m_g, e) << "\"";
typename graph_traits< Graph >::vertex_descriptor u = source(e, m_g),
v = target(e, m_g);
auto u = source(e, m_g), v = target(e, m_g);
if (m_parent[v] == u)
out << ", color=\"black\"";
else
@@ -74,8 +73,7 @@ int main()
Graph g(edge_array, edge_array + n_edges, N);
#endif
graph_traits< Graph >::edge_iterator ei, ei_end;
property_map< Graph, int EdgeProperties::* >::type weight_pmap
= get(&EdgeProperties::weight, g);
auto weight_pmap = get(&EdgeProperties::weight, g);
int i = 0;
for (boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei, ++i)
weight_pmap[*ei] = weight[i];
@@ -115,9 +113,8 @@ int main()
{
for (boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei)
{
graph_traits< Graph >::edge_descriptor e = *ei;
graph_traits< Graph >::vertex_descriptor u = source(e, g),
v = target(e, g);
auto e = *ei;
auto u = source(e, g), v = target(e, g);
// VC++ doesn't like the 3-argument get function, so here
// we workaround by using 2-nested get()'s.
dot_file << name[u] << " -> " << name[v] << "[label=\""
+1 -1
View File
@@ -81,7 +81,7 @@ int main()
Size time = 0;
typedef property_map< graph_t, std::size_t VertexProps::* >::type
dtime_map_t;
dtime_map_t dtime_map = get(&VertexProps::discover_time, g);
auto dtime_map = get(&VertexProps::discover_time, g);
bfs_time_visitor< dtime_map_t > vis(dtime_map, time);
breadth_first_search(
g, vertex(s, g), color_map(get(&VertexProps::color, g)).visitor(vis));
+8 -9
View File
@@ -16,16 +16,15 @@ template < typename Graph, typename VertexNameMap, typename TransDelayMap >
void build_router_network(
Graph& g, VertexNameMap name_map, TransDelayMap delay_map)
{
typename graph_traits< Graph >::vertex_descriptor a, b, c, d, e;
a = add_vertex(g);
auto a = add_vertex(g);
name_map[a] = 'a';
b = add_vertex(g);
auto b = add_vertex(g);
name_map[b] = 'b';
c = add_vertex(g);
auto c = add_vertex(g);
name_map[c] = 'c';
d = add_vertex(g);
auto d = add_vertex(g);
name_map[d] = 'd';
e = add_vertex(g);
auto e = add_vertex(g);
name_map[e] = 'e';
typename graph_traits< Graph >::edge_descriptor ed;
@@ -78,13 +77,13 @@ int main()
typedef adjacency_list< listS, vecS, directedS, VP, EP > graph_t;
graph_t g;
property_map< graph_t, char VP::* >::type name_map = get(&VP::name, g);
property_map< graph_t, double EP::* >::type delay_map = get(&EP::weight, g);
auto name_map = get(&VP::name, g);
auto delay_map = get(&EP::weight, g);
build_router_network(g, name_map, delay_map);
typedef property_map< graph_t, char VP::* >::type VertexNameMap;
graph_traits< graph_t >::vertex_descriptor a = *vertices(g).first;
auto a = *vertices(g).first;
bfs_name_printer< VertexNameMap > vis(name_map);
std::cout << "BFS vertex discover order: ";
breadth_first_search(g, a, visitor(vis));
+1 -1
View File
@@ -129,7 +129,7 @@ int main(int, char*[])
std::fill_n(d, 5, 0);
// The source vertex
Vertex s = *(boost::vertices(G).first);
auto s = *(boost::vertices(G).first);
p[s] = s;
boost::breadth_first_search(G, s,
boost::visitor(boost::make_bfs_visitor(
+1 -1
View File
@@ -123,7 +123,7 @@ int main(int, char*[])
std::fill_n(d, 5, 0);
// The source vertex
Vertex s = *(boost::vertices(G).first);
auto s = *(boost::vertices(G).first);
p[s] = s;
boost::neighbor_breadth_first_search(G, s,
boost::visitor(boost::make_neighbor_bfs_visitor(
+2 -3
View File
@@ -45,10 +45,9 @@ int main()
add_edge(6, 7, g);
add_edge(7, 8, g);
property_map< graph_t, edge_component_t >::type component
= get(edge_component, g);
auto component = get(edge_component, g);
std::size_t num_comps = biconnected_components(g, component);
auto num_comps = biconnected_components(g, component);
std::cerr << "Found " << num_comps << " biconnected components.\n";
std::vector< vertex_t > art_points;
+7 -7
View File
@@ -29,9 +29,8 @@ public:
void tree_edge(
typename boost::graph_traits< Graph >::edge_descriptor e, Graph& g)
{
typename boost::graph_traits< Graph >::vertex_descriptor u, v;
u = boost::source(e, g);
v = boost::target(e, g);
auto u = boost::source(e, g);
auto v = boost::target(e, g);
distance[v] = distance[u] + 1;
}
@@ -95,9 +94,8 @@ int main(int argc, const char** argv)
NameVertexMap name2vertex;
Graph g;
typedef property_map< Graph, vertex_name_t >::type NameMap;
NameMap node_name = get(vertex_name, g);
property_map< Graph, edge_name_t >::type link_name = get(edge_name, g);
auto node_name = get(vertex_name, g);
auto link_name = get(edge_name, g);
//===========================================================================
// Read the data file and construct the graph.
@@ -113,7 +111,7 @@ int main(int argc, const char** argv)
bool inserted;
Vertex u, v;
std::list< std::string >::iterator i = line_toks.begin();
auto i = line_toks.begin();
boost::tie(pos, inserted)
= name2vertex.insert(std::make_pair(*i, Vertex()));
@@ -210,6 +208,8 @@ int main(int argc, const char** argv)
// the tree nodes in the order that we want to print out:
// a directory-structure like format.
std::vector< size_type > dfs_distances(num_vertices(g), 0);
using NameMap = property_map< Graph, vertex_name_t >::type;
print_tree_visitor< NameMap, size_type* > tree_printer(
node_name, &dfs_distances[0]);
for (boost::tie(vi, vi_end) = vertices(g); vi != vi_end; ++vi)
+4 -6
View File
@@ -85,17 +85,15 @@ int main()
Graph;
Graph g;
property_map< Graph, edge_capacity_t >::type capacity
= get(edge_capacity, g);
property_map< Graph, edge_residual_capacity_t >::type residual_capacity
= get(edge_residual_capacity, g);
property_map< Graph, edge_reverse_t >::type rev = get(edge_reverse, g);
auto capacity = get(edge_capacity, g);
auto residual_capacity = get(edge_residual_capacity, g);
auto rev = get(edge_reverse, g);
Traits::vertex_descriptor s, t;
read_dimacs_max_flow(g, capacity, rev, s, t);
std::vector< default_color_type > color(num_vertices(g));
std::vector< long > distance(num_vertices(g));
long flow = boykov_kolmogorov_max_flow(g, s, t);
auto flow = boykov_kolmogorov_max_flow(g, s, t);
std::cout << "c The total flow:" << std::endl;
std::cout << "s " << flow << std::endl << std::endl;
+1 -1
View File
@@ -29,7 +29,7 @@ int main(int argc, char* argv[])
read_graph(g, cin);
// Use the Bron-Kerbosch algorithm to find all cliques, and
size_t c = bron_kerbosch_clique_number(g);
auto c = bron_kerbosch_clique_number(g);
cout << "clique number: " << c << endl;
return 0;
+4 -4
View File
@@ -47,7 +47,7 @@ int main()
cout << " has number ";
do
{
int v = my_bucket_sorter[j].top();
auto v = my_bucket_sorter[j].top();
my_bucket_sorter[j].pop();
cout << v << " ";
} while (!my_bucket_sorter[j].empty());
@@ -75,7 +75,7 @@ int main()
cout << " has number ";
do
{
int v = my_bucket_sorter[j].top();
auto v = my_bucket_sorter[j].top();
my_bucket_sorter[j].pop();
cout << v << " ";
} while (!my_bucket_sorter[j].empty());
@@ -93,7 +93,7 @@ int main()
std::size_t current = rand() % N;
if (!my_bucket_sorter[current].empty())
{
int v = my_bucket_sorter[current].top();
auto v = my_bucket_sorter[current].top();
my_bucket_sorter[current].pop();
bucket[v] = rand() % N;
my_bucket_sorter.push(v);
@@ -105,7 +105,7 @@ int main()
std::size_t current = rand() % N;
if (!my_bucket_sorter[current].empty())
{
int v = my_bucket_sorter[current].top();
auto v = my_bucket_sorter[current].top();
bucket[v] = rand() % N;
my_bucket_sorter.update(v);
}
+3 -4
View File
@@ -44,7 +44,7 @@ int main(int argc, char** argv)
add_edge(1, 5, g);
// Initialize the interior edge index
property_map< graph, edge_index_t >::type e_index = get(edge_index, g);
auto e_index = get(edge_index, g);
graph_traits< graph >::edges_size_type edge_count = 0;
graph_traits< graph >::edge_iterator ei, ei_end;
for (boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei)
@@ -69,10 +69,9 @@ int main(int argc, char** argv)
make_iterator_property_map(embedding.begin(), get(vertex_index, g)),
std::back_inserter(ordering));
ordering_storage_t::iterator oi, oi_end;
oi_end = ordering.end();
auto oi_end = ordering.end();
std::cout << "The planar canonical ordering is: ";
for (oi = ordering.begin(); oi != oi_end; ++oi)
for (auto oi = ordering.begin(); oi != oi_end; ++oi)
std::cout << *oi << " ";
std::cout << std::endl;
+1 -2
View File
@@ -32,8 +32,7 @@ int main()
make_iterator_property_map(
component.begin(), get(vertex_index, g), component[0]));
property_map< GraphvizGraph, vertex_attribute_t >::type vertex_attr_map
= get(vertex_attribute, g);
auto vertex_attr_map = get(vertex_attribute, g);
std::string color[] = { "white", "gray", "black", "lightgray" };
graph_traits< GraphvizGraph >::vertex_iterator vi, vi_end;
for (boost::tie(vi, vi_end) = vertices(g); vi != vi_end; ++vi)
+1 -1
View File
@@ -137,7 +137,7 @@ int main(int, char*[])
cout << endl;
/* Get the source vertex */
boost::graph_traits< Graph >::vertex_descriptor s = vertex(SanJose, G);
auto s = vertex(SanJose, G);
cout << "*** Breadth First ***" << endl;
breadth_first_search(G, s,
+1 -1
View File
@@ -52,7 +52,7 @@ int main(int argc, char* argv[])
// computation.
ClusteringContainer coefs(num_vertices(g));
ClusteringMap cm(coefs, g);
float cc = all_clustering_coefficients(g, cm);
auto cc = all_clustering_coefficients(g, cm);
// Print the clustering coefficient of each vertex.
graph_traits< Graph >::vertex_iterator i, end;
+1 -1
View File
@@ -24,7 +24,7 @@ int main()
add_edge(2, 5, G);
std::vector< int > c(num_vertices(G));
int num = connected_components(
auto num = connected_components(
G, make_iterator_property_map(c.begin(), get(vertex_index, G), c[0]));
std::cout << std::endl;
+1 -1
View File
@@ -49,7 +49,7 @@ int main(int, char*[])
add_edge(2, 5, G);
std::vector< int > component(num_vertices(G));
int num = connected_components(G, &component[0]);
auto num = connected_components(G, &component[0]);
std::vector< int >::size_type i;
cout << "Total number of components: " << num << endl;
+4
View File
@@ -20,7 +20,11 @@ namespace boost
template < class Alloc, class ValueType >
struct container_gen< list_with_allocatorS< Alloc >, ValueType >
{
#ifdef BOOST_NO_CXX11_ALLOCATOR
typedef typename Alloc::template rebind< ValueType >::other Allocator;
#else
typedef typename std::allocator_traits<Alloc>::template rebind_alloc<ValueType> Allocator;
#endif
typedef std::list< ValueType, Allocator > type;
};
template < class Alloc >
+1 -1
View File
@@ -30,7 +30,7 @@ int main()
N
};
graph_t G(N);
property_map< graph_t, vertex_name_t >::type name_map = get(vertex_name, G);
auto name_map = get(vertex_name, G);
char name = 'a';
graph_traits< graph_t >::vertex_iterator v, v_end;
for (boost::tie(v, v_end) = vertices(G); v != v_end; ++v, ++name)
+7 -11
View File
@@ -62,26 +62,24 @@ int main(int, char*[])
graph_traits< Graph >::vertex_iterator ui, ui_end;
property_map< Graph, vertex_degree_t >::type deg = get(vertex_degree, G);
auto deg = get(vertex_degree, G);
for (boost::tie(ui, ui_end) = vertices(G); ui != ui_end; ++ui)
deg[*ui] = degree(*ui, G);
property_map< Graph, vertex_index_t >::type index_map
= get(vertex_index, G);
auto index_map = get(vertex_index, G);
std::cout << "original bandwidth: " << bandwidth(G) << std::endl;
std::vector< Vertex > inv_perm(num_vertices(G));
std::vector< size_type > perm(num_vertices(G));
{
Vertex s = vertex(6, G);
auto s = vertex(6, G);
// reverse cuthill_mckee_ordering
cuthill_mckee_ordering(G, s, inv_perm.rbegin(), get(vertex_color, G),
get(vertex_degree, G));
cout << "Reverse Cuthill-McKee ordering starting at: " << s << endl;
cout << " ";
for (std::vector< Vertex >::const_iterator i = inv_perm.begin();
i != inv_perm.end(); ++i)
for (auto i = inv_perm.begin(); i != inv_perm.end(); ++i)
cout << index_map[*i] << " ";
cout << endl;
@@ -94,14 +92,13 @@ int main(int, char*[])
<< std::endl;
}
{
Vertex s = vertex(0, G);
auto s = vertex(0, G);
// reverse cuthill_mckee_ordering
cuthill_mckee_ordering(G, s, inv_perm.rbegin(), get(vertex_color, G),
get(vertex_degree, G));
cout << "Reverse Cuthill-McKee ordering starting at: " << s << endl;
cout << " ";
for (std::vector< Vertex >::const_iterator i = inv_perm.begin();
i != inv_perm.end(); ++i)
for (auto i = inv_perm.begin(); i != inv_perm.end(); ++i)
cout << index_map[*i] << " ";
cout << endl;
@@ -121,8 +118,7 @@ int main(int, char*[])
cout << "Reverse Cuthill-McKee ordering:" << endl;
cout << " ";
for (std::vector< Vertex >::const_iterator i = inv_perm.begin();
i != inv_perm.end(); ++i)
for (auto i = inv_perm.begin(); i != inv_perm.end(); ++i)
cout << index_map[*i] << " ";
cout << endl;
+1 -1
View File
@@ -21,7 +21,7 @@ int main()
boost::edmonds_karp_max_flow(g, s, t);
boost::cycle_canceling(g);
int cost = boost::find_flow_cost(g);
auto cost = boost::find_flow_cost(g);
assert(cost == 29);
return 0;
}
+8 -11
View File
@@ -50,12 +50,9 @@ int main(int argc, char* argv[])
ccReal_t cc; /// critical cycle
grap_real_t tgr;
property_map< grap_real_t, vertex_index_t >::type vim
= get(vertex_index, tgr);
property_map< grap_real_t, edge_weight_t >::type ew1
= get(edge_weight, tgr);
property_map< grap_real_t, edge_weight2_t >::type ew2
= get(edge_weight2, tgr);
auto vim = get(vertex_index, tgr);
auto ew1 = get(edge_weight, tgr);
auto ew2 = get(edge_weight2, tgr);
gen_rand_graph(tgr, 1000, 30000);
cout << "Vertices number: " << num_vertices(tgr) << endl;
@@ -72,12 +69,12 @@ int main(int argc, char* argv[])
cout << "Minimum cycle ratio is " << min_cr << endl;
std::pair< double, double > cr(.0, .0);
cout << "Critical cycle:\n";
for (ccReal_t::iterator itr = cc.begin(); itr != cc.end(); ++itr)
for (auto const & edge : cc)
{
cr.first += ew1[*itr];
cr.second += ew2[*itr];
std::cout << "(" << vim[source(*itr, tgr)] << ","
<< vim[target(*itr, tgr)] << ") ";
cr.first += ew1[edge];
cr.second += ew2[edge];
std::cout << "(" << vim[source(edge, tgr)] << ","
<< vim[target(edge, tgr)] << ") ";
}
cout << endl;
assert(std::abs(cr.first / cr.second - min_cr) < epsilon * 2);
+2 -3
View File
@@ -50,8 +50,7 @@ int main()
add_edge(u, x, 1, g);
add_edge(v, x, -2, g);
property_map< graph_t, vertex_distance_t >::type d_map
= get(vertex_distance, g);
auto d_map = get(vertex_distance, g);
#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
// VC++ has trouble with the named-parameter mechanism, so
@@ -61,7 +60,7 @@ int main()
default_dijkstra_visitor vis;
std::less< int > compare;
closed_plus< int > combine;
property_map< graph_t, edge_weight_t >::type w_map = get(edge_weight, g);
auto w_map = get(edge_weight, g);
dag_shortest_paths(g, s, d_map, w_map, &color[0], &pred[0], vis, compare,
combine, (std::numeric_limits< int >::max)(), 0);
#else
+1 -2
View File
@@ -169,8 +169,7 @@ int main(int, char*[])
};
Graph G(N);
boost::property_map< Graph, vertex_index_t >::type vertex_id
= get(vertex_index, G);
auto vertex_id = get(vertex_index, G);
std::vector< weight_t > distance(N, (numeric_limits< weight_t >::max)());
typedef boost::graph_traits< Graph >::vertex_descriptor Vertex;
+8 -13
View File
@@ -44,13 +44,11 @@ int main(int, char*[])
graph_traits< graph_t >::vertex_iterator i, iend;
graph_t g(edge_array, edge_array + num_arcs, weights, num_nodes);
property_map< graph_t, edge_weight_t >::type weightmap
= get(edge_weight, g);
auto weightmap = get(edge_weight, g);
// Manually intialize the vertex index and name maps
property_map< graph_t, vertex_index_t >::type indexmap
= get(vertex_index, g);
property_map< graph_t, vertex_name_t >::type name = get(vertex_name, g);
auto indexmap = get(vertex_index, g);
auto name = get(vertex_name, g);
int c = 0;
for (boost::tie(i, iend) = vertices(g); i != iend; ++i, ++c)
{
@@ -58,12 +56,10 @@ int main(int, char*[])
name[*i] = 'A' + c;
}
vertex_descriptor s = vertex(A, g);
auto s = vertex(A, g);
property_map< graph_t, vertex_distance_t >::type d
= get(vertex_distance, g);
property_map< graph_t, vertex_predecessor_t >::type p
= get(vertex_predecessor, g);
auto d = get(vertex_distance, g);
auto p = get(vertex_predecessor, g);
dijkstra_shortest_paths(g, s, predecessor_map(p).distance_map(d));
std::cout << "distances and parents:" << std::endl;
@@ -87,9 +83,8 @@ int main(int, char*[])
graph_traits< graph_t >::edge_iterator ei, ei_end;
for (boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei)
{
graph_traits< graph_t >::edge_descriptor e = *ei;
graph_traits< graph_t >::vertex_descriptor u = source(e, g),
v = target(e, g);
auto e = *ei;
auto u = source(e, g), v = target(e, g);
dot_file << name[u] << " -> " << name[v] << "[label=\""
<< get(weightmap, e) << "\"";
if (p[v] == u)
+4 -6
View File
@@ -39,11 +39,10 @@ int main(int, char*[])
int weights[] = { 1, 2, 1, 2, 7, 3, 1, 1, 1 };
int num_arcs = sizeof(edge_array) / sizeof(Edge);
graph_t g(edge_array, edge_array + num_arcs, weights, num_nodes);
property_map< graph_t, edge_weight_t >::type weightmap
= get(edge_weight, g);
auto weightmap = get(edge_weight, g);
std::vector< vertex_descriptor > p(num_vertices(g));
std::vector< int > d(num_vertices(g));
vertex_descriptor s = vertex(A, g);
auto s = vertex(A, g);
dijkstra_shortest_paths(g, s,
predecessor_map(boost::make_iterator_property_map(
@@ -73,9 +72,8 @@ int main(int, char*[])
graph_traits< graph_t >::edge_iterator ei, ei_end;
for (boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei)
{
graph_traits< graph_t >::edge_descriptor e = *ei;
graph_traits< graph_t >::vertex_descriptor u = source(e, g),
v = target(e, g);
auto e = *ei;
auto u = source(e, g), v = target(e, g);
dot_file << name[u] << " -> " << name[v] << "[label=\""
<< get(weightmap, e) << "\"";
if (p[v] == u)
+3 -5
View File
@@ -43,11 +43,10 @@ int main(int, char*[])
int weights[] = { 1, 2, 1, 2, 7, 3, 1, 1, 1 };
int num_arcs = sizeof(edge_array) / sizeof(Edge);
graph_t g(edge_array, edge_array + num_arcs, weights, num_nodes);
property_map< graph_t, edge_weight_t >::type weightmap
= get(edge_weight, g);
auto weightmap = get(edge_weight, g);
std::vector< vertex_descriptor > p(num_vertices(g));
std::vector< int > d(num_vertices(g));
vertex_descriptor s = vertex(A, g);
auto s = vertex(A, g);
dijkstra_shortest_paths_no_color_map(g, s,
predecessor_map(boost::make_iterator_property_map(
@@ -78,8 +77,7 @@ int main(int, char*[])
for (boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei)
{
graph_traits< graph_t >::edge_descriptor e = *ei;
graph_traits< graph_t >::vertex_descriptor u = source(e, g),
v = target(e, g);
auto u = source(e, g), v = target(e, g);
dot_file << name[u] << " -> " << name[v] << "[label=\""
<< get(weightmap, e) << "\"";
if (p[v] == u)
+2 -2
View File
@@ -18,8 +18,8 @@ int main(int, char*[])
typedef boost::directed_graph<> Graph;
Graph g;
boost::graph_traits< Graph >::vertex_descriptor v0 = g.add_vertex();
boost::graph_traits< Graph >::vertex_descriptor v1 = g.add_vertex();
auto v0 = g.add_vertex();
auto v1 = g.add_vertex();
g.add_edge(v0, v1);
+9 -17
View File
@@ -30,7 +30,7 @@ min_degree_vertex(Graph& g)
{
typename graph_traits< Graph >::vertex_descriptor p;
typedef typename graph_traits< Graph >::degree_size_type size_type;
size_type delta = (std::numeric_limits< size_type >::max)();
auto delta = (std::numeric_limits< size_type >::max)();
typename graph_traits< Graph >::vertex_iterator i, iend;
for (boost::tie(i, iend) = vertices(g); i != iend; ++i)
if (degree(*i, g) < delta)
@@ -86,12 +86,9 @@ typename graph_traits< VertexListGraph >::degree_size_type edge_connectivity(
std::vector< edge_descriptor > pred(num_vertices(g));
FlowGraph flow_g(num_vertices(g));
typename property_map< FlowGraph, edge_capacity_t >::type cap
= get(edge_capacity, flow_g);
typename property_map< FlowGraph, edge_residual_capacity_t >::type res_cap
= get(edge_residual_capacity, flow_g);
typename property_map< FlowGraph, edge_reverse_t >::type rev_edge
= get(edge_reverse, flow_g);
auto cap = get(edge_capacity, flow_g);
auto res_cap = get(edge_residual_capacity, flow_g);
auto rev_edge = get(edge_reverse, flow_g);
typename graph_traits< VertexListGraph >::edge_iterator ei, ei_end;
for (boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei)
@@ -139,11 +136,10 @@ typename graph_traits< VertexListGraph >::degree_size_type edge_connectivity(
}
std::vector< bool > in_S_star(num_vertices(g), false);
typename std::vector< vertex_descriptor >::iterator si;
for (si = S_star.begin(); si != S_star.end(); ++si)
for (auto si = S_star.begin(); si != S_star.end(); ++si)
in_S_star[*si] = true;
degree_size_type c = 0;
for (si = S_star.begin(); si != S_star.end(); ++si)
for (auto si = S_star.begin(); si != S_star.end(); ++si)
{
typename graph_traits< VertexListGraph >::out_edge_iterator ei, ei_end;
for (boost::tie(ei, ei_end) = out_edges(*si, g); ei != ei_end; ++ei)
@@ -166,19 +162,15 @@ int main()
read_graphviz("figs/edge-connectivity.dot", g);
typedef graph_traits< GraphvizGraph >::edge_descriptor edge_descriptor;
typedef graph_traits< GraphvizGraph >::degree_size_type degree_size_type;
std::vector< edge_descriptor > disconnecting_set;
degree_size_type c
= edge_connectivity(g, std::back_inserter(disconnecting_set));
auto c = edge_connectivity(g, std::back_inserter(disconnecting_set));
std::cout << "The edge connectivity is " << c << "." << std::endl;
property_map< GraphvizGraph, vertex_attribute_t >::type attr_map
= get(vertex_attribute, g);
auto attr_map = get(vertex_attribute, g);
std::cout << "The disconnecting set is {";
for (std::vector< edge_descriptor >::iterator i = disconnecting_set.begin();
i != disconnecting_set.end(); ++i)
for (auto i = disconnecting_set.begin(); i != disconnecting_set.end(); ++i)
std::cout << "(" << attr_map[source(*i, g)]["label"] << ","
<< attr_map[target(*i, g)]["label"] << ") ";
std::cout << "}." << std::endl;
+2 -2
View File
@@ -111,12 +111,12 @@ int main(int argc, const char** argv)
graph_traits< graph_type >::vertex_descriptor yow, zag, bar;
// Get vertex name property map from the graph
typedef property_map< graph_type, vertex_name_t >::type name_map_t;
name_map_t name = get(vertex_name, g);
auto name = get(vertex_name, g);
// Get iterators for the vertex set
graph_traits< graph_type >::vertex_iterator i, end;
boost::tie(i, end) = vertices(g);
// Find yow.h
using name_map_t = property_map< graph_type, vertex_name_t >::type;
name_equals_t< name_map_t > predicate1("yow.h", name);
yow = *std::find_if(i, end, predicate1);
// Find zag.o
+6 -6
View File
@@ -45,12 +45,12 @@ template < class Graph > struct exercise_edge
void operator()(Edge e) const
{
// begin
// Get the associated vertex type out of the edge using the
// edge_traits class
// Use the source() and target() functions to access the vertices
// that belong to Edge e
Vertex src = source(e, G);
Vertex targ = target(e, G);
// Get the associated vertex type out of the edge using the
// edge_traits class
// Use the source() and target() functions to access the vertices
// that belong to Edge e
auto src = source(e, G);
auto targ = target(e, G);
// print out the vertex id's just because
cout << "(" << src << "," << targ << ") ";
+1 -2
View File
@@ -49,8 +49,7 @@ int main()
typedef graph_traits< UndirectedGraph >::degree_size_type degree_size_type;
std::vector< edge_descriptor > disconnecting_set;
degree_size_type c
= edge_connectivity(g, std::back_inserter(disconnecting_set));
auto c = edge_connectivity(g, std::back_inserter(disconnecting_set));
std::cout << "The edge connectivity is " << c << "." << std::endl;
std::cout << "The disconnecting set is {";
+1 -1
View File
@@ -60,7 +60,7 @@ public:
}
edge_stream_iterator operator++(int)
{
edge_stream_iterator tmp = *this;
auto tmp = *this;
m_read();
return tmp;
}
+2 -4
View File
@@ -80,10 +80,8 @@ template < class Graph > void print_network(const Graph& G)
typename boost::graph_traits< Graph >::out_edge_iterator OutEdgeIter;
typedef typename boost::graph_traits< Graph >::in_edge_iterator InEdgeIter;
typename property_map< Graph, edge_mycapacity_t >::const_type capacity
= get(edge_mycapacity, G);
typename property_map< Graph, edge_myflow_t >::const_type flow
= get(edge_myflow, G);
auto capacity = get(edge_mycapacity, G);
auto flow = get(edge_myflow, G);
Viter ui, uiend;
boost::tie(ui, uiend) = vertices(G);
+3 -5
View File
@@ -61,11 +61,9 @@ int main()
Graph g;
property_map< Graph, edge_capacity_t >::type capacity
= get(edge_capacity, g);
property_map< Graph, edge_reverse_t >::type rev = get(edge_reverse, g);
property_map< Graph, edge_residual_capacity_t >::type residual_capacity
= get(edge_residual_capacity, g);
auto capacity = get(edge_capacity, g);
auto rev = get(edge_reverse, g);
auto residual_capacity = get(edge_residual_capacity, g);
Traits::vertex_descriptor s, t;
read_dimacs_max_flow(g, capacity, rev, s, t);
+1 -2
View File
@@ -38,8 +38,7 @@ int main()
graph_traits< adjacency_list<> >::vertex_iterator i, end;
graph_traits< adjacency_list<> >::adjacency_iterator ai, a_end;
property_map< adjacency_list<>, vertex_index_t >::type index_map
= get(vertex_index, g);
auto index_map = get(vertex_index, g);
for (boost::tie(i, end) = vertices(g); i != end; ++i)
{
+1 -1
View File
@@ -34,7 +34,7 @@ int main()
uniform_int<> distrib(0, N - 1);
boost::variate_generator< random_ns::mt19937&, uniform_int<> > rand_gen(
gen, distrib);
for (int t = 0; t < 10; ++t)
for (std::size_t t = 0; t < 10; ++t)
{
std::vector< float > v, w(N);
+1 -1
View File
@@ -45,7 +45,7 @@ int main()
N
};
graph_t G(N);
property_map< graph_t, vertex_name_t >::type name_map = get(vertex_name, G);
auto name_map = get(vertex_name, G);
char name = 'a';
graph_traits< graph_t >::vertex_iterator v, v_end;
for (boost::tie(v, v_end) = vertices(G); v != v_end; ++v, ++name)
+1 -1
View File
@@ -65,7 +65,7 @@ int main()
add_edge(D, B, 3, g);
add_edge(E, C, 0, g);
EdgeWeightMap weight = get(edge_weight, g);
auto weight = get(edge_weight, g);
std::cout << "unfiltered edge_range(C,D)\n";
graph_traits< Graph >::out_edge_iterator f, l;
+3 -3
View File
@@ -16,7 +16,7 @@
#include <map>
#include <vector>
#include <boost/random/linear_congruential.hpp>
#include <boost/progress.hpp>
#include <boost/timer/progress_display.hpp>
#include <boost/shared_ptr.hpp>
using namespace boost;
@@ -67,7 +67,7 @@ class progress_cooling : public linear_cooling< double >
public:
explicit progress_cooling(std::size_t iterations) : inherited(iterations)
{
display.reset(new progress_display(iterations + 1, std::cerr));
display.reset(new boost::timer::progress_display(iterations + 1, std::cerr));
}
double operator()()
@@ -77,7 +77,7 @@ public:
}
private:
shared_ptr< boost::progress_display > display;
shared_ptr< boost::timer::progress_display > display;
};
int main(int argc, char* argv[])
+4 -4
View File
@@ -49,14 +49,14 @@ void merge_vertex(typename boost::graph_traits< Graph >::vertex_descriptor u,
++out_i)
{
e = *out_i;
typename Traits::vertex_descriptor targ = target(e, g);
auto targ = target(e, g);
add_edge(u, targ, getp(e), g);
}
typename Traits::in_edge_iterator in_i, in_end;
for (boost::tie(in_i, in_end) = in_edges(v, g); in_i != in_end; ++in_i)
{
e = *in_i;
typename Traits::vertex_descriptor src = source(e, g);
auto src = source(e, g);
add_edge(src, u, getp(e), g);
}
clear_vertex(v, g);
@@ -131,8 +131,8 @@ int main()
add_edge(3, 4, EdgeProperty('h'), g);
add_edge(0, 1, EdgeProperty('c'), g);
property_map< graph_type, vertex_index_t >::type id = get(vertex_index, g);
property_map< graph_type, edge_name_t >::type name = get(edge_name, g);
auto id = get(vertex_index, g);
auto name = get(edge_name, g);
graph_traits< graph_type >::vertex_iterator i, end;
graph_traits< graph_type >::out_edge_iterator ei, edge_end;
+2 -2
View File
@@ -75,7 +75,7 @@ public:
void tree_edge(edge_descriptor e, Graph* g)
{
vertex_descriptor u = source(e, g), v = target(e, g);
auto u = source(e, g), v = target(e, g);
k = d_map[u] + 1;
d_map[v] = k;
++distance_list[k];
@@ -83,7 +83,7 @@ public:
}
void non_tree_edge(edge_descriptor e, Graph* g)
{
vertex_descriptor u = source(e, g), v = target(e, g);
auto u = source(e, g), v = target(e, g);
k = d_map[u] + 1;
if (d_map[v] + k < girth && v != p_map[u])
girth = d_map[v] + k;
+6 -7
View File
@@ -14,6 +14,7 @@
#include <boost/foreach.hpp>
#include <string>
#include <sstream>
#include <cstdlib>
using namespace boost;
using namespace std;
@@ -51,18 +52,16 @@ int main()
graph_t graph(0);
dynamic_properties dp;
property_map< graph_t, vertex_name_t >::type vname
= get(vertex_name, graph);
auto vname = get(vertex_name, graph);
dp.property("node_id", vname);
property_map< graph_t, vertex_label_t >::type vlabel
= get(vertex_label_t(), graph);
auto vlabel = get(vertex_label_t(), graph);
dp.property("label", vlabel);
property_map< graph_t, vertex_root_t >::type root = get(vertex_root, graph);
auto root = get(vertex_root, graph);
dp.property("root", root);
property_map< graph_t, edge_name_t >::type elabel = get(edge_name, graph);
auto elabel = get(edge_name, graph);
dp.property("label", elabel);
// Use ref_property_map to turn a graph property into a property map
@@ -104,5 +103,5 @@ int main()
<< get("label", dp, v) << ")\n";
}
return 0;
return status ? EXIT_SUCCESS : EXIT_FAILURE;
}
+2 -3
View File
@@ -39,13 +39,12 @@ int main()
graph_t g;
vertex_t a = add_vertex(g), b = add_vertex(g), c = add_vertex(g);
auto a = add_vertex(g), b = add_vertex(g), c = add_vertex(g);
add_edge(a, b, g);
add_edge(a, c, g);
typedef property_map< graph_t, vertex_name_t >::type vertex_name_map_t;
vertex_name_map_t name = get(vertex_name, g);
auto name = get(vertex_name, g);
name[a] = "A";
name[b] = "B";
name[c] = "C";
+21 -19
View File
@@ -7,7 +7,7 @@
// Author: Douglas Gregor
#include <boost/graph/graphviz.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/test/minimal.hpp>
#include <boost/core/lightweight_test.hpp>
#include <string>
#include <fstream>
#include <boost/graph/iteration_macros.hpp>
@@ -25,16 +25,18 @@ typedef boost::adjacency_list< vecS, vecS, undirectedS,
void test_graph_read_write(const std::string& filename)
{
std::ifstream in(filename.c_str());
BOOST_REQUIRE(in);
if (!BOOST_TEST(in)) {
return;
}
Graph g;
dynamic_properties dp;
dp.property("id", get(vertex_name, g));
dp.property("weight", get(edge_weight, g));
BOOST_CHECK(read_graphviz(in, g, dp, "id"));
BOOST_TEST(read_graphviz(in, g, dp, "id"));
BOOST_CHECK(num_vertices(g) == 4);
BOOST_CHECK(num_edges(g) == 4);
BOOST_TEST(num_vertices(g) == 4);
BOOST_TEST(num_edges(g) == 4);
typedef graph_traits< Graph >::vertex_descriptor Vertex;
@@ -43,27 +45,27 @@ void test_graph_read_write(const std::string& filename)
name_to_vertex[get(vertex_name, g, v)] = v;
// Check vertices
BOOST_CHECK(name_to_vertex.find("0") != name_to_vertex.end());
BOOST_CHECK(name_to_vertex.find("1") != name_to_vertex.end());
BOOST_CHECK(name_to_vertex.find("foo") != name_to_vertex.end());
BOOST_CHECK(name_to_vertex.find("bar") != name_to_vertex.end());
BOOST_TEST(name_to_vertex.find("0") != name_to_vertex.end());
BOOST_TEST(name_to_vertex.find("1") != name_to_vertex.end());
BOOST_TEST(name_to_vertex.find("foo") != name_to_vertex.end());
BOOST_TEST(name_to_vertex.find("bar") != name_to_vertex.end());
// Check edges
BOOST_CHECK(edge(name_to_vertex["0"], name_to_vertex["1"], g).second);
BOOST_CHECK(edge(name_to_vertex["1"], name_to_vertex["foo"], g).second);
BOOST_CHECK(edge(name_to_vertex["foo"], name_to_vertex["bar"], g).second);
BOOST_CHECK(edge(name_to_vertex["1"], name_to_vertex["bar"], g).second);
BOOST_TEST(edge(name_to_vertex["0"], name_to_vertex["1"], g).second);
BOOST_TEST(edge(name_to_vertex["1"], name_to_vertex["foo"], g).second);
BOOST_TEST(edge(name_to_vertex["foo"], name_to_vertex["bar"], g).second);
BOOST_TEST(edge(name_to_vertex["1"], name_to_vertex["bar"], g).second);
BOOST_CHECK(get(edge_weight, g,
BOOST_TEST(get(edge_weight, g,
edge(name_to_vertex["0"], name_to_vertex["1"], g).first)
== 3.14159);
BOOST_CHECK(get(edge_weight, g,
BOOST_TEST(get(edge_weight, g,
edge(name_to_vertex["1"], name_to_vertex["foo"], g).first)
== 2.71828);
BOOST_CHECK(get(edge_weight, g,
BOOST_TEST(get(edge_weight, g,
edge(name_to_vertex["foo"], name_to_vertex["bar"], g).first)
== 10.0);
BOOST_CHECK(get(edge_weight, g,
BOOST_TEST(get(edge_weight, g,
edge(name_to_vertex["1"], name_to_vertex["bar"], g).first)
== 10.0);
@@ -71,9 +73,9 @@ void test_graph_read_write(const std::string& filename)
write_graphviz_dp(std::cout, g, dp, std::string("id"));
}
int test_main(int argc, char* argv[])
int main(int argc, char* argv[])
{
test_graph_read_write(argc >= 2 ? argv[1] : "graphviz_example.dot");
return 0;
return boost::report_errors();
}
+1 -1
View File
@@ -35,7 +35,7 @@ int main(int argc, char* argv[])
put(dataMap, v, 2.0f);
// Get the data at the node at position (0,1) in the grid
float retrieved = get(dataMap, v);
auto retrieved = get(dataMap, v);
std::cout << "Retrieved value: " << retrieved << std::endl;
return 0;
+9 -6
View File
@@ -28,10 +28,7 @@ template < typename OutputStream > struct cycle_printer
// Get the property map containing the vertex indices
// so we can print them.
typedef typename boost::property_map< Graph,
boost::vertex_index_t >::const_type IndexMap;
IndexMap indices = get(boost::vertex_index, g);
auto indices = get(boost::vertex_index, g);
// Iterate over path printing each vertex that forms the cycle.
typename Path::const_iterator i, before_end = boost::prior(p.end());
@@ -78,7 +75,8 @@ int main(int argc, char const* argv[])
{
if (argc < 2)
{
std::cout << "usage: " << argv[0] << " num_vertices < input\n";
std::cout << "usage: " << argv[0] << " <num_vertices>";
std::cout << " <max_length (optional)>\n";
return EXIT_FAILURE;
}
@@ -88,7 +86,12 @@ int main(int argc, char const* argv[])
build_graph(graph, num_vertices, first_vertex, last_vertex);
cycle_printer< std::ostream > visitor(std::cout);
boost::hawick_circuits(graph, visitor);
if (argc == 2) {
boost::hawick_circuits(graph, visitor);
} else {
unsigned int max_length = boost::lexical_cast< unsigned int >(argv[2]);
boost::hawick_circuits(graph, visitor, max_length);
}
return EXIT_SUCCESS;
}
+1 -1
View File
@@ -223,7 +223,7 @@ private:
static const int ring_offset[] = { 1, -1 };
vertex_descriptor v;
std::size_t p = *this->base_reference();
auto p = *this->base_reference();
if (m_u == 0 && p == 1)
v = m_n - 1; // Vertex n-1 precedes vertex 0.
else
+1 -1
View File
@@ -63,7 +63,7 @@ int main(int argc, char* argv[])
graph_traits< Graph >::vertex_iterator i, end;
for (boost::tie(i, end) = vertices(g); i != end; ++i)
{
Vertex v = *i;
auto v = *i;
cout << setiosflags(ios::left) << setw(12) << g[v].name << "\t" << im[v]
<< "\t" << pm[v] << endl;
}
+1 -1
View File
@@ -61,7 +61,7 @@ void who_owes_who(EdgeIter first, EdgeIter last, const Graph& G)
// Access the propety acessor type for this graph
typedef
typename property_map< Graph, vertex_first_name_t >::const_type NamePA;
NamePA name = get(vertex_first_name, G);
auto name = get(vertex_first_name, G);
typedef typename boost::property_traits< NamePA >::value_type NameType;
+1 -2
View File
@@ -45,8 +45,7 @@ int main()
graph_traits< adjacency_list<> >::vertex_iterator i, end;
graph_traits< adjacency_list<> >::adjacency_iterator ai, a_end;
property_map< adjacency_list<>, vertex_index_t >::type index_map
= get(vertex_index, g);
auto index_map = get(vertex_index, g);
BGL_FORALL_VERTICES(i, g, adjacency_list<>)
{
+1 -1
View File
@@ -36,7 +36,7 @@ int main()
Graph g(edge_array, edge_array + E, V);
#endif
property_map< Graph, edge_weight_t >::type w = get(edge_weight, g);
auto w = get(edge_weight, g);
int weights[] = { 0, 0, 0, 0, 0, 3, -4, 8, 1, 7, 4, -5, 2, 6 };
int* wp = weights;
+2 -4
View File
@@ -58,10 +58,8 @@ int main(int argc, const char** argv)
Graph;
Graph g;
typedef property_map< Graph, vertex_name_t >::type actor_name_map_t;
actor_name_map_t actor_name = get(vertex_name, g);
typedef property_map< Graph, edge_name_t >::type movie_name_map_t;
movie_name_map_t connecting_movie = get(edge_name, g);
auto actor_name = get(vertex_name, g);
auto connecting_movie = get(edge_name, g);
typedef graph_traits< Graph >::vertex_descriptor Vertex;
typedef std::map< std::string, Vertex > NameVertexMap;
+1 -1
View File
@@ -65,7 +65,7 @@ public:
void tree_edge(Edge e, const Graph& g) const
{
Vertex u = source(e, g), v = target(e, g);
auto u = source(e, g), v = target(e, g);
d[v] = d[u] + 1;
}
+6 -10
View File
@@ -62,26 +62,24 @@ int main(int, char*[])
graph_traits< Graph >::vertex_iterator ui, ui_end;
property_map< Graph, vertex_degree_t >::type deg = get(vertex_degree, G);
auto deg = get(vertex_degree, G);
for (boost::tie(ui, ui_end) = vertices(G); ui != ui_end; ++ui)
deg[*ui] = degree(*ui, G);
property_map< Graph, vertex_index_t >::type index_map
= get(vertex_index, G);
auto index_map = get(vertex_index, G);
std::cout << "original bandwidth: " << bandwidth(G) << std::endl;
std::vector< Vertex > inv_perm(num_vertices(G));
std::vector< size_type > perm(num_vertices(G));
{
Vertex s = vertex(6, G);
auto s = vertex(6, G);
// king_ordering
king_ordering(G, s, inv_perm.rbegin(), get(vertex_color, G),
get(vertex_degree, G), get(vertex_index, G));
cout << "King ordering starting at: " << s << endl;
cout << " ";
for (std::vector< Vertex >::const_iterator i = inv_perm.begin();
i != inv_perm.end(); ++i)
for (auto i = inv_perm.begin(); i != inv_perm.end(); ++i)
cout << index_map[*i] << " ";
cout << endl;
@@ -100,8 +98,7 @@ int main(int, char*[])
get(vertex_degree, G), get(vertex_index, G));
cout << "King ordering starting at: " << s << endl;
cout << " ";
for (std::vector< Vertex >::const_iterator i = inv_perm.begin();
i != inv_perm.end(); ++i)
for (auto i = inv_perm.begin(); i != inv_perm.end(); ++i)
cout << index_map[*i] << " ";
cout << endl;
@@ -121,8 +118,7 @@ int main(int, char*[])
cout << "King ordering:" << endl;
cout << " ";
for (std::vector< Vertex >::const_iterator i = inv_perm.begin();
i != inv_perm.end(); ++i)
for (auto i = inv_perm.begin(); i != inv_perm.end(); ++i)
cout << index_map[*i] << " ";
cout << endl;
+4 -4
View File
@@ -26,7 +26,7 @@ int main()
std::size_t num_edges = sizeof(edge_array) / sizeof(E);
#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
Graph g(num_nodes);
property_map< Graph, edge_weight_t >::type weightmap = get(edge_weight, g);
auto = get(edge_weight, g);
for (std::size_t j = 0; j < num_edges; ++j)
{
Edge e;
@@ -38,14 +38,14 @@ int main()
#else
Graph g(edge_array, edge_array + num_edges, weights, num_nodes);
#endif
property_map< Graph, edge_weight_t >::type weight = get(edge_weight, g);
auto weight = get(edge_weight, g);
std::vector< Edge > spanning_tree;
kruskal_minimum_spanning_tree(g, std::back_inserter(spanning_tree));
std::cout << "Print the edges in the MST:" << std::endl;
for (std::vector< Edge >::iterator ei = spanning_tree.begin();
ei != spanning_tree.end(); ++ei)
for (auto ei = spanning_tree.begin(); ei != spanning_tree.end(); ++ei)
{
std::cout << source(*ei, g) << " <--> " << target(*ei, g)
<< " with weight of " << weight[*ei] << std::endl;
+4 -7
View File
@@ -30,8 +30,7 @@ int main()
property< edge_weight_t, int > >
Graph;
Graph g(num_vertices(g_dot));
property_map< GraphvizGraph, edge_attribute_t >::type edge_attr_map
= get(edge_attribute, g_dot);
auto edge_attr_map = get(edge_attribute, g_dot);
graph_traits< GraphvizGraph >::edge_iterator ei, ei_end;
for (boost::tie(ei, ei_end) = edges(g_dot); ei != ei_end; ++ei)
{
@@ -45,7 +44,7 @@ int main()
size_type;
kruskal_minimum_spanning_tree(g, std::back_inserter(mst));
property_map< Graph, edge_weight_t >::type weight = get(edge_weight, g);
auto weight = get(edge_weight, g);
int total_weight = 0;
for (size_type e = 0; e < mst.size(); ++e)
total_weight += get(weight, mst[e]);
@@ -54,13 +53,11 @@ int main()
typedef graph_traits< Graph >::vertex_descriptor Vertex;
for (size_type i = 0; i < mst.size(); ++i)
{
Vertex u = source(mst[i], g), v = target(mst[i], g);
auto u = source(mst[i], g), v = target(mst[i], g);
edge_attr_map[edge(u, v, g_dot).first]["color"] = "black";
}
std::ofstream out("figs/telephone-mst-kruskal.dot");
graph_property< GraphvizGraph, graph_edge_attribute_t >::type&
graph_edge_attr_map
= get_property(g_dot, graph_edge_attribute);
auto graph_edge_attr_map = get_property(g_dot, graph_edge_attribute);
graph_edge_attr_map["color"] = "gray";
graph_edge_attr_map["style"] = "bold";
write_graphviz(out, g_dot);
+1 -1
View File
@@ -45,7 +45,7 @@ int main(int argc, char** argv)
add_edge(4, 5, g);
// Initialize the interior edge index
property_map< graph, edge_index_t >::type e_index = get(edge_index, g);
auto e_index = get(edge_index, g);
graph_traits< graph >::edges_size_type edge_count = 0;
graph_traits< graph >::edge_iterator ei, ei_end;
for (boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei)
+2 -3
View File
@@ -76,8 +76,7 @@ int main(int argc, const char** argv)
exit(-1);
}
// Obtain internal property map from the graph
property_map< graph_type, vertex_name_t >::type name_map
= get(vertex_name, g);
auto name_map = get(vertex_name, g);
read_graph_file(file_in, name_in, g, name_map);
// Create storage for last modified times
@@ -89,7 +88,7 @@ int main(int argc, const char** argv)
// Create last modified time property map
iter_map_t mod_time_map(last_mod_vec.begin(), get(vertex_index, g));
property_map< graph_type, vertex_name_t >::type name = get(vertex_name, g);
auto name = get(vertex_name, g);
struct stat stat_buf;
graph_traits< graph_type >::vertex_descriptor u;
typedef graph_traits< graph_type >::vertex_iterator vertex_iter_t;
+1 -1
View File
@@ -19,7 +19,7 @@ int main()
g.new_node("Eurystheus");
g.new_node("Amphitryon");
typedef property_map< graph_t, vertex_all_t >::type NodeMap;
NodeMap node_name_map = get(vertex_all, g);
auto node_name_map = get(vertex_all, g);
graph_traits< graph_t >::vertex_iterator vi, vi_end;
for (boost::tie(vi, vi_end) = vertices(g); vi != vi_end; ++vi)
std::cout << node_name_map[*vi] << std::endl;

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