Compare commits

...

214 Commits

Author SHA1 Message Date
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
113 changed files with 2682 additions and 1406 deletions
+81
View File
@@ -0,0 +1,81 @@
# 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 11", "g++-5", packages="g++-5", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-5', 'CXXSTD': '11', }, globalenv=globalenv),
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 11", "g++-6", packages="g++-6", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-6', 'CXXSTD': '11', }, 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 11", "g++-7", packages="g++-7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': '11', }, 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 11", "g++-8", packages="g++-8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-8', 'CXXSTD': '11', }, 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 11", "g++-9", packages="g++-9", buildtype="boost", image="cppalliance/droneubuntu1404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': '11', }, 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 11", "g++-10", packages="g++-10", image="cppalliance/droneubuntu2004:1", buildtype="boost", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': '11', }, 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 11", "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': '11', }, 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++-4.0 1z", "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': '1z', }, globalenv=globalenv),
linux_cxx("clang++-5.0 11", "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': '11', }, 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++-5.0 1z", "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': '1z', }, globalenv=globalenv),
linux_cxx("clang++-6.0 11", "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': '11', }, 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++-6.0 1z", "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': '1z', }, 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': '11', }, 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': '14', }, globalenv=globalenv),
linux_cxx("clang++-7 1z", "clang++-7", packages="clang-7", llvm_os="xenial", llvm_ver="7", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-7', 'CXXSTD': '1z', }, globalenv=globalenv),
linux_cxx("clang++-8 11", "clang++-8", packages="clang-8", llvm_os="xenial", llvm_ver="8", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': '11', }, 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 11", "clang++-9", packages="clang-9", llvm_os="xenial", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': '11', }, 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 11", "clang++-10", packages="clang-10", llvm_os="xenial", llvm_ver="10", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': '11', }, 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 11", "clang++", packages="", buildtype="boost", xcode_version="11.7", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '11', }, 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
+178
View File
@@ -0,0 +1,178 @@
# 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=11,14,17,2a
working-directory: ../boost-root/libs/config/test
- name: Test
run: ../../../b2 toolset=$TOOLSET cxxstd=11,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=11,14,17,2a
working-directory: ../boost-root/libs/config/test
- name: Test
run: ../../../b2 toolset=${{ matrix.toolset }} cxxstd=11,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
+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()
+5 -5
View File
@@ -1,4 +1,5 @@
Boost Graph Library [![Build Status](https://travis-ci.org/boostorg/graph.svg?branch=develop)](https://travis-ci.org/boostorg/graph)
Boost Graph Library [![Build Status](https://drone.cpp.al/api/badges/boostorg/graph/status.svg)](https://drone.cpp.al/boostorg/graph)[![Build Status](https://github.com/boostorg/graph/workflows/CI/badge.svg?branch=develop)](https://github.com/boostorg/graph/actions)
===================
A generic interface for traversing graphs, using C++ templates.
@@ -14,7 +15,7 @@ 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).
@@ -25,9 +26,8 @@ There is no mailing-list specific to Boost Graph, although you can use the gener
| | 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/workflows/CI/badge.svg?branch=master)](https://github.com/boostorg/graph/actions) | [![Build Status](https://github.com/boostorg/graph/workflows/CI/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) |
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)):
-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>
+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
@@ -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
@@ -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>
+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
@@ -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 ;
+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 >
+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[])
+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();
}
+8 -2
View File
@@ -78,7 +78,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 +89,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;
}
+2 -2
View File
@@ -288,8 +288,8 @@ int main()
std::cout << "SPP with time windows:" << std::endl;
std::cout << "Number of optimal solutions: ";
std::cout << static_cast< int >(opt_solutions.size()) << std::endl;
for (int i = 0; i < static_cast< int >(opt_solutions.size()); ++i)
std::cout << static_cast< int >(opt_solutions_spptw.size()) << std::endl;
for (int i = 0; i < static_cast< int >(opt_solutions_spptw.size()); ++i)
{
std::cout << "The " << i << "th shortest path from A to E is: ";
std::cout << std::endl;
+1 -1
View File
@@ -30,7 +30,7 @@
#ifndef BOOST_ALGORITHM_HPP
#define BOOST_ALGORITHM_HPP
#include <boost/detail/iterator.hpp>
// Algorithms on sequences
//
// The functions in this file have not yet gone through formal
+3 -3
View File
@@ -10,7 +10,7 @@
#ifndef BOOST_ADJACENCY_ITERATOR_HPP
#define BOOST_ADJACENCY_ITERATOR_HPP
#include <boost/detail/iterator.hpp>
#include <iterator>
#include <boost/iterator/iterator_adaptor.hpp>
#include <boost/graph/graph_traits.hpp>
@@ -45,7 +45,7 @@ template < class Graph,
class adjacency_iterator_generator
{
typedef
typename boost::detail::iterator_traits< OutEdgeIter >::difference_type
typename std::iterator_traits< OutEdgeIter >::difference_type
difference_type;
public:
@@ -81,7 +81,7 @@ template < class Graph,
class inv_adjacency_iterator_generator
{
typedef
typename boost::detail::iterator_traits< InEdgeIter >::difference_type
typename std::iterator_traits< InEdgeIter >::difference_type
difference_type;
public:
-1
View File
@@ -328,7 +328,6 @@ inline void astar_search_no_init_tree(const VertexListGraph& g,
BOOST_THROW_EXCEPTION(negative_edge());
bool decreased
= relax(e, g, weight, predecessor, distance, combine, compare);
combine(get(distance, v), e_weight);
if (decreased)
{
vis.edge_relaxed(e, g);
+1
View File
@@ -10,6 +10,7 @@
#include <algorithm> // for std::min and std::max
#include <boost/config.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/properties.hpp>
#include <boost/detail/numeric_traits.hpp>
namespace boost
+2 -2
View File
@@ -9,11 +9,11 @@
#ifndef BOOST_GRAPH_BETWEENNESS_CENTRALITY_CLUSTERING_HPP
#define BOOST_GRAPH_BETWEENNESS_CENTRALITY_CLUSTERING_HPP
#include <boost/algorithm/minmax_element.hpp>
#include <boost/graph/betweenness_centrality.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/graph_utility.hpp>
#include <boost/pending/indirect_cmp.hpp>
#include <algorithm>
#include <vector>
#include <boost/property_map/property_map.hpp>
@@ -133,7 +133,7 @@ void betweenness_centrality_clustering(MutableGraph& g, Done done,
.vertex_index_map(vertex_index));
std::pair< edge_iterator, edge_iterator > edges_iters = edges(g);
edge_descriptor e
= *max_element(edges_iters.first, edges_iters.second, cmp);
= *boost::first_max_element(edges_iters.first, edges_iters.second, cmp);
is_done = done(get(edge_centrality, e), e, g);
if (!is_done)
remove_edge(e, g);
-1
View File
@@ -20,7 +20,6 @@
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/depth_first_search.hpp>
#include <boost/graph/one_bit_color_map.hpp>
#include <boost/bind.hpp>
namespace boost
{
@@ -977,7 +977,7 @@ boykov_kolmogorov_max_flow(Graph& g, CapacityEdgeMap cap,
}
/**
* non-named-parameter version, given capacity, residucal_capacity,
* non-named-parameter version, given capacity, residual_capacity,
* reverse_edges, and an index map.
*/
template < class Graph, class CapacityEdgeMap, class ResidualCapacityEdgeMap,
@@ -1029,8 +1029,7 @@ boykov_kolmogorov_max_flow(Graph& g, CapacityEdgeMap cap,
* named-parameter version, some given
*/
template < class Graph, class P, class T, class R >
typename property_traits<
typename property_map< Graph, edge_capacity_t >::const_type >::value_type
typename detail::edge_capacity_value< Graph, P, T, R >::type
boykov_kolmogorov_max_flow(Graph& g,
typename graph_traits< Graph >::vertex_descriptor src,
typename graph_traits< Graph >::vertex_descriptor sink,
+2 -2
View File
@@ -27,7 +27,7 @@
#include <boost/graph/detail/mpi_include.hpp>
#include <boost/concept/assert.hpp>
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / concepts.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/concepts.hpp>)
namespace boost
{
@@ -403,6 +403,6 @@ namespace graph
} // namespace boost
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / breadth_first_search.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/breadth_first_search.hpp>)
#endif // BOOST_GRAPH_BREADTH_FIRST_SEARCH_HPP
@@ -14,6 +14,7 @@
#include <stack>
#include <boost/config.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/properties.hpp>
#include <boost/property_map/property_map.hpp>
namespace boost
+1
View File
@@ -14,6 +14,7 @@
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/iteration_macros.hpp>
#include <boost/graph/topology.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/static_assert.hpp>
namespace boost
+1 -1
View File
@@ -109,6 +109,6 @@ connected_components(const Graph& g,
} // namespace boost
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / connected_components.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/connected_components.hpp>)
#endif // BOOST_GRAPH_CONNECTED_COMPONENTS_HPP
+1 -1
View File
@@ -428,6 +428,6 @@ void depth_first_visit(const IncidenceGraph& g,
}
} // namespace boost
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / depth_first_search.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/depth_first_search.hpp>)
#endif
+13 -3
View File
@@ -21,6 +21,7 @@
#include <boost/range/irange.hpp>
#include <boost/graph/graph_traits.hpp>
#include <memory>
#include <iterator>
#include <algorithm>
#include <boost/limits.hpp>
@@ -2068,15 +2069,20 @@ namespace detail
inline void reindex_edge_list(
EdgeList& el, vertex_descriptor u, boost::disallow_parallel_edge_tag)
{
for (typename EdgeList::iterator ei = el.begin(); ei != el.end(); ++ei)
typename EdgeList::iterator ei = el.begin(), e_end = el.end();
while (ei != e_end)
{
if (ei->get_target() > u)
{
typename EdgeList::value_type ce = *ei;
++ei;
el.erase(ce);
--ce.get_target();
el.insert(ce);
}
else {
++ei;
}
}
}
} // namespace detail
@@ -2183,8 +2189,12 @@ public:
}
// Copy the edges by adding each edge and copying its
// property object.
#ifdef BOOST_NO_CXX17_STRUCTURED_BINDINGS
edge_iterator ei, ei_end;
for (boost::tie(ei, ei_end) = edges(x); ei != ei_end; ++ei)
#else // Silences -Wmaybe-uninitialized in adj_list_edge_iterator::operator++().
for (auto [ei, ei_end] = edges(x); ei != ei_end; ++ei)
#endif
{
edge_descriptor e;
bool inserted;
@@ -2370,7 +2380,7 @@ namespace detail
typedef typename OutEdgeList::size_type degree_size_type;
typedef typename OutEdgeList::iterator OutEdgeIter;
typedef boost::detail::iterator_traits< OutEdgeIter >
typedef std::iterator_traits< OutEdgeIter >
OutEdgeIterTraits;
typedef
typename OutEdgeIterTraits::iterator_category OutEdgeIterCat;
@@ -2398,7 +2408,7 @@ namespace detail
// Edge Iterator
typedef boost::detail::iterator_traits< EdgeIter > EdgeIterTraits;
typedef std::iterator_traits< EdgeIter > EdgeIterTraits;
typedef typename EdgeIterTraits::iterator_category EdgeIterCat;
typedef typename EdgeIterTraits::difference_type EdgeIterDiff;
+4 -4
View File
@@ -204,10 +204,10 @@ private:
// Get the parent of a given node in the heap
static size_type parent(size_type index) { return (index - 1) / Arity; }
// Get the child_idx'th child of a given node; 0 <= child_idx < Arity
static size_type child(size_type index, std::size_t child_idx)
// Get the first child of a given node
static size_type first_child(size_type index)
{
return index * Arity + child_idx + 1;
return index * Arity + 1;
}
// Swap two elements in the heap by index, updating index_in_heap
@@ -304,7 +304,7 @@ private:
Value* data_ptr = &data[0];
for (;;)
{
size_type first_child_index = child(index, 0);
size_type first_child_index = first_child(index);
if (first_child_index >= heap_size)
break; /* No children */
Value* child_base_ptr = data_ptr + first_child_index;
+3 -2
View File
@@ -55,8 +55,9 @@ namespace detail
(ReadablePropertyMapConcept< DistanceMap, Vertex >));
BOOST_CONCEPT_ASSERT((NumericValueConcept< Distance >));
typedef numeric_values< Distance > DistanceNumbers;
BOOST_CONCEPT_ASSERT((AdaptableBinaryFunction< Combinator, Distance,
Distance, Distance >));
// NOTE: Disabled until this concept assert is fixed in Boost.ConceptCheck.
// BOOST_CONCEPT_ASSERT((AdaptableBinaryFunction< Combinator, Distance,
// Distance, Distance >));
// If there's ever an infinite distance, then we simply return
// infinity. Note that this /will/ include the a non-zero
+1
View File
@@ -8,6 +8,7 @@
#define BOOST_GRAPH_DETAIL_INDEX_HPP
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/properties.hpp>
// The structures in this module are responsible for selecting and defining
// types for accessing a builting index map. Note that the selection of these
@@ -171,7 +171,7 @@ namespace detail
= construct_< std::string >(arg1, arg2)];
a_list = list_p(
ID[(a_list.key = arg1), (a_list.value = "true")] >> !(
ID[((a_list.key = arg1), (a_list.value = "true"))] >> !(
ch_p('=') >> ID[a_list.value = arg1])[phoenix::bind(
&definition::call_prop_actor)(
var(*this), a_list.key, a_list.value)],
@@ -213,8 +213,8 @@ namespace detail
// (directed/undirected)
edgeop = ch_p('-') >> ch_p(boost::ref(edge_head));
edgeRHS = +(edgeop[(data_stmt.sources = data_stmt.dests),
(data_stmt.dests = construct_< nodes_t >())]
edgeRHS = +(edgeop[((data_stmt.sources = data_stmt.dests),
(data_stmt.dests = construct_< nodes_t >()))]
>> (subgraph[data_stmt.dests = arg1]
| node_id[phoenix::bind(&definition::insert_node)(
var(*this), data_stmt.dests, arg1)])
@@ -225,10 +225,10 @@ namespace detail
// To avoid backtracking, edge, node, and subgraph
// statements are processed as one nonterminal.
data_stmt
= (subgraph[(data_stmt.dests
= (subgraph[((data_stmt.dests
= arg1), // will get moved in rhs
(data_stmt.saw_node = false)]
| node_id[(phoenix::bind(
(data_stmt.saw_node = false))]
| node_id[((phoenix::bind(
&definition::insert_node)(
var(*this), data_stmt.dests, arg1)),
(data_stmt.saw_node = true),
@@ -236,7 +236,7 @@ namespace detail
(std::cout << val("AcTive Node: ") << arg1
<< "\n"),
#endif // BOOST_GRAPH_DEBUG
(data_stmt.active_node = arg1)])
(data_stmt.active_node = arg1))])
>> if_p(edgeRHS)[!attr_list(actor_t(phoenix::bind(
&definition::edge_prop)(
var(*this), arg1, arg2)))]
@@ -252,11 +252,11 @@ namespace detail
stmt_list = *(stmt >> !ch_p(';'));
subgraph = !(as_lower_d[keyword_p("subgraph")]
>> (!ID[(subgraph.name = arg1),
>> (!ID[((subgraph.name = arg1),
(subgraph.nodes
= (var(subgraph_nodes))[arg1]),
(subgraph.edges
= (var(subgraph_edges))[arg1])]))
= (var(subgraph_edges))[arg1]))]))
>> ch_p('{')[++var(subgraph_depth)] >> stmt_list
>> ch_p('}')[--var(subgraph_depth)]
[(var(subgraph_nodes))[subgraph.name]
@@ -265,19 +265,19 @@ namespace detail
= subgraph.edges]
| as_lower_d[keyword_p("subgraph")]
>> ID[(subgraph.nodes
>> ID[((subgraph.nodes
= (var(subgraph_nodes))[arg1]),
(subgraph.edges = (var(subgraph_edges))[arg1])];
(subgraph.edges = (var(subgraph_edges))[arg1]))];
the_grammar = (!as_lower_d[keyword_p("strict")])
>> (as_lower_d[keyword_p(
"graph")][(var(edge_head) = '-'),
"graph")][((var(edge_head) = '-'),
(phoenix::bind(&definition::check_undirected)(
var(*this)))]
var(*this))))]
| as_lower_d[keyword_p(
"digraph")][(var(edge_head) = '>'),
"digraph")][((var(edge_head) = '>'),
(phoenix::bind(&definition::check_directed)(
var(*this)))])
var(*this))))])
>> (!ID) >> ch_p('{') >> stmt_list >> ch_p('}');
} // definition()
@@ -21,7 +21,6 @@
#include <boost/graph/properties.hpp>
#include <boost/pending/indirect_cmp.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/bind.hpp>
#include <boost/graph/iteration_macros.hpp>
#include <boost/graph/depth_first_search.hpp>
@@ -575,6 +575,6 @@ inline void dijkstra_shortest_paths(const VertexListGraph& g,
} // namespace boost
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / dijkstra_shortest_paths.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/dijkstra_shortest_paths.hpp>)
#endif // BOOST_GRAPH_DIJKSTRA_HPP
+1
View File
@@ -18,6 +18,7 @@
#include <vector>
#include <queue>
#include <boost/assert.hpp>
#include <boost/throw_exception.hpp>
namespace boost
{
@@ -16,6 +16,7 @@
#include <vector>
#include <set>
#include <algorithm>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/edmonds_karp_max_flow.hpp>
namespace boost
+49
View File
@@ -13,6 +13,8 @@
#include <stdexcept>
#include <string>
#include <boost/config.hpp>
namespace boost
{
@@ -51,6 +53,53 @@ struct BOOST_SYMBOL_VISIBLE not_complete : public bad_graph
not_complete() : bad_graph("The graph must be complete.") {}
};
struct BOOST_SYMBOL_VISIBLE graph_exception : public std::exception
{
~graph_exception() throw() BOOST_OVERRIDE {}
const char* what() const throw() BOOST_OVERRIDE = 0;
};
struct BOOST_SYMBOL_VISIBLE bad_parallel_edge : public graph_exception
{
std::string from;
std::string to;
mutable std::string statement;
bad_parallel_edge(const std::string& i, const std::string& j)
: from(i), to(j)
{
}
~bad_parallel_edge() throw() BOOST_OVERRIDE {}
const char* what() const throw() BOOST_OVERRIDE
{
if (statement.empty())
statement = std::string("Failed to add parallel edge: (") + from
+ "," + to + ")\n";
return statement.c_str();
}
};
struct BOOST_SYMBOL_VISIBLE directed_graph_error : public graph_exception
{
~directed_graph_error() throw() BOOST_OVERRIDE {}
const char* what() const throw() BOOST_OVERRIDE
{
return "read_graphviz: "
"Tried to read a directed graph into an undirected graph.";
}
};
struct BOOST_SYMBOL_VISIBLE undirected_graph_error : public graph_exception
{
~undirected_graph_error() throw() BOOST_OVERRIDE {}
const char* what() const throw() BOOST_OVERRIDE
{
return "read_graphviz: "
"Tried to read an undirected graph into a directed graph.";
}
};
} // namespace boost
#endif // BOOST_GRAPH_EXCEPTION_HPP
+1 -1
View File
@@ -455,6 +455,6 @@ void fruchterman_reingold_force_directed_layout(
} // end namespace boost
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / fruchterman_reingold.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/fruchterman_reingold.hpp>)
#endif // BOOST_GRAPH_FRUCHTERMAN_REINGOLD_FORCE_DIRECTED_LAYOUT_HPP
+3 -2
View File
@@ -27,8 +27,9 @@ struct mean_geodesic_measure
BOOST_CONCEPT_ASSERT((VertexListGraphConcept< Graph >));
BOOST_CONCEPT_ASSERT((NumericValueConcept< DistanceType >));
BOOST_CONCEPT_ASSERT((NumericValueConcept< ResultType >));
BOOST_CONCEPT_ASSERT((AdaptableBinaryFunctionConcept< Divides,
ResultType, ResultType, ResultType >));
// NOTE: Disabled until this concept assert is fixed in Boost.ConceptCheck.
// BOOST_CONCEPT_ASSERT((AdaptableBinaryFunctionConcept< Divides,
// ResultType, ResultType, ResultType >));
return (d == base_type::infinite_distance())
? base_type::infinite_result()
@@ -11,6 +11,7 @@
#include <boost/mpl/if.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_same.hpp>
namespace boost
+2
View File
@@ -11,7 +11,9 @@
#include <map>
#include <list>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/iteration_macros.hpp>
#include <boost/graph/properties.hpp>
#include <boost/assert.hpp>
namespace boost
+1 -2
View File
@@ -19,6 +19,7 @@
#include <boost/tuple/tuple.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/iteration_macros.hpp>
#include <boost/graph/properties.hpp>
#include <boost/pending/container_traits.hpp>
#include <boost/graph/depth_first_search.hpp>
@@ -448,8 +449,6 @@ namespace graph
} // namespace graph
#include <boost/graph/iteration_macros.hpp>
template < class PropertyIn, class PropertyOut, class Graph >
void copy_vertex_property(PropertyIn p_in, PropertyOut p_out, Graph& g)
{
+17 -13
View File
@@ -16,17 +16,21 @@
#include <boost/lexical_cast.hpp>
#include <boost/any.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/dll_import_export.hpp>
#include <boost/graph/graphviz.hpp> // for exceptions
#include <typeinfo>
#include <boost/graph/exception.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/find.hpp>
#include <boost/mpl/for_each.hpp>
#include <boost/property_map/dynamic_property_map.hpp>
#include <boost/property_tree/detail/xml_parser_utils.hpp>
#include <boost/throw_exception.hpp>
#include <exception>
#include <sstream>
#include <typeinfo>
namespace boost
{
@@ -41,8 +45,8 @@ struct BOOST_SYMBOL_VISIBLE parse_error : public graph_exception
error = err;
statement = "parse error: " + error;
}
virtual ~parse_error() throw() {}
virtual const char* what() const throw() { return statement.c_str(); }
~parse_error() throw() BOOST_OVERRIDE {}
const char* what() const throw() BOOST_OVERRIDE { return statement.c_str(); }
std::string statement;
std::string error;
};
@@ -84,16 +88,16 @@ public:
{
}
bool is_directed() const
bool is_directed() const BOOST_OVERRIDE
{
return is_convertible<
typename graph_traits< MutableGraph >::directed_category,
directed_tag >::value;
}
virtual any do_add_vertex() { return any(add_vertex(m_g)); }
any do_add_vertex() BOOST_OVERRIDE { return any(add_vertex(m_g)); }
virtual std::pair< any, bool > do_add_edge(any source, any target)
std::pair< any, bool > do_add_edge(any source, any target) BOOST_OVERRIDE
{
std::pair< edge_descriptor, bool > retval
= add_edge(any_cast< vertex_descriptor >(source),
@@ -101,8 +105,8 @@ public:
return std::make_pair(any(retval.first), retval.second);
}
virtual void set_graph_property(const std::string& name,
const std::string& value, const std::string& value_type)
void set_graph_property(const std::string& name,
const std::string& value, const std::string& value_type) BOOST_OVERRIDE
{
bool type_found = false;
try
@@ -123,8 +127,8 @@ public:
}
}
virtual void set_vertex_property(const std::string& name, any vertex,
const std::string& value, const std::string& value_type)
void set_vertex_property(const std::string& name, any vertex,
const std::string& value, const std::string& value_type) BOOST_OVERRIDE
{
bool type_found = false;
try
@@ -146,8 +150,8 @@ public:
}
}
virtual void set_edge_property(const std::string& name, any edge,
const std::string& value, const std::string& value_type)
void set_edge_property(const std::string& name, any edge,
const std::string& value, const std::string& value_type) BOOST_OVERRIDE
{
bool type_found = false;
try
+33 -77
View File
@@ -11,13 +11,14 @@
#define BOOST_GRAPHVIZ_HPP
#include <boost/config.hpp>
#include <string>
#include <map>
#include <iostream>
#include <cstdio> // for FILE
#include <fstream>
#include <stdio.h> // for FILE
#include <iostream>
#include <map>
#include <string>
#include <boost/property_map/property_map.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/graph/exception.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/properties.hpp>
#include <boost/graph/subgraph.hpp>
@@ -649,59 +650,12 @@ void write_graphviz_dp(std::ostream& out, const Graph& g,
/////////////////////////////////////////////////////////////////////////////
// Graph reader exceptions
/////////////////////////////////////////////////////////////////////////////
struct BOOST_SYMBOL_VISIBLE graph_exception : public std::exception
{
virtual ~graph_exception() throw() {}
virtual const char* what() const throw() = 0;
};
struct BOOST_SYMBOL_VISIBLE bad_parallel_edge : public graph_exception
{
std::string from;
std::string to;
mutable std::string statement;
bad_parallel_edge(const std::string& i, const std::string& j)
: from(i), to(j)
{
}
virtual ~bad_parallel_edge() throw() {}
const char* what() const throw()
{
if (statement.empty())
statement = std::string("Failed to add parallel edge: (") + from
+ "," + to + ")\n";
return statement.c_str();
}
};
struct BOOST_SYMBOL_VISIBLE directed_graph_error : public graph_exception
{
virtual ~directed_graph_error() throw() {}
virtual const char* what() const throw()
{
return "read_graphviz: "
"Tried to read a directed graph into an undirected graph.";
}
};
struct BOOST_SYMBOL_VISIBLE undirected_graph_error : public graph_exception
{
virtual ~undirected_graph_error() throw() {}
virtual const char* what() const throw()
{
return "read_graphviz: "
"Tried to read an undirected graph into a directed graph.";
}
};
struct BOOST_SYMBOL_VISIBLE bad_graphviz_syntax : public graph_exception
{
std::string errmsg;
bad_graphviz_syntax(const std::string& errmsg) : errmsg(errmsg) {}
const char* what() const throw() { return errmsg.c_str(); }
~bad_graphviz_syntax() throw() {};
const char* what() const throw() BOOST_OVERRIDE { return errmsg.c_str(); }
~bad_graphviz_syntax() throw() BOOST_OVERRIDE {}
};
namespace detail
@@ -723,7 +677,7 @@ namespace detail
{
static int idx = 0;
return edge_t(idx++);
};
}
bool operator==(const edge_t& rhs) const
{
@@ -774,9 +728,9 @@ namespace detail
{
}
~mutate_graph_impl() {}
~mutate_graph_impl() BOOST_OVERRIDE {}
bool is_directed() const
bool is_directed() const BOOST_OVERRIDE
{
return boost::is_convertible<
typename boost::graph_traits<
@@ -784,7 +738,7 @@ namespace detail
boost::directed_tag >::value;
}
virtual void do_add_vertex(const node_t& node)
void do_add_vertex(const node_t& node) BOOST_OVERRIDE
{
// Add the node to the graph.
bgl_vertex_t v = add_vertex(graph_);
@@ -797,8 +751,8 @@ namespace detail
put(node_id_prop_, dp_, v, node);
}
void do_add_edge(
const edge_t& edge, const node_t& source, const node_t& target)
void do_add_edge(const edge_t& edge, const node_t& source,
const node_t& target) BOOST_OVERRIDE
{
std::pair< bgl_edge_t, bool > result
= add_edge(bgl_nodes[source], bgl_nodes[target], graph_);
@@ -814,25 +768,26 @@ namespace detail
}
}
void set_node_property(
const id_t& key, const node_t& node, const id_t& value)
void set_node_property(const id_t& key, const node_t& node,
const id_t& value) BOOST_OVERRIDE
{
put(key, dp_, bgl_nodes[node], value);
}
void set_edge_property(
const id_t& key, const edge_t& edge, const id_t& value)
void set_edge_property(const id_t& key, const edge_t& edge,
const id_t& value) BOOST_OVERRIDE
{
put(key, dp_, bgl_edges[edge], value);
}
void set_graph_property(const id_t& key, const id_t& value)
void set_graph_property(const id_t& key,
const id_t& value) BOOST_OVERRIDE
{
/* RG: pointer to graph prevents copying */
put(key, dp_, &graph_, value);
}
void finish_building_graph() {}
void finish_building_graph() BOOST_OVERRIDE {}
protected:
MutableGraph& graph_;
@@ -869,9 +824,9 @@ namespace detail
{
}
~mutate_graph_impl() {}
~mutate_graph_impl() BOOST_OVERRIDE {}
void finish_building_graph()
void finish_building_graph() BOOST_OVERRIDE
{
typedef compressed_sparse_row_graph< directedS, no_property,
bgl_edge_t, GraphProperty, Vertex, EdgeIndex >
@@ -902,14 +857,14 @@ namespace detail
}
}
bool is_directed() const
bool is_directed() const BOOST_OVERRIDE
{
return boost::is_convertible<
typename boost::graph_traits< CSRGraph >::directed_category,
boost::directed_tag >::value;
}
virtual void do_add_vertex(const node_t& node)
void do_add_vertex(const node_t& node) BOOST_OVERRIDE
{
// Add the node to the graph.
bgl_vertex_t v = vertex_count++;
@@ -923,8 +878,8 @@ namespace detail
boost::make_tuple(node_id_prop_, v, node));
}
void do_add_edge(
const edge_t& edge, const node_t& source, const node_t& target)
void do_add_edge(const edge_t& edge, const node_t& source,
const node_t& target) BOOST_OVERRIDE
{
bgl_edge_t result = edges_to_add.size();
edges_to_add.push_back(
@@ -932,21 +887,22 @@ namespace detail
bgl_edges.insert(std::make_pair(edge, result));
}
void set_node_property(
const id_t& key, const node_t& node, const id_t& value)
void set_node_property(const id_t& key, const node_t& node,
const id_t& value) BOOST_OVERRIDE
{
vertex_props.push_back(
boost::make_tuple(key, bgl_nodes[node], value));
}
void set_edge_property(
const id_t& key, const edge_t& edge, const id_t& value)
void set_edge_property(const id_t& key, const edge_t& edge,
const id_t& value) BOOST_OVERRIDE
{
edge_props.push_back(
boost::make_tuple(key, bgl_edges[edge], value));
}
void set_graph_property(const id_t& key, const id_t& value)
void set_graph_property(const id_t& key,
const id_t& value) BOOST_OVERRIDE
{
/* RG: pointer to graph prevents copying */
put(key, dp_, &graph_, value);
@@ -1025,6 +981,6 @@ bool read_graphviz(std::istream& in, MutableGraph& graph,
} // namespace boost
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / graphviz.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/graphviz.hpp>)
#endif // BOOST_GRAPHVIZ_HPP
-1
View File
@@ -15,7 +15,6 @@
#include <numeric>
#include <boost/array.hpp>
#include <boost/bind.hpp>
#include <boost/limits.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/properties.hpp>
+37 -15
View File
@@ -153,13 +153,14 @@ namespace hawick_circuits_detail
public:
hawick_circuits_from(Graph const& graph, Visitor& visitor,
VertexIndexMap const& vim, Stack& stack, ClosedMatrix& closed,
VerticesSize n_vertices)
VerticesSize n_vertices, unsigned int max_length)
: graph_(graph)
, visitor_(visitor)
, vim_(vim)
, stack_(stack)
, closed_(closed)
, blocked_(n_vertices, vim_)
, max_length_(max_length)
{
BOOST_ASSERT(blocked_map_starts_all_unblocked());
@@ -224,6 +225,10 @@ namespace hawick_circuits_detail
stack_.push_back(v);
block(v);
// Truncate the search if any circuits would exceed max_length_.
bool const truncate_search =
(max_length_ > 0 && stack_.size() >= max_length_);
// Cache some values that are used more than once in the function.
VertexIndex const index_of_start = index_of(start);
AdjacentVertices const adj_vertices
@@ -249,13 +254,19 @@ namespace hawick_circuits_detail
found_circuit = true;
}
// If required, truncate the search before the subsequent
// recursive call to circuit().
else if (truncate_search)
continue;
// If `w` is not blocked, we continue searching further down the
// same path for a cycle with `w` in it.
else if (!is_blocked(w) && circuit(start, w))
found_circuit = true;
}
if (found_circuit)
bool const finish_circuit = (found_circuit || truncate_search);
if (finish_circuit)
unblock(v);
else
for (AdjacencyIterator w_it = boost::begin(adj_vertices);
@@ -274,7 +285,7 @@ namespace hawick_circuits_detail
BOOST_ASSERT(v == stack_.back());
stack_.pop_back();
return found_circuit;
return finish_circuit;
}
public:
@@ -287,12 +298,14 @@ namespace hawick_circuits_detail
Stack& stack_;
ClosedMatrix& closed_;
BlockedMap blocked_;
unsigned int max_length_;
};
template < typename GetAdjacentVertices, typename Graph, typename Visitor,
typename VertexIndexMap >
void call_hawick_circuits(Graph const& graph,
Visitor /* by value */ visitor, VertexIndexMap const& vertex_index_map)
Visitor /* by value */ visitor, VertexIndexMap const& vertex_index_map,
unsigned int max_length)
{
typedef graph_traits< Graph > Traits;
typedef typename Traits::vertex_descriptor Vertex;
@@ -322,7 +335,8 @@ namespace hawick_circuits_detail
// construction. It would be strictly equivalent to have these as
// member variables of the sub algorithm.
SubAlgorithm sub_algo(
graph, visitor, vertex_index_map, stack, closed, n_vertices);
graph, visitor, vertex_index_map, stack, closed, n_vertices,
max_length);
sub_algo(*start);
stack.clear();
typename ClosedMatrix::iterator row, last_row = closed.end();
@@ -333,30 +347,35 @@ namespace hawick_circuits_detail
template < typename GetAdjacentVertices, typename Graph, typename Visitor >
void call_hawick_circuits(
Graph const& graph, BOOST_FWD_REF(Visitor) visitor)
Graph const& graph, BOOST_FWD_REF(Visitor) visitor,
unsigned int max_length)
{
call_hawick_circuits< GetAdjacentVertices >(graph,
boost::forward< Visitor >(visitor), get(vertex_index, graph));
boost::forward< Visitor >(visitor), get(vertex_index, graph),
max_length);
}
} // end namespace hawick_circuits_detail
//! Enumerate all the elementary circuits in a directed multigraph.
template < typename Graph, typename Visitor, typename VertexIndexMap >
void hawick_circuits(BOOST_FWD_REF(Graph) graph, BOOST_FWD_REF(Visitor) visitor,
BOOST_FWD_REF(VertexIndexMap) vertex_index_map)
BOOST_FWD_REF(VertexIndexMap) vertex_index_map,
unsigned int max_length = 0)
{
hawick_circuits_detail::call_hawick_circuits<
hawick_circuits_detail::get_all_adjacent_vertices >(
boost::forward< Graph >(graph), boost::forward< Visitor >(visitor),
boost::forward< VertexIndexMap >(vertex_index_map));
boost::forward< VertexIndexMap >(vertex_index_map), max_length);
}
template < typename Graph, typename Visitor >
void hawick_circuits(BOOST_FWD_REF(Graph) graph, BOOST_FWD_REF(Visitor) visitor)
void hawick_circuits(BOOST_FWD_REF(Graph) graph, BOOST_FWD_REF(Visitor) visitor,
unsigned int max_length = 0)
{
hawick_circuits_detail::call_hawick_circuits<
hawick_circuits_detail::get_all_adjacent_vertices >(
boost::forward< Graph >(graph), boost::forward< Visitor >(visitor));
boost::forward< Graph >(graph), boost::forward< Visitor >(visitor),
max_length);
}
/*!
@@ -366,21 +385,24 @@ void hawick_circuits(BOOST_FWD_REF(Graph) graph, BOOST_FWD_REF(Visitor) visitor)
template < typename Graph, typename Visitor, typename VertexIndexMap >
void hawick_unique_circuits(BOOST_FWD_REF(Graph) graph,
BOOST_FWD_REF(Visitor) visitor,
BOOST_FWD_REF(VertexIndexMap) vertex_index_map)
BOOST_FWD_REF(VertexIndexMap) vertex_index_map,
unsigned int max_length = 0)
{
hawick_circuits_detail::call_hawick_circuits<
hawick_circuits_detail::get_unique_adjacent_vertices >(
boost::forward< Graph >(graph), boost::forward< Visitor >(visitor),
boost::forward< VertexIndexMap >(vertex_index_map));
boost::forward< VertexIndexMap >(vertex_index_map), max_length);
}
template < typename Graph, typename Visitor >
void hawick_unique_circuits(
BOOST_FWD_REF(Graph) graph, BOOST_FWD_REF(Visitor) visitor)
BOOST_FWD_REF(Graph) graph, BOOST_FWD_REF(Visitor) visitor,
unsigned int max_length = 0)
{
hawick_circuits_detail::call_hawick_circuits<
hawick_circuits_detail::get_unique_adjacent_vertices >(
boost::forward< Graph >(graph), boost::forward< Visitor >(visitor));
boost::forward< Graph >(graph), boost::forward< Visitor >(visitor),
max_length);
}
} // end namespace boost
+9 -2
View File
@@ -10,9 +10,11 @@
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <limits>
#include <boost/bind.hpp>
#include <boost/bind/bind.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/concept_check.hpp>
@@ -21,6 +23,7 @@
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/graph_concepts.hpp>
#include <boost/concept/assert.hpp>
#include <boost/algorithm/minmax_element.hpp>
/** @file howard_cycle_ratio.hpp
* @brief The implementation of the maximum/minimum cycle ratio/mean algorithm.
@@ -238,9 +241,11 @@ namespace detail
typename graph_traits< Graph >::out_edge_iterator oei, oeie;
for (boost::tie(vi, vie) = vertices(m_g); vi != vie; ++vi)
{
using namespace boost::placeholders;
boost::tie(oei, oeie) = out_edges(*vi, m_g);
typename graph_traits< Graph >::out_edge_iterator mei
= std::max_element(oei, oeie,
= boost::first_max_element(oei, oeie,
boost::bind(m_cmp,
boost::bind(&EdgeWeight1::operator[], m_ew1m, _1),
boost::bind(&EdgeWeight1::operator[], m_ew1m, _2)));
@@ -351,6 +356,8 @@ namespace detail
*/
float_t policy_mcr()
{
using namespace boost::placeholders;
std::fill(m_col_bfs.begin(), m_col_bfs.end(), my_white);
color_map_t vcm_ = color_map_t(m_col_bfs.begin(), m_vim);
typename graph_traits< Graph >::vertex_iterator uv_itr, vie;
@@ -13,10 +13,10 @@
#ifndef BOOST_INCREMENTAL_COMPONENTS_HPP
#define BOOST_INCREMENTAL_COMPONENTS_HPP
#include <boost/detail/iterator.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/graph/detail/incremental_components.hpp>
#include <boost/iterator/counting_iterator.hpp>
#include <boost/make_shared.hpp>
#include <boost/smart_ptr/make_shared.hpp>
#include <boost/pending/disjoint_sets.hpp>
#include <iterator>
@@ -69,7 +69,7 @@ void compress_components(ParentIterator first, ParentIterator last)
}
template < class ParentIterator >
typename boost::detail::iterator_traits< ParentIterator >::difference_type
typename std::iterator_traits< ParentIterator >::difference_type
component_count(ParentIterator first, ParentIterator last)
{
std::ptrdiff_t count = 0;
+109 -37
View File
@@ -15,6 +15,8 @@
#include <boost/smart_ptr.hpp>
#include <boost/graph/depth_first_search.hpp>
#include <boost/detail/algorithm.hpp>
#include <boost/unordered_map.hpp>
#include <boost/unordered/unordered_flat_map.hpp>
#include <boost/pending/indirect_cmp.hpp> // for make_indirect_pmap
#include <boost/concept/assert.hpp>
@@ -31,22 +33,20 @@ namespace detail
template < typename Graph1, typename Graph2, typename IsoMapping,
typename Invariant1, typename Invariant2, typename IndexMap1,
typename IndexMap2 >
typename IndexMap2, typename InvariantCountMap = boost::unordered_flat_map<typename Invariant1::result_type, typename graph_traits< Graph1 >::vertices_size_type > >
class isomorphism_algo
{
typedef typename graph_traits< Graph1 >::vertex_descriptor vertex1_t;
typedef typename graph_traits< Graph2 >::vertex_descriptor vertex2_t;
typedef typename graph_traits< Graph1 >::edge_descriptor edge1_t;
typedef typename graph_traits< Graph1 >::vertices_size_type size_type;
typedef typename Invariant1::result_type invar1_value;
typedef typename Invariant2::result_type invar2_value;
typedef typename Invariant1::result_type invariant_t;
const Graph1& G1;
const Graph2& G2;
IsoMapping f;
Invariant1 invariant1;
Invariant2 invariant2;
std::size_t max_invariant;
IndexMap1 index_map1;
IndexMap2 index_map2;
@@ -81,17 +81,20 @@ namespace detail
friend struct compare_multiplicity;
struct compare_multiplicity
{
compare_multiplicity(Invariant1 invariant1, size_type* multiplicity)
: invariant1(invariant1), multiplicity(multiplicity)
compare_multiplicity(Invariant1 invariant1, const InvariantCountMap& multiplicity)
: invariant1(invariant1), multiplicity(&multiplicity)
{
}
bool operator()(const vertex1_t& x, const vertex1_t& y) const
{
return multiplicity[invariant1(x)]
< multiplicity[invariant1(y)];
auto x_multiplicity_iter = multiplicity->find(invariant1(x));
assert(x_multiplicity_iter != multiplicity->end());
auto y_multiplicity_iter = multiplicity->find(invariant1(y));
assert(y_multiplicity_iter != multiplicity->end());
return *x_multiplicity_iter < *y_multiplicity_iter;
}
Invariant1 invariant1;
size_type* multiplicity;
const InvariantCountMap* multiplicity;
};
struct record_dfs_order : default_dfs_visitor
@@ -138,14 +141,13 @@ namespace detail
public:
isomorphism_algo(const Graph1& G1, const Graph2& G2, IsoMapping f,
Invariant1 invariant1, Invariant2 invariant2,
std::size_t max_invariant, IndexMap1 index_map1,
std::size_t /* max_invariant */, IndexMap1 index_map1,
IndexMap2 index_map2)
: G1(G1)
, G2(G2)
, f(f)
, invariant1(invariant1)
, invariant2(invariant2)
, max_invariant(max_invariant)
, index_map1(index_map1)
, index_map2(index_map2)
{
@@ -159,36 +161,63 @@ namespace detail
);
}
// Generates map of invariant multiplicity from sorted invariants
template<typename ForwardIterator>
InvariantCountMap multiplicities(ForwardIterator first, const ForwardIterator last)
{
typedef typename InvariantCountMap::iterator invar_map_iter;
assert(std::is_sorted(first, last));
InvariantCountMap invar_multiplicity;
if(first == last)
return invar_multiplicity;
invariant_t invar = *first;
invar_map_iter inserted = invar_multiplicity.emplace(invar, 1).first;
++first;
for(; first != last; ++first)
{
if(*first == invar)
{
inserted->second += 1;
}
else
{
invar = *first;
inserted = invar_multiplicity.emplace(invar, 1).first;
}
}
return invar_multiplicity;
}
bool test_isomorphism()
{
// reset isomapping
BGL_FORALL_VERTICES_T(v, G1, Graph1)
f[v] = graph_traits< Graph2 >::null_vertex();
{
std::vector< invar1_value > invar1_array;
BGL_FORALL_VERTICES_T(v, G1, Graph1)
invar1_array.push_back(invariant1(v));
sort(invar1_array);
// Calculate all invariants of G1 and G2, sort and compare
std::vector< invariant_t > invar1_array;
invar1_array.reserve(num_vertices(G1));
BGL_FORALL_VERTICES_T(v, G1, Graph1)
invar1_array.push_back(invariant1(v));
sort(invar1_array);
std::vector< invar2_value > invar2_array;
BGL_FORALL_VERTICES_T(v, G2, Graph2)
invar2_array.push_back(invariant2(v));
sort(invar2_array);
if (!equal(invar1_array, invar2_array))
return false;
}
std::vector< invariant_t > invar2_array;
invar2_array.reserve(num_vertices(G2));
BGL_FORALL_VERTICES_T(v, G2, Graph2)
invar2_array.push_back(invariant2(v));
sort(invar2_array);
if (!equal(invar1_array, invar2_array))
return false;
// Sort vertices by the multiplicity of their invariants
std::vector< vertex1_t > V_mult;
BGL_FORALL_VERTICES_T(v, G1, Graph1)
V_mult.push_back(v);
{
std::vector< size_type > multiplicity(max_invariant, 0);
BGL_FORALL_VERTICES_T(v, G1, Graph1)
++multiplicity.at(invariant1(v));
sort(
V_mult, compare_multiplicity(invariant1, &multiplicity[0]));
}
sort(V_mult, compare_multiplicity(invariant1, multiplicities(invar1_array.begin(), invar1_array.end())));
std::vector< default_color_type > color_vec(num_vertices(G1));
safe_iterator_property_map<
@@ -366,6 +395,9 @@ namespace detail
{
return_point_true:
// At this point, there may still be null vertices in the
// mapping for disconnected vertices
map_disconnected_vertices();
return true;
return_point_false:
@@ -413,6 +445,42 @@ namespace detail
}
}
}
void map_disconnected_vertices()
{
std::vector< vertex1_t > unmatched_g1_vertices;
BGL_FORALL_VERTICES_T(v, G1, Graph1)
{
if(f[v] == graph_traits< Graph2 >::null_vertex()) {
unmatched_g1_vertices.push_back(v);
}
}
if(!unmatched_g1_vertices.empty())
{
typedef unordered_multimap< invariant_t, vertex2_t > g2_invariant_vertex_multimap;
typedef typename g2_invariant_vertex_multimap::iterator multimap_iter;
g2_invariant_vertex_multimap unmatched_invariants;
BGL_FORALL_VERTICES_T(v, G2, Graph2)
{
if(!in_S[v])
{
unmatched_invariants.emplace(invariant2(v), v);
}
}
typedef typename std::vector< vertex1_t >::iterator v1_iter;
const v1_iter end = unmatched_g1_vertices.end();
for(v1_iter iter = unmatched_g1_vertices.begin(); iter != end; ++iter)
{
invariant_t unmatched_g1_vertex_invariant = invariant1(*iter);
multimap_iter matching_invariant = unmatched_invariants.find(unmatched_g1_vertex_invariant);
BOOST_ASSERT(matching_invariant != unmatched_invariants.end());
f[*iter] = matching_invariant->second;
unmatched_invariants.erase(matching_invariant);
}
}
}
};
template < typename Graph, typename InDegreeMap >
@@ -486,7 +554,7 @@ template < typename Graph1, typename Graph2, typename IsoMapping,
typename Invariant1, typename Invariant2, typename IndexMap1,
typename IndexMap2 >
bool isomorphism(const Graph1& G1, const Graph2& G2, IsoMapping f,
Invariant1 invariant1, Invariant2 invariant2, std::size_t max_invariant,
Invariant1 invariant1, Invariant2 invariant2, std::size_t /* max_invariant */,
IndexMap1 index_map1, IndexMap2 index_map2)
{
@@ -500,11 +568,16 @@ bool isomorphism(const Graph1& G1, const Graph2& G2, IsoMapping f,
typedef typename graph_traits< Graph2 >::vertex_descriptor vertex2_t;
typedef typename graph_traits< Graph1 >::vertices_size_type size_type;
typedef typename Invariant1::result_type invariant1_t;
typedef typename Invariant2::result_type invariant2_t;
BOOST_STATIC_ASSERT(is_same<invariant1_t, invariant2_t>::value);
// Vertex invariant requirement
BOOST_CONCEPT_ASSERT(
(AdaptableUnaryFunctionConcept< Invariant1, size_type, vertex1_t >));
(AdaptableUnaryFunctionConcept< Invariant1, invariant1_t, vertex1_t >));
BOOST_CONCEPT_ASSERT(
(AdaptableUnaryFunctionConcept< Invariant2, size_type, vertex2_t >));
(AdaptableUnaryFunctionConcept< Invariant2, invariant2_t, vertex2_t >));
// Property map requirements
BOOST_CONCEPT_ASSERT(
@@ -527,7 +600,7 @@ bool isomorphism(const Graph1& G1, const Graph2& G2, IsoMapping f,
detail::isomorphism_algo< Graph1, Graph2, IsoMapping, Invariant1,
Invariant2, IndexMap1, IndexMap2 >
algo(G1, G2, f, invariant1, invariant2, max_invariant, index_map1,
algo(G1, G2, f, invariant1, invariant2, 0, index_map1,
index_map2);
return algo.test_isomorphism();
}
@@ -574,8 +647,7 @@ namespace detail
return isomorphism(G1, G2, f,
choose_param(get_param(params, vertex_invariant1_t()), invariant1),
choose_param(get_param(params, vertex_invariant2_t()), invariant2),
choose_param(get_param(params, vertex_max_invariant_t()),
(invariant2.max)()),
0,
index_map1, index_map2);
}
@@ -654,7 +726,7 @@ namespace graph
make_shared_array_property_map(
num_vertices(g1), vertex2_t(), index1_map)),
invariant1, invariant2,
arg_pack[_vertex_max_invariant | (invariant2.max)()],
0,
index1_map, index2_map);
}
};
+7
View File
@@ -11,7 +11,12 @@
#ifndef BOOST_GRAPH_KING_HPP
#define BOOST_GRAPH_KING_HPP
#include <deque>
#include <vector>
#include <algorithm>
#include <boost/config.hpp>
#include <boost/bind/bind.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/graph/detail/sparse_ordering.hpp>
#include <boost/graph/graph_utility.hpp>
@@ -44,6 +49,8 @@ namespace detail
template < typename Vertex, typename Graph >
void finish_vertex(Vertex, Graph& g)
{
using namespace boost::placeholders;
typename graph_traits< Graph >::out_edge_iterator ei, ei_end;
Vertex v, w;
+52 -2
View File
@@ -18,7 +18,9 @@
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/is_unsigned.hpp>
#include <boost/pending/container_traits.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/property_map/property_map.hpp>
// This file implements a utility for creating mappings from arbitrary
// identifiers to the vertices of a graph.
@@ -260,6 +262,54 @@ namespace graph_detail
}
//@}
/** @name Remove Labeled Vertex */
//@{
// Tag dispatch on random access containers (i.e., vectors)
template <typename Container, typename Label, typename Graph>
void remove_labeled_vertex(Container& c, Graph& g, Label const& l,
random_access_container_tag)
{
if (l < c.size())
{
boost::remove_vertex(c[l], g);
c.erase(c.begin() + l);
}
}
// Tag dispatch on multi associative containers (i.e. multimaps).
template <typename Container, typename Label, typename Graph>
void remove_labeled_vertex(Container& c, Graph& g, Label const& l,
multiple_associative_container_tag)
{
typename Container::iterator c_it = c.find(l);
if (c_it != c.end())
{
boost::remove_vertex(c_it->second, g);
c.erase(c_it);
}
}
// Tag dispatch on unique associative containers (i.e. maps).
template <typename Container, typename Label, typename Graph>
void remove_labeled_vertex(Container& c, Graph& g, Label const& l,
unique_associative_container_tag)
{
typename Container::iterator c_it = c.find(l);
if (c_it != c.end())
{
boost::remove_vertex(c_it->second, g);
c.erase(c_it);
}
}
// Dispatcher
template <typename Container, typename Label, typename Graph>
void remove_labeled_vertex(Container& c, Graph& g, Label const& l)
{
remove_labeled_vertex(c, g, l, container_category(c));
}
//@}
} // namespace detail
struct labeled_graph_class_tag
@@ -451,7 +501,7 @@ public:
/** Remove the vertex with the given label. */
void remove_vertex(Label const& l)
{
return boost::remove_vertex(vertex(l), _graph);
return graph_detail::remove_labeled_vertex(_map, _graph, l);
}
/** Return a descriptor for the given label. */
@@ -734,7 +784,7 @@ inline typename LABELED_GRAPH::degree_size_type degree(
template < LABELED_GRAPH_PARAMS >
inline std::pair< typename LABELED_GRAPH::adjacency_iterator,
typename LABELED_GRAPH::adjacency_iterator >
adjacenct_vertices(
adjacent_vertices(
typename LABELED_GRAPH::vertex_descriptor v, LABELED_GRAPH const& g)
{
return adjacent_vertices(v, g.graph());
+2
View File
@@ -24,6 +24,8 @@
#include <vector>
#include <algorithm>
#include <boost/throw_exception.hpp>
namespace boost
{
namespace graph
+1 -1
View File
@@ -99,6 +99,6 @@ inline one_bit_color_map< IndexMap > make_one_bit_color_map(
} // end namespace boost
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / one_bit_color_map.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/one_bit_color_map.hpp>)
#endif // BOOST_ONE_BIT_COLOR_MAP_HPP
+1 -1
View File
@@ -174,6 +174,6 @@ namespace graph
}
} // end namespace boost::graph
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / page_rank.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/page_rank.hpp>)
#endif // BOOST_GRAPH_PAGE_RANK_HPP
@@ -14,6 +14,7 @@
#include <boost/config.hpp>
#include <boost/next_prior.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/properties.hpp>
#include <boost/property_map/property_map.hpp>
namespace boost
+2
View File
@@ -9,6 +9,8 @@
#ifndef BOOST_GRAPH_POINT_TRAITS_HPP
#define BOOST_GRAPH_POINT_TRAITS_HPP
#include <cstddef>
namespace boost
{
namespace graph
@@ -431,6 +431,10 @@ namespace detail
}
}
std::list< Splabel > dsplabels = get(vec_vertex_labels, t);
if(!b_all_pareto_optimal_solutions)
{
dsplabels.sort();
}
typename std::list< Splabel >::const_iterator csi = dsplabels.begin();
typename std::list< Splabel >::const_iterator csi_end = dsplabels.end();
// if d could be reached from o
+1 -1
View File
@@ -658,6 +658,6 @@ private:
} // end namespace boost
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / rmat_graph_generator.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/rmat_graph_generator.hpp>)
#endif // BOOST_GRAPH_RMAT_GENERATOR_HPP
@@ -11,6 +11,7 @@
#include <iterator>
#include <utility>
#include <boost/graph/graph_traits.hpp>
#include <boost/random/uniform_01.hpp>
#include <boost/random/uniform_int.hpp>
@@ -15,6 +15,7 @@
#include <queue>
#include <boost/config.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/random/uniform_01.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/type_traits/is_base_and_derived.hpp>
#include <boost/type_traits/is_same.hpp>
+163 -100
View File
@@ -29,94 +29,130 @@ namespace boost
namespace detail
{
template < typename ParityMap, typename WeightMap, typename IndexMap >
class mas_min_cut_visitor : public boost::default_mas_visitor
/**
* \brief Performs a phase of the Stoer-Wagner min-cut algorithm
*
* Performs a phase of the Stoer-Wagner min-cut algorithm.
*
* As described by Stoer & Wagner (1997), a phase is simply a maximum
* adjacency search (also called a maximum cardinality search), which
* results in the selection of two vertices \em s and \em t, and, as a side
* product, a minimum <em>s</em>-<em>t</em> cut of the input graph. Here,
* the input graph is basically \p g, but some vertices are virtually
* assigned to others as a way of viewing \p g as a graph with some sets of
* vertices merged together.
*
* This implementation is a translation of pseudocode by Professor Uri
* Zwick, School of Computer Science, Tel Aviv University.
*
* \pre \p g is a connected, undirected graph
* \param[in] g the input graph
* \param[in] assignments a read/write property map from each vertex to the
* vertex that it is assigned to
* \param[in] assignedVertices a list of vertices that are assigned to
* others
* \param[in] weights a readable property map from each edge to its
* weight (a non-negative value)
* \param[out] pq a keyed, updatable max-priority queue
* \returns a tuple (\em s, \em t, \em w) of the "<em>s</em>" and
* "<em>t</em>" of the minimum <em>s</em>-<em>t</em> cut and the
* cut weight \em w of the minimum <em>s</em>-<em>t</em> cut.
* \see http://www.cs.tau.ac.il/~zwick/grad-algo-08/gmc.pdf
*
* \author Daniel Trebbien
* \date 2010-09-11
*/
template < class UndirectedGraph, class VertexAssignmentMap,
class WeightMap, class KeyedUpdatablePriorityQueue >
boost::tuple<
typename boost::graph_traits< UndirectedGraph >::vertex_descriptor,
typename boost::graph_traits< UndirectedGraph >::vertex_descriptor,
typename boost::property_traits< WeightMap >::value_type >
stoer_wagner_phase(const UndirectedGraph& g,
VertexAssignmentMap assignments,
const std::set< typename boost::graph_traits<
UndirectedGraph >::vertex_descriptor >& assignedVertices,
WeightMap weights, KeyedUpdatablePriorityQueue& pq)
{
typedef one_bit_color_map< IndexMap > InternalParityMap;
typedef
typename boost::graph_traits< UndirectedGraph >::vertex_descriptor
vertex_descriptor;
typedef typename boost::property_traits< WeightMap >::value_type
weight_type;
public:
template < typename Graph >
mas_min_cut_visitor(const Graph& g, ParityMap parity,
weight_type& cutweight, const WeightMap& weight_map,
IndexMap index_map)
: m_bestParity(parity)
, m_parity(make_one_bit_color_map(num_vertices(g), index_map))
, m_bestWeight(cutweight)
, m_cutweight(0)
, m_visited(0)
, m_weightMap(weight_map)
BOOST_ASSERT(pq.empty());
typename KeyedUpdatablePriorityQueue::key_map keys = pq.keys();
BGL_FORALL_VERTICES_T(v, g, UndirectedGraph)
{
// set here since the init list sets the reference
m_bestWeight = (std::numeric_limits< weight_type >::max)();
}
if (v == get(assignments, v))
{ // foreach u \in V do
put(keys, v, weight_type(0));
template < typename Vertex, typename Graph >
void initialize_vertex(Vertex u, const Graph& g)
{
typedef typename boost::property_traits< ParityMap >::value_type
parity_type;
typedef
typename boost::property_traits< InternalParityMap >::value_type
internal_parity_type;
put(m_parity, u, internal_parity_type(0));
put(m_bestParity, u, parity_type(0));
}
template < typename Edge, typename Graph >
void examine_edge(Edge e, const Graph& g)
{
weight_type w = get(m_weightMap, e);
// if the target of e is already marked then decrease cutweight
// otherwise, increase it
if (get(m_parity, boost::target(e, g)))
{
m_cutweight -= w;
}
else
{
m_cutweight += w;
pq.push(v);
}
}
template < typename Vertex, typename Graph >
void finish_vertex(Vertex u, const Graph& g)
{
typedef
typename boost::property_traits< InternalParityMap >::value_type
internal_parity_type;
BOOST_ASSERT(pq.size() >= 2);
++m_visited;
put(m_parity, u, internal_parity_type(1));
vertex_descriptor s
= boost::graph_traits< UndirectedGraph >::null_vertex();
vertex_descriptor t
= boost::graph_traits< UndirectedGraph >::null_vertex();
weight_type w;
while (!pq.empty())
{ // while PQ \neq {} do
const vertex_descriptor u = pq.top(); // u = extractmax(PQ)
w = get(keys, u);
pq.pop();
if (m_cutweight < m_bestWeight && m_visited < num_vertices(g))
s = t;
t = u;
BGL_FORALL_OUTEDGES_T(u, e, g, UndirectedGraph)
{ // foreach (u, v) \in E do
const vertex_descriptor v = get(assignments, target(e, g));
if (pq.contains(v))
{ // if v \in PQ then
put(keys, v,
get(keys, v)
+ get(weights,
e)); // increasekey(PQ, v, wA(v) + w(u, v))
pq.update(v);
}
}
typename std::set< vertex_descriptor >::const_iterator
assignedVertexIt,
assignedVertexEnd = assignedVertices.end();
for (assignedVertexIt = assignedVertices.begin();
assignedVertexIt != assignedVertexEnd; ++assignedVertexIt)
{
m_bestWeight = m_cutweight;
BGL_FORALL_VERTICES_T(i, g, Graph)
const vertex_descriptor uPrime = *assignedVertexIt;
if (get(assignments, uPrime) == u)
{
put(m_bestParity, i, get(m_parity, i));
BGL_FORALL_OUTEDGES_T(uPrime, e, g, UndirectedGraph)
{ // foreach (u, v) \in E do
const vertex_descriptor v
= get(assignments, target(e, g));
if (pq.contains(v))
{ // if v \in PQ then
put(keys, v,
get(keys, v)
+ get(weights, e)); // increasekey(PQ, v,
// wA(v) + w(u, v))
pq.update(v);
}
}
}
}
}
inline void clear()
{
m_bestWeight = (std::numeric_limits< weight_type >::max)();
m_visited = 0;
m_cutweight = 0;
}
private:
ParityMap m_bestParity;
InternalParityMap m_parity;
weight_type& m_bestWeight;
weight_type m_cutweight;
unsigned m_visited;
const WeightMap& m_weightMap;
};
return boost::make_tuple(s, t, w);
}
/**
* \brief Computes a min-cut of the input graph
@@ -156,44 +192,71 @@ namespace detail
vertex_descriptor;
typedef typename boost::property_traits< WeightMap >::value_type
weight_type;
typedef
typename boost::graph_traits< UndirectedGraph >::vertices_size_type
vertices_size_type;
typedef typename boost::property_traits< ParityMap >::value_type
parity_type;
typename graph_traits< UndirectedGraph >::vertex_iterator u_iter, u_end;
vertices_size_type n = num_vertices(g);
weight_type bestW = (std::numeric_limits< weight_type >::max)();
weight_type bestThisTime = (std::numeric_limits< weight_type >::max)();
vertex_descriptor bestStart
= boost::graph_traits< UndirectedGraph >::null_vertex();
std::set< vertex_descriptor > assignedVertices;
detail::mas_min_cut_visitor< ParityMap, WeightMap, IndexMap > vis(
g, parities, bestThisTime, weights, index_map);
// initialize `assignments` (all vertices are initially assigned to
// themselves)
BGL_FORALL_VERTICES_T(v, g, UndirectedGraph) { put(assignments, v, v); }
// for each node in the graph,
for (boost::tie(u_iter, u_end) = vertices(g); u_iter != u_end; ++u_iter)
vertex_descriptor s, t;
weight_type bestW;
boost::tie(s, t, bestW) = boost::detail::stoer_wagner_phase(
g, assignments, assignedVertices, weights, pq);
BOOST_ASSERT(s != t);
BGL_FORALL_VERTICES_T(v, g, UndirectedGraph)
{
// run the MAS and find the min cut
vis.clear();
boost::maximum_adjacency_search(g,
boost::weight_map(weights)
.visitor(vis)
.root_vertex(*u_iter)
.vertex_assignment_map(assignments)
.max_priority_queue(pq));
if (bestThisTime < bestW)
put(parities, v, parity_type(v == t ? 1 : 0));
}
put(assignments, t, s);
assignedVertices.insert(t);
--n;
for (; n >= 2; --n)
{
weight_type w;
boost::tie(s, t, w) = boost::detail::stoer_wagner_phase(
g, assignments, assignedVertices, weights, pq);
BOOST_ASSERT(s != t);
if (w < bestW)
{
bestW = bestThisTime;
bestStart = *u_iter;
BGL_FORALL_VERTICES_T(v, g, UndirectedGraph)
{
put(parities, v,
parity_type(get(assignments, v) == t ? 1 : 0));
if (get(assignments, v)
== t) // all vertices that were assigned to t are now
// assigned to s
put(assignments, v, s);
}
bestW = w;
}
else
{
BGL_FORALL_VERTICES_T(v, g, UndirectedGraph)
{
if (get(assignments, v)
== t) // all vertices that were assigned to t are now
// assigned to s
put(assignments, v, s);
}
}
put(assignments, t, s);
assignedVertices.insert(t);
}
// Run one more time, starting from the best start location, to
// ensure the visitor has the best values.
vis.clear();
boost::maximum_adjacency_search(g,
boost::vertex_assignment_map(assignments)
.weight_map(weights)
.visitor(vis)
.root_vertex(bestStart)
.max_priority_queue(pq));
BOOST_ASSERT(pq.empty());
return bestW;
}
+1 -1
View File
@@ -342,6 +342,6 @@ kosaraju_strong_components(
} // namespace boost
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / strong_components.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/strong_components.hpp>)
#endif // BOOST_GRAPH_STRONG_COMPONENTS_HPP
+7 -5
View File
@@ -10,14 +10,16 @@
#ifndef BOOST_GRAPH_TOPOLOGY_HPP
#define BOOST_GRAPH_TOPOLOGY_HPP
#include <boost/config/no_tr1/cmath.hpp>
#include <cmath>
#include <boost/random/uniform_01.hpp>
#include <boost/random/linear_congruential.hpp>
#include <boost/math/constants/constants.hpp> // For root_two
#include <boost/algorithm/minmax.hpp>
#include <boost/config.hpp> // For BOOST_STATIC_CONSTANT
#include <boost/config/no_tr1/cmath.hpp>
#include <boost/math/constants/constants.hpp> // For root_two
#include <boost/math/special_functions/hypot.hpp>
#include <boost/random/uniform_01.hpp>
#include <boost/random/linear_congruential.hpp>
#include <boost/shared_ptr.hpp>
#include <cmath>
// Classes and concepts to represent points in a space, with distance and move
// operations (used for Gurson-Atun layout), plus other things like bounding
+15 -7
View File
@@ -13,7 +13,7 @@
#include <algorithm> // for std::min and std::max
#include <functional>
#include <boost/config.hpp>
#include <boost/bind.hpp>
#include <boost/bind/bind.hpp>
#include <boost/graph/strong_components.hpp>
#include <boost/graph/topological_sort.hpp>
#include <boost/graph/graph_concepts.hpp>
@@ -82,7 +82,7 @@ void transitive_closure(const Graph& g, GraphTC& tc,
iterator_property_map< cg_vertex*, VertexIndexMap, cg_vertex, cg_vertex& >
component_number(&component_number_vec[0], index_map);
int num_scc
const cg_vertex num_scc
= strong_components(g, component_number, vertex_index_map(index_map));
std::vector< std::vector< vertex > > components;
@@ -107,12 +107,11 @@ void transitive_closure(const Graph& g, GraphTC& tc,
}
}
std::sort(adj.begin(), adj.end());
typename std::vector< cg_vertex >::iterator di
const typename std::vector< cg_vertex >::iterator di
= std::unique(adj.begin(), adj.end());
if (di != adj.end())
adj.erase(di, adj.end());
for (typename std::vector< cg_vertex >::const_iterator i = adj.begin();
i != adj.end(); ++i)
i != di; ++i)
{
add_edge(s, *i, CG);
}
@@ -131,6 +130,8 @@ void transitive_closure(const Graph& g, GraphTC& tc,
std::vector< std::vector< cg_vertex > > CG_vec(num_vertices(CG));
for (size_type i = 0; i < num_vertices(CG); ++i)
{
using namespace boost::placeholders;
typedef typename boost::graph_traits< CG_t >::adjacency_iterator
cg_adj_iter;
std::pair< cg_adj_iter, cg_adj_iter > pr = adjacent_vertices(i, CG);
@@ -156,9 +157,16 @@ void transitive_closure(const Graph& g, GraphTC& tc,
{
chain.push_back(v);
in_a_chain[v] = true;
typename std::vector< cg_vertex >::const_iterator next
#ifdef __cpp_lib_not_fn
= std::find_if(CG_vec[v].begin(), CG_vec[v].end(),
std::not1(detail::subscript(in_a_chain)));
std::not_fn(detail::subscript(in_a_chain)));
#else
= std::find_if(CG_vec[v].begin(), CG_vec[v].end(),
std::not1(detail::subscript(in_a_chain)));
#endif
if (next != CG_vec[v].end())
v = *next;
else
+1 -1
View File
@@ -103,6 +103,6 @@ inline two_bit_color_map< IndexMap > make_two_bit_color_map(
} // end namespace boost
#include BOOST_GRAPH_MPI_INCLUDE(< boost / graph / distributed / two_bit_color_map.hpp >)
#include BOOST_GRAPH_MPI_INCLUDE(<boost/graph/distributed/two_bit_color_map.hpp>)
#endif // BOOST_TWO_BIT_COLOR_MAP_HPP
+2
View File
@@ -41,6 +41,8 @@
#include <string>
#include <ostream>
#include <boost/graph/graph_traits.hpp>
namespace boost
{
@@ -6,6 +6,8 @@
#ifndef BOOST_DETAIL_DISJOINT_SETS_HPP
#define BOOST_DETAIL_DISJOINT_SETS_HPP
#include <cassert>
namespace boost
{
@@ -50,13 +52,11 @@ namespace detail
/* the postcondition of link sets is:
component_representative(i) == component_representative(j)
*/
template < class ParentPA, class RankPA, class Vertex,
class ComponentRepresentative >
inline void link_sets(ParentPA p, RankPA rank, Vertex i, Vertex j,
ComponentRepresentative comp_rep)
template < class ParentPA, class RankPA, class Vertex>
inline void link_sets(ParentPA p, RankPA rank, Vertex i, Vertex j)
{
i = comp_rep(p, i);
j = comp_rep(p, j);
assert(i == get(p, i));
assert(j == get(p, j));
if (i == j)
return;
if (get(rank, i) > get(rank, j))
+2 -2
View File
@@ -72,7 +72,7 @@ public:
// Link - union the two sets represented by vertex x and y
template < class Element > inline void link(Element x, Element y)
{
detail::link_sets(parent, rank, x, y, rep);
detail::link_sets(parent, rank, x, y);
}
// Union-Set - union the two sets containing vertex x and y
@@ -146,7 +146,7 @@ public:
template < class Element > inline void link(Element x, Element y)
{
extend_sets(x, y);
detail::link_sets(&parent[0], &rank[0], get(id, x), get(id, y), rep);
detail::link_sets(&parent[0], &rank[0], get(id, x), get(id, y));
}
template < class Element > inline void union_set(Element x, Element y)
{
+2 -1
View File
@@ -6,6 +6,7 @@
#ifndef BOOST_PROPERTY_HPP
#define BOOST_PROPERTY_HPP
#include <boost/config.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/has_xxx.hpp>
@@ -30,7 +31,7 @@ template < class Tag, class T, class Base = no_property > struct property
// copy constructor and assignment operator will be generated by compiler
T m_value;
Base m_base;
BOOST_ATTRIBUTE_NO_UNIQUE_ADDRESS Base m_base;
};
// Kinds of properties
+1 -2
View File
@@ -6,8 +6,7 @@
// Authors: Douglas Gregor
// Andrew Lumsdaine
#warning \
"Use of relaxed_heap is depreciated; please use the standard heap functions."
#ifndef BOOST_RELAXED_HEAP_HEADER
#define BOOST_RELAXED_HEAP_HEADER
+3 -2
View File
@@ -11,6 +11,7 @@
"Iterators"
],
"maintainers": [
"K. Noel Belcourt <kbelco -at- sandia.gov>"
]
"Jeremy W. Murphy <jeremy.william.murphy -at- gmail.com>"
],
"cxxstd": "14"
}
+5 -2
View File
@@ -18,6 +18,9 @@
#include <boost/graph/dll_import_export.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <map>
#include <string>
#include <vector>
using namespace boost;
@@ -162,8 +165,8 @@ public:
std::string local_directed
= edge.second.get(path("<xmlattr>/directed"), "");
bool is_directed
= (local_directed == "" ? default_directed
: local_directed == "true");
= (local_directed.empty() ? default_directed
: local_directed == "true");
if (is_directed != m_g.is_directed())
{
if (is_directed)
+34 -17
View File
@@ -33,19 +33,18 @@
#include <boost/graph/graph_traits.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <cstdlib>
#include <algorithm>
#include <exception> // for std::exception
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
#include <set>
#include <utility>
#include <map>
#include <iostream>
#include <cstdlib>
#include <boost/throw_exception.hpp>
#include <boost/regex.hpp>
#include <boost/function.hpp>
#include <boost/bind.hpp>
#include <boost/graph/dll_import_export.hpp>
#include <boost/graph/graphviz.hpp>
@@ -54,6 +53,7 @@ namespace boost
namespace read_graphviz_detail
{
static const long max_subgraph_nesting_level = 255;
struct token
{
enum token_type
@@ -208,7 +208,7 @@ namespace read_graphviz_detail
tokenizer(const std::string& str) : begin(str.begin()), end(str.end())
{
std::string end_of_token = "(?=(?:\\W))";
// std::string end_of_token = "(?=(?:\\W))"; // SEHE: unused?
std::string whitespace = "(?:\\s+)";
std::string slash_slash_comment = "(?://.*?$)";
std::string slash_star_comment = "(?:/\\*.*?\\*/)";
@@ -334,6 +334,8 @@ namespace read_graphviz_detail
BOOST_ASSERT(!"Definition of punctuation_token does "
"not match switch statement");
}
// Prevent static analyzers complaining about fallthrough:
break;
}
default:
BOOST_ASSERT(!"Definition of punctuation_token does not "
@@ -526,6 +528,7 @@ namespace read_graphviz_detail
std::map< subgraph_name, subgraph_info > subgraphs;
std::string current_subgraph_name;
int sgcounter; // Counter for anonymous subgraphs
long sgnesting_level;
std::set< std::pair< node_name, node_name > >
existing_edges; // Used for checking in strict graphs
@@ -537,7 +540,7 @@ namespace read_graphviz_detail
subgraph_member_list& current_members() { return current().members; }
parser(const std::string& gr, parser_result& result)
: the_tokenizer(gr), lookahead(), r(result), sgcounter(0)
: the_tokenizer(gr), lookahead(), r(result), sgcounter(0), sgnesting_level(0)
{
current_subgraph_name = "___root___";
current() = subgraph_info(); // Initialize root graph
@@ -772,10 +775,18 @@ namespace read_graphviz_detail
bool is_anonymous = true;
if (first_token.type == token::kw_subgraph)
{
if (peek().type == token::identifier)
switch (peek().type)
{
case token::identifier:
name = get().normalized_value;
is_anonymous = false;
break;
case token::left_brace:
is_anonymous = true;
break;
default:
error("Subgraph reference needs a name");
break;
}
}
if (is_anonymous)
@@ -789,25 +800,30 @@ namespace read_graphviz_detail
= current(); // Initialize properties and defaults
subgraphs[name].members.clear(); // Except member list
}
if (first_token.type == token::kw_subgraph
&& peek().type != token::left_brace)
if (!is_anonymous && peek().type != token::left_brace)
{
if (is_anonymous)
error("Subgraph reference needs a name");
return name;
}
subgraph_name old_sg = current_subgraph_name;
if (++sgnesting_level > max_subgraph_nesting_level)
{
error("Exceeded maximum subgraph nesting level");
}
current_subgraph_name = name;
if (peek().type == token::left_brace)
get();
else
error("Wanted left brace to start subgraph");
if (first_token.type != token::left_brace)
{
if (peek().type == token::left_brace)
get();
else
error("Wanted left brace to start subgraph");
}
parse_stmt_list();
if (peek().type == token::right_brace)
get();
else
error("Wanted right brace to end subgraph");
current_subgraph_name = old_sg;
sgnesting_level -= 1;
return name;
}
@@ -827,7 +843,7 @@ namespace read_graphviz_detail
get();
if (peek().type != token::identifier)
error("Wanted identifier as port angle");
if (id.angle != "")
if (!id.angle.empty())
error("Duplicate port angle");
id.angle = get().normalized_value;
goto parse_more;
@@ -881,6 +897,7 @@ namespace read_graphviz_detail
"port location");
}
}
break;
default:
break;
}
+17 -14
View File
@@ -9,6 +9,7 @@
import modules ;
import path ;
import ../../config/checks/config : requires ;
path-constant TEST_DIR : . ;
@@ -46,7 +47,10 @@ alias graph_test_regular :
[ run undirected_dfs.cpp ]
[ compile dfs_cc.cpp ]
[ compile dijkstra_cc.cpp ]
[ run dijkstra_heap_performance.cpp /boost/timer//boost_timer : 10000 ]
# Performance benchmark
#[ run dijkstra_heap_performance.cpp /boost/timer//boost_timer : 10000 ]
[ run dijkstra_no_color_map_compare.cpp : 10000 ]
[ run disjoint_set_test.cpp ]
[ run dominator_tree_test.cpp ]
@@ -69,12 +73,10 @@ alias graph_test_regular :
[ run graph.cpp : : : <define>TEST=9 : graph_9 ]
[ compile graph_concepts.cpp ]
[ run graphviz_test.cpp
/boost/test//boost_test_exec_monitor/<link>static
../build//boost_graph
../../regex/build//boost_regex : --log_level=all ]
../build//boost_graph : --log_level=all ]
[ run metis_test.cpp : $(METIS_INPUT_FILE) ]
[ run gursoy_atun_layout_test.cpp ]
[ run layout_test.cpp : : : <test-info>always_show_run_output <toolset>intel:<debug-symbols>off ]
[ run gursoy_atun_layout_test.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 layout_test.cpp : : : <test-info>always_show_run_output <toolset>intel:<debug-symbols>off [ 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 serialize.cpp
../../serialization/build//boost_serialization
@@ -86,7 +88,7 @@ alias graph_test_regular :
# TODO: Merge these into a single test framework.
[ run subgraph.cpp ]
[ run subgraph_bundled.cpp ]
[ run subgraph_add.cpp ../../test/build//boost_unit_test_framework/<link>static : $(TEST_DIR) ]
[ run subgraph_add.cpp : $(TEST_DIR) ]
[ run subgraph_props.cpp ]
[ run isomorphism.cpp ]
@@ -114,7 +116,7 @@ alias graph_test_regular :
[ run weighted_matching_test.cpp ]
[ run max_flow_test.cpp ]
[ run boykov_kolmogorov_max_flow_test.cpp ]
[ run cycle_ratio_tests.cpp ../build//boost_graph ../../regex/build//boost_regex : $(CYCLE_RATIO_INPUT_FILE) ]
[ run cycle_ratio_tests.cpp ../build//boost_graph : $(CYCLE_RATIO_INPUT_FILE) ]
[ run basic_planarity_test.cpp ]
[ run make_connected_test.cpp ]
[ run make_bicon_planar_test.cpp ]
@@ -122,6 +124,7 @@ alias graph_test_regular :
[ run named_vertices_test.cpp ]
[ run r_c_shortest_paths_test.cpp ]
[ run rcsp_custom_vertex_id.cpp ]
[ run rcsp_single_solution.cpp ]
[ run is_straight_line_draw_test.cpp ]
[ run metric_tsp_approx.cpp /boost/timer//boost_timer : metric_tsp_approx.graph : : ]
[ compile dimacs.cpp ]
@@ -142,17 +145,17 @@ alias graph_test_regular :
[ run random_spanning_tree_test.cpp ../build//boost_graph ]
[ run random_matching_test.cpp : 1000 1020 ]
[ run graphml_test.cpp ../build//boost_graph : : "graphml_test.xml" ]
[ run mas_test.cpp ../../test/build//boost_unit_test_framework/<link>static : $(TEST_DIR) ]
[ run stoer_wagner_test.cpp ../../test/build//boost_unit_test_framework/<link>static : $(TEST_DIR) ]
[ run mas_test.cpp : $(TEST_DIR) ]
[ run stoer_wagner_test.cpp : $(TEST_DIR) ]
[ compile filtered_graph_properties_dijkstra.cpp ]
[ run vf2_sub_graph_iso_test.cpp ]
[ run vf2_sub_graph_iso_test_2.cpp ]
[ run hawick_circuits.cpp ]
[ run successive_shortest_path_nonnegative_weights_test.cpp ../../test/build//boost_unit_test_framework/<link>static ]
[ run cycle_canceling_test.cpp ../../test/build//boost_unit_test_framework/<link>static ]
[ run successive_shortest_path_nonnegative_weights_test.cpp ]
[ run cycle_canceling_test.cpp ]
[ run strong_components_test.cpp ]
[ run find_flow_cost_bundled_properties_and_named_params_test.cpp ../../test/build//boost_unit_test_framework/<link>static ]
[ run max_flow_algorithms_bundled_properties_and_named_params.cpp ../../test/build//boost_unit_test_framework/<link>static ]
[ run find_flow_cost_bundled_properties_and_named_params_test.cpp ]
[ run max_flow_algorithms_bundled_properties_and_named_params.cpp ]
[ run delete_edge.cpp ]
[ run johnson-test.cpp ]
[ run lvalue_pmap.cpp ]
+1 -1
View File
@@ -233,7 +233,7 @@ int main(int argc, char* argv[])
if (dir_itr->path().extension() != dimacs_extension)
continue;
std::cout << "Testing " << dir_itr->path().leaf() << "... ";
std::cout << "Testing " << dir_itr->path().filename() << "... ";
BOOST_TEST(test_graph(dir_itr->path().string()) == 0);
std::cout << std::endl;
+136 -15
View File
@@ -72,7 +72,7 @@ fill_random_max_flow_graph(Graph& g, CapacityMap cap, ReverseEdgeMap rev,
// cannot use this, as we have no idea how properties are stored, right?
typename graph_traits< Graph >::edge_iterator ei, e_end;
for (boost::tie(ei, e_end) = edges(g); ei != e_end; ++ei)
cap[*ei] = int_gen();
put(cap, *ei, int_gen());
// get source and sink node
vertex_descriptor s = random_vertex(g, gen);
@@ -96,9 +96,9 @@ fill_random_max_flow_graph(Graph& g, CapacityMap cap, ReverseEdgeMap rev,
boost::tie(new_edge, inserted)
= add_edge(source_vertex, target_vertex, g);
assert(inserted);
rev[old_edge] = new_edge;
rev[new_edge] = old_edge;
cap[new_edge] = 0;
put(rev, old_edge, new_edge);
put(rev, new_edge, old_edge);
put(cap, new_edge, 0);
}
return std::make_pair(s, t);
}
@@ -174,34 +174,152 @@ template < typename EdgeDescriptor > struct Link
EdgeDescriptor edge_reverse;
};
typedef adjacency_list_traits< vecS, vecS, directedS > tTraits;
typedef Node< tTraits::edge_descriptor > tVertex;
typedef Link< tTraits::edge_descriptor > tEdge;
typedef adjacency_list< vecS, vecS, directedS, tVertex, tEdge > tBundleGraph;
namespace boost
{
template <> struct property_map< tBundleGraph, edge_capacity_t >
{
typedef adj_list_edge_property_map< directed_tag, long, long&, size_t,
tEdge, long tEdge::* >
type;
typedef adj_list_edge_property_map< directed_tag, long, const long&, size_t,
const tEdge, long tEdge::* >
const_type;
};
template <> struct property_map< tBundleGraph, edge_residual_capacity_t >
{
typedef adj_list_edge_property_map< directed_tag, long, long&, size_t,
tEdge, long tEdge::* >
type;
typedef adj_list_edge_property_map< directed_tag, long, const long&, size_t,
const tEdge, long tEdge::* >
const_type;
};
template <> struct property_map< tBundleGraph, edge_reverse_t >
{
typedef adj_list_edge_property_map< directed_tag, tTraits::edge_descriptor,
tTraits::edge_descriptor&, size_t, tEdge,
tTraits::edge_descriptor tEdge::* >
type;
typedef adj_list_edge_property_map< directed_tag, tTraits::edge_descriptor,
const tTraits::edge_descriptor&, size_t, const tEdge,
tTraits::edge_descriptor tEdge::* >
const_type;
};
template <> struct property_map< tBundleGraph, vertex_predecessor_t >
{
typedef vec_adj_list_vertex_property_map< tBundleGraph, tBundleGraph*,
tTraits::edge_descriptor, tTraits::edge_descriptor&,
tTraits::edge_descriptor tVertex::* >
type;
typedef vec_adj_list_vertex_property_map< tBundleGraph, const tBundleGraph*,
tTraits::edge_descriptor, const tTraits::edge_descriptor&,
tTraits::edge_descriptor tVertex::* >
const_type;
};
template <> struct property_map< tBundleGraph, vertex_color_t >
{
typedef vec_adj_list_vertex_property_map< tBundleGraph, tBundleGraph*,
default_color_type, default_color_type&, default_color_type tVertex::* >
type;
typedef vec_adj_list_vertex_property_map< tBundleGraph, const tBundleGraph*,
default_color_type, const default_color_type&,
default_color_type tVertex::* >
const_type;
};
template <> struct property_map< tBundleGraph, vertex_distance_t >
{
typedef vec_adj_list_vertex_property_map< tBundleGraph, tBundleGraph*, long,
long&, long tVertex::* >
type;
typedef vec_adj_list_vertex_property_map< tBundleGraph, const tBundleGraph*,
long, const long&, long tVertex::* >
const_type;
};
}
property_map< tBundleGraph, edge_capacity_t >::const_type get(
edge_capacity_t, const tBundleGraph& g)
{
return get(&tEdge::edge_capacity, g);
}
property_map< tBundleGraph, edge_residual_capacity_t >::type get(
edge_residual_capacity_t, tBundleGraph& g)
{
return get(&tEdge::edge_residual_capacity, g);
}
property_map< tBundleGraph, edge_reverse_t >::const_type get(
edge_reverse_t, const tBundleGraph& g)
{
return get(&tEdge::edge_reverse, g);
}
property_map< tBundleGraph, vertex_predecessor_t >::type get(
vertex_predecessor_t, tBundleGraph& g)
{
return get(&tVertex::vertex_predecessor, g);
}
property_map< tBundleGraph, vertex_color_t >::type get(
vertex_color_t, tBundleGraph& g)
{
return get(&tVertex::vertex_color, g);
}
property_map< tBundleGraph, vertex_distance_t >::type get(
vertex_distance_t, tBundleGraph& g)
{
return get(&tVertex::vertex_distance, g);
}
long test_bundled_properties(int n_verts, int n_edges, std::size_t seed)
{
typedef adjacency_list_traits< vecS, vecS, directedS > tTraits;
typedef Node< tTraits::edge_descriptor > tVertex;
typedef Link< tTraits::edge_descriptor > tEdge;
typedef adjacency_list< vecS, vecS, directedS, tVertex, tEdge >
tBundleGraph;
tBundleGraph g;
graph_traits< tBundleGraph >::vertex_descriptor src, sink;
boost::tie(src, sink)
= fill_random_max_flow_graph(g, get(&tEdge::edge_capacity, g),
get(&tEdge::edge_reverse, g), n_verts, n_edges, seed);
return boykov_kolmogorov_max_flow(g, get(&tEdge::edge_capacity, g),
get(&tEdge::edge_residual_capacity, g), get(&tEdge::edge_reverse, g),
get(&tVertex::vertex_predecessor, g), get(&tVertex::vertex_color, g),
get(&tVertex::vertex_distance, g), get(vertex_index, g), src, sink);
long flow_all_defaults_overload = boykov_kolmogorov_max_flow(g, src, sink);
long flow_unnamed_overload = boykov_kolmogorov_max_flow(g,
get(&tEdge::edge_capacity, g), get(&tEdge::edge_residual_capacity, g),
get(&tEdge::edge_reverse, g), get(&tVertex::vertex_predecessor, g),
get(&tVertex::vertex_color, g), get(&tVertex::vertex_distance, g),
get(vertex_index, g), src, sink);
long flow_named_overload = boykov_kolmogorov_max_flow(g, src, sink,
capacity_map(get(&tEdge::edge_capacity, g))
.residual_capacity_map(get(&tEdge::edge_residual_capacity, g))
.reverse_edge_map(get(&tEdge::edge_reverse, g))
.predecessor_map(get(&tVertex::vertex_predecessor, g))
.color_map(get(&tVertex::vertex_color, g))
.distance_map(get(&tVertex::vertex_distance, g))
.vertex_index_map(get(vertex_index, g)));
BOOST_TEST(flow_all_defaults_overload == flow_unnamed_overload);
BOOST_TEST(flow_unnamed_overload == flow_named_overload);
return flow_named_overload;
}
long test_overloads(int n_verts, int n_edges, std::size_t seed)
{
typedef adjacency_list_traits< vecS, vecS, directedS > tTraits;
typedef property< vertex_index_t, long,
property< vertex_predecessor_t, tTraits::edge_descriptor,
property< vertex_color_t, default_color_type,
property< vertex_distance_t, long > > > >
tVertexProperty;
typedef property< edge_capacity_t, long,
property< edge_residual_capacity_t, long,
property< edge_reverse_t, tTraits::edge_descriptor > > >
tEdgeProperty;
typedef adjacency_list< vecS, vecS, directedS, no_property, tEdgeProperty >
typedef adjacency_list< vecS, vecS, directedS, tVertexProperty,
tEdgeProperty >
tGraph;
tGraph g;
@@ -226,7 +344,10 @@ long test_overloads(int n_verts, int n_edges, std::size_t seed)
color_vec.begin(), get(vertex_index, g)),
get(vertex_index, g), src, sink);
long flow_overload_3 = boykov_kolmogorov_max_flow(g, src, sink);
BOOST_TEST(flow_overload_1 == flow_overload_2);
BOOST_TEST(flow_overload_2 == flow_overload_3);
return flow_overload_1;
}
+1 -1
View File
@@ -51,7 +51,7 @@ template < typename Graph > void test()
{
typedef erdos_renyi_iterator< boost::minstd_rand, Graph > er;
// Generate random graphs with 15 vertices and 15% probability
// Generate random graph with N vertices and probability P
// of edge connection.
static const size_t N = 20;
static const double P = 0.1;
+15 -9
View File
@@ -7,16 +7,14 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#define BOOST_TEST_MODULE cycle_canceling_test
#include <boost/test/unit_test.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/graph/cycle_canceling.hpp>
#include <boost/graph/edmonds_karp_max_flow.hpp>
#include "min_cost_max_flow_utils.hpp"
BOOST_AUTO_TEST_CASE(cycle_canceling_def_test)
void cycle_canceling_def_test()
{
boost::SampleGraph::vertex_descriptor s, t;
boost::SampleGraph::Graph g;
@@ -26,10 +24,10 @@ BOOST_AUTO_TEST_CASE(cycle_canceling_def_test)
boost::cycle_canceling(g);
int cost = boost::find_flow_cost(g);
BOOST_CHECK_EQUAL(cost, 29);
BOOST_TEST_EQ(cost, 29);
}
BOOST_AUTO_TEST_CASE(path_augmentation_def_test2)
void path_augmentation_def_test2()
{
boost::SampleGraph::vertex_descriptor s, t;
boost::SampleGraph::Graph g;
@@ -39,10 +37,10 @@ BOOST_AUTO_TEST_CASE(path_augmentation_def_test2)
boost::cycle_canceling(g);
int cost = boost::find_flow_cost(g);
BOOST_CHECK_EQUAL(cost, 7);
BOOST_TEST_EQ(cost, 7);
}
BOOST_AUTO_TEST_CASE(cycle_canceling_test)
void cycle_canceling_test()
{
boost::SampleGraph::vertex_descriptor s, t;
typedef boost::SampleGraph::Graph Graph;
@@ -66,5 +64,13 @@ BOOST_AUTO_TEST_CASE(cycle_canceling_test)
.vertex_index_map(idx));
int cost = boost::find_flow_cost(g);
BOOST_CHECK_EQUAL(cost, 29);
BOOST_TEST_EQ(cost, 29);
}
int main()
{
cycle_canceling_def_test();
path_augmentation_def_test2();
cycle_canceling_test();
return boost::report_errors();
}
+12 -5
View File
@@ -10,6 +10,7 @@
#define BOOST_GRAPH_TEST_CYCLE_TEST_HPP
#include <boost/assert.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/graph/directed_graph.hpp>
#include <boost/graph/erdos_renyi_generator.hpp>
#include <boost/graph/graph_traits.hpp>
@@ -52,11 +53,11 @@ struct cycle_validator
};
template < typename Graph, typename Algorithm >
void test_one(Algorithm algorithm)
void test_one(Algorithm algorithm, std::size_t num_cycles_expected)
{
typedef erdos_renyi_iterator< minstd_rand, Graph > er;
// Generate random graphs with 15 vertices and 15% probability
// Generate random graph with N vertices and probability P
// of edge connection.
static std::size_t const N = 20;
static double const P = 0.1;
@@ -70,16 +71,22 @@ void test_one(Algorithm algorithm)
cycle_validator vis(cycles);
algorithm(g, vis);
std::cout << "# cycles: " << vis.cycles << "\n";
BOOST_TEST(vis.cycles == num_cycles_expected);
}
} // end namespace cycle_test_detail
template < typename Algorithm > void cycle_test(Algorithm const& algorithm)
template < typename Algorithm > void cycle_test(Algorithm const& algorithm,
std::size_t num_cycles_expected_undirected,
std::size_t num_cycles_expected_directed)
{
std::cout << "*** undirected ***\n";
cycle_test_detail::test_one< boost::undirected_graph<> >(algorithm);
cycle_test_detail::test_one< boost::undirected_graph<> >(algorithm,
num_cycles_expected_undirected);
std::cout << "*** directed ***\n";
cycle_test_detail::test_one< boost::directed_graph<> >(algorithm);
cycle_test_detail::test_one< boost::directed_graph<> >(algorithm,
num_cycles_expected_directed);
}
#endif // !BOOST_GRAPH_TEST_CYCLE_TEST_HPP
+18
View File
@@ -55,5 +55,23 @@ int main(int argc, char* argv[])
BOOST_TEST(m_graph[ed1] == EDGE_VAL);
// https://github.com/boostorg/graph/issues/268
// 1. Undirected:
{
boost::adjacency_list<boost::setS, boost::vecS, boost::undirectedS> g;
boost::add_edge(2, 0, g);
boost::remove_vertex(1, g);
BOOST_TEST(num_vertices(g) == 2);
BOOST_TEST(num_edges(g) == 1);
}
// 2. Directed:
{
boost::adjacency_list<boost::setS, boost::vecS, boost::directedS> g;
boost::add_edge(2, 0, g);
boost::remove_vertex(1, g);
BOOST_TEST(num_vertices(g) == 2);
BOOST_TEST(num_edges(g) == 1);
}
return boost::report_errors();
}

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