1.1 --- a/.hgignore Fri Oct 16 10:21:37 2009 +0200
1.2 +++ b/.hgignore Thu Nov 05 15:50:01 2009 +0100
1.3 @@ -22,11 +22,16 @@
1.4 lemon/libemon.la
1.5 lemon/stamp-h2
1.6 doc/Doxyfile
1.7 -cmake/cmake.version
1.8 +cmake/version.cmake
1.9 .dirstamp
1.10 .libs/*
1.11 .deps/*
1.12 demo/*.eps
1.13 +m4/libtool.m4
1.14 +m4/ltoptions.m4
1.15 +m4/ltsugar.m4
1.16 +m4/ltversion.m4
1.17 +m4/lt~obsolete.m4
1.18
1.19 syntax: regexp
1.20 (.*/)?\#[^/]*\#$
1.21 @@ -35,10 +40,11 @@
1.22 ^doc/.*\.tag
1.23 ^autom4te.cache/.*
1.24 ^build-aux/.*
1.25 -^objs.*/.*
1.26 +^.*objs.*/.*
1.27 ^test/[a-z_]*$
1.28 +^tools/[a-z-_]*$
1.29 ^demo/.*_demo$
1.30 -^build/.*
1.31 +^.*build.*/.*
1.32 ^doc/gen-images/.*
1.33 CMakeFiles
1.34 DartTestfile.txt
2.1 --- a/CMakeLists.txt Fri Oct 16 10:21:37 2009 +0200
2.2 +++ b/CMakeLists.txt Thu Nov 05 15:50:01 2009 +0100
2.3 @@ -1,37 +1,75 @@
2.4 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2.5
2.6 -IF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
2.7 - INCLUDE(${CMAKE_SOURCE_DIR}/cmake/version.cmake)
2.8 -ELSE(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
2.9 - SET(PROJECT_NAME "LEMON")
2.10 - SET(PROJECT_VERSION "hg-tip" CACHE STRING "LEMON version string.")
2.11 -ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
2.12 -
2.13 +SET(PROJECT_NAME "LEMON")
2.14 PROJECT(${PROJECT_NAME})
2.15
2.16 -SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
2.17 +IF(EXISTS ${PROJECT_SOURCE_DIR}/cmake/version.cmake)
2.18 + INCLUDE(${PROJECT_SOURCE_DIR}/cmake/version.cmake)
2.19 +ELSEIF(DEFINED ENV{LEMON_VERSION})
2.20 + SET(LEMON_VERSION $ENV{LEMON_VERSION} CACHE STRING "LEMON version string.")
2.21 +ELSE()
2.22 + EXECUTE_PROCESS(
2.23 + COMMAND hg id -i
2.24 + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
2.25 + OUTPUT_VARIABLE HG_REVISION
2.26 + ERROR_QUIET
2.27 + OUTPUT_STRIP_TRAILING_WHITESPACE
2.28 + )
2.29 + IF(HG_REVISION STREQUAL "")
2.30 + SET(HG_REVISION "hg-tip")
2.31 + ENDIF()
2.32 + SET(LEMON_VERSION ${HG_REVISION} CACHE STRING "LEMON version string.")
2.33 +ENDIF()
2.34
2.35 -INCLUDE(FindDoxygen)
2.36 -INCLUDE(FindGhostscript)
2.37 +SET(PROJECT_VERSION ${LEMON_VERSION})
2.38
2.39 -ADD_DEFINITIONS(-DHAVE_CONFIG_H)
2.40 +SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
2.41 +
2.42 +FIND_PACKAGE(Doxygen)
2.43 +FIND_PACKAGE(Ghostscript)
2.44 +FIND_PACKAGE(GLPK 4.33)
2.45 +FIND_PACKAGE(CPLEX)
2.46 +FIND_PACKAGE(COIN)
2.47
2.48 INCLUDE(CheckTypeSize)
2.49 -CHECK_TYPE_SIZE("long long" LEMON_LONG_LONG)
2.50 +CHECK_TYPE_SIZE("long long" LONG_LONG)
2.51 +SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG})
2.52 +
2.53 +INCLUDE(FindPythonInterp)
2.54
2.55 ENABLE_TESTING()
2.56
2.57 ADD_SUBDIRECTORY(lemon)
2.58 -ADD_SUBDIRECTORY(demo)
2.59 -ADD_SUBDIRECTORY(doc)
2.60 -ADD_SUBDIRECTORY(test)
2.61 +IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
2.62 + ADD_SUBDIRECTORY(demo)
2.63 + ADD_SUBDIRECTORY(tools)
2.64 + ADD_SUBDIRECTORY(doc)
2.65 + ADD_SUBDIRECTORY(test)
2.66 +ENDIF()
2.67
2.68 -IF(WIN32)
2.69 +CONFIGURE_FILE(
2.70 + ${PROJECT_SOURCE_DIR}/cmake/LEMONConfig.cmake.in
2.71 + ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
2.72 + @ONLY
2.73 +)
2.74 +IF(UNIX)
2.75 + INSTALL(
2.76 + FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
2.77 + DESTINATION share/lemon/cmake
2.78 + )
2.79 +ELSEIF(WIN32)
2.80 + INSTALL(
2.81 + FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
2.82 + DESTINATION cmake
2.83 + )
2.84 +ENDIF()
2.85 +
2.86 +IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR} AND WIN32)
2.87 SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
2.88 SET(CPACK_PACKAGE_VENDOR "EGRES")
2.89 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
2.90 - "LEMON - Library of Efficient Models and Optimization in Networks")
2.91 - SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
2.92 + "LEMON - Library for Efficient Modeling and Optimization in Networks")
2.93 + SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
2.94
2.95 SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
2.96
2.97 @@ -40,16 +78,19 @@
2.98 SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY
2.99 "${PROJECT_NAME} ${PROJECT_VERSION}")
2.100
2.101 - SET(CPACK_COMPONENTS_ALL headers library html_documentation)
2.102 + SET(CPACK_COMPONENTS_ALL headers library html_documentation bin)
2.103
2.104 SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers")
2.105 SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library")
2.106 + SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities")
2.107 SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation")
2.108
2.109 SET(CPACK_COMPONENT_HEADERS_DESCRIPTION
2.110 "C++ header files")
2.111 SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION
2.112 "DLL and import library")
2.113 + SET(CPACK_COMPONENT_BIN_DESCRIPTION
2.114 + "Command line utilities")
2.115 SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION
2.116 "Doxygen generated documentation")
2.117
2.118 @@ -71,9 +112,9 @@
2.119 SET(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full)
2.120
2.121 SET(CPACK_GENERATOR "NSIS")
2.122 - SET(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis/lemon.ico")
2.123 - SET(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/cmake/nsis/uninstall.ico")
2.124 - #SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
2.125 + SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon.ico")
2.126 + SET(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico")
2.127 + #SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
2.128 SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico")
2.129 SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}")
2.130 SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu")
2.131 @@ -88,4 +129,4 @@
2.132 ")
2.133
2.134 INCLUDE(CPack)
2.135 -ENDIF(WIN32)
2.136 +ENDIF()
3.1 --- a/INSTALL Fri Oct 16 10:21:37 2009 +0200
3.2 +++ b/INSTALL Thu Nov 05 15:50:01 2009 +0100
3.3 @@ -27,8 +27,8 @@
3.4 3. `make'
3.5
3.6 This command compiles the non-template part of LEMON into libemon.a
3.7 - file. It also compiles the programs in the tools and demo subdirectories
3.8 - when enabled.
3.9 + file. It also compiles the programs in the tools subdirectory by
3.10 + default.
3.11
3.12 4. `make check'
3.13
3.14 @@ -75,14 +75,6 @@
3.15
3.16 Set the installation prefix to PREFIX. By default it is /usr/local.
3.17
3.18 ---enable-demo
3.19 -
3.20 - Build the examples in the demo subdirectory.
3.21 -
3.22 ---disable-demo
3.23 -
3.24 - Do not build the examples in the demo subdirectory (default).
3.25 -
3.26 --enable-tools
3.27
3.28 Build the programs in the tools subdirectory (default).
3.29 @@ -158,3 +150,26 @@
3.30 --without-soplex
3.31
3.32 Disable SoPlex support.
3.33 +
3.34 +--with-coin[=PREFIX]
3.35 +
3.36 + Enable support for COIN-OR solvers (CLP and CBC). You should
3.37 + specify the prefix too. (by default, COIN-OR tools install
3.38 + themselves to the source code directory). This command enables the
3.39 + solvers that are actually found.
3.40 +
3.41 +--with-coin-includedir=DIR
3.42 +
3.43 + The directory where the COIN-OR header files are located. This is
3.44 + only useful when the COIN-OR headers and libraries are not under
3.45 + the same prefix (which is unlikely).
3.46 +
3.47 +--with-coin-libdir=DIR
3.48 +
3.49 + The directory where the COIN-OR libraries are located. This is only
3.50 + useful when the COIN-OR headers and libraries are not under the
3.51 + same prefix (which is unlikely).
3.52 +
3.53 +--without-coin
3.54 +
3.55 + Disable COIN-OR support.
4.1 --- a/LICENSE Fri Oct 16 10:21:37 2009 +0200
4.2 +++ b/LICENSE Thu Nov 05 15:50:01 2009 +0100
4.3 @@ -1,7 +1,7 @@
4.4 LEMON code without an explicit copyright notice is covered by the following
4.5 copyright/license.
4.6
4.7 -Copyright (C) 2003-2008 Egervary Jeno Kombinatorikus Optimalizalasi
4.8 +Copyright (C) 2003-2009 Egervary Jeno Kombinatorikus Optimalizalasi
4.9 Kutatocsoport (Egervary Combinatorial Optimization Research Group,
4.10 EGRES).
4.11
5.1 --- a/Makefile.am Fri Oct 16 10:21:37 2009 +0200
5.2 +++ b/Makefile.am Thu Nov 05 15:50:01 2009 +0100
5.3 @@ -1,5 +1,7 @@
5.4 ACLOCAL_AMFLAGS = -I m4
5.5
5.6 +AM_CXXFLAGS = $(WARNINGCXXFLAGS)
5.7 +
5.8 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir)
5.9 LDADD = $(top_builddir)/lemon/libemon.la
5.10
5.11 @@ -9,8 +11,13 @@
5.12 m4/lx_check_cplex.m4 \
5.13 m4/lx_check_glpk.m4 \
5.14 m4/lx_check_soplex.m4 \
5.15 + m4/lx_check_coin.m4 \
5.16 CMakeLists.txt \
5.17 cmake/FindGhostscript.cmake \
5.18 + cmake/FindCPLEX.cmake \
5.19 + cmake/FindGLPK.cmake \
5.20 + cmake/FindCOIN.cmake \
5.21 + cmake/LEMONConfig.cmake.in \
5.22 cmake/version.cmake.in \
5.23 cmake/version.cmake \
5.24 cmake/nsis/lemon.ico \
5.25 @@ -36,9 +43,13 @@
5.26 include lemon/Makefile.am
5.27 include test/Makefile.am
5.28 include doc/Makefile.am
5.29 -include demo/Makefile.am
5.30 include tools/Makefile.am
5.31
5.32 +DIST_SUBDIRS = demo
5.33 +
5.34 +demo:
5.35 + $(MAKE) $(AM_MAKEFLAGS) -C demo
5.36 +
5.37 MRPROPERFILES = \
5.38 aclocal.m4 \
5.39 config.h.in \
5.40 @@ -65,4 +76,4 @@
5.41 zcat $(PACKAGE)-$(VERSION).tar.gz | \
5.42 bzip2 --best -c > $(PACKAGE)-$(VERSION).tar.bz2
5.43
5.44 -.PHONY: mrproper dist-bz2 distcheck-bz2
5.45 +.PHONY: demo mrproper dist-bz2 distcheck-bz2
6.1 --- a/NEWS Fri Oct 16 10:21:37 2009 +0200
6.2 +++ b/NEWS Thu Nov 05 15:50:01 2009 +0100
6.3 @@ -1,3 +1,90 @@
6.4 +2009-05-13 Version 1.1 released
6.5 +
6.6 + This is the second stable release of the 1.x series. It
6.7 + features a better coverage of the tools available in the 0.x
6.8 + series, a thoroughly reworked LP/MIP interface plus various
6.9 + improvements in the existing tools.
6.10 +
6.11 + * Much improved M$ Windows support
6.12 + * Various improvements in the CMAKE build system
6.13 + * Compilation warnings are fixed/suppressed
6.14 + * Support IBM xlC compiler
6.15 + * New algorithms
6.16 + * Connectivity related algorithms (#61)
6.17 + * Euler walks (#65)
6.18 + * Preflow push-relabel max. flow algorithm (#176)
6.19 + * Circulation algorithm (push-relabel based) (#175)
6.20 + * Suurballe algorithm (#47)
6.21 + * Gomory-Hu algorithm (#66)
6.22 + * Hao-Orlin algorithm (#58)
6.23 + * Edmond's maximum cardinality and weighted matching algorithms
6.24 + in general graphs (#48,#265)
6.25 + * Minimum cost arborescence/branching (#60)
6.26 + * Network Simplex min. cost flow algorithm (#234)
6.27 + * New data structures
6.28 + * Full graph structure (#57)
6.29 + * Grid graph structure (#57)
6.30 + * Hypercube graph structure (#57)
6.31 + * Graph adaptors (#67)
6.32 + * ArcSet and EdgeSet classes (#67)
6.33 + * Elevator class (#174)
6.34 + * Other new tools
6.35 + * LP/MIP interface (#44)
6.36 + * Support for GLPK, CPLEX, Soplex, COIN-OR CLP and CBC
6.37 + * Reader for the Nauty file format (#55)
6.38 + * DIMACS readers (#167)
6.39 + * Radix sort algorithms (#72)
6.40 + * RangeIdMap and CrossRefMap (#160)
6.41 + * New command line tools
6.42 + * DIMACS to LGF converter (#182)
6.43 + * lgf-gen - a graph generator (#45)
6.44 + * DIMACS solver utility (#226)
6.45 + * Other code improvements
6.46 + * Lognormal distribution added to Random (#102)
6.47 + * Better (i.e. O(1) time) item counting in SmartGraph (#3)
6.48 + * The standard maps of graphs are guaranteed to be
6.49 + reference maps (#190)
6.50 + * Miscellaneous
6.51 + * Various doc improvements
6.52 + * Improved 0.x -> 1.x converter script
6.53 +
6.54 + * Several bugfixes (compared to release 1.0):
6.55 + #170: Bugfix SmartDigraph::split()
6.56 + #171: Bugfix in SmartGraph::restoreSnapshot()
6.57 + #172: Extended test cases for graphs and digraphs
6.58 + #173: Bugfix in Random
6.59 + * operator()s always return a double now
6.60 + * the faulty real<Num>(Num) and real<Num>(Num,Num)
6.61 + have been removed
6.62 + #187: Remove DijkstraWidestPathOperationTraits
6.63 + #61: Bugfix in DfsVisit
6.64 + #193: Bugfix in GraphReader::skipSection()
6.65 + #195: Bugfix in ConEdgeIt()
6.66 + #197: Bugfix in heap unionfind
6.67 + * This bug affects Edmond's general matching algorithms
6.68 + #207: Fix 'make install' without 'make html' using CMAKE
6.69 + #208: Suppress or fix VS2008 compilation warnings
6.70 + ----: Update the LEMON icon
6.71 + ----: Enable the component-based installer
6.72 + (in installers made by CPACK)
6.73 + ----: Set the proper version for CMAKE in the tarballs
6.74 + (made by autotools)
6.75 + ----: Minor clarification in the LICENSE file
6.76 + ----: Add missing unistd.h include to time_measure.h
6.77 + #204: Compilation bug fixed in graph_to_eps.h with VS2005
6.78 + #214,#215: windows.h should never be included by lemon headers
6.79 + #230: Build systems check the availability of 'long long' type
6.80 + #229: Default implementation of Tolerance<> is used for integer types
6.81 + #211,#212: Various fixes for compiling on AIX
6.82 + ----: Improvements in CMAKE config
6.83 + - docs is installed in share/doc/
6.84 + - detects newer versions of Ghostscript
6.85 + #239: Fix missing 'inline' specifier in time_measure.h
6.86 + #274,#280: Install lemon/config.h
6.87 + #275: Prefix macro names with LEMON_ in lemon/config.h
6.88 + ----: Small script for making the release tarballs added
6.89 + ----: Minor improvement in unify-sources.sh (a76f55d7d397)
6.90 +
6.91 2009-03-27 LEMON joins to the COIN-OR initiative
6.92
6.93 COIN-OR (Computational Infrastructure for Operations Research,
7.1 --- a/README Fri Oct 16 10:21:37 2009 +0200
7.2 +++ b/README Thu Nov 05 15:50:01 2009 +0100
7.3 @@ -1,6 +1,6 @@
7.4 -==================================================================
7.5 -LEMON - a Library of Efficient Models and Optimization in Networks
7.6 -==================================================================
7.7 +=====================================================================
7.8 +LEMON - a Library for Efficient Modeling and Optimization in Networks
7.9 +=====================================================================
7.10
7.11 LEMON is an open source library written in C++. It provides
7.12 easy-to-use implementations of common data structures and algorithms
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/cmake/FindCOIN.cmake Thu Nov 05 15:50:01 2009 +0100
8.3 @@ -0,0 +1,88 @@
8.4 +SET(COIN_ROOT_DIR "" CACHE PATH "COIN root directory")
8.5 +
8.6 +FIND_PATH(COIN_INCLUDE_DIR coin/CoinUtilsConfig.h
8.7 + HINTS ${COIN_ROOT_DIR}/include
8.8 +)
8.9 +FIND_LIBRARY(COIN_CBC_LIBRARY
8.10 + NAMES Cbc libCbc
8.11 + HINTS ${COIN_ROOT_DIR}/lib
8.12 +)
8.13 +FIND_LIBRARY(COIN_CBC_SOLVER_LIBRARY
8.14 + NAMES CbcSolver libCbcSolver
8.15 + HINTS ${COIN_ROOT_DIR}/lib
8.16 +)
8.17 +FIND_LIBRARY(COIN_CGL_LIBRARY
8.18 + NAMES Cgl libCgl
8.19 + HINTS ${COIN_ROOT_DIR}/lib
8.20 +)
8.21 +FIND_LIBRARY(COIN_CLP_LIBRARY
8.22 + NAMES Clp libClp
8.23 + HINTS ${COIN_ROOT_DIR}/lib
8.24 +)
8.25 +FIND_LIBRARY(COIN_COIN_UTILS_LIBRARY
8.26 + NAMES CoinUtils libCoinUtils
8.27 + HINTS ${COIN_ROOT_DIR}/lib
8.28 +)
8.29 +FIND_LIBRARY(COIN_OSI_LIBRARY
8.30 + NAMES Osi libOsi
8.31 + HINTS ${COIN_ROOT_DIR}/lib
8.32 +)
8.33 +FIND_LIBRARY(COIN_OSI_CBC_LIBRARY
8.34 + NAMES OsiCbc libOsiCbc
8.35 + HINTS ${COIN_ROOT_DIR}/lib
8.36 +)
8.37 +FIND_LIBRARY(COIN_OSI_CLP_LIBRARY
8.38 + NAMES OsiClp libOsiClp
8.39 + HINTS ${COIN_ROOT_DIR}/lib
8.40 +)
8.41 +FIND_LIBRARY(COIN_OSI_VOL_LIBRARY
8.42 + NAMES OsiVol libOsiVol
8.43 + HINTS ${COIN_ROOT_DIR}/lib
8.44 +)
8.45 +FIND_LIBRARY(COIN_VOL_LIBRARY
8.46 + NAMES Vol libVol
8.47 + HINTS ${COIN_ROOT_DIR}/lib
8.48 +)
8.49 +
8.50 +INCLUDE(FindPackageHandleStandardArgs)
8.51 +FIND_PACKAGE_HANDLE_STANDARD_ARGS(COIN DEFAULT_MSG
8.52 + COIN_INCLUDE_DIR
8.53 + COIN_CBC_LIBRARY
8.54 + COIN_CBC_SOLVER_LIBRARY
8.55 + COIN_CGL_LIBRARY
8.56 + COIN_CLP_LIBRARY
8.57 + COIN_COIN_UTILS_LIBRARY
8.58 + COIN_OSI_LIBRARY
8.59 + COIN_OSI_CBC_LIBRARY
8.60 + COIN_OSI_CLP_LIBRARY
8.61 + COIN_OSI_VOL_LIBRARY
8.62 + COIN_VOL_LIBRARY
8.63 +)
8.64 +
8.65 +IF(COIN_FOUND)
8.66 + SET(COIN_INCLUDE_DIRS ${COIN_INCLUDE_DIR})
8.67 + SET(COIN_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_OSI_VOL_LIBRARY};${COIN_VOL_LIBRARY}")
8.68 + SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY}")
8.69 + SET(COIN_CBC_LIBRARIES ${COIN_LIBRARIES})
8.70 +ENDIF(COIN_FOUND)
8.71 +
8.72 +MARK_AS_ADVANCED(
8.73 + COIN_INCLUDE_DIR
8.74 + COIN_CBC_LIBRARY
8.75 + COIN_CBC_SOLVER_LIBRARY
8.76 + COIN_CGL_LIBRARY
8.77 + COIN_CLP_LIBRARY
8.78 + COIN_COIN_UTILS_LIBRARY
8.79 + COIN_OSI_LIBRARY
8.80 + COIN_OSI_CBC_LIBRARY
8.81 + COIN_OSI_CLP_LIBRARY
8.82 + COIN_OSI_VOL_LIBRARY
8.83 + COIN_VOL_LIBRARY
8.84 +)
8.85 +
8.86 +IF(COIN_FOUND)
8.87 + SET(LEMON_HAVE_LP TRUE)
8.88 + SET(LEMON_HAVE_MIP TRUE)
8.89 + SET(LEMON_HAVE_CLP TRUE)
8.90 + SET(LEMON_HAVE_CBC TRUE)
8.91 +ENDIF(COIN_FOUND)
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
9.2 +++ b/cmake/FindCPLEX.cmake Thu Nov 05 15:50:01 2009 +0100
9.3 @@ -0,0 +1,38 @@
9.4 +SET(CPLEX_ROOT_DIR "" CACHE PATH "CPLEX root directory")
9.5 +
9.6 +FIND_PATH(CPLEX_INCLUDE_DIR
9.7 + ilcplex/cplex.h
9.8 + PATHS "C:/ILOG/CPLEX91/include"
9.9 + PATHS "/opt/ilog/cplex91/include"
9.10 + HINTS ${CPLEX_ROOT_DIR}/include
9.11 +)
9.12 +FIND_LIBRARY(CPLEX_LIBRARY
9.13 + cplex91
9.14 + PATHS "C:/ILOG/CPLEX91/lib/msvc7/stat_mda"
9.15 + PATHS "/opt/ilog/cplex91/bin"
9.16 + HINTS ${CPLEX_ROOT_DIR}/bin
9.17 +)
9.18 +
9.19 +INCLUDE(FindPackageHandleStandardArgs)
9.20 +FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPLEX DEFAULT_MSG CPLEX_LIBRARY CPLEX_INCLUDE_DIR)
9.21 +
9.22 +FIND_PATH(CPLEX_BIN_DIR
9.23 + cplex91.dll
9.24 + PATHS "C:/ILOG/CPLEX91/bin/x86_win32"
9.25 +)
9.26 +
9.27 +IF(CPLEX_FOUND)
9.28 + SET(CPLEX_INCLUDE_DIRS ${CPLEX_INCLUDE_DIR})
9.29 + SET(CPLEX_LIBRARIES ${CPLEX_LIBRARY})
9.30 + IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
9.31 + SET(CPLEX_LIBRARIES "${CPLEX_LIBRARIES};m;pthread")
9.32 + ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
9.33 +ENDIF(CPLEX_FOUND)
9.34 +
9.35 +MARK_AS_ADVANCED(CPLEX_LIBRARY CPLEX_INCLUDE_DIR CPLEX_BIN_DIR)
9.36 +
9.37 +IF(CPLEX_FOUND)
9.38 + SET(LEMON_HAVE_LP TRUE)
9.39 + SET(LEMON_HAVE_MIP TRUE)
9.40 + SET(LEMON_HAVE_CPLEX TRUE)
9.41 +ENDIF(CPLEX_FOUND)
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/cmake/FindGLPK.cmake Thu Nov 05 15:50:01 2009 +0100
10.3 @@ -0,0 +1,61 @@
10.4 +SET(GLPK_ROOT_DIR "" CACHE PATH "GLPK root directory")
10.5 +
10.6 +SET(GLPK_REGKEY "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Glpk;InstallPath]")
10.7 +GET_FILENAME_COMPONENT(GLPK_ROOT_PATH ${GLPK_REGKEY} ABSOLUTE)
10.8 +
10.9 +FIND_PATH(GLPK_INCLUDE_DIR
10.10 + glpk.h
10.11 + PATHS ${GLPK_REGKEY}/include
10.12 + HINTS ${GLPK_ROOT_DIR}/include
10.13 +)
10.14 +FIND_LIBRARY(GLPK_LIBRARY
10.15 + glpk
10.16 + PATHS ${GLPK_REGKEY}/lib
10.17 + HINTS ${GLPK_ROOT_DIR}/lib
10.18 +)
10.19 +
10.20 +IF(GLPK_INCLUDE_DIR AND GLPK_LIBRARY)
10.21 + FILE(READ ${GLPK_INCLUDE_DIR}/glpk.h GLPK_GLPK_H)
10.22 +
10.23 + STRING(REGEX MATCH "define[ ]+GLP_MAJOR_VERSION[ ]+[0-9]+" GLPK_MAJOR_VERSION_LINE "${GLPK_GLPK_H}")
10.24 + STRING(REGEX REPLACE "define[ ]+GLP_MAJOR_VERSION[ ]+([0-9]+)" "\\1" GLPK_VERSION_MAJOR "${GLPK_MAJOR_VERSION_LINE}")
10.25 +
10.26 + STRING(REGEX MATCH "define[ ]+GLP_MINOR_VERSION[ ]+[0-9]+" GLPK_MINOR_VERSION_LINE "${GLPK_GLPK_H}")
10.27 + STRING(REGEX REPLACE "define[ ]+GLP_MINOR_VERSION[ ]+([0-9]+)" "\\1" GLPK_VERSION_MINOR "${GLPK_MINOR_VERSION_LINE}")
10.28 +
10.29 + SET(GLPK_VERSION_STRING "${GLPK_VERSION_MAJOR}.${GLPK_VERSION_MINOR}")
10.30 +
10.31 + IF(GLPK_FIND_VERSION)
10.32 + IF(GLPK_FIND_VERSION_COUNT GREATER 2)
10.33 + MESSAGE(SEND_ERROR "unexpected version string")
10.34 + ENDIF(GLPK_FIND_VERSION_COUNT GREATER 2)
10.35 +
10.36 + MATH(EXPR GLPK_REQUESTED_VERSION "${GLPK_FIND_VERSION_MAJOR}*100 + ${GLPK_FIND_VERSION_MINOR}")
10.37 + MATH(EXPR GLPK_FOUND_VERSION "${GLPK_VERSION_MAJOR}*100 + ${GLPK_VERSION_MINOR}")
10.38 +
10.39 + IF(GLPK_FOUND_VERSION LESS GLPK_REQUESTED_VERSION)
10.40 + SET(GLPK_PROPER_VERSION_FOUND FALSE)
10.41 + ELSE(GLPK_FOUND_VERSION LESS GLPK_REQUESTED_VERSION)
10.42 + SET(GLPK_PROPER_VERSION_FOUND TRUE)
10.43 + ENDIF(GLPK_FOUND_VERSION LESS GLPK_REQUESTED_VERSION)
10.44 + ELSE(GLPK_FIND_VERSION)
10.45 + SET(GLPK_PROPER_VERSION_FOUND TRUE)
10.46 + ENDIF(GLPK_FIND_VERSION)
10.47 +ENDIF(GLPK_INCLUDE_DIR AND GLPK_LIBRARY)
10.48 +
10.49 +INCLUDE(FindPackageHandleStandardArgs)
10.50 +FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLPK DEFAULT_MSG GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_PROPER_VERSION_FOUND)
10.51 +
10.52 +IF(GLPK_FOUND)
10.53 + SET(GLPK_INCLUDE_DIRS ${GLPK_INCLUDE_DIR})
10.54 + SET(GLPK_LIBRARIES ${GLPK_LIBRARY})
10.55 + SET(GLPK_BIN_DIR ${GLPK_ROOT_PATH}/bin)
10.56 +ENDIF(GLPK_FOUND)
10.57 +
10.58 +MARK_AS_ADVANCED(GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_BIN_DIR)
10.59 +
10.60 +IF(GLPK_FOUND)
10.61 + SET(LEMON_HAVE_LP TRUE)
10.62 + SET(LEMON_HAVE_MIP TRUE)
10.63 + SET(LEMON_HAVE_GLPK TRUE)
10.64 +ENDIF(GLPK_FOUND)
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
11.2 +++ b/cmake/LEMONConfig.cmake.in Thu Nov 05 15:50:01 2009 +0100
11.3 @@ -0,0 +1,13 @@
11.4 +SET(LEMON_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include" CACHE PATH "LEMON include directory")
11.5 +SET(LEMON_INCLUDE_DIRS "${LEMON_INCLUDE_DIR}")
11.6 +
11.7 +IF(UNIX)
11.8 + SET(LEMON_LIB_NAME "libemon.a")
11.9 +ELSEIF(WIN32)
11.10 + SET(LEMON_LIB_NAME "lemon.lib")
11.11 +ENDIF(UNIX)
11.12 +
11.13 +SET(LEMON_LIBRARY "@CMAKE_INSTALL_PREFIX@/lib/${LEMON_LIB_NAME}" CACHE FILEPATH "LEMON library")
11.14 +SET(LEMON_LIBRARIES "${LEMON_LIBRARY}")
11.15 +
11.16 +MARK_AS_ADVANCED(LEMON_LIBRARY LEMON_INCLUDE_DIR)
12.1 --- a/cmake/version.cmake.in Fri Oct 16 10:21:37 2009 +0200
12.2 +++ b/cmake/version.cmake.in Thu Nov 05 15:50:01 2009 +0100
12.3 @@ -1,2 +1,1 @@
12.4 -SET(PROJECT_NAME "@PACKAGE_NAME@")
12.5 -SET(PROJECT_VERSION "@PACKAGE_VERSION@" CACHE STRING "LEMON version string.")
12.6 +SET(LEMON_VERSION "@PACKAGE_VERSION@" CACHE STRING "LEMON version string.")
13.1 --- a/configure.ac Fri Oct 16 10:21:37 2009 +0200
13.2 +++ b/configure.ac Thu Nov 05 15:50:01 2009 +0100
13.3 @@ -2,14 +2,17 @@
13.4
13.5 dnl Version information.
13.6 m4_define([lemon_version_number],
13.7 - [m4_normalize(esyscmd([echo ${LEMON_VERSION}]))])
13.8 + [m4_normalize(esyscmd([echo ${LEMON_VERSION}]))])
13.9 dnl m4_define([lemon_version_number], [])
13.10 m4_define([lemon_hg_path], [m4_normalize(esyscmd([./scripts/chg-len.py]))])
13.11 -m4_define([lemon_hg_revision], [m4_normalize(esyscmd([hg id -i]))])
13.12 +m4_define([lemon_hg_revision], [m4_normalize(esyscmd([hg id -i 2> /dev/null]))])
13.13 m4_define([lemon_version], [ifelse(lemon_version_number(),
13.14 - [],
13.15 - [lemon_hg_path().lemon_hg_revision()],
13.16 - [lemon_version_number()])])
13.17 + [],
13.18 + [ifelse(lemon_hg_revision(),
13.19 + [],
13.20 + [hg-tip],
13.21 + [lemon_hg_path().lemon_hg_revision()])],
13.22 + [lemon_version_number()])])
13.23
13.24 AC_PREREQ([2.59])
13.25 AC_INIT([LEMON], [lemon_version()], [lemon-user@lemon.cs.elte.hu], [lemon])
13.26 @@ -19,7 +22,7 @@
13.27 AC_CONFIG_SRCDIR([lemon/list_graph.h])
13.28 AC_CONFIG_HEADERS([config.h lemon/config.h])
13.29
13.30 -lx_cmdline_cxxflags_set=${CXXFLAGS+set}
13.31 +AC_DEFINE([LEMON_VERSION], [lemon_version()], [The version string])
13.32
13.33 dnl Do compilation tests using the C++ compiler.
13.34 AC_LANG([C++])
13.35 @@ -38,6 +41,7 @@
13.36 AC_PROG_LIBTOOL
13.37
13.38 AC_CHECK_PROG([doxygen_found],[doxygen],[yes],[no])
13.39 +AC_CHECK_PROG([python_found],[python],[yes],[no])
13.40 AC_CHECK_PROG([gs_found],[gs],[yes],[no])
13.41
13.42 dnl Detect Intel compiler.
13.43 @@ -52,27 +56,19 @@
13.44 fi
13.45
13.46 dnl Set custom compiler flags when using g++.
13.47 -if test x"$lx_cmdline_cxxflags_set" != x"set" -a "$GXX" = yes -a "$ICC" = no; then
13.48 - CXXFLAGS="$CXXFLAGS -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas"
13.49 +if test "$GXX" = yes -a "$ICC" = no; then
13.50 + WARNINGCXXFLAGS="-Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas"
13.51 fi
13.52 +AC_SUBST([WARNINGCXXFLAGS])
13.53
13.54 dnl Checks for libraries.
13.55 -#LX_CHECK_GLPK
13.56 -#LX_CHECK_CPLEX
13.57 -#LX_CHECK_SOPLEX
13.58 +LX_CHECK_GLPK
13.59 +LX_CHECK_CPLEX
13.60 +LX_CHECK_SOPLEX
13.61 +LX_CHECK_COIN
13.62
13.63 -dnl Disable/enable building the demo programs.
13.64 -AC_ARG_ENABLE([demo],
13.65 -AS_HELP_STRING([--enable-demo], [build the demo programs])
13.66 -AS_HELP_STRING([--disable-demo], [do not build the demo programs @<:@default@:>@]),
13.67 - [], [enable_demo=no])
13.68 -AC_MSG_CHECKING([whether to build the demo programs])
13.69 -if test x"$enable_demo" != x"no"; then
13.70 - AC_MSG_RESULT([yes])
13.71 -else
13.72 - AC_MSG_RESULT([no])
13.73 -fi
13.74 -AM_CONDITIONAL([WANT_DEMO], [test x"$enable_demo" != x"no"])
13.75 +AM_CONDITIONAL([HAVE_LP], [test x"$lx_lp_found" = x"yes"])
13.76 +AM_CONDITIONAL([HAVE_MIP], [test x"$lx_mip_found" = x"yes"])
13.77
13.78 dnl Disable/enable building the binary tools.
13.79 AC_ARG_ENABLE([tools],
13.80 @@ -107,6 +103,7 @@
13.81
13.82 AC_CONFIG_FILES([
13.83 Makefile
13.84 +demo/Makefile
13.85 cmake/version.cmake
13.86 doc/Doxyfile
13.87 lemon/lemon.pc
13.88 @@ -120,15 +117,16 @@
13.89 echo Package version............... : $PACKAGE-$VERSION
13.90 echo
13.91 echo C++ compiler.................. : $CXX
13.92 -echo C++ compiles flags............ : $CXXFLAGS
13.93 +echo C++ compiles flags............ : $WARNINGCXXFLAGS $CXXFLAGS
13.94 echo
13.95 echo Compiler supports long long... : $long_long_found
13.96 echo
13.97 -#echo GLPK support.................. : $lx_glpk_found
13.98 -#echo CPLEX support................. : $lx_cplex_found
13.99 -#echo SOPLEX support................ : $lx_soplex_found
13.100 -#echo
13.101 -echo Build demo programs........... : $enable_demo
13.102 +echo GLPK support.................. : $lx_glpk_found
13.103 +echo CPLEX support................. : $lx_cplex_found
13.104 +echo SOPLEX support................ : $lx_soplex_found
13.105 +echo CLP support................... : $lx_clp_found
13.106 +echo CBC support................... : $lx_cbc_found
13.107 +echo
13.108 echo Build additional tools........ : $enable_tools
13.109 echo
13.110 echo The packace will be installed in
14.1 --- a/demo/CMakeLists.txt Fri Oct 16 10:21:37 2009 +0200
14.2 +++ b/demo/CMakeLists.txt Thu Nov 05 15:50:01 2009 +0100
14.3 @@ -1,16 +1,19 @@
14.4 INCLUDE_DIRECTORIES(
14.5 - ${CMAKE_SOURCE_DIR}
14.6 + ${PROJECT_SOURCE_DIR}
14.7 ${PROJECT_BINARY_DIR}
14.8 )
14.9
14.10 -LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lemon)
14.11 +LINK_DIRECTORIES(
14.12 + ${PROJECT_BINARY_DIR}/lemon
14.13 +)
14.14
14.15 SET(DEMOS
14.16 arg_parser_demo
14.17 graph_to_eps_demo
14.18 - lgf_demo)
14.19 + lgf_demo
14.20 +)
14.21
14.22 FOREACH(DEMO_NAME ${DEMOS})
14.23 ADD_EXECUTABLE(${DEMO_NAME} ${DEMO_NAME}.cc)
14.24 TARGET_LINK_LIBRARIES(${DEMO_NAME} lemon)
14.25 -ENDFOREACH(DEMO_NAME)
14.26 +ENDFOREACH()
15.1 --- a/demo/Makefile.am Fri Oct 16 10:21:37 2009 +0200
15.2 +++ b/demo/Makefile.am Thu Nov 05 15:50:01 2009 +0100
15.3 @@ -1,16 +1,17 @@
15.4 -EXTRA_DIST += \
15.5 - demo/CMakeLists.txt \
15.6 - demo/digraph.lgf
15.7 +AM_CXXFLAGS = $(WARNINGCXXFLAGS)
15.8
15.9 -if WANT_DEMO
15.10 +AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir)
15.11 +LDADD = $(top_builddir)/lemon/libemon.la
15.12
15.13 -noinst_PROGRAMS += \
15.14 - demo/arg_parser_demo \
15.15 - demo/graph_to_eps_demo \
15.16 - demo/lgf_demo
15.17 +EXTRA_DIST = \
15.18 + CMakeLists.txt \
15.19 + digraph.lgf
15.20
15.21 -endif WANT_DEMO
15.22 +noinst_PROGRAMS = \
15.23 + arg_parser_demo \
15.24 + graph_to_eps_demo \
15.25 + lgf_demo
15.26
15.27 -demo_arg_parser_demo_SOURCES = demo/arg_parser_demo.cc
15.28 -demo_graph_to_eps_demo_SOURCES = demo/graph_to_eps_demo.cc
15.29 -demo_lgf_demo_SOURCES = demo/lgf_demo.cc
15.30 +arg_parser_demo_SOURCES = arg_parser_demo.cc
15.31 +graph_to_eps_demo_SOURCES = graph_to_eps_demo.cc
15.32 +lgf_demo_SOURCES = lgf_demo.cc
16.1 --- a/demo/arg_parser_demo.cc Fri Oct 16 10:21:37 2009 +0200
16.2 +++ b/demo/arg_parser_demo.cc Thu Nov 05 15:50:01 2009 +0100
16.3 @@ -2,7 +2,7 @@
16.4 *
16.5 * This file is a part of LEMON, a generic C++ optimization library.
16.6 *
16.7 - * Copyright (C) 2003-2008
16.8 + * Copyright (C) 2003-2009
16.9 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
16.10 * (Egervary Research Group on Combinatorial Optimization, EGRES).
16.11 *
17.1 --- a/demo/graph_to_eps_demo.cc Fri Oct 16 10:21:37 2009 +0200
17.2 +++ b/demo/graph_to_eps_demo.cc Thu Nov 05 15:50:01 2009 +0100
17.3 @@ -2,7 +2,7 @@
17.4 *
17.5 * This file is a part of LEMON, a generic C++ optimization library.
17.6 *
17.7 - * Copyright (C) 2003-2008
17.8 + * Copyright (C) 2003-2009
17.9 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
17.10 * (Egervary Research Group on Combinatorial Optimization, EGRES).
17.11 *
17.12 @@ -85,14 +85,14 @@
17.13 graphToEps(g,"graph_to_eps_demo_out_1_pure.eps").
17.14 coords(coords).
17.15 title("Sample .eps figure").
17.16 - copyright("(C) 2003-2008 LEMON Project").
17.17 + copyright("(C) 2003-2009 LEMON Project").
17.18 run();
17.19
17.20 cout << "Create 'graph_to_eps_demo_out_2.eps'" << endl;
17.21 graphToEps(g,"graph_to_eps_demo_out_2.eps").
17.22 coords(coords).
17.23 title("Sample .eps figure").
17.24 - copyright("(C) 2003-2008 LEMON Project").
17.25 + copyright("(C) 2003-2009 LEMON Project").
17.26 absoluteNodeSizes().absoluteArcWidths().
17.27 nodeScale(2).nodeSizes(sizes).
17.28 nodeShapes(shapes).
17.29 @@ -105,7 +105,7 @@
17.30 cout << "Create 'graph_to_eps_demo_out_3_arr.eps'" << endl;
17.31 graphToEps(g,"graph_to_eps_demo_out_3_arr.eps").
17.32 title("Sample .eps figure (with arrowheads)").
17.33 - copyright("(C) 2003-2008 LEMON Project").
17.34 + copyright("(C) 2003-2009 LEMON Project").
17.35 absoluteNodeSizes().absoluteArcWidths().
17.36 nodeColors(composeMap(palette,colors)).
17.37 coords(coords).
17.38 @@ -132,7 +132,7 @@
17.39 cout << "Create 'graph_to_eps_demo_out_4_par.eps'" << endl;
17.40 graphToEps(g,"graph_to_eps_demo_out_4_par.eps").
17.41 title("Sample .eps figure (parallel arcs)").
17.42 - copyright("(C) 2003-2008 LEMON Project").
17.43 + copyright("(C) 2003-2009 LEMON Project").
17.44 absoluteNodeSizes().absoluteArcWidths().
17.45 nodeShapes(shapes).
17.46 coords(coords).
17.47 @@ -147,7 +147,7 @@
17.48 cout << "Create 'graph_to_eps_demo_out_5_par_arr.eps'" << endl;
17.49 graphToEps(g,"graph_to_eps_demo_out_5_par_arr.eps").
17.50 title("Sample .eps figure (parallel arcs and arrowheads)").
17.51 - copyright("(C) 2003-2008 LEMON Project").
17.52 + copyright("(C) 2003-2009 LEMON Project").
17.53 absoluteNodeSizes().absoluteArcWidths().
17.54 nodeScale(2).nodeSizes(sizes).
17.55 coords(coords).
17.56 @@ -163,7 +163,7 @@
17.57 cout << "Create 'graph_to_eps_demo_out_6_par_arr_a4.eps'" << endl;
17.58 graphToEps(g,"graph_to_eps_demo_out_6_par_arr_a4.eps").
17.59 title("Sample .eps figure (fits to A4)").
17.60 - copyright("(C) 2003-2008 LEMON Project").
17.61 + copyright("(C) 2003-2009 LEMON Project").
17.62 scaleToA4().
17.63 absoluteNodeSizes().absoluteArcWidths().
17.64 nodeScale(2).nodeSizes(sizes).
17.65 @@ -182,7 +182,7 @@
17.66 ListDigraph::NodeMap<int> hcolors(h);
17.67 ListDigraph::NodeMap<Point> hcoords(h);
17.68
17.69 - int cols=int(sqrt(double(palette.size())));
17.70 + int cols=int(std::sqrt(double(palette.size())));
17.71 for(int i=0;i<int(paletteW.size());i++) {
17.72 Node n=h.addNode();
17.73 hcoords[n]=Point(1+i%cols,1+i/cols);
17.74 @@ -193,7 +193,7 @@
17.75 graphToEps(h,"graph_to_eps_demo_out_7_colors.eps").
17.76 scale(60).
17.77 title("Sample .eps figure (Palette demo)").
17.78 - copyright("(C) 2003-2008 LEMON Project").
17.79 + copyright("(C) 2003-2009 LEMON Project").
17.80 coords(hcoords).
17.81 absoluteNodeSizes().absoluteArcWidths().
17.82 nodeScale(.45).
18.1 --- a/demo/lgf_demo.cc Fri Oct 16 10:21:37 2009 +0200
18.2 +++ b/demo/lgf_demo.cc Thu Nov 05 15:50:01 2009 +0100
18.3 @@ -2,7 +2,7 @@
18.4 *
18.5 * This file is a part of LEMON, a generic C++ optimization library.
18.6 *
18.7 - * Copyright (C) 2003-2008
18.8 + * Copyright (C) 2003-2009
18.9 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
18.10 * (Egervary Research Group on Combinatorial Optimization, EGRES).
18.11 *
19.1 --- a/doc/CMakeLists.txt Fri Oct 16 10:21:37 2009 +0200
19.2 +++ b/doc/CMakeLists.txt Thu Nov 05 15:50:01 2009 +0100
19.3 @@ -1,42 +1,52 @@
19.4 SET(PACKAGE_NAME ${PROJECT_NAME})
19.5 SET(PACKAGE_VERSION ${PROJECT_VERSION})
19.6 -SET(abs_top_srcdir ${CMAKE_SOURCE_DIR})
19.7 -SET(abs_top_builddir ${CMAKE_BINARY_DIR})
19.8 +SET(abs_top_srcdir ${PROJECT_SOURCE_DIR})
19.9 +SET(abs_top_builddir ${PROJECT_BINARY_DIR})
19.10
19.11 CONFIGURE_FILE(
19.12 - ${CMAKE_SOURCE_DIR}/doc/Doxyfile.in
19.13 - ${CMAKE_BINARY_DIR}/doc/Doxyfile
19.14 - @ONLY)
19.15 + ${PROJECT_SOURCE_DIR}/doc/Doxyfile.in
19.16 + ${PROJECT_BINARY_DIR}/doc/Doxyfile
19.17 + @ONLY
19.18 +)
19.19
19.20 -IF(DOXYGEN_EXECUTABLE AND GHOSTSCRIPT_EXECUTABLE)
19.21 +IF(DOXYGEN_EXECUTABLE AND PYTHONINTERP_FOUND AND GHOSTSCRIPT_EXECUTABLE)
19.22 FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/)
19.23 + SET(GHOSTSCRIPT_OPTIONS -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha)
19.24 + ADD_CUSTOM_TARGET(html
19.25 + COMMAND ${CMAKE_COMMAND} -E remove_directory gen-images
19.26 + COMMAND ${CMAKE_COMMAND} -E make_directory gen-images
19.27 + COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/bipartite_matching.png ${CMAKE_CURRENT_SOURCE_DIR}/images/bipartite_matching.eps
19.28 + COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/bipartite_partitions.png ${CMAKE_CURRENT_SOURCE_DIR}/images/bipartite_partitions.eps
19.29 + COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/connected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/connected_components.eps
19.30 + COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/edge_biconnected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/edge_biconnected_components.eps
19.31 + COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/grid_graph.png ${CMAKE_CURRENT_SOURCE_DIR}/images/grid_graph.eps
19.32 + COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/node_biconnected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/node_biconnected_components.eps
19.33 + COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_0.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_0.eps
19.34 + COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_1.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_1.eps
19.35 + COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_2.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_2.eps
19.36 + COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_3.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_3.eps
19.37 + COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_4.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_4.eps
19.38 + COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/strongly_connected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/strongly_connected_components.eps
19.39 + COMMAND ${CMAKE_COMMAND} -E remove_directory html
19.40 + COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/bib2dox.py ${CMAKE_CURRENT_SOURCE_DIR}/references.bib >references.dox
19.41 + COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
19.42 + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
19.43 + )
19.44 +
19.45 + SET_TARGET_PROPERTIES(html PROPERTIES PROJECT_LABEL BUILD_DOC)
19.46 +
19.47 IF(UNIX)
19.48 - ADD_CUSTOM_TARGET(html
19.49 - COMMAND rm -rf gen-images
19.50 - COMMAND mkdir gen-images
19.51 - COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_0.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_0.eps
19.52 - COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_1.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_1.eps
19.53 - COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_2.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_2.eps
19.54 - COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_3.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_3.eps
19.55 - COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_4.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_4.eps
19.56 - COMMAND rm -rf html
19.57 - COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
19.58 - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
19.59 + INSTALL(
19.60 + DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
19.61 + DESTINATION share/doc/lemon/html
19.62 + COMPONENT html_documentation
19.63 + )
19.64 ELSEIF(WIN32)
19.65 - ADD_CUSTOM_TARGET(html
19.66 - COMMAND if exist gen-images rmdir /s /q gen-images
19.67 - COMMAND mkdir gen-images
19.68 - COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_0.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_0.eps
19.69 - COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_1.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_1.eps
19.70 - COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_2.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_2.eps
19.71 - COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_3.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_3.eps
19.72 - COMMAND ${GHOSTSCRIPT_EXECUTABLE} -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha -r18 -sOutputFile=gen-images/nodeshape_4.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_4.eps
19.73 - COMMAND if exist html rmdir /s /q html
19.74 - COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
19.75 - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
19.76 - ENDIF(UNIX)
19.77 - INSTALL(
19.78 - DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
19.79 - DESTINATION share/doc
19.80 - COMPONENT html_documentation)
19.81 -ENDIF(DOXYGEN_EXECUTABLE AND GHOSTSCRIPT_EXECUTABLE)
19.82 + INSTALL(
19.83 + DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
19.84 + DESTINATION doc
19.85 + COMPONENT html_documentation
19.86 + )
19.87 + ENDIF()
19.88 +
19.89 +ENDIF()
20.1 --- a/doc/Doxyfile.in Fri Oct 16 10:21:37 2009 +0200
20.2 +++ b/doc/Doxyfile.in Thu Nov 05 15:50:01 2009 +0100
20.3 @@ -1,4 +1,4 @@
20.4 -# Doxyfile 1.5.7.1
20.5 +# Doxyfile 1.5.9
20.6
20.7 #---------------------------------------------------------------------------
20.8 # Project related configuration options
20.9 @@ -21,7 +21,6 @@
20.10 JAVADOC_AUTOBRIEF = NO
20.11 QT_AUTOBRIEF = NO
20.12 MULTILINE_CPP_IS_BRIEF = NO
20.13 -DETAILS_AT_TOP = YES
20.14 INHERIT_DOCS = NO
20.15 SEPARATE_MEMBER_PAGES = NO
20.16 TAB_SIZE = 8
20.17 @@ -66,7 +65,7 @@
20.18 GENERATE_DEPRECATEDLIST= YES
20.19 ENABLED_SECTIONS =
20.20 MAX_INITIALIZER_LINES = 5
20.21 -SHOW_USED_FILES = YES
20.22 +SHOW_USED_FILES = NO
20.23 SHOW_DIRECTORIES = YES
20.24 SHOW_FILES = YES
20.25 SHOW_NAMESPACES = YES
20.26 @@ -91,7 +90,8 @@
20.27 "@abs_top_srcdir@/lemon/concepts" \
20.28 "@abs_top_srcdir@/demo" \
20.29 "@abs_top_srcdir@/tools" \
20.30 - "@abs_top_srcdir@/test/test_tools.h"
20.31 + "@abs_top_srcdir@/test/test_tools.h" \
20.32 + "@abs_top_builddir@/doc/references.dox"
20.33 INPUT_ENCODING = UTF-8
20.34 FILE_PATTERNS = *.h \
20.35 *.cc \
20.36 @@ -223,7 +223,7 @@
20.37 EXPAND_AS_DEFINED =
20.38 SKIP_FUNCTION_MACROS = YES
20.39 #---------------------------------------------------------------------------
20.40 -# Configuration::additions related to external references
20.41 +# Options related to the search engine
20.42 #---------------------------------------------------------------------------
20.43 TAGFILES = "@abs_top_srcdir@/doc/libstdc++.tag = http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/ "
20.44 GENERATE_TAGFILE = html/lemon.tag
21.1 --- a/doc/Makefile.am Fri Oct 16 10:21:37 2009 +0200
21.2 +++ b/doc/Makefile.am Thu Nov 05 15:50:01 2009 +0100
21.3 @@ -8,20 +8,31 @@
21.4 doc/license.dox \
21.5 doc/mainpage.dox \
21.6 doc/migration.dox \
21.7 + doc/min_cost_flow.dox \
21.8 doc/named-param.dox \
21.9 doc/namespaces.dox \
21.10 doc/html \
21.11 doc/CMakeLists.txt
21.12
21.13 DOC_EPS_IMAGES18 = \
21.14 + grid_graph.eps \
21.15 nodeshape_0.eps \
21.16 nodeshape_1.eps \
21.17 nodeshape_2.eps \
21.18 nodeshape_3.eps \
21.19 nodeshape_4.eps
21.20
21.21 +DOC_EPS_IMAGES27 = \
21.22 + bipartite_matching.eps \
21.23 + bipartite_partitions.eps \
21.24 + connected_components.eps \
21.25 + edge_biconnected_components.eps \
21.26 + node_biconnected_components.eps \
21.27 + strongly_connected_components.eps
21.28 +
21.29 DOC_EPS_IMAGES = \
21.30 - $(DOC_EPS_IMAGES18)
21.31 + $(DOC_EPS_IMAGES18) \
21.32 + $(DOC_EPS_IMAGES27)
21.33
21.34 DOC_PNG_IMAGES = \
21.35 $(DOC_EPS_IMAGES:%.eps=doc/gen-images/%.png)
21.36 @@ -44,7 +55,30 @@
21.37 exit 1; \
21.38 fi
21.39
21.40 -html-local: $(DOC_PNG_IMAGES)
21.41 +$(DOC_EPS_IMAGES27:%.eps=doc/gen-images/%.png): doc/gen-images/%.png: doc/images/%.eps
21.42 + -mkdir doc/gen-images
21.43 + if test ${gs_found} = yes; then \
21.44 + $(GS_COMMAND) -sDEVICE=pngalpha -r27 -sOutputFile=$@ $<; \
21.45 + else \
21.46 + echo; \
21.47 + echo "Ghostscript not found."; \
21.48 + echo; \
21.49 + exit 1; \
21.50 + fi
21.51 +
21.52 +references.dox: doc/references.bib
21.53 + if test ${python_found} = yes; then \
21.54 + cd doc; \
21.55 + python @abs_top_srcdir@/scripts/bib2dox.py @abs_top_builddir@/$< >$@; \
21.56 + cd ..; \
21.57 + else \
21.58 + echo; \
21.59 + echo "Python not found."; \
21.60 + echo; \
21.61 + exit 1; \
21.62 + fi
21.63 +
21.64 +html-local: $(DOC_PNG_IMAGES) references.dox
21.65 if test ${doxygen_found} = yes; then \
21.66 cd doc; \
21.67 doxygen Doxyfile; \
21.68 @@ -69,19 +103,19 @@
21.69
21.70 install-html-local: doc/html
21.71 @$(NORMAL_INSTALL)
21.72 - $(mkinstalldirs) $(DESTDIR)$(htmldir)/docs
21.73 + $(mkinstalldirs) $(DESTDIR)$(htmldir)/html
21.74 for p in doc/html/*.{html,css,png,map,gif,tag} ; do \
21.75 f="`echo $$p | sed -e 's|^.*/||'`"; \
21.76 - echo " $(INSTALL_DATA) $$p $(DESTDIR)$(htmldir)/docs/$$f"; \
21.77 - $(INSTALL_DATA) $$p $(DESTDIR)$(htmldir)/docs/$$f; \
21.78 + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(htmldir)/html/$$f"; \
21.79 + $(INSTALL_DATA) $$p $(DESTDIR)$(htmldir)/html/$$f; \
21.80 done
21.81
21.82 uninstall-local:
21.83 @$(NORMAL_UNINSTALL)
21.84 for p in doc/html/*.{html,css,png,map,gif,tag} ; do \
21.85 f="`echo $$p | sed -e 's|^.*/||'`"; \
21.86 - echo " rm -f $(DESTDIR)$(htmldir)/docs/$$f"; \
21.87 - rm -f $(DESTDIR)$(htmldir)/docs/$$f; \
21.88 + echo " rm -f $(DESTDIR)$(htmldir)/html/$$f"; \
21.89 + rm -f $(DESTDIR)$(htmldir)/html/$$f; \
21.90 done
21.91
21.92 .PHONY: update-external-tags
22.1 --- a/doc/coding_style.dox Fri Oct 16 10:21:37 2009 +0200
22.2 +++ b/doc/coding_style.dox Thu Nov 05 15:50:01 2009 +0100
22.3 @@ -2,7 +2,7 @@
22.4 *
22.5 * This file is a part of LEMON, a generic C++ optimization library.
22.6 *
22.7 - * Copyright (C) 2003-2008
22.8 + * Copyright (C) 2003-2009
22.9 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
22.10 * (Egervary Research Group on Combinatorial Optimization, EGRES).
22.11 *
23.1 --- a/doc/dirs.dox Fri Oct 16 10:21:37 2009 +0200
23.2 +++ b/doc/dirs.dox Thu Nov 05 15:50:01 2009 +0100
23.3 @@ -2,7 +2,7 @@
23.4 *
23.5 * This file is a part of LEMON, a generic C++ optimization library.
23.6 *
23.7 - * Copyright (C) 2003-2008
23.8 + * Copyright (C) 2003-2009
23.9 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
23.10 * (Egervary Research Group on Combinatorial Optimization, EGRES).
23.11 *
23.12 @@ -71,7 +71,7 @@
23.13 \dir bits
23.14 \brief Auxiliary tools for implementation.
23.15
23.16 -This directory contains some auxiliary classes for implementing graphs,
23.17 +This directory contains some auxiliary classes for implementing graphs,
23.18 maps and some other classes.
23.19 As a user you typically don't have to deal with these files.
23.20 */
24.1 --- a/doc/groups.dox Fri Oct 16 10:21:37 2009 +0200
24.2 +++ b/doc/groups.dox Thu Nov 05 15:50:01 2009 +0100
24.3 @@ -2,7 +2,7 @@
24.4 *
24.5 * This file is a part of LEMON, a generic C++ optimization library.
24.6 *
24.7 - * Copyright (C) 2003-2008
24.8 + * Copyright (C) 2003-2009
24.9 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
24.10 * (Egervary Research Group on Combinatorial Optimization, EGRES).
24.11 *
24.12 @@ -16,9 +16,11 @@
24.13 *
24.14 */
24.15
24.16 +namespace lemon {
24.17 +
24.18 /**
24.19 @defgroup datas Data Structures
24.20 -This group describes the several data structures implemented in LEMON.
24.21 +This group contains the several data structures implemented in LEMON.
24.22 */
24.23
24.24 /**
24.25 @@ -60,13 +62,79 @@
24.26 */
24.27
24.28 /**
24.29 -@defgroup semi_adaptors Semi-Adaptor Classes for Graphs
24.30 +@defgroup graph_adaptors Adaptor Classes for Graphs
24.31 @ingroup graphs
24.32 -\brief Graph types between real graphs and graph adaptors.
24.33 +\brief Adaptor classes for digraphs and graphs
24.34
24.35 -This group describes some graph types between real graphs and graph adaptors.
24.36 -These classes wrap graphs to give new functionality as the adaptors do it.
24.37 -On the other hand they are not light-weight structures as the adaptors.
24.38 +This group contains several useful adaptor classes for digraphs and graphs.
24.39 +
24.40 +The main parts of LEMON are the different graph structures, generic
24.41 +graph algorithms, graph concepts, which couple them, and graph
24.42 +adaptors. While the previous notions are more or less clear, the
24.43 +latter one needs further explanation. Graph adaptors are graph classes
24.44 +which serve for considering graph structures in different ways.
24.45 +
24.46 +A short example makes this much clearer. Suppose that we have an
24.47 +instance \c g of a directed graph type, say ListDigraph and an algorithm
24.48 +\code
24.49 +template <typename Digraph>
24.50 +int algorithm(const Digraph&);
24.51 +\endcode
24.52 +is needed to run on the reverse oriented graph. It may be expensive
24.53 +(in time or in memory usage) to copy \c g with the reversed
24.54 +arcs. In this case, an adaptor class is used, which (according
24.55 +to LEMON \ref concepts::Digraph "digraph concepts") works as a digraph.
24.56 +The adaptor uses the original digraph structure and digraph operations when
24.57 +methods of the reversed oriented graph are called. This means that the adaptor
24.58 +have minor memory usage, and do not perform sophisticated algorithmic
24.59 +actions. The purpose of it is to give a tool for the cases when a
24.60 +graph have to be used in a specific alteration. If this alteration is
24.61 +obtained by a usual construction like filtering the node or the arc set or
24.62 +considering a new orientation, then an adaptor is worthwhile to use.
24.63 +To come back to the reverse oriented graph, in this situation
24.64 +\code
24.65 +template<typename Digraph> class ReverseDigraph;
24.66 +\endcode
24.67 +template class can be used. The code looks as follows
24.68 +\code
24.69 +ListDigraph g;
24.70 +ReverseDigraph<ListDigraph> rg(g);
24.71 +int result = algorithm(rg);
24.72 +\endcode
24.73 +During running the algorithm, the original digraph \c g is untouched.
24.74 +This techniques give rise to an elegant code, and based on stable
24.75 +graph adaptors, complex algorithms can be implemented easily.
24.76 +
24.77 +In flow, circulation and matching problems, the residual
24.78 +graph is of particular importance. Combining an adaptor implementing
24.79 +this with shortest path algorithms or minimum mean cycle algorithms,
24.80 +a range of weighted and cardinality optimization algorithms can be
24.81 +obtained. For other examples, the interested user is referred to the
24.82 +detailed documentation of particular adaptors.
24.83 +
24.84 +The behavior of graph adaptors can be very different. Some of them keep
24.85 +capabilities of the original graph while in other cases this would be
24.86 +meaningless. This means that the concepts that they meet depend
24.87 +on the graph adaptor, and the wrapped graph.
24.88 +For example, if an arc of a reversed digraph is deleted, this is carried
24.89 +out by deleting the corresponding arc of the original digraph, thus the
24.90 +adaptor modifies the original digraph.
24.91 +However in case of a residual digraph, this operation has no sense.
24.92 +
24.93 +Let us stand one more example here to simplify your work.
24.94 +ReverseDigraph has constructor
24.95 +\code
24.96 +ReverseDigraph(Digraph& digraph);
24.97 +\endcode
24.98 +This means that in a situation, when a <tt>const %ListDigraph&</tt>
24.99 +reference to a graph is given, then it have to be instantiated with
24.100 +<tt>Digraph=const %ListDigraph</tt>.
24.101 +\code
24.102 +int algorithm1(const ListDigraph& g) {
24.103 + ReverseDigraph<const ListDigraph> rg(g);
24.104 + return algorithm2(rg);
24.105 +}
24.106 +\endcode
24.107 */
24.108
24.109 /**
24.110 @@ -74,7 +142,7 @@
24.111 @ingroup datas
24.112 \brief Map structures implemented in LEMON.
24.113
24.114 -This group describes the map structures implemented in LEMON.
24.115 +This group contains the map structures implemented in LEMON.
24.116
24.117 LEMON provides several special purpose maps and map adaptors that e.g. combine
24.118 new maps from existing ones.
24.119 @@ -87,8 +155,11 @@
24.120 @ingroup maps
24.121 \brief Special graph-related maps.
24.122
24.123 -This group describes maps that are specifically designed to assign
24.124 -values to the nodes and arcs of graphs.
24.125 +This group contains maps that are specifically designed to assign
24.126 +values to the nodes and arcs/edges of graphs.
24.127 +
24.128 +If you are looking for the standard graph maps (\c NodeMap, \c ArcMap,
24.129 +\c EdgeMap), see the \ref graph_concepts "Graph Structure Concepts".
24.130 */
24.131
24.132 /**
24.133 @@ -96,10 +167,10 @@
24.134 \ingroup maps
24.135 \brief Tools to create new maps from existing ones
24.136
24.137 -This group describes map adaptors that are used to create "implicit"
24.138 +This group contains map adaptors that are used to create "implicit"
24.139 maps from other maps.
24.140
24.141 -Most of them are \ref lemon::concepts::ReadMap "read-only maps".
24.142 +Most of them are \ref concepts::ReadMap "read-only maps".
24.143 They can make arithmetic and logical operations between one or two maps
24.144 (negation, shifting, addition, multiplication, logical 'and', 'or',
24.145 'not' etc.) or e.g. convert a map to another one of different Value type.
24.146 @@ -155,19 +226,11 @@
24.147 */
24.148
24.149 /**
24.150 -@defgroup matrices Matrices
24.151 -@ingroup datas
24.152 -\brief Two dimensional data storages implemented in LEMON.
24.153 -
24.154 -This group describes two dimensional data storages implemented in LEMON.
24.155 -*/
24.156 -
24.157 -/**
24.158 @defgroup paths Path Structures
24.159 @ingroup datas
24.160 \brief %Path structures implemented in LEMON.
24.161
24.162 -This group describes the path structures implemented in LEMON.
24.163 +This group contains the path structures implemented in LEMON.
24.164
24.165 LEMON provides flexible data structures to work with paths.
24.166 All of them have similar interfaces and they can be copied easily with
24.167 @@ -175,7 +238,36 @@
24.168 efficient to have e.g. the Dijkstra algorithm to store its result in
24.169 any kind of path structure.
24.170
24.171 -\sa lemon::concepts::Path
24.172 +\sa \ref concepts::Path "Path concept"
24.173 +*/
24.174 +
24.175 +/**
24.176 +@defgroup heaps Heap Structures
24.177 +@ingroup datas
24.178 +\brief %Heap structures implemented in LEMON.
24.179 +
24.180 +This group contains the heap structures implemented in LEMON.
24.181 +
24.182 +LEMON provides several heap classes. They are efficient implementations
24.183 +of the abstract data type \e priority \e queue. They store items with
24.184 +specified values called \e priorities in such a way that finding and
24.185 +removing the item with minimum priority are efficient.
24.186 +The basic operations are adding and erasing items, changing the priority
24.187 +of an item, etc.
24.188 +
24.189 +Heaps are crucial in several algorithms, such as Dijkstra and Prim.
24.190 +The heap implementations have the same interface, thus any of them can be
24.191 +used easily in such algorithms.
24.192 +
24.193 +\sa \ref concepts::Heap "Heap concept"
24.194 +*/
24.195 +
24.196 +/**
24.197 +@defgroup matrices Matrices
24.198 +@ingroup datas
24.199 +\brief Two dimensional data storages implemented in LEMON.
24.200 +
24.201 +This group contains two dimensional data storages implemented in LEMON.
24.202 */
24.203
24.204 /**
24.205 @@ -183,16 +275,38 @@
24.206 @ingroup datas
24.207 \brief Auxiliary data structures implemented in LEMON.
24.208
24.209 -This group describes some data structures implemented in LEMON in
24.210 +This group contains some data structures implemented in LEMON in
24.211 order to make it easier to implement combinatorial algorithms.
24.212 */
24.213
24.214 /**
24.215 +@defgroup geomdat Geometric Data Structures
24.216 +@ingroup auxdat
24.217 +\brief Geometric data structures implemented in LEMON.
24.218 +
24.219 +This group contains geometric data structures implemented in LEMON.
24.220 +
24.221 + - \ref lemon::dim2::Point "dim2::Point" implements a two dimensional
24.222 + vector with the usual operations.
24.223 + - \ref lemon::dim2::Box "dim2::Box" can be used to determine the
24.224 + rectangular bounding box of a set of \ref lemon::dim2::Point
24.225 + "dim2::Point"'s.
24.226 +*/
24.227 +
24.228 +/**
24.229 +@defgroup matrices Matrices
24.230 +@ingroup auxdat
24.231 +\brief Two dimensional data storages implemented in LEMON.
24.232 +
24.233 +This group contains two dimensional data storages implemented in LEMON.
24.234 +*/
24.235 +
24.236 +/**
24.237 @defgroup algs Algorithms
24.238 -\brief This group describes the several algorithms
24.239 +\brief This group contains the several algorithms
24.240 implemented in LEMON.
24.241
24.242 -This group describes the several algorithms
24.243 +This group contains the several algorithms
24.244 implemented in LEMON.
24.245 */
24.246
24.247 @@ -201,8 +315,9 @@
24.248 @ingroup algs
24.249 \brief Common graph search algorithms.
24.250
24.251 -This group describes the common graph search algorithms like
24.252 -Breadth-First Search (BFS) and Depth-First Search (DFS).
24.253 +This group contains the common graph search algorithms, namely
24.254 +\e breadth-first \e search (BFS) and \e depth-first \e search (DFS)
24.255 +\ref clrs01algorithms.
24.256 */
24.257
24.258 /**
24.259 @@ -210,7 +325,30 @@
24.260 @ingroup algs
24.261 \brief Algorithms for finding shortest paths.
24.262
24.263 -This group describes the algorithms for finding shortest paths in graphs.
24.264 +This group contains the algorithms for finding shortest paths in digraphs
24.265 +\ref clrs01algorithms.
24.266 +
24.267 + - \ref Dijkstra algorithm for finding shortest paths from a source node
24.268 + when all arc lengths are non-negative.
24.269 + - \ref BellmanFord "Bellman-Ford" algorithm for finding shortest paths
24.270 + from a source node when arc lenghts can be either positive or negative,
24.271 + but the digraph should not contain directed cycles with negative total
24.272 + length.
24.273 + - \ref FloydWarshall "Floyd-Warshall" and \ref Johnson "Johnson" algorithms
24.274 + for solving the \e all-pairs \e shortest \e paths \e problem when arc
24.275 + lenghts can be either positive or negative, but the digraph should
24.276 + not contain directed cycles with negative total length.
24.277 + - \ref Suurballe A successive shortest path algorithm for finding
24.278 + arc-disjoint paths between two nodes having minimum total length.
24.279 +*/
24.280 +
24.281 +/**
24.282 +@defgroup spantree Minimum Spanning Tree Algorithms
24.283 +@ingroup algs
24.284 +\brief Algorithms for finding minimum cost spanning trees and arborescences.
24.285 +
24.286 +This group contains the algorithms for finding minimum cost spanning
24.287 +trees and arborescences \ref clrs01algorithms.
24.288 */
24.289
24.290 /**
24.291 @@ -218,40 +356,70 @@
24.292 @ingroup algs
24.293 \brief Algorithms for finding maximum flows.
24.294
24.295 -This group describes the algorithms for finding maximum flows and
24.296 -feasible circulations.
24.297 +This group contains the algorithms for finding maximum flows and
24.298 +feasible circulations \ref clrs01algorithms, \ref amo93networkflows.
24.299
24.300 -The maximum flow problem is to find a flow between a single source and
24.301 -a single target that is maximum. Formally, there is a \f$G=(V,A)\f$
24.302 -directed graph, an \f$c_a:A\rightarrow\mathbf{R}^+_0\f$ capacity
24.303 -function and given \f$s, t \in V\f$ source and target node. The
24.304 -maximum flow is the \f$f_a\f$ solution of the next optimization problem:
24.305 +The \e maximum \e flow \e problem is to find a flow of maximum value between
24.306 +a single source and a single target. Formally, there is a \f$G=(V,A)\f$
24.307 +digraph, a \f$cap: A\rightarrow\mathbf{R}^+_0\f$ capacity function and
24.308 +\f$s, t \in V\f$ source and target nodes.
24.309 +A maximum flow is an \f$f: A\rightarrow\mathbf{R}^+_0\f$ solution of the
24.310 +following optimization problem.
24.311
24.312 -\f[ 0 \le f_a \le c_a \f]
24.313 -\f[ \sum_{v\in\delta^{-}(u)}f_{vu}=\sum_{v\in\delta^{+}(u)}f_{uv}
24.314 -\qquad \forall u \in V \setminus \{s,t\}\f]
24.315 -\f[ \max \sum_{v\in\delta^{+}(s)}f_{uv} - \sum_{v\in\delta^{-}(s)}f_{vu}\f]
24.316 +\f[ \max\sum_{sv\in A} f(sv) - \sum_{vs\in A} f(vs) \f]
24.317 +\f[ \sum_{uv\in A} f(uv) = \sum_{vu\in A} f(vu)
24.318 + \quad \forall u\in V\setminus\{s,t\} \f]
24.319 +\f[ 0 \leq f(uv) \leq cap(uv) \quad \forall uv\in A \f]
24.320
24.321 LEMON contains several algorithms for solving maximum flow problems:
24.322 -- \ref lemon::EdmondsKarp "Edmonds-Karp"
24.323 -- \ref lemon::Preflow "Goldberg's Preflow algorithm"
24.324 -- \ref lemon::DinitzSleatorTarjan "Dinitz's blocking flow algorithm with dynamic trees"
24.325 -- \ref lemon::GoldbergTarjan "Preflow algorithm with dynamic trees"
24.326 +- \ref EdmondsKarp Edmonds-Karp algorithm
24.327 + \ref edmondskarp72theoretical.
24.328 +- \ref Preflow Goldberg-Tarjan's preflow push-relabel algorithm
24.329 + \ref goldberg88newapproach.
24.330 +- \ref DinitzSleatorTarjan Dinitz's blocking flow algorithm with dynamic trees
24.331 + \ref dinic70algorithm, \ref sleator83dynamic.
24.332 +- \ref GoldbergTarjan !Preflow push-relabel algorithm with dynamic trees
24.333 + \ref goldberg88newapproach, \ref sleator83dynamic.
24.334
24.335 -In most cases the \ref lemon::Preflow "Preflow" algorithm provides the
24.336 -fastest method to compute the maximum flow. All impelementations
24.337 -provides functions to query the minimum cut, which is the dual linear
24.338 -programming problem of the maximum flow.
24.339 +In most cases the \ref Preflow algorithm provides the
24.340 +fastest method for computing a maximum flow. All implementations
24.341 +also provide functions to query the minimum cut, which is the dual
24.342 +problem of maximum flow.
24.343 +
24.344 +\ref Circulation is a preflow push-relabel algorithm implemented directly
24.345 +for finding feasible circulations, which is a somewhat different problem,
24.346 +but it is strongly related to maximum flow.
24.347 +For more information, see \ref Circulation.
24.348 */
24.349
24.350 /**
24.351 -@defgroup min_cost_flow Minimum Cost Flow Algorithms
24.352 +@defgroup min_cost_flow_algs Minimum Cost Flow Algorithms
24.353 @ingroup algs
24.354
24.355 \brief Algorithms for finding minimum cost flows and circulations.
24.356
24.357 -This group describes the algorithms for finding minimum cost flows and
24.358 -circulations.
24.359 +This group contains the algorithms for finding minimum cost flows and
24.360 +circulations \ref amo93networkflows. For more information about this
24.361 +problem and its dual solution, see \ref min_cost_flow
24.362 +"Minimum Cost Flow Problem".
24.363 +
24.364 +LEMON contains several algorithms for this problem.
24.365 + - \ref NetworkSimplex Primal Network Simplex algorithm with various
24.366 + pivot strategies \ref dantzig63linearprog, \ref kellyoneill91netsimplex.
24.367 + - \ref CostScaling Push-Relabel and Augment-Relabel algorithms based on
24.368 + cost scaling \ref goldberg90approximation, \ref goldberg97efficient,
24.369 + \ref bunnagel98efficient.
24.370 + - \ref CapacityScaling Successive Shortest %Path algorithm with optional
24.371 + capacity scaling \ref edmondskarp72theoretical.
24.372 + - \ref CancelAndTighten The Cancel and Tighten algorithm
24.373 + \ref goldberg89cyclecanceling.
24.374 + - \ref CycleCanceling Cycle-Canceling algorithms
24.375 + \ref klein67primal, \ref goldberg89cyclecanceling.
24.376 +
24.377 +In general NetworkSimplex is the most efficient implementation,
24.378 +but in special cases other algorithms could be faster.
24.379 +For example, if the total supply and/or capacities are rather small,
24.380 +CapacityScaling is usually the fastest algorithm (without effective scaling).
24.381 */
24.382
24.383 /**
24.384 @@ -260,40 +428,117 @@
24.385
24.386 \brief Algorithms for finding minimum cut in graphs.
24.387
24.388 -This group describes the algorithms for finding minimum cut in graphs.
24.389 +This group contains the algorithms for finding minimum cut in graphs.
24.390
24.391 -The minimum cut problem is to find a non-empty and non-complete
24.392 -\f$X\f$ subset of the vertices with minimum overall capacity on
24.393 -outgoing arcs. Formally, there is \f$G=(V,A)\f$ directed graph, an
24.394 -\f$c_a:A\rightarrow\mathbf{R}^+_0\f$ capacity function. The minimum
24.395 +The \e minimum \e cut \e problem is to find a non-empty and non-complete
24.396 +\f$X\f$ subset of the nodes with minimum overall capacity on
24.397 +outgoing arcs. Formally, there is a \f$G=(V,A)\f$ digraph, a
24.398 +\f$cap: A\rightarrow\mathbf{R}^+_0\f$ capacity function. The minimum
24.399 cut is the \f$X\f$ solution of the next optimization problem:
24.400
24.401 \f[ \min_{X \subset V, X\not\in \{\emptyset, V\}}
24.402 -\sum_{uv\in A, u\in X, v\not\in X}c_{uv}\f]
24.403 + \sum_{uv\in A: u\in X, v\not\in X}cap(uv) \f]
24.404
24.405 LEMON contains several algorithms related to minimum cut problems:
24.406
24.407 -- \ref lemon::HaoOrlin "Hao-Orlin algorithm" to calculate minimum cut
24.408 - in directed graphs
24.409 -- \ref lemon::NagamochiIbaraki "Nagamochi-Ibaraki algorithm" to
24.410 - calculate minimum cut in undirected graphs
24.411 -- \ref lemon::GomoryHuTree "Gomory-Hu tree computation" to calculate all
24.412 - pairs minimum cut in undirected graphs
24.413 +- \ref HaoOrlin "Hao-Orlin algorithm" for calculating minimum cut
24.414 + in directed graphs.
24.415 +- \ref NagamochiIbaraki "Nagamochi-Ibaraki algorithm" for
24.416 + calculating minimum cut in undirected graphs.
24.417 +- \ref GomoryHu "Gomory-Hu tree computation" for calculating
24.418 + all-pairs minimum cut in undirected graphs.
24.419
24.420 If you want to find minimum cut just between two distinict nodes,
24.421 -please see the \ref max_flow "Maximum Flow page".
24.422 +see the \ref max_flow "maximum flow problem".
24.423 */
24.424
24.425 /**
24.426 -@defgroup graph_prop Connectivity and Other Graph Properties
24.427 +@defgroup min_mean_cycle Minimum Mean Cycle Algorithms
24.428 +@ingroup algs
24.429 +\brief Algorithms for finding minimum mean cycles.
24.430 +
24.431 +This group contains the algorithms for finding minimum mean cycles
24.432 +\ref clrs01algorithms, \ref amo93networkflows.
24.433 +
24.434 +The \e minimum \e mean \e cycle \e problem is to find a directed cycle
24.435 +of minimum mean length (cost) in a digraph.
24.436 +The mean length of a cycle is the average length of its arcs, i.e. the
24.437 +ratio between the total length of the cycle and the number of arcs on it.
24.438 +
24.439 +This problem has an important connection to \e conservative \e length
24.440 +\e functions, too. A length function on the arcs of a digraph is called
24.441 +conservative if and only if there is no directed cycle of negative total
24.442 +length. For an arbitrary length function, the negative of the minimum
24.443 +cycle mean is the smallest \f$\epsilon\f$ value so that increasing the
24.444 +arc lengths uniformly by \f$\epsilon\f$ results in a conservative length
24.445 +function.
24.446 +
24.447 +LEMON contains three algorithms for solving the minimum mean cycle problem:
24.448 +- \ref Karp "Karp"'s original algorithm \ref amo93networkflows,
24.449 + \ref dasdan98minmeancycle.
24.450 +- \ref HartmannOrlin "Hartmann-Orlin"'s algorithm, which is an improved
24.451 + version of Karp's algorithm \ref dasdan98minmeancycle.
24.452 +- \ref Howard "Howard"'s policy iteration algorithm
24.453 + \ref dasdan98minmeancycle.
24.454 +
24.455 +In practice, the Howard algorithm proved to be by far the most efficient
24.456 +one, though the best known theoretical bound on its running time is
24.457 +exponential.
24.458 +Both Karp and HartmannOrlin algorithms run in time O(ne) and use space
24.459 +O(n<sup>2</sup>+e), but the latter one is typically faster due to the
24.460 +applied early termination scheme.
24.461 +*/
24.462 +
24.463 +/**
24.464 +@defgroup matching Matching Algorithms
24.465 +@ingroup algs
24.466 +\brief Algorithms for finding matchings in graphs and bipartite graphs.
24.467 +
24.468 +This group contains the algorithms for calculating
24.469 +matchings in graphs and bipartite graphs. The general matching problem is
24.470 +finding a subset of the edges for which each node has at most one incident
24.471 +edge.
24.472 +
24.473 +There are several different algorithms for calculate matchings in
24.474 +graphs. The matching problems in bipartite graphs are generally
24.475 +easier than in general graphs. The goal of the matching optimization
24.476 +can be finding maximum cardinality, maximum weight or minimum cost
24.477 +matching. The search can be constrained to find perfect or
24.478 +maximum cardinality matching.
24.479 +
24.480 +The matching algorithms implemented in LEMON:
24.481 +- \ref MaxBipartiteMatching Hopcroft-Karp augmenting path algorithm
24.482 + for calculating maximum cardinality matching in bipartite graphs.
24.483 +- \ref PrBipartiteMatching Push-relabel algorithm
24.484 + for calculating maximum cardinality matching in bipartite graphs.
24.485 +- \ref MaxWeightedBipartiteMatching
24.486 + Successive shortest path algorithm for calculating maximum weighted
24.487 + matching and maximum weighted bipartite matching in bipartite graphs.
24.488 +- \ref MinCostMaxBipartiteMatching
24.489 + Successive shortest path algorithm for calculating minimum cost maximum
24.490 + matching in bipartite graphs.
24.491 +- \ref MaxMatching Edmond's blossom shrinking algorithm for calculating
24.492 + maximum cardinality matching in general graphs.
24.493 +- \ref MaxWeightedMatching Edmond's blossom shrinking algorithm for calculating
24.494 + maximum weighted matching in general graphs.
24.495 +- \ref MaxWeightedPerfectMatching
24.496 + Edmond's blossom shrinking algorithm for calculating maximum weighted
24.497 + perfect matching in general graphs.
24.498 +
24.499 +\image html bipartite_matching.png
24.500 +\image latex bipartite_matching.eps "Bipartite Matching" width=\textwidth
24.501 +*/
24.502 +
24.503 +/**
24.504 +@defgroup graph_properties Connectivity and Other Graph Properties
24.505 @ingroup algs
24.506 \brief Algorithms for discovering the graph properties
24.507
24.508 -This group describes the algorithms for discovering the graph properties
24.509 +This group contains the algorithms for discovering the graph properties
24.510 like connectivity, bipartiteness, euler property, simplicity etc.
24.511
24.512 -\image html edge_biconnected_components.png
24.513 -\image latex edge_biconnected_components.eps "bi-edge-connected components" width=\textwidth
24.514 +\image html connected_components.png
24.515 +\image latex connected_components.eps "Connected components" width=\textwidth
24.516 */
24.517
24.518 /**
24.519 @@ -301,7 +546,7 @@
24.520 @ingroup algs
24.521 \brief Algorithms for planarity checking, embedding and drawing
24.522
24.523 -This group describes the algorithms for planarity checking,
24.524 +This group contains the algorithms for planarity checking,
24.525 embedding and drawing.
24.526
24.527 \image html planar.png
24.528 @@ -309,53 +554,12 @@
24.529 */
24.530
24.531 /**
24.532 -@defgroup matching Matching Algorithms
24.533 +@defgroup approx Approximation Algorithms
24.534 @ingroup algs
24.535 -\brief Algorithms for finding matchings in graphs and bipartite graphs.
24.536 +\brief Approximation algorithms.
24.537
24.538 -This group contains algorithm objects and functions to calculate
24.539 -matchings in graphs and bipartite graphs. The general matching problem is
24.540 -finding a subset of the arcs which does not shares common endpoints.
24.541 -
24.542 -There are several different algorithms for calculate matchings in
24.543 -graphs. The matching problems in bipartite graphs are generally
24.544 -easier than in general graphs. The goal of the matching optimization
24.545 -can be the finding maximum cardinality, maximum weight or minimum cost
24.546 -matching. The search can be constrained to find perfect or
24.547 -maximum cardinality matching.
24.548 -
24.549 -LEMON contains the next algorithms:
24.550 -- \ref lemon::MaxBipartiteMatching "MaxBipartiteMatching" Hopcroft-Karp
24.551 - augmenting path algorithm for calculate maximum cardinality matching in
24.552 - bipartite graphs
24.553 -- \ref lemon::PrBipartiteMatching "PrBipartiteMatching" Push-Relabel
24.554 - algorithm for calculate maximum cardinality matching in bipartite graphs
24.555 -- \ref lemon::MaxWeightedBipartiteMatching "MaxWeightedBipartiteMatching"
24.556 - Successive shortest path algorithm for calculate maximum weighted matching
24.557 - and maximum weighted bipartite matching in bipartite graph
24.558 -- \ref lemon::MinCostMaxBipartiteMatching "MinCostMaxBipartiteMatching"
24.559 - Successive shortest path algorithm for calculate minimum cost maximum
24.560 - matching in bipartite graph
24.561 -- \ref lemon::MaxMatching "MaxMatching" Edmond's blossom shrinking algorithm
24.562 - for calculate maximum cardinality matching in general graph
24.563 -- \ref lemon::MaxWeightedMatching "MaxWeightedMatching" Edmond's blossom
24.564 - shrinking algorithm for calculate maximum weighted matching in general
24.565 - graph
24.566 -- \ref lemon::MaxWeightedPerfectMatching "MaxWeightedPerfectMatching"
24.567 - Edmond's blossom shrinking algorithm for calculate maximum weighted
24.568 - perfect matching in general graph
24.569 -
24.570 -\image html bipartite_matching.png
24.571 -\image latex bipartite_matching.eps "Bipartite Matching" width=\textwidth
24.572 -*/
24.573 -
24.574 -/**
24.575 -@defgroup spantree Minimum Spanning Tree Algorithms
24.576 -@ingroup algs
24.577 -\brief Algorithms for finding a minimum cost spanning tree in a graph.
24.578 -
24.579 -This group describes the algorithms for finding a minimum cost spanning
24.580 -tree in a graph
24.581 +This group contains the approximation and heuristic algorithms
24.582 +implemented in LEMON.
24.583 */
24.584
24.585 /**
24.586 @@ -363,36 +567,30 @@
24.587 @ingroup algs
24.588 \brief Auxiliary algorithms implemented in LEMON.
24.589
24.590 -This group describes some algorithms implemented in LEMON
24.591 +This group contains some algorithms implemented in LEMON
24.592 in order to make it easier to implement complex algorithms.
24.593 */
24.594
24.595 /**
24.596 -@defgroup approx Approximation Algorithms
24.597 -@ingroup algs
24.598 -\brief Approximation algorithms.
24.599 +@defgroup gen_opt_group General Optimization Tools
24.600 +\brief This group contains some general optimization frameworks
24.601 +implemented in LEMON.
24.602
24.603 -This group describes the approximation and heuristic algorithms
24.604 +This group contains some general optimization frameworks
24.605 implemented in LEMON.
24.606 */
24.607
24.608 /**
24.609 -@defgroup gen_opt_group General Optimization Tools
24.610 -\brief This group describes some general optimization frameworks
24.611 -implemented in LEMON.
24.612 +@defgroup lp_group LP and MIP Solvers
24.613 +@ingroup gen_opt_group
24.614 +\brief LP and MIP solver interfaces for LEMON.
24.615
24.616 -This group describes some general optimization frameworks
24.617 -implemented in LEMON.
24.618 -*/
24.619 +This group contains LP and MIP solver interfaces for LEMON.
24.620 +Various LP solvers could be used in the same manner with this
24.621 +high-level interface.
24.622
24.623 -/**
24.624 -@defgroup lp_group Lp and Mip Solvers
24.625 -@ingroup gen_opt_group
24.626 -\brief Lp and Mip solver interfaces for LEMON.
24.627 -
24.628 -This group describes Lp and Mip solver interfaces for LEMON. The
24.629 -various LP solvers could be used in the same manner with this
24.630 -interface.
24.631 +The currently supported solvers are \ref glpk, \ref clp, \ref cbc,
24.632 +\ref cplex, \ref soplex.
24.633 */
24.634
24.635 /**
24.636 @@ -409,7 +607,7 @@
24.637 @ingroup gen_opt_group
24.638 \brief Metaheuristics for LEMON library.
24.639
24.640 -This group describes some metaheuristic optimization tools.
24.641 +This group contains some metaheuristic optimization tools.
24.642 */
24.643
24.644 /**
24.645 @@ -424,7 +622,7 @@
24.646 @ingroup utils
24.647 \brief Simple basic graph utilities.
24.648
24.649 -This group describes some simple basic graph utilities.
24.650 +This group contains some simple basic graph utilities.
24.651 */
24.652
24.653 /**
24.654 @@ -432,7 +630,7 @@
24.655 @ingroup utils
24.656 \brief Tools for development, debugging and testing.
24.657
24.658 -This group describes several useful tools for development,
24.659 +This group contains several useful tools for development,
24.660 debugging and testing.
24.661 */
24.662
24.663 @@ -441,7 +639,7 @@
24.664 @ingroup misc
24.665 \brief Simple tools for measuring the performance of algorithms.
24.666
24.667 -This group describes simple tools for measuring the performance
24.668 +This group contains simple tools for measuring the performance
24.669 of algorithms.
24.670 */
24.671
24.672 @@ -450,25 +648,25 @@
24.673 @ingroup utils
24.674 \brief Exceptions defined in LEMON.
24.675
24.676 -This group describes the exceptions defined in LEMON.
24.677 +This group contains the exceptions defined in LEMON.
24.678 */
24.679
24.680 /**
24.681 @defgroup io_group Input-Output
24.682 \brief Graph Input-Output methods
24.683
24.684 -This group describes the tools for importing and exporting graphs
24.685 +This group contains the tools for importing and exporting graphs
24.686 and graph related data. Now it supports the \ref lgf-format
24.687 "LEMON Graph Format", the \c DIMACS format and the encapsulated
24.688 postscript (EPS) format.
24.689 */
24.690
24.691 /**
24.692 -@defgroup lemon_io LEMON Input-Output
24.693 +@defgroup lemon_io LEMON Graph Format
24.694 @ingroup io_group
24.695 \brief Reading and writing LEMON Graph Format.
24.696
24.697 -This group describes methods for reading and writing
24.698 +This group contains methods for reading and writing
24.699 \ref lgf-format "LEMON Graph Format".
24.700 */
24.701
24.702 @@ -477,15 +675,31 @@
24.703 @ingroup io_group
24.704 \brief General \c EPS drawer and graph exporter
24.705
24.706 -This group describes general \c EPS drawing methods and special
24.707 +This group contains general \c EPS drawing methods and special
24.708 graph exporting tools.
24.709 */
24.710
24.711 /**
24.712 +@defgroup dimacs_group DIMACS Format
24.713 +@ingroup io_group
24.714 +\brief Read and write files in DIMACS format
24.715 +
24.716 +Tools to read a digraph from or write it to a file in DIMACS format data.
24.717 +*/
24.718 +
24.719 +/**
24.720 +@defgroup nauty_group NAUTY Format
24.721 +@ingroup io_group
24.722 +\brief Read \e Nauty format
24.723 +
24.724 +Tool to read graphs from \e Nauty format data.
24.725 +*/
24.726 +
24.727 +/**
24.728 @defgroup concept Concepts
24.729 \brief Skeleton classes and concept checking classes
24.730
24.731 -This group describes the data/algorithm skeletons and concept checking
24.732 +This group contains the data/algorithm skeletons and concept checking
24.733 classes implemented in LEMON.
24.734
24.735 The purpose of the classes in this group is fourfold.
24.736 @@ -515,8 +729,8 @@
24.737 @ingroup concept
24.738 \brief Skeleton and concept checking classes for graph structures
24.739
24.740 -This group describes the skeletons and concept checking classes of LEMON's
24.741 -graph structures and helper classes used to implement these.
24.742 +This group contains the skeletons and concept checking classes of
24.743 +graph structures.
24.744 */
24.745
24.746 /**
24.747 @@ -524,23 +738,11 @@
24.748 @ingroup concept
24.749 \brief Skeleton and concept checking classes for maps
24.750
24.751 -This group describes the skeletons and concept checking classes of maps.
24.752 +This group contains the skeletons and concept checking classes of maps.
24.753 */
24.754
24.755 /**
24.756 -\anchor demoprograms
24.757 -
24.758 -@defgroup demos Demo programs
24.759 -
24.760 -Some demo programs are listed here. Their full source codes can be found in
24.761 -the \c demo subdirectory of the source tree.
24.762 -
24.763 -It order to compile them, use <tt>--enable-demo</tt> configure option when
24.764 -build the library.
24.765 -*/
24.766 -
24.767 -/**
24.768 -@defgroup tools Standalone utility applications
24.769 +@defgroup tools Standalone Utility Applications
24.770
24.771 Some utility applications are listed here.
24.772
24.773 @@ -548,3 +750,16 @@
24.774 them, as well.
24.775 */
24.776
24.777 +/**
24.778 +\anchor demoprograms
24.779 +
24.780 +@defgroup demos Demo Programs
24.781 +
24.782 +Some demo programs are listed here. Their full source codes can be found in
24.783 +the \c demo subdirectory of the source tree.
24.784 +
24.785 +In order to compile them, use the <tt>make demo</tt> or the
24.786 +<tt>make check</tt> commands.
24.787 +*/
24.788 +
24.789 +}
25.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
25.2 +++ b/doc/images/bipartite_matching.eps Thu Nov 05 15:50:01 2009 +0100
25.3 @@ -0,0 +1,586 @@
25.4 +%!PS-Adobe-3.0 EPSF-3.0
25.5 +%%BoundingBox: 15 18 829 570
25.6 +%%HiResBoundingBox: 15.1913 18.4493 828.078 569.438
25.7 +%%Creator: Karbon14 EPS Exportfilter 0.5
25.8 +%%CreationDate: (04/15/06 15:20:26)
25.9 +%%For: (Balazs Dezso) ()
25.10 +%%Title: ()
25.11 +
25.12 +/N {newpath} def
25.13 +/C {closepath} def
25.14 +/m {moveto} def
25.15 +/c {curveto} def
25.16 +/l {lineto} def
25.17 +/s {stroke} def
25.18 +/f {fill} def
25.19 +/w {setlinewidth} def
25.20 +/d {setdash} def
25.21 +/r {setrgbcolor} def
25.22 +/S {gsave} def
25.23 +/R {grestore} def
25.24 +
25.25 +N
25.26 +251.402 32.047 m
25.27 +532.945 293.946 814.484 555.844 814.484 555.844 c
25.28 +[] 0 d 1 0 0 r 3.92814 w s
25.29 +
25.30 +N
25.31 +749.012 32.047 m
25.32 +742.465 293.946 735.918 555.844 735.918 555.844 c
25.33 +[] 0 d 0 0 0 r 1.96407 w s
25.34 +
25.35 +N
25.36 +539.492 32.047 m
25.37 +637.703 293.946 735.918 555.844 735.918 555.844 c
25.38 +[] 0 d 0 0 0 r 1.96407 w s
25.39 +
25.40 +N
25.41 +172.832 32.047 m
25.42 +454.375 293.946 735.918 555.844 735.918 555.844 c
25.43 +[] 0 d 0 0 0 r 1.96407 w s
25.44 +
25.45 +N
25.46 +107.355 32.047 m
25.47 +421.637 293.946 735.918 555.844 735.918 555.844 c
25.48 +[] 0 d 1 0 0 r 3.92814 w s
25.49 +
25.50 +N
25.51 +644.25 555.844 m
25.52 +696.633 293.946 749.012 32.047 749.012 32.047 c
25.53 +[] 0 d 0 0 0 r 1.96407 w s
25.54 +
25.55 +N
25.56 +474.016 555.844 m
25.57 +611.516 293.946 749.012 32.047 749.012 32.047 c
25.58 +[] 0 d 1 0 0 r 3.92814 w s
25.59 +
25.60 +N
25.61 +683.535 32.047 m
25.62 +663.894 293.946 644.25 555.844 644.25 555.844 c
25.63 +[] 0 d 0 0 0 r 1.96407 w s
25.64 +
25.65 +N
25.66 +120.453 555.844 m
25.67 +401.992 293.946 683.535 32.047 683.535 32.047 c
25.68 +[] 0 d 0 0 0 r 1.96407 w s
25.69 +
25.70 +N
25.71 +28.7853 555.844 m
25.72 +356.16 293.946 683.535 32.047 683.535 32.047 c
25.73 +[] 0 d 1 0 0 r 3.92814 w s
25.74 +
25.75 +N
25.76 +539.492 32.047 m
25.77 +546.039 293.946 552.586 555.844 552.586 555.844 c
25.78 +[] 0 d 1 0 0 r 3.92814 w s
25.79 +
25.80 +N
25.81 +316.875 32.047 m
25.82 +349.613 293.946 382.351 555.844 382.351 555.844 c
25.83 +[] 0 d 1 0 0 r 3.92814 w s
25.84 +
25.85 +N
25.86 +107.355 32.047 m
25.87 +244.855 293.946 382.351 555.844 382.351 555.844 c
25.88 +[] 0 d 0 0 0 r 1.96407 w s
25.89 +
25.90 +N
25.91 +290.687 555.844 m
25.92 +375.805 293.946 460.922 32.047 460.922 32.047 c
25.93 +[] 0 d 1 0 0 r 3.92814 w s
25.94 +
25.95 +N
25.96 +120.453 555.844 m
25.97 +290.687 293.946 460.922 32.047 460.922 32.047 c
25.98 +[] 0 d 0 0 0 r 1.96407 w s
25.99 +
25.100 +N
25.101 +172.832 32.047 m
25.102 +146.64 293.946 120.453 555.844 120.453 555.844 c
25.103 +[] 0 d 1 0 0 r 3.92814 w s
25.104 +
25.105 +N
25.106 +15.6913 555.844 m
25.107 +15.6913 555.844 l
25.108 +15.6913 548.614 21.5553 542.75 28.7853 542.75 c
25.109 +36.0163 542.75 41.8833 548.614 41.8833 555.844 c
25.110 +41.8833 563.075 36.0163 568.938 28.7853 568.938 c
25.111 +21.5553 568.938 15.6913 563.075 15.6913 555.844 c
25.112 +15.6913 555.844 l
25.113 +C
25.114 +S 0 0 0 r f R
25.115 +
25.116 +N
25.117 +16.8833 555.844 m
25.118 +16.8833 555.844 l
25.119 +16.8833 549.27 22.2113 543.942 28.7853 543.942 c
25.120 +35.3593 543.942 40.6913 549.27 40.6913 555.844 c
25.121 +40.6913 562.418 35.3593 567.747 28.7853 567.747 c
25.122 +22.2113 567.747 16.8833 562.418 16.8833 555.844 c
25.123 +16.8833 555.844 l
25.124 +C
25.125 +S 1 0.5 1 r f R
25.126 +
25.127 +N
25.128 +107.355 555.844 m
25.129 +107.355 555.844 l
25.130 +107.355 548.614 113.223 542.75 120.453 542.75 c
25.131 +127.683 542.75 133.547 548.614 133.547 555.844 c
25.132 +133.547 563.075 127.683 568.938 120.453 568.938 c
25.133 +113.223 568.938 107.355 563.075 107.355 555.844 c
25.134 +107.355 555.844 l
25.135 +C
25.136 +S 0 0 0 r f R
25.137 +
25.138 +N
25.139 +108.547 555.844 m
25.140 +108.547 555.844 l
25.141 +108.547 549.27 113.879 543.942 120.453 543.942 c
25.142 +127.027 543.942 132.355 549.27 132.355 555.844 c
25.143 +132.355 562.418 127.027 567.747 120.453 567.747 c
25.144 +113.879 567.747 108.547 562.418 108.547 555.844 c
25.145 +108.547 555.844 l
25.146 +C
25.147 +S 1 0 1 r f R
25.148 +
25.149 +N
25.150 +199.019 555.844 m
25.151 +199.019 555.844 l
25.152 +199.019 548.614 204.887 542.75 212.117 542.75 c
25.153 +219.348 542.75 225.211 548.614 225.211 555.844 c
25.154 +225.211 563.075 219.348 568.938 212.117 568.938 c
25.155 +204.887 568.938 199.019 563.075 199.019 555.844 c
25.156 +199.019 555.844 l
25.157 +C
25.158 +S 0 0 0 r f R
25.159 +
25.160 +N
25.161 +200.211 555.844 m
25.162 +200.211 555.844 l
25.163 +200.211 549.27 205.543 543.942 212.117 543.942 c
25.164 +218.691 543.942 224.019 549.27 224.019 555.844 c
25.165 +224.019 562.418 218.691 567.747 212.117 567.747 c
25.166 +205.543 567.747 200.211 562.418 200.211 555.844 c
25.167 +200.211 555.844 l
25.168 +C
25.169 +S 1 0.5 1 r f R
25.170 +
25.171 +N
25.172 +277.59 555.844 m
25.173 +277.59 555.844 l
25.174 +277.59 548.614 283.457 542.75 290.687 542.75 c
25.175 +297.918 542.75 303.781 548.614 303.781 555.844 c
25.176 +303.781 563.075 297.918 568.938 290.687 568.938 c
25.177 +283.457 568.938 277.59 563.075 277.59 555.844 c
25.178 +277.59 555.844 l
25.179 +C
25.180 +S 0 0 0 r f R
25.181 +
25.182 +N
25.183 +278.781 555.844 m
25.184 +278.781 555.844 l
25.185 +278.781 549.27 284.113 543.942 290.687 543.942 c
25.186 +297.262 543.942 302.59 549.27 302.59 555.844 c
25.187 +302.59 562.418 297.262 567.747 290.687 567.747 c
25.188 +284.113 567.747 278.781 562.418 278.781 555.844 c
25.189 +278.781 555.844 l
25.190 +C
25.191 +S 1 0 1 r f R
25.192 +
25.193 +N
25.194 +369.258 555.844 m
25.195 +369.258 555.844 l
25.196 +369.258 548.614 375.121 542.75 382.351 542.75 c
25.197 +389.582 542.75 395.445 548.614 395.445 555.844 c
25.198 +395.445 563.075 389.582 568.938 382.351 568.938 c
25.199 +375.121 568.938 369.258 563.075 369.258 555.844 c
25.200 +369.258 555.844 l
25.201 +C
25.202 +S 0 0 0 r f R
25.203 +
25.204 +N
25.205 +370.445 555.844 m
25.206 +370.445 555.844 l
25.207 +370.445 549.27 375.777 543.942 382.351 543.942 c
25.208 +388.926 543.942 394.258 549.27 394.258 555.844 c
25.209 +394.258 562.418 388.926 567.747 382.351 567.747 c
25.210 +375.777 567.747 370.445 562.418 370.445 555.844 c
25.211 +370.445 555.844 l
25.212 +C
25.213 +S 1 0 1 r f R
25.214 +
25.215 +N
25.216 +460.922 555.844 m
25.217 +460.922 555.844 l
25.218 +460.922 548.614 466.785 542.75 474.016 542.75 c
25.219 +481.246 542.75 487.109 548.614 487.109 555.844 c
25.220 +487.109 563.075 481.246 568.938 474.016 568.938 c
25.221 +466.785 568.938 460.922 563.075 460.922 555.844 c
25.222 +460.922 555.844 l
25.223 +C
25.224 +S 0 0 0 r f R
25.225 +
25.226 +N
25.227 +462.113 555.844 m
25.228 +462.113 555.844 l
25.229 +462.113 549.27 467.441 543.942 474.016 543.942 c
25.230 +480.59 543.942 485.922 549.27 485.922 555.844 c
25.231 +485.922 562.418 480.59 567.747 474.016 567.747 c
25.232 +467.441 567.747 462.113 562.418 462.113 555.844 c
25.233 +462.113 555.844 l
25.234 +C
25.235 +S 1 0.5 1 r f R
25.236 +
25.237 +N
25.238 +539.492 555.844 m
25.239 +539.492 555.844 l
25.240 +539.492 548.614 545.355 542.75 552.586 542.75 c
25.241 +559.816 542.75 565.68 548.614 565.68 555.844 c
25.242 +565.68 563.075 559.816 568.938 552.586 568.938 c
25.243 +545.355 568.938 539.492 563.075 539.492 555.844 c
25.244 +539.492 555.844 l
25.245 +C
25.246 +S 0 0 0 r f R
25.247 +
25.248 +N
25.249 +540.683 555.844 m
25.250 +540.683 555.844 l
25.251 +540.683 549.27 546.012 543.942 552.586 543.942 c
25.252 +559.16 543.942 564.492 549.27 564.492 555.844 c
25.253 +564.492 562.418 559.16 567.747 552.586 567.747 c
25.254 +546.012 567.747 540.683 562.418 540.683 555.844 c
25.255 +540.683 555.844 l
25.256 +C
25.257 +S 1 0 1 r f R
25.258 +
25.259 +N
25.260 +631.156 555.844 m
25.261 +631.156 555.844 l
25.262 +631.156 548.614 637.019 542.75 644.25 542.75 c
25.263 +651.48 542.75 657.348 548.614 657.348 555.844 c
25.264 +657.348 563.075 651.48 568.938 644.25 568.938 c
25.265 +637.019 568.938 631.156 563.075 631.156 555.844 c
25.266 +631.156 555.844 l
25.267 +C
25.268 +S 0 0 0 r f R
25.269 +
25.270 +N
25.271 +632.348 555.844 m
25.272 +632.348 555.844 l
25.273 +632.348 549.27 637.676 543.942 644.25 543.942 c
25.274 +650.824 543.942 656.156 549.27 656.156 555.844 c
25.275 +656.156 562.418 650.824 567.747 644.25 567.747 c
25.276 +637.676 567.747 632.348 562.418 632.348 555.844 c
25.277 +632.348 555.844 l
25.278 +C
25.279 +S 1 0.5 1 r f R
25.280 +
25.281 +N
25.282 +722.82 555.844 m
25.283 +722.82 555.844 l
25.284 +722.82 548.614 728.687 542.75 735.918 542.75 c
25.285 +743.149 542.75 749.012 548.614 749.012 555.844 c
25.286 +749.012 563.075 743.149 568.938 735.918 568.938 c
25.287 +728.687 568.938 722.82 563.075 722.82 555.844 c
25.288 +722.82 555.844 l
25.289 +C
25.290 +S 0 0 0 r f R
25.291 +
25.292 +N
25.293 +724.012 555.844 m
25.294 +724.012 555.844 l
25.295 +724.012 549.27 729.344 543.942 735.918 543.942 c
25.296 +742.492 543.942 747.82 549.27 747.82 555.844 c
25.297 +747.82 562.418 742.492 567.747 735.918 567.747 c
25.298 +729.344 567.747 724.012 562.418 724.012 555.844 c
25.299 +724.012 555.844 l
25.300 +C
25.301 +S 1 0 1 r f R
25.302 +
25.303 +N
25.304 +801.391 555.844 m
25.305 +801.391 555.844 l
25.306 +801.391 548.614 807.254 542.75 814.484 542.75 c
25.307 +821.715 542.75 827.578 548.614 827.578 555.844 c
25.308 +827.578 563.075 821.715 568.938 814.484 568.938 c
25.309 +807.254 568.938 801.391 563.075 801.391 555.844 c
25.310 +801.391 555.844 l
25.311 +C
25.312 +S 0 0 0 r f R
25.313 +
25.314 +N
25.315 +802.582 555.844 m
25.316 +802.582 555.844 l
25.317 +802.582 549.27 807.91 543.942 814.484 543.942 c
25.318 +821.059 543.942 826.387 549.27 826.387 555.844 c
25.319 +826.387 562.418 821.059 567.747 814.484 567.747 c
25.320 +807.91 567.747 802.582 562.418 802.582 555.844 c
25.321 +802.582 555.844 l
25.322 +C
25.323 +S 1 0 1 r f R
25.324 +
25.325 +N
25.326 +15.6913 32.047 m
25.327 +15.6913 32.047 l
25.328 +15.6913 24.8165 21.5553 18.9493 28.7853 18.9493 c
25.329 +36.0163 18.9493 41.8833 24.8165 41.8833 32.047 c
25.330 +41.8833 39.2775 36.0163 45.1407 28.7853 45.1407 c
25.331 +21.5553 45.1407 15.6913 39.2775 15.6913 32.047 c
25.332 +15.6913 32.047 l
25.333 +C
25.334 +S 0 0 0 r f R
25.335 +
25.336 +N
25.337 +16.8833 32.047 m
25.338 +16.8833 32.047 l
25.339 +16.8833 25.4728 22.2113 20.1407 28.7853 20.1407 c
25.340 +35.3593 20.1407 40.6913 25.4728 40.6913 32.047 c
25.341 +40.6913 38.6212 35.3593 43.9493 28.7853 43.9493 c
25.342 +22.2113 43.9493 16.8833 38.6212 16.8833 32.047 c
25.343 +16.8833 32.047 l
25.344 +C
25.345 +S 0.5 0.5 1 r f R
25.346 +
25.347 +N
25.348 +94.2623 32.047 m
25.349 +94.2623 32.047 l
25.350 +94.2623 24.8165 100.125 18.9493 107.355 18.9493 c
25.351 +114.586 18.9493 120.453 24.8165 120.453 32.047 c
25.352 +120.453 39.2775 114.586 45.1407 107.355 45.1407 c
25.353 +100.125 45.1407 94.2623 39.2775 94.2623 32.047 c
25.354 +94.2623 32.047 l
25.355 +C
25.356 +S 0 0 0 r f R
25.357 +
25.358 +N
25.359 +95.4533 32.047 m
25.360 +95.4533 32.047 l
25.361 +95.4533 25.4728 100.781 20.1407 107.355 20.1407 c
25.362 +113.93 20.1407 119.262 25.4728 119.262 32.047 c
25.363 +119.262 38.6212 113.93 43.9493 107.355 43.9493 c
25.364 +100.781 43.9493 95.4533 38.6212 95.4533 32.047 c
25.365 +95.4533 32.047 l
25.366 +C
25.367 +S 0.5 0.5 1 r f R
25.368 +
25.369 +N
25.370 +159.734 32.047 m
25.371 +159.734 32.047 l
25.372 +159.734 24.8165 165.601 18.9493 172.832 18.9493 c
25.373 +180.062 18.9493 185.926 24.8165 185.926 32.047 c
25.374 +185.926 39.2775 180.062 45.1407 172.832 45.1407 c
25.375 +165.601 45.1407 159.734 39.2775 159.734 32.047 c
25.376 +159.734 32.047 l
25.377 +C
25.378 +S 0 0 0 r f R
25.379 +
25.380 +N
25.381 +160.926 32.047 m
25.382 +160.926 32.047 l
25.383 +160.926 25.4728 166.258 20.1407 172.832 20.1407 c
25.384 +179.406 20.1407 184.734 25.4728 184.734 32.047 c
25.385 +184.734 38.6212 179.406 43.9493 172.832 43.9493 c
25.386 +166.258 43.9493 160.926 38.6212 160.926 32.047 c
25.387 +160.926 32.047 l
25.388 +C
25.389 +S 0.5 0.5 1 r f R
25.390 +
25.391 +N
25.392 +238.305 32.047 m
25.393 +238.305 32.047 l
25.394 +238.305 24.8165 244.172 18.9493 251.402 18.9493 c
25.395 +258.633 18.9493 264.496 24.8165 264.496 32.047 c
25.396 +264.496 39.2775 258.633 45.1407 251.402 45.1407 c
25.397 +244.172 45.1407 238.305 39.2775 238.305 32.047 c
25.398 +238.305 32.047 l
25.399 +C
25.400 +S 0 0 0 r f R
25.401 +
25.402 +N
25.403 +239.496 32.047 m
25.404 +239.496 32.047 l
25.405 +239.496 25.4728 244.828 20.1407 251.402 20.1407 c
25.406 +257.976 20.1407 263.305 25.4728 263.305 32.047 c
25.407 +263.305 38.6212 257.976 43.9493 251.402 43.9493 c
25.408 +244.828 43.9493 239.496 38.6212 239.496 32.047 c
25.409 +239.496 32.047 l
25.410 +C
25.411 +S 0.5 0.5 1 r f R
25.412 +
25.413 +N
25.414 +303.781 32.047 m
25.415 +303.781 32.047 l
25.416 +303.781 24.8165 309.644 18.9493 316.875 18.9493 c
25.417 +324.105 18.9493 329.973 24.8165 329.973 32.047 c
25.418 +329.973 39.2775 324.105 45.1407 316.875 45.1407 c
25.419 +309.644 45.1407 303.781 39.2775 303.781 32.047 c
25.420 +303.781 32.047 l
25.421 +C
25.422 +S 0 0 0 r f R
25.423 +
25.424 +N
25.425 +304.973 32.047 m
25.426 +304.973 32.047 l
25.427 +304.973 25.4728 310.301 20.1407 316.875 20.1407 c
25.428 +323.449 20.1407 328.781 25.4728 328.781 32.047 c
25.429 +328.781 38.6212 323.449 43.9493 316.875 43.9493 c
25.430 +310.301 43.9493 304.973 38.6212 304.973 32.047 c
25.431 +304.973 32.047 l
25.432 +C
25.433 +S 0.5 0.5 1 r f R
25.434 +
25.435 +N
25.436 +382.351 32.047 m
25.437 +382.351 32.047 l
25.438 +382.351 24.8165 388.215 18.9493 395.445 18.9493 c
25.439 +402.676 18.9493 408.543 24.8165 408.543 32.047 c
25.440 +408.543 39.2775 402.676 45.1407 395.445 45.1407 c
25.441 +388.215 45.1407 382.351 39.2775 382.351 32.047 c
25.442 +382.351 32.047 l
25.443 +C
25.444 +S 0 0 0 r f R
25.445 +
25.446 +N
25.447 +383.543 32.047 m
25.448 +383.543 32.047 l
25.449 +383.543 25.4728 388.871 20.1407 395.445 20.1407 c
25.450 +402.019 20.1407 407.351 25.4728 407.351 32.047 c
25.451 +407.351 38.6212 402.019 43.9493 395.445 43.9493 c
25.452 +388.871 43.9493 383.543 38.6212 383.543 32.047 c
25.453 +383.543 32.047 l
25.454 +C
25.455 +S 0.5 0.5 1 r f R
25.456 +
25.457 +N
25.458 +447.828 32.047 m
25.459 +447.828 32.047 l
25.460 +447.828 24.8165 453.691 18.9493 460.922 18.9493 c
25.461 +468.152 18.9493 474.016 24.8165 474.016 32.047 c
25.462 +474.016 39.2775 468.152 45.1407 460.922 45.1407 c
25.463 +453.691 45.1407 447.828 39.2775 447.828 32.047 c
25.464 +447.828 32.047 l
25.465 +C
25.466 +S 0 0 0 r f R
25.467 +
25.468 +N
25.469 +449.016 32.047 m
25.470 +449.016 32.047 l
25.471 +449.016 25.4728 454.348 20.1407 460.922 20.1407 c
25.472 +467.496 20.1407 472.824 25.4728 472.824 32.047 c
25.473 +472.824 38.6212 467.496 43.9493 460.922 43.9493 c
25.474 +454.348 43.9493 449.016 38.6212 449.016 32.047 c
25.475 +449.016 32.047 l
25.476 +C
25.477 +S 0.5 0.5 1 r f R
25.478 +
25.479 +N
25.480 +526.394 32.047 m
25.481 +526.394 32.047 l
25.482 +526.394 24.8165 532.262 18.9493 539.492 18.9493 c
25.483 +546.723 18.9493 552.586 24.8165 552.586 32.047 c
25.484 +552.586 39.2775 546.723 45.1407 539.492 45.1407 c
25.485 +532.262 45.1407 526.394 39.2775 526.394 32.047 c
25.486 +526.394 32.047 l
25.487 +C
25.488 +S 0 0 0 r f R
25.489 +
25.490 +N
25.491 +527.586 32.047 m
25.492 +527.586 32.047 l
25.493 +527.586 25.4728 532.918 20.1407 539.492 20.1407 c
25.494 +546.066 20.1407 551.394 25.4728 551.394 32.047 c
25.495 +551.394 38.6212 546.066 43.9493 539.492 43.9493 c
25.496 +532.918 43.9493 527.586 38.6212 527.586 32.047 c
25.497 +527.586 32.047 l
25.498 +C
25.499 +S 0.5 0.5 1 r f R
25.500 +
25.501 +N
25.502 +591.871 32.047 m
25.503 +591.871 32.047 l
25.504 +591.871 24.8165 597.734 18.9493 604.965 18.9493 c
25.505 +612.195 18.9493 618.062 24.8165 618.062 32.047 c
25.506 +618.062 39.2775 612.195 45.1407 604.965 45.1407 c
25.507 +597.734 45.1407 591.871 39.2775 591.871 32.047 c
25.508 +591.871 32.047 l
25.509 +C
25.510 +S 0 0 0 r f R
25.511 +
25.512 +N
25.513 +593.062 32.047 m
25.514 +593.062 32.047 l
25.515 +593.062 25.4728 598.39 20.1407 604.965 20.1407 c
25.516 +611.539 20.1407 616.871 25.4728 616.871 32.047 c
25.517 +616.871 38.6212 611.539 43.9493 604.965 43.9493 c
25.518 +598.39 43.9493 593.062 38.6212 593.062 32.047 c
25.519 +593.062 32.047 l
25.520 +C
25.521 +S 0.5 0.5 1 r f R
25.522 +
25.523 +N
25.524 +670.441 32.047 m
25.525 +670.441 32.047 l
25.526 +670.441 24.8165 676.305 18.9493 683.535 18.9493 c
25.527 +690.766 18.9493 696.633 24.8165 696.633 32.047 c
25.528 +696.633 39.2775 690.766 45.1407 683.535 45.1407 c
25.529 +676.305 45.1407 670.441 39.2775 670.441 32.047 c
25.530 +670.441 32.047 l
25.531 +C
25.532 +S 0 0 0 r f R
25.533 +
25.534 +N
25.535 +671.633 32.047 m
25.536 +671.633 32.047 l
25.537 +671.633 25.4728 676.961 20.1407 683.535 20.1407 c
25.538 +690.109 20.1407 695.441 25.4728 695.441 32.047 c
25.539 +695.441 38.6212 690.109 43.9493 683.535 43.9493 c
25.540 +676.961 43.9493 671.633 38.6212 671.633 32.047 c
25.541 +671.633 32.047 l
25.542 +C
25.543 +S 0 0 1 r f R
25.544 +
25.545 +N
25.546 +735.918 32.047 m
25.547 +735.918 32.047 l
25.548 +735.918 24.8165 741.781 18.9493 749.012 18.9493 c
25.549 +756.242 18.9493 762.106 24.8165 762.106 32.047 c
25.550 +762.106 39.2775 756.242 45.1407 749.012 45.1407 c
25.551 +741.781 45.1407 735.918 39.2775 735.918 32.047 c
25.552 +735.918 32.047 l
25.553 +C
25.554 +S 0 0 0 r f R
25.555 +
25.556 +N
25.557 +737.105 32.047 m
25.558 +737.105 32.047 l
25.559 +737.105 25.4728 742.437 20.1407 749.012 20.1407 c
25.560 +755.586 20.1407 760.914 25.4728 760.914 32.047 c
25.561 +760.914 38.6212 755.586 43.9493 749.012 43.9493 c
25.562 +742.437 43.9493 737.105 38.6212 737.105 32.047 c
25.563 +737.105 32.047 l
25.564 +C
25.565 +S 0 0 1 r f R
25.566 +
25.567 +N
25.568 +801.391 32.047 m
25.569 +801.391 32.047 l
25.570 +801.391 24.8165 807.254 18.9493 814.484 18.9493 c
25.571 +821.715 18.9493 827.578 24.8165 827.578 32.047 c
25.572 +827.578 39.2775 821.715 45.1407 814.484 45.1407 c
25.573 +807.254 45.1407 801.391 39.2775 801.391 32.047 c
25.574 +801.391 32.047 l
25.575 +C
25.576 +S 0 0 0 r f R
25.577 +
25.578 +N
25.579 +802.582 32.047 m
25.580 +802.582 32.047 l
25.581 +802.582 25.4728 807.91 20.1407 814.484 20.1407 c
25.582 +821.059 20.1407 826.387 25.4728 826.387 32.047 c
25.583 +826.387 38.6212 821.059 43.9493 814.484 43.9493 c
25.584 +807.91 43.9493 802.582 38.6212 802.582 32.047 c
25.585 +802.582 32.047 l
25.586 +C
25.587 +S 0.5 0.5 1 r f R
25.588 +
25.589 +%%EOF
26.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
26.2 +++ b/doc/images/bipartite_partitions.eps Thu Nov 05 15:50:01 2009 +0100
26.3 @@ -0,0 +1,114 @@
26.4 +%!PS-Adobe-2.0 EPSF-2.0
26.5 +%%Creator: LEMON, graphToEps()
26.6 +%%CreationDate: Tue Nov 15 16:51:43 2005
26.7 +%%BoundingBox: 0 0 842 596
26.8 +%%EndComments
26.9 +/lb { setlinewidth setrgbcolor newpath moveto
26.10 + 4 2 roll 1 index 1 index curveto stroke } bind def
26.11 +/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
26.12 +/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
26.13 +/sq { newpath 2 index 1 index add 2 index 2 index add moveto
26.14 + 2 index 1 index sub 2 index 2 index add lineto
26.15 + 2 index 1 index sub 2 index 2 index sub lineto
26.16 + 2 index 1 index add 2 index 2 index sub lineto
26.17 + closepath pop pop pop} bind def
26.18 +/di { newpath 2 index 1 index add 2 index moveto
26.19 + 2 index 2 index 2 index add lineto
26.20 + 2 index 1 index sub 2 index lineto
26.21 + 2 index 2 index 2 index sub lineto
26.22 + closepath pop pop pop} bind def
26.23 +/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
26.24 + setrgbcolor 1.1 div c fill
26.25 + } bind def
26.26 +/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
26.27 + setrgbcolor 1.1 div sq fill
26.28 + } bind def
26.29 +/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
26.30 + setrgbcolor 1.1 div di fill
26.31 + } bind def
26.32 +/arrl 1 def
26.33 +/arrw 0.3 def
26.34 +/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
26.35 +/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
26.36 + /w exch def /len exch def
26.37 + newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto
26.38 + len w sub arrl sub dx dy lrl
26.39 + arrw dy dx neg lrl
26.40 + dx arrl w add mul dy w 2 div arrw add mul sub
26.41 + dy arrl w add mul dx w 2 div arrw add mul add rlineto
26.42 + dx arrl w add mul neg dy w 2 div arrw add mul sub
26.43 + dy arrl w add mul neg dx w 2 div arrw add mul add rlineto
26.44 + arrw dy dx neg lrl
26.45 + len w sub arrl sub neg dx dy lrl
26.46 + closepath fill } bind def
26.47 +/cshow { 2 index 2 index moveto dup stringwidth pop
26.48 + neg 2 div fosi .35 mul neg rmoveto show pop pop} def
26.49 +
26.50 +gsave
26.51 +90 rotate
26.52 +0 -842 translate
26.53 +71.6378 15 translate
26.54 +0.389093 dup scale
26.55 +90 rotate
26.56 +1197.47 -613.138 translate
26.57 +%Edges:
26.58 +gsave
26.59 +513.857 -446.322 296.569 -487.43 79.2808 -528.539 0 0 0 2 lb
26.60 +513.857 -446.322 575.52 -315.655 637.183 -184.989 0 0 0 2 lb
26.61 +393.468 566.711 494.771 434.577 596.074 302.442 0 0 0 2 lb
26.62 +393.468 566.711 155.625 579.925 -82.2171 593.138 0 0 0 2 lb
26.63 +393.468 566.711 251.056 450.726 108.644 334.741 0 0 0 2 lb
26.64 +869.153 52.8539 732.613 177.648 596.074 302.442 0 0 0 2 lb
26.65 +869.153 52.8539 753.168 -66.0676 637.183 -184.989 0 0 0 2 lb
26.66 +-82.2171 593.138 -91.0261 346.487 -99.8351 99.8351 0 0 0 2 lb
26.67 +-663.61 546.157 -753.168 394.936 -842.726 243.715 0 0 0 2 lb
26.68 +-663.61 546.157 -574.052 437.513 -484.494 328.869 0 0 0 2 lb
26.69 +-1077.63 161.498 -960.178 202.606 -842.726 243.715 0 0 0 2 lb
26.70 +-1077.63 161.498 -968.987 66.0674 -860.344 -29.3633 0 0 0 2 lb
26.71 +-1177.47 -234.906 -1029.18 -381.722 -880.898 -528.539 0 0 0 2 lb
26.72 +-1177.47 -234.906 -1018.91 -132.135 -860.344 -29.3633 0 0 0 2 lb
26.73 +-880.898 -528.539 -744.359 -387.595 -607.82 -246.651 0 0 0 2 lb
26.74 +-499.175 -499.175 -355.295 -475.685 -211.415 -452.194 0 0 0 2 lb
26.75 +-499.175 -499.175 -553.498 -372.913 -607.82 -246.651 0 0 0 2 lb
26.76 +-499.175 -499.175 -386.587 -315.087 -274 -131 0 0 0 2 lb
26.77 +79.2808 -528.539 -66.0671 -490.366 -211.415 -452.194 0 0 0 2 lb
26.78 +637.183 -184.989 421.363 -253.993 205.543 -322.996 0 0 0 2 lb
26.79 +205.543 -322.996 162.966 -226.097 120.389 -129.198 0 0 0 2 lb
26.80 +399.34 88.0898 259.865 -20.5541 120.389 -129.198 0 0 0 2 lb
26.81 +399.34 88.0898 253.992 211.415 108.644 334.741 0 0 0 2 lb
26.82 +-842.726 243.715 -471.281 171.775 -99.8351 99.8351 0 0 0 2 lb
26.83 +-842.726 243.715 -558.363 56.3575 -274 -131 0 0 0 2 lb
26.84 +-860.344 -29.3633 -734.082 -138.007 -607.82 -246.651 0 0 0 2 lb
26.85 +-211.415 -452.194 -45.513 -290.696 120.389 -129.198 0 0 0 2 lb
26.86 +-99.8351 99.8351 4.40445 217.288 108.644 334.741 0 0 0 2 lb
26.87 +-99.8351 99.8351 -292.165 214.352 -484.494 328.869 0 0 0 2 lb
26.88 +120.389 -129.198 -76.8055 -130.099 -274 -131 0 0 0 2 lb
26.89 +grestore
26.90 +%Nodes:
26.91 +gsave
26.92 +-274 -131 20 1 0 0 nc
26.93 +-607.82 -246.651 20 1 0 0 nc
26.94 +-484.494 328.869 20 0 0 1 nc
26.95 +108.644 334.741 20 0 0 1 nc
26.96 +120.389 -129.198 20 0 0 1 nc
26.97 +-99.8351 99.8351 20 1 0 0 nc
26.98 +-211.415 -452.194 20 1 0 0 nc
26.99 +-860.344 -29.3633 20 0 0 1 nc
26.100 +-842.726 243.715 20 0 0 1 nc
26.101 +399.34 88.0898 20 1 0 0 nc
26.102 +205.543 -322.996 20 1 0 0 nc
26.103 +637.183 -184.989 20 0 0 1 nc
26.104 +79.2808 -528.539 20 0 0 1 nc
26.105 +-499.175 -499.175 20 0 0 1 nc
26.106 +-880.898 -528.539 20 0 0 1 nc
26.107 +-1177.47 -234.906 20 1 0 0 nc
26.108 +-1077.63 161.498 20 1 0 0 nc
26.109 +-663.61 546.157 20 1 0 0 nc
26.110 +-82.2171 593.138 20 0 0 1 nc
26.111 +596.074 302.442 20 0 0 1 nc
26.112 +869.153 52.8539 20 1 0 0 nc
26.113 +393.468 566.711 20 1 0 0 nc
26.114 +513.857 -446.322 20 1 0 0 nc
26.115 +grestore
26.116 +grestore
26.117 +showpage
27.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
27.2 +++ b/doc/images/connected_components.eps Thu Nov 05 15:50:01 2009 +0100
27.3 @@ -0,0 +1,159 @@
27.4 +%!PS-Adobe-2.0 EPSF-2.0
27.5 +%%Creator: LEMON, graphToEps()
27.6 +%%CreationDate: Fri Nov 4 13:47:12 2005
27.7 +%%BoundingBox: 0 0 842 596
27.8 +%%EndComments
27.9 +/lb { setlinewidth setrgbcolor newpath moveto
27.10 + 4 2 roll 1 index 1 index curveto stroke } bind def
27.11 +/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
27.12 +/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
27.13 +/sq { newpath 2 index 1 index add 2 index 2 index add moveto
27.14 + 2 index 1 index sub 2 index 2 index add lineto
27.15 + 2 index 1 index sub 2 index 2 index sub lineto
27.16 + 2 index 1 index add 2 index 2 index sub lineto
27.17 + closepath pop pop pop} bind def
27.18 +/di { newpath 2 index 1 index add 2 index moveto
27.19 + 2 index 2 index 2 index add lineto
27.20 + 2 index 1 index sub 2 index lineto
27.21 + 2 index 2 index 2 index sub lineto
27.22 + closepath pop pop pop} bind def
27.23 +/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
27.24 + setrgbcolor 1.1 div c fill
27.25 + } bind def
27.26 +/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
27.27 + setrgbcolor 1.1 div sq fill
27.28 + } bind def
27.29 +/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
27.30 + setrgbcolor 1.1 div di fill
27.31 + } bind def
27.32 +/arrl 1 def
27.33 +/arrw 0.3 def
27.34 +/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
27.35 +/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
27.36 + /w exch def /len exch def
27.37 + newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto
27.38 + len w sub arrl sub dx dy lrl
27.39 + arrw dy dx neg lrl
27.40 + dx arrl w add mul dy w 2 div arrw add mul sub
27.41 + dy arrl w add mul dx w 2 div arrw add mul add rlineto
27.42 + dx arrl w add mul neg dy w 2 div arrw add mul sub
27.43 + dy arrl w add mul neg dx w 2 div arrw add mul add rlineto
27.44 + arrw dy dx neg lrl
27.45 + len w sub arrl sub neg dx dy lrl
27.46 + closepath fill } bind def
27.47 +/cshow { 2 index 2 index moveto dup stringwidth pop
27.48 + neg 2 div fosi .35 mul neg rmoveto show pop pop} def
27.49 +
27.50 +gsave
27.51 +90 rotate
27.52 +0 -842 translate
27.53 +71.0944 15 translate
27.54 +0.434694 dup scale
27.55 +90 rotate
27.56 +860.856 -588.349 translate
27.57 +%Edges:
27.58 +gsave
27.59 +574.035 177.301 622.149 225.748 670.264 274.195 0 0 0 2 lb
27.60 +694.579 115.483 682.421 194.839 670.264 274.195 0 0 0 2 lb
27.61 +280.402 10.3938 246.402 -6.60595 212.403 -23.6057 0 0 0 2 lb
27.62 +280.402 10.3938 283.493 -18.9695 286.584 -48.3327 0 0 0 2 lb
27.63 +212.403 -23.6057 249.493 -35.9692 286.584 -48.3327 0 0 0 2 lb
27.64 +286.584 -48.3327 326.765 -79.2414 366.947 -110.15 0 0 0 2 lb
27.65 +286.584 -48.3327 278.857 -111.695 271.13 -175.058 0 0 0 2 lb
27.66 +438.037 -88.514 417.946 -142.604 397.855 -196.694 0 0 0 2 lb
27.67 +438.037 -88.514 402.492 -99.332 366.947 -110.15 0 0 0 2 lb
27.68 +397.855 -196.694 382.401 -153.422 366.947 -110.15 0 0 0 2 lb
27.69 +366.947 -110.15 319.038 -142.604 271.13 -175.058 0 0 0 2 lb
27.70 +271.13 -175.058 274.221 -213.694 277.311 -252.33 0 0 0 2 lb
27.71 +271.13 -175.058 238.675 -190.512 206.221 -205.967 0 0 0 2 lb
27.72 +277.311 -252.33 241.766 -229.149 206.221 -205.967 0 0 0 2 lb
27.73 +-840.856 -246.718 -804.351 -66.7145 -767.847 113.289 0 0 0 2 lb
27.74 +-579.033 445.603 -673.44 279.446 -767.847 113.289 0 0 0 2 lb
27.75 +-579.033 445.603 -524.906 302.104 -470.779 158.605 0 0 0 2 lb
27.76 +-767.847 113.289 -619.313 135.947 -470.779 158.605 0 0 0 2 lb
27.77 +906.312 201.403 946.592 42.798 986.873 -115.807 0 0 0 2 lb
27.78 +906.312 201.403 834.562 91.8901 762.812 -17.6227 0 0 0 2 lb
27.79 +986.873 -115.807 874.842 -66.7148 762.812 -17.6227 0 0 0 2 lb
27.80 +-470.779 158.605 -390.218 50.3508 -309.657 -57.9033 0 0 0 2 lb
27.81 +422.945 521.129 208.955 541.269 -5.03507 561.41 0 0 0 2 lb
27.82 +422.945 521.129 376.371 417.911 329.797 314.692 0 0 0 2 lb
27.83 +422.945 521.129 474.554 276.928 526.164 32.7279 0 0 0 2 lb
27.84 +-5.03507 561.41 -36.5042 440.568 -67.9734 319.727 0 0 0 2 lb
27.85 +329.797 314.692 130.912 317.209 -67.9734 319.727 0 0 0 2 lb
27.86 +-67.9734 319.727 229.095 176.227 526.164 32.7279 0 0 0 2 lb
27.87 +762.812 -17.6227 644.488 7.5526 526.164 32.7279 0 0 0 2 lb
27.88 +762.812 -17.6227 746.448 -162.381 730.084 -307.139 0 0 0 2 lb
27.89 +526.164 32.7279 470.779 -128.394 415.393 -289.516 0 0 0 2 lb
27.90 +730.084 -307.139 572.738 -298.327 415.393 -289.516 0 0 0 2 lb
27.91 +415.393 -289.516 173.71 -318.468 -67.9734 -347.42 0 0 0 2 lb
27.92 +-67.9734 -347.42 -188.815 -202.662 -309.657 -57.9033 0 0 0 2 lb
27.93 +-67.9734 -347.42 -195.758 -390.692 -323.543 -433.964 0 0 0 2 lb
27.94 +-309.657 -57.9033 -424.775 -160.272 -539.894 -262.64 0 0 0 2 lb
27.95 +-323.543 -433.964 -431.719 -348.302 -539.894 -262.64 0 0 0 2 lb
27.96 +-26.6953 -19.9585 44.8558 -96.8093 116.407 -173.66 0 0 0 2 lb
27.97 +-26.6953 -19.9585 87.2563 9.19185 201.208 38.3422 0 0 0 2 lb
27.98 +-26.6953 -19.9585 -144.622 43.6422 -262.548 107.243 0 0 0 2 lb
27.99 +-26.6953 -19.9585 -20.0703 56.8923 -13.4452 133.743 0 0 0 2 lb
27.100 +116.407 -173.66 158.808 -67.6589 201.208 38.3422 0 0 0 2 lb
27.101 +-262.548 107.243 -137.997 120.493 -13.4452 133.743 0 0 0 2 lb
27.102 +-262.548 107.243 -221.472 176.144 -180.397 245.045 0 0 0 2 lb
27.103 +-13.4452 133.743 -96.9211 189.394 -180.397 245.045 0 0 0 2 lb
27.104 +-180.397 245.045 -142.256 345.099 -132.697 451.748 0 0 0 2 lb
27.105 +-180.397 245.045 -170.838 351.694 -132.697 451.748 0 0 0 2 lb
27.106 +-416.25 345.746 -274.474 398.747 -132.697 451.748 0 0 0 2 lb
27.107 +-416.25 345.746 -393.725 457.048 -371.2 568.349 0 0 0 2 lb
27.108 +-132.697 451.748 -251.948 510.048 -371.2 568.349 0 0 0 2 lb
27.109 +670.264 274.195 629.188 409.347 588.113 544.499 0 0 0 2 lb
27.110 +670.264 274.195 797.466 341.771 924.667 409.347 0 0 0 2 lb
27.111 +588.113 544.499 756.39 476.923 924.667 409.347 0 0 0 2 lb
27.112 +-689.204 -237.261 -614.799 -102.648 -567.302 43.6423 0 0 0 2 lb
27.113 +-689.204 -237.261 -641.707 -90.9706 -567.302 43.6423 0 0 0 2 lb
27.114 +grestore
27.115 +%Nodes:
27.116 +gsave
27.117 +-567.302 43.6423 20 0 0 0 nc
27.118 +-689.204 -237.261 20 0 0 0 nc
27.119 +924.667 409.347 20 1 0 0 nc
27.120 +588.113 544.499 20 1 0 0 nc
27.121 +670.264 274.195 20 1 0 0 nc
27.122 +-371.2 568.349 20 0 1 0 nc
27.123 +-132.697 451.748 20 0 1 0 nc
27.124 +-416.25 345.746 20 0 1 0 nc
27.125 +-180.397 245.045 20 0 1 0 nc
27.126 +-13.4452 133.743 20 0 1 0 nc
27.127 +-262.548 107.243 20 0 1 0 nc
27.128 +201.208 38.3422 20 0 1 0 nc
27.129 +116.407 -173.66 20 0 1 0 nc
27.130 +-26.6953 -19.9585 20 0 1 0 nc
27.131 +-539.894 -262.64 20 0 0 1 nc
27.132 +-323.543 -433.964 20 0 0 1 nc
27.133 +-309.657 -57.9033 20 0 0 1 nc
27.134 +-67.9734 -347.42 20 0 0 1 nc
27.135 +415.393 -289.516 20 0 0 1 nc
27.136 +730.084 -307.139 20 0 0 1 nc
27.137 +526.164 32.7279 20 0 0 1 nc
27.138 +762.812 -17.6227 20 0 0 1 nc
27.139 +-67.9734 319.727 20 0 0 1 nc
27.140 +329.797 314.692 20 0 0 1 nc
27.141 +-5.03507 561.41 20 0 0 1 nc
27.142 +422.945 521.129 20 0 0 1 nc
27.143 +-470.779 158.605 20 0 0 1 nc
27.144 +986.873 -115.807 20 0 0 1 nc
27.145 +906.312 201.403 20 0 0 1 nc
27.146 +-767.847 113.289 20 0 0 1 nc
27.147 +-579.033 445.603 20 0 0 1 nc
27.148 +-840.856 -246.718 20 0 0 1 nc
27.149 +206.221 -205.967 20 1 1 0 nc
27.150 +277.311 -252.33 20 1 1 0 nc
27.151 +271.13 -175.058 20 1 1 0 nc
27.152 +366.947 -110.15 20 1 1 0 nc
27.153 +397.855 -196.694 20 1 1 0 nc
27.154 +438.037 -88.514 20 1 1 0 nc
27.155 +286.584 -48.3327 20 1 1 0 nc
27.156 +212.403 -23.6057 20 1 1 0 nc
27.157 +280.402 10.3938 20 1 1 0 nc
27.158 +694.579 115.483 20 1 0 0 nc
27.159 +574.035 177.301 20 1 0 0 nc
27.160 +grestore
27.161 +grestore
27.162 +showpage
28.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
28.2 +++ b/doc/images/edge_biconnected_components.eps Thu Nov 05 15:50:01 2009 +0100
28.3 @@ -0,0 +1,159 @@
28.4 +%!PS-Adobe-2.0 EPSF-2.0
28.5 +%%Creator: LEMON, graphToEps()
28.6 +%%CreationDate: Fri Nov 4 13:47:12 2005
28.7 +%%BoundingBox: 0 0 842 596
28.8 +%%EndComments
28.9 +/lb { setlinewidth setrgbcolor newpath moveto
28.10 + 4 2 roll 1 index 1 index curveto stroke } bind def
28.11 +/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
28.12 +/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
28.13 +/sq { newpath 2 index 1 index add 2 index 2 index add moveto
28.14 + 2 index 1 index sub 2 index 2 index add lineto
28.15 + 2 index 1 index sub 2 index 2 index sub lineto
28.16 + 2 index 1 index add 2 index 2 index sub lineto
28.17 + closepath pop pop pop} bind def
28.18 +/di { newpath 2 index 1 index add 2 index moveto
28.19 + 2 index 2 index 2 index add lineto
28.20 + 2 index 1 index sub 2 index lineto
28.21 + 2 index 2 index 2 index sub lineto
28.22 + closepath pop pop pop} bind def
28.23 +/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
28.24 + setrgbcolor 1.1 div c fill
28.25 + } bind def
28.26 +/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
28.27 + setrgbcolor 1.1 div sq fill
28.28 + } bind def
28.29 +/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
28.30 + setrgbcolor 1.1 div di fill
28.31 + } bind def
28.32 +/arrl 1 def
28.33 +/arrw 0.3 def
28.34 +/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
28.35 +/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
28.36 + /w exch def /len exch def
28.37 + newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto
28.38 + len w sub arrl sub dx dy lrl
28.39 + arrw dy dx neg lrl
28.40 + dx arrl w add mul dy w 2 div arrw add mul sub
28.41 + dy arrl w add mul dx w 2 div arrw add mul add rlineto
28.42 + dx arrl w add mul neg dy w 2 div arrw add mul sub
28.43 + dy arrl w add mul neg dx w 2 div arrw add mul add rlineto
28.44 + arrw dy dx neg lrl
28.45 + len w sub arrl sub neg dx dy lrl
28.46 + closepath fill } bind def
28.47 +/cshow { 2 index 2 index moveto dup stringwidth pop
28.48 + neg 2 div fosi .35 mul neg rmoveto show pop pop} def
28.49 +
28.50 +gsave
28.51 +90 rotate
28.52 +0 -842 translate
28.53 +71.0944 15 translate
28.54 +0.434694 dup scale
28.55 +90 rotate
28.56 +860.856 -588.349 translate
28.57 +%Edges:
28.58 +gsave
28.59 +574.035 177.301 622.149 225.748 670.264 274.195 1 0 0 2 lb
28.60 +694.579 115.483 682.421 194.839 670.264 274.195 1 0 0 2 lb
28.61 +280.402 10.3938 246.402 -6.60595 212.403 -23.6057 0 0 1 2 lb
28.62 +280.402 10.3938 283.493 -18.9695 286.584 -48.3327 0 0 1 2 lb
28.63 +212.403 -23.6057 249.493 -35.9692 286.584 -48.3327 0 0 1 2 lb
28.64 +286.584 -48.3327 326.765 -79.2414 366.947 -110.15 0 0 1 2 lb
28.65 +286.584 -48.3327 278.857 -111.695 271.13 -175.058 0 0 1 2 lb
28.66 +438.037 -88.514 417.946 -142.604 397.855 -196.694 0 0 1 2 lb
28.67 +438.037 -88.514 402.492 -99.332 366.947 -110.15 0 0 1 2 lb
28.68 +397.855 -196.694 382.401 -153.422 366.947 -110.15 0 0 1 2 lb
28.69 +366.947 -110.15 319.038 -142.604 271.13 -175.058 0 0 1 2 lb
28.70 +271.13 -175.058 274.221 -213.694 277.311 -252.33 0 0 1 2 lb
28.71 +271.13 -175.058 238.675 -190.512 206.221 -205.967 0 0 1 2 lb
28.72 +277.311 -252.33 241.766 -229.149 206.221 -205.967 0 0 1 2 lb
28.73 +-840.856 -246.718 -804.351 -66.7145 -767.847 113.289 1 0 0 2 lb
28.74 +-579.033 445.603 -673.44 279.446 -767.847 113.289 0 0 1 2 lb
28.75 +-579.033 445.603 -524.906 302.104 -470.779 158.605 0 0 1 2 lb
28.76 +-767.847 113.289 -619.313 135.947 -470.779 158.605 0 0 1 2 lb
28.77 +906.312 201.403 946.592 42.798 986.873 -115.807 0 0 1 2 lb
28.78 +906.312 201.403 834.562 91.8901 762.812 -17.6227 0 0 1 2 lb
28.79 +986.873 -115.807 874.842 -66.7148 762.812 -17.6227 0 0 1 2 lb
28.80 +-470.779 158.605 -390.218 50.3508 -309.657 -57.9033 1 0 0 2 lb
28.81 +422.945 521.129 208.955 541.269 -5.03507 561.41 0 0 1 2 lb
28.82 +422.945 521.129 376.371 417.911 329.797 314.692 0 0 1 2 lb
28.83 +422.945 521.129 474.554 276.928 526.164 32.7279 0 0 1 2 lb
28.84 +-5.03507 561.41 -36.5042 440.568 -67.9734 319.727 0 0 1 2 lb
28.85 +329.797 314.692 130.912 317.209 -67.9734 319.727 0 0 1 2 lb
28.86 +-67.9734 319.727 229.095 176.227 526.164 32.7279 0 0 1 2 lb
28.87 +762.812 -17.6227 644.488 7.5526 526.164 32.7279 0 0 1 2 lb
28.88 +762.812 -17.6227 746.448 -162.381 730.084 -307.139 0 0 1 2 lb
28.89 +526.164 32.7279 470.779 -128.394 415.393 -289.516 0 0 1 2 lb
28.90 +730.084 -307.139 572.738 -298.327 415.393 -289.516 0 0 1 2 lb
28.91 +415.393 -289.516 173.71 -318.468 -67.9734 -347.42 1 0 0 2 lb
28.92 +-67.9734 -347.42 -188.815 -202.662 -309.657 -57.9033 0 0 1 2 lb
28.93 +-67.9734 -347.42 -195.758 -390.692 -323.543 -433.964 0 0 1 2 lb
28.94 +-309.657 -57.9033 -424.775 -160.272 -539.894 -262.64 0 0 1 2 lb
28.95 +-323.543 -433.964 -431.719 -348.302 -539.894 -262.64 0 0 1 2 lb
28.96 +-26.6953 -19.9585 44.8558 -96.8093 116.407 -173.66 0 0 1 2 lb
28.97 +-26.6953 -19.9585 87.2563 9.19185 201.208 38.3422 0 0 1 2 lb
28.98 +-26.6953 -19.9585 -144.622 43.6422 -262.548 107.243 0 0 1 2 lb
28.99 +-26.6953 -19.9585 -20.0703 56.8923 -13.4452 133.743 0 0 1 2 lb
28.100 +116.407 -173.66 158.808 -67.6589 201.208 38.3422 0 0 1 2 lb
28.101 +-262.548 107.243 -137.997 120.493 -13.4452 133.743 0 0 1 2 lb
28.102 +-262.548 107.243 -221.472 176.144 -180.397 245.045 0 0 1 2 lb
28.103 +-13.4452 133.743 -96.9211 189.394 -180.397 245.045 0 0 1 2 lb
28.104 +-180.397 245.045 -142.256 345.099 -132.697 451.748 0 0 1 2 lb
28.105 +-180.397 245.045 -170.838 351.694 -132.697 451.748 0 0 1 2 lb
28.106 +-416.25 345.746 -274.474 398.747 -132.697 451.748 0 0 1 2 lb
28.107 +-416.25 345.746 -393.725 457.048 -371.2 568.349 0 0 1 2 lb
28.108 +-132.697 451.748 -251.948 510.048 -371.2 568.349 0 0 1 2 lb
28.109 +670.264 274.195 629.188 409.347 588.113 544.499 0 0 1 2 lb
28.110 +670.264 274.195 797.466 341.771 924.667 409.347 0 0 1 2 lb
28.111 +588.113 544.499 756.39 476.923 924.667 409.347 0 0 1 2 lb
28.112 +-689.204 -237.261 -614.799 -102.648 -567.302 43.6423 0 0 1 2 lb
28.113 +-689.204 -237.261 -641.707 -90.9706 -567.302 43.6423 0 0 1 2 lb
28.114 +grestore
28.115 +%Nodes:
28.116 +gsave
28.117 +-567.302 43.6423 20 0 0 0 nc
28.118 +-689.204 -237.261 20 0 0 0 nc
28.119 +924.667 409.347 20 0 0 1 nc
28.120 +588.113 544.499 20 0 0 1 nc
28.121 +670.264 274.195 20 0 0 1 nc
28.122 +-371.2 568.349 20 1 1 0 nc
28.123 +-132.697 451.748 20 1 1 0 nc
28.124 +-416.25 345.746 20 1 1 0 nc
28.125 +-180.397 245.045 20 1 1 0 nc
28.126 +-13.4452 133.743 20 1 1 0 nc
28.127 +-262.548 107.243 20 1 1 0 nc
28.128 +201.208 38.3422 20 1 1 0 nc
28.129 +116.407 -173.66 20 1 1 0 nc
28.130 +-26.6953 -19.9585 20 1 1 0 nc
28.131 +-539.894 -262.64 20 0 0.5 0 nc
28.132 +-323.543 -433.964 20 0 0.5 0 nc
28.133 +-309.657 -57.9033 20 0 0.5 0 nc
28.134 +-67.9734 -347.42 20 0 0.5 0 nc
28.135 +415.393 -289.516 20 0.5 0 0 nc
28.136 +730.084 -307.139 20 0.5 0 0 nc
28.137 +526.164 32.7279 20 0.5 0 0 nc
28.138 +762.812 -17.6227 20 0.5 0 0 nc
28.139 +-67.9734 319.727 20 0.5 0 0 nc
28.140 +329.797 314.692 20 0.5 0 0 nc
28.141 +-5.03507 561.41 20 0.5 0 0 nc
28.142 +422.945 521.129 20 0.5 0 0 nc
28.143 +-470.779 158.605 20 0 1 1 nc
28.144 +986.873 -115.807 20 0.5 0 0 nc
28.145 +906.312 201.403 20 0.5 0 0 nc
28.146 +-767.847 113.289 20 0 1 1 nc
28.147 +-579.033 445.603 20 0 1 1 nc
28.148 +-840.856 -246.718 20 1 0 1 nc
28.149 +206.221 -205.967 20 0 0 0.5 nc
28.150 +277.311 -252.33 20 0 0 0.5 nc
28.151 +271.13 -175.058 20 0 0 0.5 nc
28.152 +366.947 -110.15 20 0 0 0.5 nc
28.153 +397.855 -196.694 20 0 0 0.5 nc
28.154 +438.037 -88.514 20 0 0 0.5 nc
28.155 +286.584 -48.3327 20 0 0 0.5 nc
28.156 +212.403 -23.6057 20 0 0 0.5 nc
28.157 +280.402 10.3938 20 0 0 0.5 nc
28.158 +694.579 115.483 20 1 0 0 nc
28.159 +574.035 177.301 20 0 1 0 nc
28.160 +grestore
28.161 +grestore
28.162 +showpage
29.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
29.2 +++ b/doc/images/grid_graph.eps Thu Nov 05 15:50:01 2009 +0100
29.3 @@ -0,0 +1,286 @@
29.4 +%!PS-Adobe-2.0 EPSF-2.0
29.5 +%%Title: Grid undirected graph
29.6 +%%Copyright: (C) 2006 LEMON Project
29.7 +%%Creator: LEMON, graphToEps()
29.8 +%%CreationDate: Fri Sep 29 11:55:56 2006
29.9 +%%BoundingBox: 0 0 985 1144
29.10 +%%EndComments
29.11 +/lb { setlinewidth setrgbcolor newpath moveto
29.12 + 4 2 roll 1 index 1 index curveto stroke } bind def
29.13 +/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
29.14 +/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
29.15 +/sq { newpath 2 index 1 index add 2 index 2 index add moveto
29.16 + 2 index 1 index sub 2 index 2 index add lineto
29.17 + 2 index 1 index sub 2 index 2 index sub lineto
29.18 + 2 index 1 index add 2 index 2 index sub lineto
29.19 + closepath pop pop pop} bind def
29.20 +/di { newpath 2 index 1 index add 2 index moveto
29.21 + 2 index 2 index 2 index add lineto
29.22 + 2 index 1 index sub 2 index lineto
29.23 + 2 index 2 index 2 index sub lineto
29.24 + closepath pop pop pop} bind def
29.25 +/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
29.26 + setrgbcolor 1.1 div c fill
29.27 + } bind def
29.28 +/arrl 1 def
29.29 +/arrw 0.3 def
29.30 +/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
29.31 +/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
29.32 + /w exch def /len exch def
29.33 + newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto
29.34 + len w sub arrl sub dx dy lrl
29.35 + arrw dy dx neg lrl
29.36 + dx arrl w add mul dy w 2 div arrw add mul sub
29.37 + dy arrl w add mul dx w 2 div arrw add mul add rlineto
29.38 + dx arrl w add mul neg dy w 2 div arrw add mul sub
29.39 + dy arrl w add mul neg dx w 2 div arrw add mul add rlineto
29.40 + arrw dy dx neg lrl
29.41 + len w sub arrl sub neg dx dy lrl
29.42 + closepath fill } bind def
29.43 +/cshow { 2 index 2 index moveto dup stringwidth pop
29.44 + neg 2 div fosi .35 mul neg rmoveto show pop pop} def
29.45 +
29.46 +gsave
29.47 +2 2 scale
29.48 +50 40 translate
29.49 +5.5000 5.5000 scale
29.50 +% 1.14018 1.14018 translate
29.51 +%Edges:
29.52 +gsave
29.53 +70 80 70 90 0 0 0 0.5000 l
29.54 +70 70 70 80 0 0 0 0.5000 l
29.55 +70 60 70 70 0 0 0 0.5000 l
29.56 +70 50 70 60 0 0 0 0.5000 l
29.57 +70 40 70 50 0 0 0 0.5000 l
29.58 +70 30 70 40 0 0 0 0.5000 l
29.59 +70 20 70 30 0 0 0 0.5000 l
29.60 +70 10 70 20 0 0 0 0.5000 l
29.61 +70 0 70 10 0 0 0 0.5000 l
29.62 +60 80 60 90 0 0 0 0.5000 l
29.63 +60 70 60 80 0 0 0 0.5000 l
29.64 +60 60 60 70 0 0 0 0.5000 l
29.65 +60 50 60 60 0 0 0 0.5000 l
29.66 +60 40 60 50 0 0 0 0.5000 l
29.67 +60 30 60 40 0 0 0 0.5000 l
29.68 +60 20 60 30 0 0 0 0.5000 l
29.69 +60 10 60 20 0 0 0 0.5000 l
29.70 +60 0 60 10 0 0 0 0.5000 l
29.71 +50 80 50 90 0 0 0 0.5000 l
29.72 +50 70 50 80 0 0 0 0.5000 l
29.73 +50 60 50 70 0 0 0 0.5000 l
29.74 +50 50 50 60 0 0 0 0.5000 l
29.75 +50 40 50 50 0 0 0 0.5000 l
29.76 +50 30 50 40 0 0 0 0.5000 l
29.77 +50 20 50 30 0 0 0 0.5000 l
29.78 +50 10 50 20 0 0 0 0.5000 l
29.79 +50 0 50 10 0 0 0 0.5000 l
29.80 +40 80 40 90 0 0 0 0.5000 l
29.81 +40 70 40 80 0 0 0 0.5000 l
29.82 +40 60 40 70 0 0 0 0.5000 l
29.83 +40 50 40 60 0 0 0 0.5000 l
29.84 +40 40 40 50 0 0 0 0.5000 l
29.85 +40 30 40 40 0 0 0 0.5000 l
29.86 +40 20 40 30 0 0 0 0.5000 l
29.87 +40 10 40 20 0 0 0 0.5000 l
29.88 +40 0 40 10 0 0 0 0.5000 l
29.89 +30 80 30 90 0 0 0 0.5000 l
29.90 +30 70 30 80 0 0 0 0.5000 l
29.91 +30 60 30 70 0 0 0 0.5000 l
29.92 +30 50 30 60 0 0 0 0.5000 l
29.93 +30 40 30 50 0 0 0 0.5000 l
29.94 +30 30 30 40 0 0 0 0.5000 l
29.95 +30 20 30 30 0 0 0 0.5000 l
29.96 +30 10 30 20 0 0 0 0.5000 l
29.97 +30 0 30 10 0 0 0 0.5000 l
29.98 +20 80 20 90 0 0 0 0.5000 l
29.99 +20 70 20 80 0 0 0 0.5000 l
29.100 +20 60 20 70 0 0 0 0.5000 l
29.101 +20 50 20 60 0 0 0 0.5000 l
29.102 +20 40 20 50 0 0 0 0.5000 l
29.103 +20 30 20 40 0 0 0 0.5000 l
29.104 +20 20 20 30 0 0 0 0.5000 l
29.105 +20 10 20 20 0 0 0 0.5000 l
29.106 +20 0 20 10 0 0 0 0.5000 l
29.107 +10 80 10 90 0 0 0 0.5000 l
29.108 +10 70 10 80 0 0 0 0.5000 l
29.109 +10 60 10 70 0 0 0 0.5000 l
29.110 +10 50 10 60 0 0 0 0.5000 l
29.111 +10 40 10 50 0 0 0 0.5000 l
29.112 +10 30 10 40 0 0 0 0.5000 l
29.113 +10 20 10 30 0 0 0 0.5000 l
29.114 +10 10 10 20 0 0 0 0.5000 l
29.115 +10 0 10 10 0 0 0 0.5000 l
29.116 +0 80 0 90 0 0 0 0.5000 l
29.117 +0 70 0 80 0 0 0 0.5000 l
29.118 +0 60 0 70 0 0 0 0.5000 l
29.119 +0 50 0 60 0 0 0 0.5000 l
29.120 +0 40 0 50 0 0 0 0.5000 l
29.121 +0 30 0 40 0 0 0 0.5000 l
29.122 +0 20 0 30 0 0 0 0.5000 l
29.123 +0 10 0 20 0 0 0 0.5000 l
29.124 +0 0 0 10 0 0 0 0.5000 l
29.125 +60 90 70 90 0 0 0 0.5000 l
29.126 +60 80 70 80 0 0 0 0.5000 l
29.127 +60 70 70 70 0 0 0 0.5000 l
29.128 +60 60 70 60 0 0 0 0.5000 l
29.129 +60 50 70 50 0 0 0 0.5000 l
29.130 +60 40 70 40 0 0 0 0.5000 l
29.131 +60 30 70 30 0 0 0 0.5000 l
29.132 +60 20 70 20 0 0 0 0.5000 l
29.133 +60 10 70 10 0 0 0 0.5000 l
29.134 +60 0 70 0 0 0 0 0.5000 l
29.135 +50 90 60 90 0 0 0 0.5000 l
29.136 +50 80 60 80 0 0 0 0.5000 l
29.137 +50 70 60 70 0 0 0 0.5000 l
29.138 +50 60 60 60 0 0 0 0.5000 l
29.139 +50 50 60 50 0 0 0 0.5000 l
29.140 +50 40 60 40 0 0 0 0.5000 l
29.141 +50 30 60 30 0 0 0 0.5000 l
29.142 +50 20 60 20 0 0 0 0.5000 l
29.143 +50 10 60 10 0 0 0 0.5000 l
29.144 +50 0 60 0 0 0 0 0.5000 l
29.145 +40 90 50 90 0 0 0 0.5000 l
29.146 +40 80 50 80 0 0 0 0.5000 l
29.147 +40 70 50 70 0 0 0 0.5000 l
29.148 +40 60 50 60 0 0 0 0.5000 l
29.149 +40 50 50 50 0 0 0 0.5000 l
29.150 +40 40 50 40 0 0 0 0.5000 l
29.151 +40 30 50 30 0 0 0 0.5000 l
29.152 +40 20 50 20 0 0 0 0.5000 l
29.153 +40 10 50 10 0 0 0 0.5000 l
29.154 +40 0 50 0 0 0 0 0.5000 l
29.155 +30 90 40 90 0 0 0 0.5000 l
29.156 +30 80 40 80 0 0 0 0.5000 l
29.157 +30 70 40 70 0 0 0 0.5000 l
29.158 +30 60 40 60 0 0 0 0.5000 l
29.159 +30 50 40 50 0 0 0 0.5000 l
29.160 +30 40 40 40 0 0 0 0.5000 l
29.161 +30 30 40 30 0 0 0 0.5000 l
29.162 +30 20 40 20 0 0 0 0.5000 l
29.163 +30 10 40 10 0 0 0 0.5000 l
29.164 +30 0 40 0 0 0 0 0.5000 l
29.165 +20 90 30 90 0 0 0 0.5000 l
29.166 +20 80 30 80 0 0 0 0.5000 l
29.167 +20 70 30 70 0 0 0 0.5000 l
29.168 +20 60 30 60 0 0 0 0.5000 l
29.169 +20 50 30 50 0 0 0 0.5000 l
29.170 +20 40 30 40 0 0 0 0.5000 l
29.171 +20 30 30 30 0 0 0 0.5000 l
29.172 +20 20 30 20 0 0 0 0.5000 l
29.173 +20 10 30 10 0 0 0 0.5000 l
29.174 +20 0 30 0 0 0 0 0.5000 l
29.175 +10 90 20 90 0 0 0 0.5000 l
29.176 +10 80 20 80 0 0 0 0.5000 l
29.177 +10 70 20 70 0 0 0 0.5000 l
29.178 +10 60 20 60 0 0 0 0.5000 l
29.179 +10 50 20 50 0 0 0 0.5000 l
29.180 +10 40 20 40 0 0 0 0.5000 l
29.181 +10 30 20 30 0 0 0 0.5000 l
29.182 +10 20 20 20 0 0 0 0.5000 l
29.183 +10 10 20 10 0 0 0 0.5000 l
29.184 +10 0 20 0 0 0 0 0.5000 l
29.185 +0 90 10 90 0 0 0 0.5000 l
29.186 +0 80 10 80 0 0 0 0.5000 l
29.187 +0 70 10 70 0 0 0 0.5000 l
29.188 +0 60 10 60 0 0 0 0.5000 l
29.189 +0 50 10 50 0 0 0 0.5000 l
29.190 +0 40 10 40 0 0 0 0.5000 l
29.191 +0 30 10 30 0 0 0 0.5000 l
29.192 +0 20 10 20 0 0 0 0.5000 l
29.193 +0 10 10 10 0 0 0 0.5000 l
29.194 +0 0 10 0 0 0 0 0.5000 l
29.195 +grestore
29.196 +%Nodes:
29.197 +gsave
29.198 +70 90 1.4000 0 0 0 nc
29.199 +70 80 1.4000 1 1 1 nc
29.200 +70 70 1.4000 1 1 1 nc
29.201 +70 60 1.4000 1 1 1 nc
29.202 +70 50 1.4000 1 1 1 nc
29.203 +70 40 1.4000 1 1 1 nc
29.204 +70 30 1.4000 1 1 1 nc
29.205 +70 20 1.4000 1 1 1 nc
29.206 +70 10 1.4000 1 1 1 nc
29.207 +70 0 1.4000 0 0 0 nc
29.208 +60 90 1.4000 1 1 1 nc
29.209 +60 80 1.4000 1 1 1 nc
29.210 +60 70 1.4000 1 1 1 nc
29.211 +60 60 1.4000 1 1 1 nc
29.212 +60 50 1.4000 1 1 1 nc
29.213 +60 40 1.4000 1 1 1 nc
29.214 +60 30 1.4000 1 1 1 nc
29.215 +60 20 1.4000 1 1 1 nc
29.216 +60 10 1.4000 1 1 1 nc
29.217 +60 0 1.4000 1 1 1 nc
29.218 +50 90 1.4000 1 1 1 nc
29.219 +50 80 1.4000 1 1 1 nc
29.220 +50 70 1.4000 1 1 1 nc
29.221 +50 60 1.4000 1 1 1 nc
29.222 +50 50 1.4000 1 1 1 nc
29.223 +50 40 1.4000 1 1 1 nc
29.224 +50 30 1.4000 1 1 1 nc
29.225 +50 20 1.4000 1 1 1 nc
29.226 +50 10 1.4000 1 1 1 nc
29.227 +50 0 1.4000 1 1 1 nc
29.228 +40 90 1.4000 1 1 1 nc
29.229 +40 80 1.4000 1 1 1 nc
29.230 +40 70 1.4000 1 1 1 nc
29.231 +40 60 1.4000 1 1 1 nc
29.232 +40 50 1.4000 1 1 1 nc
29.233 +40 40 1.4000 1 1 1 nc
29.234 +40 30 1.4000 1 1 1 nc
29.235 +40 20 1.4000 1 1 1 nc
29.236 +40 10 1.4000 1 1 1 nc
29.237 +40 0 1.4000 1 1 1 nc
29.238 +30 90 1.4000 1 1 1 nc
29.239 +30 80 1.4000 1 1 1 nc
29.240 +30 70 1.4000 1 1 1 nc
29.241 +30 60 1.4000 1 1 1 nc
29.242 +30 50 1.4000 1 1 1 nc
29.243 +30 40 1.4000 1 1 1 nc
29.244 +30 30 1.4000 1 1 1 nc
29.245 +30 20 1.4000 1 1 1 nc
29.246 +30 10 1.4000 1 1 1 nc
29.247 +30 0 1.4000 1 1 1 nc
29.248 +20 90 1.4000 1 1 1 nc
29.249 +20 80 1.4000 1 1 1 nc
29.250 +20 70 1.4000 1 1 1 nc
29.251 +20 60 1.4000 1 1 1 nc
29.252 +20 50 1.4000 1 1 1 nc
29.253 +20 40 1.4000 1 1 1 nc
29.254 +20 30 1.4000 1 1 1 nc
29.255 +20 20 1.4000 1 1 1 nc
29.256 +20 10 1.4000 1 1 1 nc
29.257 +20 0 1.4000 1 1 1 nc
29.258 +10 90 1.4000 1 1 1 nc
29.259 +10 80 1.4000 1 1 1 nc
29.260 +10 70 1.4000 1 1 1 nc
29.261 +10 60 1.4000 1 1 1 nc
29.262 +10 50 1.4000 1 1 1 nc
29.263 +10 40 1.4000 1 1 1 nc
29.264 +10 30 1.4000 1 1 1 nc
29.265 +10 20 1.4000 1 1 1 nc
29.266 +10 10 1.4000 1 1 1 nc
29.267 +10 0 1.4000 1 1 1 nc
29.268 +0 90 1.4000 0 0 0 nc
29.269 +0 80 1.4000 1 1 1 nc
29.270 +0 70 1.4000 1 1 1 nc
29.271 +0 60 1.4000 1 1 1 nc
29.272 +0 50 1.4000 1 1 1 nc
29.273 +0 40 1.4000 1 1 1 nc
29.274 +0 30 1.4000 1 1 1 nc
29.275 +0 20 1.4000 1 1 1 nc
29.276 +0 10 1.4000 1 1 1 nc
29.277 +0 0 1.4000 0 0 0 nc
29.278 +grestore
29.279 +gsave
29.280 +/fosi 3.5 def
29.281 +(Helvetica) findfont fosi scalefont setfont
29.282 +0 0 0 setrgbcolor
29.283 +0 95 ((0,height-1)) cshow
29.284 +67 95 ((width-1,height-1)) cshow
29.285 +0 -5 ((0,0)) cshow
29.286 +70 -5 ((width-1,0)) cshow
29.287 +grestore
29.288 +grestore
29.289 +showpage
30.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
30.2 +++ b/doc/images/node_biconnected_components.eps Thu Nov 05 15:50:01 2009 +0100
30.3 @@ -0,0 +1,159 @@
30.4 +%!PS-Adobe-2.0 EPSF-2.0
30.5 +%%Creator: LEMON, graphToEps()
30.6 +%%CreationDate: Fri Nov 4 13:47:12 2005
30.7 +%%BoundingBox: 0 0 842 596
30.8 +%%EndComments
30.9 +/lb { setlinewidth setrgbcolor newpath moveto
30.10 + 4 2 roll 1 index 1 index curveto stroke } bind def
30.11 +/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
30.12 +/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
30.13 +/sq { newpath 2 index 1 index add 2 index 2 index add moveto
30.14 + 2 index 1 index sub 2 index 2 index add lineto
30.15 + 2 index 1 index sub 2 index 2 index sub lineto
30.16 + 2 index 1 index add 2 index 2 index sub lineto
30.17 + closepath pop pop pop} bind def
30.18 +/di { newpath 2 index 1 index add 2 index moveto
30.19 + 2 index 2 index 2 index add lineto
30.20 + 2 index 1 index sub 2 index lineto
30.21 + 2 index 2 index 2 index sub lineto
30.22 + closepath pop pop pop} bind def
30.23 +/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
30.24 + setrgbcolor 1.1 div c fill
30.25 + } bind def
30.26 +/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
30.27 + setrgbcolor 1.1 div sq fill
30.28 + } bind def
30.29 +/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
30.30 + setrgbcolor 1.1 div di fill
30.31 + } bind def
30.32 +/arrl 1 def
30.33 +/arrw 0.3 def
30.34 +/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
30.35 +/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
30.36 + /w exch def /len exch def
30.37 + newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto
30.38 + len w sub arrl sub dx dy lrl
30.39 + arrw dy dx neg lrl
30.40 + dx arrl w add mul dy w 2 div arrw add mul sub
30.41 + dy arrl w add mul dx w 2 div arrw add mul add rlineto
30.42 + dx arrl w add mul neg dy w 2 div arrw add mul sub
30.43 + dy arrl w add mul neg dx w 2 div arrw add mul add rlineto
30.44 + arrw dy dx neg lrl
30.45 + len w sub arrl sub neg dx dy lrl
30.46 + closepath fill } bind def
30.47 +/cshow { 2 index 2 index moveto dup stringwidth pop
30.48 + neg 2 div fosi .35 mul neg rmoveto show pop pop} def
30.49 +
30.50 +gsave
30.51 +90 rotate
30.52 +0 -842 translate
30.53 +71.0944 15 translate
30.54 +0.434694 dup scale
30.55 +90 rotate
30.56 +860.856 -588.349 translate
30.57 +%Edges:
30.58 +gsave
30.59 +574.035 177.301 622.149 225.748 670.264 274.195 0 1 0 5 lb
30.60 +694.579 115.483 682.421 194.839 670.264 274.195 1 0 0 5 lb
30.61 +280.402 10.3938 246.402 -6.60595 212.403 -23.6057 1 1 0.5 5 lb
30.62 +280.402 10.3938 283.493 -18.9695 286.584 -48.3327 1 1 0.5 5 lb
30.63 +212.403 -23.6057 249.493 -35.9692 286.584 -48.3327 1 1 0.5 5 lb
30.64 +286.584 -48.3327 326.765 -79.2414 366.947 -110.15 1 0.5 1 5 lb
30.65 +286.584 -48.3327 278.857 -111.695 271.13 -175.058 1 0.5 1 5 lb
30.66 +438.037 -88.514 417.946 -142.604 397.855 -196.694 0.5 0.5 1 5 lb
30.67 +438.037 -88.514 402.492 -99.332 366.947 -110.15 0.5 0.5 1 5 lb
30.68 +397.855 -196.694 382.401 -153.422 366.947 -110.15 0.5 0.5 1 5 lb
30.69 +366.947 -110.15 319.038 -142.604 271.13 -175.058 1 0.5 1 5 lb
30.70 +271.13 -175.058 274.221 -213.694 277.311 -252.33 0.5 1 1 5 lb
30.71 +271.13 -175.058 238.675 -190.512 206.221 -205.967 0.5 1 1 5 lb
30.72 +277.311 -252.33 241.766 -229.149 206.221 -205.967 0.5 1 1 5 lb
30.73 +-840.856 -246.718 -804.351 -66.7145 -767.847 113.289 0 0.5 0 5 lb
30.74 +-579.033 445.603 -673.44 279.446 -767.847 113.289 0 0 0.5 5 lb
30.75 +-579.033 445.603 -524.906 302.104 -470.779 158.605 0 0 0.5 5 lb
30.76 +-767.847 113.289 -619.313 135.947 -470.779 158.605 0 0 0.5 5 lb
30.77 +906.312 201.403 946.592 42.798 986.873 -115.807 0 0.5 0.5 5 lb
30.78 +906.312 201.403 834.562 91.8901 762.812 -17.6227 0 0.5 0.5 5 lb
30.79 +986.873 -115.807 874.842 -66.7148 762.812 -17.6227 0 0.5 0.5 5 lb
30.80 +-470.779 158.605 -390.218 50.3508 -309.657 -57.9033 0.5 0.5 0 5 lb
30.81 +422.945 521.129 208.955 541.269 -5.03507 561.41 0.5 0 0.5 5 lb
30.82 +422.945 521.129 376.371 417.911 329.797 314.692 0.5 0 0.5 5 lb
30.83 +422.945 521.129 474.554 276.928 526.164 32.7279 0.5 0 0.5 5 lb
30.84 +-5.03507 561.41 -36.5042 440.568 -67.9734 319.727 0.5 0 0.5 5 lb
30.85 +329.797 314.692 130.912 317.209 -67.9734 319.727 0.5 0 0.5 5 lb
30.86 +-67.9734 319.727 229.095 176.227 526.164 32.7279 0.5 0 0.5 5 lb
30.87 +762.812 -17.6227 644.488 7.5526 526.164 32.7279 0.5 0.5 0.5 5 lb
30.88 +762.812 -17.6227 746.448 -162.381 730.084 -307.139 0.5 0.5 0.5 5 lb
30.89 +526.164 32.7279 470.779 -128.394 415.393 -289.516 0.5 0.5 0.5 5 lb
30.90 +730.084 -307.139 572.738 -298.327 415.393 -289.516 0.5 0.5 0.5 5 lb
30.91 +415.393 -289.516 173.71 -318.468 -67.9734 -347.42 1 0.5 0.5 5 lb
30.92 +-67.9734 -347.42 -188.815 -202.662 -309.657 -57.9033 0.5 1 0.5 5 lb
30.93 +-67.9734 -347.42 -195.758 -390.692 -323.543 -433.964 0.5 1 0.5 5 lb
30.94 +-309.657 -57.9033 -424.775 -160.272 -539.894 -262.64 0.5 1 0.5 5 lb
30.95 +-323.543 -433.964 -431.719 -348.302 -539.894 -262.64 0.5 1 0.5 5 lb
30.96 +-26.6953 -19.9585 44.8558 -96.8093 116.407 -173.66 1 1 0 5 lb
30.97 +-26.6953 -19.9585 87.2563 9.19185 201.208 38.3422 1 1 0 5 lb
30.98 +-26.6953 -19.9585 -144.622 43.6422 -262.548 107.243 1 0 1 5 lb
30.99 +-26.6953 -19.9585 -20.0703 56.8923 -13.4452 133.743 1 0 1 5 lb
30.100 +116.407 -173.66 158.808 -67.6589 201.208 38.3422 1 1 0 5 lb
30.101 +-262.548 107.243 -137.997 120.493 -13.4452 133.743 1 0 1 5 lb
30.102 +-262.548 107.243 -221.472 176.144 -180.397 245.045 1 0 1 5 lb
30.103 +-13.4452 133.743 -96.9211 189.394 -180.397 245.045 1 0 1 5 lb
30.104 +-180.397 245.045 -140.307 344.649 -132.697 451.748 0 1 1 5 lb
30.105 +-180.397 245.045 -172.787 352.144 -132.697 451.748 0 1 1 5 lb
30.106 +-416.25 345.746 -274.474 398.747 -132.697 451.748 0.5 0 0 5 lb
30.107 +-416.25 345.746 -393.725 457.048 -371.2 568.349 0.5 0 0 5 lb
30.108 +-132.697 451.748 -251.948 510.048 -371.2 568.349 0.5 0 0 5 lb
30.109 +670.264 274.195 629.188 409.347 588.113 544.499 0 0 1 5 lb
30.110 +670.264 274.195 797.466 341.771 924.667 409.347 0 0 1 5 lb
30.111 +588.113 544.499 756.39 476.923 924.667 409.347 0 0 1 5 lb
30.112 +-689.204 -237.261 -612.964 -103.444 -567.302 43.6423 0 0 0 5 lb
30.113 +-689.204 -237.261 -643.542 -90.1744 -567.302 43.6423 0 0 0 5 lb
30.114 +grestore
30.115 +%Nodes:
30.116 +gsave
30.117 +-567.302 43.6423 20 0 0 1 nc
30.118 +-689.204 -237.261 20 0 0 1 nc
30.119 +924.667 409.347 20 0 0 1 nc
30.120 +588.113 544.499 20 0 0 1 nc
30.121 +670.264 274.195 20 1 0 0 nc
30.122 +-371.2 568.349 20 0 0 1 nc
30.123 +-132.697 451.748 20 1 0 0 nc
30.124 +-416.25 345.746 20 0 0 1 nc
30.125 +-180.397 245.045 20 1 0 0 nc
30.126 +-13.4452 133.743 20 0 0 1 nc
30.127 +-262.548 107.243 20 0 0 1 nc
30.128 +201.208 38.3422 20 0 0 1 nc
30.129 +116.407 -173.66 20 0 0 1 nc
30.130 +-26.6953 -19.9585 20 1 0 0 nc
30.131 +-539.894 -262.64 20 0 0 1 nc
30.132 +-323.543 -433.964 20 0 0 1 nc
30.133 +-309.657 -57.9033 20 1 0 0 nc
30.134 +-67.9734 -347.42 20 1 0 0 nc
30.135 +415.393 -289.516 20 1 0 0 nc
30.136 +730.084 -307.139 20 0 0 1 nc
30.137 +526.164 32.7279 20 1 0 0 nc
30.138 +762.812 -17.6227 20 1 0 0 nc
30.139 +-67.9734 319.727 20 0 0 1 nc
30.140 +329.797 314.692 20 0 0 1 nc
30.141 +-5.03507 561.41 20 0 0 1 nc
30.142 +422.945 521.129 20 0 0 1 nc
30.143 +-470.779 158.605 20 1 0 0 nc
30.144 +986.873 -115.807 20 0 0 1 nc
30.145 +906.312 201.403 20 0 0 1 nc
30.146 +-767.847 113.289 20 1 0 0 nc
30.147 +-579.033 445.603 20 0 0 1 nc
30.148 +-840.856 -246.718 20 0 0 1 nc
30.149 +206.221 -205.967 20 0 0 1 nc
30.150 +277.311 -252.33 20 0 0 1 nc
30.151 +271.13 -175.058 20 1 0 0 nc
30.152 +366.947 -110.15 20 1 0 0 nc
30.153 +397.855 -196.694 20 0 0 1 nc
30.154 +438.037 -88.514 20 0 0 1 nc
30.155 +286.584 -48.3327 20 1 0 0 nc
30.156 +212.403 -23.6057 20 0 0 1 nc
30.157 +280.402 10.3938 20 0 0 1 nc
30.158 +694.579 115.483 20 0 0 1 nc
30.159 +574.035 177.301 20 0 0 1 nc
30.160 +grestore
30.161 +grestore
30.162 +showpage
31.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
31.2 +++ b/doc/images/strongly_connected_components.eps Thu Nov 05 15:50:01 2009 +0100
31.3 @@ -0,0 +1,180 @@
31.4 +%!PS-Adobe-2.0 EPSF-2.0
31.5 +%%Creator: LEMON, graphToEps()
31.6 +%%CreationDate: Fri Nov 4 13:47:12 2005
31.7 +%%BoundingBox: 0 0 842 596
31.8 +%%EndComments
31.9 +/lb { setlinewidth setrgbcolor newpath moveto
31.10 + 4 2 roll 1 index 1 index curveto stroke } bind def
31.11 +/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
31.12 +/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
31.13 +/sq { newpath 2 index 1 index add 2 index 2 index add moveto
31.14 + 2 index 1 index sub 2 index 2 index add lineto
31.15 + 2 index 1 index sub 2 index 2 index sub lineto
31.16 + 2 index 1 index add 2 index 2 index sub lineto
31.17 + closepath pop pop pop} bind def
31.18 +/di { newpath 2 index 1 index add 2 index moveto
31.19 + 2 index 2 index 2 index add lineto
31.20 + 2 index 1 index sub 2 index lineto
31.21 + 2 index 2 index 2 index sub lineto
31.22 + closepath pop pop pop} bind def
31.23 +/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
31.24 + setrgbcolor 1.1 div c fill
31.25 + } bind def
31.26 +/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
31.27 + setrgbcolor 1.1 div sq fill
31.28 + } bind def
31.29 +/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
31.30 + setrgbcolor 1.1 div di fill
31.31 + } bind def
31.32 +/arrl 10 def
31.33 +/arrw 3 def
31.34 +/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
31.35 +/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
31.36 + /w exch def /len exch def
31.37 + newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto
31.38 + len w sub arrl sub dx dy lrl
31.39 + arrw dy dx neg lrl
31.40 + dx arrl w add mul dy w 2 div arrw add mul sub
31.41 + dy arrl w add mul dx w 2 div arrw add mul add rlineto
31.42 + dx arrl w add mul neg dy w 2 div arrw add mul sub
31.43 + dy arrl w add mul neg dx w 2 div arrw add mul add rlineto
31.44 + arrw dy dx neg lrl
31.45 + len w sub arrl sub neg dx dy lrl
31.46 + closepath fill } bind def
31.47 +/cshow { 2 index 2 index moveto dup stringwidth pop
31.48 + neg 2 div fosi .35 mul neg rmoveto show pop pop} def
31.49 +
31.50 +gsave
31.51 +90 rotate
31.52 +0 -842 translate
31.53 +77.1122 15 translate
31.54 +0.585745 dup scale
31.55 +90 rotate
31.56 +695.963 -397.916 translate
31.57 +%Edges:
31.58 +gsave
31.59 +2 setlinewidth 0 0 1 setrgbcolor newpath
31.60 +218.178 27.2723 moveto
31.61 +192.373 -40.1551 188.622 -49.9556 169.228 -100.631 curveto stroke
31.62 +newpath 164.939 -111.838 moveto 165.492 -99.2013 lineto 172.964 -102.061 lineto closepath fill
31.63 +2 setlinewidth 0 0 1 setrgbcolor newpath
31.64 +44.8044 15.5841 moveto
31.65 +119.293 20.6059 129.775 21.3125 186.25 25.1199 curveto stroke
31.66 +newpath 198.223 25.927 moveto 186.519 21.1289 lineto 185.981 29.1108 lineto closepath fill
31.67 +2 setlinewidth 1 0 0 setrgbcolor newpath
31.68 +218.178 27.2723 moveto
31.69 +285.395 -87.4449 290.763 -96.6058 348.102 -194.464 curveto stroke
31.70 +newpath 354.169 -204.818 moveto 344.651 -196.487 lineto 351.554 -192.442 lineto closepath fill
31.71 +2 setlinewidth 0 0 1 setrgbcolor newpath
31.72 +157.79 -130.517 moveto
31.73 +108.71 -67.0521 102.27 -58.7243 64.3804 -9.72954 curveto stroke
31.74 +newpath 57.0394 -0.236898 moveto 67.5446 -7.28254 lineto 61.2162 -12.1765 lineto closepath fill
31.75 +2 setlinewidth 1 0 0 setrgbcolor newpath
31.76 +-105.193 -261.035 moveto
31.77 +-35.6576 -132.801 -30.5923 -123.459 29.5506 -12.5464 curveto stroke
31.78 +newpath 35.2708 -1.99743 moveto 33.0669 -14.4531 lineto 26.0343 -10.6397 lineto closepath fill
31.79 +2 setlinewidth 0 0 1 setrgbcolor newpath
31.80 +-465.576 -42.8564 moveto
31.81 +-559.078 -25.5413 -569.47 -23.6169 -644.498 -9.72286 curveto stroke
31.82 +newpath -656.297 -7.5378 moveto -643.77 -5.78973 lineto -645.226 -13.656 lineto closepath fill
31.83 +2 setlinewidth 0 0 1 setrgbcolor newpath
31.84 +-574.666 -153.893 moveto
31.85 +-528.842 -107.252 -521.515 -99.794 -488.002 -65.683 curveto stroke
31.86 +newpath -479.592 -57.123 moveto -485.149 -68.4863 lineto -490.856 -62.8797 lineto closepath fill
31.87 +2 setlinewidth 1 0 0 setrgbcolor newpath
31.88 +-490.901 120.777 moveto
31.89 +-480.122 51.1328 -478.519 40.7713 -470.47 -11.2329 curveto stroke
31.90 +newpath -468.635 -23.0917 moveto -474.423 -11.8447 lineto -466.517 -10.6212 lineto closepath fill
31.91 +2 setlinewidth 0 0 1 setrgbcolor newpath
31.92 +-675.963 -3.89604 moveto
31.93 +-632.116 -68.8235 -626.228 -77.5422 -592.575 -127.374 curveto stroke
31.94 +newpath -585.859 -137.319 moveto -595.89 -129.612 lineto -589.26 -125.135 lineto closepath fill
31.95 +2 setlinewidth 0 0 1 setrgbcolor newpath
31.96 +-490.901 120.777 moveto
31.97 +-435.445 215.844 -430.107 224.995 -384.3 303.522 curveto stroke
31.98 +newpath -378.253 313.887 moveto -380.845 301.507 lineto -387.755 305.537 lineto closepath fill
31.99 +2 setlinewidth 0 0 1 setrgbcolor newpath
31.100 +-266.879 114.933 moveto
31.101 +-367.067 117.547 -377.642 117.822 -458.912 119.943 curveto stroke
31.102 +newpath -470.908 120.255 moveto -458.807 123.941 lineto -459.016 115.944 lineto closepath fill
31.103 +2 setlinewidth 0 0 1 setrgbcolor newpath
31.104 +-368.176 331.163 moveto
31.105 +-322.511 233.685 -318.018 224.095 -280.454 143.911 curveto stroke
31.106 +newpath -275.364 133.044 moveto -284.076 142.214 lineto -276.832 145.608 lineto closepath fill
31.107 +2 setlinewidth 1 0 0 setrgbcolor newpath
31.108 +-266.879 114.933 moveto
31.109 +-224.004 235.52 -220.448 245.52 -184.094 347.765 curveto stroke
31.110 +newpath -180.074 359.072 moveto -180.325 346.425 lineto -187.863 349.105 lineto closepath fill
31.111 +2 setlinewidth 0 0 1 setrgbcolor newpath
31.112 +-251.294 -335.059 moveto
31.113 +-189.25 -303.624 -179.902 -298.887 -133.738 -275.498 curveto stroke
31.114 +newpath -123.034 -270.074 moveto -131.93 -279.066 lineto -135.546 -271.93 lineto closepath fill
31.115 +2 setlinewidth 0 0 1 setrgbcolor newpath
31.116 +-389.604 -136.361 moveto
31.117 +-327.15 -226.083 -321.098 -234.777 -269.576 -308.795 curveto stroke
31.118 +newpath -262.72 -318.644 moveto -272.859 -311.081 lineto -266.293 -306.51 lineto closepath fill
31.119 +2 setlinewidth 1 0 0 setrgbcolor newpath
31.120 +5.84406 175.322 moveto
31.121 +-76.0754 267.926 -83.1051 275.873 -152.172 353.948 curveto stroke
31.122 +newpath -160.122 362.936 moveto -149.176 356.598 lineto -155.168 351.298 lineto closepath fill
31.123 +2 setlinewidth 0 0 1 setrgbcolor newpath
31.124 +169.478 311.683 moveto
31.125 +96.8003 251.119 88.6819 244.353 30.4273 195.808 curveto stroke
31.126 +newpath 21.2086 188.126 moveto 27.8666 198.881 lineto 32.988 192.735 lineto closepath fill
31.127 +2 setlinewidth 0 0 1 setrgbcolor newpath
31.128 +342.851 111.037 moveto
31.129 +263.766 202.563 256.831 210.589 190.4 287.47 curveto stroke
31.130 +newpath 182.554 296.55 moveto 193.427 290.085 lineto 187.373 284.855 lineto closepath fill
31.131 +2 setlinewidth 0 0 1 setrgbcolor newpath
31.132 +5.84406 175.322 moveto
31.133 +163.16 145.314 173.605 143.321 311.418 117.033 curveto stroke
31.134 +newpath 323.205 114.784 moveto 310.668 113.104 lineto 312.167 120.962 lineto closepath fill
31.135 +2 setlinewidth 0 0 1 setrgbcolor newpath
31.136 +342.851 111.037 moveto
31.137 +497.255 2.58683 505.964 -3.53033 643.932 -100.436 curveto stroke
31.138 +newpath 653.752 -107.334 moveto 641.633 -103.71 lineto 646.231 -97.163 lineto closepath fill
31.139 +2 setlinewidth 0 0 1 setrgbcolor newpath
31.140 +364.28 -222.074 moveto
31.141 +354.298 -66.9063 353.616 -56.2971 344.905 79.1029 curveto stroke
31.142 +newpath 344.135 91.0781 moveto 348.897 79.3597 lineto 340.914 78.8461 lineto closepath fill
31.143 +2 setlinewidth 0 0 1 setrgbcolor newpath
31.144 +670.118 -118.829 moveto
31.145 +528.037 -166.793 517.967 -170.192 394.599 -211.839 curveto stroke
31.146 +newpath 383.229 -215.677 moveto 393.32 -208.049 lineto 395.878 -215.629 lineto closepath fill
31.147 +2 setlinewidth 1 0 0 setrgbcolor newpath
31.148 +-105.193 -261.035 moveto
31.149 +118.401 -242.479 129.015 -241.598 332.39 -224.721 curveto stroke
31.150 +newpath 344.348 -223.728 moveto 332.72 -228.707 lineto 332.059 -220.734 lineto closepath fill
31.151 +2 setlinewidth 0 0 1 setrgbcolor newpath
31.152 +-105.193 -261.035 moveto
31.153 +-160.867 -161.176 -166.028 -151.918 -212.336 -68.858 curveto stroke
31.154 +newpath -218.179 -58.3769 moveto -208.842 -66.9102 lineto -215.829 -70.8058 lineto closepath fill
31.155 +2 setlinewidth 0 0 1 setrgbcolor newpath
31.156 +-227.918 -40.9084 moveto
31.157 +-298.35 -82.4884 -307.42 -87.8432 -362.048 -120.093 curveto stroke
31.158 +newpath -372.381 -126.193 moveto -364.081 -116.648 lineto -360.014 -123.537 lineto closepath fill
31.159 +grestore
31.160 +%Nodes:
31.161 +gsave
31.162 +-389.604 -136.361 20 0 1 0 nc
31.163 +-227.918 -40.9084 20 0 1 0 nc
31.164 +-105.193 -261.035 20 0 1 0 nc
31.165 +364.28 -222.074 20 1 1 0 nc
31.166 +670.118 -118.829 20 1 1 0 nc
31.167 +342.851 111.037 20 1 1 0 nc
31.168 +5.84406 175.322 20 1 1 0 nc
31.169 +169.478 311.683 20 1 1 0 nc
31.170 +-173.374 377.916 20 1 0 1 nc
31.171 +-251.294 -335.059 20 0 1 0 nc
31.172 +-266.879 114.933 20 0 0 0 nc
31.173 +-368.176 331.163 20 0 0 0 nc
31.174 +-490.901 120.777 20 0 0 0 nc
31.175 +-574.666 -153.893 20 1 0 0 nc
31.176 +-675.963 -3.89604 20 1 0 0 nc
31.177 +-465.576 -42.8564 20 1 0 0 nc
31.178 +44.8044 15.5841 20 0 0 1 nc
31.179 +157.79 -130.517 20 0 0 1 nc
31.180 +218.178 27.2723 20 0 0 1 nc
31.181 +grestore
31.182 +grestore
31.183 +showpage
32.1 --- a/doc/lgf.dox Fri Oct 16 10:21:37 2009 +0200
32.2 +++ b/doc/lgf.dox Thu Nov 05 15:50:01 2009 +0100
32.3 @@ -2,7 +2,7 @@
32.4 *
32.5 * This file is a part of LEMON, a generic C++ optimization library.
32.6 *
32.7 - * Copyright (C) 2003-2008
32.8 + * Copyright (C) 2003-2009
32.9 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
32.10 * (Egervary Research Group on Combinatorial Optimization, EGRES).
32.11 *
33.1 --- a/doc/license.dox Fri Oct 16 10:21:37 2009 +0200
33.2 +++ b/doc/license.dox Thu Nov 05 15:50:01 2009 +0100
33.3 @@ -2,7 +2,7 @@
33.4 *
33.5 * This file is a part of LEMON, a generic C++ optimization library.
33.6 *
33.7 - * Copyright (C) 2003-2008
33.8 + * Copyright (C) 2003-2009
33.9 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
33.10 * (Egervary Research Group on Combinatorial Optimization, EGRES).
33.11 *
34.1 --- a/doc/mainpage.dox Fri Oct 16 10:21:37 2009 +0200
34.2 +++ b/doc/mainpage.dox Thu Nov 05 15:50:01 2009 +0100
34.3 @@ -2,7 +2,7 @@
34.4 *
34.5 * This file is a part of LEMON, a generic C++ optimization library.
34.6 *
34.7 - * Copyright (C) 2003-2008
34.8 + * Copyright (C) 2003-2009
34.9 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
34.10 * (Egervary Research Group on Combinatorial Optimization, EGRES).
34.11 *
34.12 @@ -21,15 +21,11 @@
34.13
34.14 \section intro Introduction
34.15
34.16 -\subsection whatis What is LEMON
34.17 -
34.18 -LEMON stands for
34.19 -<b>L</b>ibrary of <b>E</b>fficient <b>M</b>odels
34.20 -and <b>O</b>ptimization in <b>N</b>etworks.
34.21 -It is a C++ template
34.22 -library aimed at combinatorial optimization tasks which
34.23 -often involve in working
34.24 -with graphs.
34.25 +<b>LEMON</b> stands for <i><b>L</b>ibrary for <b>E</b>fficient <b>M</b>odeling
34.26 +and <b>O</b>ptimization in <b>N</b>etworks</i>.
34.27 +It is a C++ template library providing efficient implementation of common
34.28 +data structures and algorithms with focus on combinatorial optimization
34.29 +problems in graphs and networks.
34.30
34.31 <b>
34.32 LEMON is an <a class="el" href="http://opensource.org/">open source</a>
34.33 @@ -39,22 +35,22 @@
34.34 \ref license "license terms".
34.35 </b>
34.36
34.37 -\subsection howtoread How to read the documentation
34.38 +The project is maintained by the
34.39 +<a href="http://www.cs.elte.hu/egres/">Egerváry Research Group on
34.40 +Combinatorial Optimization</a> \ref egres
34.41 +at the Operations Research Department of the
34.42 +<a href="http://www.elte.hu/">Eötvös Loránd University,
34.43 +Budapest</a>, Hungary.
34.44 +LEMON is also a member of the <a href="http://www.coin-or.org/">COIN-OR</a>
34.45 +initiative \ref coinor.
34.46
34.47 -If you want to get a quick start and see the most important features then
34.48 -take a look at our \ref quicktour
34.49 -"Quick Tour to LEMON" which will guide you along.
34.50 +\section howtoread How to Read the Documentation
34.51
34.52 -If you already feel like using our library, see the page that tells you
34.53 -\ref getstart "How to start using LEMON".
34.54 +If you would like to get to know the library, see
34.55 +<a class="el" href="http://lemon.cs.elte.hu/pub/tutorial/">LEMON Tutorial</a>.
34.56
34.57 -If you
34.58 -want to see how LEMON works, see
34.59 -some \ref demoprograms "demo programs".
34.60 -
34.61 -If you know what you are looking for then try to find it under the
34.62 -<a class="el" href="modules.html">Modules</a>
34.63 -section.
34.64 +If you know what you are looking for, then try to find it under the
34.65 +<a class="el" href="modules.html">Modules</a> section.
34.66
34.67 If you are a user of the old (0.x) series of LEMON, please check out the
34.68 \ref migration "Migration Guide" for the backward incompatibilities.
35.1 --- a/doc/migration.dox Fri Oct 16 10:21:37 2009 +0200
35.2 +++ b/doc/migration.dox Thu Nov 05 15:50:01 2009 +0100
35.3 @@ -2,7 +2,7 @@
35.4 *
35.5 * This file is a part of LEMON, a generic C++ optimization library.
35.6 *
35.7 - * Copyright (C) 2003-2008
35.8 + * Copyright (C) 2003-2009
35.9 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
35.10 * (Egervary Research Group on Combinatorial Optimization, EGRES).
35.11 *
35.12 @@ -25,7 +25,7 @@
35.13 to the 0.x release series.
35.14
35.15 Many of these changes adjusted automatically by the
35.16 -<tt>script/lemon-0.x-to-1.x.sh</tt> tool. Those requiring manual
35.17 +<tt>lemon-0.x-to-1.x.sh</tt> tool. Those requiring manual
35.18 update are typeset <b>boldface</b>.
35.19
35.20 \section migration-graph Graph Related Name Changes
35.21 @@ -53,9 +53,11 @@
35.22 for <tt>Arc</tt>s (directed edges).
35.23
35.24 \warning
35.25 -<b>The <tt>script/lemon-0.x-to-1.x.sh</tt> tool replaces all instances of
35.26 -the words \c graph, \c digraph, \c edge and \c arc, so it replaces them
35.27 -in strings, comments etc. as well as in all identifiers.</b>
35.28 +<b>The <tt>lemon-0.x-to-1.x.sh</tt> script replaces the words \c graph,
35.29 +\c ugraph, \c edge and \c uedge in your own identifiers and in
35.30 +strings, comments etc. as well as in all LEMON specific identifiers.
35.31 +So use the script carefully and make a backup copy of your source files
35.32 +before applying the script to them.</b>
35.33
35.34 \section migration-lgf LGF tools
35.35 - The \ref lgf-format "LGF file format" has changed,
36.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
36.2 +++ b/doc/min_cost_flow.dox Thu Nov 05 15:50:01 2009 +0100
36.3 @@ -0,0 +1,153 @@
36.4 +/* -*- mode: C++; indent-tabs-mode: nil; -*-
36.5 + *
36.6 + * This file is a part of LEMON, a generic C++ optimization library.
36.7 + *
36.8 + * Copyright (C) 2003-2009
36.9 + * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
36.10 + * (Egervary Research Group on Combinatorial Optimization, EGRES).
36.11 + *
36.12 + * Permission to use, modify and distribute this software is granted
36.13 + * provided that this copyright notice appears in all copies. For
36.14 + * precise terms see the accompanying LICENSE file.
36.15 + *
36.16 + * This software is provided "AS IS" with no warranty of any kind,
36.17 + * express or implied, and with no claim as to its suitability for any
36.18 + * purpose.
36.19 + *
36.20 + */
36.21 +
36.22 +namespace lemon {
36.23 +
36.24 +/**
36.25 +\page min_cost_flow Minimum Cost Flow Problem
36.26 +
36.27 +\section mcf_def Definition (GEQ form)
36.28 +
36.29 +The \e minimum \e cost \e flow \e problem is to find a feasible flow of
36.30 +minimum total cost from a set of supply nodes to a set of demand nodes
36.31 +in a network with capacity constraints (lower and upper bounds)
36.32 +and arc costs \ref amo93networkflows.
36.33 +
36.34 +Formally, let \f$G=(V,A)\f$ be a digraph, \f$lower: A\rightarrow\mathbf{R}\f$,
36.35 +\f$upper: A\rightarrow\mathbf{R}\cup\{+\infty\}\f$ denote the lower and
36.36 +upper bounds for the flow values on the arcs, for which
36.37 +\f$lower(uv) \leq upper(uv)\f$ must hold for all \f$uv\in A\f$,
36.38 +\f$cost: A\rightarrow\mathbf{R}\f$ denotes the cost per unit flow
36.39 +on the arcs and \f$sup: V\rightarrow\mathbf{R}\f$ denotes the
36.40 +signed supply values of the nodes.
36.41 +If \f$sup(u)>0\f$, then \f$u\f$ is a supply node with \f$sup(u)\f$
36.42 +supply, if \f$sup(u)<0\f$, then \f$u\f$ is a demand node with
36.43 +\f$-sup(u)\f$ demand.
36.44 +A minimum cost flow is an \f$f: A\rightarrow\mathbf{R}\f$ solution
36.45 +of the following optimization problem.
36.46 +
36.47 +\f[ \min\sum_{uv\in A} f(uv) \cdot cost(uv) \f]
36.48 +\f[ \sum_{uv\in A} f(uv) - \sum_{vu\in A} f(vu) \geq
36.49 + sup(u) \quad \forall u\in V \f]
36.50 +\f[ lower(uv) \leq f(uv) \leq upper(uv) \quad \forall uv\in A \f]
36.51 +
36.52 +The sum of the supply values, i.e. \f$\sum_{u\in V} sup(u)\f$ must be
36.53 +zero or negative in order to have a feasible solution (since the sum
36.54 +of the expressions on the left-hand side of the inequalities is zero).
36.55 +It means that the total demand must be greater or equal to the total
36.56 +supply and all the supplies have to be carried out from the supply nodes,
36.57 +but there could be demands that are not satisfied.
36.58 +If \f$\sum_{u\in V} sup(u)\f$ is zero, then all the supply/demand
36.59 +constraints have to be satisfied with equality, i.e. all demands
36.60 +have to be satisfied and all supplies have to be used.
36.61 +
36.62 +
36.63 +\section mcf_algs Algorithms
36.64 +
36.65 +LEMON contains several algorithms for solving this problem, for more
36.66 +information see \ref min_cost_flow_algs "Minimum Cost Flow Algorithms".
36.67 +
36.68 +A feasible solution for this problem can be found using \ref Circulation.
36.69 +
36.70 +
36.71 +\section mcf_dual Dual Solution
36.72 +
36.73 +The dual solution of the minimum cost flow problem is represented by
36.74 +node potentials \f$\pi: V\rightarrow\mathbf{R}\f$.
36.75 +An \f$f: A\rightarrow\mathbf{R}\f$ primal feasible solution is optimal
36.76 +if and only if for some \f$\pi: V\rightarrow\mathbf{R}\f$ node potentials
36.77 +the following \e complementary \e slackness optimality conditions hold.
36.78 +
36.79 + - For all \f$uv\in A\f$ arcs:
36.80 + - if \f$cost^\pi(uv)>0\f$, then \f$f(uv)=lower(uv)\f$;
36.81 + - if \f$lower(uv)<f(uv)<upper(uv)\f$, then \f$cost^\pi(uv)=0\f$;
36.82 + - if \f$cost^\pi(uv)<0\f$, then \f$f(uv)=upper(uv)\f$.
36.83 + - For all \f$u\in V\f$ nodes:
36.84 + - \f$\pi(u)<=0\f$;
36.85 + - if \f$\sum_{uv\in A} f(uv) - \sum_{vu\in A} f(vu) \neq sup(u)\f$,
36.86 + then \f$\pi(u)=0\f$.
36.87 +
36.88 +Here \f$cost^\pi(uv)\f$ denotes the \e reduced \e cost of the arc
36.89 +\f$uv\in A\f$ with respect to the potential function \f$\pi\f$, i.e.
36.90 +\f[ cost^\pi(uv) = cost(uv) + \pi(u) - \pi(v).\f]
36.91 +
36.92 +All algorithms provide dual solution (node potentials), as well,
36.93 +if an optimal flow is found.
36.94 +
36.95 +
36.96 +\section mcf_eq Equality Form
36.97 +
36.98 +The above \ref mcf_def "definition" is actually more general than the
36.99 +usual formulation of the minimum cost flow problem, in which strict
36.100 +equalities are required in the supply/demand contraints.
36.101 +
36.102 +\f[ \min\sum_{uv\in A} f(uv) \cdot cost(uv) \f]
36.103 +\f[ \sum_{uv\in A} f(uv) - \sum_{vu\in A} f(vu) =
36.104 + sup(u) \quad \forall u\in V \f]
36.105 +\f[ lower(uv) \leq f(uv) \leq upper(uv) \quad \forall uv\in A \f]
36.106 +
36.107 +However if the sum of the supply values is zero, then these two problems
36.108 +are equivalent.
36.109 +The \ref min_cost_flow_algs "algorithms" in LEMON support the general
36.110 +form, so if you need the equality form, you have to ensure this additional
36.111 +contraint manually.
36.112 +
36.113 +
36.114 +\section mcf_leq Opposite Inequalites (LEQ Form)
36.115 +
36.116 +Another possible definition of the minimum cost flow problem is
36.117 +when there are <em>"less or equal"</em> (LEQ) supply/demand constraints,
36.118 +instead of the <em>"greater or equal"</em> (GEQ) constraints.
36.119 +
36.120 +\f[ \min\sum_{uv\in A} f(uv) \cdot cost(uv) \f]
36.121 +\f[ \sum_{uv\in A} f(uv) - \sum_{vu\in A} f(vu) \leq
36.122 + sup(u) \quad \forall u\in V \f]
36.123 +\f[ lower(uv) \leq f(uv) \leq upper(uv) \quad \forall uv\in A \f]
36.124 +
36.125 +It means that the total demand must be less or equal to the
36.126 +total supply (i.e. \f$\sum_{u\in V} sup(u)\f$ must be zero or
36.127 +positive) and all the demands have to be satisfied, but there
36.128 +could be supplies that are not carried out from the supply
36.129 +nodes.
36.130 +The equality form is also a special case of this form, of course.
36.131 +
36.132 +You could easily transform this case to the \ref mcf_def "GEQ form"
36.133 +of the problem by reversing the direction of the arcs and taking the
36.134 +negative of the supply values (e.g. using \ref ReverseDigraph and
36.135 +\ref NegMap adaptors).
36.136 +However \ref NetworkSimplex algorithm also supports this form directly
36.137 +for the sake of convenience.
36.138 +
36.139 +Note that the optimality conditions for this supply constraint type are
36.140 +slightly differ from the conditions that are discussed for the GEQ form,
36.141 +namely the potentials have to be non-negative instead of non-positive.
36.142 +An \f$f: A\rightarrow\mathbf{R}\f$ feasible solution of this problem
36.143 +is optimal if and only if for some \f$\pi: V\rightarrow\mathbf{R}\f$
36.144 +node potentials the following conditions hold.
36.145 +
36.146 + - For all \f$uv\in A\f$ arcs:
36.147 + - if \f$cost^\pi(uv)>0\f$, then \f$f(uv)=lower(uv)\f$;
36.148 + - if \f$lower(uv)<f(uv)<upper(uv)\f$, then \f$cost^\pi(uv)=0\f$;
36.149 + - if \f$cost^\pi(uv)<0\f$, then \f$f(uv)=upper(uv)\f$.
36.150 + - For all \f$u\in V\f$ nodes:
36.151 + - \f$\pi(u)>=0\f$;
36.152 + - if \f$\sum_{uv\in A} f(uv) - \sum_{vu\in A} f(vu) \neq sup(u)\f$,
36.153 + then \f$\pi(u)=0\f$.
36.154 +
36.155 +*/
36.156 +}
37.1 --- a/doc/named-param.dox Fri Oct 16 10:21:37 2009 +0200
37.2 +++ b/doc/named-param.dox Thu Nov 05 15:50:01 2009 +0100
37.3 @@ -2,7 +2,7 @@
37.4 *
37.5 * This file is a part of LEMON, a generic C++ optimization library.
37.6 *
37.7 - * Copyright (C) 2003-2008
37.8 + * Copyright (C) 2003-2009
37.9 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
37.10 * (Egervary Research Group on Combinatorial Optimization, EGRES).
37.11 *
38.1 --- a/doc/namespaces.dox Fri Oct 16 10:21:37 2009 +0200
38.2 +++ b/doc/namespaces.dox Thu Nov 05 15:50:01 2009 +0100
38.3 @@ -2,7 +2,7 @@
38.4 *
38.5 * This file is a part of LEMON, a generic C++ optimization library.
38.6 *
38.7 - * Copyright (C) 2003-2008
38.8 + * Copyright (C) 2003-2009
38.9 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
38.10 * (Egervary Research Group on Combinatorial Optimization, EGRES).
38.11 *
39.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
39.2 +++ b/doc/references.bib Thu Nov 05 15:50:01 2009 +0100
39.3 @@ -0,0 +1,301 @@
39.4 +%%%%% Defining LEMON %%%%%
39.5 +
39.6 +@misc{lemon,
39.7 + key = {LEMON},
39.8 + title = {{LEMON} -- {L}ibrary for {E}fficient {M}odeling and
39.9 + {O}ptimization in {N}etworks},
39.10 + howpublished = {\url{http://lemon.cs.elte.hu/}},
39.11 + year = 2009
39.12 +}
39.13 +
39.14 +@misc{egres,
39.15 + key = {EGRES},
39.16 + title = {{EGRES} -- {E}gerv{\'a}ry {R}esearch {G}roup on
39.17 + {C}ombinatorial {O}ptimization},
39.18 + url = {http://www.cs.elte.hu/egres/}
39.19 +}
39.20 +
39.21 +@misc{coinor,
39.22 + key = {COIN-OR},
39.23 + title = {{COIN-OR} -- {C}omputational {I}nfrastructure for
39.24 + {O}perations {R}esearch},
39.25 + url = {http://www.coin-or.org/}
39.26 +}
39.27 +
39.28 +
39.29 +%%%%% Other libraries %%%%%%
39.30 +
39.31 +@misc{boost,
39.32 + key = {Boost},
39.33 + title = {{B}oost {C++} {L}ibraries},
39.34 + url = {http://www.boost.org/}
39.35 +}
39.36 +
39.37 +@book{bglbook,
39.38 + author = {Jeremy G. Siek and Lee-Quan Lee and Andrew
39.39 + Lumsdaine},
39.40 + title = {The Boost Graph Library: User Guide and Reference
39.41 + Manual},
39.42 + publisher = {Addison-Wesley},
39.43 + year = 2002
39.44 +}
39.45 +
39.46 +@misc{leda,
39.47 + key = {LEDA},
39.48 + title = {{LEDA} -- {L}ibrary of {E}fficient {D}ata {T}ypes and
39.49 + {A}lgorithms},
39.50 + url = {http://www.algorithmic-solutions.com/}
39.51 +}
39.52 +
39.53 +@book{ledabook,
39.54 + author = {Kurt Mehlhorn and Stefan N{\"a}her},
39.55 + title = {{LEDA}: {A} platform for combinatorial and geometric
39.56 + computing},
39.57 + isbn = {0-521-56329-1},
39.58 + publisher = {Cambridge University Press},
39.59 + address = {New York, NY, USA},
39.60 + year = 1999
39.61 +}
39.62 +
39.63 +
39.64 +%%%%% Tools that LEMON depends on %%%%%
39.65 +
39.66 +@misc{cmake,
39.67 + key = {CMake},
39.68 + title = {{CMake} -- {C}ross {P}latform {M}ake},
39.69 + url = {http://www.cmake.org/}
39.70 +}
39.71 +
39.72 +@misc{doxygen,
39.73 + key = {Doxygen},
39.74 + title = {{Doxygen} -- {S}ource code documentation generator
39.75 + tool},
39.76 + url = {http://www.doxygen.org/}
39.77 +}
39.78 +
39.79 +
39.80 +%%%%% LP/MIP libraries %%%%%
39.81 +
39.82 +@misc{glpk,
39.83 + key = {GLPK},
39.84 + title = {{GLPK} -- {GNU} {L}inear {P}rogramming {K}it},
39.85 + url = {http://www.gnu.org/software/glpk/}
39.86 +}
39.87 +
39.88 +@misc{clp,
39.89 + key = {Clp},
39.90 + title = {{Clp} -- {Coin-Or} {L}inear {P}rogramming},
39.91 + url = {http://projects.coin-or.org/Clp/}
39.92 +}
39.93 +
39.94 +@misc{cbc,
39.95 + key = {Cbc},
39.96 + title = {{Cbc} -- {Coin-Or} {B}ranch and {C}ut},
39.97 + url = {http://projects.coin-or.org/Cbc/}
39.98 +}
39.99 +
39.100 +@misc{cplex,
39.101 + key = {CPLEX},
39.102 + title = {{ILOG} {CPLEX}},
39.103 + url = {http://www.ilog.com/}
39.104 +}
39.105 +
39.106 +@misc{soplex,
39.107 + key = {SoPlex},
39.108 + title = {{SoPlex} -- {T}he {S}equential {O}bject-{O}riented
39.109 + {S}implex},
39.110 + url = {http://soplex.zib.de/}
39.111 +}
39.112 +
39.113 +
39.114 +%%%%% General books %%%%%
39.115 +
39.116 +@book{amo93networkflows,
39.117 + author = {Ravindra K. Ahuja and Thomas L. Magnanti and James
39.118 + B. Orlin},
39.119 + title = {Network Flows: Theory, Algorithms, and Applications},
39.120 + publisher = {Prentice-Hall, Inc.},
39.121 + year = 1993,
39.122 + month = feb,
39.123 + isbn = {978-0136175490}
39.124 +}
39.125 +
39.126 +@book{schrijver03combinatorial,
39.127 + author = {Alexander Schrijver},
39.128 + title = {Combinatorial Optimization: Polyhedra and Efficiency},
39.129 + publisher = {Springer-Verlag},
39.130 + year = 2003,
39.131 + isbn = {978-3540443896}
39.132 +}
39.133 +
39.134 +@book{clrs01algorithms,
39.135 + author = {Thomas H. Cormen and Charles E. Leiserson and Ronald
39.136 + L. Rivest and Clifford Stein},
39.137 + title = {Introduction to Algorithms},
39.138 + publisher = {The MIT Press},
39.139 + year = 2001,
39.140 + edition = {2nd}
39.141 +}
39.142 +
39.143 +@book{stroustrup00cpp,
39.144 + author = {Bjarne Stroustrup},
39.145 + title = {The C++ Programming Language},
39.146 + edition = {3rd},
39.147 + publisher = {Addison-Wesley Professional},
39.148 + isbn = 0201700735,
39.149 + month = {February},
39.150 + year = 2000
39.151 +}
39.152 +
39.153 +
39.154 +%%%%% Maximum flow algorithms %%%%%
39.155 +
39.156 +@article{edmondskarp72theoretical,
39.157 + author = {Jack Edmonds and Richard M. Karp},
39.158 + title = {Theoretical improvements in algorithmic efficiency
39.159 + for network flow problems},
39.160 + journal = {Journal of the ACM},
39.161 + year = 1972,
39.162 + volume = 19,
39.163 + number = 2,
39.164 + pages = {248-264}
39.165 +}
39.166 +
39.167 +@article{goldberg88newapproach,
39.168 + author = {Andrew V. Goldberg and Robert E. Tarjan},
39.169 + title = {A new approach to the maximum flow problem},
39.170 + journal = {Journal of the ACM},
39.171 + year = 1988,
39.172 + volume = 35,
39.173 + number = 4,
39.174 + pages = {921-940}
39.175 +}
39.176 +
39.177 +@article{dinic70algorithm,
39.178 + author = {E. A. Dinic},
39.179 + title = {Algorithm for solution of a problem of maximum flow
39.180 + in a network with power estimation},
39.181 + journal = {Soviet Math. Doklady},
39.182 + year = 1970,
39.183 + volume = 11,
39.184 + pages = {1277-1280}
39.185 +}
39.186 +
39.187 +@article{goldberg08partial,
39.188 + author = {Andrew V. Goldberg},
39.189 + title = {The Partial Augment-Relabel Algorithm for the
39.190 + Maximum Flow Problem},
39.191 + journal = {16th Annual European Symposium on Algorithms},
39.192 + year = 2008,
39.193 + pages = {466-477}
39.194 +}
39.195 +
39.196 +@article{sleator83dynamic,
39.197 + author = {Daniel D. Sleator and Robert E. Tarjan},
39.198 + title = {A data structure for dynamic trees},
39.199 + journal = {Journal of Computer and System Sciences},
39.200 + year = 1983,
39.201 + volume = 26,
39.202 + number = 3,
39.203 + pages = {362-391}
39.204 +}
39.205 +
39.206 +
39.207 +%%%%% Minimum mean cycle algorithms %%%%%
39.208 +
39.209 +@article{karp78characterization,
39.210 + author = {Richard M. Karp},
39.211 + title = {A characterization of the minimum cycle mean in a
39.212 + digraph},
39.213 + journal = {Discrete Math.},
39.214 + year = 1978,
39.215 + volume = 23,
39.216 + pages = {309-311}
39.217 +}
39.218 +
39.219 +@article{dasdan98minmeancycle,
39.220 + author = {Ali Dasdan and Rajesh K. Gupta},
39.221 + title = {Faster Maximum and Minimum Mean Cycle Alogrithms for
39.222 + System Performance Analysis},
39.223 + journal = {IEEE Transactions on Computer-Aided Design of
39.224 + Integrated Circuits and Systems},
39.225 + year = 1998,
39.226 + volume = 17,
39.227 + number = 10,
39.228 + pages = {889-899}
39.229 +}
39.230 +
39.231 +
39.232 +%%%%% Minimum cost flow algorithms %%%%%
39.233 +
39.234 +@article{klein67primal,
39.235 + author = {Morton Klein},
39.236 + title = {A primal method for minimal cost flows with
39.237 + applications to the assignment and transportation
39.238 + problems},
39.239 + journal = {Management Science},
39.240 + year = 1967,
39.241 + volume = 14,
39.242 + pages = {205-220}
39.243 +}
39.244 +
39.245 +@article{goldberg89cyclecanceling,
39.246 + author = {Andrew V. Goldberg and Robert E. Tarjan},
39.247 + title = {Finding minimum-cost circulations by canceling
39.248 + negative cycles},
39.249 + journal = {Journal of the ACM},
39.250 + year = 1989,
39.251 + volume = 36,
39.252 + number = 4,
39.253 + pages = {873-886}
39.254 +}
39.255 +
39.256 +@article{goldberg90approximation,
39.257 + author = {Andrew V. Goldberg and Robert E. Tarjan},
39.258 + title = {Finding Minimum-Cost Circulations by Successive
39.259 + Approximation},
39.260 + journal = {Mathematics of Operations Research},
39.261 + year = 1990,
39.262 + volume = 15,
39.263 + number = 3,
39.264 + pages = {430-466}
39.265 +}
39.266 +
39.267 +@article{goldberg97efficient,
39.268 + author = {Andrew V. Goldberg},
39.269 + title = {An Efficient Implementation of a Scaling
39.270 + Minimum-Cost Flow Algorithm},
39.271 + journal = {Journal of Algorithms},
39.272 + year = 1997,
39.273 + volume = 22,
39.274 + number = 1,
39.275 + pages = {1-29}
39.276 +}
39.277 +
39.278 +@article{bunnagel98efficient,
39.279 + author = {Ursula B{\"u}nnagel and Bernhard Korte and Jens
39.280 + Vygen},
39.281 + title = {Efficient implementation of the {G}oldberg-{T}arjan
39.282 + minimum-cost flow algorithm},
39.283 + journal = {Optimization Methods and Software},
39.284 + year = 1998,
39.285 + volume = 10,
39.286 + pages = {157-174}
39.287 +}
39.288 +
39.289 +@book{dantzig63linearprog,
39.290 + author = {George B. Dantzig},
39.291 + title = {Linear Programming and Extensions},
39.292 + publisher = {Princeton University Press},
39.293 + year = 1963
39.294 +}
39.295 +
39.296 +@mastersthesis{kellyoneill91netsimplex,
39.297 + author = {Damian J. Kelly and Garrett M. O'Neill},
39.298 + title = {The Minimum Cost Flow Problem and The Network
39.299 + Simplex Method},
39.300 + school = {University College},
39.301 + address = {Dublin, Ireland},
39.302 + year = 1991,
39.303 + month = sep,
39.304 +}
40.1 --- a/doc/template.h Fri Oct 16 10:21:37 2009 +0200
40.2 +++ b/doc/template.h Thu Nov 05 15:50:01 2009 +0100
40.3 @@ -2,7 +2,7 @@
40.4 *
40.5 * This file is a part of LEMON, a generic C++ optimization library.
40.6 *
40.7 - * Copyright (C) 2003-2008
40.8 + * Copyright (C) 2003-2009
40.9 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
40.10 * (Egervary Research Group on Combinatorial Optimization, EGRES).
40.11 *
41.1 --- a/lemon/CMakeLists.txt Fri Oct 16 10:21:37 2009 +0200
41.2 +++ b/lemon/CMakeLists.txt Thu Nov 05 15:50:01 2009 +0100
41.3 @@ -1,5 +1,5 @@
41.4 INCLUDE_DIRECTORIES(
41.5 - ${CMAKE_SOURCE_DIR}
41.6 + ${PROJECT_SOURCE_DIR}
41.7 ${PROJECT_BINARY_DIR}
41.8 )
41.9
41.10 @@ -8,26 +8,61 @@
41.11 ${CMAKE_CURRENT_BINARY_DIR}/config.h
41.12 )
41.13
41.14 -ADD_LIBRARY(lemon
41.15 +SET(LEMON_SOURCES
41.16 arg_parser.cc
41.17 base.cc
41.18 color.cc
41.19 + lp_base.cc
41.20 + lp_skeleton.cc
41.21 random.cc
41.22 bits/windows.cc
41.23 )
41.24
41.25 +IF(LEMON_HAVE_GLPK)
41.26 + SET(LEMON_SOURCES ${LEMON_SOURCES} glpk.cc)
41.27 + INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIRS})
41.28 + IF(WIN32)
41.29 + INSTALL(FILES ${GLPK_BIN_DIR}/glpk.dll DESTINATION bin)
41.30 + INSTALL(FILES ${GLPK_BIN_DIR}/libltdl3.dll DESTINATION bin)
41.31 + INSTALL(FILES ${GLPK_BIN_DIR}/zlib1.dll DESTINATION bin)
41.32 + ENDIF()
41.33 +ENDIF()
41.34 +
41.35 +IF(LEMON_HAVE_CPLEX)
41.36 + SET(LEMON_SOURCES ${LEMON_SOURCES} cplex.cc)
41.37 + INCLUDE_DIRECTORIES(${CPLEX_INCLUDE_DIRS})
41.38 +ENDIF()
41.39 +
41.40 +IF(LEMON_HAVE_CLP)
41.41 + SET(LEMON_SOURCES ${LEMON_SOURCES} clp.cc)
41.42 + INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS})
41.43 +ENDIF()
41.44 +
41.45 +IF(LEMON_HAVE_CBC)
41.46 + SET(LEMON_SOURCES ${LEMON_SOURCES} cbc.cc)
41.47 + INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS})
41.48 +ENDIF()
41.49 +
41.50 +ADD_LIBRARY(lemon ${LEMON_SOURCES})
41.51 +IF(UNIX)
41.52 + SET_TARGET_PROPERTIES(lemon PROPERTIES OUTPUT_NAME emon)
41.53 +ENDIF()
41.54 +
41.55 INSTALL(
41.56 TARGETS lemon
41.57 ARCHIVE DESTINATION lib
41.58 - COMPONENT library)
41.59 + COMPONENT library
41.60 +)
41.61
41.62 INSTALL(
41.63 DIRECTORY . bits concepts
41.64 DESTINATION include/lemon
41.65 COMPONENT headers
41.66 - FILES_MATCHING PATTERN "*.h")
41.67 + FILES_MATCHING PATTERN "*.h"
41.68 +)
41.69
41.70 INSTALL(
41.71 FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h
41.72 DESTINATION include/lemon
41.73 - COMPONENT headers)
41.74 + COMPONENT headers
41.75 +)
42.1 --- a/lemon/Makefile.am Fri Oct 16 10:21:37 2009 +0200
42.2 +++ b/lemon/Makefile.am Thu Nov 05 15:50:01 2009 +0100
42.3 @@ -1,62 +1,139 @@
42.4 EXTRA_DIST += \
42.5 lemon/lemon.pc.in \
42.6 - lemon/CMakeLists.txt
42.7 + lemon/CMakeLists.txt \
42.8 + lemon/config.h.cmake
42.9
42.10 pkgconfig_DATA += lemon/lemon.pc
42.11
42.12 lib_LTLIBRARIES += lemon/libemon.la
42.13
42.14 lemon_libemon_la_SOURCES = \
42.15 - lemon/arg_parser.cc \
42.16 - lemon/base.cc \
42.17 - lemon/color.cc \
42.18 - lemon/random.cc \
42.19 + lemon/arg_parser.cc \
42.20 + lemon/base.cc \
42.21 + lemon/color.cc \
42.22 + lemon/lp_base.cc \
42.23 + lemon/lp_skeleton.cc \
42.24 + lemon/random.cc \
42.25 lemon/bits/windows.cc
42.26
42.27 -#lemon_libemon_la_CXXFLAGS = $(GLPK_CFLAGS) $(CPLEX_CFLAGS) $(SOPLEX_CXXFLAGS)
42.28 -#lemon_libemon_la_LDFLAGS = $(GLPK_LIBS) $(CPLEX_LIBS) $(SOPLEX_LIBS)
42.29 +nodist_lemon_HEADERS = lemon/config.h
42.30
42.31 -nodist_lemon_HEADERS = lemon/config.h
42.32 +lemon_libemon_la_CXXFLAGS = \
42.33 + $(AM_CXXFLAGS) \
42.34 + $(GLPK_CFLAGS) \
42.35 + $(CPLEX_CFLAGS) \
42.36 + $(SOPLEX_CXXFLAGS) \
42.37 + $(CLP_CXXFLAGS) \
42.38 + $(CBC_CXXFLAGS)
42.39 +
42.40 +lemon_libemon_la_LDFLAGS = \
42.41 + $(GLPK_LIBS) \
42.42 + $(CPLEX_LIBS) \
42.43 + $(SOPLEX_LIBS) \
42.44 + $(CLP_LIBS) \
42.45 + $(CBC_LIBS)
42.46 +
42.47 +if HAVE_GLPK
42.48 +lemon_libemon_la_SOURCES += lemon/glpk.cc
42.49 +endif
42.50 +
42.51 +if HAVE_CPLEX
42.52 +lemon_libemon_la_SOURCES += lemon/cplex.cc
42.53 +endif
42.54 +
42.55 +if HAVE_SOPLEX
42.56 +lemon_libemon_la_SOURCES += lemon/soplex.cc
42.57 +endif
42.58 +
42.59 +if HAVE_CLP
42.60 +lemon_libemon_la_SOURCES += lemon/clp.cc
42.61 +endif
42.62 +
42.63 +if HAVE_CBC
42.64 +lemon_libemon_la_SOURCES += lemon/cbc.cc
42.65 +endif
42.66
42.67 lemon_HEADERS += \
42.68 - lemon/arg_parser.h \
42.69 + lemon/adaptors.h \
42.70 + lemon/arg_parser.h \
42.71 lemon/assert.h \
42.72 - lemon/bfs.h \
42.73 - lemon/bin_heap.h \
42.74 - lemon/color.h \
42.75 + lemon/bellman_ford.h \
42.76 + lemon/bfs.h \
42.77 + lemon/bin_heap.h \
42.78 + lemon/binom_heap.h \
42.79 + lemon/bucket_heap.h \
42.80 + lemon/cbc.h \
42.81 + lemon/circulation.h \
42.82 + lemon/clp.h \
42.83 + lemon/color.h \
42.84 lemon/concept_check.h \
42.85 - lemon/counter.h \
42.86 + lemon/connectivity.h \
42.87 + lemon/counter.h \
42.88 lemon/core.h \
42.89 - lemon/dfs.h \
42.90 - lemon/dijkstra.h \
42.91 - lemon/dim2.h \
42.92 + lemon/cplex.h \
42.93 + lemon/dfs.h \
42.94 + lemon/dijkstra.h \
42.95 + lemon/dim2.h \
42.96 + lemon/dimacs.h \
42.97 + lemon/edge_set.h \
42.98 + lemon/elevator.h \
42.99 lemon/error.h \
42.100 - lemon/graph_to_eps.h \
42.101 + lemon/euler.h \
42.102 + lemon/fib_heap.h \
42.103 + lemon/fourary_heap.h \
42.104 + lemon/full_graph.h \
42.105 + lemon/glpk.h \
42.106 + lemon/gomory_hu.h \
42.107 + lemon/graph_to_eps.h \
42.108 + lemon/grid_graph.h \
42.109 + lemon/hartmann_orlin.h \
42.110 + lemon/howard.h \
42.111 + lemon/hypercube_graph.h \
42.112 + lemon/karp.h \
42.113 + lemon/kary_heap.h \
42.114 lemon/kruskal.h \
42.115 + lemon/hao_orlin.h \
42.116 lemon/lgf_reader.h \
42.117 lemon/lgf_writer.h \
42.118 lemon/list_graph.h \
42.119 + lemon/lp.h \
42.120 + lemon/lp_base.h \
42.121 + lemon/lp_skeleton.h \
42.122 lemon/maps.h \
42.123 + lemon/matching.h \
42.124 lemon/math.h \
42.125 + lemon/min_cost_arborescence.h \
42.126 + lemon/nauty_reader.h \
42.127 + lemon/network_simplex.h \
42.128 + lemon/pairing_heap.h \
42.129 lemon/path.h \
42.130 - lemon/random.h \
42.131 + lemon/preflow.h \
42.132 + lemon/radix_heap.h \
42.133 + lemon/radix_sort.h \
42.134 + lemon/random.h \
42.135 lemon/smart_graph.h \
42.136 - lemon/time_measure.h \
42.137 - lemon/tolerance.h \
42.138 + lemon/soplex.h \
42.139 + lemon/static_graph.h \
42.140 + lemon/suurballe.h \
42.141 + lemon/time_measure.h \
42.142 + lemon/tolerance.h \
42.143 lemon/unionfind.h \
42.144 lemon/bits/windows.h
42.145
42.146 bits_HEADERS += \
42.147 lemon/bits/alteration_notifier.h \
42.148 lemon/bits/array_map.h \
42.149 - lemon/bits/base_extender.h \
42.150 - lemon/bits/bezier.h \
42.151 + lemon/bits/bezier.h \
42.152 lemon/bits/default_map.h \
42.153 - lemon/bits/enable_if.h \
42.154 + lemon/bits/edge_set_extender.h \
42.155 + lemon/bits/enable_if.h \
42.156 + lemon/bits/graph_adaptor_extender.h \
42.157 lemon/bits/graph_extender.h \
42.158 lemon/bits/map_extender.h \
42.159 lemon/bits/path_dump.h \
42.160 + lemon/bits/solver_bits.h \
42.161 lemon/bits/traits.h \
42.162 + lemon/bits/variant.h \
42.163 lemon/bits/vector_map.h
42.164
42.165 concept_HEADERS += \
43.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
43.2 +++ b/lemon/adaptors.h Thu Nov 05 15:50:01 2009 +0100
43.3 @@ -0,0 +1,3614 @@
43.4 +/* -*- mode: C++; indent-tabs-mode: nil; -*-
43.5 + *
43.6 + * This file is a part of LEMON, a generic C++ optimization library.
43.7 + *
43.8 + * Copyright (C) 2003-2009
43.9 + * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
43.10 + * (Egervary Research Group on Combinatorial Optimization, EGRES).
43.11 + *
43.12 + * Permission to use, modify and distribute this software is granted
43.13 + * provided that this copyright notice appears in all copies. For
43.14 + * precise terms see the accompanying LICENSE file.
43.15 + *
43.16 + * This software is provided "AS IS" with no warranty of any kind,
43.17 + * express or implied, and with no claim as to its suitability for any
43.18 + * purpose.
43.19 + *
43.20 + */
43.21 +
43.22 +#ifndef LEMON_ADAPTORS_H
43.23 +#define LEMON_ADAPTORS_H
43.24 +
43.25 +/// \ingroup graph_adaptors
43.26 +/// \file
43.27 +/// \brief Adaptor classes for digraphs and graphs
43.28 +///
43.29 +/// This file contains several useful adaptors for digraphs and graphs.
43.30 +
43.31 +#include <lemon/core.h>
43.32 +#include <lemon/maps.h>
43.33 +#include <lemon/bits/variant.h>
43.34 +
43.35 +#include <lemon/bits/graph_adaptor_extender.h>
43.36 +#include <lemon/bits/map_extender.h>
43.37 +#include <lemon/tolerance.h>
43.38 +
43.39 +#include <algorithm>
43.40 +
43.41 +namespace lemon {
43.42 +
43.43 +#ifdef _MSC_VER
43.44 +#define LEMON_SCOPE_FIX(OUTER, NESTED) OUTER::NESTED
43.45 +#else
43.46 +#define LEMON_SCOPE_FIX(OUTER, NESTED) typename OUTER::template NESTED
43.47 +#endif
43.48 +
43.49 + template<typename DGR>
43.50 + class DigraphAdaptorBase {
43.51 + public:
43.52 + typedef DGR Digraph;
43.53 + typedef DigraphAdaptorBase Adaptor;
43.54 +
43.55 + protected:
43.56 + DGR* _digraph;
43.57 + DigraphAdaptorBase() : _digraph(0) { }
43.58 + void initialize(DGR& digraph) { _digraph = &digraph; }
43.59 +
43.60 + public:
43.61 + DigraphAdaptorBase(DGR& digraph) : _digraph(&digraph) { }
43.62 +
43.63 + typedef typename DGR::Node Node;
43.64 + typedef typename DGR::Arc Arc;
43.65 +
43.66 + void first(Node& i) const { _digraph->first(i); }
43.67 + void first(Arc& i) const { _digraph->first(i); }
43.68 + void firstIn(Arc& i, const Node& n) const { _digraph->firstIn(i, n); }
43.69 + void firstOut(Arc& i, const Node& n ) const { _digraph->firstOut(i, n); }
43.70 +
43.71 + void next(Node& i) const { _digraph->next(i); }
43.72 + void next(Arc& i) const { _digraph->next(i); }
43.73 + void nextIn(Arc& i) const { _digraph->nextIn(i); }
43.74 + void nextOut(Arc& i) const { _digraph->nextOut(i); }
43.75 +
43.76 + Node source(const Arc& a) const { return _digraph->source(a); }
43.77 + Node target(const Arc& a) const { return _digraph->target(a); }
43.78 +
43.79 + typedef NodeNumTagIndicator<DGR> NodeNumTag;
43.80 + int nodeNum() const { return _digraph->nodeNum(); }
43.81 +
43.82 + typedef ArcNumTagIndicator<DGR> ArcNumTag;
43.83 + int arcNum() const { return _digraph->arcNum(); }
43.84 +
43.85 + typedef FindArcTagIndicator<DGR> FindArcTag;
43.86 + Arc findArc(const Node& u, const Node& v, const Arc& prev = INVALID) const {
43.87 + return _digraph->findArc(u, v, prev);
43.88 + }
43.89 +
43.90 + Node addNode() { return _digraph->addNode(); }
43.91 + Arc addArc(const Node& u, const Node& v) { return _digraph->addArc(u, v); }
43.92 +
43.93 + void erase(const Node& n) { _digraph->erase(n); }
43.94 + void erase(const Arc& a) { _digraph->erase(a); }
43.95 +
43.96 + void clear() { _digraph->clear(); }
43.97 +
43.98 + int id(const Node& n) const { return _digraph->id(n); }
43.99 + int id(const Arc& a) const { return _digraph->id(a); }
43.100 +
43.101 + Node nodeFromId(int ix) const { return _digraph->nodeFromId(ix); }
43.102 + Arc arcFromId(int ix) const { return _digraph->arcFromId(ix); }
43.103 +
43.104 + int maxNodeId() const { return _digraph->maxNodeId(); }
43.105 + int maxArcId() const { return _digraph->maxArcId(); }
43.106 +
43.107 + typedef typename ItemSetTraits<DGR, Node>::ItemNotifier NodeNotifier;
43.108 + NodeNotifier& notifier(Node) const { return _digraph->notifier(Node()); }
43.109 +
43.110 + typedef typename ItemSetTraits<DGR, Arc>::ItemNotifier ArcNotifier;
43.111 + ArcNotifier& notifier(Arc) const { return _digraph->notifier(Arc()); }
43.112 +
43.113 + template <typename V>
43.114 + class NodeMap : public DGR::template NodeMap<V> {
43.115 + typedef typename DGR::template NodeMap<V> Parent;
43.116 +
43.117 + public:
43.118 + explicit NodeMap(const Adaptor& adaptor)
43.119 + : Parent(*adaptor._digraph) {}
43.120 + NodeMap(const Adaptor& adaptor, const V& value)
43.121 + : Parent(*adaptor._digraph, value) { }
43.122 +
43.123 + private:
43.124 + NodeMap& operator=(const NodeMap& cmap) {
43.125 + return operator=<NodeMap>(cmap);
43.126 + }
43.127 +
43.128 + template <typename CMap>
43.129 + NodeMap& operator=(const CMap& cmap) {
43.130 + Parent::operator=(cmap);
43.131 + return *this;
43.132 + }
43.133 +
43.134 + };
43.135 +
43.136 + template <typename V>
43.137 + class ArcMap : public DGR::template ArcMap<V> {
43.138 + typedef typename DGR::template ArcMap<V> Parent;
43.139 +
43.140 + public:
43.141 + explicit ArcMap(const DigraphAdaptorBase<DGR>& adaptor)
43.142 + : Parent(*adaptor._digraph) {}
43.143 + ArcMap(const DigraphAdaptorBase<DGR>& adaptor, const V& value)
43.144 + : Parent(*adaptor._digraph, value) {}
43.145 +
43.146 + private:
43.147 + ArcMap& operator=(const ArcMap& cmap) {
43.148 + return operator=<ArcMap>(cmap);
43.149 + }
43.150 +
43.151 + template <typename CMap>
43.152 + ArcMap& operator=(const CMap& cmap) {
43.153 + Parent::operator=(cmap);
43.154 + return *this;
43.155 + }
43.156 +
43.157 + };
43.158 +
43.159 + };
43.160 +
43.161 + template<typename GR>
43.162 + class GraphAdaptorBase {
43.163 + public:
43.164 + typedef GR Graph;
43.165 +
43.166 + protected:
43.167 + GR* _graph;
43.168 +
43.169 + GraphAdaptorBase() : _graph(0) {}
43.170 +
43.171 + void initialize(GR& graph) { _graph = &graph; }
43.172 +
43.173 + public:
43.174 + GraphAdaptorBase(GR& graph) : _graph(&graph) {}
43.175 +
43.176 + typedef typename GR::Node Node;
43.177 + typedef typename GR::Arc Arc;
43.178 + typedef typename GR::Edge Edge;
43.179 +
43.180 + void first(Node& i) const { _graph->first(i); }
43.181 + void first(Arc& i) const { _graph->first(i); }
43.182 + void first(Edge& i) const { _graph->first(i); }
43.183 + void firstIn(Arc& i, const Node& n) const { _graph->firstIn(i, n); }
43.184 + void firstOut(Arc& i, const Node& n ) const { _graph->firstOut(i, n); }
43.185 + void firstInc(Edge &i, bool &d, const Node &n) const {
43.186 + _graph->firstInc(i, d, n);
43.187 + }
43.188 +
43.189 + void next(Node& i) const { _graph->next(i); }
43.190 + void next(Arc& i) const { _graph->next(i); }
43.191 + void next(Edge& i) const { _graph->next(i); }
43.192 + void nextIn(Arc& i) const { _graph->nextIn(i); }
43.193 + void nextOut(Arc& i) const { _graph->nextOut(i); }
43.194 + void nextInc(Edge &i, bool &d) const { _graph->nextInc(i, d); }
43.195 +
43.196 + Node u(const Edge& e) const { return _graph->u(e); }
43.197 + Node v(const Edge& e) const { return _graph->v(e); }
43.198 +
43.199 + Node source(const Arc& a) const { return _graph->source(a); }
43.200 + Node target(const Arc& a) const { return _graph->target(a); }
43.201 +
43.202 + typedef NodeNumTagIndicator<Graph> NodeNumTag;
43.203 + int nodeNum() const { return _graph->nodeNum(); }
43.204 +
43.205 + typedef ArcNumTagIndicator<Graph> ArcNumTag;
43.206 + int arcNum() const { return _graph->arcNum(); }
43.207 +
43.208 + typedef EdgeNumTagIndicator<Graph> EdgeNumTag;
43.209 + int edgeNum() const { return _graph->edgeNum(); }
43.210 +
43.211 + typedef FindArcTagIndicator<Graph> FindArcTag;
43.212 + Arc findArc(const Node& u, const Node& v,
43.213 + const Arc& prev = INVALID) const {
43.214 + return _graph->findArc(u, v, prev);
43.215 + }
43.216 +
43.217 + typedef FindEdgeTagIndicator<Graph> FindEdgeTag;
43.218 + Edge findEdge(const Node& u, const Node& v,
43.219 + const Edge& prev = INVALID) const {
43.220 + return _graph->findEdge(u, v, prev);
43.221 + }
43.222 +
43.223 + Node addNode() { return _graph->addNode(); }
43.224 + Edge addEdge(const Node& u, const Node& v) { return _graph->addEdge(u, v); }
43.225 +
43.226 + void erase(const Node& i) { _graph->erase(i); }
43.227 + void erase(const Edge& i) { _graph->erase(i); }
43.228 +
43.229 + void clear() { _graph->clear(); }
43.230 +
43.231 + bool direction(const Arc& a) const { return _graph->direction(a); }
43.232 + Arc direct(const Edge& e, bool d) const { return _graph->direct(e, d); }
43.233 +
43.234 + int id(const Node& v) const { return _graph->id(v); }
43.235 + int id(const Arc& a) const { return _graph->id(a); }
43.236 + int id(const Edge& e) const { return _graph->id(e); }
43.237 +
43.238 + Node nodeFromId(int ix) const { return _graph->nodeFromId(ix); }
43.239 + Arc arcFromId(int ix) const { return _graph->arcFromId(ix); }
43.240 + Edge edgeFromId(int ix) const { return _graph->edgeFromId(ix); }
43.241 +
43.242 + int maxNodeId() const { return _graph->maxNodeId(); }
43.243 + int maxArcId() const { return _graph->maxArcId(); }
43.244 + int maxEdgeId() const { return _graph->maxEdgeId(); }
43.245 +
43.246 + typedef typename ItemSetTraits<GR, Node>::ItemNotifier NodeNotifier;
43.247 + NodeNotifier& notifier(Node) const { return _graph->notifier(Node()); }
43.248 +
43.249 + typedef typename ItemSetTraits<GR, Arc>::ItemNotifier ArcNotifier;
43.250 + ArcNotifier& notifier(Arc) const { return _graph->notifier(Arc()); }
43.251 +
43.252 + typedef typename ItemSetTraits<GR, Edge>::ItemNotifier EdgeNotifier;
43.253 + EdgeNotifier& notifier(Edge) const { return _graph->notifier(Edge()); }
43.254 +
43.255 + template <typename V>
43.256 + class NodeMap : public GR::template NodeMap<V> {
43.257 + typedef typename GR::template NodeMap<V> Parent;
43.258 +
43.259 + public:
43.260 + explicit NodeMap(const GraphAdaptorBase<GR>& adapter)
43.261 + : Parent(*adapter._graph) {}
43.262 + NodeMap(const GraphAdaptorBase<GR>& adapter, const V& value)
43.263 + : Parent(*adapter._graph, value) {}
43.264 +
43.265 + private:
43.266 + NodeMap& operator=(const NodeMap& cmap) {
43.267 + return operator=<NodeMap>(cmap);
43.268 + }
43.269 +
43.270 + template <typename CMap>
43.271 + NodeMap& operator=(const CMap& cmap) {
43.272 + Parent::operator=(cmap);
43.273 + return *this;
43.274 + }
43.275 +
43.276 + };
43.277 +
43.278 + template <typename V>
43.279 + class ArcMap : public GR::template ArcMap<V> {
43.280 + typedef typename GR::template ArcMap<V> Parent;
43.281 +
43.282 + public:
43.283 + explicit ArcMap(const GraphAdaptorBase<GR>& adapter)
43.284 + : Parent(*adapter._graph) {}
43.285 + ArcMap(const GraphAdaptorBase<GR>& adapter, const V& value)
43.286 + : Parent(*adapter._graph, value) {}
43.287 +
43.288 + private:
43.289 + ArcMap& operator=(const ArcMap& cmap) {
43.290 + return operator=<ArcMap>(cmap);
43.291 + }
43.292 +
43.293 + template <typename CMap>
43.294 + ArcMap& operator=(const CMap& cmap) {
43.295 + Parent::operator=(cmap);
43.296 + return *this;
43.297 + }
43.298 + };
43.299 +
43.300 + template <typename V>
43.301 + class EdgeMap : public GR::template EdgeMap<V> {
43.302 + typedef typename GR::template EdgeMap<V> Parent;
43.303 +
43.304 + public:
43.305 + explicit EdgeMap(const GraphAdaptorBase<GR>& adapter)
43.306 + : Parent(*adapter._graph) {}
43.307 + EdgeMap(const GraphAdaptorBase<GR>& adapter, const V& value)
43.308 + : Parent(*adapter._graph, value) {}
43.309 +
43.310 + private:
43.311 + EdgeMap& operator=(const EdgeMap& cmap) {
43.312 + return operator=<EdgeMap>(cmap);
43.313 + }
43.314 +
43.315 + template <typename CMap>
43.316 + EdgeMap& operator=(const CMap& cmap) {
43.317 + Parent::operator=(cmap);
43.318 + return *this;
43.319 + }
43.320 + };
43.321 +
43.322 + };
43.323 +
43.324 + template <typename DGR>
43.325 + class ReverseDigraphBase : public DigraphAdaptorBase<DGR> {
43.326 + typedef DigraphAdaptorBase<DGR> Parent;
43.327 + public:
43.328 + typedef DGR Digraph;
43.329 + protected:
43.330 + ReverseDigraphBase() : Parent() { }
43.331 + public:
43.332 + typedef typename Parent::Node Node;
43.333 + typedef typename Parent::Arc Arc;
43.334 +
43.335 + void firstIn(Arc& a, const Node& n) const { Parent::firstOut(a, n); }
43.336 + void firstOut(Arc& a, const Node& n ) const { Parent::firstIn(a, n); }
43.337 +
43.338 + void nextIn(Arc& a) const { Parent::nextOut(a); }
43.339 + void nextOut(Arc& a) const { Parent::nextIn(a); }
43.340 +
43.341 + Node source(const Arc& a) const { return Parent::target(a); }
43.342 + Node target(const Arc& a) const { return Parent::source(a); }
43.343 +
43.344 + Arc addArc(const Node& u, const Node& v) { return Parent::addArc(v, u); }
43.345 +
43.346 + typedef FindArcTagIndicator<DGR> FindArcTag;
43.347 + Arc findArc(const Node& u, const Node& v,
43.348 + const Arc& prev = INVALID) const {
43.349 + return Parent::findArc(v, u, prev);
43.350 + }
43.351 +
43.352 + };
43.353 +
43.354 + /// \ingroup graph_adaptors
43.355 + ///
43.356 + /// \brief Adaptor class for reversing the orientation of the arcs in
43.357 + /// a digraph.
43.358 + ///
43.359 + /// ReverseDigraph can be used for reversing the arcs in a digraph.
43.360 + /// It conforms to the \ref concepts::Digraph "Digraph" concept.
43.361 + ///
43.362 + /// The adapted digraph can also be modified through this adaptor
43.363 + /// by adding or removing nodes or arcs, unless the \c GR template
43.364 + /// parameter is set to be \c const.
43.365 + ///
43.366 + /// \tparam DGR The type of the adapted digraph.
43.367 + /// It must conform to the \ref concepts::Digraph "Digraph" concept.
43.368 + /// It can also be specified to be \c const.
43.369 + ///
43.370 + /// \note The \c Node and \c Arc types of this adaptor and the adapted
43.371 + /// digraph are convertible to each other.
43.372 + template<typename DGR>
43.373 +#ifdef DOXYGEN
43.374 + class ReverseDigraph {
43.375 +#else
43.376 + class ReverseDigraph :
43.377 + public DigraphAdaptorExtender<ReverseDigraphBase<DGR> > {
43.378 +#endif
43.379 + typedef DigraphAdaptorExtender<ReverseDigraphBase<DGR> > Parent;
43.380 + public:
43.381 + /// The type of the adapted digraph.
43.382 + typedef DGR Digraph;
43.383 + protected:
43.384 + ReverseDigraph() { }
43.385 + public:
43.386 +
43.387 + /// \brief Constructor
43.388 + ///
43.389 + /// Creates a reverse digraph adaptor for the given digraph.
43.390 + explicit ReverseDigraph(DGR& digraph) {
43.391 + Parent::initialize(digraph);
43.392 + }
43.393 + };
43.394 +
43.395 + /// \brief Returns a read-only ReverseDigraph adaptor
43.396 + ///
43.397 + /// This function just returns a read-only \ref ReverseDigraph adaptor.
43.398 + /// \ingroup graph_adaptors
43.399 + /// \relates ReverseDigraph
43.400 + template<typename DGR>
43.401 + ReverseDigraph<const DGR> reverseDigraph(const DGR& digraph) {
43.402 + return ReverseDigraph<const DGR>(digraph);
43.403 + }
43.404 +
43.405 +
43.406 + template <typename DGR, typename NF, typename AF, bool ch = true>
43.407 + class SubDigraphBase : public DigraphAdaptorBase<DGR> {
43.408 + typedef DigraphAdaptorBase<DGR> Parent;
43.409 + public:
43.410 + typedef DGR Digraph;
43.411 + typedef NF NodeFilterMap;
43.412 + typedef AF ArcFilterMap;
43.413 +
43.414 + typedef SubDigraphBase Adaptor;
43.415 + protected:
43.416 + NF* _node_filter;
43.417 + AF* _arc_filter;
43.418 + SubDigraphBase()
43.419 + : Parent(), _node_filter(0), _arc_filter(0) { }
43.420 +
43.421 + void initialize(DGR& digraph, NF& node_filter, AF& arc_filter) {
43.422 + Parent::initialize(digraph);
43.423 + _node_filter = &node_filter;
43.424 + _arc_filter = &arc_filter;
43.425 + }
43.426 +
43.427 + public:
43.428 +
43.429 + typedef typename Parent::Node Node;
43.430 + typedef typename Parent::Arc Arc;
43.431 +
43.432 + void first(Node& i) const {
43.433 + Parent::first(i);
43.434 + while (i != INVALID && !(*_node_filter)[i]) Parent::next(i);
43.435 + }
43.436 +
43.437 + void first(Arc& i) const {
43.438 + Parent::first(i);
43.439 + while (i != INVALID && (!(*_arc_filter)[i]
43.440 + || !(*_node_filter)[Parent::source(i)]
43.441 + || !(*_node_filter)[Parent::target(i)]))
43.442 + Parent::next(i);
43.443 + }
43.444 +
43.445 + void firstIn(Arc& i, const Node& n) const {
43.446 + Parent::firstIn(i, n);
43.447 + while (i != INVALID && (!(*_arc_filter)[i]
43.448 + || !(*_node_filter)[Parent::source(i)]))
43.449 + Parent::nextIn(i);
43.450 + }
43.451 +
43.452 + void firstOut(Arc& i, const Node& n) const {
43.453 + Parent::firstOut(i, n);
43.454 + while (i != INVALID && (!(*_arc_filter)[i]
43.455 + || !(*_node_filter)[Parent::target(i)]))
43.456 + Parent::nextOut(i);
43.457 + }
43.458 +
43.459 + void next(Node& i) const {
43.460 + Parent::next(i);
43.461 + while (i != INVALID && !(*_node_filter)[i]) Parent::next(i);
43.462 + }
43.463 +
43.464 + void next(Arc& i) const {
43.465 + Parent::next(i);
43.466 + while (i != INVALID && (!(*_arc_filter)[i]
43.467 + || !(*_node_filter)[Parent::source(i)]
43.468 + || !(*_node_filter)[Parent::target(i)]))
43.469 + Parent::next(i);
43.470 + }
43.471 +
43.472 + void nextIn(Arc& i) const {
43.473 + Parent::nextIn(i);
43.474 + while (i != INVALID && (!(*_arc_filter)[i]
43.475 + || !(*_node_filter)[Parent::source(i)]))
43.476 + Parent::nextIn(i);
43.477 + }
43.478 +
43.479 + void nextOut(Arc& i) const {
43.480 + Parent::nextOut(i);
43.481 + while (i != INVALID && (!(*_arc_filter)[i]
43.482 + || !(*_node_filter)[Parent::target(i)]))
43.483 + Parent::nextOut(i);
43.484 + }
43.485 +
43.486 + void status(const Node& n, bool v) const { _node_filter->set(n, v); }
43.487 + void status(const Arc& a, bool v) const { _arc_filter->set(a, v); }
43.488 +
43.489 + bool status(const Node& n) const { return (*_node_filter)[n]; }
43.490 + bool status(const Arc& a) const { return (*_arc_filter)[a]; }
43.491 +
43.492 + typedef False NodeNumTag;
43.493 + typedef False ArcNumTag;
43.494 +
43.495 + typedef FindArcTagIndicator<DGR> FindArcTag;
43.496 + Arc findArc(const Node& source, const Node& target,
43.497 + const Arc& prev = INVALID) const {
43.498 + if (!(*_node_filter)[source] || !(*_node_filter)[target]) {
43.499 + return INVALID;
43.500 + }
43.501 + Arc arc = Parent::findArc(source, target, prev);
43.502 + while (arc != INVALID && !(*_arc_filter)[arc]) {
43.503 + arc = Parent::findArc(source, target, arc);
43.504 + }
43.505 + return arc;
43.506 + }
43.507 +
43.508 + public:
43.509 +
43.510 + template <typename V>
43.511 + class NodeMap
43.512 + : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
43.513 + LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
43.514 + typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
43.515 + LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
43.516 +
43.517 + public:
43.518 + typedef V Value;
43.519 +
43.520 + NodeMap(const SubDigraphBase<DGR, NF, AF, ch>& adaptor)
43.521 + : Parent(adaptor) {}
43.522 + NodeMap(const SubDigraphBase<DGR, NF, AF, ch>& adaptor, const V& value)
43.523 + : Parent(adaptor, value) {}
43.524 +
43.525 + private:
43.526 + NodeMap& operator=(const NodeMap& cmap) {
43.527 + return operator=<NodeMap>(cmap);
43.528 + }
43.529 +
43.530 + template <typename CMap>
43.531 + NodeMap& operator=(const CMap& cmap) {
43.532 + Parent::operator=(cmap);
43.533 + return *this;
43.534 + }
43.535 + };
43.536 +
43.537 + template <typename V>
43.538 + class ArcMap
43.539 + : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
43.540 + LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
43.541 + typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
43.542 + LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> Parent;
43.543 +
43.544 + public:
43.545 + typedef V Value;
43.546 +
43.547 + ArcMap(const SubDigraphBase<DGR, NF, AF, ch>& adaptor)
43.548 + : Parent(adaptor) {}
43.549 + ArcMap(const SubDigraphBase<DGR, NF, AF, ch>& adaptor, const V& value)
43.550 + : Parent(adaptor, value) {}
43.551 +
43.552 + private:
43.553 + ArcMap& operator=(const ArcMap& cmap) {
43.554 + return operator=<ArcMap>(cmap);
43.555 + }
43.556 +
43.557 + template <typename CMap>
43.558 + ArcMap& operator=(const CMap& cmap) {
43.559 + Parent::operator=(cmap);
43.560 + return *this;
43.561 + }
43.562 + };
43.563 +
43.564 + };
43.565 +
43.566 + template <typename DGR, typename NF, typename AF>
43.567 + class SubDigraphBase<DGR, NF, AF, false>
43.568 + : public DigraphAdaptorBase<DGR> {
43.569 + typedef DigraphAdaptorBase<DGR> Parent;
43.570 + public:
43.571 + typedef DGR Digraph;
43.572 + typedef NF NodeFilterMap;
43.573 + typedef AF ArcFilterMap;
43.574 +
43.575 + typedef SubDigraphBase Adaptor;
43.576 + protected:
43.577 + NF* _node_filter;
43.578 + AF* _arc_filter;
43.579 + SubDigraphBase()
43.580 + : Parent(), _node_filter(0), _arc_filter(0) { }
43.581 +
43.582 + void initialize(DGR& digraph, NF& node_filter, AF& arc_filter) {
43.583 + Parent::initialize(digraph);
43.584 + _node_filter = &node_filter;
43.585 + _arc_filter = &arc_filter;
43.586 + }
43.587 +
43.588 + public:
43.589 +
43.590 + typedef typename Parent::Node Node;
43.591 + typedef typename Parent::Arc Arc;
43.592 +
43.593 + void first(Node& i) const {
43.594 + Parent::first(i);
43.595 + while (i!=INVALID && !(*_node_filter)[i]) Parent::next(i);
43.596 + }
43.597 +
43.598 + void first(Arc& i) const {
43.599 + Parent::first(i);
43.600 + while (i!=INVALID && !(*_arc_filter)[i]) Parent::next(i);
43.601 + }
43.602 +
43.603 + void firstIn(Arc& i, const Node& n) const {
43.604 + Parent::firstIn(i, n);
43.605 + while (i!=INVALID && !(*_arc_filter)[i]) Parent::nextIn(i);
43.606 + }
43.607 +
43.608 + void firstOut(Arc& i, const Node& n) const {
43.609 + Parent::firstOut(i, n);
43.610 + while (i!=INVALID && !(*_arc_filter)[i]) Parent::nextOut(i);
43.611 + }
43.612 +
43.613 + void next(Node& i) const {
43.614 + Parent::next(i);
43.615 + while (i!=INVALID && !(*_node_filter)[i]) Parent::next(i);
43.616 + }
43.617 + void next(Arc& i) const {
43.618 + Parent::next(i);
43.619 + while (i!=INVALID && !(*_arc_filter)[i]) Parent::next(i);
43.620 + }
43.621 + void nextIn(Arc& i) const {
43.622 + Parent::nextIn(i);
43.623 + while (i!=INVALID && !(*_arc_filter)[i]) Parent::nextIn(i);
43.624 + }
43.625 +
43.626 + void nextOut(Arc& i) const {
43.627 + Parent::nextOut(i);
43.628 + while (i!=INVALID && !(*_arc_filter)[i]) Parent::nextOut(i);
43.629 + }
43.630 +
43.631 + void status(const Node& n, bool v) const { _node_filter->set(n, v); }
43.632 + void status(const Arc& a, bool v) const { _arc_filter->set(a, v); }
43.633 +
43.634 + bool status(const Node& n) const { return (*_node_filter)[n]; }
43.635 + bool status(const Arc& a) const { return (*_arc_filter)[a]; }
43.636 +
43.637 + typedef False NodeNumTag;
43.638 + typedef False ArcNumTag;
43.639 +
43.640 + typedef FindArcTagIndicator<DGR> FindArcTag;
43.641 + Arc findArc(const Node& source, const Node& target,
43.642 + const Arc& prev = INVALID) const {
43.643 + if (!(*_node_filter)[source] || !(*_node_filter)[target]) {
43.644 + return INVALID;
43.645 + }
43.646 + Arc arc = Parent::findArc(source, target, prev);
43.647 + while (arc != INVALID && !(*_arc_filter)[arc]) {
43.648 + arc = Parent::findArc(source, target, arc);
43.649 + }
43.650 + return arc;
43.651 + }
43.652 +
43.653 + template <typename V>
43.654 + class NodeMap
43.655 + : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
43.656 + LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
43.657 + typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
43.658 + LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
43.659 +
43.660 + public:
43.661 + typedef V Value;
43.662 +
43.663 + NodeMap(const SubDigraphBase<DGR, NF, AF, false>& adaptor)
43.664 + : Parent(adaptor) {}
43.665 + NodeMap(const SubDigraphBase<DGR, NF, AF, false>& adaptor, const V& value)
43.666 + : Parent(adaptor, value) {}
43.667 +
43.668 + private:
43.669 + NodeMap& operator=(const NodeMap& cmap) {
43.670 + return operator=<NodeMap>(cmap);
43.671 + }
43.672 +
43.673 + template <typename CMap>
43.674 + NodeMap& operator=(const CMap& cmap) {
43.675 + Parent::operator=(cmap);
43.676 + return *this;
43.677 + }
43.678 + };
43.679 +
43.680 + template <typename V>
43.681 + class ArcMap
43.682 + : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
43.683 + LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
43.684 + typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
43.685 + LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> Parent;
43.686 +
43.687 + public:
43.688 + typedef V Value;
43.689 +
43.690 + ArcMap(const SubDigraphBase<DGR, NF, AF, false>& adaptor)
43.691 + : Parent(adaptor) {}
43.692 + ArcMap(const SubDigraphBase<DGR, NF, AF, false>& adaptor, const V& value)
43.693 + : Parent(adaptor, value) {}
43.694 +
43.695 + private:
43.696 + ArcMap& operator=(const ArcMap& cmap) {
43.697 + return operator=<ArcMap>(cmap);
43.698 + }
43.699 +
43.700 + template <typename CMap>
43.701 + ArcMap& operator=(const CMap& cmap) {
43.702 + Parent::operator=(cmap);
43.703 + return *this;
43.704 + }
43.705 + };
43.706 +
43.707 + };
43.708 +
43.709 + /// \ingroup graph_adaptors
43.710 + ///
43.711 + /// \brief Adaptor class for hiding nodes and arcs in a digraph
43.712 + ///
43.713 + /// SubDigraph can be used for hiding nodes and arcs in a digraph.
43.714 + /// A \c bool node map and a \c bool arc map must be specified, which
43.715 + /// define the filters for nodes and arcs.
43.716 + /// Only the nodes and arcs with \c true filter value are
43.717 + /// shown in the subdigraph. The arcs that are incident to hidden
43.718 + /// nodes are also filtered out.
43.719 + /// This adaptor conforms to the \ref concepts::Digraph "Digraph" concept.
43.720 + ///
43.721 + /// The adapted digraph can also be modified through this adaptor
43.722 + /// by adding or removing nodes or arcs, unless the \c GR template
43.723 + /// parameter is set to be \c const.
43.724 + ///
43.725 + /// \tparam DGR The type of the adapted digraph.
43.726 + /// It must conform to the \ref concepts::Digraph "Digraph" concept.
43.727 + /// It can also be specified to be \c const.
43.728 + /// \tparam NF The type of the node filter map.
43.729 + /// It must be a \c bool (or convertible) node map of the
43.730 + /// adapted digraph. The default type is
43.731 + /// \ref concepts::Digraph::NodeMap "DGR::NodeMap<bool>".
43.732 + /// \tparam AF The type of the arc filter map.
43.733 + /// It must be \c bool (or convertible) arc map of the
43.734 + /// adapted digraph. The default type is
43.735 + /// \ref concepts::Digraph::ArcMap "DGR::ArcMap<bool>".
43.736 + ///
43.737 + /// \note The \c Node and \c Arc types of this adaptor and the adapted
43.738 + /// digraph are convertible to each other.
43.739 + ///
43.740 + /// \see FilterNodes
43.741 + /// \see FilterArcs
43.742 +#ifdef DOXYGEN
43.743 + template<typename DGR, typename NF, typename AF>
43.744 + class SubDigraph {
43.745 +#else
43.746 + template<typename DGR,
43.747 + typename NF = typename DGR::template NodeMap<bool>,
43.748 + typename AF = typename DGR::template ArcMap<bool> >
43.749 + class SubDigraph :
43.750 + public DigraphAdaptorExtender<SubDigraphBase<DGR, NF, AF, true> > {
43.751 +#endif
43.752 + public:
43.753 + /// The type of the adapted digraph.
43.754 + typedef DGR Digraph;
43.755 + /// The type of the node filter map.
43.756 + typedef NF NodeFilterMap;
43.757 + /// The type of the arc filter map.
43.758 + typedef AF ArcFilterMap;
43.759 +
43.760 + typedef DigraphAdaptorExtender<SubDigraphBase<DGR, NF, AF, true> >
43.761 + Parent;
43.762 +
43.763 + typedef typename Parent::Node Node;
43.764 + typedef typename Parent::Arc Arc;
43.765 +
43.766 + protected:
43.767 + SubDigraph() { }
43.768 + public:
43.769 +
43.770 + /// \brief Constructor
43.771 + ///
43.772 + /// Creates a subdigraph for the given digraph with the
43.773 + /// given node and arc filter maps.
43.774 + SubDigraph(DGR& digraph, NF& node_filter, AF& arc_filter) {
43.775 + Parent::initialize(digraph, node_filter, arc_filter);
43.776 + }
43.777 +
43.778 + /// \brief Sets the status of the given node
43.779 + ///
43.780 + /// This function sets the status of the given node.
43.781 + /// It is done by simply setting the assigned value of \c n
43.782 + /// to \c v in the node filter map.
43.783 + void status(const Node& n, bool v) const { Parent::status(n, v); }
43.784 +
43.785 + /// \brief Sets the status of the given arc
43.786 + ///
43.787 + /// This function sets the status of the given arc.
43.788 + /// It is done by simply setting the assigned value of \c a
43.789 + /// to \c v in the arc filter map.
43.790 + void status(const Arc& a, bool v) const { Parent::status(a, v); }
43.791 +
43.792 + /// \brief Returns the status of the given node
43.793 + ///
43.794 + /// This function returns the status of the given node.
43.795 + /// It is \c true if the given node is enabled (i.e. not hidden).
43.796 + bool status(const Node& n) const { return Parent::status(n); }
43.797 +
43.798 + /// \brief Returns the status of the given arc
43.799 + ///
43.800 + /// This function returns the status of the given arc.
43.801 + /// It is \c true if the given arc is enabled (i.e. not hidden).
43.802 + bool status(const Arc& a) const { return Parent::status(a); }
43.803 +
43.804 + /// \brief Disables the given node
43.805 + ///
43.806 + /// This function disables the given node in the subdigraph,
43.807 + /// so the iteration jumps over it.
43.808 + /// It is the same as \ref status() "status(n, false)".
43.809 + void disable(const Node& n) const { Parent::status(n, false); }
43.810 +
43.811 + /// \brief Disables the given arc
43.812 + ///
43.813 + /// This function disables the given arc in the subdigraph,
43.814 + /// so the iteration jumps over it.
43.815 + /// It is the same as \ref status() "status(a, false)".
43.816 + void disable(const Arc& a) const { Parent::status(a, false); }
43.817 +
43.818 + /// \brief Enables the given node
43.819 + ///
43.820 + /// This function enables the given node in the subdigraph.
43.821 + /// It is the same as \ref status() "status(n, true)".
43.822 + void enable(const Node& n) const { Parent::status(n, true); }
43.823 +
43.824 + /// \brief Enables the given arc
43.825 + ///
43.826 + /// This function enables the given arc in the subdigraph.
43.827 + /// It is the same as \ref status() "status(a, true)".
43.828 + void enable(const Arc& a) const { Parent::status(a, true); }
43.829 +
43.830 + };
43.831 +
43.832 + /// \brief Returns a read-only SubDigraph adaptor
43.833 + ///
43.834 + /// This function just returns a read-only \ref SubDigraph adaptor.
43.835 + /// \ingroup graph_adaptors
43.836 + /// \relates SubDigraph
43.837 + template<typename DGR, typename NF, typename AF>
43.838 + SubDigraph<const DGR, NF, AF>
43.839 + subDigraph(const DGR& digraph,
43.840 + NF& node_filter, AF& arc_filter) {
43.841 + return SubDigraph<const DGR, NF, AF>
43.842 + (digraph, node_filter, arc_filter);
43.843 + }
43.844 +
43.845 + template<typename DGR, typename NF, typename AF>
43.846 + SubDigraph<const DGR, const NF, AF>
43.847 + subDigraph(const DGR& digraph,
43.848 + const NF& node_filter, AF& arc_filter) {
43.849 + return SubDigraph<const DGR, const NF, AF>
43.850 + (digraph, node_filter, arc_filter);
43.851 + }
43.852 +
43.853 + template<typename DGR, typename NF, typename AF>
43.854 + SubDigraph<const DGR, NF, const AF>
43.855 + subDigraph(const DGR& digraph,
43.856 + NF& node_filter, const AF& arc_filter) {
43.857 + return SubDigraph<const DGR, NF, const AF>
43.858 + (digraph, node_filter, arc_filter);
43.859 + }
43.860 +
43.861 + template<typename DGR, typename NF, typename AF>
43.862 + SubDigraph<const DGR, const NF, const AF>
43.863 + subDigraph(const DGR& digraph,
43.864 + const NF& node_filter, const AF& arc_filter) {
43.865 + return SubDigraph<const DGR, const NF, const AF>
43.866 + (digraph, node_filter, arc_filter);
43.867 + }
43.868 +
43.869 +
43.870 + template <typename GR, typename NF, typename EF, bool ch = true>
43.871 + class SubGraphBase : public GraphAdaptorBase<GR> {
43.872 + typedef GraphAdaptorBase<GR> Parent;
43.873 + public:
43.874 + typedef GR Graph;
43.875 + typedef NF NodeFilterMap;
43.876 + typedef EF EdgeFilterMap;
43.877 +
43.878 + typedef SubGraphBase Adaptor;
43.879 + protected:
43.880 +
43.881 + NF* _node_filter;
43.882 + EF* _edge_filter;
43.883 +
43.884 + SubGraphBase()
43.885 + : Parent(), _node_filter(0), _edge_filter(0) { }
43.886 +
43.887 + void initialize(GR& graph, NF& node_filter, EF& edge_filter) {
43.888 + Parent::initialize(graph);
43.889 + _node_filter = &node_filter;
43.890 + _edge_filter = &edge_filter;
43.891 + }
43.892 +
43.893 + public:
43.894 +
43.895 + typedef typename Parent::Node Node;
43.896 + typedef typename Parent::Arc Arc;
43.897 + typedef typename Parent::Edge Edge;
43.898 +
43.899 + void first(Node& i) const {
43.900 + Parent::first(i);
43.901 + while (i!=INVALID && !(*_node_filter)[i]) Parent::next(i);
43.902 + }
43.903 +
43.904 + void first(Arc& i) const {
43.905 + Parent::first(i);
43.906 + while (i!=INVALID && (!(*_edge_filter)[i]
43.907 + || !(*_node_filter)[Parent::source(i)]
43.908 + || !(*_node_filter)[Parent::target(i)]))
43.909 + Parent::next(i);
43.910 + }
43.911 +
43.912 + void first(Edge& i) const {
43.913 + Parent::first(i);
43.914 + while (i!=INVALID && (!(*_edge_filter)[i]
43.915 + || !(*_node_filter)[Parent::u(i)]
43.916 + || !(*_node_filter)[Parent::v(i)]))
43.917 + Parent::next(i);
43.918 + }
43.919 +
43.920 + void firstIn(Arc& i, const Node& n) const {
43.921 + Parent::firstIn(i, n);
43.922 + while (i!=INVALID && (!(*_edge_filter)[i]
43.923 + || !(*_node_filter)[Parent::source(i)]))
43.924 + Parent::nextIn(i);
43.925 + }
43.926 +
43.927 + void firstOut(Arc& i, const Node& n) const {
43.928 + Parent::firstOut(i, n);
43.929 + while (i!=INVALID && (!(*_edge_filter)[i]
43.930 + || !(*_node_filter)[Parent::target(i)]))
43.931 + Parent::nextOut(i);
43.932 + }
43.933 +
43.934 + void firstInc(Edge& i, bool& d, const Node& n) const {
43.935 + Parent::firstInc(i, d, n);
43.936 + while (i!=INVALID && (!(*_edge_filter)[i]
43.937 + || !(*_node_filter)[Parent::u(i)]
43.938 + || !(*_node_filter)[Parent::v(i)]))
43.939 + Parent::nextInc(i, d);
43.940 + }
43.941 +
43.942 + void next(Node& i) const {
43.943 + Parent::next(i);
43.944 + while (i!=INVALID && !(*_node_filter)[i]) Parent::next(i);
43.945 + }
43.946 +
43.947 + void next(Arc& i) const {
43.948 + Parent::next(i);
43.949 + while (i!=INVALID && (!(*_edge_filter)[i]
43.950 + || !(*_node_filter)[Parent::source(i)]
43.951 + || !(*_node_filter)[Parent::target(i)]))
43.952 + Parent::next(i);
43.953 + }
43.954 +
43.955 + void next(Edge& i) const {
43.956 + Parent::next(i);
43.957 + while (i!=INVALID && (!(*_edge_filter)[i]
43.958 + || !(*_node_filter)[Parent::u(i)]
43.959 + || !(*_node_filter)[Parent::v(i)]))
43.960 + Parent::next(i);
43.961 + }
43.962 +
43.963 + void nextIn(Arc& i) const {
43.964 + Parent::nextIn(i);
43.965 + while (i!=INVALID && (!(*_edge_filter)[i]
43.966 + || !(*_node_filter)[Parent::source(i)]))
43.967 + Parent::nextIn(i);
43.968 + }
43.969 +
43.970 + void nextOut(Arc& i) const {
43.971 + Parent::nextOut(i);
43.972 + while (i!=INVALID && (!(*_edge_filter)[i]
43.973 + || !(*_node_filter)[Parent::target(i)]))
43.974 + Parent::nextOut(i);
43.975 + }
43.976 +
43.977 + void nextInc(Edge& i, bool& d) const {
43.978 + Parent::nextInc(i, d);
43.979 + while (i!=INVALID && (!(*_edge_filter)[i]
43.980 + || !(*_node_filter)[Parent::u(i)]
43.981 + || !(*_node_filter)[Parent::v(i)]))
43.982 + Parent::nextInc(i, d);
43.983 + }
43.984 +
43.985 + void status(const Node& n, bool v) const { _node_filter->set(n, v); }
43.986 + void status(const Edge& e, bool v) const { _edge_filter->set(e, v); }
43.987 +
43.988 + bool status(const Node& n) const { return (*_node_filter)[n]; }
43.989 + bool status(const Edge& e) const { return (*_edge_filter)[e]; }
43.990 +
43.991 + typedef False NodeNumTag;
43.992 + typedef False ArcNumTag;
43.993 + typedef False EdgeNumTag;
43.994 +
43.995 + typedef FindArcTagIndicator<Graph> FindArcTag;
43.996 + Arc findArc(const Node& u, const Node& v,
43.997 + const Arc& prev = INVALID) const {
43.998 + if (!(*_node_filter)[u] || !(*_node_filter)[v]) {
43.999 + return INVALID;
43.1000 + }
43.1001 + Arc arc = Parent::findArc(u, v, prev);
43.1002 + while (arc != INVALID && !(*_edge_filter)[arc]) {
43.1003 + arc = Parent::findArc(u, v, arc);
43.1004 + }
43.1005 + return arc;
43.1006 + }
43.1007 +
43.1008 + typedef FindEdgeTagIndicator<Graph> FindEdgeTag;
43.1009 + Edge findEdge(const Node& u, const Node& v,
43.1010 + const Edge& prev = INVALID) const {
43.1011 + if (!(*_node_filter)[u] || !(*_node_filter)[v]) {
43.1012 + return INVALID;
43.1013 + }
43.1014 + Edge edge = Parent::findEdge(u, v, prev);
43.1015 + while (edge != INVALID && !(*_edge_filter)[edge]) {
43.1016 + edge = Parent::findEdge(u, v, edge);
43.1017 + }
43.1018 + return edge;
43.1019 + }
43.1020 +
43.1021 + template <typename V>
43.1022 + class NodeMap
43.1023 + : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
43.1024 + LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
43.1025 + typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
43.1026 + LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent;
43.1027 +
43.1028 + public:
43.1029 + typedef V Value;
43.1030 +
43.1031 + NodeMap(const SubGraphBase<GR, NF, EF, ch>& adaptor)
43.1032 + : Parent(adaptor) {}
43.1033 + NodeMap(const SubGraphBase<GR, NF, EF, ch>& adaptor, const V& value)
43.1034 + : Parent(adaptor, value) {}
43.1035 +
43.1036 + private:
43.1037 + NodeMap& operator=(const NodeMap& cmap) {
43.1038 + return operator=<NodeMap>(cmap);
43.1039 + }
43.1040 +
43.1041 + template <typename CMap>
43.1042 + NodeMap& operator=(const CMap& cmap) {
43.1043 + Parent::operator=(cmap);
43.1044 + return *this;
43.1045 + }
43.1046 + };
43.1047 +
43.1048 + template <typename V>
43.1049 + class ArcMap
43.1050 + : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
43.1051 + LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
43.1052 + typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
43.1053 + LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent;
43.1054 +
43.1055 + public:
43.1056 + typedef V Value;
43.1057 +
43.1058 + ArcMap(const SubGraphBase<GR, NF, EF, ch>& adaptor)
43.1059 + : Parent(adaptor) {}
43.1060 + ArcMap(const SubGraphBase<GR, NF, EF, ch>& adaptor, const V& value)
43.1061 + : Parent(adaptor, value) {}
43.1062 +
43.1063 + private:
43.1064 + ArcMap& operator=(const ArcMap& cmap) {
43.1065 + return operator=<ArcMap>(cmap);
43.1066 + }
43.1067 +
43.1068 + template <typename CMap>
43.1069 + ArcMap& operator=(const CMap& cmap) {
43.1070 + Parent::operator=(cmap);
43.1071 + return *this;
43.1072 + }
43.1073 + };
43.1074 +
43.1075 + template <typename V>
43.1076 + class EdgeMap
43.1077 + : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
43.1078 + LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
43.1079 + typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
43.1080 + LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
43.1081 +
43.1082 + public:
43.1083 + typedef V Value;
43.1084 +
43.1085 + EdgeMap(const SubGraphBase<GR, NF, EF, ch>& adaptor)
43.1086 + : Parent(adaptor) {}
43.1087 +
43.1088 + EdgeMap(const SubGraphBase<GR, NF, EF, ch>& adaptor, const V& value)
43.1089 + : Parent(adaptor, value) {}
43.1090 +
43.1091 + private:
43.1092 + EdgeMap& operator=(const EdgeMap& cmap) {
43.1093 + return operator=<EdgeMap>(cmap);
43.1094 + }
43.1095 +
43.1096 + template <typename CMap>
43.1097 + EdgeMap& operator=(const CMap& cmap) {
43.1098 + Parent::operator=(cmap);
43.1099 + return *this;
43.1100 + }
43.1101 + };
43.1102 +
43.1103 + };
43.1104 +
43.1105 + template <typename GR, typename NF, typename EF>
43.1106 + class SubGraphBase<GR, NF, EF, false>
43.1107 + : public GraphAdaptorBase<GR> {
43.1108 + typedef GraphAdaptorBase<GR> Parent;
43.1109 + public:
43.1110 + typedef GR Graph;
43.1111 + typedef NF NodeFilterMap;
43.1112 + typedef EF EdgeFilterMap;
43.1113 +
43.1114 + typedef SubGraphBase Adaptor;
43.1115 + protected:
43.1116 + NF* _node_filter;
43.1117 + EF* _edge_filter;
43.1118 + SubGraphBase()
43.1119 + : Parent(), _node_filter(0), _edge_filter(0) { }
43.1120 +
43.1121 + void initialize(GR& graph, NF& node_filter, EF& edge_filter) {
43.1122 + Parent::initialize(graph);
43.1123 + _node_filter = &node_filter;
43.1124 + _edge_filter = &edge_filter;
43.1125 + }
43.1126 +
43.1127 + public:
43.1128 +
43.1129 + typedef typename Parent::Node Node;
43.1130 + typedef typename Parent::Arc Arc;
43.1131 + typedef typename Parent::Edge Edge;
43.1132 +
43.1133 + void first(Node& i) const {
43.1134 + Parent::first(i);
43.1135 + while (i!=INVALID && !(*_node_filter)[i]) Parent::next(i);
43.1136 + }
43.1137 +
43.1138 + void first(Arc& i) const {
43.1139 + Parent::first(i);
43.1140 + while (i!=INVALID && !(*_edge_filter)[i]) Parent::next(i);
43.1141 + }
43.1142 +
43.1143 + void first(Edge& i) const {
43.1144 + Parent::first(i);
43.1145 + while (i!=INVALID && !(*_edge_filter)[i]) Parent::next(i);
43.1146 + }
43.1147 +
43.1148 + void firstIn(Arc& i, const Node& n) const {
43.1149 + Parent::firstIn(i, n);
43.1150 + while (i!=INVALID && !(*_edge_filter)[i]) Parent::nextIn(i);
43.1151 + }
43.1152 +
43.1153 + void firstOut(Arc& i, const Node& n) const {
43.1154 + Parent::firstOut(i, n);
43.1155 + while (i!=INVALID && !(*_edge_filter)[i]) Parent::nextOut(i);
43.1156 + }
43.1157 +
43.1158 + void firstInc(Edge& i, bool& d, const Node& n) const {
43.1159 + Parent::firstInc(i, d, n);
43.1160 + while (i!=INVALID && !(*_edge_filter)[i]) Parent::nextInc(i, d);
43.1161 + }
43.1162 +
43.1163 + void next(Node& i) const {
43.1164 + Parent::next(i);
43.1165 + while (i!=INVALID && !(*_node_filter)[i]) Parent::next(i);
43.1166 + }
43.1167 + void next(Arc& i) const {
43.1168 + Parent::next(i);
43.1169 + while (i!=INVALID && !(*_edge_filter)[i]) Parent::next(i);
43.1170 + }
43.1171 + void next(Edge& i) const {
43.1172 + Parent::next(i);
43.1173 + while (i!=INVALID && !(*_edge_filter)[i]) Parent::next(i);
43.1174 + }
43.1175 + void nextIn(Arc& i) const {
43.1176 + Parent::nextIn(i);
43.1177 + while (i!=INVALID && !(*_edge_filter)[i]) Parent::nextIn(i);
43.1178 + }
43.1179 +
43.1180 + void nextOut(Arc& i) const {
43.1181 + Parent::nextOut(i);
43.1182 + while (i!=INVALID && !(*_edge_filter)[i]) Parent::nextOut(i);
43.1183 + }
43.1184 + void nextInc(Edge& i, bool& d) const {
43.1185 + Parent::nextInc(i, d);
43.1186 + while (i!=INVALID && !(*_edge_filter)[i]) Parent::nextInc(i, d);
43.1187 + }
43.1188 +
43.1189 + void status(const Node& n, bool v) const { _node_filter->set(n, v); }
43.1190 + void status(const Edge& e, bool v) const { _edge_filter->set(e, v); }
43.1191 +
43.1192 + bool status(const Node& n) const { return (*_node_filter)[n]; }
43.1193 + bool status(const Edge& e) const { return (*_edge_filter)[e]; }
43.1194 +
43.1195 + typedef False NodeNumTag;
43.1196 + typedef False ArcNumTag;
43.1197 + typedef False EdgeNumTag;
43.1198 +
43.1199 + typedef FindArcTagIndicator<Graph> FindArcTag;
43.1200 + Arc findArc(const Node& u, const Node& v,
43.1201 + const Arc& prev = INVALID) const {
43.1202 + Arc arc = Parent::findArc(u, v, prev);
43.1203 + while (arc != INVALID && !(*_edge_filter)[arc]) {
43.1204 + arc = Parent::findArc(u, v, arc);
43.1205 + }
43.1206 + return arc;
43.1207 + }
43.1208 +
43.1209 + typedef FindEdgeTagIndicator<Graph> FindEdgeTag;
43.1210 + Edge findEdge(const Node& u, const Node& v,
43.1211 + const Edge& prev = INVALID) const {
43.1212 + Edge edge = Parent::findEdge(u, v, prev);
43.1213 + while (edge != INVALID && !(*_edge_filter)[edge]) {
43.1214 + edge = Parent::findEdge(u, v, edge);
43.1215 + }
43.1216 + return edge;
43.1217 + }
43.1218 +
43.1219 + template <typename V>
43.1220 + class NodeMap
43.1221 + : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
43.1222 + LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
43.1223 + typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>,
43.1224 + LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent;
43.1225 +
43.1226 + public:
43.1227 + typedef V Value;
43.1228 +
43.1229 + NodeMap(const SubGraphBase<GR, NF, EF, false>& adaptor)
43.1230 + : Parent(adaptor) {}
43.1231 + NodeMap(const SubGraphBase<GR, NF, EF, false>& adaptor, const V& value)
43.1232 + : Parent(adaptor, value) {}
43.1233 +
43.1234 + private:
43.1235 + NodeMap& operator=(const NodeMap& cmap) {
43.1236 + return operator=<NodeMap>(cmap);
43.1237 + }
43.1238 +
43.1239 + template <typename CMap>
43.1240 + NodeMap& operator=(const CMap& cmap) {
43.1241 + Parent::operator=(cmap);
43.1242 + return *this;
43.1243 + }
43.1244 + };
43.1245 +
43.1246 + template <typename V>
43.1247 + class ArcMap
43.1248 + : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
43.1249 + LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
43.1250 + typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>,
43.1251 + LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent;
43.1252 +
43.1253 + public:
43.1254 + typedef V Value;
43.1255 +
43.1256 + ArcMap(const SubGraphBase<GR, NF, EF, false>& adaptor)
43.1257 + : Parent(adaptor) {}
43.1258 + ArcMap(const SubGraphBase<GR, NF, EF, false>& adaptor, const V& value)
43.1259 + : Parent(adaptor, value) {}
43.1260 +
43.1261 + private:
43.1262 + ArcMap& operator=(const ArcMap& cmap) {
43.1263 + return operator=<ArcMap>(cmap);
43.1264 + }
43.1265 +
43.1266 + template <typename CMap>
43.1267 + ArcMap& operator=(const CMap& cmap) {
43.1268 + Parent::operator=(cmap);
43.1269 + return *this;
43.1270 + }
43.1271 + };
43.1272 +
43.1273 + template <typename V>
43.1274 + class EdgeMap
43.1275 + : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
43.1276 + LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
43.1277 + typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>,
43.1278 + LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
43.1279 +
43.1280 + public:
43.1281 + typedef V Value;
43.1282 +
43.1283 + EdgeMap(const SubGraphBase<GR, NF, EF, false>& adaptor)
43.1284 + : Parent(adaptor) {}
43.1285 +
43.1286 + EdgeMap(const SubGraphBase<GR, NF, EF, false>& adaptor, const V& value)
43.1287 + : Parent(adaptor, value) {}
43.1288 +
43.1289 + private:
43.1290 + EdgeMap& operator=(const EdgeMap& cmap) {
43.1291 + return operator=<EdgeMap>(cmap);
43.1292 + }
43.1293 +
43.1294 + template <typename CMap>
43.1295 + EdgeMap& operator=(const CMap& cmap) {
43.1296 + Parent::operator=(cmap);
43.1297 + return *this;
43.1298 + }
43.1299 + };
43.1300 +
43.1301 + };
43.1302 +
43.1303 + /// \ingroup graph_adaptors
43.1304 + ///
43.1305 + /// \brief Adaptor class for hiding nodes and edges in an undirected
43.1306 + /// graph.
43.1307 + ///
43.1308 + /// SubGraph can be used for hiding nodes and edges in a graph.
43.1309 + /// A \c bool node map and a \c bool edge map must be specified, which
43.1310 + /// define the filters for nodes and edges.
43.1311 + /// Only the nodes and edges with \c true filter value are
43.1312 + /// shown in the subgraph. The edges that are incident to hidden
43.1313 + /// nodes are also filtered out.
43.1314 + /// This adaptor conforms to the \ref concepts::Graph "Graph" concept.
43.1315 + ///
43.1316 + /// The adapted graph can also be modified through this adaptor
43.1317 + /// by adding or removing nodes or edges, unless the \c GR template
43.1318 + /// parameter is set to be \c const.
43.1319 + ///
43.1320 + /// \tparam GR The type of the adapted graph.
43.1321 + /// It must conform to the \ref concepts::Graph "Graph" concept.
43.1322 + /// It can also be specified to be \c const.
43.1323 + /// \tparam NF The type of the node filter map.
43.1324 + /// It must be a \c bool (or convertible) node map of the
43.1325 + /// adapted graph. The default type is
43.1326 + /// \ref concepts::Graph::NodeMap "GR::NodeMap<bool>".
43.1327 + /// \tparam EF The type of the edge filter map.
43.1328 + /// It must be a \c bool (or convertible) edge map of the
43.1329 + /// adapted graph. The default type is
43.1330 + /// \ref concepts::Graph::EdgeMap "GR::EdgeMap<bool>".
43.1331 + ///
43.1332 + /// \note The \c Node, \c Edge and \c Arc types of this adaptor and the
43.1333 + /// adapted graph are convertible to each other.
43.1334 + ///
43.1335 + /// \see FilterNodes
43.1336 + /// \see FilterEdges
43.1337 +#ifdef DOXYGEN
43.1338 + template<typename GR, typename NF, typename EF>
43.1339 + class SubGraph {
43.1340 +#else
43.1341 + template<typename GR,
43.1342 + typename NF = typename GR::template NodeMap<bool>,
43.1343 + typename EF = typename GR::template EdgeMap<bool> >
43.1344 + class SubGraph :
43.1345 + public GraphAdaptorExtender<SubGraphBase<GR, NF, EF, true> > {
43.1346 +#endif
43.1347 + public:
43.1348 + /// The type of the adapted graph.
43.1349 + typedef GR Graph;
43.1350 + /// The type of the node filter map.
43.1351 + typedef NF NodeFilterMap;
43.1352 + /// The type of the edge filter map.
43.1353 + typedef EF EdgeFilterMap;
43.1354 +
43.1355 + typedef GraphAdaptorExtender<SubGraphBase<GR, NF, EF, true> >
43.1356 + Parent;
43.1357 +
43.1358 + typedef typename Parent::Node Node;
43.1359 + typedef typename Parent::Edge Edge;
43.1360 +
43.1361 + protected:
43.1362 + SubGraph() { }
43.1363 + public:
43.1364 +
43.1365 + /// \brief Constructor
43.1366 + ///
43.1367 + /// Creates a subgraph for the given graph with the given node
43.1368 + /// and edge filter maps.
43.1369 + SubGraph(GR& graph, NF& node_filter, EF& edge_filter) {
43.1370 + initialize(graph, node_filter, edge_filter);
43.1371 + }
43.1372 +
43.1373 + /// \brief Sets the status of the given node
43.1374 + ///
43.1375 + /// This function sets the status of the given node.
43.1376 + /// It is done by simply setting the assigned value of \c n
43.1377 + /// to \c v in the node filter map.
43.1378 + void status(const Node& n, bool v) const { Parent::status(n, v); }
43.1379 +
43.1380 + /// \brief Sets the status of the given edge
43.1381 + ///
43.1382 + /// This function sets the status of the given edge.
43.1383 + /// It is done by simply setting the assigned value of \c e
43.1384 + /// to \c v in the edge filter map.
43.1385 + void status(const Edge& e, bool v) const { Parent::status(e, v); }
43.1386 +
43.1387 + /// \brief Returns the status of the given node
43.1388 + ///
43.1389 + /// This function returns the status of the given node.
43.1390 + /// It is \c true if the given node is enabled (i.e. not hidden).
43.1391 + bool status(const Node& n) const { return Parent::status(n); }
43.1392 +
43.1393 + /// \brief Returns the status of the given edge
43.1394 + ///
43.1395 + /// This function returns the status of the given edge.
43.1396 + /// It is \c true if the given edge is enabled (i.e. not hidden).
43.1397 + bool status(const Edge& e) const { return Parent::status(e); }
43.1398 +
43.1399 + /// \brief Disables the given node
43.1400 + ///
43.1401 + /// This function disables the given node in the subdigraph,
43.1402 + /// so the iteration jumps over it.
43.1403 + /// It is the same as \ref status() "status(n, false)".
43.1404 + void disable(const Node& n) const { Parent::status(n, false); }
43.1405 +
43.1406 + /// \brief Disables the given edge
43.1407 + ///
43.1408 + /// This function disables the given edge in the subgraph,
43.1409 + /// so the iteration jumps over it.
43.1410 + /// It is the same as \ref status() "status(e, false)".
43.1411 + void disable(const Edge& e) const { Parent::status(e, false); }
43.1412 +
43.1413 + /// \brief Enables the given node
43.1414 + ///
43.1415 + /// This function enables the given node in the subdigraph.
43.1416 + /// It is the same as \ref status() "status(n, true)".
43.1417 + void enable(const Node& n) const { Parent::status(n, true); }
43.1418 +
43.1419 + /// \brief Enables the given edge
43.1420 + ///
43.1421 + /// This function enables the given edge in the subgraph.
43.1422 + /// It is the same as \ref status() "status(e, true)".
43.1423 + void enable(const Edge& e) const { Parent::status(e, true); }
43.1424 +
43.1425 + };
43.1426 +
43.1427 + /// \brief Returns a read-only SubGraph adaptor
43.1428 + ///
43.1429 + /// This function just returns a read-only \ref SubGraph adaptor.
43.1430 + /// \ingroup graph_adaptors
43.1431 + /// \relates SubGraph
43.1432 + template<typename GR, typename NF, typename EF>
43.1433 + SubGraph<const GR, NF, EF>
43.1434 + subGraph(const GR& graph, NF& node_filter, EF& edge_filter) {
43.1435 + return SubGraph<const GR, NF, EF>
43.1436 + (graph, node_filter, edge_filter);
43.1437 + }
43.1438 +
43.1439 + template<typename GR, typename NF, typename EF>
43.1440 + SubGraph<const GR, const NF, EF>
43.1441 + subGraph(const GR& graph, const NF& node_filter, EF& edge_filter) {
43.1442 + return SubGraph<const GR, const NF, EF>
43.1443 + (graph, node_filter, edge_filter);
43.1444 + }
43.1445 +
43.1446 + template<typename GR, typename NF, typename EF>
43.1447 + SubGraph<const GR, NF, const EF>
43.1448 + subGraph(const GR& graph, NF& node_filter, const EF& edge_filter) {
43.1449 + return SubGraph<const GR, NF, const EF>
43.1450 + (graph, node_filter, edge_filter);
43.1451 + }
43.1452 +
43.1453 + template<typename GR, typename NF, typename EF>
43.1454 + SubGraph<const GR, const NF, const EF>
43.1455 + subGraph(const GR& graph, const NF& node_filter, const EF& edge_filter) {
43.1456 + return SubGraph<const GR, const NF, const EF>
43.1457 + (graph, node_filter, edge_filter);
43.1458 + }
43.1459 +
43.1460 +
43.1461 + /// \ingroup graph_adaptors
43.1462 + ///
43.1463 + /// \brief Adaptor class for hiding nodes in a digraph or a graph.
43.1464 + ///
43.1465 + /// FilterNodes adaptor can be used for hiding nodes in a digraph or a
43.1466 + /// graph. A \c bool node map must be specified, which defines the filter
43.1467 + /// for the nodes. Only the nodes with \c true filter value and the
43.1468 + /// arcs/edges incident to nodes both with \c true filter value are shown
43.1469 + /// in the subgraph. This adaptor conforms to the \ref concepts::Digraph
43.1470 + /// "Digraph" concept or the \ref concepts::Graph "Graph" concept
43.1471 + /// depending on the \c GR template parameter.
43.1472 + ///
43.1473 + /// The adapted (di)graph can also be modified through this adaptor
43.1474 + /// by adding or removing nodes or arcs/edges, unless the \c GR template
43.1475 + /// parameter is set to be \c const.
43.1476 + ///
43.1477 + /// \tparam GR The type of the adapted digraph or graph.
43.1478 + /// It must conform to the \ref concepts::Digraph "Digraph" concept
43.1479 + /// or the \ref concepts::Graph "Graph" concept.
43.1480 + /// It can also be specified to be \c const.
43.1481 + /// \tparam NF The type of the node filter map.
43.1482 + /// It must be a \c bool (or convertible) node map of the
43.1483 + /// adapted (di)graph. The default type is
43.1484 + /// \ref concepts::Graph::NodeMap "GR::NodeMap<bool>".
43.1485 + ///
43.1486 + /// \note The \c Node and <tt>Arc/Edge</tt> types of this adaptor and the
43.1487 + /// adapted (di)graph are convertible to each other.
43.1488 +#ifdef DOXYGEN
43.1489 + template<typename GR, typename NF>
43.1490 + class FilterNodes {
43.1491 +#else
43.1492 + template<typename GR,
43.1493 + typename NF = typename GR::template NodeMap<bool>,
43.1494 + typename Enable = void>
43.1495 + class FilterNodes :
43.1496 + public DigraphAdaptorExtender<
43.1497 + SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >,
43.1498 + true> > {
43.1499 +#endif
43.1500 + typedef DigraphAdaptorExtender<
43.1501 + SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >,
43.1502 + true> > Parent;
43.1503 +
43.1504 + public:
43.1505 +
43.1506 + typedef GR Digraph;
43.1507 + typedef NF NodeFilterMap;
43.1508 +
43.1509 + typedef typename Parent::Node Node;
43.1510 +
43.1511 + protected:
43.1512 + ConstMap<typename Digraph::Arc, Const<bool, true> > const_true_map;
43.1513 +
43.1514 + FilterNodes() : const_true_map() {}
43.1515 +
43.1516 + public:
43.1517 +
43.1518 + /// \brief Constructor
43.1519 + ///
43.1520 + /// Creates a subgraph for the given digraph or graph with the
43.1521 + /// given node filter map.
43.1522 + FilterNodes(GR& graph, NF& node_filter)
43.1523 + : Parent(), const_true_map()
43.1524 + {
43.1525 + Parent::initialize(graph, node_filter, const_true_map);
43.1526 + }
43.1527 +
43.1528 + /// \brief Sets the status of the given node
43.1529 + ///
43.1530 + /// This function sets the status of the given node.
43.1531 + /// It is done by simply setting the assigned value of \c n
43.1532 + /// to \c v in the node filter map.
43.1533 + void status(const Node& n, bool v) const { Parent::status(n, v); }
43.1534 +
43.1535 + /// \brief Returns the status of the given node
43.1536 + ///
43.1537 + /// This function returns the status of the given node.
43.1538 + /// It is \c true if the given node is enabled (i.e. not hidden).
43.1539 + bool status(const Node& n) const { return Parent::status(n); }
43.1540 +
43.1541 + /// \brief Disables the given node
43.1542 + ///
43.1543 + /// This function disables the given node, so the iteration
43.1544 + /// jumps over it.
43.1545 + /// It is the same as \ref status() "status(n, false)".
43.1546 + void disable(const Node& n) const { Parent::status(n, false); }
43.1547 +
43.1548 + /// \brief Enables the given node
43.1549 + ///
43.1550 + /// This function enables the given node.
43.1551 + /// It is the same as \ref status() "status(n, true)".
43.1552 + void enable(const Node& n) const { Parent::status(n, true); }
43.1553 +
43.1554 + };
43.1555 +
43.1556 + template<typename GR, typename NF>
43.1557 + class FilterNodes<GR, NF,
43.1558 + typename enable_if<UndirectedTagIndicator<GR> >::type> :
43.1559 + public GraphAdaptorExtender<
43.1560 + SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >,
43.1561 + true> > {
43.1562 +
43.1563 + typedef GraphAdaptorExtender<
43.1564 + SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >,
43.1565 + true> > Parent;
43.1566 +
43.1567 + public:
43.1568 +
43.1569 + typedef GR Graph;
43.1570 + typedef NF NodeFilterMap;
43.1571 +
43.1572 + typedef typename Parent::Node Node;
43.1573 +
43.1574 + protected:
43.1575 + ConstMap<typename GR::Edge, Const<bool, true> > const_true_map;
43.1576 +
43.1577 + FilterNodes() : const_true_map() {}
43.1578 +
43.1579 + public:
43.1580 +
43.1581 + FilterNodes(GR& graph, NodeFilterMap& node_filter) :
43.1582 + Parent(), const_true_map() {
43.1583 + Parent::initialize(graph, node_filter, const_true_map);
43.1584 + }
43.1585 +
43.1586 + void status(const Node& n, bool v) const { Parent::status(n, v); }
43.1587 + bool status(const Node& n) const { return Parent::status(n); }
43.1588 + void disable(const Node& n) const { Parent::status(n, false); }
43.1589 + void enable(const Node& n) const { Parent::status(n, true); }
43.1590 +
43.1591 + };
43.1592 +
43.1593 +
43.1594 + /// \brief Returns a read-only FilterNodes adaptor
43.1595 + ///
43.1596 + /// This function just returns a read-only \ref FilterNodes adaptor.
43.1597 + /// \ingroup graph_adaptors
43.1598 + /// \relates FilterNodes
43.1599 + template<typename GR, typename NF>
43.1600 + FilterNodes<const GR, NF>
43.1601 + filterNodes(const GR& graph, NF& node_filter) {
43.1602 + return FilterNodes<const GR, NF>(graph, node_filter);
43.1603 + }
43.1604 +
43.1605 + template<typename GR, typename NF>
43.1606 + FilterNodes<const GR, const NF>
43.1607 + filterNodes(const GR& graph, const NF& node_filter) {
43.1608 + return FilterNodes<const GR, const NF>(graph, node_filter);
43.1609 + }
43.1610 +
43.1611 + /// \ingroup graph_adaptors
43.1612 + ///
43.1613 + /// \brief Adaptor class for hiding arcs in a digraph.
43.1614 + ///
43.1615 + /// FilterArcs adaptor can be used for hiding arcs in a digraph.
43.1616 + /// A \c bool arc map must be specified, which defines the filter for
43.1617 + /// the arcs. Only the arcs with \c true filter value are shown in the
43.1618 + /// subdigraph. This adaptor conforms to the \ref concepts::Digraph
43.1619 + /// "Digraph" concept.
43.1620 + ///
43.1621 + /// The adapted digraph can also be modified through this adaptor
43.1622 + /// by adding or removing nodes or arcs, unless the \c GR template
43.1623 + /// parameter is set to be \c const.
43.1624 + ///
43.1625 + /// \tparam DGR The type of the adapted digraph.
43.1626 + /// It must conform to the \ref concepts::Digraph "Digraph" concept.
43.1627 + /// It can also be specified to be \c const.
43.1628 + /// \tparam AF The type of the arc filter map.
43.1629 + /// It must be a \c bool (or convertible) arc map of the
43.1630 + /// adapted digraph. The default type is
43.1631 + /// \ref concepts::Digraph::ArcMap "DGR::ArcMap<bool>".
43.1632 + ///
43.1633 + /// \note The \c Node and \c Arc types of this adaptor and the adapted
43.1634 + /// digraph are convertible to each other.
43.1635 +#ifdef DOXYGEN
43.1636 + template<typename DGR,
43.1637 + typename AF>
43.1638 + class FilterArcs {
43.1639 +#else
43.1640 + template<typename DGR,
43.1641 + typename AF = typename DGR::template ArcMap<bool> >
43.1642 + class FilterArcs :
43.1643 + public DigraphAdaptorExtender<
43.1644 + SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >,
43.1645 + AF, false> > {
43.1646 +#endif
43.1647 + typedef DigraphAdaptorExtender<
43.1648 + SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >,
43.1649 + AF, false> > Parent;
43.1650 +
43.1651 + public:
43.1652 +
43.1653 + /// The type of the adapted digraph.
43.1654 + typedef DGR Digraph;
43.1655 + /// The type of the arc filter map.
43.1656 + typedef AF ArcFilterMap;
43.1657 +
43.1658 + typedef typename Parent::Arc Arc;
43.1659 +
43.1660 + protected:
43.1661 + ConstMap<typename DGR::Node, Const<bool, true> > const_true_map;
43.1662 +
43.1663 + FilterArcs() : const_true_map() {}
43.1664 +
43.1665 + public:
43.1666 +
43.1667 + /// \brief Constructor
43.1668 + ///
43.1669 + /// Creates a subdigraph for the given digraph with the given arc
43.1670 + /// filter map.
43.1671 + FilterArcs(DGR& digraph, ArcFilterMap& arc_filter)
43.1672 + : Parent(), const_true_map() {
43.1673 + Parent::initialize(digraph, const_true_map, arc_filter);
43.1674 + }
43.1675 +
43.1676 + /// \brief Sets the status of the given arc
43.1677 + ///
43.1678 + /// This function sets the status of the given arc.
43.1679 + /// It is done by simply setting the assigned value of \c a
43.1680 + /// to \c v in the arc filter map.
43.1681 + void status(const Arc& a, bool v) const { Parent::status(a, v); }
43.1682 +
43.1683 + /// \brief Returns the status of the given arc
43.1684 + ///
43.1685 + /// This function returns the status of the given arc.
43.1686 + /// It is \c true if the given arc is enabled (i.e. not hidden).
43.1687 + bool status(const Arc& a) const { return Parent::status(a); }
43.1688 +
43.1689 + /// \brief Disables the given arc
43.1690 + ///
43.1691 + /// This function disables the given arc in the subdigraph,
43.1692 + /// so the iteration jumps over it.
43.1693 + /// It is the same as \ref status() "status(a, false)".
43.1694 + void disable(const Arc& a) const { Parent::status(a, false); }
43.1695 +
43.1696 + /// \brief Enables the given arc
43.1697 + ///
43.1698 + /// This function enables the given arc in the subdigraph.
43.1699 + /// It is the same as \ref status() "status(a, true)".
43.1700 + void enable(const Arc& a) const { Parent::status(a, true); }
43.1701 +
43.1702 + };
43.1703 +
43.1704 + /// \brief Returns a read-only FilterArcs adaptor
43.1705 + ///
43.1706 + /// This function just returns a read-only \ref FilterArcs adaptor.
43.1707 + /// \ingroup graph_adaptors
43.1708 + /// \relates FilterArcs
43.1709 + template<typename DGR, typename AF>
43.1710 + FilterArcs<const DGR, AF>
43.1711 + filterArcs(const DGR& digraph, AF& arc_filter) {
43.1712 + return FilterArcs<const DGR, AF>(digraph, arc_filter);
43.1713 + }
43.1714 +
43.1715 + template<typename DGR, typename AF>
43.1716 + FilterArcs<const DGR, const AF>
43.1717 + filterArcs(const DGR& digraph, const AF& arc_filter) {
43.1718 + return FilterArcs<const DGR, const AF>(digraph, arc_filter);
43.1719 + }
43.1720 +
43.1721 + /// \ingroup graph_adaptors
43.1722 + ///
43.1723 + /// \brief Adaptor class for hiding edges in a graph.
43.1724 + ///
43.1725 + /// FilterEdges adaptor can be used for hiding edges in a graph.
43.1726 + /// A \c bool edge map must be specified, which defines the filter for
43.1727 + /// the edges. Only the edges with \c true filter value are shown in the
43.1728 + /// subgraph. This adaptor conforms to the \ref concepts::Graph
43.1729 + /// "Graph" concept.
43.1730 + ///
43.1731 + /// The adapted graph can also be modified through this adaptor
43.1732 + /// by adding or removing nodes or edges, unless the \c GR template
43.1733 + /// parameter is set to be \c const.
43.1734 + ///
43.1735 + /// \tparam GR The type of the adapted graph.
43.1736 + /// It must conform to the \ref concepts::Graph "Graph" concept.
43.1737 + /// It can also be specified to be \c const.
43.1738 + /// \tparam EF The type of the edge filter map.
43.1739 + /// It must be a \c bool (or convertible) edge map of the
43.1740 + /// adapted graph. The default type is
43.1741 + /// \ref concepts::Graph::EdgeMap "GR::EdgeMap<bool>".
43.1742 + ///
43.1743 + /// \note The \c Node, \c Edge and \c Arc types of this adaptor and the
43.1744 + /// adapted graph are convertible to each other.
43.1745 +#ifdef DOXYGEN
43.1746 + template<typename GR,
43.1747 + typename EF>
43.1748 + class FilterEdges {
43.1749 +#else
43.1750 + template<typename GR,
43.1751 + typename EF = typename GR::template EdgeMap<bool> >
43.1752 + class FilterEdges :
43.1753 + public GraphAdaptorExtender<
43.1754 + SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true> >,
43.1755 + EF, false> > {
43.1756 +#endif
43.1757 + typedef GraphAdaptorExtender<
43.1758 + SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >,
43.1759 + EF, false> > Parent;
43.1760 +
43.1761 + public:
43.1762 +
43.1763 + /// The type of the adapted graph.
43.1764 + typedef GR Graph;
43.1765 + /// The type of the edge filter map.
43.1766 + typedef EF EdgeFilterMap;
43.1767 +
43.1768 + typedef typename Parent::Edge Edge;
43.1769 +
43.1770 + protected:
43.1771 + ConstMap<typename GR::Node, Const<bool, true> > const_true_map;
43.1772 +
43.1773 + FilterEdges() : const_true_map(true) {
43.1774 + Parent::setNodeFilterMap(const_true_map);
43.1775 + }
43.1776 +
43.1777 + public:
43.1778 +
43.1779 + /// \brief Constructor
43.1780 + ///
43.1781 + /// Creates a subgraph for the given graph with the given edge
43.1782 + /// filter map.
43.1783 + FilterEdges(GR& graph, EF& edge_filter)
43.1784 + : Parent(), const_true_map() {
43.1785 + Parent::initialize(graph, const_true_map, edge_filter);
43.1786 + }
43.1787 +
43.1788 + /// \brief Sets the status of the given edge
43.1789 + ///
43.1790 + /// This function sets the status of the given edge.
43.1791 + /// It is done by simply setting the assigned value of \c e
43.1792 + /// to \c v in the edge filter map.
43.1793 + void status(const Edge& e, bool v) const { Parent::status(e, v); }
43.1794 +
43.1795 + /// \brief Returns the status of the given edge
43.1796 + ///
43.1797 + /// This function returns the status of the given edge.
43.1798 + /// It is \c true if the given edge is enabled (i.e. not hidden).
43.1799 + bool status(const Edge& e) const { return Parent::status(e); }
43.1800 +
43.1801 + /// \brief Disables the given edge
43.1802 + ///
43.1803 + /// This function disables the given edge in the subgraph,
43.1804 + /// so the iteration jumps over it.
43.1805 + /// It is the same as \ref status() "status(e, false)".
43.1806 + void disable(const Edge& e) const { Parent::status(e, false); }
43.1807 +
43.1808 + /// \brief Enables the given edge
43.1809 + ///
43.1810 + /// This function enables the given edge in the subgraph.
43.1811 + /// It is the same as \ref status() "status(e, true)".
43.1812 + void enable(const Edge& e) const { Parent::status(e, true); }
43.1813 +
43.1814 + };
43.1815 +
43.1816 + /// \brief Returns a read-only FilterEdges adaptor
43.1817 + ///
43.1818 + /// This function just returns a read-only \ref FilterEdges adaptor.
43.1819 + /// \ingroup graph_adaptors
43.1820 + /// \relates FilterEdges
43.1821 + template<typename GR, typename EF>
43.1822 + FilterEdges<const GR, EF>
43.1823 + filterEdges(const GR& graph, EF& edge_filter) {
43.1824 + return FilterEdges<const GR, EF>(graph, edge_filter);
43.1825 + }
43.1826 +
43.1827 + template<typename GR, typename EF>
43.1828 + FilterEdges<const GR, const EF>
43.1829 + filterEdges(const GR& graph, const EF& edge_filter) {
43.1830 + return FilterEdges<const GR, const EF>(graph, edge_filter);
43.1831 + }
43.1832 +
43.1833 +
43.1834 + template <typename DGR>
43.1835 + class UndirectorBase {
43.1836 + public:
43.1837 + typedef DGR Digraph;
43.1838 + typedef UndirectorBase Adaptor;
43.1839 +
43.1840 + typedef True UndirectedTag;
43.1841 +
43.1842 + typedef typename Digraph::Arc Edge;
43.1843 + typedef typename Digraph::Node Node;
43.1844 +
43.1845 + class Arc {
43.1846 + friend class UndirectorBase;
43.1847 + protected:
43.1848 + Edge _edge;
43.1849 + bool _forward;
43.1850 +
43.1851 + Arc(const Edge& edge, bool forward)
43.1852 + : _edge(edge), _forward(forward) {}
43.1853 +
43.1854 + public:
43.1855 + Arc() {}
43.1856 +
43.1857 + Arc(Invalid) : _edge(INVALID), _forward(true) {}
43.1858 +
43.1859 + operator const Edge&() const { return _edge; }
43.1860 +
43.1861 + bool operator==(const Arc &other) const {
43.1862 + return _forward == other._forward && _edge == other._edge;
43.1863 + }
43.1864 + bool operator!=(const Arc &other) const {
43.1865 + return _forward != other._forward || _edge != other._edge;
43.1866 + }
43.1867 + bool operator<(const Arc &other) const {
43.1868 + return _forward < other._forward ||
43.1869 + (_forward == other._forward && _edge < other._edge);
43.1870 + }
43.1871 + };
43.1872 +
43.1873 + void first(Node& n) const {
43.1874 + _digraph->first(n);
43.1875 + }
43.1876 +
43.1877 + void next(Node& n) const {
43.1878 + _digraph->next(n);
43.1879 + }
43.1880 +
43.1881 + void first(Arc& a) const {
43.1882 + _digraph->first(a._edge);
43.1883 + a._forward = true;
43.1884 + }
43.1885 +
43.1886 + void next(Arc& a) const {
43.1887 + if (a._forward) {
43.1888 + a._forward = false;
43.1889 + } else {
43.1890 + _digraph->next(a._edge);
43.1891 + a._forward = true;
43.1892 + }
43.1893 + }
43.1894 +
43.1895 + void first(Edge& e) const {
43.1896 + _digraph->first(e);
43.1897 + }
43.1898 +
43.1899 + void next(Edge& e) const {
43.1900 + _digraph->next(e);
43.1901 + }
43.1902 +
43.1903 + void firstOut(Arc& a, const Node& n) const {
43.1904 + _digraph->firstIn(a._edge, n);
43.1905 + if (a._edge != INVALID ) {
43.1906 + a._forward = false;
43.1907 + } else {
43.1908 + _digraph->firstOut(a._edge, n);
43.1909 + a._forward = true;
43.1910 + }
43.1911 + }
43.1912 + void nextOut(Arc &a) const {
43.1913 + if (!a._forward) {
43.1914 + Node n = _digraph->target(a._edge);
43.1915 + _digraph->nextIn(a._edge);
43.1916 + if (a._edge == INVALID) {
43.1917 + _digraph->firstOut(a._edge, n);
43.1918 + a._forward = true;
43.1919 + }
43.1920 + }
43.1921 + else {
43.1922 + _digraph->nextOut(a._edge);
43.1923 + }
43.1924 + }
43.1925 +
43.1926 + void firstIn(Arc &a, const Node &n) const {
43.1927 + _digraph->firstOut(a._edge, n);
43.1928 + if (a._edge != INVALID ) {
43.1929 + a._forward = false;
43.1930 + } else {
43.1931 + _digraph->firstIn(a._edge, n);
43.1932 + a._forward = true;
43.1933 + }
43.1934 + }
43.1935 + void nextIn(Arc &a) const {
43.1936 + if (!a._forward) {
43.1937 + Node n = _digraph->source(a._edge);
43.1938 + _digraph->nextOut(a._edge);
43.1939 + if (a._edge == INVALID ) {
43.1940 + _digraph->firstIn(a._edge, n);
43.1941 + a._forward = true;
43.1942 + }
43.1943 + }
43.1944 + else {
43.1945 + _digraph->nextIn(a._edge);
43.1946 + }
43.1947 + }
43.1948 +
43.1949 + void firstInc(Edge &e, bool &d, const Node &n) const {
43.1950 + d = true;
43.1951 + _digraph->firstOut(e, n);
43.1952 + if (e != INVALID) return;
43.1953 + d = false;
43.1954 + _digraph->firstIn(e, n);
43.1955 + }
43.1956 +
43.1957 + void nextInc(Edge &e, bool &d) const {
43.1958 + if (d) {
43.1959 + Node s = _digraph->source(e);
43.1960 + _digraph->nextOut(e);
43.1961 + if (e != INVALID) return;
43.1962 + d = false;
43.1963 + _digraph->firstIn(e, s);
43.1964 + } else {
43.1965 + _digraph->nextIn(e);
43.1966 + }
43.1967 + }
43.1968 +
43.1969 + Node u(const Edge& e) const {
43.1970 + return _digraph->source(e);
43.1971 + }
43.1972 +
43.1973 + Node v(const Edge& e) const {
43.1974 + return _digraph->target(e);
43.1975 + }
43.1976 +
43.1977 + Node source(const Arc &a) const {
43.1978 + return a._forward ? _digraph->source(a._edge) : _digraph->target(a._edge);
43.1979 + }
43.1980 +
43.1981 + Node target(const Arc &a) const {
43.1982 + return a._forward ? _digraph->target(a._edge) : _digraph->source(a._edge);
43.1983 + }
43.1984 +
43.1985 + static Arc direct(const Edge &e, bool d) {
43.1986 + return Arc(e, d);
43.1987 + }
43.1988 +
43.1989 + static bool direction(const Arc &a) { return a._forward; }
43.1990 +
43.1991 + Node nodeFromId(int ix) const { return _digraph->nodeFromId(ix); }
43.1992 + Arc arcFromId(int ix) const {
43.1993 + return direct(_digraph->arcFromId(ix >> 1), bool(ix & 1));
43.1994 + }
43.1995 + Edge edgeFromId(int ix) const { return _digraph->arcFromId(ix); }
43.1996 +
43.1997 + int id(const Node &n) const { return _digraph->id(n); }
43.1998 + int id(const Arc &a) const {
43.1999 + return (_digraph->id(a) << 1) | (a._forward ? 1 : 0);
43.2000 + }
43.2001 + int id(const Edge &e) const { return _digraph->id(e); }
43.2002 +
43.2003 + int maxNodeId() const { return _digraph->maxNodeId(); }
43.2004 + int maxArcId() const { return (_digraph->maxArcId() << 1) | 1; }
43.2005 + int maxEdgeId() const { return _digraph->maxArcId(); }
43.2006 +
43.2007 + Node addNode() { return _digraph->addNode(); }
43.2008 + Edge addEdge(const Node& u, const Node& v) {
43.2009 + return _digraph->addArc(u, v);
43.2010 + }
43.2011 +
43.2012 + void erase(const Node& i) { _digraph->erase(i); }
43.2013 + void erase(const Edge& i) { _digraph->erase(i); }
43.2014 +
43.2015 + void clear() { _digraph->clear(); }
43.2016 +
43.2017 + typedef NodeNumTagIndicator<Digraph> NodeNumTag;
43.2018 + int nodeNum() const { return _digraph->nodeNum(); }
43.2019 +
43.2020 + typedef ArcNumTagIndicator<Digraph> ArcNumTag;
43.2021 + int arcNum() const { return 2 * _digraph->arcNum(); }
43.2022 +
43.2023 + typedef ArcNumTag EdgeNumTag;
43.2024 + int edgeNum() const { return _digraph->arcNum(); }
43.2025 +
43.2026 + typedef FindArcTagIndicator<Digraph> FindArcTag;
43.2027 + Arc findArc(Node s, Node t, Arc p = INVALID) const {
43.2028 + if (p == INVALID) {
43.2029 + Edge arc = _digraph->findArc(s, t);
43.2030 + if (arc != INVALID) return direct(arc, true);
43.2031 + arc = _digraph->findArc(t, s);
43.2032 + if (arc != INVALID) return direct(arc, false);
43.2033 + } else if (direction(p)) {
43.2034 + Edge arc = _digraph->findArc(s, t, p);
43.2035 + if (arc != INVALID) return direct(arc, true);
43.2036 + arc = _digraph->findArc(t, s);
43.2037 + if (arc != INVALID) return direct(arc, false);
43.2038 + } else {
43.2039 + Edge arc = _digraph->findArc(t, s, p);
43.2040 + if (arc != INVALID) return direct(arc, false);
43.2041 + }
43.2042 + return INVALID;
43.2043 + }
43.2044 +
43.2045 + typedef FindArcTag FindEdgeTag;
43.2046 + Edge findEdge(Node s, Node t, Edge p = INVALID) const {
43.2047 + if (s != t) {
43.2048 + if (p == INVALID) {
43.2049 + Edge arc = _digraph->findArc(s, t);
43.2050 + if (arc != INVALID) return arc;
43.2051 + arc = _digraph->findArc(t, s);
43.2052 + if (arc != INVALID) return arc;
43.2053 + } else if (_digraph->source(p) == s) {
43.2054 + Edge arc = _digraph->findArc(s, t, p);
43.2055 + if (arc != INVALID) return arc;
43.2056 + arc = _digraph->findArc(t, s);
43.2057 + if (arc != INVALID) return arc;
43.2058 + } else {
43.2059 + Edge arc = _digraph->findArc(t, s, p);
43.2060 + if (arc != INVALID) return arc;
43.2061 + }
43.2062 + } else {
43.2063 + return _digraph->findArc(s, t, p);
43.2064 + }
43.2065 + return INVALID;
43.2066 + }
43.2067 +
43.2068 + private:
43.2069 +
43.2070 + template <typename V>
43.2071 + class ArcMapBase {
43.2072 + private:
43.2073 +
43.2074 + typedef typename DGR::template ArcMap<V> MapImpl;
43.2075 +
43.2076 + public:
43.2077 +
43.2078 + typedef typename MapTraits<MapImpl>::ReferenceMapTag ReferenceMapTag;
43.2079 +
43.2080 + typedef V Value;
43.2081 + typedef Arc Key;
43.2082 + typedef typename MapTraits<MapImpl>::ConstReturnValue ConstReturnValue;
43.2083 + typedef typename MapTraits<MapImpl>::ReturnValue ReturnValue;
43.2084 + typedef typename MapTraits<MapImpl>::ConstReturnValue ConstReference;
43.2085 + typedef typename MapTraits<MapImpl>::ReturnValue Reference;
43.2086 +
43.2087 + ArcMapBase(const UndirectorBase<DGR>& adaptor) :
43.2088 + _forward(*adaptor._digraph), _backward(*adaptor._digraph) {}
43.2089 +
43.2090 + ArcMapBase(const UndirectorBase<DGR>& adaptor, const V& value)
43.2091 + : _forward(*adaptor._digraph, value),
43.2092 + _backward(*adaptor._digraph, value) {}
43.2093 +
43.2094 + void set(const Arc& a, const V& value) {
43.2095 + if (direction(a)) {
43.2096 + _forward.set(a, value);
43.2097 + } else {
43.2098 + _backward.set(a, value);
43.2099 + }
43.2100 + }
43.2101 +
43.2102 + ConstReturnValue operator[](const Arc& a) const {
43.2103 + if (direction(a)) {
43.2104 + return _forward[a];
43.2105 + } else {
43.2106 + return _backward[a];
43.2107 + }
43.2108 + }
43.2109 +
43.2110 + ReturnValue operator[](const Arc& a) {
43.2111 + if (direction(a)) {
43.2112 + return _forward[a];
43.2113 + } else {
43.2114 + return _backward[a];
43.2115 + }
43.2116 + }
43.2117 +
43.2118 + protected:
43.2119 +
43.2120 + MapImpl _forward, _backward;
43.2121 +
43.2122 + };
43.2123 +
43.2124 + public:
43.2125 +
43.2126 + template <typename V>
43.2127 + class NodeMap : public DGR::template NodeMap<V> {
43.2128 + typedef typename DGR::template NodeMap<V> Parent;
43.2129 +
43.2130 + public:
43.2131 + typedef V Value;
43.2132 +
43.2133 + explicit NodeMap(const UndirectorBase<DGR>& adaptor)
43.2134 + : Parent(*adaptor._digraph) {}
43.2135 +
43.2136 + NodeMap(const UndirectorBase<DGR>& adaptor, const V& value)
43.2137 + : Parent(*adaptor._digraph, value) { }
43.2138 +
43.2139 + private:
43.2140 + NodeMap& operator=(const NodeMap& cmap) {
43.2141 + return operator=<NodeMap>(cmap);
43.2142 + }
43.2143 +
43.2144 + template <typename CMap>
43.2145 + NodeMap& operator=(const CMap& cmap) {
43.2146 + Parent::operator=(cmap);
43.2147 + return *this;
43.2148 + }
43.2149 +
43.2150 + };
43.2151 +
43.2152 + template <typename V>
43.2153 + class ArcMap
43.2154 + : public SubMapExtender<UndirectorBase<DGR>, ArcMapBase<V> > {
43.2155 + typedef SubMapExtender<UndirectorBase<DGR>, ArcMapBase<V> > Parent;
43.2156 +
43.2157 + public:
43.2158 + typedef V Value;
43.2159 +
43.2160 + explicit ArcMap(const UndirectorBase<DGR>& adaptor)
43.2161 + : Parent(adaptor) {}
43.2162 +
43.2163 + ArcMap(const UndirectorBase<DGR>& adaptor, const V& value)
43.2164 + : Parent(adaptor, value) {}
43.2165 +
43.2166 + private:
43.2167 + ArcMap& operator=(const ArcMap& cmap) {
43.2168 + return operator=<ArcMap>(cmap);
43.2169 + }
43.2170 +
43.2171 + template <typename CMap>
43.2172 + ArcMap& operator=(const CMap& cmap) {
43.2173 + Parent::operator=(cmap);
43.2174 + return *this;
43.2175 + }
43.2176 + };
43.2177 +
43.2178 + template <typename V>
43.2179 + class EdgeMap : public Digraph::template ArcMap<V> {
43.2180 + typedef typename Digraph::template ArcMap<V> Parent;
43.2181 +
43.2182 + public:
43.2183 + typedef V Value;
43.2184 +
43.2185 + explicit EdgeMap(const UndirectorBase<DGR>& adaptor)
43.2186 + : Parent(*adaptor._digraph) {}
43.2187 +
43.2188 + EdgeMap(const UndirectorBase<DGR>& adaptor, const V& value)
43.2189 + : Parent(*adaptor._digraph, value) {}
43.2190 +
43.2191 + private:
43.2192 + EdgeMap& operator=(const EdgeMap& cmap) {
43.2193 + return operator=<EdgeMap>(cmap);
43.2194 + }
43.2195 +
43.2196 + template <typename CMap>
43.2197 + EdgeMap& operator=(const CMap& cmap) {
43.2198 + Parent::operator=(cmap);
43.2199 + return *this;
43.2200 + }
43.2201 +
43.2202 + };
43.2203 +
43.2204 + typedef typename ItemSetTraits<DGR, Node>::ItemNotifier NodeNotifier;
43.2205 + NodeNotifier& notifier(Node) const { return _digraph->notifier(Node()); }
43.2206 +
43.2207 + typedef typename ItemSetTraits<DGR, Edge>::ItemNotifier EdgeNotifier;
43.2208 + EdgeNotifier& notifier(Edge) const { return _digraph->notifier(Edge()); }
43.2209 +
43.2210 + typedef EdgeNotifier ArcNotifier;
43.2211 + ArcNotifier& notifier(Arc) const { return _digraph->notifier(Edge()); }
43.2212 +
43.2213 + protected:
43.2214 +
43.2215 + UndirectorBase() : _digraph(0) {}
43.2216 +
43.2217 + DGR* _digraph;
43.2218 +
43.2219 + void initialize(DGR& digraph) {
43.2220 + _digraph = &digraph;
43.2221 + }
43.2222 +
43.2223 + };
43.2224 +
43.2225 + /// \ingroup graph_adaptors
43.2226 + ///
43.2227 + /// \brief Adaptor class for viewing a digraph as an undirected graph.
43.2228 + ///
43.2229 + /// Undirector adaptor can be used for viewing a digraph as an undirected
43.2230 + /// graph. All arcs of the underlying digraph are showed in the
43.2231 + /// adaptor as an edge (and also as a pair of arcs, of course).
43.2232 + /// This adaptor conforms to the \ref concepts::Graph "Graph" concept.
43.2233 + ///
43.2234 + /// The adapted digraph can also be modified through this adaptor
43.2235 + /// by adding or removing nodes or edges, unless the \c GR template
43.2236 + /// parameter is set to be \c const.
43.2237 + ///
43.2238 + /// \tparam DGR The type of the adapted digraph.
43.2239 + /// It must conform to the \ref concepts::Digraph "Digraph" concept.
43.2240 + /// It can also be specified to be \c const.
43.2241 + ///
43.2242 + /// \note The \c Node type of this adaptor and the adapted digraph are
43.2243 + /// convertible to each other, moreover the \c Edge type of the adaptor
43.2244 + /// and the \c Arc type of the adapted digraph are also convertible to
43.2245 + /// each other.
43.2246 + /// (Thus the \c Arc type of the adaptor is convertible to the \c Arc type
43.2247 + /// of the adapted digraph.)
43.2248 + template<typename DGR>
43.2249 +#ifdef DOXYGEN
43.2250 + class Undirector {
43.2251 +#else
43.2252 + class Undirector :
43.2253 + public GraphAdaptorExtender<UndirectorBase<DGR> > {
43.2254 +#endif
43.2255 + typedef GraphAdaptorExtender<UndirectorBase<DGR> > Parent;
43.2256 + public:
43.2257 + /// The type of the adapted digraph.
43.2258 + typedef DGR Digraph;
43.2259 + protected:
43.2260 + Undirector() { }
43.2261 + public:
43.2262 +
43.2263 + /// \brief Constructor
43.2264 + ///
43.2265 + /// Creates an undirected graph from the given digraph.
43.2266 + Undirector(DGR& digraph) {
43.2267 + initialize(digraph);
43.2268 + }
43.2269 +
43.2270 + /// \brief Arc map combined from two original arc maps
43.2271 + ///
43.2272 + /// This map adaptor class adapts two arc maps of the underlying
43.2273 + /// digraph to get an arc map of the undirected graph.
43.2274 + /// Its value type is inherited from the first arc map type (\c FW).
43.2275 + /// \tparam FW The type of the "foward" arc map.
43.2276 + /// \tparam BK The type of the "backward" arc map.
43.2277 + template <typename FW, typename BK>
43.2278 + class CombinedArcMap {
43.2279 + public:
43.2280 +
43.2281 + /// The key type of the map
43.2282 + typedef typename Parent::Arc Key;
43.2283 + /// The value type of the map
43.2284 + typedef typename FW::Value Value;
43.2285 +
43.2286 + typedef typename MapTraits<FW>::ReferenceMapTag ReferenceMapTag;
43.2287 +
43.2288 + typedef typename MapTraits<FW>::ReturnValue ReturnValue;
43.2289 + typedef typename MapTraits<FW>::ConstReturnValue ConstReturnValue;
43.2290 + typedef typename MapTraits<FW>::ReturnValue Reference;
43.2291 + typedef typename MapTraits<FW>::ConstReturnValue ConstReference;
43.2292 +
43.2293 + /// Constructor
43.2294 + CombinedArcMap(FW& forward, BK& backward)
43.2295 + : _forward(&forward), _backward(&backward) {}
43.2296 +
43.2297 + /// Sets the value associated with the given key.
43.2298 + void set(const Key& e, const Value& a) {
43.2299 + if (Parent::direction(e)) {
43.2300 + _forward->set(e, a);
43.2301 + } else {
43.2302 + _backward->set(e, a);
43.2303 + }
43.2304 + }
43.2305 +
43.2306 + /// Returns the value associated with the given key.
43.2307 + ConstReturnValue operator[](const Key& e) const {
43.2308 + if (Parent::direction(e)) {
43.2309 + return (*_forward)[e];
43.2310 + } else {
43.2311 + return (*_backward)[e];
43.2312 + }
43.2313 + }
43.2314 +
43.2315 + /// Returns a reference to the value associated with the given key.
43.2316 + ReturnValue operator[](const Key& e) {
43.2317 + if (Parent::direction(e)) {
43.2318 + return (*_forward)[e];
43.2319 + } else {
43.2320 + return (*_backward)[e];
43.2321 + }
43.2322 + }
43.2323 +
43.2324 + protected:
43.2325 +
43.2326 + FW* _forward;
43.2327 + BK* _backward;
43.2328 +
43.2329 + };
43.2330 +
43.2331 + /// \brief Returns a combined arc map
43.2332 + ///
43.2333 + /// This function just returns a combined arc map.
43.2334 + template <typename FW, typename BK>
43.2335 + static CombinedArcMap<FW, BK>
43.2336 + combinedArcMap(FW& forward, BK& backward) {
43.2337 + return CombinedArcMap<FW, BK>(forward, backward);
43.2338 + }
43.2339 +
43.2340 + template <typename FW, typename BK>
43.2341 + static CombinedArcMap<const FW, BK>
43.2342 + combinedArcMap(const FW& forward, BK& backward) {
43.2343 + return CombinedArcMap<const FW, BK>(forward, backward);
43.2344 + }
43.2345 +
43.2346 + template <typename FW, typename BK>
43.2347 + static CombinedArcMap<FW, const BK>
43.2348 + combinedArcMap(FW& forward, const BK& backward) {
43.2349 + return CombinedArcMap<FW, const BK>(forward, backward);
43.2350 + }
43.2351 +
43.2352 + template <typename FW, typename BK>
43.2353 + static CombinedArcMap<const FW, const BK>
43.2354 + combinedArcMap(const FW& forward, const BK& backward) {
43.2355 + return CombinedArcMap<const FW, const BK>(forward, backward);
43.2356 + }
43.2357 +
43.2358 + };
43.2359 +
43.2360 + /// \brief Returns a read-only Undirector adaptor
43.2361 + ///
43.2362 + /// This function just returns a read-only \ref Undirector adaptor.
43.2363 + /// \ingroup graph_adaptors
43.2364 + /// \relates Undirector
43.2365 + template<typename DGR>
43.2366 + Undirector<const DGR> undirector(const DGR& digraph) {
43.2367 + return Undirector<const DGR>(digraph);
43.2368 + }
43.2369 +
43.2370 +
43.2371 + template <typename GR, typename DM>
43.2372 + class OrienterBase {
43.2373 + public:
43.2374 +
43.2375 + typedef GR Graph;
43.2376 + typedef DM DirectionMap;
43.2377 +
43.2378 + typedef typename GR::Node Node;
43.2379 + typedef typename GR::Edge Arc;
43.2380 +
43.2381 + void reverseArc(const Arc& arc) {
43.2382 + _direction->set(arc, !(*_direction)[arc]);
43.2383 + }
43.2384 +
43.2385 + void first(Node& i) const { _graph->first(i); }
43.2386 + void first(Arc& i) const { _graph->first(i); }
43.2387 + void firstIn(Arc& i, const Node& n) const {
43.2388 + bool d = true;
43.2389 + _graph->firstInc(i, d, n);
43.2390 + while (i != INVALID && d == (*_direction)[i]) _graph->nextInc(i, d);
43.2391 + }
43.2392 + void firstOut(Arc& i, const Node& n ) const {
43.2393 + bool d = true;
43.2394 + _graph->firstInc(i, d, n);
43.2395 + while (i != INVALID && d != (*_direction)[i]) _graph->nextInc(i, d);
43.2396 + }
43.2397 +
43.2398 + void next(Node& i) const { _graph->next(i); }
43.2399 + void next(Arc& i) const { _graph->next(i); }
43.2400 + void nextIn(Arc& i) const {
43.2401 + bool d = !(*_direction)[i];
43.2402 + _graph->nextInc(i, d);
43.2403 + while (i != INVALID && d == (*_direction)[i]) _graph->nextInc(i, d);
43.2404 + }
43.2405 + void nextOut(Arc& i) const {
43.2406 + bool d = (*_direction)[i];
43.2407 + _graph->nextInc(i, d);
43.2408 + while (i != INVALID && d != (*_direction)[i]) _graph->nextInc(i, d);
43.2409 + }
43.2410 +
43.2411 + Node source(const Arc& e) const {
43.2412 + return (*_direction)[e] ? _graph->u(e) : _graph->v(e);
43.2413 + }
43.2414 + Node target(const Arc& e) const {
43.2415 + return (*_direction)[e] ? _graph->v(e) : _graph->u(e);
43.2416 + }
43.2417 +
43.2418 + typedef NodeNumTagIndicator<Graph> NodeNumTag;
43.2419 + int nodeNum() const { return _graph->nodeNum(); }
43.2420 +
43.2421 + typedef EdgeNumTagIndicator<Graph> ArcNumTag;
43.2422 + int arcNum() const { return _graph->edgeNum(); }
43.2423 +
43.2424 + typedef FindEdgeTagIndicator<Graph> FindArcTag;
43.2425 + Arc findArc(const Node& u, const Node& v,
43.2426 + const Arc& prev = INVALID) const {
43.2427 + Arc arc = _graph->findEdge(u, v, prev);
43.2428 + while (arc != INVALID && source(arc) != u) {
43.2429 + arc = _graph->findEdge(u, v, arc);
43.2430 + }
43.2431 + return arc;
43.2432 + }
43.2433 +
43.2434 + Node addNode() {
43.2435 + return Node(_graph->addNode());
43.2436 + }
43.2437 +
43.2438 + Arc addArc(const Node& u, const Node& v) {
43.2439 + Arc arc = _graph->addEdge(u, v);
43.2440 + _direction->set(arc, _graph->u(arc) == u);
43.2441 + return arc;
43.2442 + }
43.2443 +
43.2444 + void erase(const Node& i) { _graph->erase(i); }
43.2445 + void erase(const Arc& i) { _graph->erase(i); }
43.2446 +
43.2447 + void clear() { _graph->clear(); }
43.2448 +
43.2449 + int id(const Node& v) const { return _graph->id(v); }
43.2450 + int id(const Arc& e) const { return _graph->id(e); }
43.2451 +
43.2452 + Node nodeFromId(int idx) const { return _graph->nodeFromId(idx); }
43.2453 + Arc arcFromId(int idx) const { return _graph->edgeFromId(idx); }
43.2454 +
43.2455 + int maxNodeId() const { return _graph->maxNodeId(); }
43.2456 + int maxArcId() const { return _graph->maxEdgeId(); }
43.2457 +
43.2458 + typedef typename ItemSetTraits<GR, Node>::ItemNotifier NodeNotifier;
43.2459 + NodeNotifier& notifier(Node) const { return _graph->notifier(Node()); }
43.2460 +
43.2461 + typedef typename ItemSetTraits<GR, Arc>::ItemNotifier ArcNotifier;
43.2462 + ArcNotifier& notifier(Arc) const { return _graph->notifier(Arc()); }
43.2463 +
43.2464 + template <typename V>
43.2465 + class NodeMap : public GR::template NodeMap<V> {
43.2466 + typedef typename GR::template NodeMap<V> Parent;
43.2467 +
43.2468 + public:
43.2469 +
43.2470 + explicit NodeMap(const OrienterBase<GR, DM>& adapter)
43.2471 + : Parent(*adapter._graph) {}
43.2472 +
43.2473 + NodeMap(const OrienterBase<GR, DM>& adapter, const V& value)
43.2474 + : Parent(*adapter._graph, value) {}
43.2475 +
43.2476 + private:
43.2477 + NodeMap& operator=(const NodeMap& cmap) {
43.2478 + return operator=<NodeMap>(cmap);
43.2479 + }
43.2480 +
43.2481 + template <typename CMap>
43.2482 + NodeMap& operator=(const CMap& cmap) {
43.2483 + Parent::operator=(cmap);
43.2484 + return *this;
43.2485 + }
43.2486 +
43.2487 + };
43.2488 +
43.2489 + template <typename V>
43.2490 + class ArcMap : public GR::template EdgeMap<V> {
43.2491 + typedef typename Graph::template EdgeMap<V> Parent;
43.2492 +
43.2493 + public:
43.2494 +
43.2495 + explicit ArcMap(const OrienterBase<GR, DM>& adapter)
43.2496 + : Parent(*adapter._graph) { }
43.2497 +
43.2498 + ArcMap(const OrienterBase<GR, DM>& adapter, const V& value)
43.2499 + : Parent(*adapter._graph, value) { }
43.2500 +
43.2501 + private:
43.2502 + ArcMap& operator=(const ArcMap& cmap) {
43.2503 + return operator=<ArcMap>(cmap);
43.2504 + }
43.2505 +
43.2506 + template <typename CMap>
43.2507 + ArcMap& operator=(const CMap& cmap) {
43.2508 + Parent::operator=(cmap);
43.2509 + return *this;
43.2510 + }
43.2511 + };
43.2512 +
43.2513 +
43.2514 +
43.2515 + protected:
43.2516 + Graph* _graph;
43.2517 + DM* _direction;
43.2518 +
43.2519 + void initialize(GR& graph, DM& direction) {
43.2520 + _graph = &graph;
43.2521 + _direction = &direction;
43.2522 + }
43.2523 +
43.2524 + };
43.2525 +
43.2526 + /// \ingroup graph_adaptors
43.2527 + ///
43.2528 + /// \brief Adaptor class for orienting the edges of a graph to get a digraph
43.2529 + ///
43.2530 + /// Orienter adaptor can be used for orienting the edges of a graph to
43.2531 + /// get a digraph. A \c bool edge map of the underlying graph must be
43.2532 + /// specified, which define the direction of the arcs in the adaptor.
43.2533 + /// The arcs can be easily reversed by the \c reverseArc() member function
43.2534 + /// of the adaptor.
43.2535 + /// This class conforms to the \ref concepts::Digraph "Digraph" concept.
43.2536 + ///
43.2537 + /// The adapted graph can also be modified through this adaptor
43.2538 + /// by adding or removing nodes or arcs, unless the \c GR template
43.2539 + /// parameter is set to be \c const.
43.2540 + ///
43.2541 + /// \tparam GR The type of the adapted graph.
43.2542 + /// It must conform to the \ref concepts::Graph "Graph" concept.
43.2543 + /// It can also be specified to be \c const.
43.2544 + /// \tparam DM The type of the direction map.
43.2545 + /// It must be a \c bool (or convertible) edge map of the
43.2546 + /// adapted graph. The default type is
43.2547 + /// \ref concepts::Graph::EdgeMap "GR::EdgeMap<bool>".
43.2548 + ///
43.2549 + /// \note The \c Node type of this adaptor and the adapted graph are
43.2550 + /// convertible to each other, moreover the \c Arc type of the adaptor
43.2551 + /// and the \c Edge type of the adapted graph are also convertible to
43.2552 + /// each other.
43.2553 +#ifdef DOXYGEN
43.2554 + template<typename GR,
43.2555 + typename DM>
43.2556 + class Orienter {
43.2557 +#else
43.2558 + template<typename GR,
43.2559 + typename DM = typename GR::template EdgeMap<bool> >
43.2560 + class Orienter :
43.2561 + public DigraphAdaptorExtender<OrienterBase<GR, DM> > {
43.2562 +#endif
43.2563 + typedef DigraphAdaptorExtender<OrienterBase<GR, DM> > Parent;
43.2564 + public:
43.2565 +
43.2566 + /// The type of the adapted graph.
43.2567 + typedef GR Graph;
43.2568 + /// The type of the direction edge map.
43.2569 + typedef DM DirectionMap;
43.2570 +
43.2571 + typedef typename Parent::Arc Arc;
43.2572 +
43.2573 + protected:
43.2574 + Orienter() { }
43.2575 +
43.2576 + public:
43.2577 +
43.2578 + /// \brief Constructor
43.2579 + ///
43.2580 + /// Constructor of the adaptor.
43.2581 + Orienter(GR& graph, DM& direction) {
43.2582 + Parent::initialize(graph, direction);
43.2583 + }
43.2584 +
43.2585 + /// \brief Reverses the given arc
43.2586 + ///
43.2587 + /// This function reverses the given arc.
43.2588 + /// It is done by simply negate the assigned value of \c a
43.2589 + /// in the direction map.
43.2590 + void reverseArc(const Arc& a) {
43.2591 + Parent::reverseArc(a);
43.2592 + }
43.2593 + };
43.2594 +
43.2595 + /// \brief Returns a read-only Orienter adaptor
43.2596 + ///
43.2597 + /// This function just returns a read-only \ref Orienter adaptor.
43.2598 + /// \ingroup graph_adaptors
43.2599 + /// \relates Orienter
43.2600 + template<typename GR, typename DM>
43.2601 + Orienter<const GR, DM>
43.2602 + orienter(const GR& graph, DM& direction) {
43.2603 + return Orienter<const GR, DM>(graph, direction);
43.2604 + }
43.2605 +
43.2606 + template<typename GR, typename DM>
43.2607 + Orienter<const GR, const DM>
43.2608 + orienter(const GR& graph, const DM& direction) {
43.2609 + return Orienter<const GR, const DM>(graph, direction);
43.2610 + }
43.2611 +
43.2612 + namespace _adaptor_bits {
43.2613 +
43.2614 + template <typename DGR, typename CM, typename FM, typename TL>
43.2615 + class ResForwardFilter {
43.2616 + public:
43.2617 +
43.2618 + typedef typename DGR::Arc Key;
43.2619 + typedef bool Value;
43.2620 +
43.2621 + private:
43.2622 +
43.2623 + const CM* _capacity;
43.2624 + const FM* _flow;
43.2625 + TL _tolerance;
43.2626 +
43.2627 + public:
43.2628 +
43.2629 + ResForwardFilter(const CM& capacity, const FM& flow,
43.2630 + const TL& tolerance = TL())
43.2631 + : _capacity(&capacity), _flow(&flow), _tolerance(tolerance) { }
43.2632 +
43.2633 + bool operator[](const typename DGR::Arc& a) const {
43.2634 + return _tolerance.positive((*_capacity)[a] - (*_flow)[a]);
43.2635 + }
43.2636 + };
43.2637 +
43.2638 + template<typename DGR,typename CM, typename FM, typename TL>
43.2639 + class ResBackwardFilter {
43.2640 + public:
43.2641 +
43.2642 + typedef typename DGR::Arc Key;
43.2643 + typedef bool Value;
43.2644 +
43.2645 + private:
43.2646 +
43.2647 + const CM* _capacity;
43.2648 + const FM* _flow;
43.2649 + TL _tolerance;
43.2650 +
43.2651 + public:
43.2652 +
43.2653 + ResBackwardFilter(const CM& capacity, const FM& flow,
43.2654 + const TL& tolerance = TL())
43.2655 + : _capacity(&capacity), _flow(&flow), _tolerance(tolerance) { }
43.2656 +
43.2657 + bool operator[](const typename DGR::Arc& a) const {
43.2658 + return _tolerance.positive((*_flow)[a]);
43.2659 + }
43.2660 + };
43.2661 +
43.2662 + }
43.2663 +
43.2664 + /// \ingroup graph_adaptors
43.2665 + ///
43.2666 + /// \brief Adaptor class for composing the residual digraph for directed
43.2667 + /// flow and circulation problems.
43.2668 + ///
43.2669 + /// ResidualDigraph can be used for composing the \e residual digraph
43.2670 + /// for directed flow and circulation problems. Let \f$ G=(V, A) \f$
43.2671 + /// be a directed graph and let \f$ F \f$ be a number type.
43.2672 + /// Let \f$ flow, cap: A\to F \f$ be functions on the arcs.
43.2673 + /// This adaptor implements a digraph structure with node set \f$ V \f$
43.2674 + /// and arc set \f$ A_{forward}\cup A_{backward} \f$,
43.2675 + /// where \f$ A_{forward}=\{uv : uv\in A, flow(uv)<cap(uv)\} \f$ and
43.2676 + /// \f$ A_{backward}=\{vu : uv\in A, flow(uv)>0\} \f$, i.e. the so
43.2677 + /// called residual digraph.
43.2678 + /// When the union \f$ A_{forward}\cup A_{backward} \f$ is taken,
43.2679 + /// multiplicities are counted, i.e. the adaptor has exactly
43.2680 + /// \f$ |A_{forward}| + |A_{backward}|\f$ arcs (it may have parallel
43.2681 + /// arcs).
43.2682 + /// This class conforms to the \ref concepts::Digraph "Digraph" concept.
43.2683 + ///
43.2684 + /// \tparam DGR The type of the adapted digraph.
43.2685 + /// It must conform to the \ref concepts::Digraph "Digraph" concept.
43.2686 + /// It is implicitly \c const.
43.2687 + /// \tparam CM The type of the capacity map.
43.2688 + /// It must be an arc map of some numerical type, which defines
43.2689 + /// the capacities in the flow problem. It is implicitly \c const.
43.2690 + /// The default type is
43.2691 + /// \ref concepts::Digraph::ArcMap "GR::ArcMap<int>".
43.2692 + /// \tparam FM The type of the flow map.
43.2693 + /// It must be an arc map of some numerical type, which defines
43.2694 + /// the flow values in the flow problem. The default type is \c CM.
43.2695 + /// \tparam TL The tolerance type for handling inexact computation.
43.2696 + /// The default tolerance type depends on the value type of the
43.2697 + /// capacity map.
43.2698 + ///
43.2699 + /// \note This adaptor is implemented using Undirector and FilterArcs
43.2700 + /// adaptors.
43.2701 + ///
43.2702 + /// \note The \c Node type of this adaptor and the adapted digraph are
43.2703 + /// convertible to each other, moreover the \c Arc type of the adaptor
43.2704 + /// is convertible to the \c Arc type of the adapted digraph.
43.2705 +#ifdef DOXYGEN
43.2706 + template<typename DGR, typename CM, typename FM, typename TL>
43.2707 + class ResidualDigraph
43.2708 +#else
43.2709 + template<typename DGR,
43.2710 + typename CM = typename DGR::template ArcMap<int>,
43.2711 + typename FM = CM,
43.2712 + typename TL = Tolerance<typename CM::Value> >
43.2713 + class ResidualDigraph
43.2714 + : public SubDigraph<
43.2715 + Undirector<const DGR>,
43.2716 + ConstMap<typename DGR::Node, Const<bool, true> >,
43.2717 + typename Undirector<const DGR>::template CombinedArcMap<
43.2718 + _adaptor_bits::ResForwardFilter<const DGR, CM, FM, TL>,
43.2719 + _adaptor_bits::ResBackwardFilter<const DGR, CM, FM, TL> > >
43.2720 +#endif
43.2721 + {
43.2722 + public:
43.2723 +
43.2724 + /// The type of the underlying digraph.
43.2725 + typedef DGR Digraph;
43.2726 + /// The type of the capacity map.
43.2727 + typedef CM CapacityMap;
43.2728 + /// The type of the flow map.
43.2729 + typedef FM FlowMap;
43.2730 + /// The tolerance type.
43.2731 + typedef TL Tolerance;
43.2732 +
43.2733 + typedef typename CapacityMap::Value Value;
43.2734 + typedef ResidualDigraph Adaptor;
43.2735 +
43.2736 + protected:
43.2737 +
43.2738 + typedef Undirector<const Digraph> Undirected;
43.2739 +
43.2740 + typedef ConstMap<typename DGR::Node, Const<bool, true> > NodeFilter;
43.2741 +
43.2742 + typedef _adaptor_bits::ResForwardFilter<const DGR, CM,
43.2743 + FM, TL> ForwardFilter;
43.2744 +
43.2745 + typedef _adaptor_bits::ResBackwardFilter<const DGR, CM,
43.2746 + FM, TL> BackwardFilter;
43.2747 +
43.2748 + typedef typename Undirected::
43.2749 + template CombinedArcMap<ForwardFilter, BackwardFilter> ArcFilter;
43.2750 +
43.2751 + typedef SubDigraph<Undirected, NodeFilter, ArcFilter> Parent;
43.2752 +
43.2753 + const CapacityMap* _capacity;
43.2754 + FlowMap* _flow;
43.2755 +
43.2756 + Undirected _graph;
43.2757 + NodeFilter _node_filter;
43.2758 + ForwardFilter _forward_filter;
43.2759 + BackwardFilter _backward_filter;
43.2760 + ArcFilter _arc_filter;
43.2761 +
43.2762 + public:
43.2763 +
43.2764 + /// \brief Constructor
43.2765 + ///
43.2766 + /// Constructor of the residual digraph adaptor. The parameters are the
43.2767 + /// digraph, the capacity map, the flow map, and a tolerance object.
43.2768 + ResidualDigraph(const DGR& digraph, const CM& capacity,
43.2769 + FM& flow, const TL& tolerance = Tolerance())
43.2770 + : Parent(), _capacity(&capacity), _flow(&flow),
43.2771 + _graph(digraph), _node_filter(),
43.2772 + _forward_filter(capacity, flow, tolerance),
43.2773 + _backward_filter(capacity, flow, tolerance),
43.2774 + _arc_filter(_forward_filter, _backward_filter)
43.2775 + {
43.2776 + Parent::initialize(_graph, _node_filter, _arc_filter);
43.2777 + }
43.2778 +
43.2779 + typedef typename Parent::Arc Arc;
43.2780 +
43.2781 + /// \brief Returns the residual capacity of the given arc.
43.2782 + ///
43.2783 + /// Returns the residual capacity of the given arc.
43.2784 + Value residualCapacity(const Arc& a) const {
43.2785 + if (Undirected::direction(a)) {
43.2786 + return (*_capacity)[a] - (*_flow)[a];
43.2787 + } else {
43.2788 + return (*_flow)[a];
43.2789 + }
43.2790 + }
43.2791 +
43.2792 + /// \brief Augments on the given arc in the residual digraph.
43.2793 + ///
43.2794 + /// Augments on the given arc in the residual digraph. It increases
43.2795 + /// or decreases the flow value on the original arc according to the
43.2796 + /// direction of the residual arc.
43.2797 + void augment(const Arc& a, const Value& v) const {
43.2798 + if (Undirected::direction(a)) {
43.2799 + _flow->set(a, (*_flow)[a] + v);
43.2800 + } else {
43.2801 + _flow->set(a, (*_flow)[a] - v);
43.2802 + }
43.2803 + }
43.2804 +
43.2805 + /// \brief Returns \c true if the given residual arc is a forward arc.
43.2806 + ///
43.2807 + /// Returns \c true if the given residual arc has the same orientation
43.2808 + /// as the original arc, i.e. it is a so called forward arc.
43.2809 + static bool forward(const Arc& a) {
43.2810 + return Undirected::direction(a);
43.2811 + }
43.2812 +
43.2813 + /// \brief Returns \c true if the given residual arc is a backward arc.
43.2814 + ///
43.2815 + /// Returns \c true if the given residual arc has the opposite orientation
43.2816 + /// than the original arc, i.e. it is a so called backward arc.
43.2817 + static bool backward(const Arc& a) {
43.2818 + return !Undirected::direction(a);
43.2819 + }
43.2820 +
43.2821 + /// \brief Returns the forward oriented residual arc.
43.2822 + ///
43.2823 + /// Returns the forward oriented residual arc related to the given
43.2824 + /// arc of the underlying digraph.
43.2825 + static Arc forward(const typename Digraph::Arc& a) {
43.2826 + return Undirected::direct(a, true);
43.2827 + }
43.2828 +
43.2829 + /// \brief Returns the backward oriented residual arc.
43.2830 + ///
43.2831 + /// Returns the backward oriented residual arc related to the given
43.2832 + /// arc of the underlying digraph.
43.2833 + static Arc backward(const typename Digraph::Arc& a) {
43.2834 + return Undirected::direct(a, false);
43.2835 + }
43.2836 +
43.2837 + /// \brief Residual capacity map.
43.2838 + ///
43.2839 + /// This map adaptor class can be used for obtaining the residual
43.2840 + /// capacities as an arc map of the residual digraph.
43.2841 + /// Its value type is inherited from the capacity map.
43.2842 + class ResidualCapacity {
43.2843 + protected:
43.2844 + const Adaptor* _adaptor;
43.2845 + public:
43.2846 + /// The key type of the map
43.2847 + typedef Arc Key;
43.2848 + /// The value type of the map
43.2849 + typedef typename CapacityMap::Value Value;
43.2850 +
43.2851 + /// Constructor
43.2852 + ResidualCapacity(const ResidualDigraph<DGR, CM, FM, TL>& adaptor)
43.2853 + : _adaptor(&adaptor) {}
43.2854 +
43.2855 + /// Returns the value associated with the given residual arc
43.2856 + Value operator[](const Arc& a) const {
43.2857 + return _adaptor->residualCapacity(a);
43.2858 + }
43.2859 +
43.2860 + };
43.2861 +
43.2862 + /// \brief Returns a residual capacity map
43.2863 + ///
43.2864 + /// This function just returns a residual capacity map.
43.2865 + ResidualCapacity residualCapacity() const {
43.2866 + return ResidualCapacity(*this);
43.2867 + }
43.2868 +
43.2869 + };
43.2870 +
43.2871 + /// \brief Returns a (read-only) Residual adaptor
43.2872 + ///
43.2873 + /// This function just returns a (read-only) \ref ResidualDigraph adaptor.
43.2874 + /// \ingroup graph_adaptors
43.2875 + /// \relates ResidualDigraph
43.2876 + template<typename DGR, typename CM, typename FM>
43.2877 + ResidualDigraph<DGR, CM, FM>
43.2878 + residualDigraph(const DGR& digraph, const CM& capacity_map, FM& flow_map) {
43.2879 + return ResidualDigraph<DGR, CM, FM> (digraph, capacity_map, flow_map);
43.2880 + }
43.2881 +
43.2882 +
43.2883 + template <typename DGR>
43.2884 + class SplitNodesBase {
43.2885 + typedef DigraphAdaptorBase<const DGR> Parent;
43.2886 +
43.2887 + public:
43.2888 +
43.2889 + typedef DGR Digraph;
43.2890 + typedef SplitNodesBase Adaptor;
43.2891 +
43.2892 + typedef typename DGR::Node DigraphNode;
43.2893 + typedef typename DGR::Arc DigraphArc;
43.2894 +
43.2895 + class Node;
43.2896 + class Arc;
43.2897 +
43.2898 + private:
43.2899 +
43.2900 + template <typename T> class NodeMapBase;
43.2901 + template <typename T> class ArcMapBase;
43.2902 +
43.2903 + public:
43.2904 +
43.2905 + class Node : public DigraphNode {
43.2906 + friend class SplitNodesBase;
43.2907 + template <typename T> friend class NodeMapBase;
43.2908 + private:
43.2909 +
43.2910 + bool _in;
43.2911 + Node(DigraphNode node, bool in)
43.2912 + : DigraphNode(node), _in(in) {}
43.2913 +
43.2914 + public:
43.2915 +
43.2916 + Node() {}
43.2917 + Node(Invalid) : DigraphNode(INVALID), _in(true) {}
43.2918 +
43.2919 + bool operator==(const Node& node) const {
43.2920 + return DigraphNode::operator==(node) && _in == node._in;
43.2921 + }
43.2922 +
43.2923 + bool operator!=(const Node& node) const {
43.2924 + return !(*this == node);
43.2925 + }
43.2926 +
43.2927 + bool operator<(const Node& node) const {
43.2928 + return DigraphNode::operator<(node) ||
43.2929 + (DigraphNode::operator==(node) && _in < node._in);
43.2930 + }
43.2931 + };
43.2932 +
43.2933 + class Arc {
43.2934 + friend class SplitNodesBase;
43.2935 + template <typename T> friend class ArcMapBase;
43.2936 + private:
43.2937 + typedef BiVariant<DigraphArc, DigraphNode> ArcImpl;
43.2938 +
43.2939 + explicit Arc(const DigraphArc& arc) : _item(arc) {}
43.2940 + explicit Arc(const DigraphNode& node) : _item(node) {}
43.2941 +
43.2942 + ArcImpl _item;
43.2943 +
43.2944 + public:
43.2945 + Arc() {}
43.2946 + Arc(Invalid) : _item(DigraphArc(INVALID)) {}
43.2947 +
43.2948 + bool operator==(const Arc& arc) const {
43.2949 + if (_item.firstState()) {
43.2950 + if (arc._item.firstState()) {
43.2951 + return _item.first() == arc._item.first();
43.2952 + }
43.2953 + } else {
43.2954 + if (arc._item.secondState()) {
43.2955 + return _item.second() == arc._item.second();
43.2956 + }
43.2957 + }
43.2958 + return false;
43.2959 + }
43.2960 +
43.2961 + bool operator!=(const Arc& arc) const {
43.2962 + return !(*this == arc);
43.2963 + }
43.2964 +
43.2965 + bool operator<(const Arc& arc) const {
43.2966 + if (_item.firstState()) {
43.2967 + if (arc._item.firstState()) {
43.2968 + return _item.first() < arc._item.first();
43.2969 + }
43.2970 + return false;
43.2971 + } else {
43.2972 + if (arc._item.secondState()) {
43.2973 + return _item.second() < arc._item.second();
43.2974 + }
43.2975 + return true;
43.2976 + }
43.2977 + }
43.2978 +
43.2979 + operator DigraphArc() const { return _item.first(); }
43.2980 + operator DigraphNode() const { return _item.second(); }
43.2981 +
43.2982 + };
43.2983 +
43.2984 + void first(Node& n) const {
43.2985 + _digraph->first(n);
43.2986 + n._in = true;
43.2987 + }
43.2988 +
43.2989 + void next(Node& n) const {
43.2990 + if (n._in) {
43.2991 + n._in = false;
43.2992 + } else {
43.2993 + n._in = true;
43.2994 + _digraph->next(n);
43.2995 + }
43.2996 + }
43.2997 +
43.2998 + void first(Arc& e) const {
43.2999 + e._item.setSecond();
43.3000 + _digraph->first(e._item.second());
43.3001 + if (e._item.second() == INVALID) {
43.3002 + e._item.setFirst();
43.3003 + _digraph->first(e._item.first());
43.3004 + }
43.3005 + }
43.3006 +
43.3007 + void next(Arc& e) const {
43.3008 + if (e._item.secondState()) {
43.3009 + _digraph->next(e._item.second());
43.3010 + if (e._item.second() == INVALID) {
43.3011 + e._item.setFirst();
43.3012 + _digraph->first(e._item.first());
43.3013 + }
43.3014 + } else {
43.3015 + _digraph->next(e._item.first());
43.3016 + }
43.3017 + }
43.3018 +
43.3019 + void firstOut(Arc& e, const Node& n) const {
43.3020 + if (n._in) {
43.3021 + e._item.setSecond(n);
43.3022 + } else {
43.3023 + e._item.setFirst();
43.3024 + _digraph->firstOut(e._item.first(), n);
43.3025 + }
43.3026 + }
43.3027 +
43.3028 + void nextOut(Arc& e) const {
43.3029 + if (!e._item.firstState()) {
43.3030 + e._item.setFirst(INVALID);
43.3031 + } else {
43.3032 + _digraph->nextOut(e._item.first());
43.3033 + }
43.3034 + }
43.3035 +
43.3036 + void firstIn(Arc& e, const Node& n) const {
43.3037 + if (!n._in) {
43.3038 + e._item.setSecond(n);
43.3039 + } else {
43.3040 + e._item.setFirst();
43.3041 + _digraph->firstIn(e._item.first(), n);
43.3042 + }
43.3043 + }
43.3044 +
43.3045 + void nextIn(Arc& e) const {
43.3046 + if (!e._item.firstState()) {
43.3047 + e._item.setFirst(INVALID);
43.3048 + } else {
43.3049 + _digraph->nextIn(e._item.first());
43.3050 + }
43.3051 + }
43.3052 +
43.3053 + Node source(const Arc& e) const {
43.3054 + if (e._item.firstState()) {
43.3055 + return Node(_digraph->source(e._item.first()), false);
43.3056 + } else {
43.3057 + return Node(e._item.second(), true);
43.3058 + }
43.3059 + }
43.3060 +
43.3061 + Node target(const Arc& e) const {
43.3062 + if (e._item.firstState()) {
43.3063 + return Node(_digraph->target(e._item.first()), true);
43.3064 + } else {
43.3065 + return Node(e._item.second(), false);
43.3066 + }
43.3067 + }
43.3068 +
43.3069 + int id(const Node& n) const {
43.3070 + return (_digraph->id(n) << 1) | (n._in ? 0 : 1);
43.3071 + }
43.3072 + Node nodeFromId(int ix) const {
43.3073 + return Node(_digraph->nodeFromId(ix >> 1), (ix & 1) == 0);
43.3074 + }
43.3075 + int maxNodeId() const {
43.3076 + return 2 * _digraph->maxNodeId() + 1;
43.3077 + }
43.3078 +
43.3079 + int id(const Arc& e) const {
43.3080 + if (e._item.firstState()) {
43.3081 + return _digraph->id(e._item.first()) << 1;
43.3082 + } else {
43.3083 + return (_digraph->id(e._item.second()) << 1) | 1;
43.3084 + }
43.3085 + }
43.3086 + Arc arcFromId(int ix) const {
43.3087 + if ((ix & 1) == 0) {
43.3088 + return Arc(_digraph->arcFromId(ix >> 1));
43.3089 + } else {
43.3090 + return Arc(_digraph->nodeFromId(ix >> 1));
43.3091 + }
43.3092 + }
43.3093 + int maxArcId() const {
43.3094 + return std::max(_digraph->maxNodeId() << 1,
43.3095 + (_digraph->maxArcId() << 1) | 1);
43.3096 + }
43.3097 +
43.3098 + static bool inNode(const Node& n) {
43.3099 + return n._in;
43.3100 + }
43.3101 +
43.3102 + static bool outNode(const Node& n) {
43.3103 + return !n._in;
43.3104 + }
43.3105 +
43.3106 + static bool origArc(const Arc& e) {
43.3107 + return e._item.firstState();
43.3108 + }
43.3109 +
43.3110 + static bool bindArc(const Arc& e) {
43.3111 + return e._item.secondState();
43.3112 + }
43.3113 +
43.3114 + static Node inNode(const DigraphNode& n) {
43.3115 + return Node(n, true);
43.3116 + }
43.3117 +
43.3118 + static Node outNode(const DigraphNode& n) {
43.3119 + return Node(n, false);
43.3120 + }
43.3121 +
43.3122 + static Arc arc(const DigraphNode& n) {
43.3123 + return Arc(n);
43.3124 + }
43.3125 +
43.3126 + static Arc arc(const DigraphArc& e) {
43.3127 + return Arc(e);
43.3128 + }
43.3129 +
43.3130 + typedef True NodeNumTag;
43.3131 + int nodeNum() const {
43.3132 + return 2 * countNodes(*_digraph);
43.3133 + }
43.3134 +
43.3135 + typedef True ArcNumTag;
43.3136 + int arcNum() const {
43.3137 + return countArcs(*_digraph) + countNodes(*_digraph);
43.3138 + }
43.3139 +
43.3140 + typedef True FindArcTag;
43.3141 + Arc findArc(const Node& u, const Node& v,
43.3142 + const Arc& prev = INVALID) const {
43.3143 + if (inNode(u) && outNode(v)) {
43.3144 + if (static_cast<const DigraphNode&>(u) ==
43.3145 + static_cast<const DigraphNode&>(v) && prev == INVALID) {
43.3146 + return Arc(u);
43.3147 + }
43.3148 + }
43.3149 + else if (outNode(u) && inNode(v)) {
43.3150 + return Arc(::lemon::findArc(*_digraph, u, v, prev));
43.3151 + }
43.3152 + return INVALID;
43.3153 + }
43.3154 +
43.3155 + private:
43.3156 +
43.3157 + template <typename V>
43.3158 + class NodeMapBase
43.3159 + : public MapTraits<typename Parent::template NodeMap<V> > {
43.3160 + typedef typename Parent::template NodeMap<V> NodeImpl;
43.3161 + public:
43.3162 + typedef Node Key;
43.3163 + typedef V Value;
43.3164 + typedef typename MapTraits<NodeImpl>::ReferenceMapTag ReferenceMapTag;
43.3165 + typedef typename MapTraits<NodeImpl>::ReturnValue ReturnValue;
43.3166 + typedef typename MapTraits<NodeImpl>::ConstReturnValue ConstReturnValue;
43.3167 + typedef typename MapTraits<NodeImpl>::ReturnValue Reference;
43.3168 + typedef typename MapTraits<NodeImpl>::ConstReturnValue ConstReference;
43.3169 +
43.3170 + NodeMapBase(const SplitNodesBase<DGR>& adaptor)
43.3171 + : _in_map(*adaptor._digraph), _out_map(*adaptor._digraph) {}
43.3172 + NodeMapBase(const SplitNodesBase<DGR>& adaptor, const V& value)
43.3173 + : _in_map(*adaptor._digraph, value),
43.3174 + _out_map(*adaptor._digraph, value) {}
43.3175 +
43.3176 + void set(const Node& key, const V& val) {
43.3177 + if (SplitNodesBase<DGR>::inNode(key)) { _in_map.set(key, val); }
43.3178 + else {_out_map.set(key, val); }
43.3179 + }
43.3180 +
43.3181 + ReturnValue operator[](const Node& key) {
43.3182 + if (SplitNodesBase<DGR>::inNode(key)) { return _in_map[key]; }
43.3183 + else { return _out_map[key]; }
43.3184 + }
43.3185 +
43.3186 + ConstReturnValue operator[](const Node& key) const {
43.3187 + if (Adaptor::inNode(key)) { return _in_map[key]; }
43.3188 + else { return _out_map[key]; }
43.3189 + }
43.3190 +
43.3191 + private:
43.3192 + NodeImpl _in_map, _out_map;
43.3193 + };
43.3194 +
43.3195 + template <typename V>
43.3196 + class ArcMapBase
43.3197 + : public MapTraits<typename Parent::template ArcMap<V> > {
43.3198 + typedef typename Parent::template ArcMap<V> ArcImpl;
43.3199 + typedef typename Parent::template NodeMap<V> NodeImpl;
43.3200 + public:
43.3201 + typedef Arc Key;
43.3202 + typedef V Value;
43.3203 + typedef typename MapTraits<ArcImpl>::ReferenceMapTag ReferenceMapTag;
43.3204 + typedef typename MapTraits<ArcImpl>::ReturnValue ReturnValue;
43.3205 + typedef typename MapTraits<ArcImpl>::ConstReturnValue ConstReturnValue;
43.3206 + typedef typename MapTraits<ArcImpl>::ReturnValue Reference;
43.3207 + typedef typename MapTraits<ArcImpl>::ConstReturnValue ConstReference;
43.3208 +
43.3209 + ArcMapBase(const SplitNodesBase<DGR>& adaptor)
43.3210 + : _arc_map(*adaptor._digraph), _node_map(*adaptor._digraph) {}
43.3211 + ArcMapBase(const SplitNodesBase<DGR>& adaptor, const V& value)
43.3212 + : _arc_map(*adaptor._digraph, value),
43.3213 + _node_map(*adaptor._digraph, value) {}
43.3214 +
43.3215 + void set(const Arc& key, const V& val) {
43.3216 + if (SplitNodesBase<DGR>::origArc(key)) {
43.3217 + _arc_map.set(static_cast<const DigraphArc&>(key), val);
43.3218 + } else {
43.3219 + _node_map.set(static_cast<const DigraphNode&>(key), val);
43.3220 + }
43.3221 + }
43.3222 +
43.3223 + ReturnValue operator[](const Arc& key) {
43.3224 + if (SplitNodesBase<DGR>::origArc(key)) {
43.3225 + return _arc_map[static_cast<const DigraphArc&>(key)];
43.3226 + } else {
43.3227 + return _node_map[static_cast<const DigraphNode&>(key)];
43.3228 + }
43.3229 + }
43.3230 +
43.3231 + ConstReturnValue operator[](const Arc& key) const {
43.3232 + if (SplitNodesBase<DGR>::origArc(key)) {
43.3233 + return _arc_map[static_cast<const DigraphArc&>(key)];
43.3234 + } else {
43.3235 + return _node_map[static_cast<const DigraphNode&>(key)];
43.3236 + }
43.3237 + }
43.3238 +
43.3239 + private:
43.3240 + ArcImpl _arc_map;
43.3241 + NodeImpl _node_map;
43.3242 + };
43.3243 +
43.3244 + public:
43.3245 +
43.3246 + template <typename V>
43.3247 + class NodeMap
43.3248 + : public SubMapExtender<SplitNodesBase<DGR>, NodeMapBase<V> > {
43.3249 + typedef SubMapExtender<SplitNodesBase<DGR>, NodeMapBase<V> > Parent;
43.3250 +
43.3251 + public:
43.3252 + typedef V Value;
43.3253 +
43.3254 + NodeMap(const SplitNodesBase<DGR>& adaptor)
43.3255 + : Parent(adaptor) {}
43.3256 +
43.3257 + NodeMap(const SplitNodesBase<DGR>& adaptor, const V& value)
43.3258 + : Parent(adaptor, value) {}
43.3259 +
43.3260 + private:
43.3261 + NodeMap& operator=(const NodeMap& cmap) {
43.3262 + return operator=<NodeMap>(cmap);
43.3263 + }
43.3264 +
43.3265 + template <typename CMap>
43.3266 + NodeMap& operator=(const CMap& cmap) {
43.3267 + Parent::operator=(cmap);
43.3268 + return *this;
43.3269 + }
43.3270 + };
43.3271 +
43.3272 + template <typename V>
43.3273 + class ArcMap
43.3274 + : public SubMapExtender<SplitNodesBase<DGR>, ArcMapBase<V> > {
43.3275 + typedef SubMapExtender<SplitNodesBase<DGR>, ArcMapBase<V> > Parent;
43.3276 +
43.3277 + public:
43.3278 + typedef V Value;
43.3279 +
43.3280 + ArcMap(const SplitNodesBase<DGR>& adaptor)
43.3281 + : Parent(adaptor) {}
43.3282 +
43.3283 + ArcMap(const SplitNodesBase<DGR>& adaptor, const V& value)
43.3284 + : Parent(adaptor, value) {}
43.3285 +
43.3286 + private:
43.3287 + ArcMap& operator=(const ArcMap& cmap) {
43.3288 + return operator=<ArcMap>(cmap);
43.3289 + }
43.3290 +
43.3291 + template <typename CMap>
43.3292 + ArcMap& operator=(const CMap& cmap) {
43.3293 + Parent::operator=(cmap);
43.3294 + return *this;
43.3295 + }
43.3296 + };
43.3297 +
43.3298 + protected:
43.3299 +
43.3300 + SplitNodesBase() : _digraph(0) {}
43.3301 +
43.3302 + DGR* _digraph;
43.3303 +
43.3304 + void initialize(Digraph& digraph) {
43.3305 + _digraph = &digraph;
43.3306 + }
43.3307 +
43.3308 + };
43.3309 +
43.3310 + /// \ingroup graph_adaptors
43.3311 + ///
43.3312 + /// \brief Adaptor class for splitting the nodes of a digraph.
43.3313 + ///
43.3314 + /// SplitNodes adaptor can be used for splitting each node into an
43.3315 + /// \e in-node and an \e out-node in a digraph. Formaly, the adaptor
43.3316 + /// replaces each node \f$ u \f$ in the digraph with two nodes,
43.3317 + /// namely node \f$ u_{in} \f$ and node \f$ u_{out} \f$.
43.3318 + /// If there is a \f$ (v, u) \f$ arc in the original digraph, then the
43.3319 + /// new target of the arc will be \f$ u_{in} \f$ and similarly the
43.3320 + /// source of each original \f$ (u, v) \f$ arc will be \f$ u_{out} \f$.
43.3321 + /// The adaptor adds an additional \e bind \e arc from \f$ u_{in} \f$
43.3322 + /// to \f$ u_{out} \f$ for each node \f$ u \f$ of the original digraph.
43.3323 + ///
43.3324 + /// The aim of this class is running an algorithm with respect to node
43.3325 + /// costs or capacities if the algorithm considers only arc costs or
43.3326 + /// capacities directly.
43.3327 + /// In this case you can use \c SplitNodes adaptor, and set the node
43.3328 + /// costs/capacities of the original digraph to the \e bind \e arcs
43.3329 + /// in the adaptor.
43.3330 + ///
43.3331 + /// \tparam DGR The type of the adapted digraph.
43.3332 + /// It must conform to the \ref concepts::Digraph "Digraph" concept.
43.3333 + /// It is implicitly \c const.
43.3334 + ///
43.3335 + /// \note The \c Node type of this adaptor is converible to the \c Node
43.3336 + /// type of the adapted digraph.
43.3337 + template <typename DGR>
43.3338 +#ifdef DOXYGEN
43.3339 + class SplitNodes {
43.3340 +#else
43.3341 + class SplitNodes
43.3342 + : public DigraphAdaptorExtender<SplitNodesBase<const DGR> > {
43.3343 +#endif
43.3344 + typedef DigraphAdaptorExtender<SplitNodesBase<const DGR> > Parent;
43.3345 +
43.3346 + public:
43.3347 + typedef DGR Digraph;
43.3348 +
43.3349 + typedef typename DGR::Node DigraphNode;
43.3350 + typedef typename DGR::Arc DigraphArc;
43.3351 +
43.3352 + typedef typename Parent::Node Node;
43.3353 + typedef typename Parent::Arc Arc;
43.3354 +
43.3355 + /// \brief Constructor
43.3356 + ///
43.3357 + /// Constructor of the adaptor.
43.3358 + SplitNodes(const DGR& g) {
43.3359 + Parent::initialize(g);
43.3360 + }
43.3361 +
43.3362 + /// \brief Returns \c true if the given node is an in-node.
43.3363 + ///
43.3364 + /// Returns \c true if the given node is an in-node.
43.3365 + static bool inNode(const Node& n) {
43.3366 + return Parent::inNode(n);
43.3367 + }
43.3368 +
43.3369 + /// \brief Returns \c true if the given node is an out-node.
43.3370 + ///
43.3371 + /// Returns \c true if the given node is an out-node.
43.3372 + static bool outNode(const Node& n) {
43.3373 + return Parent::outNode(n);
43.3374 + }
43.3375 +
43.3376 + /// \brief Returns \c true if the given arc is an original arc.
43.3377 + ///
43.3378 + /// Returns \c true if the given arc is one of the arcs in the
43.3379 + /// original digraph.
43.3380 + static bool origArc(const Arc& a) {
43.3381 + return Parent::origArc(a);
43.3382 + }
43.3383 +
43.3384 + /// \brief Returns \c true if the given arc is a bind arc.
43.3385 + ///
43.3386 + /// Returns \c true if the given arc is a bind arc, i.e. it connects
43.3387 + /// an in-node and an out-node.
43.3388 + static bool bindArc(const Arc& a) {
43.3389 + return Parent::bindArc(a);
43.3390 + }
43.3391 +
43.3392 + /// \brief Returns the in-node created from the given original node.
43.3393 + ///
43.3394 + /// Returns the in-node created from the given original node.
43.3395 + static Node inNode(const DigraphNode& n) {
43.3396 + return Parent::inNode(n);
43.3397 + }
43.3398 +
43.3399 + /// \brief Returns the out-node created from the given original node.
43.3400 + ///
43.3401 + /// Returns the out-node created from the given original node.
43.3402 + static Node outNode(const DigraphNode& n) {
43.3403 + return Parent::outNode(n);
43.3404 + }
43.3405 +
43.3406 + /// \brief Returns the bind arc that corresponds to the given
43.3407 + /// original node.
43.3408 + ///
43.3409 + /// Returns the bind arc in the adaptor that corresponds to the given
43.3410 + /// original node, i.e. the arc connecting the in-node and out-node
43.3411 + /// of \c n.
43.3412 + static Arc arc(const DigraphNode& n) {
43.3413 + return Parent::arc(n);
43.3414 + }
43.3415 +
43.3416 + /// \brief Returns the arc that corresponds to the given original arc.
43.3417 + ///
43.3418 + /// Returns the arc in the adaptor that corresponds to the given
43.3419 + /// original arc.
43.3420 + static Arc arc(const DigraphArc& a) {
43.3421 + return Parent::arc(a);
43.3422 + }
43.3423 +
43.3424 + /// \brief Node map combined from two original node maps
43.3425 + ///
43.3426 + /// This map adaptor class adapts two node maps of the original digraph
43.3427 + /// to get a node map of the split digraph.
43.3428 + /// Its value type is inherited from the first node map type (\c IN).
43.3429 + /// \tparam IN The type of the node map for the in-nodes.
43.3430 + /// \tparam OUT The type of the node map for the out-nodes.
43.3431 + template <typename IN, typename OUT>
43.3432 + class CombinedNodeMap {
43.3433 + public:
43.3434 +
43.3435 + /// The key type of the map
43.3436 + typedef Node Key;
43.3437 + /// The value type of the map
43.3438 + typedef typename IN::Value Value;
43.3439 +
43.3440 + typedef typename MapTraits<IN>::ReferenceMapTag ReferenceMapTag;
43.3441 + typedef typename MapTraits<IN>::ReturnValue ReturnValue;
43.3442 + typedef typename MapTraits<IN>::ConstReturnValue ConstReturnValue;
43.3443 + typedef typename MapTraits<IN>::ReturnValue Reference;
43.3444 + typedef typename MapTraits<IN>::ConstReturnValue ConstReference;
43.3445 +
43.3446 + /// Constructor
43.3447 + CombinedNodeMap(IN& in_map, OUT& out_map)
43.3448 + : _in_map(in_map), _out_map(out_map) {}
43.3449 +
43.3450 + /// Returns the value associated with the given key.
43.3451 + Value operator[](const Key& key) const {
43.3452 + if (SplitNodesBase<const DGR>::inNode(key)) {
43.3453 + return _in_map[key];
43.3454 + } else {
43.3455 + return _out_map[key];
43.3456 + }
43.3457 + }
43.3458 +
43.3459 + /// Returns a reference to the value associated with the given key.
43.3460 + Value& operator[](const Key& key) {
43.3461 + if (SplitNodesBase<const DGR>::inNode(key)) {
43.3462 + return _in_map[key];
43.3463 + } else {
43.3464 + return _out_map[key];
43.3465 + }
43.3466 + }
43.3467 +
43.3468 + /// Sets the value associated with the given key.
43.3469 + void set(const Key& key, const Value& value) {
43.3470 + if (SplitNodesBase<const DGR>::inNode(key)) {
43.3471 + _in_map.set(key, value);
43.3472 + } else {
43.3473 + _out_map.set(key, value);
43.3474 + }
43.3475 + }
43.3476 +
43.3477 + private:
43.3478 +
43.3479 + IN& _in_map;
43.3480 + OUT& _out_map;
43.3481 +
43.3482 + };
43.3483 +
43.3484 +
43.3485 + /// \brief Returns a combined node map
43.3486 + ///
43.3487 + /// This function just returns a combined node map.
43.3488 + template <typename IN, typename OUT>
43.3489 + static CombinedNodeMap<IN, OUT>
43.3490 + combinedNodeMap(IN& in_map, OUT& out_map) {
43.3491 + return CombinedNodeMap<IN, OUT>(in_map, out_map);
43.3492 + }
43.3493 +
43.3494 + template <typename IN, typename OUT>
43.3495 + static CombinedNodeMap<const IN, OUT>
43.3496 + combinedNodeMap(const IN& in_map, OUT& out_map) {
43.3497 + return CombinedNodeMap<const IN, OUT>(in_map, out_map);
43.3498 + }
43.3499 +
43.3500 + template <typename IN, typename OUT>
43.3501 + static CombinedNodeMap<IN, const OUT>
43.3502 + combinedNodeMap(IN& in_map, const OUT& out_map) {
43.3503 + return CombinedNodeMap<IN, const OUT>(in_map, out_map);
43.3504 + }
43.3505 +
43.3506 + template <typename IN, typename OUT>
43.3507 + static CombinedNodeMap<const IN, const OUT>
43.3508 + combinedNodeMap(const IN& in_map, const OUT& out_map) {
43.3509 + return CombinedNodeMap<const IN, const OUT>(in_map, out_map);
43.3510 + }
43.3511 +
43.3512 + /// \brief Arc map combined from an arc map and a node map of the
43.3513 + /// original digraph.
43.3514 + ///
43.3515 + /// This map adaptor class adapts an arc map and a node map of the
43.3516 + /// original digraph to get an arc map of the split digraph.
43.3517 + /// Its value type is inherited from the original arc map type (\c AM).
43.3518 + /// \tparam AM The type of the arc map.
43.3519 + /// \tparam NM the type of the node map.
43.3520 + template <typename AM, typename NM>
43.3521 + class CombinedArcMap {
43.3522 + public:
43.3523 +
43.3524 + /// The key type of the map
43.3525 + typedef Arc Key;
43.3526 + /// The value type of the map
43.3527 + typedef typename AM::Value Value;
43.3528 +
43.3529 + typedef typename MapTraits<AM>::ReferenceMapTag ReferenceMapTag;
43.3530 + typedef typename MapTraits<AM>::ReturnValue ReturnValue;
43.3531 + typedef typename MapTraits<AM>::ConstReturnValue ConstReturnValue;
43.3532 + typedef typename MapTraits<AM>::ReturnValue Reference;
43.3533 + typedef typename MapTraits<AM>::ConstReturnValue ConstReference;
43.3534 +
43.3535 + /// Constructor
43.3536 + CombinedArcMap(AM& arc_map, NM& node_map)
43.3537 + : _arc_map(arc_map), _node_map(node_map) {}
43.3538 +
43.3539 + /// Returns the value associated with the given key.
43.3540 + Value operator[](const Key& arc) const {
43.3541 + if (SplitNodesBase<const DGR>::origArc(arc)) {
43.3542 + return _arc_map[arc];
43.3543 + } else {
43.3544 + return _node_map[arc];
43.3545 + }
43.3546 + }
43.3547 +
43.3548 + /// Returns a reference to the value associated with the given key.
43.3549 + Value& operator[](const Key& arc) {
43.3550 + if (SplitNodesBase<const DGR>::origArc(arc)) {
43.3551 + return _arc_map[arc];
43.3552 + } else {
43.3553 + return _node_map[arc];
43.3554 + }
43.3555 + }
43.3556 +
43.3557 + /// Sets the value associated with the given key.
43.3558 + void set(const Arc& arc, const Value& val) {
43.3559 + if (SplitNodesBase<const DGR>::origArc(arc)) {
43.3560 + _arc_map.set(arc, val);
43.3561 + } else {
43.3562 + _node_map.set(arc, val);
43.3563 + }
43.3564 + }
43.3565 +
43.3566 + private:
43.3567 +
43.3568 + AM& _arc_map;
43.3569 + NM& _node_map;
43.3570 +
43.3571 + };
43.3572 +
43.3573 + /// \brief Returns a combined arc map
43.3574 + ///
43.3575 + /// This function just returns a combined arc map.
43.3576 + template <typename ArcMap, typename NodeMap>
43.3577 + static CombinedArcMap<ArcMap, NodeMap>
43.3578 + combinedArcMap(ArcMap& arc_map, NodeMap& node_map) {
43.3579 + return CombinedArcMap<ArcMap, NodeMap>(arc_map, node_map);
43.3580 + }
43.3581 +
43.3582 + template <typename ArcMap, typename NodeMap>
43.3583 + static CombinedArcMap<const ArcMap, NodeMap>
43.3584 + combinedArcMap(const ArcMap& arc_map, NodeMap& node_map) {
43.3585 + return CombinedArcMap<const ArcMap, NodeMap>(arc_map, node_map);
43.3586 + }
43.3587 +
43.3588 + template <typename ArcMap, typename NodeMap>
43.3589 + static CombinedArcMap<ArcMap, const NodeMap>
43.3590 + combinedArcMap(ArcMap& arc_map, const NodeMap& node_map) {
43.3591 + return CombinedArcMap<ArcMap, const NodeMap>(arc_map, node_map);
43.3592 + }
43.3593 +
43.3594 + template <typename ArcMap, typename NodeMap>
43.3595 + static CombinedArcMap<const ArcMap, const NodeMap>
43.3596 + combinedArcMap(const ArcMap& arc_map, const NodeMap& node_map) {
43.3597 + return CombinedArcMap<const ArcMap, const NodeMap>(arc_map, node_map);
43.3598 + }
43.3599 +
43.3600 + };
43.3601 +
43.3602 + /// \brief Returns a (read-only) SplitNodes adaptor
43.3603 + ///
43.3604 + /// This function just returns a (read-only) \ref SplitNodes adaptor.
43.3605 + /// \ingroup graph_adaptors
43.3606 + /// \relates SplitNodes
43.3607 + template<typename DGR>
43.3608 + SplitNodes<DGR>
43.3609 + splitNodes(const DGR& digraph) {
43.3610 + return SplitNodes<DGR>(digraph);
43.3611 + }
43.3612 +
43.3613 +#undef LEMON_SCOPE_FIX
43.3614 +
43.3615 +} //namespace lemon
43.3616 +
43.3617 +#endif //LEMON_ADAPTORS_H
44.1 --- a/lemon/arg_parser.cc Fri Oct 16 10:21:37 2009 +0200
44.2 +++ b/lemon/arg_parser.cc Thu Nov 05 15:50:01 2009 +0100
44.3 @@ -2,7 +2,7 @@
44.4 *
44.5 * This file is a part of LEMON, a generic C++ optimization library.
44.6 *
44.7 - * Copyright (C) 2003-2008
44.8 + * Copyright (C) 2003-2009
44.9 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
44.10 * (Egervary Research Group on Combinatorial Optimization, EGRES).
44.11 *
45.1 --- a/lemon/arg_parser.h Fri Oct 16 10:21:37 2009 +0200
45.2 +++ b/lemon/arg_parser.h Thu Nov 05 15:50:01 2009 +0100
45.3 @@ -2,7 +2,7 @@
45.4 *
45.5 * This file is a part of LEMON, a generic C++ optimization library.
45.6 *
45.7 - * Copyright (C) 2003-2008
45.8 + * Copyright (C) 2003-2009
45.9 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
45.10 * (Egervary Research Group on Combinatorial Optimization, EGRES).
45.11 *
46.1 --- a/lemon/assert.h Fri Oct 16 10:21:37 2009 +0200
46.2 +++ b/lemon/assert.h Thu Nov 05 15:50:01 2009 +0100
46.3 @@ -2,7 +2,7 @@
46.4 *
46.5 * This file is a part of LEMON, a generic C++ optimization library.
46.6 *
46.7 - * Copyright (C) 2003-2008
46.8 + * Copyright (C) 2003-2009
46.9 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
46.10 * (Egervary Research Group on Combinatorial Optimization, EGRES).
46.11 *
47.1 --- a/lemon/base.cc Fri Oct 16 10:21:37 2009 +0200
47.2 +++ b/lemon/base.cc Thu Nov 05 15:50:01 2009 +0100
47.3 @@ -2,7 +2,7 @@
47.4 *
47.5 * This file is a part of LEMON, a generic C++ optimization library.
47.6 *
47.7 - * Copyright (C) 2003-2008
47.8 + * Copyright (C) 2003-2009
47.9 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
47.10 * (Egervary Research Group on Combinatorial Optimization, EGRES).
47.11 *
47.12 @@ -23,7 +23,7 @@
47.13 #include<lemon/core.h>
47.14 namespace lemon {
47.15
47.16 - float Tolerance<float>::def_epsilon = 1e-4;
47.17 + float Tolerance<float>::def_epsilon = static_cast<float>(1e-4);
47.18 double Tolerance<double>::def_epsilon = 1e-10;
47.19 long double Tolerance<long double>::def_epsilon = 1e-14;
47.20
48.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
48.2 +++ b