mirror of
https://github.com/boostorg/graph.git
synced 2026-07-21 13:23:42 +00:00
Compare commits
214 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 198616d896 | |||
| 5557ccf921 | |||
| 17acf25da7 | |||
| 64a3bae4f2 | |||
| 05aa9fd816 | |||
| c71ceb8486 | |||
| 9c0ceda4c8 | |||
| 5007b01ad5 | |||
| 8126d97989 | |||
| 2154398906 | |||
| b8150fac82 | |||
| 06339d6f44 | |||
| e7d0adb472 | |||
| a3fffa9c2b | |||
| 6caa0baaec | |||
| 044c7d65a5 | |||
| 2e7d74b1a0 | |||
| 71cea99db3 | |||
| b9fbc47bbb | |||
| 2c36c0f819 | |||
| 2f5a3c2ccc | |||
| db7b3736d6 | |||
| 8f3139bed4 | |||
| 0be4c876bd | |||
| 5ec4327816 | |||
| 4375631fa6 | |||
| 81ead6e595 | |||
| 158eebd082 | |||
| fa8caeeffa | |||
| 33a2510c54 | |||
| 57fdbf4093 | |||
| 3fd626fa71 | |||
| 46a2823a94 | |||
| 46ddc517a2 | |||
| 9c9f9f4b49 | |||
| a052dcdd06 | |||
| 72cad02a0b | |||
| a7c3845f28 | |||
| e522561485 | |||
| 1f6bb4adfa | |||
| a63690ac60 | |||
| 3d6b1d4c9b | |||
| 5235d7dd49 | |||
| 372355b045 | |||
| fa2636d69d | |||
| e94408cf41 | |||
| 8dc51f8bdc | |||
| 52c216c0aa | |||
| f3158683b5 | |||
| 77c07d131e | |||
| 2e63766abb | |||
| f2d0ae7827 | |||
| d09128fc7b | |||
| 0fd61671ae | |||
| c3574b1f2d | |||
| e5ccf7977e | |||
| 3e2b86ab81 | |||
| 2cff7c5207 | |||
| 7a469ec47a | |||
| 1a3dab98cd | |||
| b48bf93057 | |||
| 942829ee68 | |||
| 4fc6b0b65e | |||
| 9f36ca3a1d | |||
| 047fff647f | |||
| 2097d8ffed | |||
| 98e7bfa10a | |||
| ec28611026 | |||
| b14f16b472 | |||
| 41aa91891d | |||
| 38efd9dc1d | |||
| 8c9f2dcaf5 | |||
| ee2cdcc805 | |||
| e56883f789 | |||
| 0182f7490e | |||
| 05e099335a | |||
| 5ef6a074e7 | |||
| 2573812229 | |||
| b5fa4d9758 | |||
| 12a57f9c01 | |||
| 985bfbd765 | |||
| 634f5fb1dd | |||
| a981db8b1f | |||
| a3001ec2e6 | |||
| 5308f29b6a | |||
| eb0ab8bd4b | |||
| 0714892239 | |||
| 0fb5562d43 | |||
| 088714f052 | |||
| 4d968a2972 | |||
| 1cf87d5558 | |||
| b460995095 | |||
| 2eea120320 | |||
| 21a9c6588f | |||
| aa0a4d3c93 | |||
| e8e47eacbb | |||
| 68ee7972df | |||
| 04a213038c | |||
| d95b3d477d | |||
| 5a9e2aa794 | |||
| a07f3532ad | |||
| e17d6f9ff8 | |||
| b9509fd9a8 | |||
| 00028767d8 | |||
| 1cf05f2b3f | |||
| b33c1eb37d | |||
| 5ccd0852b7 | |||
| a3148837c2 | |||
| 231de4c573 | |||
| f58f3df2bf | |||
| 3f75ea7aa3 | |||
| c9f515347b | |||
| 6f1f605ac8 | |||
| dd77077747 | |||
| ed75fd3e03 | |||
| a487ba019d | |||
| e9852ef6a0 | |||
| a649be53bd | |||
| 2862644154 | |||
| f62a1839bd | |||
| 3600dbc226 | |||
| 01020b0265 | |||
| fcfc152f85 | |||
| ea24532da5 | |||
| 944d9fc836 | |||
| 446dc15cf8 | |||
| 44632af1a9 | |||
| 5f4ce096f8 | |||
| 393c31d148 | |||
| 73149e556b | |||
| 3b6d40011b | |||
| 797530d23a | |||
| 2e4b9c461a | |||
| 3b6825958a | |||
| fa6aa57529 | |||
| 430f61f696 | |||
| 51f7f20cb6 | |||
| 71fed2fda8 | |||
| 76aed24add | |||
| c583bfa197 | |||
| fa3bd05312 | |||
| 99d0414416 | |||
| 31026c4a5a | |||
| 5f6e128c16 | |||
| 1e200701f8 | |||
| 8543c8ad78 | |||
| f2e5ef1b40 | |||
| f6fc9c8157 | |||
| 0486e91d1b | |||
| 0defbbc323 | |||
| b657cf3901 | |||
| 5ff3645af6 | |||
| 84232b46c0 | |||
| b76ffc7f2a | |||
| 972bde3031 | |||
| 8c76c8aa01 | |||
| 4879e70593 | |||
| 27202068ea | |||
| cea3ee8225 | |||
| 6e1f68ef22 | |||
| af22c9bcde | |||
| 7a6ceb3cd2 | |||
| 2bc8d0490e | |||
| 5bb73cd899 | |||
| 6bae630c38 | |||
| bb4fbd6494 | |||
| 64aa4a822a | |||
| d865589d62 | |||
| 03318bfb5f | |||
| 97f51d8180 | |||
| 35d3e15a47 | |||
| c2c341c12d | |||
| 685f9e091a | |||
| 2247005473 | |||
| 1fd5fc12a4 | |||
| 58b6f3640a | |||
| 63135f59b5 | |||
| 0c38817632 | |||
| 5842a766b6 | |||
| 5f1bbdb941 | |||
| 9b425a037c | |||
| 2bcd634112 | |||
| 7cccda8854 | |||
| f4aa9658fe | |||
| b3751605e4 | |||
| d63a380343 | |||
| 46702c45ac | |||
| 487459712b | |||
| cb342d159b | |||
| b05b379492 | |||
| 099f965f24 | |||
| d4160d52ba | |||
| 50e9e7a692 | |||
| d2ae80b7db | |||
| 0cfb1b8895 | |||
| 493e7b53a5 | |||
| f0c469b8e6 | |||
| bbc499708c | |||
| e4e12158e7 | |||
| 56ce18a75d | |||
| 1b2c9d8d3f | |||
| f364ee7be2 | |||
| 910445584a | |||
| ecbd271eb1 | |||
| e5f9471984 | |||
| 70d7fca2ce | |||
| 274a05f630 | |||
| 7c0a9d2998 | |||
| c1803bbb4f | |||
| 545428a4d0 | |||
| 53d0e93e43 | |||
| 1eb8c16a76 | |||
| b9c3b14d39 | |||
| 80b88a32e9 |
+81
@@ -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")
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
Executable
+42
@@ -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
|
||||
@@ -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
|
||||
@@ -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
@@ -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
|
||||
@@ -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()
|
||||
@@ -1,4 +1,5 @@
|
||||
Boost Graph Library [](https://travis-ci.org/boostorg/graph)
|
||||
Boost Graph Library [](https://drone.cpp.al/boostorg/graph)[](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 | [](https://travis-ci.org/boostorg/graph) | [](https://travis-ci.org/boostorg/graph) |
|
||||
| Appveyor | [](https://ci.appveyor.com/project/jzmaddock/graph/branch/master) | [](https://ci.appveyor.com/project/jzmaddock/graph/branch/develop) |
|
||||
|
||||
| Github Actions | [](https://github.com/boostorg/graph/actions) | [](https://github.com/boostorg/graph/actions) |
|
||||
|Drone | [](https://drone.cpp.al/boostorg/graph) | [](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)):
|
||||
|
||||
|
||||
@@ -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%
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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 <(b,x), (x,v)> is simple,
|
||||
while the path <(a,z), (z,a)> is not. Also, the path <(a,z),
|
||||
(z,a)> 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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
<h1 id="hawick_circuits"><code>hawick_circuits</code></h1>
|
||||
|
||||
<pre><code>template <typename Graph, typename Visitor, typename VertexIndexMap>
|
||||
void hawick_circuits(Graph const& graph, Visitor visitor, VertexIndexMap const& vim = get(vertex_index, graph));
|
||||
void hawick_circuits(Graph const& graph, Visitor visitor, VertexIndexMap const& vim = get(vertex_index, graph), unsigned int max_length = 0);
|
||||
|
||||
template <typename Graph, typename Visitor, typename VertexIndexMap>
|
||||
void hawick_unique_circuits(Graph const& graph, Visitor visitor, VertexIndexMap const& vim = get(vertex_index, graph));
|
||||
void hawick_unique_circuits(Graph const& graph, Visitor visitor, VertexIndexMap const& 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 ≤ <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
@@ -44,7 +44,7 @@
|
||||
incident(typename graph_traits<Graph>::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
@@ -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
@@ -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>
|
||||
|
||||
@@ -57,7 +57,7 @@ void r_c_shortest_paths( const Graph& g,
|
||||
typename graph_traits<Graph>::vertex_descriptor s,
|
||||
typename graph_traits<Graph>::vertex_descriptor t,
|
||||
std::vector<typename graph_traits<Graph>::edge_descriptor>& pareto_optimal_solution,
|
||||
Resource_Container>& pareto_optimal_resource_container,
|
||||
Resource_Container& pareto_optimal_resource_container,
|
||||
const Resource_Container& rc,
|
||||
const Resource_Extension_Function& ref,
|
||||
const Dominance_Function& dominance,
|
||||
@@ -93,7 +93,7 @@ void r_c_shortest_paths( const Graph& g,
|
||||
typename graph_traits<Graph>::vertex_descriptor s,
|
||||
typename graph_traits<Graph>::vertex_descriptor t,
|
||||
std::vector<typename graph_traits<Graph>::edge_descriptor>& pareto_optimal_solution,
|
||||
Resource_Container>& pareto_optimal_resource_container,
|
||||
Resource_Container& pareto_optimal_resource_container,
|
||||
const Resource_Container& rc,
|
||||
const Resource_Extension_Function& ref,
|
||||
const Dominance_Function& 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>
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ void random_spanning_tree(const Graph& g, Gen& 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;
|
||||
|
||||
@@ -181,8 +181,8 @@ bool status = read_graphviz(gvgraph,graph,dp,"node_id");
|
||||
<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 "boost_graph" and "boost_regex" 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 "boost_graph" 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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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
@@ -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 ;
|
||||
|
||||
@@ -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 >
|
||||
|
||||
@@ -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
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace graph
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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 ]
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
@@ -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
Reference in New Issue
Block a user