1
109
87
3614
9
3
60
19
25
10
1
1
13
2
87
3
3
24
26
13
12
43
33
41
7
1
1
373
158
1
1
19
23
Changeset was too big and was cut off... Show full diff
| 1 |
SET(COIN_ROOT_DIR "" CACHE PATH "COIN root directory") |
|
| 2 |
|
|
| 3 |
FIND_PATH(COIN_INCLUDE_DIR coin/CoinUtilsConfig.h |
|
| 4 |
HINTS ${COIN_ROOT_DIR}/include
|
|
| 5 |
) |
|
| 6 |
FIND_LIBRARY(COIN_CBC_LIBRARY |
|
| 7 |
NAMES Cbc libCbc |
|
| 8 |
HINTS ${COIN_ROOT_DIR}/lib
|
|
| 9 |
) |
|
| 10 |
FIND_LIBRARY(COIN_CBC_SOLVER_LIBRARY |
|
| 11 |
NAMES CbcSolver libCbcSolver |
|
| 12 |
HINTS ${COIN_ROOT_DIR}/lib
|
|
| 13 |
) |
|
| 14 |
FIND_LIBRARY(COIN_CGL_LIBRARY |
|
| 15 |
NAMES Cgl libCgl |
|
| 16 |
HINTS ${COIN_ROOT_DIR}/lib
|
|
| 17 |
) |
|
| 18 |
FIND_LIBRARY(COIN_CLP_LIBRARY |
|
| 19 |
NAMES Clp libClp |
|
| 20 |
HINTS ${COIN_ROOT_DIR}/lib
|
|
| 21 |
) |
|
| 22 |
FIND_LIBRARY(COIN_COIN_UTILS_LIBRARY |
|
| 23 |
NAMES CoinUtils libCoinUtils |
|
| 24 |
HINTS ${COIN_ROOT_DIR}/lib
|
|
| 25 |
) |
|
| 26 |
FIND_LIBRARY(COIN_OSI_LIBRARY |
|
| 27 |
NAMES Osi libOsi |
|
| 28 |
HINTS ${COIN_ROOT_DIR}/lib
|
|
| 29 |
) |
|
| 30 |
FIND_LIBRARY(COIN_OSI_CBC_LIBRARY |
|
| 31 |
NAMES OsiCbc libOsiCbc |
|
| 32 |
HINTS ${COIN_ROOT_DIR}/lib
|
|
| 33 |
) |
|
| 34 |
FIND_LIBRARY(COIN_OSI_CLP_LIBRARY |
|
| 35 |
NAMES OsiClp libOsiClp |
|
| 36 |
HINTS ${COIN_ROOT_DIR}/lib
|
|
| 37 |
) |
|
| 38 |
FIND_LIBRARY(COIN_OSI_VOL_LIBRARY |
|
| 39 |
NAMES OsiVol libOsiVol |
|
| 40 |
HINTS ${COIN_ROOT_DIR}/lib
|
|
| 41 |
) |
|
| 42 |
FIND_LIBRARY(COIN_VOL_LIBRARY |
|
| 43 |
NAMES Vol libVol |
|
| 44 |
HINTS ${COIN_ROOT_DIR}/lib
|
|
| 45 |
) |
|
| 46 |
|
|
| 47 |
INCLUDE(FindPackageHandleStandardArgs) |
|
| 48 |
FIND_PACKAGE_HANDLE_STANDARD_ARGS(COIN DEFAULT_MSG |
|
| 49 |
COIN_INCLUDE_DIR |
|
| 50 |
COIN_CBC_LIBRARY |
|
| 51 |
COIN_CBC_SOLVER_LIBRARY |
|
| 52 |
COIN_CGL_LIBRARY |
|
| 53 |
COIN_CLP_LIBRARY |
|
| 54 |
COIN_COIN_UTILS_LIBRARY |
|
| 55 |
COIN_OSI_LIBRARY |
|
| 56 |
COIN_OSI_CBC_LIBRARY |
|
| 57 |
COIN_OSI_CLP_LIBRARY |
|
| 58 |
COIN_OSI_VOL_LIBRARY |
|
| 59 |
COIN_VOL_LIBRARY |
|
| 60 |
) |
|
| 61 |
|
|
| 62 |
IF(COIN_FOUND) |
|
| 63 |
SET(COIN_INCLUDE_DIRS ${COIN_INCLUDE_DIR})
|
|
| 64 |
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}")
|
|
| 65 |
SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY}")
|
|
| 66 |
SET(COIN_CBC_LIBRARIES ${COIN_LIBRARIES})
|
|
| 67 |
ENDIF(COIN_FOUND) |
|
| 68 |
|
|
| 69 |
MARK_AS_ADVANCED( |
|
| 70 |
COIN_INCLUDE_DIR |
|
| 71 |
COIN_CBC_LIBRARY |
|
| 72 |
COIN_CBC_SOLVER_LIBRARY |
|
| 73 |
COIN_CGL_LIBRARY |
|
| 74 |
COIN_CLP_LIBRARY |
|
| 75 |
COIN_COIN_UTILS_LIBRARY |
|
| 76 |
COIN_OSI_LIBRARY |
|
| 77 |
COIN_OSI_CBC_LIBRARY |
|
| 78 |
COIN_OSI_CLP_LIBRARY |
|
| 79 |
COIN_OSI_VOL_LIBRARY |
|
| 80 |
COIN_VOL_LIBRARY |
|
| 81 |
) |
|
| 82 |
|
|
| 83 |
IF(COIN_FOUND) |
|
| 84 |
SET(LEMON_HAVE_LP TRUE) |
|
| 85 |
SET(LEMON_HAVE_MIP TRUE) |
|
| 86 |
SET(LEMON_HAVE_CLP TRUE) |
|
| 87 |
SET(LEMON_HAVE_CBC TRUE) |
|
| 88 |
ENDIF(COIN_FOUND) |
| 1 |
SET(CPLEX_ROOT_DIR "" CACHE PATH "CPLEX root directory") |
|
| 2 |
|
|
| 3 |
FIND_PATH(CPLEX_INCLUDE_DIR |
|
| 4 |
ilcplex/cplex.h |
|
| 5 |
PATHS "C:/ILOG/CPLEX91/include" |
|
| 6 |
PATHS "/opt/ilog/cplex91/include" |
|
| 7 |
HINTS ${CPLEX_ROOT_DIR}/include
|
|
| 8 |
) |
|
| 9 |
FIND_LIBRARY(CPLEX_LIBRARY |
|
| 10 |
cplex91 |
|
| 11 |
PATHS "C:/ILOG/CPLEX91/lib/msvc7/stat_mda" |
|
| 12 |
PATHS "/opt/ilog/cplex91/bin" |
|
| 13 |
HINTS ${CPLEX_ROOT_DIR}/bin
|
|
| 14 |
) |
|
| 15 |
|
|
| 16 |
INCLUDE(FindPackageHandleStandardArgs) |
|
| 17 |
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPLEX DEFAULT_MSG CPLEX_LIBRARY CPLEX_INCLUDE_DIR) |
|
| 18 |
|
|
| 19 |
FIND_PATH(CPLEX_BIN_DIR |
|
| 20 |
cplex91.dll |
|
| 21 |
PATHS "C:/ILOG/CPLEX91/bin/x86_win32" |
|
| 22 |
) |
|
| 23 |
|
|
| 24 |
IF(CPLEX_FOUND) |
|
| 25 |
SET(CPLEX_INCLUDE_DIRS ${CPLEX_INCLUDE_DIR})
|
|
| 26 |
SET(CPLEX_LIBRARIES ${CPLEX_LIBRARY})
|
|
| 27 |
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") |
|
| 28 |
SET(CPLEX_LIBRARIES "${CPLEX_LIBRARIES};m;pthread")
|
|
| 29 |
ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux") |
|
| 30 |
ENDIF(CPLEX_FOUND) |
|
| 31 |
|
|
| 32 |
MARK_AS_ADVANCED(CPLEX_LIBRARY CPLEX_INCLUDE_DIR CPLEX_BIN_DIR) |
|
| 33 |
|
|
| 34 |
IF(CPLEX_FOUND) |
|
| 35 |
SET(LEMON_HAVE_LP TRUE) |
|
| 36 |
SET(LEMON_HAVE_MIP TRUE) |
|
| 37 |
SET(LEMON_HAVE_CPLEX TRUE) |
|
| 38 |
ENDIF(CPLEX_FOUND) |
| 1 |
SET(GLPK_ROOT_DIR "" CACHE PATH "GLPK root directory") |
|
| 2 |
|
|
| 3 |
SET(GLPK_REGKEY "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Glpk;InstallPath]") |
|
| 4 |
GET_FILENAME_COMPONENT(GLPK_ROOT_PATH ${GLPK_REGKEY} ABSOLUTE)
|
|
| 5 |
|
|
| 6 |
FIND_PATH(GLPK_INCLUDE_DIR |
|
| 7 |
glpk.h |
|
| 8 |
PATHS ${GLPK_REGKEY}/include
|
|
| 9 |
HINTS ${GLPK_ROOT_DIR}/include
|
|
| 10 |
) |
|
| 11 |
FIND_LIBRARY(GLPK_LIBRARY |
|
| 12 |
glpk |
|
| 13 |
PATHS ${GLPK_REGKEY}/lib
|
|
| 14 |
HINTS ${GLPK_ROOT_DIR}/lib
|
|
| 15 |
) |
|
| 16 |
|
|
| 17 |
IF(GLPK_INCLUDE_DIR AND GLPK_LIBRARY) |
|
| 18 |
FILE(READ ${GLPK_INCLUDE_DIR}/glpk.h GLPK_GLPK_H)
|
|
| 19 |
|
|
| 20 |
STRING(REGEX MATCH "define[ ]+GLP_MAJOR_VERSION[ ]+[0-9]+" GLPK_MAJOR_VERSION_LINE "${GLPK_GLPK_H}")
|
|
| 21 |
STRING(REGEX REPLACE "define[ ]+GLP_MAJOR_VERSION[ ]+([0-9]+)" "\\1" GLPK_VERSION_MAJOR "${GLPK_MAJOR_VERSION_LINE}")
|
|
| 22 |
|
|
| 23 |
STRING(REGEX MATCH "define[ ]+GLP_MINOR_VERSION[ ]+[0-9]+" GLPK_MINOR_VERSION_LINE "${GLPK_GLPK_H}")
|
|
| 24 |
STRING(REGEX REPLACE "define[ ]+GLP_MINOR_VERSION[ ]+([0-9]+)" "\\1" GLPK_VERSION_MINOR "${GLPK_MINOR_VERSION_LINE}")
|
|
| 25 |
|
|
| 26 |
SET(GLPK_VERSION_STRING "${GLPK_VERSION_MAJOR}.${GLPK_VERSION_MINOR}")
|
|
| 27 |
|
|
| 28 |
IF(GLPK_FIND_VERSION) |
|
| 29 |
IF(GLPK_FIND_VERSION_COUNT GREATER 2) |
|
| 30 |
MESSAGE(SEND_ERROR "unexpected version string") |
|
| 31 |
ENDIF(GLPK_FIND_VERSION_COUNT GREATER 2) |
|
| 32 |
|
|
| 33 |
MATH(EXPR GLPK_REQUESTED_VERSION "${GLPK_FIND_VERSION_MAJOR}*100 + ${GLPK_FIND_VERSION_MINOR}")
|
|
| 34 |
MATH(EXPR GLPK_FOUND_VERSION "${GLPK_VERSION_MAJOR}*100 + ${GLPK_VERSION_MINOR}")
|
|
| 35 |
|
|
| 36 |
IF(GLPK_FOUND_VERSION LESS GLPK_REQUESTED_VERSION) |
|
| 37 |
SET(GLPK_PROPER_VERSION_FOUND FALSE) |
|
| 38 |
ELSE(GLPK_FOUND_VERSION LESS GLPK_REQUESTED_VERSION) |
|
| 39 |
SET(GLPK_PROPER_VERSION_FOUND TRUE) |
|
| 40 |
ENDIF(GLPK_FOUND_VERSION LESS GLPK_REQUESTED_VERSION) |
|
| 41 |
ELSE(GLPK_FIND_VERSION) |
|
| 42 |
SET(GLPK_PROPER_VERSION_FOUND TRUE) |
|
| 43 |
ENDIF(GLPK_FIND_VERSION) |
|
| 44 |
ENDIF(GLPK_INCLUDE_DIR AND GLPK_LIBRARY) |
|
| 45 |
|
|
| 46 |
INCLUDE(FindPackageHandleStandardArgs) |
|
| 47 |
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLPK DEFAULT_MSG GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_PROPER_VERSION_FOUND) |
|
| 48 |
|
|
| 49 |
IF(GLPK_FOUND) |
|
| 50 |
SET(GLPK_INCLUDE_DIRS ${GLPK_INCLUDE_DIR})
|
|
| 51 |
SET(GLPK_LIBRARIES ${GLPK_LIBRARY})
|
|
| 52 |
SET(GLPK_BIN_DIR ${GLPK_ROOT_PATH}/bin)
|
|
| 53 |
ENDIF(GLPK_FOUND) |
|
| 54 |
|
|
| 55 |
MARK_AS_ADVANCED(GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_BIN_DIR) |
|
| 56 |
|
|
| 57 |
IF(GLPK_FOUND) |
|
| 58 |
SET(LEMON_HAVE_LP TRUE) |
|
| 59 |
SET(LEMON_HAVE_MIP TRUE) |
|
| 60 |
SET(LEMON_HAVE_GLPK TRUE) |
|
| 61 |
ENDIF(GLPK_FOUND) |
| 1 |
SET(LEMON_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include" CACHE PATH "LEMON include directory") |
|
| 2 |
SET(LEMON_INCLUDE_DIRS "${LEMON_INCLUDE_DIR}")
|
|
| 3 |
|
|
| 4 |
IF(UNIX) |
|
| 5 |
SET(LEMON_LIB_NAME "libemon.a") |
|
| 6 |
ELSEIF(WIN32) |
|
| 7 |
SET(LEMON_LIB_NAME "lemon.lib") |
|
| 8 |
ENDIF(UNIX) |
|
| 9 |
|
|
| 10 |
SET(LEMON_LIBRARY "@CMAKE_INSTALL_PREFIX@/lib/${LEMON_LIB_NAME}" CACHE FILEPATH "LEMON library")
|
|
| 11 |
SET(LEMON_LIBRARIES "${LEMON_LIBRARY}")
|
|
| 12 |
|
|
| 13 |
MARK_AS_ADVANCED(LEMON_LIBRARY LEMON_INCLUDE_DIR) |
| 1 |
%!PS-Adobe-3.0 EPSF-3.0 |
|
| 2 |
%%BoundingBox: 15 18 829 570 |
|
| 3 |
%%HiResBoundingBox: 15.1913 18.4493 828.078 569.438 |
|
| 4 |
%%Creator: Karbon14 EPS Exportfilter 0.5 |
|
| 5 |
%%CreationDate: (04/15/06 15:20:26) |
|
| 6 |
%%For: (Balazs Dezso) () |
|
| 7 |
%%Title: () |
|
| 8 |
|
|
| 9 |
/N {newpath} def
|
|
| 10 |
/C {closepath} def
|
|
| 11 |
/m {moveto} def
|
|
| 12 |
/c {curveto} def
|
|
| 13 |
/l {lineto} def
|
|
| 14 |
/s {stroke} def
|
|
| 15 |
/f {fill} def
|
|
| 16 |
/w {setlinewidth} def
|
|
| 17 |
/d {setdash} def
|
|
| 18 |
/r {setrgbcolor} def
|
|
| 19 |
/S {gsave} def
|
|
| 20 |
/R {grestore} def
|
|
| 21 |
|
|
| 22 |
N |
|
| 23 |
251.402 32.047 m |
|
| 24 |
532.945 293.946 814.484 555.844 814.484 555.844 c |
|
| 25 |
[] 0 d 1 0 0 r 3.92814 w s |
|
| 26 |
|
|
| 27 |
N |
|
| 28 |
749.012 32.047 m |
|
| 29 |
742.465 293.946 735.918 555.844 735.918 555.844 c |
|
| 30 |
[] 0 d 0 0 0 r 1.96407 w s |
|
| 31 |
|
|
| 32 |
N |
|
| 33 |
539.492 32.047 m |
|
| 34 |
637.703 293.946 735.918 555.844 735.918 555.844 c |
|
| 35 |
[] 0 d 0 0 0 r 1.96407 w s |
|
| 36 |
|
|
| 37 |
N |
|
| 38 |
172.832 32.047 m |
|
| 39 |
454.375 293.946 735.918 555.844 735.918 555.844 c |
|
| 40 |
[] 0 d 0 0 0 r 1.96407 w s |
|
| 41 |
|
|
| 42 |
N |
|
| 43 |
107.355 32.047 m |
|
| 44 |
421.637 293.946 735.918 555.844 735.918 555.844 c |
|
| 45 |
[] 0 d 1 0 0 r 3.92814 w s |
|
| 46 |
|
|
| 47 |
N |
|
| 48 |
644.25 555.844 m |
|
| 49 |
696.633 293.946 749.012 32.047 749.012 32.047 c |
|
| 50 |
[] 0 d 0 0 0 r 1.96407 w s |
|
| 51 |
|
|
| 52 |
N |
|
| 53 |
474.016 555.844 m |
|
| 54 |
611.516 293.946 749.012 32.047 749.012 32.047 c |
|
| 55 |
[] 0 d 1 0 0 r 3.92814 w s |
|
| 56 |
|
|
| 57 |
N |
|
| 58 |
683.535 32.047 m |
|
| 59 |
663.894 293.946 644.25 555.844 644.25 555.844 c |
|
| 60 |
[] 0 d 0 0 0 r 1.96407 w s |
|
| 61 |
|
|
| 62 |
N |
|
| 63 |
120.453 555.844 m |
|
| 64 |
401.992 293.946 683.535 32.047 683.535 32.047 c |
|
| 65 |
[] 0 d 0 0 0 r 1.96407 w s |
|
| 66 |
|
|
| 67 |
N |
|
| 68 |
28.7853 555.844 m |
|
| 69 |
356.16 293.946 683.535 32.047 683.535 32.047 c |
|
| 70 |
[] 0 d 1 0 0 r 3.92814 w s |
|
| 71 |
|
|
| 72 |
N |
|
| 73 |
539.492 32.047 m |
|
| 74 |
546.039 293.946 552.586 555.844 552.586 555.844 c |
|
| 75 |
[] 0 d 1 0 0 r 3.92814 w s |
|
| 76 |
|
|
| 77 |
N |
|
| 78 |
316.875 32.047 m |
|
| 79 |
349.613 293.946 382.351 555.844 382.351 555.844 c |
|
| 80 |
[] 0 d 1 0 0 r 3.92814 w s |
|
| 81 |
|
|
| 82 |
N |
|
| 83 |
107.355 32.047 m |
|
| 84 |
244.855 293.946 382.351 555.844 382.351 555.844 c |
|
| 85 |
[] 0 d 0 0 0 r 1.96407 w s |
|
| 86 |
|
|
| 87 |
N |
|
| 88 |
290.687 555.844 m |
|
| 89 |
375.805 293.946 460.922 32.047 460.922 32.047 c |
|
| 90 |
[] 0 d 1 0 0 r 3.92814 w s |
|
| 91 |
|
|
| 92 |
N |
|
| 93 |
120.453 555.844 m |
|
| 94 |
290.687 293.946 460.922 32.047 460.922 32.047 c |
|
| 95 |
[] 0 d 0 0 0 r 1.96407 w s |
|
| 96 |
|
|
| 97 |
N |
|
| 98 |
172.832 32.047 m |
|
| 99 |
146.64 293.946 120.453 555.844 120.453 555.844 c |
|
| 100 |
[] 0 d 1 0 0 r 3.92814 w s |
|
| 101 |
|
|
| 102 |
N |
|
| 103 |
15.6913 555.844 m |
|
| 104 |
15.6913 555.844 l |
|
| 105 |
15.6913 548.614 21.5553 542.75 28.7853 542.75 c |
|
| 106 |
36.0163 542.75 41.8833 548.614 41.8833 555.844 c |
|
| 107 |
41.8833 563.075 36.0163 568.938 28.7853 568.938 c |
|
| 108 |
21.5553 568.938 15.6913 563.075 15.6913 555.844 c |
|
| 109 |
15.6913 555.844 l |
|
| 110 |
C |
|
| 111 |
S 0 0 0 r f R |
|
| 112 |
|
|
| 113 |
N |
|
| 114 |
16.8833 555.844 m |
|
| 115 |
16.8833 555.844 l |
|
| 116 |
16.8833 549.27 22.2113 543.942 28.7853 543.942 c |
|
| 117 |
35.3593 543.942 40.6913 549.27 40.6913 555.844 c |
|
| 118 |
40.6913 562.418 35.3593 567.747 28.7853 567.747 c |
|
| 119 |
22.2113 567.747 16.8833 562.418 16.8833 555.844 c |
|
| 120 |
16.8833 555.844 l |
|
| 121 |
C |
|
| 122 |
S 1 0.5 1 r f R |
|
| 123 |
|
|
| 124 |
N |
|
| 125 |
107.355 555.844 m |
|
| 126 |
107.355 555.844 l |
|
| 127 |
107.355 548.614 113.223 542.75 120.453 542.75 c |
|
| 128 |
127.683 542.75 133.547 548.614 133.547 555.844 c |
|
| 129 |
133.547 563.075 127.683 568.938 120.453 568.938 c |
|
| 130 |
113.223 568.938 107.355 563.075 107.355 555.844 c |
|
| 131 |
107.355 555.844 l |
|
| 132 |
C |
|
| 133 |
S 0 0 0 r f R |
|
| 134 |
|
|
| 135 |
N |
|
| 136 |
108.547 555.844 m |
|
| 137 |
108.547 555.844 l |
|
| 138 |
108.547 549.27 113.879 543.942 120.453 543.942 c |
|
| 139 |
127.027 543.942 132.355 549.27 132.355 555.844 c |
|
| 140 |
132.355 562.418 127.027 567.747 120.453 567.747 c |
|
| 141 |
113.879 567.747 108.547 562.418 108.547 555.844 c |
|
| 142 |
108.547 555.844 l |
|
| 143 |
C |
|
| 144 |
S 1 0 1 r f R |
|
| 145 |
|
|
| 146 |
N |
|
| 147 |
199.019 555.844 m |
|
| 148 |
199.019 555.844 l |
|
| 149 |
199.019 548.614 204.887 542.75 212.117 542.75 c |
|
| 150 |
219.348 542.75 225.211 548.614 225.211 555.844 c |
|
| 151 |
225.211 563.075 219.348 568.938 212.117 568.938 c |
|
| 152 |
204.887 568.938 199.019 563.075 199.019 555.844 c |
|
| 153 |
199.019 555.844 l |
|
| 154 |
C |
|
| 155 |
S 0 0 0 r f R |
|
| 156 |
|
|
| 157 |
N |
|
| 158 |
200.211 555.844 m |
|
| 159 |
200.211 555.844 l |
|
| 160 |
200.211 549.27 205.543 543.942 212.117 543.942 c |
|
| 161 |
218.691 543.942 224.019 549.27 224.019 555.844 c |
|
| 162 |
224.019 562.418 218.691 567.747 212.117 567.747 c |
|
| 163 |
205.543 567.747 200.211 562.418 200.211 555.844 c |
|
| 164 |
200.211 555.844 l |
|
| 165 |
C |
|
| 166 |
S 1 0.5 1 r f R |
|
| 167 |
|
|
| 168 |
N |
|
| 169 |
277.59 555.844 m |
|
| 170 |
277.59 555.844 l |
|
| 171 |
277.59 548.614 283.457 542.75 290.687 542.75 c |
|
| 172 |
297.918 542.75 303.781 548.614 303.781 555.844 c |
|
| 173 |
303.781 563.075 297.918 568.938 290.687 568.938 c |
|
| 174 |
283.457 568.938 277.59 563.075 277.59 555.844 c |
|
| 175 |
277.59 555.844 l |
|
| 176 |
C |
|
| 177 |
S 0 0 0 r f R |
|
| 178 |
|
|
| 179 |
N |
|
| 180 |
278.781 555.844 m |
|
| 181 |
278.781 555.844 l |
|
| 182 |
278.781 549.27 284.113 543.942 290.687 543.942 c |
|
| 183 |
297.262 543.942 302.59 549.27 302.59 555.844 c |
|
| 184 |
302.59 562.418 297.262 567.747 290.687 567.747 c |
|
| 185 |
284.113 567.747 278.781 562.418 278.781 555.844 c |
|
| 186 |
278.781 555.844 l |
|
| 187 |
C |
|
| 188 |
S 1 0 1 r f R |
|
| 189 |
|
|
| 190 |
N |
|
| 191 |
369.258 555.844 m |
|
| 192 |
369.258 555.844 l |
|
| 193 |
369.258 548.614 375.121 542.75 382.351 542.75 c |
|
| 194 |
389.582 542.75 395.445 548.614 395.445 555.844 c |
|
| 195 |
395.445 563.075 389.582 568.938 382.351 568.938 c |
|
| 196 |
375.121 568.938 369.258 563.075 369.258 555.844 c |
|
| 197 |
369.258 555.844 l |
|
| 198 |
C |
|
| 199 |
S 0 0 0 r f R |
|
| 200 |
|
|
| 201 |
N |
|
| 202 |
370.445 555.844 m |
|
| 203 |
370.445 555.844 l |
|
| 204 |
370.445 549.27 375.777 543.942 382.351 543.942 c |
|
| 205 |
388.926 543.942 394.258 549.27 394.258 555.844 c |
|
| 206 |
394.258 562.418 388.926 567.747 382.351 567.747 c |
|
| 207 |
375.777 567.747 370.445 562.418 370.445 555.844 c |
|
| 208 |
370.445 555.844 l |
|
| 209 |
C |
|
| 210 |
S 1 0 1 r f R |
|
| 211 |
|
|
| 212 |
N |
|
| 213 |
460.922 555.844 m |
|
| 214 |
460.922 555.844 l |
|
| 215 |
460.922 548.614 466.785 542.75 474.016 542.75 c |
|
| 216 |
481.246 542.75 487.109 548.614 487.109 555.844 c |
|
| 217 |
487.109 563.075 481.246 568.938 474.016 568.938 c |
|
| 218 |
466.785 568.938 460.922 563.075 460.922 555.844 c |
|
| 219 |
460.922 555.844 l |
|
| 220 |
C |
|
| 221 |
S 0 0 0 r f R |
|
| 222 |
|
|
| 223 |
N |
|
| 224 |
462.113 555.844 m |
|
| 225 |
462.113 555.844 l |
|
| 226 |
462.113 549.27 467.441 543.942 474.016 543.942 c |
|
| 227 |
480.59 543.942 485.922 549.27 485.922 555.844 c |
|
| 228 |
485.922 562.418 480.59 567.747 474.016 567.747 c |
|
| 229 |
467.441 567.747 462.113 562.418 462.113 555.844 c |
|
| 230 |
462.113 555.844 l |
|
| 231 |
C |
|
| 232 |
S 1 0.5 1 r f R |
|
| 233 |
|
|
| 234 |
N |
|
| 235 |
539.492 555.844 m |
|
| 236 |
539.492 555.844 l |
|
| 237 |
539.492 548.614 545.355 542.75 552.586 542.75 c |
|
| 238 |
559.816 542.75 565.68 548.614 565.68 555.844 c |
|
| 239 |
565.68 563.075 559.816 568.938 552.586 568.938 c |
|
| 240 |
545.355 568.938 539.492 563.075 539.492 555.844 c |
|
| 241 |
539.492 555.844 l |
|
| 242 |
C |
|
| 243 |
S 0 0 0 r f R |
|
| 244 |
|
|
| 245 |
N |
|
| 246 |
540.683 555.844 m |
|
| 247 |
540.683 555.844 l |
|
| 248 |
540.683 549.27 546.012 543.942 552.586 543.942 c |
|
| 249 |
559.16 543.942 564.492 549.27 564.492 555.844 c |
|
| 250 |
564.492 562.418 559.16 567.747 552.586 567.747 c |
|
| 251 |
546.012 567.747 540.683 562.418 540.683 555.844 c |
|
| 252 |
540.683 555.844 l |
|
| 253 |
C |
|
| 254 |
S 1 0 1 r f R |
|
| 255 |
|
|
| 256 |
N |
|
| 257 |
631.156 555.844 m |
|
| 258 |
631.156 555.844 l |
|
| 259 |
631.156 548.614 637.019 542.75 644.25 542.75 c |
|
| 260 |
651.48 542.75 657.348 548.614 657.348 555.844 c |
|
| 261 |
657.348 563.075 651.48 568.938 644.25 568.938 c |
|
| 262 |
637.019 568.938 631.156 563.075 631.156 555.844 c |
|
| 263 |
631.156 555.844 l |
|
| 264 |
C |
|
| 265 |
S 0 0 0 r f R |
|
| 266 |
|
|
| 267 |
N |
|
| 268 |
632.348 555.844 m |
|
| 269 |
632.348 555.844 l |
|
| 270 |
632.348 549.27 637.676 543.942 644.25 543.942 c |
|
| 271 |
650.824 543.942 656.156 549.27 656.156 555.844 c |
|
| 272 |
656.156 562.418 650.824 567.747 644.25 567.747 c |
|
| 273 |
637.676 567.747 632.348 562.418 632.348 555.844 c |
|
| 274 |
632.348 555.844 l |
|
| 275 |
C |
|
| 276 |
S 1 0.5 1 r f R |
|
| 277 |
|
|
| 278 |
N |
|
| 279 |
722.82 555.844 m |
|
| 280 |
722.82 555.844 l |
|
| 281 |
722.82 548.614 728.687 542.75 735.918 542.75 c |
|
| 282 |
743.149 542.75 749.012 548.614 749.012 555.844 c |
|
| 283 |
749.012 563.075 743.149 568.938 735.918 568.938 c |
|
| 284 |
728.687 568.938 722.82 563.075 722.82 555.844 c |
|
| 285 |
722.82 555.844 l |
|
| 286 |
C |
|
| 287 |
S 0 0 0 r f R |
|
| 288 |
|
|
| 289 |
N |
|
| 290 |
724.012 555.844 m |
|
| 291 |
724.012 555.844 l |
|
| 292 |
724.012 549.27 729.344 543.942 735.918 543.942 c |
|
| 293 |
742.492 543.942 747.82 549.27 747.82 555.844 c |
|
| 294 |
747.82 562.418 742.492 567.747 735.918 567.747 c |
|
| 295 |
729.344 567.747 724.012 562.418 724.012 555.844 c |
|
| 296 |
724.012 555.844 l |
|
| 297 |
C |
|
| 298 |
S 1 0 1 r f R |
|
| 299 |
|
|
| 300 |
N |
|
| 301 |
801.391 555.844 m |
|
| 302 |
801.391 555.844 l |
|
| 303 |
801.391 548.614 807.254 542.75 814.484 542.75 c |
|
| 304 |
821.715 542.75 827.578 548.614 827.578 555.844 c |
|
| 305 |
827.578 563.075 821.715 568.938 814.484 568.938 c |
|
| 306 |
807.254 568.938 801.391 563.075 801.391 555.844 c |
|
| 307 |
801.391 555.844 l |
|
| 308 |
C |
|
| 309 |
S 0 0 0 r f R |
|
| 310 |
|
|
| 311 |
N |
|
| 312 |
802.582 555.844 m |
|
| 313 |
802.582 555.844 l |
|
| 314 |
802.582 549.27 807.91 543.942 814.484 543.942 c |
|
| 315 |
821.059 543.942 826.387 549.27 826.387 555.844 c |
|
| 316 |
826.387 562.418 821.059 567.747 814.484 567.747 c |
|
| 317 |
807.91 567.747 802.582 562.418 802.582 555.844 c |
|
| 318 |
802.582 555.844 l |
|
| 319 |
C |
|
| 320 |
S 1 0 1 r f R |
|
| 321 |
|
|
| 322 |
N |
|
| 323 |
15.6913 32.047 m |
|
| 324 |
15.6913 32.047 l |
|
| 325 |
15.6913 24.8165 21.5553 18.9493 28.7853 18.9493 c |
|
| 326 |
36.0163 18.9493 41.8833 24.8165 41.8833 32.047 c |
|
| 327 |
41.8833 39.2775 36.0163 45.1407 28.7853 45.1407 c |
|
| 328 |
21.5553 45.1407 15.6913 39.2775 15.6913 32.047 c |
|
| 329 |
15.6913 32.047 l |
|
| 330 |
C |
|
| 331 |
S 0 0 0 r f R |
|
| 332 |
|
|
| 333 |
N |
|
| 334 |
16.8833 32.047 m |
|
| 335 |
16.8833 32.047 l |
|
| 336 |
16.8833 25.4728 22.2113 20.1407 28.7853 20.1407 c |
|
| 337 |
35.3593 20.1407 40.6913 25.4728 40.6913 32.047 c |
|
| 338 |
40.6913 38.6212 35.3593 43.9493 28.7853 43.9493 c |
|
| 339 |
22.2113 43.9493 16.8833 38.6212 16.8833 32.047 c |
|
| 340 |
16.8833 32.047 l |
|
| 341 |
C |
|
| 342 |
S 0.5 0.5 1 r f R |
|
| 343 |
|
|
| 344 |
N |
|
| 345 |
94.2623 32.047 m |
|
| 346 |
94.2623 32.047 l |
|
| 347 |
94.2623 24.8165 100.125 18.9493 107.355 18.9493 c |
|
| 348 |
114.586 18.9493 120.453 24.8165 120.453 32.047 c |
|
| 349 |
120.453 39.2775 114.586 45.1407 107.355 45.1407 c |
|
| 350 |
100.125 45.1407 94.2623 39.2775 94.2623 32.047 c |
|
| 351 |
94.2623 32.047 l |
|
| 352 |
C |
|
| 353 |
S 0 0 0 r f R |
|
| 354 |
|
|
| 355 |
N |
|
| 356 |
95.4533 32.047 m |
|
| 357 |
95.4533 32.047 l |
|
| 358 |
95.4533 25.4728 100.781 20.1407 107.355 20.1407 c |
|
| 359 |
113.93 20.1407 119.262 25.4728 119.262 32.047 c |
|
| 360 |
119.262 38.6212 113.93 43.9493 107.355 43.9493 c |
|
| 361 |
100.781 43.9493 95.4533 38.6212 95.4533 32.047 c |
|
| 362 |
95.4533 32.047 l |
|
| 363 |
C |
|
| 364 |
S 0.5 0.5 1 r f R |
|
| 365 |
|
|
| 366 |
N |
|
| 367 |
159.734 32.047 m |
|
| 368 |
159.734 32.047 l |
|
| 369 |
159.734 24.8165 165.601 18.9493 172.832 18.9493 c |
|
| 370 |
180.062 18.9493 185.926 24.8165 185.926 32.047 c |
|
| 371 |
185.926 39.2775 180.062 45.1407 172.832 45.1407 c |
|
| 372 |
165.601 45.1407 159.734 39.2775 159.734 32.047 c |
|
| 373 |
159.734 32.047 l |
|
| 374 |
C |
|
| 375 |
S 0 0 0 r f R |
|
| 376 |
|
|
| 377 |
N |
|
| 378 |
160.926 32.047 m |
|
| 379 |
160.926 32.047 l |
|
| 380 |
160.926 25.4728 166.258 20.1407 172.832 20.1407 c |
|
| 381 |
179.406 20.1407 184.734 25.4728 184.734 32.047 c |
|
| 382 |
184.734 38.6212 179.406 43.9493 172.832 43.9493 c |
|
| 383 |
166.258 43.9493 160.926 38.6212 160.926 32.047 c |
|
| 384 |
160.926 32.047 l |
|
| 385 |
C |
|
| 386 |
S 0.5 0.5 1 r f R |
|
| 387 |
|
|
| 388 |
N |
|
| 389 |
238.305 32.047 m |
|
| 390 |
238.305 32.047 l |
|
| 391 |
238.305 24.8165 244.172 18.9493 251.402 18.9493 c |
|
| 392 |
258.633 18.9493 264.496 24.8165 264.496 32.047 c |
|
| 393 |
264.496 39.2775 258.633 45.1407 251.402 45.1407 c |
|
| 394 |
244.172 45.1407 238.305 39.2775 238.305 32.047 c |
|
| 395 |
238.305 32.047 l |
|
| 396 |
C |
|
| 397 |
S 0 0 0 r f R |
|
| 398 |
|
|
| 399 |
N |
|
| 400 |
239.496 32.047 m |
|
| 401 |
239.496 32.047 l |
|
| 402 |
239.496 25.4728 244.828 20.1407 251.402 20.1407 c |
|
| 403 |
257.976 20.1407 263.305 25.4728 263.305 32.047 c |
|
| 404 |
263.305 38.6212 257.976 43.9493 251.402 43.9493 c |
|
| 405 |
244.828 43.9493 239.496 38.6212 239.496 32.047 c |
|
| 406 |
239.496 32.047 l |
|
| 407 |
C |
|
| 408 |
S 0.5 0.5 1 r f R |
|
| 409 |
|
|
| 410 |
N |
|
| 411 |
303.781 32.047 m |
|
| 412 |
303.781 32.047 l |
|
| 413 |
303.781 24.8165 309.644 18.9493 316.875 18.9493 c |
|
| 414 |
324.105 18.9493 329.973 24.8165 329.973 32.047 c |
|
| 415 |
329.973 39.2775 324.105 45.1407 316.875 45.1407 c |
|
| 416 |
309.644 45.1407 303.781 39.2775 303.781 32.047 c |
|
| 417 |
303.781 32.047 l |
|
| 418 |
C |
|
| 419 |
S 0 0 0 r f R |
|
| 420 |
|
|
| 421 |
N |
|
| 422 |
304.973 32.047 m |
|
| 423 |
304.973 32.047 l |
|
| 424 |
304.973 25.4728 310.301 20.1407 316.875 20.1407 c |
|
| 425 |
323.449 20.1407 328.781 25.4728 328.781 32.047 c |
|
| 426 |
328.781 38.6212 323.449 43.9493 316.875 43.9493 c |
|
| 427 |
310.301 43.9493 304.973 38.6212 304.973 32.047 c |
|
| 428 |
304.973 32.047 l |
|
| 429 |
C |
|
| 430 |
S 0.5 0.5 1 r f R |
|
| 431 |
|
|
| 432 |
N |
|
| 433 |
382.351 32.047 m |
|
| 434 |
382.351 32.047 l |
|
| 435 |
382.351 24.8165 388.215 18.9493 395.445 18.9493 c |
|
| 436 |
402.676 18.9493 408.543 24.8165 408.543 32.047 c |
|
| 437 |
408.543 39.2775 402.676 45.1407 395.445 45.1407 c |
|
| 438 |
388.215 45.1407 382.351 39.2775 382.351 32.047 c |
|
| 439 |
382.351 32.047 l |
|
| 440 |
C |
|
| 441 |
S 0 0 0 r f R |
|
| 442 |
|
|
| 443 |
N |
|
| 444 |
383.543 32.047 m |
|
| 445 |
383.543 32.047 l |
|
| 446 |
383.543 25.4728 388.871 20.1407 395.445 20.1407 c |
|
| 447 |
402.019 20.1407 407.351 25.4728 407.351 32.047 c |
|
| 448 |
407.351 38.6212 402.019 43.9493 395.445 43.9493 c |
|
| 449 |
388.871 43.9493 383.543 38.6212 383.543 32.047 c |
|
| 450 |
383.543 32.047 l |
|
| 451 |
C |
|
| 452 |
S 0.5 0.5 1 r f R |
|
| 453 |
|
|
| 454 |
N |
|
| 455 |
447.828 32.047 m |
|
| 456 |
447.828 32.047 l |
|
| 457 |
447.828 24.8165 453.691 18.9493 460.922 18.9493 c |
|
| 458 |
468.152 18.9493 474.016 24.8165 474.016 32.047 c |
|
| 459 |
474.016 39.2775 468.152 45.1407 460.922 45.1407 c |
|
| 460 |
453.691 45.1407 447.828 39.2775 447.828 32.047 c |
|
| 461 |
447.828 32.047 l |
|
| 462 |
C |
|
| 463 |
S 0 0 0 r f R |
|
| 464 |
|
|
| 465 |
N |
|
| 466 |
449.016 32.047 m |
|
| 467 |
449.016 32.047 l |
|
| 468 |
449.016 25.4728 454.348 20.1407 460.922 20.1407 c |
|
| 469 |
467.496 20.1407 472.824 25.4728 472.824 32.047 c |
|
| 470 |
472.824 38.6212 467.496 43.9493 460.922 43.9493 c |
|
| 471 |
454.348 43.9493 449.016 38.6212 449.016 32.047 c |
|
| 472 |
449.016 32.047 l |
|
| 473 |
C |
|
| 474 |
S 0.5 0.5 1 r f R |
|
| 475 |
|
|
| 476 |
N |
|
| 477 |
526.394 32.047 m |
|
| 478 |
526.394 32.047 l |
|
| 479 |
526.394 24.8165 532.262 18.9493 539.492 18.9493 c |
|
| 480 |
546.723 18.9493 552.586 24.8165 552.586 32.047 c |
|
| 481 |
552.586 39.2775 546.723 45.1407 539.492 45.1407 c |
|
| 482 |
532.262 45.1407 526.394 39.2775 526.394 32.047 c |
|
| 483 |
526.394 32.047 l |
|
| 484 |
C |
|
| 485 |
S 0 0 0 r f R |
|
| 486 |
|
|
| 487 |
N |
|
| 488 |
527.586 32.047 m |
|
| 489 |
527.586 32.047 l |
|
| 490 |
527.586 25.4728 532.918 20.1407 539.492 20.1407 c |
|
| 491 |
546.066 20.1407 551.394 25.4728 551.394 32.047 c |
|
| 492 |
551.394 38.6212 546.066 43.9493 539.492 43.9493 c |
|
| 493 |
532.918 43.9493 527.586 38.6212 527.586 32.047 c |
|
| 494 |
527.586 32.047 l |
|
| 495 |
C |
|
| 496 |
S 0.5 0.5 1 r f R |
|
| 497 |
|
|
| 498 |
N |
|
| 499 |
591.871 32.047 m |
|
| 500 |
591.871 32.047 l |
|
| 501 |
591.871 24.8165 597.734 18.9493 604.965 18.9493 c |
|
| 502 |
612.195 18.9493 618.062 24.8165 618.062 32.047 c |
|
| 503 |
618.062 39.2775 612.195 45.1407 604.965 45.1407 c |
|
| 504 |
597.734 45.1407 591.871 39.2775 591.871 32.047 c |
|
| 505 |
591.871 32.047 l |
|
| 506 |
C |
|
| 507 |
S 0 0 0 r f R |
|
| 508 |
|
|
| 509 |
N |
|
| 510 |
593.062 32.047 m |
|
| 511 |
593.062 32.047 l |
|
| 512 |
593.062 25.4728 598.39 20.1407 604.965 20.1407 c |
|
| 513 |
611.539 20.1407 616.871 25.4728 616.871 32.047 c |
|
| 514 |
616.871 38.6212 611.539 43.9493 604.965 43.9493 c |
|
| 515 |
598.39 43.9493 593.062 38.6212 593.062 32.047 c |
|
| 516 |
593.062 32.047 l |
|
| 517 |
C |
|
| 518 |
S 0.5 0.5 1 r f R |
|
| 519 |
|
|
| 520 |
N |
|
| 521 |
670.441 32.047 m |
|
| 522 |
670.441 32.047 l |
|
| 523 |
670.441 24.8165 676.305 18.9493 683.535 18.9493 c |
|
| 524 |
690.766 18.9493 696.633 24.8165 696.633 32.047 c |
|
| 525 |
696.633 39.2775 690.766 45.1407 683.535 45.1407 c |
|
| 526 |
676.305 45.1407 670.441 39.2775 670.441 32.047 c |
|
| 527 |
670.441 32.047 l |
|
| 528 |
C |
|
| 529 |
S 0 0 0 r f R |
|
| 530 |
|
|
| 531 |
N |
|
| 532 |
671.633 32.047 m |
|
| 533 |
671.633 32.047 l |
|
| 534 |
671.633 25.4728 676.961 20.1407 683.535 20.1407 c |
|
| 535 |
690.109 20.1407 695.441 25.4728 695.441 32.047 c |
|
| 536 |
695.441 38.6212 690.109 43.9493 683.535 43.9493 c |
|
| 537 |
676.961 43.9493 671.633 38.6212 671.633 32.047 c |
|
| 538 |
671.633 32.047 l |
|
| 539 |
C |
|
| 540 |
S 0 0 1 r f R |
|
| 541 |
|
|
| 542 |
N |
|
| 543 |
735.918 32.047 m |
|
| 544 |
735.918 32.047 l |
|
| 545 |
735.918 24.8165 741.781 18.9493 749.012 18.9493 c |
|
| 546 |
756.242 18.9493 762.106 24.8165 762.106 32.047 c |
|
| 547 |
762.106 39.2775 756.242 45.1407 749.012 45.1407 c |
|
| 548 |
741.781 45.1407 735.918 39.2775 735.918 32.047 c |
|
| 549 |
735.918 32.047 l |
|
| 550 |
C |
|
| 551 |
S 0 0 0 r f R |
|
| 552 |
|
|
| 553 |
N |
|
| 554 |
737.105 32.047 m |
|
| 555 |
737.105 32.047 l |
|
| 556 |
737.105 25.4728 742.437 20.1407 749.012 20.1407 c |
|
| 557 |
755.586 20.1407 760.914 25.4728 760.914 32.047 c |
|
| 558 |
760.914 38.6212 755.586 43.9493 749.012 43.9493 c |
|
| 559 |
742.437 43.9493 737.105 38.6212 737.105 32.047 c |
|
| 560 |
737.105 32.047 l |
|
| 561 |
C |
|
| 562 |
S 0 0 1 r f R |
|
| 563 |
|
|
| 564 |
N |
|
| 565 |
801.391 32.047 m |
|
| 566 |
801.391 32.047 l |
|
| 567 |
801.391 24.8165 807.254 18.9493 814.484 18.9493 c |
|
| 568 |
821.715 18.9493 827.578 24.8165 827.578 32.047 c |
|
| 569 |
827.578 39.2775 821.715 45.1407 814.484 45.1407 c |
|
| 570 |
807.254 45.1407 801.391 39.2775 801.391 32.047 c |
|
| 571 |
801.391 32.047 l |
|
| 572 |
C |
|
| 573 |
S 0 0 0 r f R |
|
| 574 |
|
|
| 575 |
N |
|
| 576 |
802.582 32.047 m |
|
| 577 |
802.582 32.047 l |
|
| 578 |
802.582 25.4728 807.91 20.1407 814.484 20.1407 c |
|
| 579 |
821.059 20.1407 826.387 25.4728 826.387 32.047 c |
|
| 580 |
826.387 38.6212 821.059 43.9493 814.484 43.9493 c |
|
| 581 |
807.91 43.9493 802.582 38.6212 802.582 32.047 c |
|
| 582 |
802.582 32.047 l |
|
| 583 |
C |
|
| 584 |
S 0.5 0.5 1 r f R |
|
| 585 |
|
|
| 586 |
%%EOF |
| 1 |
%!PS-Adobe-2.0 EPSF-2.0 |
|
| 2 |
%%Creator: LEMON, graphToEps() |
|
| 3 |
%%CreationDate: Tue Nov 15 16:51:43 2005 |
|
| 4 |
%%BoundingBox: 0 0 842 596 |
|
| 5 |
%%EndComments |
|
| 6 |
/lb { setlinewidth setrgbcolor newpath moveto
|
|
| 7 |
4 2 roll 1 index 1 index curveto stroke } bind def |
|
| 8 |
/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
|
|
| 9 |
/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
|
|
| 10 |
/sq { newpath 2 index 1 index add 2 index 2 index add moveto
|
|
| 11 |
2 index 1 index sub 2 index 2 index add lineto |
|
| 12 |
2 index 1 index sub 2 index 2 index sub lineto |
|
| 13 |
2 index 1 index add 2 index 2 index sub lineto |
|
| 14 |
closepath pop pop pop} bind def |
|
| 15 |
/di { newpath 2 index 1 index add 2 index moveto
|
|
| 16 |
2 index 2 index 2 index add lineto |
|
| 17 |
2 index 1 index sub 2 index lineto |
|
| 18 |
2 index 2 index 2 index sub lineto |
|
| 19 |
closepath pop pop pop} bind def |
|
| 20 |
/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
|
|
| 21 |
setrgbcolor 1.1 div c fill |
|
| 22 |
} bind def |
|
| 23 |
/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
|
|
| 24 |
setrgbcolor 1.1 div sq fill |
|
| 25 |
} bind def |
|
| 26 |
/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
|
|
| 27 |
setrgbcolor 1.1 div di fill |
|
| 28 |
} bind def |
|
| 29 |
/arrl 1 def |
|
| 30 |
/arrw 0.3 def |
|
| 31 |
/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
|
|
| 32 |
/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
|
|
| 33 |
/w exch def /len exch def |
|
| 34 |
newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto |
|
| 35 |
len w sub arrl sub dx dy lrl |
|
| 36 |
arrw dy dx neg lrl |
|
| 37 |
dx arrl w add mul dy w 2 div arrw add mul sub |
|
| 38 |
dy arrl w add mul dx w 2 div arrw add mul add rlineto |
|
| 39 |
dx arrl w add mul neg dy w 2 div arrw add mul sub |
|
| 40 |
dy arrl w add mul neg dx w 2 div arrw add mul add rlineto |
|
| 41 |
arrw dy dx neg lrl |
|
| 42 |
len w sub arrl sub neg dx dy lrl |
|
| 43 |
closepath fill } bind def |
|
| 44 |
/cshow { 2 index 2 index moveto dup stringwidth pop
|
|
| 45 |
neg 2 div fosi .35 mul neg rmoveto show pop pop} def |
|
| 46 |
|
|
| 47 |
gsave |
|
| 48 |
90 rotate |
|
| 49 |
0 -842 translate |
|
| 50 |
71.6378 15 translate |
|
| 51 |
0.389093 dup scale |
|
| 52 |
90 rotate |
|
| 53 |
1197.47 -613.138 translate |
|
| 54 |
%Edges: |
|
| 55 |
gsave |
|
| 56 |
513.857 -446.322 296.569 -487.43 79.2808 -528.539 0 0 0 2 lb |
|
| 57 |
513.857 -446.322 575.52 -315.655 637.183 -184.989 0 0 0 2 lb |
|
| 58 |
393.468 566.711 494.771 434.577 596.074 302.442 0 0 0 2 lb |
|
| 59 |
393.468 566.711 155.625 579.925 -82.2171 593.138 0 0 0 2 lb |
|
| 60 |
393.468 566.711 251.056 450.726 108.644 334.741 0 0 0 2 lb |
|
| 61 |
869.153 52.8539 732.613 177.648 596.074 302.442 0 0 0 2 lb |
|
| 62 |
869.153 52.8539 753.168 -66.0676 637.183 -184.989 0 0 0 2 lb |
|
| 63 |
-82.2171 593.138 -91.0261 346.487 -99.8351 99.8351 0 0 0 2 lb |
|
| 64 |
-663.61 546.157 -753.168 394.936 -842.726 243.715 0 0 0 2 lb |
|
| 65 |
-663.61 546.157 -574.052 437.513 -484.494 328.869 0 0 0 2 lb |
|
| 66 |
-1077.63 161.498 -960.178 202.606 -842.726 243.715 0 0 0 2 lb |
|
| 67 |
-1077.63 161.498 -968.987 66.0674 -860.344 -29.3633 0 0 0 2 lb |
|
| 68 |
-1177.47 -234.906 -1029.18 -381.722 -880.898 -528.539 0 0 0 2 lb |
|
| 69 |
-1177.47 -234.906 -1018.91 -132.135 -860.344 -29.3633 0 0 0 2 lb |
|
| 70 |
-880.898 -528.539 -744.359 -387.595 -607.82 -246.651 0 0 0 2 lb |
|
| 71 |
-499.175 -499.175 -355.295 -475.685 -211.415 -452.194 0 0 0 2 lb |
|
| 72 |
-499.175 -499.175 -553.498 -372.913 -607.82 -246.651 0 0 0 2 lb |
|
| 73 |
-499.175 -499.175 -386.587 -315.087 -274 -131 0 0 0 2 lb |
|
| 74 |
79.2808 -528.539 -66.0671 -490.366 -211.415 -452.194 0 0 0 2 lb |
|
| 75 |
637.183 -184.989 421.363 -253.993 205.543 -322.996 0 0 0 2 lb |
|
| 76 |
205.543 -322.996 162.966 -226.097 120.389 -129.198 0 0 0 2 lb |
|
| 77 |
399.34 88.0898 259.865 -20.5541 120.389 -129.198 0 0 0 2 lb |
|
| 78 |
399.34 88.0898 253.992 211.415 108.644 334.741 0 0 0 2 lb |
|
| 79 |
-842.726 243.715 -471.281 171.775 -99.8351 99.8351 0 0 0 2 lb |
|
| 80 |
-842.726 243.715 -558.363 56.3575 -274 -131 0 0 0 2 lb |
|
| 81 |
-860.344 -29.3633 -734.082 -138.007 -607.82 -246.651 0 0 0 2 lb |
|
| 82 |
-211.415 -452.194 -45.513 -290.696 120.389 -129.198 0 0 0 2 lb |
|
| 83 |
-99.8351 99.8351 4.40445 217.288 108.644 334.741 0 0 0 2 lb |
|
| 84 |
-99.8351 99.8351 -292.165 214.352 -484.494 328.869 0 0 0 2 lb |
|
| 85 |
120.389 -129.198 -76.8055 -130.099 -274 -131 0 0 0 2 lb |
|
| 86 |
grestore |
|
| 87 |
%Nodes: |
|
| 88 |
gsave |
|
| 89 |
-274 -131 20 1 0 0 nc |
|
| 90 |
-607.82 -246.651 20 1 0 0 nc |
|
| 91 |
-484.494 328.869 20 0 0 1 nc |
|
| 92 |
108.644 334.741 20 0 0 1 nc |
|
| 93 |
120.389 -129.198 20 0 0 1 nc |
|
| 94 |
-99.8351 99.8351 20 1 0 0 nc |
|
| 95 |
-211.415 -452.194 20 1 0 0 nc |
|
| 96 |
-860.344 -29.3633 20 0 0 1 nc |
|
| 97 |
-842.726 243.715 20 0 0 1 nc |
|
| 98 |
399.34 88.0898 20 1 0 0 nc |
|
| 99 |
205.543 -322.996 20 1 0 0 nc |
|
| 100 |
637.183 -184.989 20 0 0 1 nc |
|
| 101 |
79.2808 -528.539 20 0 0 1 nc |
|
| 102 |
-499.175 -499.175 20 0 0 1 nc |
|
| 103 |
-880.898 -528.539 20 0 0 1 nc |
|
| 104 |
-1177.47 -234.906 20 1 0 0 nc |
|
| 105 |
-1077.63 161.498 20 1 0 0 nc |
|
| 106 |
-663.61 546.157 20 1 0 0 nc |
|
| 107 |
-82.2171 593.138 20 0 0 1 nc |
|
| 108 |
596.074 302.442 20 0 0 1 nc |
|
| 109 |
869.153 52.8539 20 1 0 0 nc |
|
| 110 |
393.468 566.711 20 1 0 0 nc |
|
| 111 |
513.857 -446.322 20 1 0 0 nc |
|
| 112 |
grestore |
|
| 113 |
grestore |
|
| 114 |
showpage |
| 1 |
%!PS-Adobe-2.0 EPSF-2.0 |
|
| 2 |
%%Creator: LEMON, graphToEps() |
|
| 3 |
%%CreationDate: Fri Nov 4 13:47:12 2005 |
|
| 4 |
%%BoundingBox: 0 0 842 596 |
|
| 5 |
%%EndComments |
|
| 6 |
/lb { setlinewidth setrgbcolor newpath moveto
|
|
| 7 |
4 2 roll 1 index 1 index curveto stroke } bind def |
|
| 8 |
/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
|
|
| 9 |
/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
|
|
| 10 |
/sq { newpath 2 index 1 index add 2 index 2 index add moveto
|
|
| 11 |
2 index 1 index sub 2 index 2 index add lineto |
|
| 12 |
2 index 1 index sub 2 index 2 index sub lineto |
|
| 13 |
2 index 1 index add 2 index 2 index sub lineto |
|
| 14 |
closepath pop pop pop} bind def |
|
| 15 |
/di { newpath 2 index 1 index add 2 index moveto
|
|
| 16 |
2 index 2 index 2 index add lineto |
|
| 17 |
2 index 1 index sub 2 index lineto |
|
| 18 |
2 index 2 index 2 index sub lineto |
|
| 19 |
closepath pop pop pop} bind def |
|
| 20 |
/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
|
|
| 21 |
setrgbcolor 1.1 div c fill |
|
| 22 |
} bind def |
|
| 23 |
/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
|
|
| 24 |
setrgbcolor 1.1 div sq fill |
|
| 25 |
} bind def |
|
| 26 |
/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
|
|
| 27 |
setrgbcolor 1.1 div di fill |
|
| 28 |
} bind def |
|
| 29 |
/arrl 1 def |
|
| 30 |
/arrw 0.3 def |
|
| 31 |
/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
|
|
| 32 |
/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
|
|
| 33 |
/w exch def /len exch def |
|
| 34 |
newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto |
|
| 35 |
len w sub arrl sub dx dy lrl |
|
| 36 |
arrw dy dx neg lrl |
|
| 37 |
dx arrl w add mul dy w 2 div arrw add mul sub |
|
| 38 |
dy arrl w add mul dx w 2 div arrw add mul add rlineto |
|
| 39 |
dx arrl w add mul neg dy w 2 div arrw add mul sub |
|
| 40 |
dy arrl w add mul neg dx w 2 div arrw add mul add rlineto |
|
| 41 |
arrw dy dx neg lrl |
|
| 42 |
len w sub arrl sub neg dx dy lrl |
|
| 43 |
closepath fill } bind def |
|
| 44 |
/cshow { 2 index 2 index moveto dup stringwidth pop
|
|
| 45 |
neg 2 div fosi .35 mul neg rmoveto show pop pop} def |
|
| 46 |
|
|
| 47 |
gsave |
|
| 48 |
90 rotate |
|
| 49 |
0 -842 translate |
|
| 50 |
71.0944 15 translate |
|
| 51 |
0.434694 dup scale |
|
| 52 |
90 rotate |
|
| 53 |
860.856 -588.349 translate |
|
| 54 |
%Edges: |
|
| 55 |
gsave |
|
| 56 |
574.035 177.301 622.149 225.748 670.264 274.195 0 0 0 2 lb |
|
| 57 |
694.579 115.483 682.421 194.839 670.264 274.195 0 0 0 2 lb |
|
| 58 |
280.402 10.3938 246.402 -6.60595 212.403 -23.6057 0 0 0 2 lb |
|
| 59 |
280.402 10.3938 283.493 -18.9695 286.584 -48.3327 0 0 0 2 lb |
|
| 60 |
212.403 -23.6057 249.493 -35.9692 286.584 -48.3327 0 0 0 2 lb |
|
| 61 |
286.584 -48.3327 326.765 -79.2414 366.947 -110.15 0 0 0 2 lb |
|
| 62 |
286.584 -48.3327 278.857 -111.695 271.13 -175.058 0 0 0 2 lb |
|
| 63 |
438.037 -88.514 417.946 -142.604 397.855 -196.694 0 0 0 2 lb |
|
| 64 |
438.037 -88.514 402.492 -99.332 366.947 -110.15 0 0 0 2 lb |
|
| 65 |
397.855 -196.694 382.401 -153.422 366.947 -110.15 0 0 0 2 lb |
|
| 66 |
366.947 -110.15 319.038 -142.604 271.13 -175.058 0 0 0 2 lb |
|
| 67 |
271.13 -175.058 274.221 -213.694 277.311 -252.33 0 0 0 2 lb |
|
| 68 |
271.13 -175.058 238.675 -190.512 206.221 -205.967 0 0 0 2 lb |
|
| 69 |
277.311 -252.33 241.766 -229.149 206.221 -205.967 0 0 0 2 lb |
|
| 70 |
-840.856 -246.718 -804.351 -66.7145 -767.847 113.289 0 0 0 2 lb |
|
| 71 |
-579.033 445.603 -673.44 279.446 -767.847 113.289 0 0 0 2 lb |
|
| 72 |
-579.033 445.603 -524.906 302.104 -470.779 158.605 0 0 0 2 lb |
|
| 73 |
-767.847 113.289 -619.313 135.947 -470.779 158.605 0 0 0 2 lb |
|
| 74 |
906.312 201.403 946.592 42.798 986.873 -115.807 0 0 0 2 lb |
|
| 75 |
906.312 201.403 834.562 91.8901 762.812 -17.6227 0 0 0 2 lb |
|
| 76 |
986.873 -115.807 874.842 -66.7148 762.812 -17.6227 0 0 0 2 lb |
|
| 77 |
-470.779 158.605 -390.218 50.3508 -309.657 -57.9033 0 0 0 2 lb |
|
| 78 |
422.945 521.129 208.955 541.269 -5.03507 561.41 0 0 0 2 lb |
|
| 79 |
422.945 521.129 376.371 417.911 329.797 314.692 0 0 0 2 lb |
|
| 80 |
422.945 521.129 474.554 276.928 526.164 32.7279 0 0 0 2 lb |
|
| 81 |
-5.03507 561.41 -36.5042 440.568 -67.9734 319.727 0 0 0 2 lb |
|
| 82 |
329.797 314.692 130.912 317.209 -67.9734 319.727 0 0 0 2 lb |
|
| 83 |
-67.9734 319.727 229.095 176.227 526.164 32.7279 0 0 0 2 lb |
|
| 84 |
762.812 -17.6227 644.488 7.5526 526.164 32.7279 0 0 0 2 lb |
|
| 85 |
762.812 -17.6227 746.448 -162.381 730.084 -307.139 0 0 0 2 lb |
|
| 86 |
526.164 32.7279 470.779 -128.394 415.393 -289.516 0 0 0 2 lb |
|
| 87 |
730.084 -307.139 572.738 -298.327 415.393 -289.516 0 0 0 2 lb |
|
| 88 |
415.393 -289.516 173.71 -318.468 -67.9734 -347.42 0 0 0 2 lb |
|
| 89 |
-67.9734 -347.42 -188.815 -202.662 -309.657 -57.9033 0 0 0 2 lb |
|
| 90 |
-67.9734 -347.42 -195.758 -390.692 -323.543 -433.964 0 0 0 2 lb |
|
| 91 |
-309.657 -57.9033 -424.775 -160.272 -539.894 -262.64 0 0 0 2 lb |
|
| 92 |
-323.543 -433.964 -431.719 -348.302 -539.894 -262.64 0 0 0 2 lb |
|
| 93 |
-26.6953 -19.9585 44.8558 -96.8093 116.407 -173.66 0 0 0 2 lb |
|
| 94 |
-26.6953 -19.9585 87.2563 9.19185 201.208 38.3422 0 0 0 2 lb |
|
| 95 |
-26.6953 -19.9585 -144.622 43.6422 -262.548 107.243 0 0 0 2 lb |
|
| 96 |
-26.6953 -19.9585 -20.0703 56.8923 -13.4452 133.743 0 0 0 2 lb |
|
| 97 |
116.407 -173.66 158.808 -67.6589 201.208 38.3422 0 0 0 2 lb |
|
| 98 |
-262.548 107.243 -137.997 120.493 -13.4452 133.743 0 0 0 2 lb |
|
| 99 |
-262.548 107.243 -221.472 176.144 -180.397 245.045 0 0 0 2 lb |
|
| 100 |
-13.4452 133.743 -96.9211 189.394 -180.397 245.045 0 0 0 2 lb |
|
| 101 |
-180.397 245.045 -142.256 345.099 -132.697 451.748 0 0 0 2 lb |
|
| 102 |
-180.397 245.045 -170.838 351.694 -132.697 451.748 0 0 0 2 lb |
|
| 103 |
-416.25 345.746 -274.474 398.747 -132.697 451.748 0 0 0 2 lb |
|
| 104 |
-416.25 345.746 -393.725 457.048 -371.2 568.349 0 0 0 2 lb |
|
| 105 |
-132.697 451.748 -251.948 510.048 -371.2 568.349 0 0 0 2 lb |
|
| 106 |
670.264 274.195 629.188 409.347 588.113 544.499 0 0 0 2 lb |
|
| 107 |
670.264 274.195 797.466 341.771 924.667 409.347 0 0 0 2 lb |
|
| 108 |
588.113 544.499 756.39 476.923 924.667 409.347 0 0 0 2 lb |
|
| 109 |
-689.204 -237.261 -614.799 -102.648 -567.302 43.6423 0 0 0 2 lb |
|
| 110 |
-689.204 -237.261 -641.707 -90.9706 -567.302 43.6423 0 0 0 2 lb |
|
| 111 |
grestore |
|
| 112 |
%Nodes: |
|
| 113 |
gsave |
|
| 114 |
-567.302 43.6423 20 0 0 0 nc |
|
| 115 |
-689.204 -237.261 20 0 0 0 nc |
|
| 116 |
924.667 409.347 20 1 0 0 nc |
|
| 117 |
588.113 544.499 20 1 0 0 nc |
|
| 118 |
670.264 274.195 20 1 0 0 nc |
|
| 119 |
-371.2 568.349 20 0 1 0 nc |
|
| 120 |
-132.697 451.748 20 0 1 0 nc |
|
| 121 |
-416.25 345.746 20 0 1 0 nc |
|
| 122 |
-180.397 245.045 20 0 1 0 nc |
|
| 123 |
-13.4452 133.743 20 0 1 0 nc |
|
| 124 |
-262.548 107.243 20 0 1 0 nc |
|
| 125 |
201.208 38.3422 20 0 1 0 nc |
|
| 126 |
116.407 -173.66 20 0 1 0 nc |
|
| 127 |
-26.6953 -19.9585 20 0 1 0 nc |
|
| 128 |
-539.894 -262.64 20 0 0 1 nc |
|
| 129 |
-323.543 -433.964 20 0 0 1 nc |
|
| 130 |
-309.657 -57.9033 20 0 0 1 nc |
|
| 131 |
-67.9734 -347.42 20 0 0 1 nc |
|
| 132 |
415.393 -289.516 20 0 0 1 nc |
|
| 133 |
730.084 -307.139 20 0 0 1 nc |
|
| 134 |
526.164 32.7279 20 0 0 1 nc |
|
| 135 |
762.812 -17.6227 20 0 0 1 nc |
|
| 136 |
-67.9734 319.727 20 0 0 1 nc |
|
| 137 |
329.797 314.692 20 0 0 1 nc |
|
| 138 |
-5.03507 561.41 20 0 0 1 nc |
|
| 139 |
422.945 521.129 20 0 0 1 nc |
|
| 140 |
-470.779 158.605 20 0 0 1 nc |
|
| 141 |
986.873 -115.807 20 0 0 1 nc |
|
| 142 |
906.312 201.403 20 0 0 1 nc |
|
| 143 |
-767.847 113.289 20 0 0 1 nc |
|
| 144 |
-579.033 445.603 20 0 0 1 nc |
|
| 145 |
-840.856 -246.718 20 0 0 1 nc |
|
| 146 |
206.221 -205.967 20 1 1 0 nc |
|
| 147 |
277.311 -252.33 20 1 1 0 nc |
|
| 148 |
271.13 -175.058 20 1 1 0 nc |
|
| 149 |
366.947 -110.15 20 1 1 0 nc |
|
| 150 |
397.855 -196.694 20 1 1 0 nc |
|
| 151 |
438.037 -88.514 20 1 1 0 nc |
|
| 152 |
286.584 -48.3327 20 1 1 0 nc |
|
| 153 |
212.403 -23.6057 20 1 1 0 nc |
|
| 154 |
280.402 10.3938 20 1 1 0 nc |
|
| 155 |
694.579 115.483 20 1 0 0 nc |
|
| 156 |
574.035 177.301 20 1 0 0 nc |
|
| 157 |
grestore |
|
| 158 |
grestore |
|
| 159 |
showpage |
| 1 |
%!PS-Adobe-2.0 EPSF-2.0 |
|
| 2 |
%%Creator: LEMON, graphToEps() |
|
| 3 |
%%CreationDate: Fri Nov 4 13:47:12 2005 |
|
| 4 |
%%BoundingBox: 0 0 842 596 |
|
| 5 |
%%EndComments |
|
| 6 |
/lb { setlinewidth setrgbcolor newpath moveto
|
|
| 7 |
4 2 roll 1 index 1 index curveto stroke } bind def |
|
| 8 |
/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
|
|
| 9 |
/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
|
|
| 10 |
/sq { newpath 2 index 1 index add 2 index 2 index add moveto
|
|
| 11 |
2 index 1 index sub 2 index 2 index add lineto |
|
| 12 |
2 index 1 index sub 2 index 2 index sub lineto |
|
| 13 |
2 index 1 index add 2 index 2 index sub lineto |
|
| 14 |
closepath pop pop pop} bind def |
|
| 15 |
/di { newpath 2 index 1 index add 2 index moveto
|
|
| 16 |
2 index 2 index 2 index add lineto |
|
| 17 |
2 index 1 index sub 2 index lineto |
|
| 18 |
2 index 2 index 2 index sub lineto |
|
| 19 |
closepath pop pop pop} bind def |
|
| 20 |
/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
|
|
| 21 |
setrgbcolor 1.1 div c fill |
|
| 22 |
} bind def |
|
| 23 |
/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
|
|
| 24 |
setrgbcolor 1.1 div sq fill |
|
| 25 |
} bind def |
|
| 26 |
/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
|
|
| 27 |
setrgbcolor 1.1 div di fill |
|
| 28 |
} bind def |
|
| 29 |
/arrl 1 def |
|
| 30 |
/arrw 0.3 def |
|
| 31 |
/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
|
|
| 32 |
/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
|
|
| 33 |
/w exch def /len exch def |
|
| 34 |
newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto |
|
| 35 |
len w sub arrl sub dx dy lrl |
|
| 36 |
arrw dy dx neg lrl |
|
| 37 |
dx arrl w add mul dy w 2 div arrw add mul sub |
|
| 38 |
dy arrl w add mul dx w 2 div arrw add mul add rlineto |
|
| 39 |
dx arrl w add mul neg dy w 2 div arrw add mul sub |
|
| 40 |
dy arrl w add mul neg dx w 2 div arrw add mul add rlineto |
|
| 41 |
arrw dy dx neg lrl |
|
| 42 |
len w sub arrl sub neg dx dy lrl |
|
| 43 |
closepath fill } bind def |
|
| 44 |
/cshow { 2 index 2 index moveto dup stringwidth pop
|
|
| 45 |
neg 2 div fosi .35 mul neg rmoveto show pop pop} def |
|
| 46 |
|
|
| 47 |
gsave |
|
| 48 |
90 rotate |
|
| 49 |
0 -842 translate |
|
| 50 |
71.0944 15 translate |
|
| 51 |
0.434694 dup scale |
|
| 52 |
90 rotate |
|
| 53 |
860.856 -588.349 translate |
|
| 54 |
%Edges: |
|
| 55 |
gsave |
|
| 56 |
574.035 177.301 622.149 225.748 670.264 274.195 1 0 0 2 lb |
|
| 57 |
694.579 115.483 682.421 194.839 670.264 274.195 1 0 0 2 lb |
|
| 58 |
280.402 10.3938 246.402 -6.60595 212.403 -23.6057 0 0 1 2 lb |
|
| 59 |
280.402 10.3938 283.493 -18.9695 286.584 -48.3327 0 0 1 2 lb |
|
| 60 |
212.403 -23.6057 249.493 -35.9692 286.584 -48.3327 0 0 1 2 lb |
|
| 61 |
286.584 -48.3327 326.765 -79.2414 366.947 -110.15 0 0 1 2 lb |
|
| 62 |
286.584 -48.3327 278.857 -111.695 271.13 -175.058 0 0 1 2 lb |
|
| 63 |
438.037 -88.514 417.946 -142.604 397.855 -196.694 0 0 1 2 lb |
|
| 64 |
438.037 -88.514 402.492 -99.332 366.947 -110.15 0 0 1 2 lb |
|
| 65 |
397.855 -196.694 382.401 -153.422 366.947 -110.15 0 0 1 2 lb |
|
| 66 |
366.947 -110.15 319.038 -142.604 271.13 -175.058 0 0 1 2 lb |
|
| 67 |
271.13 -175.058 274.221 -213.694 277.311 -252.33 0 0 1 2 lb |
|
| 68 |
271.13 -175.058 238.675 -190.512 206.221 -205.967 0 0 1 2 lb |
|
| 69 |
277.311 -252.33 241.766 -229.149 206.221 -205.967 0 0 1 2 lb |
|
| 70 |
-840.856 -246.718 -804.351 -66.7145 -767.847 113.289 1 0 0 2 lb |
|
| 71 |
-579.033 445.603 -673.44 279.446 -767.847 113.289 0 0 1 2 lb |
|
| 72 |
-579.033 445.603 -524.906 302.104 -470.779 158.605 0 0 1 2 lb |
|
| 73 |
-767.847 113.289 -619.313 135.947 -470.779 158.605 0 0 1 2 lb |
|
| 74 |
906.312 201.403 946.592 42.798 986.873 -115.807 0 0 1 2 lb |
|
| 75 |
906.312 201.403 834.562 91.8901 762.812 -17.6227 0 0 1 2 lb |
|
| 76 |
986.873 -115.807 874.842 -66.7148 762.812 -17.6227 0 0 1 2 lb |
|
| 77 |
-470.779 158.605 -390.218 50.3508 -309.657 -57.9033 1 0 0 2 lb |
|
| 78 |
422.945 521.129 208.955 541.269 -5.03507 561.41 0 0 1 2 lb |
|
| 79 |
422.945 521.129 376.371 417.911 329.797 314.692 0 0 1 2 lb |
|
| 80 |
422.945 521.129 474.554 276.928 526.164 32.7279 0 0 1 2 lb |
|
| 81 |
-5.03507 561.41 -36.5042 440.568 -67.9734 319.727 0 0 1 2 lb |
|
| 82 |
329.797 314.692 130.912 317.209 -67.9734 319.727 0 0 1 2 lb |
|
| 83 |
-67.9734 319.727 229.095 176.227 526.164 32.7279 0 0 1 2 lb |
|
| 84 |
762.812 -17.6227 644.488 7.5526 526.164 32.7279 0 0 1 2 lb |
|
| 85 |
762.812 -17.6227 746.448 -162.381 730.084 -307.139 0 0 1 2 lb |
|
| 86 |
526.164 32.7279 470.779 -128.394 415.393 -289.516 0 0 1 2 lb |
|
| 87 |
730.084 -307.139 572.738 -298.327 415.393 -289.516 0 0 1 2 lb |
|
| 88 |
415.393 -289.516 173.71 -318.468 -67.9734 -347.42 1 0 0 2 lb |
|
| 89 |
-67.9734 -347.42 -188.815 -202.662 -309.657 -57.9033 0 0 1 2 lb |
|
| 90 |
-67.9734 -347.42 -195.758 -390.692 -323.543 -433.964 0 0 1 2 lb |
|
| 91 |
-309.657 -57.9033 -424.775 -160.272 -539.894 -262.64 0 0 1 2 lb |
|
| 92 |
-323.543 -433.964 -431.719 -348.302 -539.894 -262.64 0 0 1 2 lb |
|
| 93 |
-26.6953 -19.9585 44.8558 -96.8093 116.407 -173.66 0 0 1 2 lb |
|
| 94 |
-26.6953 -19.9585 87.2563 9.19185 201.208 38.3422 0 0 1 2 lb |
|
| 95 |
-26.6953 -19.9585 -144.622 43.6422 -262.548 107.243 0 0 1 2 lb |
|
| 96 |
-26.6953 -19.9585 -20.0703 56.8923 -13.4452 133.743 0 0 1 2 lb |
|
| 97 |
116.407 -173.66 158.808 -67.6589 201.208 38.3422 0 0 1 2 lb |
|
| 98 |
-262.548 107.243 -137.997 120.493 -13.4452 133.743 0 0 1 2 lb |
|
| 99 |
-262.548 107.243 -221.472 176.144 -180.397 245.045 0 0 1 2 lb |
|
| 100 |
-13.4452 133.743 -96.9211 189.394 -180.397 245.045 0 0 1 2 lb |
|
| 101 |
-180.397 245.045 -142.256 345.099 -132.697 451.748 0 0 1 2 lb |
|
| 102 |
-180.397 245.045 -170.838 351.694 -132.697 451.748 0 0 1 2 lb |
|
| 103 |
-416.25 345.746 -274.474 398.747 -132.697 451.748 0 0 1 2 lb |
|
| 104 |
-416.25 345.746 -393.725 457.048 -371.2 568.349 0 0 1 2 lb |
|
| 105 |
-132.697 451.748 -251.948 510.048 -371.2 568.349 0 0 1 2 lb |
|
| 106 |
670.264 274.195 629.188 409.347 588.113 544.499 0 0 1 2 lb |
|
| 107 |
670.264 274.195 797.466 341.771 924.667 409.347 0 0 1 2 lb |
|
| 108 |
588.113 544.499 756.39 476.923 924.667 409.347 0 0 1 2 lb |
|
| 109 |
-689.204 -237.261 -614.799 -102.648 -567.302 43.6423 0 0 1 2 lb |
|
| 110 |
-689.204 -237.261 -641.707 -90.9706 -567.302 43.6423 0 0 1 2 lb |
|
| 111 |
grestore |
|
| 112 |
%Nodes: |
|
| 113 |
gsave |
|
| 114 |
-567.302 43.6423 20 0 0 0 nc |
|
| 115 |
-689.204 -237.261 20 0 0 0 nc |
|
| 116 |
924.667 409.347 20 0 0 1 nc |
|
| 117 |
588.113 544.499 20 0 0 1 nc |
|
| 118 |
670.264 274.195 20 0 0 1 nc |
|
| 119 |
-371.2 568.349 20 1 1 0 nc |
|
| 120 |
-132.697 451.748 20 1 1 0 nc |
|
| 121 |
-416.25 345.746 20 1 1 0 nc |
|
| 122 |
-180.397 245.045 20 1 1 0 nc |
|
| 123 |
-13.4452 133.743 20 1 1 0 nc |
|
| 124 |
-262.548 107.243 20 1 1 0 nc |
|
| 125 |
201.208 38.3422 20 1 1 0 nc |
|
| 126 |
116.407 -173.66 20 1 1 0 nc |
|
| 127 |
-26.6953 -19.9585 20 1 1 0 nc |
|
| 128 |
-539.894 -262.64 20 0 0.5 0 nc |
|
| 129 |
-323.543 -433.964 20 0 0.5 0 nc |
|
| 130 |
-309.657 -57.9033 20 0 0.5 0 nc |
|
| 131 |
-67.9734 -347.42 20 0 0.5 0 nc |
|
| 132 |
415.393 -289.516 20 0.5 0 0 nc |
|
| 133 |
730.084 -307.139 20 0.5 0 0 nc |
|
| 134 |
526.164 32.7279 20 0.5 0 0 nc |
|
| 135 |
762.812 -17.6227 20 0.5 0 0 nc |
|
| 136 |
-67.9734 319.727 20 0.5 0 0 nc |
|
| 137 |
329.797 314.692 20 0.5 0 0 nc |
|
| 138 |
-5.03507 561.41 20 0.5 0 0 nc |
|
| 139 |
422.945 521.129 20 0.5 0 0 nc |
|
| 140 |
-470.779 158.605 20 0 1 1 nc |
|
| 141 |
986.873 -115.807 20 0.5 0 0 nc |
|
| 142 |
906.312 201.403 20 0.5 0 0 nc |
|
| 143 |
-767.847 113.289 20 0 1 1 nc |
|
| 144 |
-579.033 445.603 20 0 1 1 nc |
|
| 145 |
-840.856 -246.718 20 1 0 1 nc |
|
| 146 |
206.221 -205.967 20 0 0 0.5 nc |
|
| 147 |
277.311 -252.33 20 0 0 0.5 nc |
|
| 148 |
271.13 -175.058 20 0 0 0.5 nc |
|
| 149 |
366.947 -110.15 20 0 0 0.5 nc |
|
| 150 |
397.855 -196.694 20 0 0 0.5 nc |
|
| 151 |
438.037 -88.514 20 0 0 0.5 nc |
|
| 152 |
286.584 -48.3327 20 0 0 0.5 nc |
|
| 153 |
212.403 -23.6057 20 0 0 0.5 nc |
|
| 154 |
280.402 10.3938 20 0 0 0.5 nc |
|
| 155 |
694.579 115.483 20 1 0 0 nc |
|
| 156 |
574.035 177.301 20 0 1 0 nc |
|
| 157 |
grestore |
|
| 158 |
grestore |
|
| 159 |
showpage |
| 1 |
%!PS-Adobe-2.0 EPSF-2.0 |
|
| 2 |
%%Title: Grid undirected graph |
|
| 3 |
%%Copyright: (C) 2006 LEMON Project |
|
| 4 |
%%Creator: LEMON, graphToEps() |
|
| 5 |
%%CreationDate: Fri Sep 29 11:55:56 2006 |
|
| 6 |
%%BoundingBox: 0 0 985 1144 |
|
| 7 |
%%EndComments |
|
| 8 |
/lb { setlinewidth setrgbcolor newpath moveto
|
|
| 9 |
4 2 roll 1 index 1 index curveto stroke } bind def |
|
| 10 |
/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
|
|
| 11 |
/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
|
|
| 12 |
/sq { newpath 2 index 1 index add 2 index 2 index add moveto
|
|
| 13 |
2 index 1 index sub 2 index 2 index add lineto |
|
| 14 |
2 index 1 index sub 2 index 2 index sub lineto |
|
| 15 |
2 index 1 index add 2 index 2 index sub lineto |
|
| 16 |
closepath pop pop pop} bind def |
|
| 17 |
/di { newpath 2 index 1 index add 2 index moveto
|
|
| 18 |
2 index 2 index 2 index add lineto |
|
| 19 |
2 index 1 index sub 2 index lineto |
|
| 20 |
2 index 2 index 2 index sub lineto |
|
| 21 |
closepath pop pop pop} bind def |
|
| 22 |
/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
|
|
| 23 |
setrgbcolor 1.1 div c fill |
|
| 24 |
} bind def |
|
| 25 |
/arrl 1 def |
|
| 26 |
/arrw 0.3 def |
|
| 27 |
/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
|
|
| 28 |
/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
|
|
| 29 |
/w exch def /len exch def |
|
| 30 |
newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto |
|
| 31 |
len w sub arrl sub dx dy lrl |
|
| 32 |
arrw dy dx neg lrl |
|
| 33 |
dx arrl w add mul dy w 2 div arrw add mul sub |
|
| 34 |
dy arrl w add mul dx w 2 div arrw add mul add rlineto |
|
| 35 |
dx arrl w add mul neg dy w 2 div arrw add mul sub |
|
| 36 |
dy arrl w add mul neg dx w 2 div arrw add mul add rlineto |
|
| 37 |
arrw dy dx neg lrl |
|
| 38 |
len w sub arrl sub neg dx dy lrl |
|
| 39 |
closepath fill } bind def |
|
| 40 |
/cshow { 2 index 2 index moveto dup stringwidth pop
|
|
| 41 |
neg 2 div fosi .35 mul neg rmoveto show pop pop} def |
|
| 42 |
|
|
| 43 |
gsave |
|
| 44 |
2 2 scale |
|
| 45 |
50 40 translate |
|
| 46 |
5.5000 5.5000 scale |
|
| 47 |
% 1.14018 1.14018 translate |
|
| 48 |
%Edges: |
|
| 49 |
gsave |
|
| 50 |
70 80 70 90 0 0 0 0.5000 l |
|
| 51 |
70 70 70 80 0 0 0 0.5000 l |
|
| 52 |
70 60 70 70 0 0 0 0.5000 l |
|
| 53 |
70 50 70 60 0 0 0 0.5000 l |
|
| 54 |
70 40 70 50 0 0 0 0.5000 l |
|
| 55 |
70 30 70 40 0 0 0 0.5000 l |
|
| 56 |
70 20 70 30 0 0 0 0.5000 l |
|
| 57 |
70 10 70 20 0 0 0 0.5000 l |
|
| 58 |
70 0 70 10 0 0 0 0.5000 l |
|
| 59 |
60 80 60 90 0 0 0 0.5000 l |
|
| 60 |
60 70 60 80 0 0 0 0.5000 l |
|
| 61 |
60 60 60 70 0 0 0 0.5000 l |
|
| 62 |
60 50 60 60 0 0 0 0.5000 l |
|
| 63 |
60 40 60 50 0 0 0 0.5000 l |
|
| 64 |
60 30 60 40 0 0 0 0.5000 l |
|
| 65 |
60 20 60 30 0 0 0 0.5000 l |
|
| 66 |
60 10 60 20 0 0 0 0.5000 l |
|
| 67 |
60 0 60 10 0 0 0 0.5000 l |
|
| 68 |
50 80 50 90 0 0 0 0.5000 l |
|
| 69 |
50 70 50 80 0 0 0 0.5000 l |
|
| 70 |
50 60 50 70 0 0 0 0.5000 l |
|
| 71 |
50 50 50 60 0 0 0 0.5000 l |
|
| 72 |
50 40 50 50 0 0 0 0.5000 l |
|
| 73 |
50 30 50 40 0 0 0 0.5000 l |
|
| 74 |
50 20 50 30 0 0 0 0.5000 l |
|
| 75 |
50 10 50 20 0 0 0 0.5000 l |
|
| 76 |
50 0 50 10 0 0 0 0.5000 l |
|
| 77 |
40 80 40 90 0 0 0 0.5000 l |
|
| 78 |
40 70 40 80 0 0 0 0.5000 l |
|
| 79 |
40 60 40 70 0 0 0 0.5000 l |
|
| 80 |
40 50 40 60 0 0 0 0.5000 l |
|
| 81 |
40 40 40 50 0 0 0 0.5000 l |
|
| 82 |
40 30 40 40 0 0 0 0.5000 l |
|
| 83 |
40 20 40 30 0 0 0 0.5000 l |
|
| 84 |
40 10 40 20 0 0 0 0.5000 l |
|
| 85 |
40 0 40 10 0 0 0 0.5000 l |
|
| 86 |
30 80 30 90 0 0 0 0.5000 l |
|
| 87 |
30 70 30 80 0 0 0 0.5000 l |
|
| 88 |
30 60 30 70 0 0 0 0.5000 l |
|
| 89 |
30 50 30 60 0 0 0 0.5000 l |
|
| 90 |
30 40 30 50 0 0 0 0.5000 l |
|
| 91 |
30 30 30 40 0 0 0 0.5000 l |
|
| 92 |
30 20 30 30 0 0 0 0.5000 l |
|
| 93 |
30 10 30 20 0 0 0 0.5000 l |
|
| 94 |
30 0 30 10 0 0 0 0.5000 l |
|
| 95 |
20 80 20 90 0 0 0 0.5000 l |
|
| 96 |
20 70 20 80 0 0 0 0.5000 l |
|
| 97 |
20 60 20 70 0 0 0 0.5000 l |
|
| 98 |
20 50 20 60 0 0 0 0.5000 l |
|
| 99 |
20 40 20 50 0 0 0 0.5000 l |
|
| 100 |
20 30 20 40 0 0 0 0.5000 l |
|
| 101 |
20 20 20 30 0 0 0 0.5000 l |
|
| 102 |
20 10 20 20 0 0 0 0.5000 l |
|
| 103 |
20 0 20 10 0 0 0 0.5000 l |
|
| 104 |
10 80 10 90 0 0 0 0.5000 l |
|
| 105 |
10 70 10 80 0 0 0 0.5000 l |
|
| 106 |
10 60 10 70 0 0 0 0.5000 l |
|
| 107 |
10 50 10 60 0 0 0 0.5000 l |
|
| 108 |
10 40 10 50 0 0 0 0.5000 l |
|
| 109 |
10 30 10 40 0 0 0 0.5000 l |
|
| 110 |
10 20 10 30 0 0 0 0.5000 l |
|
| 111 |
10 10 10 20 0 0 0 0.5000 l |
|
| 112 |
10 0 10 10 0 0 0 0.5000 l |
|
| 113 |
0 80 0 90 0 0 0 0.5000 l |
|
| 114 |
0 70 0 80 0 0 0 0.5000 l |
|
| 115 |
0 60 0 70 0 0 0 0.5000 l |
|
| 116 |
0 50 0 60 0 0 0 0.5000 l |
|
| 117 |
0 40 0 50 0 0 0 0.5000 l |
|
| 118 |
0 30 0 40 0 0 0 0.5000 l |
|
| 119 |
0 20 0 30 0 0 0 0.5000 l |
|
| 120 |
0 10 0 20 0 0 0 0.5000 l |
|
| 121 |
0 0 0 10 0 0 0 0.5000 l |
|
| 122 |
60 90 70 90 0 0 0 0.5000 l |
|
| 123 |
60 80 70 80 0 0 0 0.5000 l |
|
| 124 |
60 70 70 70 0 0 0 0.5000 l |
|
| 125 |
60 60 70 60 0 0 0 0.5000 l |
|
| 126 |
60 50 70 50 0 0 0 0.5000 l |
|
| 127 |
60 40 70 40 0 0 0 0.5000 l |
|
| 128 |
60 30 70 30 0 0 0 0.5000 l |
|
| 129 |
60 20 70 20 0 0 0 0.5000 l |
|
| 130 |
60 10 70 10 0 0 0 0.5000 l |
|
| 131 |
60 0 70 0 0 0 0 0.5000 l |
|
| 132 |
50 90 60 90 0 0 0 0.5000 l |
|
| 133 |
50 80 60 80 0 0 0 0.5000 l |
|
| 134 |
50 70 60 70 0 0 0 0.5000 l |
|
| 135 |
50 60 60 60 0 0 0 0.5000 l |
|
| 136 |
50 50 60 50 0 0 0 0.5000 l |
|
| 137 |
50 40 60 40 0 0 0 0.5000 l |
|
| 138 |
50 30 60 30 0 0 0 0.5000 l |
|
| 139 |
50 20 60 20 0 0 0 0.5000 l |
|
| 140 |
50 10 60 10 0 0 0 0.5000 l |
|
| 141 |
50 0 60 0 0 0 0 0.5000 l |
|
| 142 |
40 90 50 90 0 0 0 0.5000 l |
|
| 143 |
40 80 50 80 0 0 0 0.5000 l |
|
| 144 |
40 70 50 70 0 0 0 0.5000 l |
|
| 145 |
40 60 50 60 0 0 0 0.5000 l |
|
| 146 |
40 50 50 50 0 0 0 0.5000 l |
|
| 147 |
40 40 50 40 0 0 0 0.5000 l |
|
| 148 |
40 30 50 30 0 0 0 0.5000 l |
|
| 149 |
40 20 50 20 0 0 0 0.5000 l |
|
| 150 |
40 10 50 10 0 0 0 0.5000 l |
|
| 151 |
40 0 50 0 0 0 0 0.5000 l |
|
| 152 |
30 90 40 90 0 0 0 0.5000 l |
|
| 153 |
30 80 40 80 0 0 0 0.5000 l |
|
| 154 |
30 70 40 70 0 0 0 0.5000 l |
|
| 155 |
30 60 40 60 0 0 0 0.5000 l |
|
| 156 |
30 50 40 50 0 0 0 0.5000 l |
|
| 157 |
30 40 40 40 0 0 0 0.5000 l |
|
| 158 |
30 30 40 30 0 0 0 0.5000 l |
|
| 159 |
30 20 40 20 0 0 0 0.5000 l |
|
| 160 |
30 10 40 10 0 0 0 0.5000 l |
|
| 161 |
30 0 40 0 0 0 0 0.5000 l |
|
| 162 |
20 90 30 90 0 0 0 0.5000 l |
|
| 163 |
20 80 30 80 0 0 0 0.5000 l |
|
| 164 |
20 70 30 70 0 0 0 0.5000 l |
|
| 165 |
20 60 30 60 0 0 0 0.5000 l |
|
| 166 |
20 50 30 50 0 0 0 0.5000 l |
|
| 167 |
20 40 30 40 0 0 0 0.5000 l |
|
| 168 |
20 30 30 30 0 0 0 0.5000 l |
|
| 169 |
20 20 30 20 0 0 0 0.5000 l |
|
| 170 |
20 10 30 10 0 0 0 0.5000 l |
|
| 171 |
20 0 30 0 0 0 0 0.5000 l |
|
| 172 |
10 90 20 90 0 0 0 0.5000 l |
|
| 173 |
10 80 20 80 0 0 0 0.5000 l |
|
| 174 |
10 70 20 70 0 0 0 0.5000 l |
|
| 175 |
10 60 20 60 0 0 0 0.5000 l |
|
| 176 |
10 50 20 50 0 0 0 0.5000 l |
|
| 177 |
10 40 20 40 0 0 0 0.5000 l |
|
| 178 |
10 30 20 30 0 0 0 0.5000 l |
|
| 179 |
10 20 20 20 0 0 0 0.5000 l |
|
| 180 |
10 10 20 10 0 0 0 0.5000 l |
|
| 181 |
10 0 20 0 0 0 0 0.5000 l |
|
| 182 |
0 90 10 90 0 0 0 0.5000 l |
|
| 183 |
0 80 10 80 0 0 0 0.5000 l |
|
| 184 |
0 70 10 70 0 0 0 0.5000 l |
|
| 185 |
0 60 10 60 0 0 0 0.5000 l |
|
| 186 |
0 50 10 50 0 0 0 0.5000 l |
|
| 187 |
0 40 10 40 0 0 0 0.5000 l |
|
| 188 |
0 30 10 30 0 0 0 0.5000 l |
|
| 189 |
0 20 10 20 0 0 0 0.5000 l |
|
| 190 |
0 10 10 10 0 0 0 0.5000 l |
|
| 191 |
0 0 10 0 0 0 0 0.5000 l |
|
| 192 |
grestore |
|
| 193 |
%Nodes: |
|
| 194 |
gsave |
|
| 195 |
70 90 1.4000 0 0 0 nc |
|
| 196 |
70 80 1.4000 1 1 1 nc |
|
| 197 |
70 70 1.4000 1 1 1 nc |
|
| 198 |
70 60 1.4000 1 1 1 nc |
|
| 199 |
70 50 1.4000 1 1 1 nc |
|
| 200 |
70 40 1.4000 1 1 1 nc |
|
| 201 |
70 30 1.4000 1 1 1 nc |
|
| 202 |
70 20 1.4000 1 1 1 nc |
|
| 203 |
70 10 1.4000 1 1 1 nc |
|
| 204 |
70 0 1.4000 0 0 0 nc |
|
| 205 |
60 90 1.4000 1 1 1 nc |
|
| 206 |
60 80 1.4000 1 1 1 nc |
|
| 207 |
60 70 1.4000 1 1 1 nc |
|
| 208 |
60 60 1.4000 1 1 1 nc |
|
| 209 |
60 50 1.4000 1 1 1 nc |
|
| 210 |
60 40 1.4000 1 1 1 nc |
|
| 211 |
60 30 1.4000 1 1 1 nc |
|
| 212 |
60 20 1.4000 1 1 1 nc |
|
| 213 |
60 10 1.4000 1 1 1 nc |
|
| 214 |
60 0 1.4000 1 1 1 nc |
|
| 215 |
50 90 1.4000 1 1 1 nc |
|
| 216 |
50 80 1.4000 1 1 1 nc |
|
| 217 |
50 70 1.4000 1 1 1 nc |
|
| 218 |
50 60 1.4000 1 1 1 nc |
|
| 219 |
50 50 1.4000 1 1 1 nc |
|
| 220 |
50 40 1.4000 1 1 1 nc |
|
| 221 |
50 30 1.4000 1 1 1 nc |
|
| 222 |
50 20 1.4000 1 1 1 nc |
|
| 223 |
50 10 1.4000 1 1 1 nc |
|
| 224 |
50 0 1.4000 1 1 1 nc |
|
| 225 |
40 90 1.4000 1 1 1 nc |
|
| 226 |
40 80 1.4000 1 1 1 nc |
|
| 227 |
40 70 1.4000 1 1 1 nc |
|
| 228 |
40 60 1.4000 1 1 1 nc |
|
| 229 |
40 50 1.4000 1 1 1 nc |
|
| 230 |
40 40 1.4000 1 1 1 nc |
|
| 231 |
40 30 1.4000 1 1 1 nc |
|
| 232 |
40 20 1.4000 1 1 1 nc |
|
| 233 |
40 10 1.4000 1 1 1 nc |
|
| 234 |
40 0 1.4000 1 1 1 nc |
|
| 235 |
30 90 1.4000 1 1 1 nc |
|
| 236 |
30 80 1.4000 1 1 1 nc |
|
| 237 |
30 70 1.4000 1 1 1 nc |
|
| 238 |
30 60 1.4000 1 1 1 nc |
|
| 239 |
30 50 1.4000 1 1 1 nc |
|
| 240 |
30 40 1.4000 1 1 1 nc |
|
| 241 |
30 30 1.4000 1 1 1 nc |
|
| 242 |
30 20 1.4000 1 1 1 nc |
|
| 243 |
30 10 1.4000 1 1 1 nc |
|
| 244 |
30 0 1.4000 1 1 1 nc |
|
| 245 |
20 90 1.4000 1 1 1 nc |
|
| 246 |
20 80 1.4000 1 1 1 nc |
|
| 247 |
20 70 1.4000 1 1 1 nc |
|
| 248 |
20 60 1.4000 1 1 1 nc |
|
| 249 |
20 50 1.4000 1 1 1 nc |
|
| 250 |
20 40 1.4000 1 1 1 nc |
|
| 251 |
20 30 1.4000 1 1 1 nc |
|
| 252 |
20 20 1.4000 1 1 1 nc |
|
| 253 |
20 10 1.4000 1 1 1 nc |
|
| 254 |
20 0 1.4000 1 1 1 nc |
|
| 255 |
10 90 1.4000 1 1 1 nc |
|
| 256 |
10 80 1.4000 1 1 1 nc |
|
| 257 |
10 70 1.4000 1 1 1 nc |
|
| 258 |
10 60 1.4000 1 1 1 nc |
|
| 259 |
10 50 1.4000 1 1 1 nc |
|
| 260 |
10 40 1.4000 1 1 1 nc |
|
| 261 |
10 30 1.4000 1 1 1 nc |
|
| 262 |
10 20 1.4000 1 1 1 nc |
|
| 263 |
10 10 1.4000 1 1 1 nc |
|
| 264 |
10 0 1.4000 1 1 1 nc |
|
| 265 |
0 90 1.4000 0 0 0 nc |
|
| 266 |
0 80 1.4000 1 1 1 nc |
|
| 267 |
0 70 1.4000 1 1 1 nc |
|
| 268 |
0 60 1.4000 1 1 1 nc |
|
| 269 |
0 50 1.4000 1 1 1 nc |
|
| 270 |
0 40 1.4000 1 1 1 nc |
|
| 271 |
0 30 1.4000 1 1 1 nc |
|
| 272 |
0 20 1.4000 1 1 1 nc |
|
| 273 |
0 10 1.4000 1 1 1 nc |
|
| 274 |
0 0 1.4000 0 0 0 nc |
|
| 275 |
grestore |
|
| 276 |
gsave |
|
| 277 |
/fosi 3.5 def |
|
| 278 |
(Helvetica) findfont fosi scalefont setfont |
|
| 279 |
0 0 0 setrgbcolor |
|
| 280 |
0 95 ((0,height-1)) cshow |
|
| 281 |
67 95 ((width-1,height-1)) cshow |
|
| 282 |
0 -5 ((0,0)) cshow |
|
| 283 |
70 -5 ((width-1,0)) cshow |
|
| 284 |
grestore |
|
| 285 |
grestore |
|
| 286 |
showpage |
| 1 |
%!PS-Adobe-2.0 EPSF-2.0 |
|
| 2 |
%%Creator: LEMON, graphToEps() |
|
| 3 |
%%CreationDate: Fri Nov 4 13:47:12 2005 |
|
| 4 |
%%BoundingBox: 0 0 842 596 |
|
| 5 |
%%EndComments |
|
| 6 |
/lb { setlinewidth setrgbcolor newpath moveto
|
|
| 7 |
4 2 roll 1 index 1 index curveto stroke } bind def |
|
| 8 |
/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
|
|
| 9 |
/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
|
|
| 10 |
/sq { newpath 2 index 1 index add 2 index 2 index add moveto
|
|
| 11 |
2 index 1 index sub 2 index 2 index add lineto |
|
| 12 |
2 index 1 index sub 2 index 2 index sub lineto |
|
| 13 |
2 index 1 index add 2 index 2 index sub lineto |
|
| 14 |
closepath pop pop pop} bind def |
|
| 15 |
/di { newpath 2 index 1 index add 2 index moveto
|
|
| 16 |
2 index 2 index 2 index add lineto |
|
| 17 |
2 index 1 index sub 2 index lineto |
|
| 18 |
2 index 2 index 2 index sub lineto |
|
| 19 |
closepath pop pop pop} bind def |
|
| 20 |
/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
|
|
| 21 |
setrgbcolor 1.1 div c fill |
|
| 22 |
} bind def |
|
| 23 |
/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
|
|
| 24 |
setrgbcolor 1.1 div sq fill |
|
| 25 |
} bind def |
|
| 26 |
/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
|
|
| 27 |
setrgbcolor 1.1 div di fill |
|
| 28 |
} bind def |
|
| 29 |
/arrl 1 def |
|
| 30 |
/arrw 0.3 def |
|
| 31 |
/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
|
|
| 32 |
/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
|
|
| 33 |
/w exch def /len exch def |
|
| 34 |
newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto |
|
| 35 |
len w sub arrl sub dx dy lrl |
|
| 36 |
arrw dy dx neg lrl |
|
| 37 |
dx arrl w add mul dy w 2 div arrw add mul sub |
|
| 38 |
dy arrl w add mul dx w 2 div arrw add mul add rlineto |
|
| 39 |
dx arrl w add mul neg dy w 2 div arrw add mul sub |
|
| 40 |
dy arrl w add mul neg dx w 2 div arrw add mul add rlineto |
|
| 41 |
arrw dy dx neg lrl |
|
| 42 |
len w sub arrl sub neg dx dy lrl |
|
| 43 |
closepath fill } bind def |
|
| 44 |
/cshow { 2 index 2 index moveto dup stringwidth pop
|
|
| 45 |
neg 2 div fosi .35 mul neg rmoveto show pop pop} def |
|
| 46 |
|
|
| 47 |
gsave |
|
| 48 |
90 rotate |
|
| 49 |
0 -842 translate |
|
| 50 |
71.0944 15 translate |
|
| 51 |
0.434694 dup scale |
|
| 52 |
90 rotate |
|
| 53 |
860.856 -588.349 translate |
|
| 54 |
%Edges: |
|
| 55 |
gsave |
|
| 56 |
574.035 177.301 622.149 225.748 670.264 274.195 0 1 0 5 lb |
|
| 57 |
694.579 115.483 682.421 194.839 670.264 274.195 1 0 0 5 lb |
|
| 58 |
280.402 10.3938 246.402 -6.60595 212.403 -23.6057 1 1 0.5 5 lb |
|
| 59 |
280.402 10.3938 283.493 -18.9695 286.584 -48.3327 1 1 0.5 5 lb |
|
| 60 |
212.403 -23.6057 249.493 -35.9692 286.584 -48.3327 1 1 0.5 5 lb |
|
| 61 |
286.584 -48.3327 326.765 -79.2414 366.947 -110.15 1 0.5 1 5 lb |
|
| 62 |
286.584 -48.3327 278.857 -111.695 271.13 -175.058 1 0.5 1 5 lb |
|
| 63 |
438.037 -88.514 417.946 -142.604 397.855 -196.694 0.5 0.5 1 5 lb |
|
| 64 |
438.037 -88.514 402.492 -99.332 366.947 -110.15 0.5 0.5 1 5 lb |
|
| 65 |
397.855 -196.694 382.401 -153.422 366.947 -110.15 0.5 0.5 1 5 lb |
|
| 66 |
366.947 -110.15 319.038 -142.604 271.13 -175.058 1 0.5 1 5 lb |
|
| 67 |
271.13 -175.058 274.221 -213.694 277.311 -252.33 0.5 1 1 5 lb |
|
| 68 |
271.13 -175.058 238.675 -190.512 206.221 -205.967 0.5 1 1 5 lb |
|
| 69 |
277.311 -252.33 241.766 -229.149 206.221 -205.967 0.5 1 1 5 lb |
|
| 70 |
-840.856 -246.718 -804.351 -66.7145 -767.847 113.289 0 0.5 0 5 lb |
|
| 71 |
-579.033 445.603 -673.44 279.446 -767.847 113.289 0 0 0.5 5 lb |
|
| 72 |
-579.033 445.603 -524.906 302.104 -470.779 158.605 0 0 0.5 5 lb |
|
| 73 |
-767.847 113.289 -619.313 135.947 -470.779 158.605 0 0 0.5 5 lb |
|
| 74 |
906.312 201.403 946.592 42.798 986.873 -115.807 0 0.5 0.5 5 lb |
|
| 75 |
906.312 201.403 834.562 91.8901 762.812 -17.6227 0 0.5 0.5 5 lb |
|
| 76 |
986.873 -115.807 874.842 -66.7148 762.812 -17.6227 0 0.5 0.5 5 lb |
|
| 77 |
-470.779 158.605 -390.218 50.3508 -309.657 -57.9033 0.5 0.5 0 5 lb |
|
| 78 |
422.945 521.129 208.955 541.269 -5.03507 561.41 0.5 0 0.5 5 lb |
|
| 79 |
422.945 521.129 376.371 417.911 329.797 314.692 0.5 0 0.5 5 lb |
|
| 80 |
422.945 521.129 474.554 276.928 526.164 32.7279 0.5 0 0.5 5 lb |
|
| 81 |
-5.03507 561.41 -36.5042 440.568 -67.9734 319.727 0.5 0 0.5 5 lb |
|
| 82 |
329.797 314.692 130.912 317.209 -67.9734 319.727 0.5 0 0.5 5 lb |
|
| 83 |
-67.9734 319.727 229.095 176.227 526.164 32.7279 0.5 0 0.5 5 lb |
|
| 84 |
762.812 -17.6227 644.488 7.5526 526.164 32.7279 0.5 0.5 0.5 5 lb |
|
| 85 |
762.812 -17.6227 746.448 -162.381 730.084 -307.139 0.5 0.5 0.5 5 lb |
|
| 86 |
526.164 32.7279 470.779 -128.394 415.393 -289.516 0.5 0.5 0.5 5 lb |
|
| 87 |
730.084 -307.139 572.738 -298.327 415.393 -289.516 0.5 0.5 0.5 5 lb |
|
| 88 |
415.393 -289.516 173.71 -318.468 -67.9734 -347.42 1 0.5 0.5 5 lb |
|
| 89 |
-67.9734 -347.42 -188.815 -202.662 -309.657 -57.9033 0.5 1 0.5 5 lb |
|
| 90 |
-67.9734 -347.42 -195.758 -390.692 -323.543 -433.964 0.5 1 0.5 5 lb |
|
| 91 |
-309.657 -57.9033 -424.775 -160.272 -539.894 -262.64 0.5 1 0.5 5 lb |
|
| 92 |
-323.543 -433.964 -431.719 -348.302 -539.894 -262.64 0.5 1 0.5 5 lb |
|
| 93 |
-26.6953 -19.9585 44.8558 -96.8093 116.407 -173.66 1 1 0 5 lb |
|
| 94 |
-26.6953 -19.9585 87.2563 9.19185 201.208 38.3422 1 1 0 5 lb |
|
| 95 |
-26.6953 -19.9585 -144.622 43.6422 -262.548 107.243 1 0 1 5 lb |
|
| 96 |
-26.6953 -19.9585 -20.0703 56.8923 -13.4452 133.743 1 0 1 5 lb |
|
| 97 |
116.407 -173.66 158.808 -67.6589 201.208 38.3422 1 1 0 5 lb |
|
| 98 |
-262.548 107.243 -137.997 120.493 -13.4452 133.743 1 0 1 5 lb |
|
| 99 |
-262.548 107.243 -221.472 176.144 -180.397 245.045 1 0 1 5 lb |
|
| 100 |
-13.4452 133.743 -96.9211 189.394 -180.397 245.045 1 0 1 5 lb |
|
| 101 |
-180.397 245.045 -140.307 344.649 -132.697 451.748 0 1 1 5 lb |
|
| 102 |
-180.397 245.045 -172.787 352.144 -132.697 451.748 0 1 1 5 lb |
|
| 103 |
-416.25 345.746 -274.474 398.747 -132.697 451.748 0.5 0 0 5 lb |
|
| 104 |
-416.25 345.746 -393.725 457.048 -371.2 568.349 0.5 0 0 5 lb |
|
| 105 |
-132.697 451.748 -251.948 510.048 -371.2 568.349 0.5 0 0 5 lb |
|
| 106 |
670.264 274.195 629.188 409.347 588.113 544.499 0 0 1 5 lb |
|
| 107 |
670.264 274.195 797.466 341.771 924.667 409.347 0 0 1 5 lb |
|
| 108 |
588.113 544.499 756.39 476.923 924.667 409.347 0 0 1 5 lb |
|
| 109 |
-689.204 -237.261 -612.964 -103.444 -567.302 43.6423 0 0 0 5 lb |
|
| 110 |
-689.204 -237.261 -643.542 -90.1744 -567.302 43.6423 0 0 0 5 lb |
|
| 111 |
grestore |
|
| 112 |
%Nodes: |
|
| 113 |
gsave |
|
| 114 |
-567.302 43.6423 20 0 0 1 nc |
|
| 115 |
-689.204 -237.261 20 0 0 1 nc |
|
| 116 |
924.667 409.347 20 0 0 1 nc |
|
| 117 |
588.113 544.499 20 0 0 1 nc |
|
| 118 |
670.264 274.195 20 1 0 0 nc |
|
| 119 |
-371.2 568.349 20 0 0 1 nc |
|
| 120 |
-132.697 451.748 20 1 0 0 nc |
|
| 121 |
-416.25 345.746 20 0 0 1 nc |
|
| 122 |
-180.397 245.045 20 1 0 0 nc |
|
| 123 |
-13.4452 133.743 20 0 0 1 nc |
|
| 124 |
-262.548 107.243 20 0 0 1 nc |
|
| 125 |
201.208 38.3422 20 0 0 1 nc |
|
| 126 |
116.407 -173.66 20 0 0 1 nc |
|
| 127 |
-26.6953 -19.9585 20 1 0 0 nc |
|
| 128 |
-539.894 -262.64 20 0 0 1 nc |
|
| 129 |
-323.543 -433.964 20 0 0 1 nc |
|
| 130 |
-309.657 -57.9033 20 1 0 0 nc |
|
| 131 |
-67.9734 -347.42 20 1 0 0 nc |
|
| 132 |
415.393 -289.516 20 1 0 0 nc |
|
| 133 |
730.084 -307.139 20 0 0 1 nc |
|
| 134 |
526.164 32.7279 20 1 0 0 nc |
|
| 135 |
762.812 -17.6227 20 1 0 0 nc |
|
| 136 |
-67.9734 319.727 20 0 0 1 nc |
|
| 137 |
329.797 314.692 20 0 0 1 nc |
|
| 138 |
-5.03507 561.41 20 0 0 1 nc |
|
| 139 |
422.945 521.129 20 0 0 1 nc |
|
| 140 |
-470.779 158.605 20 1 0 0 nc |
|
| 141 |
986.873 -115.807 20 0 0 1 nc |
|
| 142 |
906.312 201.403 20 0 0 1 nc |
|
| 143 |
-767.847 113.289 20 1 0 0 nc |
|
| 144 |
-579.033 445.603 20 0 0 1 nc |
|
| 145 |
-840.856 -246.718 20 0 0 1 nc |
|
| 146 |
206.221 -205.967 20 0 0 1 nc |
|
| 147 |
277.311 -252.33 20 0 0 1 nc |
|
| 148 |
271.13 -175.058 20 1 0 0 nc |
|
| 149 |
366.947 -110.15 20 1 0 0 nc |
|
| 150 |
397.855 -196.694 20 0 0 1 nc |
|
| 151 |
438.037 -88.514 20 0 0 1 nc |
|
| 152 |
286.584 -48.3327 20 1 0 0 nc |
|
| 153 |
212.403 -23.6057 20 0 0 1 nc |
|
| 154 |
280.402 10.3938 20 0 0 1 nc |
|
| 155 |
694.579 115.483 20 0 0 1 nc |
|
| 156 |
574.035 177.301 20 0 0 1 nc |
|
| 157 |
grestore |
|
| 158 |
grestore |
|
| 159 |
showpage |
| 1 |
%!PS-Adobe-2.0 EPSF-2.0 |
|
| 2 |
%%Creator: LEMON, graphToEps() |
|
| 3 |
%%CreationDate: Fri Nov 4 13:47:12 2005 |
|
| 4 |
%%BoundingBox: 0 0 842 596 |
|
| 5 |
%%EndComments |
|
| 6 |
/lb { setlinewidth setrgbcolor newpath moveto
|
|
| 7 |
4 2 roll 1 index 1 index curveto stroke } bind def |
|
| 8 |
/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
|
|
| 9 |
/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
|
|
| 10 |
/sq { newpath 2 index 1 index add 2 index 2 index add moveto
|
|
| 11 |
2 index 1 index sub 2 index 2 index add lineto |
|
| 12 |
2 index 1 index sub 2 index 2 index sub lineto |
|
| 13 |
2 index 1 index add 2 index 2 index sub lineto |
|
| 14 |
closepath pop pop pop} bind def |
|
| 15 |
/di { newpath 2 index 1 index add 2 index moveto
|
|
| 16 |
2 index 2 index 2 index add lineto |
|
| 17 |
2 index 1 index sub 2 index lineto |
|
| 18 |
2 index 2 index 2 index sub lineto |
|
| 19 |
closepath pop pop pop} bind def |
|
| 20 |
/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
|
|
| 21 |
setrgbcolor 1.1 div c fill |
|
| 22 |
} bind def |
|
| 23 |
/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
|
|
| 24 |
setrgbcolor 1.1 div sq fill |
|
| 25 |
} bind def |
|
| 26 |
/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
|
|
| 27 |
setrgbcolor 1.1 div di fill |
|
| 28 |
} bind def |
|
| 29 |
/arrl 10 def |
|
| 30 |
/arrw 3 def |
|
| 31 |
/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
|
|
| 32 |
/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
|
|
| 33 |
/w exch def /len exch def |
|
| 34 |
newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto |
|
| 35 |
len w sub arrl sub dx dy lrl |
|
| 36 |
arrw dy dx neg lrl |
|
| 37 |
dx arrl w add mul dy w 2 div arrw add mul sub |
|
| 38 |
dy arrl w add mul dx w 2 div arrw add mul add rlineto |
|
| 39 |
dx arrl w add mul neg dy w 2 div arrw add mul sub |
|
| 40 |
dy arrl w add mul neg dx w 2 div arrw add mul add rlineto |
|
| 41 |
arrw dy dx neg lrl |
|
| 42 |
len w sub arrl sub neg dx dy lrl |
|
| 43 |
closepath fill } bind def |
|
| 44 |
/cshow { 2 index 2 index moveto dup stringwidth pop
|
|
| 45 |
neg 2 div fosi .35 mul neg rmoveto show pop pop} def |
|
| 46 |
|
|
| 47 |
gsave |
|
| 48 |
90 rotate |
|
| 49 |
0 -842 translate |
|
| 50 |
77.1122 15 translate |
|
| 51 |
0.585745 dup scale |
|
| 52 |
90 rotate |
|
| 53 |
695.963 -397.916 translate |
|
| 54 |
%Edges: |
|
| 55 |
gsave |
|
| 56 |
2 setlinewidth 0 0 1 setrgbcolor newpath |
|
| 57 |
218.178 27.2723 moveto |
|
| 58 |
192.373 -40.1551 188.622 -49.9556 169.228 -100.631 curveto stroke |
|
| 59 |
newpath 164.939 -111.838 moveto 165.492 -99.2013 lineto 172.964 -102.061 lineto closepath fill |
|
| 60 |
2 setlinewidth 0 0 1 setrgbcolor newpath |
|
| 61 |
44.8044 15.5841 moveto |
|
| 62 |
119.293 20.6059 129.775 21.3125 186.25 25.1199 curveto stroke |
|
| 63 |
newpath 198.223 25.927 moveto 186.519 21.1289 lineto 185.981 29.1108 lineto closepath fill |
|
| 64 |
2 setlinewidth 1 0 0 setrgbcolor newpath |
|
| 65 |
218.178 27.2723 moveto |
|
| 66 |
285.395 -87.4449 290.763 -96.6058 348.102 -194.464 curveto stroke |
|
| 67 |
newpath 354.169 -204.818 moveto 344.651 -196.487 lineto 351.554 -192.442 lineto closepath fill |
|
| 68 |
2 setlinewidth 0 0 1 setrgbcolor newpath |
|
| 69 |
157.79 -130.517 moveto |
|
| 70 |
108.71 -67.0521 102.27 -58.7243 64.3804 -9.72954 curveto stroke |
|
| 71 |
newpath 57.0394 -0.236898 moveto 67.5446 -7.28254 lineto 61.2162 -12.1765 lineto closepath fill |
|
| 72 |
2 setlinewidth 1 0 0 setrgbcolor newpath |
|
| 73 |
-105.193 -261.035 moveto |
|
| 74 |
-35.6576 -132.801 -30.5923 -123.459 29.5506 -12.5464 curveto stroke |
|
| 75 |
newpath 35.2708 -1.99743 moveto 33.0669 -14.4531 lineto 26.0343 -10.6397 lineto closepath fill |
|
| 76 |
2 setlinewidth 0 0 1 setrgbcolor newpath |
|
| 77 |
-465.576 -42.8564 moveto |
|
| 78 |
-559.078 -25.5413 -569.47 -23.6169 -644.498 -9.72286 curveto stroke |
|
| 79 |
newpath -656.297 -7.5378 moveto -643.77 -5.78973 lineto -645.226 -13.656 lineto closepath fill |
|
| 80 |
2 setlinewidth 0 0 1 setrgbcolor newpath |
|
| 81 |
-574.666 -153.893 moveto |
|
| 82 |
-528.842 -107.252 -521.515 -99.794 -488.002 -65.683 curveto stroke |
|
| 83 |
newpath -479.592 -57.123 moveto -485.149 -68.4863 lineto -490.856 -62.8797 lineto closepath fill |
|
| 84 |
2 setlinewidth 1 0 0 setrgbcolor newpath |
|
| 85 |
-490.901 120.777 moveto |
|
| 86 |
-480.122 51.1328 -478.519 40.7713 -470.47 -11.2329 curveto stroke |
|
| 87 |
newpath -468.635 -23.0917 moveto -474.423 -11.8447 lineto -466.517 -10.6212 lineto closepath fill |
|
| 88 |
2 setlinewidth 0 0 1 setrgbcolor newpath |
|
| 89 |
-675.963 -3.89604 moveto |
|
| 90 |
-632.116 -68.8235 -626.228 -77.5422 -592.575 -127.374 curveto stroke |
|
| 91 |
newpath -585.859 -137.319 moveto -595.89 -129.612 lineto -589.26 -125.135 lineto closepath fill |
|
| 92 |
2 setlinewidth 0 0 1 setrgbcolor newpath |
|
| 93 |
-490.901 120.777 moveto |
|
| 94 |
-435.445 215.844 -430.107 224.995 -384.3 303.522 curveto stroke |
|
| 95 |
newpath -378.253 313.887 moveto -380.845 301.507 lineto -387.755 305.537 lineto closepath fill |
|
| 96 |
2 setlinewidth 0 0 1 setrgbcolor newpath |
|
| 97 |
-266.879 114.933 moveto |
|
| 98 |
-367.067 117.547 -377.642 117.822 -458.912 119.943 curveto stroke |
|
| 99 |
newpath -470.908 120.255 moveto -458.807 123.941 lineto -459.016 115.944 lineto closepath fill |
|
| 100 |
2 setlinewidth 0 0 1 setrgbcolor newpath |
|
| 101 |
-368.176 331.163 moveto |
|
| 102 |
-322.511 233.685 -318.018 224.095 -280.454 143.911 curveto stroke |
|
| 103 |
newpath -275.364 133.044 moveto -284.076 142.214 lineto -276.832 145.608 lineto closepath fill |
|
| 104 |
2 setlinewidth 1 0 0 setrgbcolor newpath |
|
| 105 |
-266.879 114.933 moveto |
|
| 106 |
-224.004 235.52 -220.448 245.52 -184.094 347.765 curveto stroke |
|
| 107 |
newpath -180.074 359.072 moveto -180.325 346.425 lineto -187.863 349.105 lineto closepath fill |
|
| 108 |
2 setlinewidth 0 0 1 setrgbcolor newpath |
|
| 109 |
-251.294 -335.059 moveto |
|
| 110 |
-189.25 -303.624 -179.902 -298.887 -133.738 -275.498 curveto stroke |
|
| 111 |
newpath -123.034 -270.074 moveto -131.93 -279.066 lineto -135.546 -271.93 lineto closepath fill |
|
| 112 |
2 setlinewidth 0 0 1 setrgbcolor newpath |
|
| 113 |
-389.604 -136.361 moveto |
|
| 114 |
-327.15 -226.083 -321.098 -234.777 -269.576 -308.795 curveto stroke |
|
| 115 |
newpath -262.72 -318.644 moveto -272.859 -311.081 lineto -266.293 -306.51 lineto closepath fill |
|
| 116 |
2 setlinewidth 1 0 0 setrgbcolor newpath |
|
| 117 |
5.84406 175.322 moveto |
|
| 118 |
-76.0754 267.926 -83.1051 275.873 -152.172 353.948 curveto stroke |
|
| 119 |
newpath -160.122 362.936 moveto -149.176 356.598 lineto -155.168 351.298 lineto closepath fill |
|
| 120 |
2 setlinewidth 0 0 1 setrgbcolor newpath |
|
| 121 |
169.478 311.683 moveto |
|
| 122 |
96.8003 251.119 88.6819 244.353 30.4273 195.808 curveto stroke |
|
| 123 |
newpath 21.2086 188.126 moveto 27.8666 198.881 lineto 32.988 192.735 lineto closepath fill |
|
| 124 |
2 setlinewidth 0 0 1 setrgbcolor newpath |
|
| 125 |
342.851 111.037 moveto |
|
| 126 |
263.766 202.563 256.831 210.589 190.4 287.47 curveto stroke |
|
| 127 |
newpath 182.554 296.55 moveto 193.427 290.085 lineto 187.373 284.855 lineto closepath fill |
|
| 128 |
2 setlinewidth 0 0 1 setrgbcolor newpath |
|
| 129 |
5.84406 175.322 moveto |
|
| 130 |
163.16 145.314 173.605 143.321 311.418 117.033 curveto stroke |
|
| 131 |
newpath 323.205 114.784 moveto 310.668 113.104 lineto 312.167 120.962 lineto closepath fill |
|
| 132 |
2 setlinewidth 0 0 1 setrgbcolor newpath |
|
| 133 |
342.851 111.037 moveto |
|
| 134 |
497.255 2.58683 505.964 -3.53033 643.932 -100.436 curveto stroke |
|
| 135 |
newpath 653.752 -107.334 moveto 641.633 -103.71 lineto 646.231 -97.163 lineto closepath fill |
|
| 136 |
2 setlinewidth 0 0 1 setrgbcolor newpath |
|
| 137 |
364.28 -222.074 moveto |
|
| 138 |
354.298 -66.9063 353.616 -56.2971 344.905 79.1029 curveto stroke |
|
| 139 |
newpath 344.135 91.0781 moveto 348.897 79.3597 lineto 340.914 78.8461 lineto closepath fill |
|
| 140 |
2 setlinewidth 0 0 1 setrgbcolor newpath |
|
| 141 |
670.118 -118.829 moveto |
|
| 142 |
528.037 -166.793 517.967 -170.192 394.599 -211.839 curveto stroke |
|
| 143 |
newpath 383.229 -215.677 moveto 393.32 -208.049 lineto 395.878 -215.629 lineto closepath fill |
|
| 144 |
2 setlinewidth 1 0 0 setrgbcolor newpath |
|
| 145 |
-105.193 -261.035 moveto |
|
| 146 |
118.401 -242.479 129.015 -241.598 332.39 -224.721 curveto stroke |
|
| 147 |
newpath 344.348 -223.728 moveto 332.72 -228.707 lineto 332.059 -220.734 lineto closepath fill |
|
| 148 |
2 setlinewidth 0 0 1 setrgbcolor newpath |
|
| 149 |
-105.193 -261.035 moveto |
|
| 150 |
-160.867 -161.176 -166.028 -151.918 -212.336 -68.858 curveto stroke |
|
| 151 |
newpath -218.179 -58.3769 moveto -208.842 -66.9102 lineto -215.829 -70.8058 lineto closepath fill |
|
| 152 |
2 setlinewidth 0 0 1 setrgbcolor newpath |
|
| 153 |
-227.918 -40.9084 moveto |
|
| 154 |
-298.35 -82.4884 -307.42 -87.8432 -362.048 -120.093 curveto stroke |
|
| 155 |
newpath -372.381 -126.193 moveto -364.081 -116.648 lineto -360.014 -123.537 lineto closepath fill |
|
| 156 |
grestore |
|
| 157 |
%Nodes: |
|
| 158 |
gsave |
|
| 159 |
-389.604 -136.361 20 0 1 0 nc |
|
| 160 |
-227.918 -40.9084 20 0 1 0 nc |
|
| 161 |
-105.193 -261.035 20 0 1 0 nc |
|
| 162 |
364.28 -222.074 20 1 1 0 nc |
|
| 163 |
670.118 -118.829 20 1 1 0 nc |
|
| 164 |
342.851 111.037 20 1 1 0 nc |
|
| 165 |
5.84406 175.322 20 1 1 0 nc |
|
| 166 |
169.478 311.683 20 1 1 0 nc |
|
| 167 |
-173.374 377.916 20 1 0 1 nc |
|
| 168 |
-251.294 -335.059 20 0 1 0 nc |
|
| 169 |
-266.879 114.933 20 0 0 0 nc |
|
| 170 |
-368.176 331.163 20 0 0 0 nc |
|
| 171 |
-490.901 120.777 20 0 0 0 nc |
|
| 172 |
-574.666 -153.893 20 1 0 0 nc |
|
| 173 |
-675.963 -3.89604 20 1 0 0 nc |
|
| 174 |
-465.576 -42.8564 20 1 0 0 nc |
|
| 175 |
44.8044 15.5841 20 0 0 1 nc |
|
| 176 |
157.79 -130.517 20 0 0 1 nc |
|
| 177 |
218.178 27.2723 20 0 0 1 nc |
|
| 178 |
grestore |
|
| 179 |
grestore |
|
| 180 |
showpage |
| 1 |
/* -*- mode: C++; indent-tabs-mode: nil; -*- |
|
| 2 |
* |
|
| 3 |
* This file is a part of LEMON, a generic C++ optimization library. |
|
| 4 |
* |
|
| 5 |
* Copyright (C) 2003-2009 |
|
| 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
|
| 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
|
| 8 |
* |
|
| 9 |
* Permission to use, modify and distribute this software is granted |
|
| 10 |
* provided that this copyright notice appears in all copies. For |
|
| 11 |
* precise terms see the accompanying LICENSE file. |
|
| 12 |
* |
|
| 13 |
* This software is provided "AS IS" with no warranty of any kind, |
|
| 14 |
* express or implied, and with no claim as to its suitability for any |
|
| 15 |
* purpose. |
|
| 16 |
* |
|
| 17 |
*/ |
|
| 18 |
|
|
| 19 |
namespace lemon {
|
|
| 20 |
|
|
| 21 |
/** |
|
| 22 |
\page min_cost_flow Minimum Cost Flow Problem |
|
| 23 |
|
|
| 24 |
\section mcf_def Definition (GEQ form) |
|
| 25 |
|
|
| 26 |
The \e minimum \e cost \e flow \e problem is to find a feasible flow of |
|
| 27 |
minimum total cost from a set of supply nodes to a set of demand nodes |
|
| 28 |
in a network with capacity constraints (lower and upper bounds) |
|
| 29 |
and arc costs \ref amo93networkflows. |
|
| 30 |
|
|
| 31 |
Formally, let \f$G=(V,A)\f$ be a digraph, \f$lower: A\rightarrow\mathbf{R}\f$,
|
|
| 32 |
\f$upper: A\rightarrow\mathbf{R}\cup\{+\infty\}\f$ denote the lower and
|
|
| 33 |
upper bounds for the flow values on the arcs, for which |
|
| 34 |
\f$lower(uv) \leq upper(uv)\f$ must hold for all \f$uv\in A\f$, |
|
| 35 |
\f$cost: A\rightarrow\mathbf{R}\f$ denotes the cost per unit flow
|
|
| 36 |
on the arcs and \f$sup: V\rightarrow\mathbf{R}\f$ denotes the
|
|
| 37 |
signed supply values of the nodes. |
|
| 38 |
If \f$sup(u)>0\f$, then \f$u\f$ is a supply node with \f$sup(u)\f$ |
|
| 39 |
supply, if \f$sup(u)<0\f$, then \f$u\f$ is a demand node with |
|
| 40 |
\f$-sup(u)\f$ demand. |
|
| 41 |
A minimum cost flow is an \f$f: A\rightarrow\mathbf{R}\f$ solution
|
|
| 42 |
of the following optimization problem. |
|
| 43 |
|
|
| 44 |
\f[ \min\sum_{uv\in A} f(uv) \cdot cost(uv) \f]
|
|
| 45 |
\f[ \sum_{uv\in A} f(uv) - \sum_{vu\in A} f(vu) \geq
|
|
| 46 |
sup(u) \quad \forall u\in V \f] |
|
| 47 |
\f[ lower(uv) \leq f(uv) \leq upper(uv) \quad \forall uv\in A \f] |
|
| 48 |
|
|
| 49 |
The sum of the supply values, i.e. \f$\sum_{u\in V} sup(u)\f$ must be
|
|
| 50 |
zero or negative in order to have a feasible solution (since the sum |
|
| 51 |
of the expressions on the left-hand side of the inequalities is zero). |
|
| 52 |
It means that the total demand must be greater or equal to the total |
|
| 53 |
supply and all the supplies have to be carried out from the supply nodes, |
|
| 54 |
but there could be demands that are not satisfied. |
|
| 55 |
If \f$\sum_{u\in V} sup(u)\f$ is zero, then all the supply/demand
|
|
| 56 |
constraints have to be satisfied with equality, i.e. all demands |
|
| 57 |
have to be satisfied and all supplies have to be used. |
|
| 58 |
|
|
| 59 |
|
|
| 60 |
\section mcf_algs Algorithms |
|
| 61 |
|
|
| 62 |
LEMON contains several algorithms for solving this problem, for more |
|
| 63 |
information see \ref min_cost_flow_algs "Minimum Cost Flow Algorithms". |
|
| 64 |
|
|
| 65 |
A feasible solution for this problem can be found using \ref Circulation. |
|
| 66 |
|
|
| 67 |
|
|
| 68 |
\section mcf_dual Dual Solution |
|
| 69 |
|
|
| 70 |
The dual solution of the minimum cost flow problem is represented by |
|
| 71 |
node potentials \f$\pi: V\rightarrow\mathbf{R}\f$.
|
|
| 72 |
An \f$f: A\rightarrow\mathbf{R}\f$ primal feasible solution is optimal
|
|
| 73 |
if and only if for some \f$\pi: V\rightarrow\mathbf{R}\f$ node potentials
|
|
| 74 |
the following \e complementary \e slackness optimality conditions hold. |
|
| 75 |
|
|
| 76 |
- For all \f$uv\in A\f$ arcs: |
|
| 77 |
- if \f$cost^\pi(uv)>0\f$, then \f$f(uv)=lower(uv)\f$; |
|
| 78 |
- if \f$lower(uv)<f(uv)<upper(uv)\f$, then \f$cost^\pi(uv)=0\f$; |
|
| 79 |
- if \f$cost^\pi(uv)<0\f$, then \f$f(uv)=upper(uv)\f$. |
|
| 80 |
- For all \f$u\in V\f$ nodes: |
|
| 81 |
- \f$\pi(u)<=0\f$; |
|
| 82 |
- if \f$\sum_{uv\in A} f(uv) - \sum_{vu\in A} f(vu) \neq sup(u)\f$,
|
|
| 83 |
then \f$\pi(u)=0\f$. |
|
| 84 |
|
|
| 85 |
Here \f$cost^\pi(uv)\f$ denotes the \e reduced \e cost of the arc |
|
| 86 |
\f$uv\in A\f$ with respect to the potential function \f$\pi\f$, i.e. |
|
| 87 |
\f[ cost^\pi(uv) = cost(uv) + \pi(u) - \pi(v).\f] |
|
| 88 |
|
|
| 89 |
All algorithms provide dual solution (node potentials), as well, |
|
| 90 |
if an optimal flow is found. |
|
| 91 |
|
|
| 92 |
|
|
| 93 |
\section mcf_eq Equality Form |
|
| 94 |
|
|
| 95 |
The above \ref mcf_def "definition" is actually more general than the |
|
| 96 |
usual formulation of the minimum cost flow problem, in which strict |
|
| 97 |
equalities are required in the supply/demand contraints. |
|
| 98 |
|
|
| 99 |
\f[ \min\sum_{uv\in A} f(uv) \cdot cost(uv) \f]
|
|
| 100 |
\f[ \sum_{uv\in A} f(uv) - \sum_{vu\in A} f(vu) =
|
|
| 101 |
sup(u) \quad \forall u\in V \f] |
|
| 102 |
\f[ lower(uv) \leq f(uv) \leq upper(uv) \quad \forall uv\in A \f] |
|
| 103 |
|
|
| 104 |
However if the sum of the supply values is zero, then these two problems |
|
| 105 |
are equivalent. |
|
| 106 |
The \ref min_cost_flow_algs "algorithms" in LEMON support the general |
|
| 107 |
form, so if you need the equality form, you have to ensure this additional |
|
| 108 |
contraint manually. |
|
| 109 |
|
|
| 110 |
|
|
| 111 |
\section mcf_leq Opposite Inequalites (LEQ Form) |
|
| 112 |
|
|
| 113 |
Another possible definition of the minimum cost flow problem is |
|
| 114 |
when there are <em>"less or equal"</em> (LEQ) supply/demand constraints, |
|
| 115 |
instead of the <em>"greater or equal"</em> (GEQ) constraints. |
|
| 116 |
|
|
| 117 |
\f[ \min\sum_{uv\in A} f(uv) \cdot cost(uv) \f]
|
|
| 118 |
\f[ \sum_{uv\in A} f(uv) - \sum_{vu\in A} f(vu) \leq
|
|
| 119 |
sup(u) \quad \forall u\in V \f] |
|
| 120 |
\f[ lower(uv) \leq f(uv) \leq upper(uv) \quad \forall uv\in A \f] |
|
| 121 |
|
|
| 122 |
It means that the total demand must be less or equal to the |
|
| 123 |
total supply (i.e. \f$\sum_{u\in V} sup(u)\f$ must be zero or
|
|
| 124 |
positive) and all the demands have to be satisfied, but there |
|
| 125 |
could be supplies that are not carried out from the supply |
|
| 126 |
nodes. |
|
| 127 |
The equality form is also a special case of this form, of course. |
|
| 128 |
|
|
| 129 |
You could easily transform this case to the \ref mcf_def "GEQ form" |
|
| 130 |
of the problem by reversing the direction of the arcs and taking the |
|
| 131 |
negative of the supply values (e.g. using \ref ReverseDigraph and |
|
| 132 |
\ref NegMap adaptors). |
|
| 133 |
However \ref NetworkSimplex algorithm also supports this form directly |
|
| 134 |
for the sake of convenience. |
|
| 135 |
|
|
| 136 |
Note that the optimality conditions for this supply constraint type are |
|
| 137 |
slightly differ from the conditions that are discussed for the GEQ form, |
|
| 138 |
namely the potentials have to be non-negative instead of non-positive. |
|
| 139 |
An \f$f: A\rightarrow\mathbf{R}\f$ feasible solution of this problem
|
|
| 140 |
is optimal if and only if for some \f$\pi: V\rightarrow\mathbf{R}\f$
|
|
| 141 |
node potentials the following conditions hold. |
|
| 142 |
|
|
| 143 |
- For all \f$uv\in A\f$ arcs: |
|
| 144 |
- if \f$cost^\pi(uv)>0\f$, then \f$f(uv)=lower(uv)\f$; |
|
| 145 |
- if \f$lower(uv)<f(uv)<upper(uv)\f$, then \f$cost^\pi(uv)=0\f$; |
|
| 146 |
- if \f$cost^\pi(uv)<0\f$, then \f$f(uv)=upper(uv)\f$. |
|
| 147 |
- For all \f$u\in V\f$ nodes: |
|
| 148 |
- \f$\pi(u)>=0\f$; |
|
| 149 |
- if \f$\sum_{uv\in A} f(uv) - \sum_{vu\in A} f(vu) \neq sup(u)\f$,
|
|
| 150 |
then \f$\pi(u)=0\f$. |
|
| 151 |
|
|
| 152 |
*/ |
|
| 153 |
} |
| 1 |
%%%%% Defining LEMON %%%%% |
|
| 2 |
|
|
| 3 |
@misc{lemon,
|
|
| 4 |
key = {LEMON},
|
|
| 5 |
title = {{LEMON} -- {L}ibrary for {E}fficient {M}odeling and
|
|
| 6 |
{O}ptimization in {N}etworks},
|
|
| 7 |
howpublished = {\url{http://lemon.cs.elte.hu/}},
|
|
| 8 |
year = 2009 |
|
| 9 |
} |
|
| 10 |
|
|
| 11 |
@misc{egres,
|
|
| 12 |
key = {EGRES},
|
|
| 13 |
title = {{EGRES} -- {E}gerv{\'a}ry {R}esearch {G}roup on
|
|
| 14 |
{C}ombinatorial {O}ptimization},
|
|
| 15 |
url = {http://www.cs.elte.hu/egres/}
|
|
| 16 |
} |
|
| 17 |
|
|
| 18 |
@misc{coinor,
|
|
| 19 |
key = {COIN-OR},
|
|
| 20 |
title = {{COIN-OR} -- {C}omputational {I}nfrastructure for
|
|
| 21 |
{O}perations {R}esearch},
|
|
| 22 |
url = {http://www.coin-or.org/}
|
|
| 23 |
} |
|
| 24 |
|
|
| 25 |
|
|
| 26 |
%%%%% Other libraries %%%%%% |
|
| 27 |
|
|
| 28 |
@misc{boost,
|
|
| 29 |
key = {Boost},
|
|
| 30 |
title = {{B}oost {C++} {L}ibraries},
|
|
| 31 |
url = {http://www.boost.org/}
|
|
| 32 |
} |
|
| 33 |
|
|
| 34 |
@book{bglbook,
|
|
| 35 |
author = {Jeremy G. Siek and Lee-Quan Lee and Andrew
|
|
| 36 |
Lumsdaine}, |
|
| 37 |
title = {The Boost Graph Library: User Guide and Reference
|
|
| 38 |
Manual}, |
|
| 39 |
publisher = {Addison-Wesley},
|
|
| 40 |
year = 2002 |
|
| 41 |
} |
|
| 42 |
|
|
| 43 |
@misc{leda,
|
|
| 44 |
key = {LEDA},
|
|
| 45 |
title = {{LEDA} -- {L}ibrary of {E}fficient {D}ata {T}ypes and
|
|
| 46 |
{A}lgorithms},
|
|
| 47 |
url = {http://www.algorithmic-solutions.com/}
|
|
| 48 |
} |
|
| 49 |
|
|
| 50 |
@book{ledabook,
|
|
| 51 |
author = {Kurt Mehlhorn and Stefan N{\"a}her},
|
|
| 52 |
title = {{LEDA}: {A} platform for combinatorial and geometric
|
|
| 53 |
computing}, |
|
| 54 |
isbn = {0-521-56329-1},
|
|
| 55 |
publisher = {Cambridge University Press},
|
|
| 56 |
address = {New York, NY, USA},
|
|
| 57 |
year = 1999 |
|
| 58 |
} |
|
| 59 |
|
|
| 60 |
|
|
| 61 |
%%%%% Tools that LEMON depends on %%%%% |
|
| 62 |
|
|
| 63 |
@misc{cmake,
|
|
| 64 |
key = {CMake},
|
|
| 65 |
title = {{CMake} -- {C}ross {P}latform {M}ake},
|
|
| 66 |
url = {http://www.cmake.org/}
|
|
| 67 |
} |
|
| 68 |
|
|
| 69 |
@misc{doxygen,
|
|
| 70 |
key = {Doxygen},
|
|
| 71 |
title = {{Doxygen} -- {S}ource code documentation generator
|
|
| 72 |
tool}, |
|
| 73 |
url = {http://www.doxygen.org/}
|
|
| 74 |
} |
|
| 75 |
|
|
| 76 |
|
|
| 77 |
%%%%% LP/MIP libraries %%%%% |
|
| 78 |
|
|
| 79 |
@misc{glpk,
|
|
| 80 |
key = {GLPK},
|
|
| 81 |
title = {{GLPK} -- {GNU} {L}inear {P}rogramming {K}it},
|
|
| 82 |
url = {http://www.gnu.org/software/glpk/}
|
|
| 83 |
} |
|
| 84 |
|
|
| 85 |
@misc{clp,
|
|
| 86 |
key = {Clp},
|
|
| 87 |
title = {{Clp} -- {Coin-Or} {L}inear {P}rogramming},
|
|
| 88 |
url = {http://projects.coin-or.org/Clp/}
|
|
| 89 |
} |
|
| 90 |
|
|
| 91 |
@misc{cbc,
|
|
| 92 |
key = {Cbc},
|
|
| 93 |
title = {{Cbc} -- {Coin-Or} {B}ranch and {C}ut},
|
|
| 94 |
url = {http://projects.coin-or.org/Cbc/}
|
|
| 95 |
} |
|
| 96 |
|
|
| 97 |
@misc{cplex,
|
|
| 98 |
key = {CPLEX},
|
|
| 99 |
title = {{ILOG} {CPLEX}},
|
|
| 100 |
url = {http://www.ilog.com/}
|
|
| 101 |
} |
|
| 102 |
|
|
| 103 |
@misc{soplex,
|
|
| 104 |
key = {SoPlex},
|
|
| 105 |
title = {{SoPlex} -- {T}he {S}equential {O}bject-{O}riented
|
|
| 106 |
{S}implex},
|
|
| 107 |
url = {http://soplex.zib.de/}
|
|
| 108 |
} |
|
| 109 |
|
|
| 110 |
|
|
| 111 |
%%%%% General books %%%%% |
|
| 112 |
|
|
| 113 |
@book{amo93networkflows,
|
|
| 114 |
author = {Ravindra K. Ahuja and Thomas L. Magnanti and James
|
|
| 115 |
B. Orlin}, |
|
| 116 |
title = {Network Flows: Theory, Algorithms, and Applications},
|
|
| 117 |
publisher = {Prentice-Hall, Inc.},
|
|
| 118 |
year = 1993, |
|
| 119 |
month = feb, |
|
| 120 |
isbn = {978-0136175490}
|
|
| 121 |
} |
|
| 122 |
|
|
| 123 |
@book{schrijver03combinatorial,
|
|
| 124 |
author = {Alexander Schrijver},
|
|
| 125 |
title = {Combinatorial Optimization: Polyhedra and Efficiency},
|
|
| 126 |
publisher = {Springer-Verlag},
|
|
| 127 |
year = 2003, |
|
| 128 |
isbn = {978-3540443896}
|
|
| 129 |
} |
|
| 130 |
|
|
| 131 |
@book{clrs01algorithms,
|
|
| 132 |
author = {Thomas H. Cormen and Charles E. Leiserson and Ronald
|
|
| 133 |
L. Rivest and Clifford Stein}, |
|
| 134 |
title = {Introduction to Algorithms},
|
|
| 135 |
publisher = {The MIT Press},
|
|
| 136 |
year = 2001, |
|
| 137 |
edition = {2nd}
|
|
| 138 |
} |
|
| 139 |
|
|
| 140 |
@book{stroustrup00cpp,
|
|
| 141 |
author = {Bjarne Stroustrup},
|
|
| 142 |
title = {The C++ Programming Language},
|
|
| 143 |
edition = {3rd},
|
|
| 144 |
publisher = {Addison-Wesley Professional},
|
|
| 145 |
isbn = 0201700735, |
|
| 146 |
month = {February},
|
|
| 147 |
year = 2000 |
|
| 148 |
} |
|
| 149 |
|
|
| 150 |
|
|
| 151 |
%%%%% Maximum flow algorithms %%%%% |
|
| 152 |
|
|
| 153 |
@article{edmondskarp72theoretical,
|
|
| 154 |
author = {Jack Edmonds and Richard M. Karp},
|
|
| 155 |
title = {Theoretical improvements in algorithmic efficiency
|
|
| 156 |
for network flow problems}, |
|
| 157 |
journal = {Journal of the ACM},
|
|
| 158 |
year = 1972, |
|
| 159 |
volume = 19, |
|
| 160 |
number = 2, |
|
| 161 |
pages = {248-264}
|
|
| 162 |
} |
|
| 163 |
|
|
| 164 |
@article{goldberg88newapproach,
|
|
| 165 |
author = {Andrew V. Goldberg and Robert E. Tarjan},
|
|
| 166 |
title = {A new approach to the maximum flow problem},
|
|
| 167 |
journal = {Journal of the ACM},
|
|
| 168 |
year = 1988, |
|
| 169 |
volume = 35, |
|
| 170 |
number = 4, |
|
| 171 |
pages = {921-940}
|
|
| 172 |
} |
|
| 173 |
|
|
| 174 |
@article{dinic70algorithm,
|
|
| 175 |
author = {E. A. Dinic},
|
|
| 176 |
title = {Algorithm for solution of a problem of maximum flow
|
|
| 177 |
in a network with power estimation}, |
|
| 178 |
journal = {Soviet Math. Doklady},
|
|
| 179 |
year = 1970, |
|
| 180 |
volume = 11, |
|
| 181 |
pages = {1277-1280}
|
|
| 182 |
} |
|
| 183 |
|
|
| 184 |
@article{goldberg08partial,
|
|
| 185 |
author = {Andrew V. Goldberg},
|
|
| 186 |
title = {The Partial Augment-Relabel Algorithm for the
|
|
| 187 |
Maximum Flow Problem}, |
|
| 188 |
journal = {16th Annual European Symposium on Algorithms},
|
|
| 189 |
year = 2008, |
|
| 190 |
pages = {466-477}
|
|
| 191 |
} |
|
| 192 |
|
|
| 193 |
@article{sleator83dynamic,
|
|
| 194 |
author = {Daniel D. Sleator and Robert E. Tarjan},
|
|
| 195 |
title = {A data structure for dynamic trees},
|
|
| 196 |
journal = {Journal of Computer and System Sciences},
|
|
| 197 |
year = 1983, |
|
| 198 |
volume = 26, |
|
| 199 |
number = 3, |
|
| 200 |
pages = {362-391}
|
|
| 201 |
} |
|
| 202 |
|
|
| 203 |
|
|
| 204 |
%%%%% Minimum mean cycle algorithms %%%%% |
|
| 205 |
|
|
| 206 |
@article{karp78characterization,
|
|
| 207 |
author = {Richard M. Karp},
|
|
| 208 |
title = {A characterization of the minimum cycle mean in a
|
|
| 209 |
digraph}, |
|
| 210 |
journal = {Discrete Math.},
|
|
| 211 |
year = 1978, |
|
| 212 |
volume = 23, |
|
| 213 |
pages = {309-311}
|
|
| 214 |
} |
|
| 215 |
|
|
| 216 |
@article{dasdan98minmeancycle,
|
|
| 217 |
author = {Ali Dasdan and Rajesh K. Gupta},
|
|
| 218 |
title = {Faster Maximum and Minimum Mean Cycle Alogrithms for
|
|
| 219 |
System Performance Analysis}, |
|
| 220 |
journal = {IEEE Transactions on Computer-Aided Design of
|
|
| 221 |
Integrated Circuits and Systems}, |
|
| 222 |
year = 1998, |
|
| 223 |
volume = 17, |
|
| 224 |
number = 10, |
|
| 225 |
pages = {889-899}
|
|
| 226 |
} |
|
| 227 |
|
|
| 228 |
|
|
| 229 |
%%%%% Minimum cost flow algorithms %%%%% |
|
| 230 |
|
|
| 231 |
@article{klein67primal,
|
|
| 232 |
author = {Morton Klein},
|
|
| 233 |
title = {A primal method for minimal cost flows with
|
|
| 234 |
applications to the assignment and transportation |
|
| 235 |
problems}, |
|
| 236 |
journal = {Management Science},
|
|
| 237 |
year = 1967, |
|
| 238 |
volume = 14, |
|
| 239 |
pages = {205-220}
|
|
| 240 |
} |
|
| 241 |
|
|
| 242 |
@article{goldberg89cyclecanceling,
|
|
| 243 |
author = {Andrew V. Goldberg and Robert E. Tarjan},
|
|
| 244 |
title = {Finding minimum-cost circulations by canceling
|
|
| 245 |
negative cycles}, |
|
| 246 |
journal = {Journal of the ACM},
|
|
| 247 |
year = 1989, |
|
| 248 |
volume = 36, |
|
| 249 |
number = 4, |
|
| 250 |
pages = {873-886}
|
|
| 251 |
} |
|
| 252 |
|
|
| 253 |
@article{goldberg90approximation,
|
|
| 254 |
author = {Andrew V. Goldberg and Robert E. Tarjan},
|
|
| 255 |
title = {Finding Minimum-Cost Circulations by Successive
|
|
| 256 |
Approximation}, |
|
| 257 |
journal = {Mathematics of Operations Research},
|
|
| 258 |
year = 1990, |
|
| 259 |
volume = 15, |
|
| 260 |
number = 3, |
|
| 261 |
pages = {430-466}
|
|
| 262 |
} |
|
| 263 |
|
|
| 264 |
@article{goldberg97efficient,
|
|
| 265 |
author = {Andrew V. Goldberg},
|
|
| 266 |
title = {An Efficient Implementation of a Scaling
|
|
| 267 |
Minimum-Cost Flow Algorithm}, |
|
| 268 |
journal = {Journal of Algorithms},
|
|
| 269 |
year = 1997, |
|
| 270 |
volume = 22, |
|
| 271 |
number = 1, |
|
| 272 |
pages = {1-29}
|
|
| 273 |
} |
|
| 274 |
|
|
| 275 |
@article{bunnagel98efficient,
|
|
| 276 |
author = {Ursula B{\"u}nnagel and Bernhard Korte and Jens
|
|
| 277 |
Vygen}, |
|
| 278 |
title = {Efficient implementation of the {G}oldberg-{T}arjan
|
|
| 279 |
minimum-cost flow algorithm}, |
|
| 280 |
journal = {Optimization Methods and Software},
|
|
| 281 |
year = 1998, |
|
| 282 |
volume = 10, |
|
| 283 |
pages = {157-174}
|
|
| 284 |
} |
|
| 285 |
|
|
| 286 |
@book{dantzig63linearprog,
|
|
| 287 |
author = {George B. Dantzig},
|
|
| 288 |
title = {Linear Programming and Extensions},
|
|
| 289 |
publisher = {Princeton University Press},
|
|
| 290 |
year = 1963 |
|
| 291 |
} |
|
| 292 |
|
|
| 293 |
@mastersthesis{kellyoneill91netsimplex,
|
|
| 294 |
author = {Damian J. Kelly and Garrett M. O'Neill},
|
|
| 295 |
title = {The Minimum Cost Flow Problem and The Network
|
|
| 296 |
Simplex Method}, |
|
| 297 |
school = {University College},
|
|
| 298 |
address = {Dublin, Ireland},
|
|
| 299 |
year = 1991, |
|
| 300 |
month = sep, |
|
| 301 |
} |
| 1 |
/* -*- mode: C++; indent-tabs-mode: nil; -*- |
|
| 2 |
* |
|
| 3 |
* This file is a part of LEMON, a generic C++ optimization library. |
|
| 4 |
* |
|
| 5 |
* Copyright (C) 2003-2009 |
|
| 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
|
| 7 |
* (Egervary Research Group on Combinatorial Optimization, EGRES). |
|
| 8 |
* |
|
| 9 |
* Permission to use, modify and distribute this software is granted |
|
| 10 |
* provided that this copyright notice appears in all copies. For |
|
| 11 |
* precise terms see the accompanying LICENSE file. |
|
| 12 |
* |
|
| 13 |
* This software is provided "AS IS" with no warranty of any kind, |
|
| 14 |
* express or implied, and with no claim as to its suitability for any |
|
| 15 |
* purpose. |
|
| 16 |
* |
|
| 17 |
*/ |
|
| 18 |
|
|
| 19 |
#ifndef LEMON_ADAPTORS_H |
|
| 20 |
#define LEMON_ADAPTORS_H |
|
| 21 |
|
|
| 22 |
/// \ingroup graph_adaptors |
|
| 23 |
/// \file |
|
| 24 |
/// \brief Adaptor classes for digraphs and graphs |
|
| 25 |
/// |
|
| 26 |
/// This file contains several useful adaptors for digraphs and graphs. |
|
| 27 |
|
|
| 28 |
#include <lemon/core.h> |
|
| 29 |
#include <lemon/maps.h> |
|
| 30 |
#include <lemon/bits/variant.h> |
|
| 31 |
|
|
| 32 |
#include <lemon/bits/graph_adaptor_extender.h> |
|
| 33 |
#include <lemon/bits/map_extender.h> |
|
| 34 |
#include <lemon/tolerance.h> |
|
| 35 |
|
|
| 36 |
#include <algorithm> |
|
| 37 |
|
|
| 38 |
namespace lemon {
|
|
| 39 |
|
|
| 40 |
#ifdef _MSC_VER |
|
| 41 |
#define LEMON_SCOPE_FIX(OUTER, NESTED) OUTER::NESTED |
|
| 42 |
#else |
|
| 43 |
#define LEMON_SCOPE_FIX(OUTER, NESTED) typename OUTER::template NESTED |
|
| 44 |
#endif |
|
| 45 |
|
|
| 46 |
template<typename DGR> |
|
| 47 |
class DigraphAdaptorBase {
|
|
| 48 |
public: |
|
| 49 |
typedef DGR Digraph; |
|
| 50 |
typedef DigraphAdaptorBase Adaptor; |
|
| 51 |
|
|
| 52 |
protected: |
|
| 53 |
DGR* _digraph; |
|
| 54 |
DigraphAdaptorBase() : _digraph(0) { }
|
|
| 55 |
void initialize(DGR& digraph) { _digraph = &digraph; }
|
|
| 56 |
|
|
| 57 |
public: |
|
| 58 |
DigraphAdaptorBase(DGR& digraph) : _digraph(&digraph) { }
|
|
| 59 |
|
|
| 60 |
typedef typename DGR::Node Node; |
|
| 61 |
typedef typename DGR::Arc Arc; |
|
| 62 |
|
|
| 63 |
void first(Node& i) const { _digraph->first(i); }
|
|
| 64 |
void first(Arc& i) const { _digraph->first(i); }
|
|
| 65 |
void firstIn(Arc& i, const Node& n) const { _digraph->firstIn(i, n); }
|
|
| 66 |
void firstOut(Arc& i, const Node& n ) const { _digraph->firstOut(i, n); }
|
|
| 67 |
|
|
| 68 |
void next(Node& i) const { _digraph->next(i); }
|
|
| 69 |
void next(Arc& i) const { _digraph->next(i); }
|
|
| 70 |
void nextIn(Arc& i) const { _digraph->nextIn(i); }
|
|
| 71 |
void nextOut(Arc& i) const { _digraph->nextOut(i); }
|
|
| 72 |
|
|
| 73 |
Node source(const Arc& a) const { return _digraph->source(a); }
|
|
| 74 |
Node target(const Arc& a) const { return _digraph->target(a); }
|
|
| 75 |
|
|
| 76 |
typedef NodeNumTagIndicator<DGR> NodeNumTag; |
|
| 77 |
int nodeNum() const { return _digraph->nodeNum(); }
|
|
| 78 |
|
|
| 79 |
typedef ArcNumTagIndicator<DGR> ArcNumTag; |
|
| 80 |
int arcNum() const { return _digraph->arcNum(); }
|
|
| 81 |
|
|
| 82 |
typedef FindArcTagIndicator<DGR> FindArcTag; |
|
| 83 |
Arc findArc(const Node& u, const Node& v, const Arc& prev = INVALID) const {
|
|
| 84 |
return _digraph->findArc(u, v, prev); |
|
| 85 |
} |
|
| 86 |
|
|
| 87 |
Node addNode() { return _digraph->addNode(); }
|
|
| 88 |
Arc addArc(const Node& u, const Node& v) { return _digraph->addArc(u, v); }
|
|
| 89 |
|
|
| 90 |
void erase(const Node& n) { _digraph->erase(n); }
|
|
| 91 |
void erase(const Arc& a) { _digraph->erase(a); }
|
|
| 92 |
|
|
| 93 |
void clear() { _digraph->clear(); }
|
|
| 94 |
|
|
| 95 |
int id(const Node& n) const { return _digraph->id(n); }
|
|
| 96 |
int id(const Arc& a) const { return _digraph->id(a); }
|
|
| 97 |
|
|
| 98 |
Node nodeFromId(int ix) const { return _digraph->nodeFromId(ix); }
|
|
| 99 |
Arc arcFromId(int ix) const { return _digraph->arcFromId(ix); }
|
|
| 100 |
|
|
| 101 |
int maxNodeId() const { return _digraph->maxNodeId(); }
|
|
| 102 |
int maxArcId() const { return _digraph->maxArcId(); }
|
|
| 103 |
|
|
| 104 |
typedef typename ItemSetTraits<DGR, Node>::ItemNotifier NodeNotifier; |
|
| 105 |
NodeNotifier& notifier(Node) const { return _digraph->notifier(Node()); }
|
|
| 106 |
|
|
| 107 |
typedef typename ItemSetTraits<DGR, Arc>::ItemNotifier ArcNotifier; |
|
| 108 |
ArcNotifier& notifier(Arc) const { return _digraph->notifier(Arc()); }
|
|
| 109 |
|
|
| 110 |
template <typename V> |
|
| 111 |
class NodeMap : public DGR::template NodeMap<V> {
|
|
| 112 |
typedef typename DGR::template NodeMap<V> Parent; |
|
| 113 |
|
|
| 114 |
public: |
|
| 115 |
explicit NodeMap(const Adaptor& adaptor) |
|
| 116 |
: Parent(*adaptor._digraph) {}
|
|
| 117 |
NodeMap(const Adaptor& adaptor, const V& value) |
|
| 118 |
: Parent(*adaptor._digraph, value) { }
|
|
| 119 |
|
|
| 120 |
private: |
|
| 121 |
NodeMap& operator=(const NodeMap& cmap) {
|
|
| 122 |
return operator=<NodeMap>(cmap); |
|
| 123 |
} |
|
| 124 |
|
|
| 125 |
template <typename CMap> |
|
| 126 |
NodeMap& operator=(const CMap& cmap) {
|
|
| 127 |
Parent::operator=(cmap); |
|
| 128 |
return *this; |
|
| 129 |
} |
|
| 130 |
|
|
| 131 |
}; |
|
| 132 |
|
|
| 133 |
template <typename V> |
|
| 134 |
class ArcMap : public DGR::template ArcMap<V> {
|
|
| 135 |
typedef typename DGR::template ArcMap<V> Parent; |
|
| 136 |
|
|
| 137 |
public: |
|
| 138 |
explicit ArcMap(const DigraphAdaptorBase<DGR>& adaptor) |
|
| 139 |
: Parent(*adaptor._digraph) {}
|
|
| 140 |
ArcMap(const DigraphAdaptorBase<DGR>& adaptor, const V& value) |
|
| 141 |
: Parent(*adaptor._digraph, value) {}
|
|
| 142 |
|
|
| 143 |
private: |
|
| 144 |
ArcMap& operator=(const ArcMap& cmap) {
|
|
| 145 |
return operator=<ArcMap>(cmap); |
|
| 146 |
} |
|
| 147 |
|
|
| 148 |
template <typename CMap> |
|
| 149 |
ArcMap& operator=(const CMap& cmap) {
|
|
| 150 |
Parent::operator=(cmap); |
|
| 151 |
return *this; |
|
| 152 |
} |
|
| 153 |
|
|
| 154 |
}; |
|
| 155 |
|
|
| 156 |
}; |
|
| 157 |
|
|
| 158 |
template<typename GR> |
|
| 159 |
class GraphAdaptorBase {
|
|
| 160 |
public: |
|
| 161 |
typedef GR Graph; |
|
| 162 |
|
|
| 163 |
protected: |
|
| 164 |
GR* _graph; |
|
| 165 |
|
|
| 166 |
GraphAdaptorBase() : _graph(0) {}
|
|
| 167 |
|
|
| 168 |
void initialize(GR& graph) { _graph = &graph; }
|
|
| 169 |
|
|
| 170 |
public: |
|
| 171 |
GraphAdaptorBase(GR& graph) : _graph(&graph) {}
|
|
| 172 |
|
|
| 173 |
typedef typename GR::Node Node; |
|
| 174 |
typedef typename GR::Arc Arc; |
|
| 175 |
typedef typename GR::Edge Edge; |
|
| 176 |
|
|
| 177 |
void first(Node& i) const { _graph->first(i); }
|
|
| 178 |
void first(Arc& i) const { _graph->first(i); }
|
|
| 179 |
void first(Edge& i) const { _graph->first(i); }
|
|
| 180 |
void firstIn(Arc& i, const Node& n) const { _graph->firstIn(i, n); }
|
|
| 181 |
void firstOut(Arc& i, const Node& n ) const { _graph->firstOut(i, n); }
|
|
| 182 |
void firstInc(Edge &i, bool &d, const Node &n) const {
|
|
| 183 |
_graph->firstInc(i, d, n); |
|
| 184 |
} |
|
| 185 |
|
|
| 186 |
void next(Node& i) const { _graph->next(i); }
|
|
| 187 |
void next(Arc& i) const { _graph->next(i); }
|
|
| 188 |
void next(Edge& i) const { _graph->next(i); }
|
|
| 189 |
void nextIn(Arc& i) const { _graph->nextIn(i); }
|
|
| 190 |
void nextOut(Arc& i) const { _graph->nextOut(i); }
|
|
| 191 |
void nextInc(Edge &i, bool &d) const { _graph->nextInc(i, d); }
|
|
| 192 |
|
|
| 193 |
Node u(const Edge& e) const { return _graph->u(e); }
|
|
| 194 |
Node v(const Edge& e) const { return _graph->v(e); }
|
|
| 195 |
|
|
| 196 |
Node source(const Arc& a) const { return _graph->source(a); }
|
|
| 197 |
Node target(const Arc& a) const { return _graph->target(a); }
|
|
| 198 |
|
|
| 199 |
typedef NodeNumTagIndicator<Graph> NodeNumTag; |
|
| 200 |
int nodeNum() const { return _graph->nodeNum(); }
|
|
| 201 |
|
|
| 202 |
typedef ArcNumTagIndicator<Graph> ArcNumTag; |
|
| 203 |
int arcNum() const { return _graph->arcNum(); }
|
|
| 204 |
|
|
| 205 |
typedef EdgeNumTagIndicator<Graph> EdgeNumTag; |
|
| 206 |
int edgeNum() const { return _graph->edgeNum(); }
|
|
| 207 |
|
|
| 208 |
typedef FindArcTagIndicator<Graph> FindArcTag; |
|
| 209 |
Arc findArc(const Node& u, const Node& v, |
|
| 210 |
const Arc& prev = INVALID) const {
|
|
| 211 |
return _graph->findArc(u, v, prev); |
|
| 212 |
} |
|
| 213 |
|
|
| 214 |
typedef FindEdgeTagIndicator<Graph> FindEdgeTag; |
|
| 215 |
Edge findEdge(const Node& u, const Node& v, |
|
| 216 |
const Edge& prev = INVALID) const {
|
|
| 217 |
return _graph->findEdge(u, v, prev); |
|
| 218 |
} |
|
| 219 |
|
|
| 220 |
Node addNode() { return _graph->addNode(); }
|
|
| 221 |
Edge addEdge(const Node& u, const Node& v) { return _graph->addEdge(u, v); }
|
|
| 222 |
|
|
| 223 |
void erase(const Node& i) { _graph->erase(i); }
|
|
| 224 |
void erase(const Edge& i) { _graph->erase(i); }
|
|
| 225 |
|
|
| 226 |
void clear() { _graph->clear(); }
|
|
| 227 |
|
|
| 228 |
bool direction(const Arc& a) const { return _graph->direction(a); }
|
|
| 229 |
Arc direct(const Edge& e, bool d) const { return _graph->direct(e, d); }
|
|
| 230 |
|
|
| 231 |
int id(const Node& v) const { return _graph->id(v); }
|
|
| 232 |
int id(const Arc& a) const { return _graph->id(a); }
|
|
| 233 |
int id(const Edge& e) const { return _graph->id(e); }
|
|
| 234 |
|
|
| 235 |
Node nodeFromId(int ix) const { return _graph->nodeFromId(ix); }
|
|
| 236 |
Arc arcFromId(int ix) const { return _graph->arcFromId(ix); }
|
|
| 237 |
Edge edgeFromId(int ix) const { return _graph->edgeFromId(ix); }
|
|
| 238 |
|
|
| 239 |
int maxNodeId() const { return _graph->maxNodeId(); }
|
|
| 240 |
int maxArcId() const { return _graph->maxArcId(); }
|
|
| 241 |
int maxEdgeId() const { return _graph->maxEdgeId(); }
|
|
| 242 |
|
|
| 243 |
typedef typename ItemSetTraits<GR, Node>::ItemNotifier NodeNotifier; |
|
| 244 |
NodeNotifier& notifier(Node) const { return _graph->notifier(Node()); }
|
|
| 245 |
|
|
| 246 |
typedef typename ItemSetTraits<GR, Arc>::ItemNotifier ArcNotifier; |
|
| 247 |
ArcNotifier& notifier(Arc) const { return _graph->notifier(Arc()); }
|
|
| 248 |
|
|
| 249 |
typedef typename ItemSetTraits<GR, Edge>::ItemNotifier EdgeNotifier; |
|
| 250 |
EdgeNotifier& notifier(Edge) const { return _graph->notifier(Edge()); }
|
|
| 251 |
|
|
| 252 |
template <typename V> |
|
| 253 |
class NodeMap : public GR::template NodeMap<V> {
|
|
| 254 |
typedef typename GR::template NodeMap<V> Parent; |
|
| 255 |
|
|
| 256 |
public: |
|
| 257 |
explicit NodeMap(const GraphAdaptorBase<GR>& adapter) |
|
| 258 |
: Parent(*adapter._graph) {}
|
|
| 259 |
NodeMap(const GraphAdaptorBase<GR>& adapter, const V& value) |
|
| 260 |
: Parent(*adapter._graph, value) {}
|
|
| 261 |
|
|
| 262 |
private: |
|
| 263 |
NodeMap& operator=(const NodeMap& cmap) {
|
|
| 264 |
return operator=<NodeMap>(cmap); |
|
| 265 |
} |
|
| 266 |
|
|
| 267 |
template <typename CMap> |
|
| 268 |
NodeMap& operator=(const CMap& cmap) {
|
|
| 269 |
Parent::operator=(cmap); |
|
| 270 |
return *this; |
|
| 271 |
} |
|
| 272 |
|
|
| 273 |
}; |
|
| 274 |
|
|
| 275 |
template <typename V> |
|
| 276 |
class ArcMap : public GR::template ArcMap<V> {
|
|
| 277 |
typedef typename GR::template ArcMap<V> Parent; |
|
| 278 |
|
|
| 279 |
public: |
|
| 280 |
explicit ArcMap(const GraphAdaptorBase<GR>& adapter) |
|
| 281 |
: Parent(*adapter._graph) {}
|
|
| 282 |
ArcMap(const GraphAdaptorBase<GR>& adapter, const V& value) |
|
| 283 |
: Parent(*adapter._graph, value) {}
|
|
| 284 |
|
|
| 285 |
private: |
|
| 286 |
ArcMap& operator=(const ArcMap& cmap) {
|
|
| 287 |
return operator=<ArcMap>(cmap); |
|
| 288 |
} |
|
| 289 |
|
|
| 290 |
template <typename CMap> |
|
| 291 |
ArcMap& operator=(const CMap& cmap) {
|
|
| 292 |
Parent::operator=(cmap); |
|
| 293 |
return *this; |
|
| 294 |
} |
|
| 295 |
}; |
|
| 296 |
|
|
| 297 |
template <typename V> |
|
| 298 |
class EdgeMap : public GR::template EdgeMap<V> {
|
|
| 299 |
typedef typename GR::template EdgeMap<V> Parent; |
|
| 300 |
|
|
| 301 |
public: |
|
| 302 |
explicit EdgeMap(const GraphAdaptorBase<GR>& adapter) |
|
| 303 |
: Parent(*adapter._graph) {}
|
|
| 304 |
EdgeMap(const GraphAdaptorBase<GR>& adapter, const V& value) |
|
| 305 |
: Parent(*adapter._graph, value) {}
|
|
| 306 |
|
|
| 307 |
private: |
|
| 308 |
EdgeMap& operator=(const EdgeMap& cmap) {
|
|
| 309 |
return operator=<EdgeMap>(cmap); |
|
| 310 |
} |
|
| 311 |
|
|
| 312 |
template <typename CMap> |
|
| 313 |
EdgeMap& operator=(const CMap& cmap) {
|
|
| 314 |
Parent::operator=(cmap); |
|
| 315 |
return *this; |
|
| 316 |
} |
|
| 317 |
}; |
|
| 318 |
|
|
| 319 |
}; |
|
| 320 |
|
|
| 321 |
template <typename DGR> |
|
| 322 |
class ReverseDigraphBase : public DigraphAdaptorBase<DGR> {
|
|
| 323 |
typedef DigraphAdaptorBase<DGR> Parent; |
|
| 324 |
public: |
|
| 325 |
typedef DGR Digraph; |
|
| 326 |
protected: |
|
| 327 |
ReverseDigraphBase() : Parent() { }
|
|
| 328 |
public: |
|
| 329 |
typedef typename Parent::Node Node; |
|
| 330 |
typedef typename Parent::Arc Arc; |
|
| 331 |
|
|
| 332 |
void firstIn(Arc& a, const Node& n) const { Parent::firstOut(a, n); }
|
|
| 333 |
void firstOut(Arc& a, const Node& n ) const { Parent::firstIn(a, n); }
|
|
| 334 |
|
|
| 335 |
void nextIn(Arc& a) const { Parent::nextOut(a); }
|
|
| 336 |
void nextOut(Arc& a) const { Parent::nextIn(a); }
|
|
| 337 |
|
|
| 338 |
Node source(const Arc& a) const { return Parent::target(a); }
|
|
| 339 |
Node target(const Arc& a) const { return Parent::source(a); }
|
|
| 340 |
|
|
| 341 |
Arc addArc(const Node& u, const Node& v) { return Parent::addArc(v, u); }
|
|
| 342 |
|
|
| 343 |
typedef FindArcTagIndicator<DGR> FindArcTag; |
|
| 344 |
Arc findArc(const Node& u, const Node& v, |
|
| 345 |
const Arc& prev = INVALID) const {
|
|
| 346 |
return Parent::findArc(v, u, prev); |
|
| 347 |
} |
|
| 348 |
|
|
| 349 |
}; |
|
| 350 |
|
|
| 351 |
/// \ingroup graph_adaptors |
|
| 352 |
/// |
|
| 353 |
/// \brief Adaptor class for reversing the orientation of the arcs in |
|
| 354 |
/// a digraph. |
|
| 355 |
/// |
|
| 356 |
/// ReverseDigraph can be used for reversing the arcs in a digraph. |
|
| 357 |
/// It conforms to the \ref concepts::Digraph "Digraph" concept. |
|
| 358 |
/// |
|
| 359 |
/// The adapted digraph can also be modified through this adaptor |
|
| 360 |
/// by adding or removing nodes or arcs, unless the \c GR template |
|
| 361 |
/// parameter is set to be \c const. |
|
| 362 |
/// |
|
| 363 |
/// \tparam DGR The type of the adapted digraph. |
|
| 364 |
/// It must conform to the \ref concepts::Digraph "Digraph" concept. |
|
| 365 |
/// It can also be specified to be \c const. |
|
| 366 |
/// |
|
| 367 |
/// \note The \c Node and \c Arc types of this adaptor and the adapted |
|
| 368 |
/// digraph are convertible to each other. |
|
| 369 |
template<typename DGR> |
|
| 370 |
#ifdef DOXYGEN |
|
| 371 |
class ReverseDigraph {
|
|
| 372 |
#else |
|
| 373 |
class ReverseDigraph : |
|
| 374 |
public DigraphAdaptorExtender<ReverseDigraphBase<DGR> > {
|
|
| 375 |
#endif |
|
| 376 |
typedef DigraphAdaptorExtender<ReverseDigraphBase<DGR> > Parent; |
|
| 377 |
public: |
|
| 378 |
/// The type of the adapted digraph. |
|
| 379 |
typedef DGR Digraph; |
|
| 380 |
protected: |
|
| 381 |
ReverseDigraph() { }
|
|
| 382 |
public: |
|
| 383 |
|
|
| 384 |
/// \brief Constructor |
|
| 385 |
/// |
|
| 386 |
/// Creates a reverse digraph adaptor for the given digraph. |
|
| 387 |
explicit ReverseDigraph(DGR& digraph) {
|
|
| 388 |
Parent::initialize(digraph); |
|
| 389 |
} |
|
| 390 |
}; |
|
| 391 |
|
|
| 392 |
/// \brief Returns a read-only ReverseDigraph adaptor |
|
| 393 |
/// |
|
| 394 |
/// This function just returns a read-only \ref ReverseDigraph adaptor. |
|
| 395 |
/// \ingroup graph_adaptors |
|
| 396 |
/// \relates ReverseDigraph |
|
| 397 |
template<typename DGR> |
|
| 398 |
ReverseDigraph<const DGR> reverseDigraph(const DGR& digraph) {
|
|
| 399 |
return ReverseDigraph<const DGR>(digraph); |
|
| 400 |
} |
|
| 401 |
|
|
| 402 |
|
|
| 403 |
template <typename DGR, typename NF, typename AF, bool ch = true> |
|
| 404 |
class SubDigraphBase : public DigraphAdaptorBase<DGR> {
|
|
| 405 |
typedef DigraphAdaptorBase<DGR> Parent; |
|
| 406 |
public: |
|
| 407 |
typedef DGR Digraph; |
|
| 408 |
typedef NF NodeFilterMap; |
|
| 409 |
typedef AF ArcFilterMap; |
|
| 410 |
|
|
| 411 |
typedef SubDigraphBase Adaptor; |
|
| 412 |
protected: |
|
| 413 |
NF* _node_filter; |
|
| 414 |
AF* _arc_filter; |
|
| 415 |
SubDigraphBase() |
|
| 416 |
: Parent(), _node_filter(0), _arc_filter(0) { }
|
|
| 417 |
|
|
| 418 |
void initialize(DGR& digraph, NF& node_filter, AF& arc_filter) {
|
|
| 419 |
Parent::initialize(digraph); |
|
| 420 |
_node_filter = &node_filter; |
|
| 421 |
_arc_filter = &arc_filter; |
|
| 422 |
} |
|
| 423 |
|
|
| 424 |
public: |
|
| 425 |
|
|
| 426 |
typedef typename Parent::Node Node; |
|
| 427 |
typedef typename Parent::Arc Arc; |
|
| 428 |
|
|
| 429 |
void first(Node& i) const {
|
|
| 430 |
Parent::first(i); |
|
| 431 |
while (i != INVALID && !(*_node_filter)[i]) Parent::next(i); |
|
| 432 |
} |
|
| 433 |
|
|
| 434 |
void first(Arc& i) const {
|
|
| 435 |
Parent::first(i); |
|
| 436 |
while (i != INVALID && (!(*_arc_filter)[i] |
|
| 437 |
|| !(*_node_filter)[Parent::source(i)] |
|
| 438 |
|| !(*_node_filter)[Parent::target(i)])) |
|
| 439 |
Parent::next(i); |
|
| 440 |
} |
|
| 441 |
|
|
| 442 |
void firstIn(Arc& i, const Node& n) const {
|
|
| 443 |
Parent::firstIn(i, n); |
|
| 444 |
while (i != INVALID && (!(*_arc_filter)[i] |
|
| 445 |
|| !(*_node_filter)[Parent::source(i)])) |
|
| 446 |
Parent::nextIn(i); |
|
| 447 |
} |
|
| 448 |
|
|
| 449 |
void firstOut(Arc& i, const Node& n) const {
|
|
| 450 |
Parent::firstOut(i, n); |
|
| 451 |
while (i != INVALID && (!(*_arc_filter)[i] |
|
| 452 |
|| !(*_node_filter)[Parent::target(i)])) |
|
| 453 |
Parent::nextOut(i); |
|
| 454 |
} |
|
| 455 |
|
|
| 456 |
void next(Node& i) const {
|
|
| 457 |
Parent::next(i); |
|
| 458 |
while (i != INVALID && !(*_node_filter)[i]) Parent::next(i); |
|
| 459 |
} |
|
| 460 |
|
|
| 461 |
void next(Arc& i) const {
|
|
| 462 |
Parent::next(i); |
|
| 463 |
while (i != INVALID && (!(*_arc_filter)[i] |
|
| 464 |
|| !(*_node_filter)[Parent::source(i)] |
|
| 465 |
|| !(*_node_filter)[Parent::target(i)])) |
|
| 466 |
Parent::next(i); |
|
| 467 |
} |
|
| 468 |
|
|
| 469 |
void nextIn(Arc& i) const {
|
|
| 470 |
Parent::nextIn(i); |
|
| 471 |
while (i != INVALID && (!(*_arc_filter)[i] |
|
| 472 |
|| !(*_node_filter)[Parent::source(i)])) |
|
| 473 |
Parent::nextIn(i); |
|
| 474 |
} |
|
| 475 |
|
|
| 476 |
void nextOut(Arc& i) const {
|
|
| 477 |
Parent::nextOut(i); |
|
| 478 |
while (i != INVALID && (!(*_arc_filter)[i] |
|
| 479 |
|| !(*_node_filter)[Parent::target(i)])) |
|
| 480 |
Parent::nextOut(i); |
|
| 481 |
} |
|
| 482 |
|
|
| 483 |
void status(const Node& n, bool v) const { _node_filter->set(n, v); }
|
|
| 484 |
void status(const Arc& a, bool v) const { _arc_filter->set(a, v); }
|
|
| 485 |
|
|
| 486 |
bool status(const Node& n) const { return (*_node_filter)[n]; }
|
|
| 487 |
bool status(const Arc& a) const { return (*_arc_filter)[a]; }
|
|
| 488 |
|
|
| 489 |
typedef False NodeNumTag; |
|
| 490 |
typedef False ArcNumTag; |
|
| 491 |
|
|
| 492 |
typedef FindArcTagIndicator<DGR> FindArcTag; |
|
| 493 |
Arc findArc(const Node& source, const Node& target, |
|
| 494 |
const Arc& prev = INVALID) const {
|
|
| 495 |
if (!(*_node_filter)[source] || !(*_node_filter)[target]) {
|
|
| 496 |
return INVALID; |
|
| 497 |
} |
|
| 498 |
Arc arc = Parent::findArc(source, target, prev); |
|
| 499 |
while (arc != INVALID && !(*_arc_filter)[arc]) {
|
|
| 500 |
arc = Parent::findArc(source, target, arc); |
|
| 501 |
} |
|
| 502 |
return arc; |
|
| 503 |
} |
|
| 504 |
|
|
| 505 |
public: |
|
| 506 |
|
|
| 507 |
template <typename V> |
|
| 508 |
class NodeMap |
|
| 509 |
: public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, |
|
| 510 |
LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
|
|
| 511 |
typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, |
|
| 512 |
LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent; |
|
| 513 |
|
|
| 514 |
public: |
|
| 515 |
typedef V Value; |
|
| 516 |
|
|
| 517 |
NodeMap(const SubDigraphBase<DGR, NF, AF, ch>& adaptor) |
|
| 518 |
: Parent(adaptor) {}
|
|
| 519 |
NodeMap(const SubDigraphBase<DGR, NF, AF, ch>& adaptor, const V& value) |
|
| 520 |
: Parent(adaptor, value) {}
|
|
| 521 |
|
|
| 522 |
private: |
|
| 523 |
NodeMap& operator=(const NodeMap& cmap) {
|
|
| 524 |
return operator=<NodeMap>(cmap); |
|
| 525 |
} |
|
| 526 |
|
|
| 527 |
template <typename CMap> |
|
| 528 |
NodeMap& operator=(const CMap& cmap) {
|
|
| 529 |
Parent::operator=(cmap); |
|
| 530 |
return *this; |
|
| 531 |
} |
|
| 532 |
}; |
|
| 533 |
|
|
| 534 |
template <typename V> |
|
| 535 |
class ArcMap |
|
| 536 |
: public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, |
|
| 537 |
LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
|
|
| 538 |
typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, |
|
| 539 |
LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> Parent; |
|
| 540 |
|
|
| 541 |
public: |
|
| 542 |
typedef V Value; |
|
| 543 |
|
|
| 544 |
ArcMap(const SubDigraphBase<DGR, NF, AF, ch>& adaptor) |
|
| 545 |
: Parent(adaptor) {}
|
|
| 546 |
ArcMap(const SubDigraphBase<DGR, NF, AF, ch>& adaptor, const V& value) |
|
| 547 |
: Parent(adaptor, value) {}
|
|
| 548 |
|
|
| 549 |
private: |
|
| 550 |
ArcMap& operator=(const ArcMap& cmap) {
|
|
| 551 |
return operator=<ArcMap>(cmap); |
|
| 552 |
} |
|
| 553 |
|
|
| 554 |
template <typename CMap> |
|
| 555 |
ArcMap& operator=(const CMap& cmap) {
|
|
| 556 |
Parent::operator=(cmap); |
|
| 557 |
return *this; |
|
| 558 |
} |
|
| 559 |
}; |
|
| 560 |
|
|
| 561 |
}; |
|
| 562 |
|
|
| 563 |
template <typename DGR, typename NF, typename AF> |
|
| 564 |
class SubDigraphBase<DGR, NF, AF, false> |
|
| 565 |
: public DigraphAdaptorBase<DGR> {
|
|
| 566 |
typedef DigraphAdaptorBase<DGR> Parent; |
|
| 567 |
public: |
|
| 568 |
typedef DGR Digraph; |
|
| 569 |
typedef NF NodeFilterMap; |
|
| 570 |
typedef AF ArcFilterMap; |
|
| 571 |
|
|
| 572 |
typedef SubDigraphBase Adaptor; |
|
| 573 |
protected: |
|
| 574 |
NF* _node_filter; |
|
| 575 |
AF* _arc_filter; |
|
| 576 |
SubDigraphBase() |
|
| 577 |
: Parent(), _node_filter(0), _arc_filter(0) { }
|
|
| 578 |
|
|
| 579 |
void initialize(DGR& digraph, NF& node_filter, AF& arc_filter) {
|
|
| 580 |
Parent::initialize(digraph); |
|
| 581 |
_node_filter = &node_filter; |
|
| 582 |
_arc_filter = &arc_filter; |
|
| 583 |
} |
|
| 584 |
|
|
| 585 |
public: |
|
| 586 |
|
|
| 587 |
typedef typename Parent::Node Node; |
|
| 588 |
typedef typename Parent::Arc Arc; |
|
| 589 |
|
|
| 590 |
void first(Node& i) const {
|
|
| 591 |
Parent::first(i); |
|
| 592 |
while (i!=INVALID && !(*_node_filter)[i]) Parent::next(i); |
|
| 593 |
} |
|
| 594 |
|
|
| 595 |
void first(Arc& i) const {
|
|
| 596 |
Parent::first(i); |
|
| 597 |
while (i!=INVALID && !(*_arc_filter)[i]) Parent::next(i); |
|
| 598 |
} |
|
| 599 |
|
|
| 600 |
void firstIn(Arc& i, const Node& n) const {
|
|
| 601 |
Parent::firstIn(i, n); |
|
| 602 |
while (i!=INVALID && !(*_arc_filter)[i]) Parent::nextIn(i); |
|
| 603 |
} |
|
| 604 |
|
|
| 605 |
void firstOut(Arc& i, const Node& n) const {
|
|
| 606 |
Parent::firstOut(i, n); |
|
| 607 |
while (i!=INVALID && !(*_arc_filter)[i]) Parent::nextOut(i); |
|
| 608 |
} |
|
| 609 |
|
|
| 610 |
void next(Node& i) const {
|
|
| 611 |
Parent::next(i); |
|
| 612 |
while (i!=INVALID && !(*_node_filter)[i]) Parent::next(i); |
|
| 613 |
} |
|
| 614 |
void next(Arc& i) const {
|
|
| 615 |
Parent::next(i); |
|
| 616 |
while (i!=INVALID && !(*_arc_filter)[i]) Parent::next(i); |
|
| 617 |
} |
|
| 618 |
void nextIn(Arc& i) const {
|
|
| 619 |
Parent::nextIn(i); |
|
| 620 |
while (i!=INVALID && !(*_arc_filter)[i]) Parent::nextIn(i); |
|
| 621 |
} |
|
| 622 |
|
|
| 623 |
void nextOut(Arc& i) const {
|
|
| 624 |
Parent::nextOut(i); |
|
| 625 |
while (i!=INVALID && !(*_arc_filter)[i]) Parent::nextOut(i); |
|
| 626 |
} |
|
| 627 |
|
|
| 628 |
void status(const Node& n, bool v) const { _node_filter->set(n, v); }
|
|
| 629 |
void status(const Arc& a, bool v) const { _arc_filter->set(a, v); }
|
|
| 630 |
|
|
| 631 |
bool status(const Node& n) const { return (*_node_filter)[n]; }
|
|
| 632 |
bool status(const Arc& a) const { return (*_arc_filter)[a]; }
|
|
| 633 |
|
|
| 634 |
typedef False NodeNumTag; |
|
| 635 |
typedef False ArcNumTag; |
|
| 636 |
|
|
| 637 |
typedef FindArcTagIndicator<DGR> FindArcTag; |
|
| 638 |
Arc findArc(const Node& source, const Node& target, |
|
| 639 |
const Arc& prev = INVALID) const {
|
|
| 640 |
if (!(*_node_filter)[source] || !(*_node_filter)[target]) {
|
|
| 641 |
return INVALID; |
|
| 642 |
} |
|
| 643 |
Arc arc = Parent::findArc(source, target, prev); |
|
| 644 |
while (arc != INVALID && !(*_arc_filter)[arc]) {
|
|
| 645 |
arc = Parent::findArc(source, target, arc); |
|
| 646 |
} |
|
| 647 |
return arc; |
|
| 648 |
} |
|
| 649 |
|
|
| 650 |
template <typename V> |
|
| 651 |
class NodeMap |
|
| 652 |
: public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, |
|
| 653 |
LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
|
|
| 654 |
typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, |
|
| 655 |
LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent; |
|
| 656 |
|
|
| 657 |
public: |
|
| 658 |
typedef V Value; |
|
| 659 |
|
|
| 660 |
NodeMap(const SubDigraphBase<DGR, NF, AF, false>& adaptor) |
|
| 661 |
: Parent(adaptor) {}
|
|
| 662 |
NodeMap(const SubDigraphBase<DGR, NF, AF, false>& adaptor, const V& value) |
|
| 663 |
: Parent(adaptor, value) {}
|
|
| 664 |
|
|
| 665 |
private: |
|
| 666 |
NodeMap& operator=(const NodeMap& cmap) {
|
|
| 667 |
return operator=<NodeMap>(cmap); |
|
| 668 |
} |
|
| 669 |
|
|
| 670 |
template <typename CMap> |
|
| 671 |
NodeMap& operator=(const CMap& cmap) {
|
|
| 672 |
Parent::operator=(cmap); |
|
| 673 |
return *this; |
|
| 674 |
} |
|
| 675 |
}; |
|
| 676 |
|
|
| 677 |
template <typename V> |
|
| 678 |
class ArcMap |
|
| 679 |
: public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, |
|
| 680 |
LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
|
|
| 681 |
typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, |
|
| 682 |
LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> Parent; |
|
| 683 |
|
|
| 684 |
public: |
|
| 685 |
typedef V Value; |
|
| 686 |
|
|
| 687 |
ArcMap(const SubDigraphBase<DGR, NF, AF, false>& adaptor) |
|
| 688 |
: Parent(adaptor) {}
|
|
| 689 |
ArcMap(const SubDigraphBase<DGR, NF, AF, false>& adaptor, const V& value) |
|
| 690 |
: Parent(adaptor, value) {}
|
|
| 691 |
|
|
| 692 |
private: |
|
| 693 |
ArcMap& operator=(const ArcMap& cmap) {
|
|
| 694 |
return operator=<ArcMap>(cmap); |
|
| 695 |
} |
|
| 696 |
|
|
| 697 |
template <typename CMap> |
|
| 698 |
ArcMap& operator=(const CMap& cmap) {
|
|
| 699 |
Parent::operator=(cmap); |
|
| 700 |
return *this; |
|
| 701 |
} |
|
| 702 |
}; |
|
| 703 |
|
|
| 704 |
}; |
|
| 705 |
|
|
| 706 |
/// \ingroup graph_adaptors |
|
| 707 |
/// |
|
| 708 |
/// \brief Adaptor class for hiding nodes and arcs in a digraph |
|
| 709 |
/// |
|
| 710 |
/// SubDigraph can be used for hiding nodes and arcs in a digraph. |
|
| 711 |
/// A \c bool node map and a \c bool arc map must be specified, which |
|
| 712 |
/// define the filters for nodes and arcs. |
|
| 713 |
/// Only the nodes and arcs with \c true filter value are |
|
| 714 |
/// shown in the subdigraph. The arcs that are incident to hidden |
|
| 715 |
/// nodes are also filtered out. |
|
| 716 |
/// This adaptor conforms to the \ref concepts::Digraph "Digraph" concept. |
|
| 717 |
/// |
|
| 718 |
/// The adapted digraph can also be modified through this adaptor |
|
| 719 |
/// by adding or removing nodes or arcs, unless the \c GR template |
|
| 720 |
/// parameter is set to be \c const. |
|
| 721 |
/// |
|
| 722 |
/// \tparam DGR The type of the adapted digraph. |
|
| 723 |
/// It must conform to the \ref concepts::Digraph "Digraph" concept. |
|
| 724 |
/// It can also be specified to be \c const. |
|
| 725 |
/// \tparam NF The type of the node filter map. |
|
| 726 |
/// It must be a \c bool (or convertible) node map of the |
|
| 727 |
/// adapted digraph. The default type is |
|
| 728 |
/// \ref concepts::Digraph::NodeMap "DGR::NodeMap<bool>". |
|
| 729 |
/// \tparam AF The type of the arc filter map. |
|
| 730 |
/// It must be \c bool (or convertible) arc map of the |
|
| 731 |
/// adapted digraph. The default type is |
|
| 732 |
/// \ref concepts::Digraph::ArcMap "DGR::ArcMap<bool>". |
|
| 733 |
/// |
|
| 734 |
/// \note The \c Node and \c Arc types of this adaptor and the adapted |
|
| 735 |
/// digraph are convertible to each other. |
|
| 736 |
/// |
|
| 737 |
/// \see FilterNodes |
|
| 738 |
/// \see FilterArcs |
|
| 739 |
#ifdef DOXYGEN |
|
| 740 |
template<typename DGR, typename NF, typename AF> |
|
| 741 |
class SubDigraph {
|
|
| 742 |
#else |
|
| 743 |
template<typename DGR, |
|
| 744 |
typename NF = typename DGR::template NodeMap<bool>, |
|
| 745 |
typename AF = typename DGR::template ArcMap<bool> > |
|
| 746 |
class SubDigraph : |
|
| 747 |
public DigraphAdaptorExtender<SubDigraphBase<DGR, NF, AF, true> > {
|
|
| 748 |
#endif |
|
| 749 |
public: |
|
| 750 |
/// The type of the adapted digraph. |
|
| 751 |
typedef DGR Digraph; |
|
| 752 |
/// The type of the node filter map. |
|
| 753 |
typedef NF NodeFilterMap; |
|
| 754 |
/// The type of the arc filter map. |
|
| 755 |
typedef AF ArcFilterMap; |
|
| 756 |
|
|
| 757 |
typedef DigraphAdaptorExtender<SubDigraphBase<DGR, NF, AF, true> > |
|
| 758 |
Parent; |
|
| 759 |
|
|
| 760 |
typedef typename Parent::Node Node; |
|
| 761 |
typedef typename Parent::Arc Arc; |
|
| 762 |
|
|
| 763 |
protected: |
|
| 764 |
SubDigraph() { }
|
|
| 765 |
public: |
|
| 766 |
|
|
| 767 |
/// \brief Constructor |
|
| 768 |
/// |
|
| 769 |
/// Creates a subdigraph for the given digraph with the |
|
| 770 |
/// given node and arc filter maps. |
|
| 771 |
SubDigraph(DGR& digraph, NF& node_filter, AF& arc_filter) {
|
|
| 772 |
Parent::initialize(digraph, node_filter, arc_filter); |
|
| 773 |
} |
|
| 774 |
|
|
| 775 |
/// \brief Sets the status of the given node |
|
| 776 |
/// |
|
| 777 |
/// This function sets the status of the given node. |
|
| 778 |
/// It is done by simply setting the assigned value of \c n |
|
| 779 |
/// to \c v in the node filter map. |
|
| 780 |
void status(const Node& n, bool v) const { Parent::status(n, v); }
|
|
| 781 |
|
|
| 782 |
/// \brief Sets the status of the given arc |
|
| 783 |
/// |
|
| 784 |
/// This function sets the status of the given arc. |
|
| 785 |
/// It is done by simply setting the assigned value of \c a |
|
| 786 |
/// to \c v in the arc filter map. |
|
| 787 |
void status(const Arc& a, bool v) const { Parent::status(a, v); }
|
|
| 788 |
|
|
| 789 |
/// \brief Returns the status of the given node |
|
| 790 |
/// |
|
| 791 |
/// This function returns the status of the given node. |
|
| 792 |
/// It is \c true if the given node is enabled (i.e. not hidden). |
|
| 793 |
bool status(const Node& n) const { return Parent::status(n); }
|
|
| 794 |
|
|
| 795 |
/// \brief Returns the status of the given arc |
|
| 796 |
/// |
|
| 797 |
/// This function returns the status of the given arc. |
|
| 798 |
/// It is \c true if the given arc is enabled (i.e. not hidden). |
|
| 799 |
bool status(const Arc& a) const { return Parent::status(a); }
|
|
| 800 |
|
|
| 801 |
/// \brief Disables the given node |
|
| 802 |
/// |
|
| 803 |
/// This function disables the given node in the subdigraph, |
|
| 804 |
/// so the iteration jumps over it. |
|
| 805 |
/// It is the same as \ref status() "status(n, false)". |
|
| 806 |
void disable(const Node& n) const { Parent::status(n, false); }
|
|
| 807 |
|
|
| 808 |
/// \brief Disables the given arc |
|
| 809 |
/// |
|
| 810 |
/// This function disables the given arc in the subdigraph, |
|
| 811 |
/// so the iteration jumps over it. |
|
| 812 |
/// It is the same as \ref status() "status(a, false)". |
|
| 813 |
void disable(const Arc& a) const { Parent::status(a, false); }
|
|
| 814 |
|
|
| 815 |
/// \brief Enables the given node |
|
| 816 |
/// |
|
| 817 |
/// This function enables the given node in the subdigraph. |
|
| 818 |
/// It is the same as \ref status() "status(n, true)". |
|
| 819 |
void enable(const Node& n) const { Parent::status(n, true); }
|
|
| 820 |
|
|
| 821 |
/// \brief Enables the given arc |
|
| 822 |
/// |
|
| 823 |
/// This function enables the given arc in the subdigraph. |
|
| 824 |
/// It is the same as \ref status() "status(a, true)". |
|
| 825 |
void enable(const Arc& a) const { Parent::status(a, true); }
|
|
| 826 |
|
|
| 827 |
}; |
|
| 828 |
|
|
| 829 |
/// \brief Returns a read-only SubDigraph adaptor |
|
| 830 |
/// |
|
| 831 |
/// This function just returns a read-only \ref SubDigraph adaptor. |
|
| 832 |
/// \ingroup graph_adaptors |
|
| 833 |
/// \relates SubDigraph |
|
| 834 |
template<typename DGR, typename NF, typename AF> |
|
| 835 |
SubDigraph<const DGR, NF, AF> |
|
| 836 |
subDigraph(const DGR& digraph, |
|
| 837 |
NF& node_filter, AF& arc_filter) {
|
|
| 838 |
return SubDigraph<const DGR, NF, AF> |
|
| 839 |
(digraph, node_filter, arc_filter); |
|
| 840 |
} |
|
| 841 |
|
|
| 842 |
template<typename DGR, typename NF, typename AF> |
|
| 843 |
SubDigraph<const DGR, const NF, AF> |
|
| 844 |
subDigraph(const DGR& digraph, |
|
| 845 |
const NF& node_filter, AF& arc_filter) {
|
|
| 846 |
return SubDigraph<const DGR, const NF, AF> |
|
| 847 |
(digraph, node_filter, arc_filter); |
|
| 848 |
} |
|
| 849 |
|
|
| 850 |
template<typename DGR, typename NF, typename AF> |
|
| 851 |
SubDigraph<const DGR, NF, const AF> |
|
| 852 |
subDigraph(const DGR& digraph, |
|
| 853 |
NF& node_filter, const AF& arc_filter) {
|
|
| 854 |
return SubDigraph<const DGR, NF, const AF> |
|
| 855 |
(digraph, node_filter, arc_filter); |
|
| 856 |
} |
|
| 857 |
|
|
| 858 |
template<typename DGR, typename NF, typename AF> |
|
| 859 |
SubDigraph<const DGR, const NF, const AF> |
|
| 860 |
subDigraph(const DGR& digraph, |
|
| 861 |
const NF& node_filter, const AF& arc_filter) {
|
|
| 862 |
return SubDigraph<const DGR, const NF, const AF> |
|
| 863 |
(digraph, node_filter, arc_filter); |
|
| 864 |
} |
|
| 865 |
|
|
| 866 |
|
|
| 867 |
template <typename GR, typename NF, typename EF, bool ch = true> |
|
| 868 |
class SubGraphBase : public GraphAdaptorBase<GR> {
|
|
| 869 |
typedef GraphAdaptorBase<GR> Parent; |
|
| 870 |
public: |
|
| 871 |
typedef GR Graph; |
|
| 872 |
typedef NF NodeFilterMap; |
|
| 873 |
typedef EF EdgeFilterMap; |
|
| 874 |
|
|
| 875 |
typedef SubGraphBase Adaptor; |
|
| 876 |
protected: |
|
| 877 |
|
|
| 878 |
NF* _node_filter; |
|
| 879 |
EF* _edge_filter; |
|
| 880 |
|
|
| 881 |
SubGraphBase() |
|
| 882 |
: Parent(), _node_filter(0), _edge_filter(0) { }
|
|
| 883 |
|
|
| 884 |
void initialize(GR& graph, NF& node_filter, EF& edge_filter) {
|
|
| 885 |
Parent::initialize(graph); |
|
| 886 |
_node_filter = &node_filter; |
|
| 887 |
_edge_filter = &edge_filter; |
|
| 888 |
} |
|
| 889 |
|
|
| 890 |
public: |
|
| 891 |
|
|
| 892 |
typedef typename Parent::Node Node; |
|
| 893 |
typedef typename Parent::Arc Arc; |
|
| 894 |
typedef typename Parent::Edge Edge; |
|
| 895 |
|
|
| 896 |
void first(Node& i) const {
|
|
| 897 |
Parent::first(i); |
|
| 898 |
while (i!=INVALID && !(*_node_filter)[i]) Parent::next(i); |
|
| 899 |
} |
|
| 900 |
|
|
| 901 |
void first(Arc& i) const {
|
|
| 902 |
Parent::first(i); |
|
| 903 |
while (i!=INVALID && (!(*_edge_filter)[i] |
|
| 904 |
|| !(*_node_filter)[Parent::source(i)] |
|
| 905 |
|| !(*_node_filter)[Parent::target(i)])) |
|
| 906 |
Parent::next(i); |
|
| 907 |
} |
|
| 908 |
|
|
| 909 |
void first(Edge& i) const {
|
|
| 910 |
Parent::first(i); |
|
| 911 |
while (i!=INVALID && (!(*_edge_filter)[i] |
|
| 912 |
|| !(*_node_filter)[Parent::u(i)] |
|
| 913 |
|| !(*_node_filter)[Parent::v(i)])) |
|
| 914 |
Parent::next(i); |
|
| 915 |
} |
|
| 916 |
|
|
| 917 |
void firstIn(Arc& i, const Node& n) const {
|
|
| 918 |
Parent::firstIn(i, n); |
|
| 919 |
while (i!=INVALID && (!(*_edge_filter)[i] |
|
| 920 |
|| !(*_node_filter)[Parent::source(i)])) |
|
| 921 |
Parent::nextIn(i); |
|
| 922 |
} |
|
| 923 |
|
|
| 924 |
void firstOut(Arc& i, const Node& n) const {
|
|
| 925 |
Parent::firstOut(i, n); |
|
| 926 |
while (i!=INVALID && (!(*_edge_filter)[i] |
|
| 927 |
|| !(*_node_filter)[Parent::target(i)])) |
|
| 928 |
Parent::nextOut(i); |
|
| 929 |
} |
|
| 930 |
|
|
| 931 |
void firstInc(Edge& i, bool& d, const Node& n) const {
|
|
| 932 |
Parent::firstInc(i, d, n); |
|
| 933 |
while (i!=INVALID && (!(*_edge_filter)[i] |
|
| 934 |
|| !(*_node_filter)[Parent::u(i)] |
|
| 935 |
|| !(*_node_filter)[Parent::v(i)])) |
|
| 936 |
Parent::nextInc(i, d); |
|
| 937 |
} |
|
| 938 |
|
|
| 939 |
void next(Node& i) const {
|
|
| 940 |
Parent::next(i); |
|
| 941 |
while (i!=INVALID && !(*_node_filter)[i]) Parent::next(i); |
|
| 942 |
} |
|
| 943 |
|
|
| 944 |
void next(Arc& i) const {
|
|
| 945 |
Parent::next(i); |
|
| 946 |
while (i!=INVALID && (!(*_edge_filter)[i] |
|
| 947 |
|| !(*_node_filter)[Parent::source(i)] |
|
| 948 |
|| !(*_node_filter)[Parent::target(i)])) |
|
| 949 |
Parent::next(i); |
|
| 950 |
} |
|
| 951 |
|
|
| 952 |
void next(Edge& i) const {
|
|
| 953 |
Parent::next(i); |
|
| 954 |
while (i!=INVALID && (!(*_edge_filter)[i] |
|
| 955 |
|| !(*_node_filter)[Parent::u(i)] |
|
| 956 |
|| !(*_node_filter)[Parent::v(i)])) |
|
| 957 |
Parent::next(i); |
|
| 958 |
} |
|
| 959 |
|
|
| 960 |
void nextIn(Arc& i) const {
|
|
| 961 |
Parent::nextIn(i); |
|
| 962 |
while (i!=INVALID && (!(*_edge_filter)[i] |
|
| 963 |
|| !(*_node_filter)[Parent::source(i)])) |
|
| 964 |
Parent::nextIn(i); |
|
| 965 |
} |
|
| 966 |
|
|
| 967 |
void nextOut(Arc& i) const {
|
|
| 968 |
Parent::nextOut(i); |
|
| 969 |
while (i!=INVALID && (!(*_edge_filter)[i] |
|
| 970 |
|| !(*_node_filter)[Parent::target(i)])) |
|
| 971 |
Parent::nextOut(i); |
|
| 972 |
} |
|
| 973 |
|
|
| 974 |
void nextInc(Edge& i, bool& d) const {
|
|
| 975 |
Parent::nextInc(i, d); |
|
| 976 |
while (i!=INVALID && (!(*_edge_filter)[i] |
|
| 977 |
|| !(*_node_filter)[Parent::u(i)] |
|
| 978 |
|| !(*_node_filter)[Parent::v(i)])) |
|
| 979 |
Parent::nextInc(i, d); |
|
| 980 |
} |
|
| 981 |
|
|
| 982 |
void status(const Node& n, bool v) const { _node_filter->set(n, v); }
|
|
| 983 |
void status(const Edge& e, bool v) const { _edge_filter->set(e, v); }
|
|
| 984 |
|
|
| 985 |
bool status(const Node& n) const { return (*_node_filter)[n]; }
|
|
| 986 |
bool status(const Edge& e) const { return (*_edge_filter)[e]; }
|
|
| 987 |
|
|
| 988 |
typedef False NodeNumTag; |
|
| 989 |
typedef False ArcNumTag; |
|
| 990 |
typedef False EdgeNumTag; |
|
| 991 |
|
|
| 992 |
typedef FindArcTagIndicator<Graph> FindArcTag; |
|
| 993 |
Arc findArc(const Node& u, const Node& v, |
|
| 994 |
const Arc& prev = INVALID) const {
|
|
| 995 |
if (!(*_node_filter)[u] || !(*_node_filter)[v]) {
|
|
| 996 |
return INVALID; |
|
| 997 |
} |
|
| 998 |
Arc arc = Parent::findArc(u, v, prev); |
|
| 999 |
while (arc != INVALID && !(*_edge_filter)[arc]) {
|
|
| 1000 |
arc = Parent::findArc(u, v, arc); |
|
| 1001 |
} |
|
| 1002 |
return arc; |
|
| 1003 |
} |
|
| 1004 |
|
|
| 1005 |
typedef FindEdgeTagIndicator<Graph> FindEdgeTag; |
|
| 1006 |
Edge findEdge(const Node& u, const Node& v, |
|
| 1007 |
const Edge& prev = INVALID) const {
|
|
| 1008 |
if (!(*_node_filter)[u] || !(*_node_filter)[v]) {
|
|
| 1009 |
return INVALID; |
|
| 1010 |
} |
|
| 1011 |
Edge edge = Parent::findEdge(u, v, prev); |
|
| 1012 |
while (edge != INVALID && !(*_edge_filter)[edge]) {
|
|
| 1013 |
edge = Parent::findEdge(u, v, edge); |
|
| 1014 |
} |
|
| 1015 |
return edge; |
|
| 1016 |
} |
|
| 1017 |
|
|
| 1018 |
template <typename V> |
|
| 1019 |
class NodeMap |
|
| 1020 |
: public SubMapExtender<SubGraphBase<GR, NF, EF, ch>, |
|
| 1021 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
|
|
| 1022 |
typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, |
|
| 1023 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent; |
|
| 1024 |
|
|
| 1025 |
public: |
|
| 1026 |
typedef V Value; |
|
| 1027 |
|
|
| 1028 |
NodeMap(const SubGraphBase<GR, NF, EF, ch>& adaptor) |
|
| 1029 |
: Parent(adaptor) {}
|
|
| 1030 |
NodeMap(const SubGraphBase<GR, NF, EF, ch>& adaptor, const V& value) |
|
| 1031 |
: Parent(adaptor, value) {}
|
|
| 1032 |
|
|
| 1033 |
private: |
|
| 1034 |
NodeMap& operator=(const NodeMap& cmap) {
|
|
| 1035 |
return operator=<NodeMap>(cmap); |
|
| 1036 |
} |
|
| 1037 |
|
|
| 1038 |
template <typename CMap> |
|
| 1039 |
NodeMap& operator=(const CMap& cmap) {
|
|
| 1040 |
Parent::operator=(cmap); |
|
| 1041 |
return *this; |
|
| 1042 |
} |
|
| 1043 |
}; |
|
| 1044 |
|
|
| 1045 |
template <typename V> |
|
| 1046 |
class ArcMap |
|
| 1047 |
: public SubMapExtender<SubGraphBase<GR, NF, EF, ch>, |
|
| 1048 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
|
|
| 1049 |
typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, |
|
| 1050 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent; |
|
| 1051 |
|
|
| 1052 |
public: |
|
| 1053 |
typedef V Value; |
|
| 1054 |
|
|
| 1055 |
ArcMap(const SubGraphBase<GR, NF, EF, ch>& adaptor) |
|
| 1056 |
: Parent(adaptor) {}
|
|
| 1057 |
ArcMap(const SubGraphBase<GR, NF, EF, ch>& adaptor, const V& value) |
|
| 1058 |
: Parent(adaptor, value) {}
|
|
| 1059 |
|
|
| 1060 |
private: |
|
| 1061 |
ArcMap& operator=(const ArcMap& cmap) {
|
|
| 1062 |
return operator=<ArcMap>(cmap); |
|
| 1063 |
} |
|
| 1064 |
|
|
| 1065 |
template <typename CMap> |
|
| 1066 |
ArcMap& operator=(const CMap& cmap) {
|
|
| 1067 |
Parent::operator=(cmap); |
|
| 1068 |
return *this; |
|
| 1069 |
} |
|
| 1070 |
}; |
|
| 1071 |
|
|
| 1072 |
template <typename V> |
|
| 1073 |
class EdgeMap |
|
| 1074 |
: public SubMapExtender<SubGraphBase<GR, NF, EF, ch>, |
|
| 1075 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
|
|
| 1076 |
typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, |
|
| 1077 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent; |
|
| 1078 |
|
|
| 1079 |
public: |
|
| 1080 |
typedef V Value; |
|
| 1081 |
|
|
| 1082 |
EdgeMap(const SubGraphBase<GR, NF, EF, ch>& adaptor) |
|
| 1083 |
: Parent(adaptor) {}
|
|
| 1084 |
|
|
| 1085 |
EdgeMap(const SubGraphBase<GR, NF, EF, ch>& adaptor, const V& value) |
|
| 1086 |
: Parent(adaptor, value) {}
|
|
| 1087 |
|
|
| 1088 |
private: |
|
| 1089 |
EdgeMap& operator=(const EdgeMap& cmap) {
|
|
| 1090 |
return operator=<EdgeMap>(cmap); |
|
| 1091 |
} |
|
| 1092 |
|
|
| 1093 |
template <typename CMap> |
|
| 1094 |
EdgeMap& operator=(const CMap& cmap) {
|
|
| 1095 |
Parent::operator=(cmap); |
|
| 1096 |
return *this; |
|
| 1097 |
} |
|
| 1098 |
}; |
|
| 1099 |
|
|
| 1100 |
}; |
|
| 1101 |
|
|
| 1102 |
template <typename GR, typename NF, typename EF> |
|
| 1103 |
class SubGraphBase<GR, NF, EF, false> |
|
| 1104 |
: public GraphAdaptorBase<GR> {
|
|
| 1105 |
typedef GraphAdaptorBase<GR> Parent; |
|
| 1106 |
public: |
|
| 1107 |
typedef GR Graph; |
|
| 1108 |
typedef NF NodeFilterMap; |
|
| 1109 |
typedef EF EdgeFilterMap; |
|
| 1110 |
|
|
| 1111 |
typedef SubGraphBase Adaptor; |
|
| 1112 |
protected: |
|
| 1113 |
NF* _node_filter; |
|
| 1114 |
EF* _edge_filter; |
|
| 1115 |
SubGraphBase() |
|
| 1116 |
: Parent(), _node_filter(0), _edge_filter(0) { }
|
|
| 1117 |
|
|
| 1118 |
void initialize(GR& graph, NF& node_filter, EF& edge_filter) {
|
|
| 1119 |
Parent::initialize(graph); |
|
| 1120 |
_node_filter = &node_filter; |
|
| 1121 |
_edge_filter = &edge_filter; |
|
| 1122 |
} |
|
| 1123 |
|
|
| 1124 |
public: |
|
| 1125 |
|
|
| 1126 |
typedef typename Parent::Node Node; |
|
| 1127 |
typedef typename Parent::Arc Arc; |
|
| 1128 |
typedef typename Parent::Edge Edge; |
|
| 1129 |
|
|
| 1130 |
void first(Node& i) const {
|
|
| 1131 |
Parent::first(i); |
|
| 1132 |
while (i!=INVALID && !(*_node_filter)[i]) Parent::next(i); |
|
| 1133 |
} |
|
| 1134 |
|
|
| 1135 |
void first(Arc& i) const {
|
|
| 1136 |
Parent::first(i); |
|
| 1137 |
while (i!=INVALID && !(*_edge_filter)[i]) Parent::next(i); |
|
| 1138 |
} |
|
| 1139 |
|
|
| 1140 |
void first(Edge& i) const {
|
|
| 1141 |
Parent::first(i); |
|
| 1142 |
while (i!=INVALID && !(*_edge_filter)[i]) Parent::next(i); |
|
| 1143 |
} |
|
| 1144 |
|
|
| 1145 |
void firstIn(Arc& i, const Node& n) const {
|
|
| 1146 |
Parent::firstIn(i, n); |
|
| 1147 |
while (i!=INVALID && !(*_edge_filter)[i]) Parent::nextIn(i); |
|
| 1148 |
} |
|
| 1149 |
|
|
| 1150 |
void firstOut(Arc& i, const Node& n) const {
|
|
| 1151 |
Parent::firstOut(i, n); |
|
| 1152 |
while (i!=INVALID && !(*_edge_filter)[i]) Parent::nextOut(i); |
|
| 1153 |
} |
|
| 1154 |
|
|
| 1155 |
void firstInc(Edge& i, bool& d, const Node& n) const {
|
|
| 1156 |
Parent::firstInc(i, d, n); |
|
| 1157 |
while (i!=INVALID && !(*_edge_filter)[i]) Parent::nextInc(i, d); |
|
| 1158 |
} |
|
| 1159 |
|
|
| 1160 |
void next(Node& i) const {
|
|
| 1161 |
Parent::next(i); |
|
| 1162 |
while (i!=INVALID && !(*_node_filter)[i]) Parent::next(i); |
|
| 1163 |
} |
|
| 1164 |
void next(Arc& i) const {
|
|
| 1165 |
Parent::next(i); |
|
| 1166 |
while (i!=INVALID && !(*_edge_filter)[i]) Parent::next(i); |
|
| 1167 |
} |
|
| 1168 |
void next(Edge& i) const {
|
|
| 1169 |
Parent::next(i); |
|
| 1170 |
while (i!=INVALID && !(*_edge_filter)[i]) Parent::next(i); |
|
| 1171 |
} |
|
| 1172 |
void nextIn(Arc& i) const {
|
|
| 1173 |
Parent::nextIn(i); |
|
| 1174 |
while (i!=INVALID && !(*_edge_filter)[i]) Parent::nextIn(i); |
|
| 1175 |
} |
|
| 1176 |
|
|
| 1177 |
void nextOut(Arc& i) const {
|
|
| 1178 |
Parent::nextOut(i); |
|
| 1179 |
while (i!=INVALID && !(*_edge_filter)[i]) Parent::nextOut(i); |
|
| 1180 |
} |
|
| 1181 |
void nextInc(Edge& i, bool& d) const {
|
|
| 1182 |
Parent::nextInc(i, d); |
|
| 1183 |
while (i!=INVALID && !(*_edge_filter)[i]) Parent::nextInc(i, d); |
|
| 1184 |
} |
|
| 1185 |
|
|
| 1186 |
void status(const Node& n, bool v) const { _node_filter->set(n, v); }
|
|
| 1187 |
void status(const Edge& e, bool v) const { _edge_filter->set(e, v); }
|
|
| 1188 |
|
|
| 1189 |
bool status(const Node& n) const { return (*_node_filter)[n]; }
|
|
| 1190 |
bool status(const Edge& e) const { return (*_edge_filter)[e]; }
|
|
| 1191 |
|
|
| 1192 |
typedef False NodeNumTag; |
|
| 1193 |
typedef False ArcNumTag; |
|
| 1194 |
typedef False EdgeNumTag; |
|
| 1195 |
|
|
| 1196 |
typedef FindArcTagIndicator<Graph> FindArcTag; |
|
| 1197 |
Arc findArc(const Node& u, const Node& v, |
|
| 1198 |
const Arc& prev = INVALID) const {
|
|
| 1199 |
Arc arc = Parent::findArc(u, v, prev); |
|
| 1200 |
while (arc != INVALID && !(*_edge_filter)[arc]) {
|
|
| 1201 |
arc = Parent::findArc(u, v, arc); |
|
| 1202 |
} |
|
| 1203 |
return arc; |
|
| 1204 |
} |
|
| 1205 |
|
|
| 1206 |
typedef FindEdgeTagIndicator<Graph> FindEdgeTag; |
|
| 1207 |
Edge findEdge(const Node& u, const Node& v, |
|
| 1208 |
const Edge& prev = INVALID) const {
|
|
| 1209 |
Edge edge = Parent::findEdge(u, v, prev); |
|
| 1210 |
while (edge != INVALID && !(*_edge_filter)[edge]) {
|
|
| 1211 |
edge = Parent::findEdge(u, v, edge); |
|
| 1212 |
} |
|
| 1213 |
return edge; |
|
| 1214 |
} |
|
| 1215 |
|
|
| 1216 |
template <typename V> |
|
| 1217 |
class NodeMap |
|
| 1218 |
: public SubMapExtender<SubGraphBase<GR, NF, EF, false>, |
|
| 1219 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
|
|
| 1220 |
typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, |
|
| 1221 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent; |
|
| 1222 |
|
|
| 1223 |
public: |
|
| 1224 |
typedef V Value; |
|
| 1225 |
|
|
| 1226 |
NodeMap(const SubGraphBase<GR, NF, EF, false>& adaptor) |
|
| 1227 |
: Parent(adaptor) {}
|
|
| 1228 |
NodeMap(const SubGraphBase<GR, NF, EF, false>& adaptor, const V& value) |
|
| 1229 |
: Parent(adaptor, value) {}
|
|
| 1230 |
|
|
| 1231 |
private: |
|
| 1232 |
NodeMap& operator=(const NodeMap& cmap) {
|
|
| 1233 |
return operator=<NodeMap>(cmap); |
|
| 1234 |
} |
|
| 1235 |
|
|
| 1236 |
template <typename CMap> |
|
| 1237 |
NodeMap& operator=(const CMap& cmap) {
|
|
| 1238 |
Parent::operator=(cmap); |
|
| 1239 |
return *this; |
|
| 1240 |
} |
|
| 1241 |
}; |
|
| 1242 |
|
|
| 1243 |
template <typename V> |
|
| 1244 |
class ArcMap |
|
| 1245 |
: public SubMapExtender<SubGraphBase<GR, NF, EF, false>, |
|
| 1246 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
|
|
| 1247 |
typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, |
|
| 1248 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent; |
|
| 1249 |
|
|
| 1250 |
public: |
|
| 1251 |
typedef V Value; |
|
| 1252 |
|
|
| 1253 |
ArcMap(const SubGraphBase<GR, NF, EF, false>& adaptor) |
|
| 1254 |
: Parent(adaptor) {}
|
|
| 1255 |
ArcMap(const SubGraphBase<GR, NF, EF, false>& adaptor, const V& value) |
|
| 1256 |
: Parent(adaptor, value) {}
|
|
| 1257 |
|
|
| 1258 |
private: |
|
| 1259 |
ArcMap& operator=(const ArcMap& cmap) {
|
|
| 1260 |
return operator=<ArcMap>(cmap); |
|
| 1261 |
} |
|
| 1262 |
|
|
| 1263 |
template <typename CMap> |
|
| 1264 |
ArcMap& operator=(const CMap& cmap) {
|
|
| 1265 |
Parent::operator=(cmap); |
|
| 1266 |
return *this; |
|
| 1267 |
} |
|
| 1268 |
}; |
|
| 1269 |
|
|
| 1270 |
template <typename V> |
|
| 1271 |
class EdgeMap |
|
| 1272 |
: public SubMapExtender<SubGraphBase<GR, NF, EF, false>, |
|
| 1273 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
|
|
| 1274 |
typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, |
|
| 1275 |
LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent; |
|
| 1276 |
|
|
| 1277 |
public: |
|
| 1278 |
typedef V Value; |
|
| 1279 |
|
|
| 1280 |
EdgeMap(const SubGraphBase<GR, NF, EF, false>& adaptor) |
|
| 1281 |
: Parent(adaptor) {}
|
|
| 1282 |
|
|
| 1283 |
EdgeMap(const SubGraphBase<GR, NF, EF, false>& adaptor, const V& value) |
|
| 1284 |
: Parent(adaptor, value) {}
|
|
| 1285 |
|
|
| 1286 |
private: |
|
| 1287 |
EdgeMap& operator=(const EdgeMap& cmap) {
|
|
| 1288 |
return operator=<EdgeMap>(cmap); |
|
| 1289 |
} |
|
| 1290 |
|
|
| 1291 |
template <typename CMap> |
|
| 1292 |
EdgeMap& operator=(const CMap& cmap) {
|
|
| 1293 |
Parent::operator=(cmap); |
|
| 1294 |
return *this; |
|
| 1295 |
} |
|
| 1296 |
}; |
|
| 1297 |
|
|
| 1298 |
}; |
|
| 1299 |
|
|
| 1300 |
/// \ingroup graph_adaptors |
|
| 1301 |
/// |
|
| 1302 |
/// \brief Adaptor class for hiding nodes and edges in an undirected |
|
| 1303 |
/// graph. |
|
| 1304 |
/// |
|
| 1305 |
/// SubGraph can be used for hiding nodes and edges in a graph. |
|
| 1306 |
/// A \c bool node map and a \c bool edge map must be specified, which |
|
| 1307 |
/// define the filters for nodes and edges. |
|
| 1308 |
/// Only the nodes and edges with \c true filter value are |
|
| 1309 |
/// shown in the subgraph. The edges that are incident to hidden |
|
| 1310 |
/// nodes are also filtered out. |
|
| 1311 |
/// This adaptor conforms to the \ref concepts::Graph "Graph" concept. |
|
| 1312 |
/// |
|
| 1313 |
/// The adapted graph can also be modified through this adaptor |
|
| 1314 |
/// by adding or removing nodes or edges, unless the \c GR template |
|
| 1315 |
/// parameter is set to be \c const. |
|
| 1316 |
/// |
|
| 1317 |
/// \tparam GR The type of the adapted graph. |
|
| 1318 |
/// It must conform to the \ref concepts::Graph "Graph" concept. |
|
| 1319 |
/// It can also be specified to be \c const. |
|
| 1320 |
/// \tparam NF The type of the node filter map. |
|
| 1321 |
/// It must be a \c bool (or convertible) node map of the |
|
| 1322 |
/// adapted graph. The default type is |
|
| 1323 |
/// \ref concepts::Graph::NodeMap "GR::NodeMap<bool>". |
|
| 1324 |
/// \tparam EF The type of the edge filter map. |
|
| 1325 |
/// It must be a \c bool (or convertible) edge map of the |
|
| 1326 |
/// adapted graph. The default type is |
|
| 1327 |
/// \ref concepts::Graph::EdgeMap "GR::EdgeMap<bool>". |
|
| 1328 |
/// |
|
| 1329 |
/// \note The \c Node, \c Edge and \c Arc types of this adaptor and the |
|
| 1330 |
/// adapted graph are convertible to each other. |
|
| 1331 |
/// |
|
| 1332 |
/// \see FilterNodes |
|
| 1333 |
/// \see FilterEdges |
|
| 1334 |
#ifdef DOXYGEN |
|
| 1335 |
template<typename GR, typename NF, typename EF> |
|
| 1336 |
class SubGraph {
|
|
| 1337 |
#else |
|
| 1338 |
template<typename GR, |
|
| 1339 |
typename NF = typename GR::template NodeMap<bool>, |
|
| 1340 |
typename EF = typename GR::template EdgeMap<bool> > |
|
| 1341 |
class SubGraph : |
|
| 1342 |
public GraphAdaptorExtender<SubGraphBase<GR, NF, EF, true> > {
|
|
| 1343 |
#endif |
|
| 1344 |
public: |
|
| 1345 |
/// The type of the adapted graph. |
|
| 1346 |
typedef GR Graph; |
|
| 1347 |
/// The type of the node filter map. |
|
| 1348 |
typedef NF NodeFilterMap; |
|
| 1349 |
/// The type of the edge filter map. |
|
| 1350 |
typedef EF EdgeFilterMap; |
|
| 1351 |
|
|
| 1352 |
typedef GraphAdaptorExtender<SubGraphBase<GR, NF, EF, true> > |
|
| 1353 |
Parent; |
|
| 1354 |
|
|
| 1355 |
typedef typename Parent::Node Node; |
|
| 1356 |
typedef typename Parent::Edge Edge; |
|
| 1357 |
|
|
| 1358 |
protected: |
|
| 1359 |
SubGraph() { }
|
|
| 1360 |
public: |
|
| 1361 |
|
|
| 1362 |
/// \brief Constructor |
|
| 1363 |
/// |
|
| 1364 |
/// Creates a subgraph for the given graph with the given node |
|
| 1365 |
/// and edge filter maps. |
|
| 1366 |
SubGraph(GR& graph, NF& node_filter, EF& edge_filter) {
|
|
| 1367 |
initialize(graph, node_filter, edge_filter); |
|
| 1368 |
} |
|
| 1369 |
|
|
| 1370 |
/// \brief Sets the status of the given node |
|
| 1371 |
/// |
|
| 1372 |
/// This function sets the status of the given node. |
|
| 1373 |
/// It is done by simply setting the assigned value of \c n |
|
| 1374 |
/// to \c v in the node filter map. |
|
| 1375 |
void status(const Node& n, bool v) const { Parent::status(n, v); }
|
|
| 1376 |
|
|
| 1377 |
/// \brief Sets the status of the given edge |
|
| 1378 |
/// |
|
| 1379 |
/// This function sets the status of the given edge. |
|
| 1380 |
/// It is done by simply setting the assigned value of \c e |
|
| 1381 |
/// to \c v in the edge filter map. |
|
| 1382 |
void status(const Edge& e, bool v) const { Parent::status(e, v); }
|
|
| 1383 |
|
|
| 1384 |
/// \brief Returns the status of the given node |
|
| 1385 |
/// |
|
| 1386 |
/// This function returns the status of the given node. |
|
| 1387 |
/// It is \c true if the given node is enabled (i.e. not hidden). |
|
| 1388 |
bool status(const Node& n) const { return Parent::status(n); }
|
|
| 1389 |
|
|
| 1390 |
/// \brief Returns the status of the given edge |
|
| 1391 |
/// |
|
| 1392 |
/// This function returns the status of the given edge. |
|
| 1393 |
/// It is \c true if the given edge is enabled (i.e. not hidden). |
|
| 1394 |
bool status(const Edge& e) const { return Parent::status(e); }
|
|
| 1395 |
|
|
| 1396 |
/// \brief Disables the given node |
|
| 1397 |
/// |
|
| 1398 |
/// This function disables the given node in the subdigraph, |
|
| 1399 |
/// so the iteration jumps over it. |
|
| 1400 |
/// It is the same as \ref status() "status(n, false)". |
|
| 1401 |
void disable(const Node& n) const { Parent::status(n, false); }
|
|
| 1402 |
|
|
| 1403 |
/// \brief Disables the given edge |
|
| 1404 |
/// |
|
| 1405 |
/// This function disables the given edge in the subgraph, |
|
| 1406 |
/// so the iteration jumps over it. |
|
| 1407 |
/// It is the same as \ref status() "status(e, false)". |
|
| 1408 |
void disable(const Edge& e) const { Parent::status(e, false); }
|
|
| 1409 |
|
|
| 1410 |
/// \brief Enables the given node |
|
| 1411 |
/// |
|
| 1412 |
/// This function enables the given node in the subdigraph. |
|
| 1413 |
/// It is the same as \ref status() "status(n, true)". |
|
| 1414 |
void enable(const Node& n) const { Parent::status(n, true); }
|
|
| 1415 |
|
|
| 1416 |
/// \brief Enables the given edge |
|
| 1417 |
/// |
|
| 1418 |
/// This function enables the given edge in the subgraph. |
|
| 1419 |
/// It is the same as \ref status() "status(e, true)". |
|
| 1420 |
void enable(const Edge& e) const { Parent::status(e, true); }
|
|
| 1421 |
|
|
| 1422 |
}; |
|
| 1423 |
|
|
| 1424 |
/// \brief Returns a read-only SubGraph adaptor |
|
| 1425 |
/// |
|
| 1426 |
/// This function just returns a read-only \ref SubGraph adaptor. |
|
| 1427 |
/// \ingroup graph_adaptors |
|
| 1428 |
/// \relates SubGraph |
|
| 1429 |
template<typename GR, typename NF, typename EF> |
|
| 1430 |
SubGraph<const GR, NF, EF> |
|
| 1431 |
subGraph(const GR& graph, NF& node_filter, EF& edge_filter) {
|
|
| 1432 |
return SubGraph<const GR, NF, EF> |
|
| 1433 |
(graph, node_filter, edge_filter); |
|
| 1434 |
} |
|
| 1435 |
|
|
| 1436 |
template<typename GR, typename NF, typename EF> |
|
| 1437 |
SubGraph<const GR, const NF, EF> |
|
| 1438 |
subGraph(const GR& graph, const NF& node_filter, EF& edge_filter) {
|
|
| 1439 |
return SubGraph<const GR, const NF, EF> |
|
| 1440 |
(graph, node_filter, edge_filter); |
|
| 1441 |
} |
|
| 1442 |
|
|
| 1443 |
template<typename GR, typename NF, typename EF> |
|
| 1444 |
SubGraph<const GR, NF, const EF> |
|
| 1445 |
subGraph(const GR& graph, NF& node_filter, const EF& edge_filter) {
|
|
| 1446 |
return SubGraph<const GR, NF, const EF> |
|
| 1447 |
(graph, node_filter, edge_filter); |
|
| 1448 |
} |
|
| 1449 |
|
|
| 1450 |
template<typename GR, typename NF, typename EF> |
|
| 1451 |
SubGraph<const GR, const NF, const EF> |
|
| 1452 |
subGraph(const GR& graph, const NF& node_filter, const EF& edge_filter) {
|
|
| 1453 |
return SubGraph<const GR, const NF, const EF> |
|
| 1454 |
(graph, node_filter, edge_filter); |
|
| 1455 |
} |
|
| 1456 |
|
|
| 1457 |
|
|
| 1458 |
/// \ingroup graph_adaptors |
|
| 1459 |
/// |
|
| 1460 |
/// \brief Adaptor class for hiding nodes in a digraph or a graph. |
|
| 1461 |
/// |
|
| 1462 |
/// FilterNodes adaptor can be used for hiding nodes in a digraph or a |
|
| 1463 |
/// graph. A \c bool node map must be specified, which defines the filter |
|
| 1464 |
/// for the nodes. Only the nodes with \c true filter value and the |
|
| 1465 |
/// arcs/edges incident to nodes both with \c true filter value are shown |
|
| 1466 |
/// in the subgraph. This adaptor conforms to the \ref concepts::Digraph |
|
| 1467 |
/// "Digraph" concept or the \ref concepts::Graph "Graph" concept |
|
| 1468 |
/// depending on the \c GR template parameter. |
|
| 1469 |
/// |
|
| 1470 |
/// The adapted (di)graph can also be modified through this adaptor |
|
| 1471 |
/// by adding or removing nodes or arcs/edges, unless the \c GR template |
|
| 1472 |
/// parameter is set to be \c const. |
|
| 1473 |
/// |
|
| 1474 |
/// \tparam GR The type of the adapted digraph or graph. |
|
| 1475 |
/// It must conform to the \ref concepts::Digraph "Digraph" concept |
|
| 1476 |
/// or the \ref concepts::Graph "Graph" concept. |
|
| 1477 |
/// It can also be specified to be \c const. |
|
| 1478 |
/// \tparam NF The type of the node filter map. |
|
| 1479 |
/// It must be a \c bool (or convertible) node map of the |
|
| 1480 |
/// adapted (di)graph. The default type is |
|
| 1481 |
/// \ref concepts::Graph::NodeMap "GR::NodeMap<bool>". |
|
| 1482 |
/// |
|
| 1483 |
/// \note The \c Node and <tt>Arc/Edge</tt> types of this adaptor and the |
|
| 1484 |
/// adapted (di)graph are convertible to each other. |
|
| 1485 |
#ifdef DOXYGEN |
|
| 1486 |
template<typename GR, typename NF> |
|
| 1487 |
class FilterNodes {
|
|
| 1488 |
#else |
|
| 1489 |
template<typename GR, |
|
| 1490 |
typename NF = typename GR::template NodeMap<bool>, |
|
| 1491 |
typename Enable = void> |
|
| 1492 |
class FilterNodes : |
|
| 1493 |
public DigraphAdaptorExtender< |
|
| 1494 |
SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >, |
|
| 1495 |
true> > {
|
|
| 1496 |
#endif |
|
| 1497 |
typedef DigraphAdaptorExtender< |
|
| 1498 |
SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >, |
|
| 1499 |
true> > Parent; |
|
| 1500 |
|
|
| 1501 |
public: |
|
| 1502 |
|
|
| 1503 |
typedef GR Digraph; |
|
| 1504 |
typedef NF NodeFilterMap; |
|
| 1505 |
|
|
| 1506 |
typedef typename Parent::Node Node; |
|
| 1507 |
|
|
| 1508 |
protected: |
|
| 1509 |
ConstMap<typename Digraph::Arc, Const<bool, true> > const_true_map; |
|
| 1510 |
|
|
| 1511 |
FilterNodes() : const_true_map() {}
|
|
| 1512 |
|
|
| 1513 |
public: |
|
| 1514 |
|
|
| 1515 |
/// \brief Constructor |
|
| 1516 |
/// |
|
| 1517 |
/// Creates a subgraph for the given digraph or graph with the |
|
| 1518 |
/// given node filter map. |
|
| 1519 |
FilterNodes(GR& graph, NF& node_filter) |
|
| 1520 |
: Parent(), const_true_map() |
|
| 1521 |
{
|
|
| 1522 |
Parent::initialize(graph, node_filter, const_true_map); |
|
| 1523 |
} |
|
| 1524 |
|
|
| 1525 |
/// \brief Sets the status of the given node |
|
| 1526 |
/// |
|
| 1527 |
/// This function sets the status of the given node. |
|
| 1528 |
/// It is done by simply setting the assigned value of \c n |
|
| 1529 |
/// to \c v in the node filter map. |
|
| 1530 |
void status(const Node& n, bool v) const { Parent::status(n, v); }
|
|
| 1531 |
|
|
| 1532 |
/// \brief Returns the status of the given node |
|
| 1533 |
/// |
|
| 1534 |
/// This function returns the status of the given node. |
|
| 1535 |
/// It is \c true if the given node is enabled (i.e. not hidden). |
|
| 1536 |
bool status(const Node& n) const { return Parent::status(n); }
|
|
| 1537 |
|
|
| 1538 |
/// \brief Disables the given node |
|
| 1539 |
/// |
|
| 1540 |
/// This function disables the given node, so the iteration |
|
| 1541 |
/// jumps over it. |
|
| 1542 |
/// It is the same as \ref status() "status(n, false)". |
|
| 1543 |
void disable(const Node& n) const { Parent::status(n, false); }
|
|
| 1544 |
|
|
| 1545 |
/// \brief Enables the given node |
|
| 1546 |
/// |
|
| 1547 |
/// This function enables the given node. |
|
| 1548 |
/// It is the same as \ref status() "status(n, true)". |
|
| 1549 |
void enable(const Node& n) const { Parent::status(n, true); }
|
|
| 1550 |
|
|
| 1551 |
}; |
|
| 1552 |
|
|
| 1553 |
template<typename GR, typename NF> |
|
| 1554 |
class FilterNodes<GR, NF, |
|
| 1555 |
typename enable_if<UndirectedTagIndicator<GR> >::type> : |
|
| 1556 |
public GraphAdaptorExtender< |
|
| 1557 |
SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, |
|
| 1558 |
true> > {
|
|
| 1559 |
|
|
| 1560 |
typedef GraphAdaptorExtender< |
|
| 1561 |
SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, |
|
| 1562 |
true> > Parent; |
|
| 1563 |
|
|
| 1564 |
public: |
|
| 1565 |
|
|
| 1566 |
typedef GR Graph; |
|
| 1567 |
typedef NF NodeFilterMap; |
|
| 1568 |
|
|
| 1569 |
typedef typename Parent::Node Node; |
|
| 1570 |
|
|
| 1571 |
protected: |
|
| 1572 |
ConstMap<typename GR::Edge, Const<bool, true> > const_true_map; |
|
| 1573 |
|
|
| 1574 |
FilterNodes() : const_true_map() {}
|
|
| 1575 |
|
|
| 1576 |
public: |
|
| 1577 |
|
|
| 1578 |
FilterNodes(GR& graph, NodeFilterMap& node_filter) : |
|
| 1579 |
Parent(), const_true_map() {
|
|
| 1580 |
Parent::initialize(graph, node_filter, const_true_map); |
|
| 1581 |
} |
|
| 1582 |
|
|
| 1583 |
void status(const Node& n, bool v) const { Parent::status(n, v); }
|
|
| 1584 |
bool status(const Node& n) const { return Parent::status(n); }
|
|
| 1585 |
void disable(const Node& n) const { Parent::status(n, false); }
|
|
| 1586 |
void enable(const Node& n) const { Parent::status(n, true); }
|
|
| 1587 |
|
|
| 1588 |
}; |
|
| 1589 |
|
|
| 1590 |
|
|
| 1591 |
/// \brief Returns a read-only FilterNodes adaptor |
|
| 1592 |
/// |
|
| 1593 |
/// This function just returns a read-only \ref FilterNodes adaptor. |
|
| 1594 |
/// \ingroup graph_adaptors |
|
| 1595 |
/// \relates FilterNodes |
|
| 1596 |
template<typename GR, typename NF> |
|
| 1597 |
FilterNodes<const GR, NF> |
|
| 1598 |
filterNodes(const GR& graph, NF& node_filter) {
|
|
| 1599 |
return FilterNodes<const GR, NF>(graph, node_filter); |
|
| 1600 |
} |
|
| 1601 |
|
|
| 1602 |
template<typename GR, typename NF> |
|
| 1603 |
FilterNodes<const GR, const NF> |
|
| 1604 |
filterNodes(const GR& graph, const NF& node_filter) {
|
|
| 1605 |
return FilterNodes<const GR, const NF>(graph, node_filter); |
|
| 1606 |
} |
|
| 1607 |
|
|
| 1608 |
/// \ingroup graph_adaptors |
|
| 1609 |
/// |
|
| 1610 |
/// \brief Adaptor class for hiding arcs in a digraph. |
|
| 1611 |
/// |
|
| 1612 |
/// FilterArcs adaptor can be used for hiding arcs in a digraph. |
|
| 1613 |
/// A \c bool arc map must be specified, which defines the filter for |
|
| 1614 |
/// the arcs. Only the arcs with \c true filter value are shown in the |
|
| 1615 |
/// subdigraph. This adaptor conforms to the \ref concepts::Digraph |
|
| 1616 |
/// "Digraph" concept. |
|
| 1617 |
/// |
|
| 1618 |
/// The adapted digraph can also be modified through this adaptor |
|
| 1619 |
/// by adding or removing nodes or arcs, unless the \c GR template |
|
| 1620 |
/// parameter is set to be \c const. |
|
| 1621 |
/// |
|
| 1622 |
/// \tparam DGR The type of the adapted digraph. |
|
| 1623 |
/// It must conform to the \ref concepts::Digraph "Digraph" concept. |
|
| 1624 |
/// It can also be specified to be \c const. |
|
| 1625 |
/// \tparam AF The type of the arc filter map. |
|
| 1626 |
/// It must be a \c bool (or convertible) arc map of the |
|
| 1627 |
/// adapted digraph. The default type is |
|
| 1628 |
/// \ref concepts::Digraph::ArcMap "DGR::ArcMap<bool>". |
|
| 1629 |
/// |
|
| 1630 |
/// \note The \c Node and \c Arc types of this adaptor and the adapted |
|
| 1631 |
/// digraph are convertible to each other. |
|
| 1632 |
#ifdef DOXYGEN |
|
| 1633 |
template<typename DGR, |
|
| 1634 |
typename AF> |
|
| 1635 |
class FilterArcs {
|
|
| 1636 |
#else |
|
| 1637 |
template<typename DGR, |
|
| 1638 |
typename AF = typename DGR::template ArcMap<bool> > |
|
| 1639 |
class FilterArcs : |
|
| 1640 |
public DigraphAdaptorExtender< |
|
| 1641 |
SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >, |
|
| 1642 |
AF, false> > {
|
|
| 1643 |
#endif |
|
| 1644 |
typedef DigraphAdaptorExtender< |
|
| 1645 |
SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >, |
|
| 1646 |
AF, false> > Parent; |
|
| 1647 |
|
|
| 1648 |
public: |
|
| 1649 |
|
|
| 1650 |
/// The type of the adapted digraph. |
|
| 1651 |
typedef DGR Digraph; |
|
| 1652 |
/// The type of the arc filter map. |
|
| 1653 |
typedef AF ArcFilterMap; |
|
| 1654 |
|
|
| 1655 |
typedef typename Parent::Arc Arc; |
|
| 1656 |
|
|
| 1657 |
protected: |
|
| 1658 |
ConstMap<typename DGR::Node, Const<bool, true> > const_true_map; |
|
| 1659 |
|
|
| 1660 |
FilterArcs() : const_true_map() {}
|
|
| 1661 |
|
|
| 1662 |
public: |
|
| 1663 |
|
|
| 1664 |
/// \brief Constructor |
|
| 1665 |
/// |
|
| 1666 |
/// Creates a subdigraph for the given digraph with the given arc |
|
| 1667 |
/// filter map. |
|
| 1668 |
FilterArcs(DGR& digraph, ArcFilterMap& arc_filter) |
|
| 1669 |
: Parent(), const_true_map() {
|
|
| 1670 |
Parent::initialize(digraph, const_true_map, arc_filter); |
|
| 1671 |
} |
|
| 1672 |
|
|
| 1673 |
/// \brief Sets the status of the given arc |
|
| 1674 |
/// |
|
| 1675 |
/// This function sets the status of the given arc. |
|
| 1676 |
/// It is done by simply setting the assigned value of \c a |
|
| 1677 |
/// to \c v in the arc filter map. |
|
| 1678 |
void status(const Arc& a, bool v) const { Parent::status(a, v); }
|
|
| 1679 |
|
|
| 1680 |
/// \brief Returns the status of the given arc |
|
| 1681 |
/// |
|
| 1682 |
/// This function returns the status of the given arc. |
|
| 1683 |
/// It is \c true if the given arc is enabled (i.e. not hidden). |
|
| 1684 |
bool status(const Arc& a) const { return Parent::status(a); }
|
|
| 1685 |
|
|
| 1686 |
/// \brief Disables the given arc |
|
| 1687 |
/// |
|
| 1688 |
/// This function disables the given arc in the subdigraph, |
|
| 1689 |
/// so the iteration jumps over it. |
|
| 1690 |
/// It is the same as \ref status() "status(a, false)". |
|
| 1691 |
void disable(const Arc& a) const { Parent::status(a, false); }
|
|
| 1692 |
|
|
| 1693 |
/// \brief Enables the given arc |
|
| 1694 |
/// |
|
| 1695 |
/// This function enables the given arc in the subdigraph. |
|
| 1696 |
/// It is the same as \ref status() "status(a, true)". |
|
| 1697 |
void enable(const Arc& a) const { Parent::status(a, true); }
|
|
| 1698 |
|
|
| 1699 |
}; |
|
| 1700 |
|
|
| 1701 |
/// \brief Returns a read-only FilterArcs adaptor |
|
| 1702 |
/// |
|
| 1703 |
/// This function just returns a read-only \ref FilterArcs adaptor. |
|
| 1704 |
/// \ingroup graph_adaptors |
|
| 1705 |
/// \relates FilterArcs |
|
| 1706 |
template<typename DGR, typename AF> |
|
| 1707 |
FilterArcs<const DGR, AF> |
|
| 1708 |
filterArcs(const DGR& digraph, AF& arc_filter) {
|
|
| 1709 |
return FilterArcs<const DGR, AF>(digraph, arc_filter); |
|
| 1710 |
} |
|
| 1711 |
|
|
| 1712 |
template<typename DGR, typename AF> |
|
| 1713 |
FilterArcs<const DGR, const AF> |
|
| 1714 |
filterArcs(const DGR& digraph, const AF& arc_filter) {
|
|
| 1715 |
return FilterArcs<const DGR, const AF>(digraph, arc_filter); |
|
| 1716 |
} |
|
| 1717 |
|
|
| 1718 |
/// \ingroup graph_adaptors |
|
| 1719 |
/// |
|
| 1720 |
/// \brief Adaptor class for hiding edges in a graph. |
|
| 1721 |
/// |
|
| 1722 |
/// FilterEdges adaptor can be used for hiding edges in a graph. |
|
| 1723 |
/// A \c bool edge map must be specified, which defines the filter for |
|
| 1724 |
/// the edges. Only the edges with \c true filter value are shown in the |
|
| 1725 |
/// subgraph. This adaptor conforms to the \ref concepts::Graph |
|
| 1726 |
/// "Graph" concept. |
|
| 1727 |
/// |
|
| 1728 |
/// The adapted graph can also be modified through this adaptor |
|
| 1729 |
/// by adding or removing nodes or edges, unless the \c GR template |
|
| 1730 |
/// parameter is set to be \c const. |
|
| 1731 |
/// |
|
| 1732 |
/// \tparam GR The type of the adapted graph. |
|
| 1733 |
/// It must conform to the \ref concepts::Graph "Graph" concept. |
|
| 1734 |
/// It can also be specified to be \c const. |
|
| 1735 |
/// \tparam EF The type of the edge filter map. |
|
| 1736 |
/// It must be a \c bool (or convertible) edge map of the |
|
| 1737 |
/// adapted graph. The default type is |
|
| 1738 |
/// \ref concepts::Graph::EdgeMap "GR::EdgeMap<bool>". |
|
| 1739 |
/// |
|
| 1740 |
/// \note The \c Node, \c Edge and \c Arc types of this adaptor and the |
|
| 1741 |
/// adapted graph are convertible to each other. |
|
| 1742 |
#ifdef DOXYGEN |
|
| 1743 |
template<typename GR, |
|
| 1744 |
typename EF> |
|
| 1745 |
class FilterEdges {
|
|
| 1746 |
#else |
|
| 1747 |
template<typename GR, |
|
| 1748 |
typename EF = typename GR::template EdgeMap<bool> > |
|
| 1749 |
class FilterEdges : |
|
| 1750 |
public GraphAdaptorExtender< |
|
| 1751 |
SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true> >, |
|
| 1752 |
EF, false> > {
|
|
| 1753 |
#endif |
|
| 1754 |
typedef GraphAdaptorExtender< |
|
| 1755 |
SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >, |
|
| 1756 |
EF, false> > Parent; |
|
| 1757 |
|
|
| 1758 |
public: |
|
| 1759 |
|
|
| 1760 |
/// The type of the adapted graph. |
|
| 1761 |
typedef GR Graph; |
|
| 1762 |
/// The type of the edge filter map. |
|
| 1763 |
typedef EF EdgeFilterMap; |
|
| 1764 |
|
|
| 1765 |
typedef typename Parent::Edge Edge; |
|
| 1766 |
|
|
| 1767 |
protected: |
|
| 1768 |
ConstMap<typename GR::Node, Const<bool, true> > const_true_map; |
|
| 1769 |
|
|
| 1770 |
FilterEdges() : const_true_map(true) {
|
|
| 1771 |
Parent::setNodeFilterMap(const_true_map); |
|
| 1772 |
} |
|
| 1773 |
|
|
| 1774 |
public: |
|
| 1775 |
|
|
| 1776 |
/// \brief Constructor |
|
| 1777 |
/// |
|
| 1778 |
/// Creates a subgraph for the given graph with the given edge |
|
| 1779 |
/// filter map. |
|
| 1780 |
FilterEdges(GR& graph, EF& edge_filter) |
|
| 1781 |
: Parent(), const_true_map() {
|
|
| 1782 |
Parent::initialize(graph, const_true_map, edge_filter); |
|
| 1783 |
} |
|
| 1784 |
|
|
| 1785 |
/// \brief Sets the status of the given edge |
|
| 1786 |
/// |
|
| 1787 |
/// This function sets the status of the given edge. |
|
| 1788 |
/// It is done by simply setting the assigned value of \c e |
|
| 1789 |
/// to \c v in the edge filter map. |
|
| 1790 |
void status(const Edge& e, bool v) const { Parent::status(e, v); }
|
|
| 1791 |
|
|
| 1792 |
/// \brief Returns the status of the given edge |
|
| 1793 |
/// |
|
| 1794 |
/// This function returns the status of the given edge. |
|
| 1795 |
/// It is \c true if the given edge is enabled (i.e. not hidden). |
|
| 1796 |
bool status(const Edge& e) const { return Parent::status(e); }
|
|
| 1797 |
|
|
| 1798 |
/// \brief Disables the given edge |
|
| 1799 |
/// |
|
| 1800 |
/// This function disables the given edge in the subgraph, |
|
| 1801 |
/// so the iteration jumps over it. |
|
| 1802 |
/// It is the same as \ref status() "status(e, false)". |
|
| 1803 |
void disable(const Edge& e) const { Parent::status(e, false); }
|
|
| 1804 |
|
|
| 1805 |
/// \brief Enables the given edge |
|
| 1806 |
/// |
|
| 1807 |
/// This function enables the given edge in the subgraph. |
|
| 1808 |
/// It is the same as \ref status() "status(e, true)". |
|
| 1809 |
void enable(const Edge& e) const { Parent::status(e, true); }
|
|
| 1810 |
|
|
| 1811 |
}; |
|
| 1812 |
|
|
| 1813 |
/// \brief Returns a read-only FilterEdges adaptor |
|
| 1814 |
/// |
|
| 1815 |
/// This function just returns a read-only \ref FilterEdges adaptor. |
|
| 1816 |
/// \ingroup graph_adaptors |
|
| 1817 |
/// \relates FilterEdges |
|
| 1818 |
template<typename GR, typename EF> |
|
| 1819 |
FilterEdges<const GR, EF> |
|
| 1820 |
filterEdges(const GR& graph, EF& edge_filter) {
|
|
| 1821 |
return FilterEdges<const GR, EF>(graph, edge_filter); |
|
| 1822 |
} |
|
| 1823 |
|
|
| 1824 |
template<typename GR, typename EF> |
|
| 1825 |
FilterEdges<const GR, const EF> |
|
| 1826 |
filterEdges(const GR& graph, const EF& edge_filter) {
|
|
| 1827 |
return FilterEdges<const GR, const EF>(graph, edge_filter); |
|
| 1828 |
} |
|
| 1829 |
|
|
| 1830 |
|
|
| 1831 |
template <typename DGR> |
|
| 1832 |
class UndirectorBase {
|
|
| 1833 |
public: |
|
| 1834 |
typedef DGR Digraph; |
|
| 1835 |
typedef UndirectorBase Adaptor; |
|
| 1836 |
|
|
| 1837 |
typedef True UndirectedTag; |
|
| 1838 |
|
|
| 1839 |
typedef typename Digraph::Arc Edge; |
|
| 1840 |
typedef typename Digraph::Node Node; |
|
| 1841 |
|
|
| 1842 |
class Arc {
|
|
| 1843 |
friend class UndirectorBase; |
|
| 1844 |
protected: |
|
| 1845 |
Edge _edge; |
|
| 1846 |
bool _forward; |
|
| 1847 |
|
|
| 1848 |
Arc(const Edge& edge, bool forward) |
|
| 1849 |
: _edge(edge), _forward(forward) {}
|
|
| 1850 |
|
|
| 1851 |
public: |
|
| 1852 |
Arc() {}
|
|
| 1853 |
|
|
| 1854 |
Arc(Invalid) : _edge(INVALID), _forward(true) {}
|
|
| 1855 |
|
|
| 1856 |
operator const Edge&() const { return _edge; }
|
|
| 1857 |
|
|
| 1858 |
bool operator==(const Arc &other) const {
|
|
| 1859 |
return _forward == other._forward && _edge == other._edge; |
|
| 1860 |
} |
|
| 1861 |
bool operator!=(const Arc &other) const {
|
|
| 1862 |
return _forward != other._forward || _edge != other._edge; |
|
| 1863 |
} |
|
| 1864 |
bool operator<(const Arc &other) const {
|
|
| 1865 |
return _forward < other._forward || |
|
| 1866 |
(_forward == other._forward && _edge < other._edge); |
|
| 1867 |
} |
|
| 1868 |
}; |
|
| 1869 |
|
|
| 1870 |
void first(Node& n) const {
|
|
| 1871 |
_digraph->first(n); |
|
| 1872 |
} |
|
| 1873 |
|
|
| 1874 |
void next(Node& n) const {
|
|
| 1875 |
_digraph->next(n); |
|
| 1876 |
} |
|
| 1877 |
|
|
| 1878 |
void first(Arc& a) const {
|
|
| 1879 |
_digraph->first(a._edge); |
|
| 1880 |
a._forward = true; |
|
| 1881 |
} |
|
| 1882 |
|
|
| 1883 |
void next(Arc& a) const {
|
|
| 1884 |
if (a._forward) {
|
|
| 1885 |
a._forward = false; |
|
| 1886 |
} else {
|
|
| 1887 |
_digraph->next(a._edge); |
|
| 1888 |
a._forward = true; |
|
| 1889 |
} |
|
| 1890 |
} |
|
| 1891 |
|
|
| 1892 |
void first(Edge& e) const {
|
|
| 1893 |
_digraph->first(e); |
|
| 1894 |
} |
|
| 1895 |
|
|
| 1896 |
void next(Edge& e) const {
|
|
| 1897 |
_digraph->next(e); |
|
| 1898 |
} |
|
| 1899 |
|
|
| 1900 |
void firstOut(Arc& a, const Node& n) const {
|
|
| 1901 |
_digraph->firstIn(a._edge, n); |
|
| 1902 |
if (a._edge != INVALID ) {
|
|
| 1903 |
a._forward = false; |
|
| 1904 |
} else {
|
|
| 1905 |
_digraph->firstOut(a._edge, n); |
|
| 1906 |
a._forward = true; |
|
| 1907 |
} |
|
| 1908 |
} |
|
| 1909 |
void nextOut(Arc &a) const {
|
|
| 1910 |
if (!a._forward) {
|
|
| 1911 |
Node n = _digraph->target(a._edge); |
|
| 1912 |
_digraph->nextIn(a._edge); |
|
| 1913 |
if (a._edge == INVALID) {
|
|
| 1914 |
_digraph->firstOut(a._edge, n); |
|
| 1915 |
a._forward = true; |
|
| 1916 |
} |
|
| 1917 |
} |
|
| 1918 |
else {
|
|
| 1919 |
_digraph->nextOut(a._edge); |
|
| 1920 |
} |
|
| 1921 |
} |
|
| 1922 |
|
|
| 1923 |
void firstIn(Arc &a, const Node &n) const {
|
|
| 1924 |
_digraph->firstOut(a._edge, n); |
|
| 1925 |
if (a._edge != INVALID ) {
|
|
| 1926 |
a._forward = false; |
|
| 1927 |
} else {
|
|
| 1928 |
_digraph->firstIn(a._edge, n); |
|
| 1929 |
a._forward = true; |
|
| 1930 |
} |
|
| 1931 |
} |
|
| 1932 |
void nextIn(Arc &a) const {
|
|
| 1933 |
if (!a._forward) {
|
|
| 1934 |
Node n = _digraph->source(a._edge); |
|
| 1935 |
_digraph->nextOut(a._edge); |
|
| 1936 |
if (a._edge == INVALID ) {
|
|
| 1937 |
_digraph->firstIn(a._edge, n); |
|
| 1938 |
a._forward = true; |
|
| 1939 |
} |
|
| 1940 |
} |
|
| 1941 |
else {
|
|
| 1942 |
_digraph->nextIn(a._edge); |
|
| 1943 |
} |
|
| 1944 |
} |
|
| 1945 |
|
|
| 1946 |
void firstInc(Edge &e, bool &d, const Node &n) const {
|
|
| 1947 |
d = true; |
|
| 1948 |
_digraph->firstOut(e, n); |
|
| 1949 |
if (e != INVALID) return; |
|
| 1950 |
d = false; |
|
| 1951 |
_digraph->firstIn(e, n); |
|
| 1952 |
} |
|
| 1953 |
|
|
| 1954 |
void nextInc(Edge &e, bool &d) const {
|
|
| 1955 |
if (d) {
|
|
| 1956 |
Node s = _digraph->source(e); |
|
| 1957 |
_digraph->nextOut(e); |
|
| 1958 |
if (e != INVALID) return; |
|
| 1959 |
d = false; |
|
| 1960 |
_digraph->firstIn(e, s); |
|
| 1961 |
} else {
|
|
| 1962 |
_digraph->nextIn(e); |
|
| 1963 |
} |
|
| 1964 |
} |
|
| 1965 |
|
|
| 1966 |
Node u(const Edge& e) const {
|
|
| 1967 |
return _digraph->source(e); |
|
| 1968 |
} |
|
| 1969 |
|
|
| 1970 |
Node v(const Edge& e) const {
|
|
| 1971 |
return _digraph->target(e); |
|
| 1972 |
} |
|
| 1973 |
|
|
| 1974 |
Node source(const Arc &a) const {
|
|
| 1975 |
return a._forward ? _digraph->source(a._edge) : _digraph->target(a._edge); |
|
| 1976 |
} |
|
| 1977 |
|
|
| 1978 |
Node target(const Arc &a) const {
|
|
| 1979 |
return a._forward ? _digraph->target(a._edge) : _digraph->source(a._edge); |
|
| 1980 |
} |
|
| 1981 |
|
|
| 1982 |
static Arc direct(const Edge &e, bool d) {
|
|
| 1983 |
return Arc(e, d); |
|
| 1984 |
} |
|
| 1985 |
|
|
| 1986 |
static bool direction(const Arc &a) { return a._forward; }
|
|
| 1987 |
|
|
| 1988 |
Node nodeFromId(int ix) const { return _digraph->nodeFromId(ix); }
|
|
| 1989 |
Arc arcFromId(int ix) const {
|
|
| 1990 |
return direct(_digraph->arcFromId(ix >> 1), bool(ix & 1)); |
|
| 1991 |
} |
|
| 1992 |
Edge edgeFromId(int ix) const { return _digraph->arcFromId(ix); }
|
|
| 1993 |
|
|
| 1994 |
int id(const Node &n) const { return _digraph->id(n); }
|
|
| 1995 |
int id(const Arc &a) const {
|
|
| 1996 |
return (_digraph->id(a) << 1) | (a._forward ? 1 : 0); |
|
| 1997 |
} |
|
| 1998 |
int id(const Edge &e) const { return _digraph->id(e); }
|
|
| 1999 |
|
|
| 2000 |
int maxNodeId() const { return _digraph->maxNodeId(); }
|
|
| 2001 |
int maxArcId() const { return (_digraph->maxArcId() << 1) | 1; }
|
|
| 2002 |
int maxEdgeId() const { return _digraph->maxArcId(); }
|
|
| 2003 |
|
|
| 2004 |
Node addNode() { return _digraph->addNode(); }
|
|
| 2005 |
Edge addEdge(const Node& u, const Node& v) {
|
|
| 2006 |
return _digraph->addArc(u, v); |
|
| 2007 |
} |
|
| 2008 |
|
|
| 2009 |
void erase(const Node& i) { _digraph->erase(i); }
|
|
| 2010 |
void erase(const Edge& i) { _digraph->erase(i); }
|
|
| 2011 |
|
|
| 2012 |
void clear() { _digraph->clear(); }
|
|
| 2013 |
|
|
| 2014 |
typedef NodeNumTagIndicator<Digraph> NodeNumTag; |
|
| 2015 |
int nodeNum() const { return _digraph->nodeNum(); }
|
|
| 2016 |
|
|
| 2017 |
typedef ArcNumTagIndicator<Digraph> ArcNumTag; |
|
| 2018 |
int arcNum() const { return 2 * _digraph->arcNum(); }
|
|
| 2019 |
|
|
| 2020 |
typedef ArcNumTag EdgeNumTag; |
|
| 2021 |
int edgeNum() const { return _digraph->arcNum(); }
|
|
| 2022 |
|
|
| 2023 |
typedef FindArcTagIndicator<Digraph> FindArcTag; |
|
| 2024 |
Arc findArc(Node s, Node t, Arc p = INVALID) const {
|
|
| 2025 |
if (p == INVALID) {
|
|
| 2026 |
Edge arc = _digraph->findArc(s, t); |
|
| 2027 |
if (arc != INVALID) return direct(arc, true); |
|
| 2028 |
arc = _digraph->findArc(t, s); |
|
| 2029 |
if (arc != INVALID) return direct(arc, false); |
|
| 2030 |
} else if (direction(p)) {
|
|
| 2031 |
Edge arc = _digraph->findArc(s, t, p); |
|
| 2032 |
if (arc != INVALID) return direct(arc, true); |
|
| 2033 |
arc = _digraph->findArc(t, s); |
|
| 2034 |
if (arc != INVALID) return direct(arc, false); |
|
| 2035 |
} else {
|
|
| 2036 |
Edge arc = _digraph->findArc(t, s, p); |
|
| 2037 |
if (arc != INVALID) return direct(arc, false); |
|
| 2038 |
} |
|
| 2039 |
return INVALID; |
|
| 2040 |
} |
|
| 2041 |
|
|
| 2042 |
typedef FindArcTag FindEdgeTag; |
|
| 2043 |
Edge findEdge(Node s, Node t, Edge p = INVALID) const {
|
|
| 2044 |
if (s != t) {
|
|
| 2045 |
if (p == INVALID) {
|
|
| 2046 |
Edge arc = _digraph->findArc(s, t); |
|
| 2047 |
if (arc != INVALID) return arc; |
|
| 2048 |
arc = _digraph->findArc(t, s); |
|
| 2049 |
if (arc != INVALID) return arc; |
|
| 2050 |
} else if (_digraph->source(p) == s) {
|
|
| 2051 |
Edge arc = _digraph->findArc(s, t, p); |
|
| 2052 |
if (arc != INVALID) return arc; |
|
| 2053 |
arc = _digraph->findArc(t, s); |
|
| 2054 |
if (arc != INVALID) return arc; |
|
| 2055 |
} else {
|
|
| 2056 |
Edge arc = _digraph->findArc(t, s, p); |
|
| 2057 |
if (arc != INVALID) return arc; |
|
| 2058 |
} |
|
| 2059 |
} else {
|
|
| 2060 |
return _digraph->findArc(s, t, p); |
|
| 2061 |
} |
|
| 2062 |
return INVALID; |
|
| 2063 |
} |
|
| 2064 |
|
|
| 2065 |
private: |
|
| 2066 |
|
|
| 2067 |
template <typename V> |
|
| 2068 |
class ArcMapBase {
|
|
| 2069 |
private: |
|
| 2070 |
|
|
| 2071 |
typedef typename DGR::template ArcMap<V> MapImpl; |
|
| 2072 |
|
|
| 2073 |
public: |
|
| 2074 |
|
|
| 2075 |
typedef typename MapTraits<MapImpl>::ReferenceMapTag ReferenceMapTag; |
|
| 2076 |
|
|
| 2077 |
typedef V Value; |
|
| 2078 |
typedef Arc Key; |
|
| 2079 |
typedef typename MapTraits<MapImpl>::ConstReturnValue ConstReturnValue; |
|
| 2080 |
typedef typename MapTraits<MapImpl>::ReturnValue ReturnValue; |
|
| 2081 |
typedef typename MapTraits<MapImpl>::ConstReturnValue ConstReference; |
|
| 2082 |
typedef typename MapTraits<MapImpl>::ReturnValue Reference; |
|
| 2083 |
|
|
| 2084 |
ArcMapBase(const UndirectorBase<DGR>& adaptor) : |
|
| 2085 |
_forward(*adaptor._digraph), _backward(*adaptor._digraph) {}
|
|
| 2086 |
|
|
| 2087 |
ArcMapBase(const UndirectorBase<DGR>& adaptor, const V& value) |
|
| 2088 |
: _forward(*adaptor._digraph, value), |
|
| 2089 |
_backward(*adaptor._digraph, value) {}
|
|
| 2090 |
|
|
| 2091 |
void set(const Arc& a, const V& value) {
|
|
| 2092 |
if (direction(a)) {
|
|
| 2093 |
_forward.set(a, value); |
|
| 2094 |
} else {
|
|
| 2095 |
_backward.set(a, value); |
|
| 2096 |
} |
|
| 2097 |
} |
|
| 2098 |
|
|
| 2099 |
ConstReturnValue operator[](const Arc& a) const {
|
|
| 2100 |
if (direction(a)) {
|
|
| 2101 |
return _forward[a]; |
|
| 2102 |
} else {
|
|
| 2103 |
return _backward[a]; |
|
| 2104 |
} |
|
| 2105 |
} |
|
| 2106 |
|
|
| 2107 |
ReturnValue operator[](const Arc& a) {
|
|
| 2108 |
if (direction(a)) {
|
|
| 2109 |
return _forward[a]; |
|
| 2110 |
} else {
|
|
| 2111 |
return _backward[a]; |
|
| 2112 |
} |
|
| 2113 |
} |
|
| 2114 |
|
|
| 2115 |
protected: |
|
| 2116 |
|
|
| 2117 |
MapImpl _forward, _backward; |
|
| 2118 |
|
|
| 2119 |
}; |
|
| 2120 |
|
|
| 2121 |
public: |
|
| 2122 |
|
|
| 2123 |
template <typename V> |
|
| 2124 |
class NodeMap : public DGR::template NodeMap<V> {
|
|
| 2125 |
typedef typename DGR::template NodeMap<V> Parent; |
|
| 2126 |
|
|
| 2127 |
public: |
|
| 2128 |
typedef V Value; |
|
| 2129 |
|
|
| 2130 |
explicit NodeMap(const UndirectorBase<DGR>& adaptor) |
|
| 2131 |
: Parent(*adaptor._digraph) {}
|
|
| 2132 |
|
|
| 2133 |
NodeMap(const UndirectorBase<DGR>& adaptor, const V& value) |
|
| 2134 |
: Parent(*adaptor._digraph, value) { }
|
|
| 2135 |
|
|
| 2136 |
private: |
|
| 2137 |
NodeMap& operator=(const NodeMap& cmap) {
|
|
| 2138 |
return operator=<NodeMap>(cmap); |
|
| 2139 |
} |
|
| 2140 |
|
|
| 2141 |
template <typename CMap> |
|
| 2142 |
NodeMap& operator=(const CMap& cmap) {
|
|
| 2143 |
Parent::operator=(cmap); |
|
| 2144 |
return *this; |
|
| 2145 |
} |
|
| 2146 |
|
|
| 2147 |
}; |
|
| 2148 |
|
|
| 2149 |
template <typename V> |
|
| 2150 |
class ArcMap |
|
| 2151 |
: public SubMapExtender<UndirectorBase<DGR>, ArcMapBase<V> > {
|
|
| 2152 |
typedef SubMapExtender<UndirectorBase<DGR>, ArcMapBase<V> > Parent; |
|
| 2153 |
|
|
| 2154 |
public: |
|
| 2155 |
typedef V Value; |
|
| 2156 |
|
|
| 2157 |
explicit ArcMap(const UndirectorBase<DGR>& adaptor) |
|
| 2158 |
: Parent(adaptor) {}
|
|
| 2159 |
|
|
| 2160 |
ArcMap(const UndirectorBase<DGR>& adaptor, const V& value) |
|
| 2161 |
: Parent(adaptor, value) {}
|
|
| 2162 |
|
|
| 2163 |
private: |
|
| 2164 |
ArcMap& operator=(const ArcMap& cmap) {
|
|
| 2165 |
return operator=<ArcMap>(cmap); |
|
| 2166 |
} |
|
| 2167 |
|
|
| 2168 |
template <typename CMap> |
|
| 2169 |
ArcMap& operator=(const CMap& cmap) {
|
|
| 2170 |
Parent::operator=(cmap); |
|
| 2171 |
return *this; |
|
| 2172 |
} |
|
| 2173 |
}; |
|
| 2174 |
|
|
| 2175 |
template <typename V> |
|
| 2176 |
class EdgeMap : public Digraph::template ArcMap<V> {
|
|
| 2177 |
typedef typename Digraph::template ArcMap<V> Parent; |
|
| 2178 |
|
|
| 2179 |
public: |
|
| 2180 |
typedef V Value; |
|
| 2181 |
|
|
| 2182 |
explicit EdgeMap(const UndirectorBase<DGR>& adaptor) |
|
| 2183 |
: Parent(*adaptor._digraph) {}
|
|
| 2184 |
|
|
| 2185 |
EdgeMap(const UndirectorBase<DGR>& adaptor, const V& value) |
|
| 2186 |
: Parent(*adaptor._digraph, value) {}
|
|
| 2187 |
|
|
| 2188 |
private: |
|
| 2189 |
EdgeMap& operator=(const EdgeMap& cmap) {
|
|
| 2190 |
return operator=<EdgeMap>(cmap); |
|
| 2191 |
} |
|
| 2192 |
|
|
| 2193 |
template <typename CMap> |
|
| 2194 |
EdgeMap& operator=(const CMap& cmap) {
|
|
| 2195 |
Parent::operator=(cmap); |
|
| 2196 |
return *this; |
|
| 2197 |
} |
|
| 2198 |
|
|
| 2199 |
}; |
|
| 2200 |
|
|
| 2201 |
typedef typename ItemSetTraits<DGR, Node>::ItemNotifier NodeNotifier; |
|
| 2202 |
NodeNotifier& notifier(Node) const { return _digraph->notifier(Node()); }
|
|
| 2203 |
|
|
| 2204 |
typedef typename ItemSetTraits<DGR, Edge>::ItemNotifier EdgeNotifier; |
|
| 2205 |
EdgeNotifier& notifier(Edge) const { return _digraph->notifier(Edge()); }
|
|
| 2206 |
|
|
| 2207 |
typedef EdgeNotifier ArcNotifier; |
|
| 2208 |
ArcNotifier& notifier(Arc) const { return _digraph->notifier(Edge()); }
|
|
| 2209 |
|
|
| 2210 |
protected: |
|
| 2211 |
|
|
| 2212 |
UndirectorBase() : _digraph(0) {}
|
|
| 2213 |
|
|
| 2214 |
DGR* _digraph; |
|
| 2215 |
|
|
| 2216 |
void initialize(DGR& digraph) {
|
|
| 2217 |
_digraph = &digraph; |
|
| 2218 |
} |
|
| 2219 |
|
|
| 2220 |
}; |
|
| 2221 |
|
|
| 2222 |
/// \ingroup graph_adaptors |
|
| 2223 |
/// |
|
| 2224 |
/// \brief Adaptor class for viewing a digraph as an undirected graph. |
|
| 2225 |
/// |
|
| 2226 |
/// Undirector adaptor can be used for viewing a digraph as an undirected |
|
| 2227 |
/// graph. All arcs of the underlying digraph are showed in the |
|
| 2228 |
/// adaptor as an edge (and also as a pair of arcs, of course). |
|
| 2229 |
/// This adaptor conforms to the \ref concepts::Graph "Graph" concept. |
|
| 2230 |
/// |
|
| 2231 |
/// The adapted digraph can also be modified through this adaptor |
|
| 2232 |
/// by adding or removing nodes or edges, unless the \c GR template |
|
| 2233 |
/// parameter is set to be \c const. |
|
| 2234 |
/// |
|
| 2235 |
/// \tparam DGR The type of the adapted digraph. |
|
| 2236 |
/// It must conform to the \ref concepts::Digraph "Digraph" concept. |
|
| 2237 |
/// It can also be specified to be \c const. |
|
| 2238 |
/// |
|
| 2239 |
/// \note The \c Node type of this adaptor and the adapted digraph are |
|
| 2240 |
/// convertible to each other, moreover the \c Edge type of the adaptor |
|
| 2241 |
/// and the \c Arc type of the adapted digraph are also convertible to |
|
| 2242 |
/// each other. |
|
| 2243 |
/// (Thus the \c Arc type of the adaptor is convertible to the \c Arc type |
|
| 2244 |
/// of the adapted digraph.) |
|
| 2245 |
template<typename DGR> |
|
| 2246 |
#ifdef DOXYGEN |
|
| 2247 |
class Undirector {
|
|
| 2248 |
#else |
|
| 2249 |
class Undirector : |
|
| 2250 |
public GraphAdaptorExtender<UndirectorBase<DGR> > {
|
|
| 2251 |
#endif |
|
| 2252 |
typedef GraphAdaptorExtender<UndirectorBase<DGR> > Parent; |
|
| 2253 |
public: |
|
| 2254 |
/// The type of the adapted digraph. |
|
| 2255 |
typedef DGR Digraph; |
|
| 2256 |
protected: |
|
| 2257 |
Undirector() { }
|
|
| 2258 |
public: |
|
| 2259 |
|
|
| 2260 |
/// \brief Constructor |
|
| 2261 |
/// |
|
| 2262 |
/// Creates an undirected graph from the given digraph. |
|
| 2263 |
Undirector(DGR& digraph) {
|
|
| 2264 |
initialize(digraph); |
|
| 2265 |
} |
|
| 2266 |
|
|
| 2267 |
/// \brief Arc map combined from two original arc maps |
|
| 2268 |
/// |
|
| 2269 |
/// This map adaptor class adapts two arc maps of the underlying |
|
| 2270 |
/// digraph to get an arc map of the undirected graph. |
|
| 2271 |
/// Its value type is inherited from the first arc map type (\c FW). |
|
| 2272 |
/// \tparam FW The type of the "foward" arc map. |
|
| 2273 |
/// \tparam BK The type of the "backward" arc map. |
|
| 2274 |
template <typename FW, typename BK> |
|
| 2275 |
class CombinedArcMap {
|
|
| 2276 |
public: |
|
| 2277 |
|
|
| 2278 |
/// The key type of the map |
|
| 2279 |
typedef typename Parent::Arc Key; |
|
| 2280 |
/// The value type of the map |
|
| 2281 |
typedef typename FW::Value Value; |
|
| 2282 |
|
|
| 2283 |
typedef typename MapTraits<FW>::ReferenceMapTag ReferenceMapTag; |
|
| 2284 |
|
|
| 2285 |
typedef typename MapTraits<FW>::ReturnValue ReturnValue; |
|
| 2286 |
typedef typename MapTraits<FW>::ConstReturnValue ConstReturnValue; |
|
| 2287 |
typedef typename MapTraits<FW>::ReturnValue Reference; |
|
| 2288 |
typedef typename MapTraits<FW>::ConstReturnValue ConstReference; |
|
| 2289 |
|
|
| 2290 |
/// Constructor |
|
| 2291 |
CombinedArcMap(FW& forward, BK& backward) |
|
| 2292 |
: _forward(&forward), _backward(&backward) {}
|
|
| 2293 |
|
|
| 2294 |
/// Sets the value associated with the given key. |
|
| 2295 |
void set(const Key& e, const Value& a) {
|
|
| 2296 |
if (Parent::direction(e)) {
|
|
| 2297 |
_forward->set(e, a); |
|
| 2298 |
} else {
|
|
| 2299 |
_backward->set(e, a); |
|
| 2300 |
} |
|
| 2301 |
} |
|
| 2302 |
|
|
| 2303 |
/// Returns the value associated with the given key. |
|
| 2304 |
ConstReturnValue operator[](const Key& e) const {
|
|
| 2305 |
if (Parent::direction(e)) {
|
|
| 2306 |
return (*_forward)[e]; |
|
| 2307 |
} else {
|
|
| 2308 |
return (*_backward)[e]; |
|
| 2309 |
} |
|
| 2310 |
} |
|
| 2311 |
|
|
| 2312 |
/// Returns a reference to the value associated with the given key. |
|
| 2313 |
ReturnValue operator[](const Key& e) {
|
|
| 2314 |
if (Parent::direction(e)) {
|
|
| 2315 |
return (*_forward)[e]; |
|
| 2316 |
} else {
|
|
| 2317 |
return (*_backward)[e]; |
|
| 2318 |
} |
|
| 2319 |
} |
|
| 2320 |
|
|
| 2321 |
protected: |
|
| 2322 |
|
|
| 2323 |
FW* _forward; |
|
| 2324 |
BK* _backward; |
|
| 2325 |
|
|
| 2326 |
}; |
|
| 2327 |
|
|
| 2328 |
/// \brief Returns a combined arc map |
|
| 2329 |
/// |
|
| 2330 |
/// This function just returns a combined arc map. |
|
| 2331 |
template <typename FW, typename BK> |
|
| 2332 |
static CombinedArcMap<FW, BK> |
|
| 2333 |
combinedArcMap(FW& forward, BK& backward) {
|
|
| 2334 |
return CombinedArcMap<FW, BK>(forward, backward); |
|
| 2335 |
} |
|
| 2336 |
|
|
| 2337 |
template <typename FW, typename BK> |
|
| 2338 |
static CombinedArcMap<const FW, BK> |
|
| 2339 |
combinedArcMap(const FW& forward, BK& backward) {
|
|
| 2340 |
return CombinedArcMap<const FW, BK>(forward, backward); |
|
| 2341 |
} |
|
| 2342 |
|
|
| 2343 |
template <typename FW, typename BK> |
|
| 2344 |
static CombinedArcMap<FW, const BK> |
|
| 2345 |
combinedArcMap(FW& forward, const BK& backward) {
|
|
| 2346 |
return CombinedArcMap<FW, const BK>(forward, backward); |
|
| 2347 |
} |
|
| 2348 |
|
|
| 2349 |
template <typename FW, typename BK> |
|
| 2350 |
static CombinedArcMap<const FW, const BK> |
|
| 2351 |
combinedArcMap(const FW& forward, const BK& backward) {
|
|
| 2352 |
return CombinedArcMap<const FW, const BK>(forward, backward); |
|
| 2353 |
} |
|
| 2354 |
|
|
| 2355 |
}; |
|
| 2356 |
|
|
| 2357 |
/// \brief Returns a read-only Undirector adaptor |
|
| 2358 |
/// |
|
| 2359 |
/// This function just returns a read-only \ref Undirector adaptor. |
|
| 2360 |
/// \ingroup graph_adaptors |
|
| 2361 |
/// \relates Undirector |
|
| 2362 |
template<typename DGR> |
|
| 2363 |
Undirector<const DGR> undirector(const DGR& digraph) {
|
|
| 2364 |
return Undirector<const DGR>(digraph); |
|
| 2365 |
} |
|
| 2366 |
|
|
| 2367 |
|
|
| 2368 |
template <typename GR, typename DM> |
|
| 2369 |
class OrienterBase {
|
|
| 2370 |
public: |
|
| 2371 |
|
|
| 2372 |
typedef GR Graph; |
|
| 2373 |
typedef DM DirectionMap; |
|
| 2374 |
|
|
| 2375 |
typedef typename GR::Node Node; |
|
| 2376 |
typedef typename GR::Edge Arc; |
|
| 2377 |
|
|
| 2378 |
void reverseArc(const Arc& arc) {
|
|
| 2379 |
_direction->set(arc, !(*_direction)[arc]); |
|
| 2380 |
} |
|
| 2381 |
|
|
| 2382 |
void first(Node& i) const { _graph->first(i); }
|
|
| 2383 |
void first(Arc& i) const { _graph->first(i); }
|
|
| 2384 |
void firstIn(Arc& i, const Node& n) const {
|
|
| 2385 |
bool d = true; |
|
| 2386 |
_graph->firstInc(i, d, n); |
|
| 2387 |
while (i != INVALID && d == (*_direction)[i]) _graph->nextInc(i, d); |
|
| 2388 |
} |
|
| 2389 |
void firstOut(Arc& i, const Node& n ) const {
|
|
| 2390 |
bool d = true; |
|
| 2391 |
_graph->firstInc(i, d, n); |
|
| 2392 |
while (i != INVALID && d != (*_direction)[i]) _graph->nextInc(i, d); |
|
| 2393 |
} |
|
| 2394 |
|
|
| 2395 |
void next(Node& i) const { _graph->next(i); }
|
|
| 2396 |
void next(Arc& i) const { _graph->next(i); }
|
|
| 2397 |
void nextIn(Arc& i) const {
|
|
| 2398 |
bool d = !(*_direction)[i]; |
|
| 2399 |
_graph->nextInc(i, d); |
|
| 2400 |
while (i != INVALID && d == (*_direction)[i]) _graph->nextInc(i, d); |
|
| 2401 |
} |
|
| 2402 |
void nextOut(Arc& i) const {
|
|
| 2403 |
bool d = (*_direction)[i]; |
|
| 2404 |
_graph->nextInc(i, d); |
|
| 2405 |
while (i != INVALID && d != (*_direction)[i]) _graph->nextInc(i, d); |
|
| 2406 |
} |
|
| 2407 |
|
|
| 2408 |
Node source(const Arc& e) const {
|
|
| 2409 |
return (*_direction)[e] ? _graph->u(e) : _graph->v(e); |
|
| 2410 |
} |
|
| 2411 |
Node target(const Arc& e) const {
|
|
| 2412 |
return (*_direction)[e] ? _graph->v(e) : _graph->u(e); |
|
| 2413 |
} |
|
| 2414 |
|
|
| 2415 |
typedef NodeNumTagIndicator<Graph> NodeNumTag; |
|
| 2416 |
int nodeNum() const { return _graph->nodeNum(); }
|
|
| 2417 |
|
|
| 2418 |
typedef EdgeNumTagIndicator<Graph> ArcNumTag; |
|
| 2419 |
int arcNum() const { return _graph->edgeNum(); }
|
|
| 2420 |
|
|
| 2421 |
typedef FindEdgeTagIndicator<Graph> FindArcTag; |
|
| 2422 |
Arc findArc(const Node& u, const Node& v, |
|
| 2423 |
const Arc& prev = INVALID) const {
|
|
| 2424 |
Arc arc = _graph->findEdge(u, v, prev); |
|
| 2425 |
while (arc != INVALID && source(arc) != u) {
|
|
| 2426 |
arc = _graph->findEdge(u, v, arc); |
|
| 2427 |
} |
|
| 2428 |
return arc; |
|
| 2429 |
} |
|
| 2430 |
|
|
| 2431 |
Node addNode() {
|
|
| 2432 |
return Node(_graph->addNode()); |
|
| 2433 |
} |
|
| 2434 |
|
|
| 2435 |
Arc addArc(const Node& u, const Node& v) {
|
|
| 2436 |
Arc arc = _graph->addEdge(u, v); |
|
| 2437 |
_direction->set(arc, _graph->u(arc) == u); |
|
| 2438 |
return arc; |
|
| 2439 |
} |
|
| 2440 |
|
|
| 2441 |
void erase(const Node& i) { _graph->erase(i); }
|
|
| 2442 |
void erase(const Arc& i) { _graph->erase(i); }
|
|
| 2443 |
|
|
| 2444 |
void clear() { _graph->clear(); }
|
|
| 2445 |
|
|
| 2446 |
int id(const Node& v) const { return _graph->id(v); }
|
|
| 2447 |
int id(const Arc& e) const { return _graph->id(e); }
|
|
| 2448 |
|
|
| 2449 |
Node nodeFromId(int idx) const { return _graph->nodeFromId(idx); }
|
|
| 2450 |
Arc arcFromId(int idx) const { return _graph->edgeFromId(idx); }
|
|
| 2451 |
|
|
| 2452 |
int maxNodeId() const { return _graph->maxNodeId(); }
|
|
| 2453 |
int maxArcId() const { return _graph->maxEdgeId(); }
|
|
| 2454 |
|
|
| 2455 |
typedef typename ItemSetTraits<GR, Node>::ItemNotifier NodeNotifier; |
|
| 2456 |
NodeNotifier& notifier(Node) const { return _graph->notifier(Node()); }
|
|
| 2457 |
|
|
| 2458 |
typedef typename ItemSetTraits<GR, Arc>::ItemNotifier ArcNotifier; |
|
| 2459 |
ArcNotifier& notifier(Arc) const { return _graph->notifier(Arc()); }
|
|
| 2460 |
|
|
| 2461 |
template <typename V> |
|
| 2462 |
class NodeMap : public GR::template NodeMap<V> {
|
|
| 2463 |
typedef typename GR::template NodeMap<V> Parent; |
|
| 2464 |
|
|
| 2465 |
public: |
|
| 2466 |
|
|
| 2467 |
explicit NodeMap(const OrienterBase<GR, DM>& adapter) |
|
| 2468 |
: Parent(*adapter._graph) {}
|
|
| 2469 |
|
|
| 2470 |
NodeMap(const OrienterBase<GR, DM>& adapter, const V& value) |
|
| 2471 |
: Parent(*adapter._graph, value) {}
|
|
| 2472 |
|
|
| 2473 |
private: |
|
| 2474 |
NodeMap& operator=(const NodeMap& cmap) {
|
|
| 2475 |
return operator=<NodeMap>(cmap); |
|
| 2476 |
} |
|
| 2477 |
|
|
| 2478 |
template <typename CMap> |
|
| 2479 |
NodeMap& operator=(const CMap& cmap) {
|
|
| 2480 |
Parent::operator=(cmap); |
|
| 2481 |
return *this; |
|
| 2482 |
} |
|
| 2483 |
|
|
| 2484 |
}; |
|
| 2485 |
|
|
| 2486 |
template <typename V> |
|
| 2487 |
class ArcMap : public GR::template EdgeMap<V> {
|
|
| 2488 |
typedef typename Graph::template EdgeMap<V> Parent; |
|
| 2489 |
|
|
| 2490 |
public: |
|
| 2491 |
|
|
| 2492 |
explicit ArcMap(const OrienterBase<GR, DM>& adapter) |
|
| 2493 |
: Parent(*adapter._graph) { }
|
|
| 2494 |
|
|
| 2495 |
ArcMap(const OrienterBase<GR, DM>& adapter, const V& value) |
|
| 2496 |
: Parent(*adapter._graph, value) { }
|
|
| 2497 |
|
|
| 2498 |
private: |
|
| 2499 |
ArcMap& operator=(const ArcMap& cmap) {
|
|
| 2500 |
return operator=<ArcMap>(cmap); |
|
| 2501 |
} |
|
| 2502 |
|
|
| 2503 |
template <typename CMap> |
|
| 2504 |
ArcMap& operator=(const CMap& cmap) {
|
|
| 2505 |
Parent::operator=(cmap); |
|
| 2506 |
return *this; |
|
| 2507 |
} |
|
| 2508 |
}; |
|
| 2509 |
|
|
| 2510 |
|
|
| 2511 |
|
|
| 2512 |
protected: |
|
| 2513 |
Graph* _graph; |
|
| 2514 |
DM* _direction; |
|
| 2515 |
|
|
| 2516 |
void initialize(GR& graph, DM& direction) {
|
|
| 2517 |
_graph = &graph; |
|
| 2518 |
_direction = &direction; |
|
| 2519 |
} |
|
| 2520 |
|
|
| 2521 |
}; |
|
| 2522 |
|
|
| 2523 |
/// \ingroup graph_adaptors |
|
| 2524 |
/// |
|
| 2525 |
/// \brief Adaptor class for orienting the edges of a graph to get a digraph |
|
| 2526 |
/// |
|
| 2527 |
/// Orienter adaptor can be used for orienting the edges of a graph to |
|
| 2528 |
/// get a digraph. A \c bool edge map of the underlying graph must be |
|
| 2529 |
/// specified, which define the direction of the arcs in the adaptor. |
|
| 2530 |
/// The arcs can be easily reversed by the \c reverseArc() member function |
|
| 2531 |
/// of the adaptor. |
|
| 2532 |
/// This class conforms to the \ref concepts::Digraph "Digraph" concept. |
|
| 2533 |
/// |
|
| 2534 |
/// The adapted graph can also be modified through this adaptor |
|
| 2535 |
/// by adding or removing nodes or arcs, unless the \c GR template |
|
| 2536 |
/// parameter is set to be \c const. |
|
| 2537 |
/// |
|
| 2538 |
/// \tparam GR The type of the adapted graph. |
|
| 2539 |
/// It must conform to the \ref concepts::Graph "Graph" concept. |
|
| 2540 |
/// It can also be specified to be \c const. |
|
| 2541 |
/// \tparam DM The type of the direction map. |
|
| 2542 |
/// It must be a \c bool (or convertible) edge map of the |
|
| 2543 |
/// adapted graph. The default type is |
|
| 2544 |
/// \ref concepts::Graph::EdgeMap "GR::EdgeMap<bool>". |
|
| 2545 |
/// |
|
| 2546 |
/// \note The \c Node type of this adaptor and the adapted graph are |
|
| 2547 |
/// convertible to each other, moreover the \c Arc type of the adaptor |
|
| 2548 |
/// and the \c Edge type of the adapted graph are also convertible to |
|
| 2549 |
/// each other. |
|
| 2550 |
#ifdef DOXYGEN |
|
| 2551 |
template<typename GR, |
|
| 2552 |
typename DM> |
|
| 2553 |
class Orienter {
|
|
| 2554 |
#else |
|
| 2555 |
template<typename GR, |
|
| 2556 |
typename DM = typename GR::template EdgeMap<bool> > |
|
| 2557 |
class Orienter : |
|
| 2558 |
public DigraphAdaptorExtender<OrienterBase<GR, DM> > {
|
|
| 2559 |
#endif |
|
| 2560 |
typedef DigraphAdaptorExtender<OrienterBase<GR, DM> > Parent; |
|
| 2561 |
public: |
|
| 2562 |
|
|
| 2563 |
/// The type of the adapted graph. |
|
| 2564 |
typedef GR Graph; |
|
| 2565 |
/// The type of the direction edge map. |
|
| 2566 |
typedef DM DirectionMap; |
|
| 2567 |
|
|
| 2568 |
typedef typename Parent::Arc Arc; |
|
| 2569 |
|
|
| 2570 |
protected: |
|
| 2571 |
Orienter() { }
|
|
| 2572 |
|
|
| 2573 |
public: |
|
| 2574 |
|
|
| 2575 |
/// \brief Constructor |
|
| 2576 |
/// |
|
| 2577 |
/// Constructor of the adaptor. |
|
| 2578 |
Orienter(GR& graph, DM& direction) {
|
|
| 2579 |
Parent::initialize(graph, direction); |
|
| 2580 |
} |
|
| 2581 |
|
|
| 2582 |
/// \brief Reverses the given arc |
|
| 2583 |
/// |
|
| 2584 |
/// This function reverses the given arc. |
|
| 2585 |
/// It is done by simply negate the assigned value of \c a |
|
| 2586 |
/// in the direction map. |
|
| 2587 |
void reverseArc(const Arc& a) {
|
|
| 2588 |
Parent::reverseArc(a); |
|
| 2589 |
} |
|
| 2590 |
}; |
|
| 2591 |
|
|
| 2592 |
/// \brief Returns a read-only Orienter adaptor |
|
| 2593 |
/// |
|
| 2594 |
/// This function just returns a read-only \ref Orienter adaptor. |
|
| 2595 |
/// \ingroup graph_adaptors |
|
| 2596 |
/// \relates Orienter |
|
| 2597 |
template<typename GR, typename DM> |
|
| 2598 |
Orienter<const GR, DM> |
|
| 2599 |
orienter(const GR& graph, DM& direction) {
|
|
| 2600 |
return Orienter<const GR, DM>(graph, direction); |
|
| 2601 |
} |
|
| 2602 |
|
|
| 2603 |
template<typename GR, typename DM> |
|
| 2604 |
Orienter<const GR, const DM> |
|
| 2605 |
orienter(const GR& graph, const DM& direction) {
|
|
| 2606 |
return Orienter<const GR, const DM>(graph, direction); |
|
| 2607 |
} |
|
| 2608 |
|
|
| 2609 |
namespace _adaptor_bits {
|
|
| 2610 |
|
|
| 2611 |
template <typename DGR, typename CM, typename FM, typename TL> |
|
| 2612 |
class ResForwardFilter {
|
|
| 2613 |
public: |
|
| 2614 |
|
|
| 2615 |
typedef typename DGR::Arc Key; |
|
| 2616 |
typedef bool Value; |
|
| 2617 |
|
|
| 2618 |
private: |
|
| 2619 |
|
|
| 2620 |
const CM* _capacity; |
|
| 2621 |
const FM* _flow; |
|
| 2622 |
TL _tolerance; |
|
| 2623 |
|
|
| 2624 |
public: |
|
| 2625 |
|
|
| 2626 |
ResForwardFilter(const CM& capacity, const FM& flow, |
|
| 2627 |
const TL& tolerance = TL()) |
|
| 2628 |
: _capacity(&capacity), _flow(&flow), _tolerance(tolerance) { }
|
|
| 2629 |
|
|
| 2630 |
bool operator[](const typename DGR::Arc& a) const {
|
|
| 2631 |
return _tolerance.positive((*_capacity)[a] - (*_flow)[a]); |
|
| 2632 |
} |
|
| 2633 |
}; |
|
| 2634 |
|
|
| 2635 |
template<typename DGR,typename CM, typename FM, typename TL> |
|
| 2636 |
class ResBackwardFilter {
|
|
| 2637 |
public: |
|
| 2638 |
|
|
| 2639 |
typedef typename DGR::Arc Key; |
|
| 2640 |
typedef bool Value; |
|
| 2641 |
|
|
| 2642 |
private: |
|
| 2643 |
|
|
| 2644 |
const CM* _capacity; |
|
| 2645 |
const FM* _flow; |
|
| 2646 |
TL _tolerance; |
|
| 2647 |
|
|
| 2648 |
public: |
|
| 2649 |
|
|
| 2650 |
ResBackwardFilter(const CM& capacity, const FM& flow, |
|
| 2651 |
const TL& tolerance = TL()) |
|
| 2652 |
: _capacity(&capacity), _flow(&flow), _tolerance(tolerance) { }
|
|
| 2653 |
|
|
| 2654 |
bool operator[](const typename DGR::Arc& a) const {
|
|
| 2655 |
return _tolerance.positive((*_flow)[a]); |
|
| 2656 |
} |
|
| 2657 |
}; |
|
| 2658 |
|
|
| 2659 |
} |
|
| 2660 |
|
|
| 2661 |
/// \ingroup graph_adaptors |
|
| 2662 |
/// |
|
| 2663 |
/// \brief Adaptor class for composing the residual digraph for directed |
|
| 2664 |
/// flow and circulation problems. |
|
| 2665 |
/// |
|
| 2666 |
/// ResidualDigraph can be used for composing the \e residual digraph |
|
| 2667 |
/// for directed flow and circulation problems. Let \f$ G=(V, A) \f$ |
|
| 2668 |
/// be a directed graph and let \f$ F \f$ be a number type. |
|
| 2669 |
/// Let \f$ flow, cap: A\to F \f$ be functions on the arcs. |
|
| 2670 |
/// This adaptor implements a digraph structure with node set \f$ V \f$ |
|
| 2671 |
/// and arc set \f$ A_{forward}\cup A_{backward} \f$,
|
|
| 2672 |
/// where \f$ A_{forward}=\{uv : uv\in A, flow(uv)<cap(uv)\} \f$ and
|
|
| 2673 |
/// \f$ A_{backward}=\{vu : uv\in A, flow(uv)>0\} \f$, i.e. the so
|
|
| 2674 |
/// called residual digraph. |
|
| 2675 |
/// When the union \f$ A_{forward}\cup A_{backward} \f$ is taken,
|
|
| 2676 |
/// multiplicities are counted, i.e. the adaptor has exactly |
|
| 2677 |
/// \f$ |A_{forward}| + |A_{backward}|\f$ arcs (it may have parallel
|
|
| 2678 |
/// arcs). |
|
| 2679 |
/// This class conforms to the \ref concepts::Digraph "Digraph" concept. |
|
| 2680 |
/// |
|
| 2681 |
/// \tparam DGR The type of the adapted digraph. |
|
| 2682 |
/// It must conform to the \ref concepts::Digraph "Digraph" concept. |
|
| 2683 |
/// It is implicitly \c const. |
|
| 2684 |
/// \tparam CM The type of the capacity map. |
|
| 2685 |
/// It must be an arc map of some numerical type, which defines |
|
| 2686 |
/// the capacities in the flow problem. It is implicitly \c const. |
|
| 2687 |
/// The default type is |
|
| 2688 |
/// \ref concepts::Digraph::ArcMap "GR::ArcMap<int>". |
|
| 2689 |
/// \tparam FM The type of the flow map. |
|
| 2690 |
/// It must be an arc map of some numerical type, which defines |
|
| 2691 |
/// the flow values in the flow problem. The default type is \c CM. |
|
| 2692 |
/// \tparam TL The tolerance type for handling inexact computation. |
|
| 2693 |
/// The default tolerance type depends on the value type of the |
|
| 2694 |
/// capacity map. |
|
| 2695 |
/// |
|
| 2696 |
/// \note This adaptor is implemented using Undirector and FilterArcs |
|
| 2697 |
/// adaptors. |
|
| 2698 |
/// |
|
| 2699 |
/// \note The \c Node type of this adaptor and the adapted digraph are |
|
| 2700 |
/// convertible to each other, moreover the \c Arc type of the adaptor |
|
| 2701 |
/// is convertible to the \c Arc type of the adapted digraph. |
|
| 2702 |
#ifdef DOXYGEN |
|
| 2703 |
template<typename DGR, typename CM, typename FM, typename TL> |
|
| 2704 |
class ResidualDigraph |
|
| 2705 |
#else |
|
| 2706 |
template<typename DGR, |
|
| 2707 |
typename CM = typename DGR::template ArcMap<int>, |
|
| 2708 |
typename FM = CM, |
|
| 2709 |
typename TL = Tolerance<typename CM::Value> > |
|
| 2710 |
class ResidualDigraph |
|
| 2711 |
: public SubDigraph< |
|
| 2712 |
Undirector<const DGR>, |
|
| 2713 |
ConstMap<typename DGR::Node, Const<bool, true> >, |
|
| 2714 |
typename Undirector<const DGR>::template CombinedArcMap< |
|
| 2715 |
_adaptor_bits::ResForwardFilter<const DGR, CM, FM, TL>, |
|
| 2716 |
_adaptor_bits::ResBackwardFilter<const DGR, CM, FM, TL> > > |
|
| 2717 |
#endif |
|
| 2718 |
{
|
|
| 2719 |
public: |
|
| 2720 |
|
|
| 2721 |
/// The type of the underlying digraph. |
|
| 2722 |
typedef DGR Digraph; |
|
| 2723 |
/// The type of the capacity map. |
|
| 2724 |
typedef CM CapacityMap; |
|
| 2725 |
/// The type of the flow map. |
|
| 2726 |
typedef FM FlowMap; |
|
| 2727 |
/// The tolerance type. |
|
| 2728 |
typedef TL Tolerance; |
|
| 2729 |
|
|
| 2730 |
typedef typename CapacityMap::Value Value; |
|
| 2731 |
typedef ResidualDigraph Adaptor; |
|
| 2732 |
|
|
| 2733 |
protected: |
|
| 2734 |
|
|
| 2735 |
typedef Undirector<const Digraph> Undirected; |
|
| 2736 |
|
|
| 2737 |
typedef ConstMap<typename DGR::Node, Const<bool, true> > NodeFilter; |
|
| 2738 |
|
|
| 2739 |
typedef _adaptor_bits::ResForwardFilter<const DGR, CM, |
|
| 2740 |
FM, TL> ForwardFilter; |
|
| 2741 |
|
|
| 2742 |
typedef _adaptor_bits::ResBackwardFilter<const DGR, CM, |
|
| 2743 |
FM, TL> BackwardFilter; |
|
| 2744 |
|
|
| 2745 |
typedef typename Undirected:: |
|
| 2746 |
template CombinedArcMap<ForwardFilter, BackwardFilter> ArcFilter; |
|
| 2747 |
|
|
| 2748 |
typedef SubDigraph<Undirected, NodeFilter, ArcFilter> Parent; |
|
| 2749 |
|
|
| 2750 |
const CapacityMap* _capacity; |
|
| 2751 |
FlowMap* _flow; |
|
| 2752 |
|
|
| 2753 |
Undirected _graph; |
|
| 2754 |
NodeFilter _node_filter; |
|
| 2755 |
ForwardFilter _forward_filter; |
|
| 2756 |
BackwardFilter _backward_filter; |
|
| 2757 |
ArcFilter _arc_filter; |
|
| 2758 |
|
|
| 2759 |
public: |
|
| 2760 |
|
|
| 2761 |
/// \brief Constructor |
|
| 2762 |
/// |
|
| 2763 |
/// Constructor of the residual digraph adaptor. The parameters are the |
|
| 2764 |
/// digraph, the capacity map, the flow map, and a tolerance object. |
|
| 2765 |
ResidualDigraph(const DGR& digraph, const CM& capacity, |
|
| 2766 |
FM& flow, const TL& tolerance = Tolerance()) |
|
| 2767 |
: Parent(), _capacity(&capacity), _flow(&flow), |
|
| 2768 |
_graph(digraph), _node_filter(), |
|
| 2769 |
_forward_filter(capacity, flow, tolerance), |
|
| 2770 |
_backward_filter(capacity, flow, tolerance), |
|
| 2771 |
_arc_filter(_forward_filter, _backward_filter) |
|
| 2772 |
{
|
|
| 2773 |
Parent::initialize(_graph, _node_filter, _arc_filter); |
|
| 2774 |
} |
|
| 2775 |
|
|
| 2776 |
typedef typename Parent::Arc Arc; |
|
| 2777 |
|
|
| 2778 |
/// \brief Returns the residual capacity of the given arc. |
|
| 2779 |
/// |
|
| 2780 |
/// Returns the residual capacity of the given arc. |
|
| 2781 |
Value residualCapacity(const Arc& a) const {
|
|
| 2782 |
if (Undirected::direction(a)) {
|
|
| 2783 |
return (*_capacity)[a] - (*_flow)[a]; |
|
| 2784 |
} else {
|
|
| 2785 |
return (*_flow)[a]; |
|
| 2786 |
} |
|
| 2787 |
} |
|
| 2788 |
|
|
| 2789 |
/// \brief Augments on the given arc in the residual digraph. |
|
| 2790 |
/// |
|
| 2791 |
/// Augments on the given arc in the residual digraph. It increases |
|
| 2792 |
/// or decreases the flow value on the original arc according to the |
|
| 2793 |
/// direction of the residual arc. |
|
| 2794 |
void augment(const Arc& a, const Value& v) const {
|
|
| 2795 |
if (Undirected::direction(a)) {
|
|
| 2796 |
_flow->set(a, (*_flow)[a] + v); |
|
| 2797 |
} else {
|
|
| 2798 |
_flow->set(a, (*_flow)[a] - v); |
|
| 2799 |
} |
|
| 2800 |
} |
|
| 2801 |
|
|
| 2802 |
/// \brief Returns \c true if the given residual arc is a forward arc. |
|
| 2803 |
/// |
|
| 2804 |
/// Returns \c true if the given residual arc has the same orientation |
|
| 2805 |
/// as the original arc, i.e. it is a so called forward arc. |
|
| 2806 |
static bool forward(const Arc& a) {
|
|
| 2807 |
return Undirected::direction(a); |
|
| 2808 |
} |
|
| 2809 |
|
|
| 2810 |
/// \brief Returns \c true if the given residual arc is a backward arc. |
|
| 2811 |
/// |
|
| 2812 |
/// Returns \c true if the given residual arc has the opposite orientation |
|
| 2813 |
/// than the original arc, i.e. it is a so called backward arc. |
|
| 2814 |
static bool backward(const Arc& a) {
|
|
| 2815 |
return !Undirected::direction(a); |
|
| 2816 |
} |
|
| 2817 |
|
|
| 2818 |
/// \brief Returns the forward oriented residual arc. |
|
| 2819 |
/// |
|
| 2820 |
/// Returns the forward oriented residual arc related to the given |
|
| 2821 |
/// arc of the underlying digraph. |
|
| 2822 |
static Arc forward(const typename Digraph::Arc& a) {
|
|
| 2823 |
return Undirected::direct(a, true); |
|
| 2824 |
} |
|
| 2825 |
|
|
| 2826 |
/// \brief Returns the backward oriented residual arc. |
|
| 2827 |
/// |
|
| 2828 |
/// Returns the backward oriented residual arc related to the given |
|
| 2829 |
/// arc of the underlying digraph. |
|
| 2830 |
static Arc backward(const typename Digraph::Arc& a) {
|
|
| 2831 |
return Undirected::direct(a, false); |
|
| 2832 |
} |
|
| 2833 |
|
|
| 2834 |
/// \brief Residual capacity map. |
|
| 2835 |
/// |
|
| 2836 |
/// This map adaptor class can be used for obtaining the residual |
|
| 2837 |
/// capacities as an arc map of the residual digraph. |
|
| 2838 |
/// Its value type is inherited from the capacity map. |
|
| 2839 |
class ResidualCapacity {
|
|
| 2840 |
protected: |
|
| 2841 |
const Adaptor* _adaptor; |
|
| 2842 |
public: |
|
| 2843 |
/// The key type of the map |
|
| 2844 |
typedef Arc Key; |
|
| 2845 |
/// The value type of the map |
|
| 2846 |
typedef typename CapacityMap::Value Value; |
|
| 2847 |
|
|
| 2848 |
/// Constructor |
|
| 2849 |
ResidualCapacity(const ResidualDigraph<DGR, CM, FM, TL>& adaptor) |
|
| 2850 |
: _adaptor(&adaptor) {}
|
|
| 2851 |
|
|
| 2852 |
/// Returns the value associated with the given residual arc |
|
| 2853 |
Value operator[](const Arc& a) const {
|
|
| 2854 |
return _adaptor->residualCapacity(a); |
|
| 2855 |
} |
|
| 2856 |
|
|
| 2857 |
}; |
|
| 2858 |
|
|
| 2859 |
/// \brief Returns a residual capacity map |
|
| 2860 |
/// |
|
| 2861 |
/// This function just returns a residual capacity map. |
|
| 2862 |
ResidualCapacity residualCapacity() const {
|
|
| 2863 |
return ResidualCapacity(*this); |
|
| 2864 |
} |
|
| 2865 |
|
|
| 2866 |
}; |
|
| 2867 |
|
|
| 2868 |
/// \brief Returns a (read-only) Residual adaptor |
|
| 2869 |
/// |
|
| 2870 |
/// This function just returns a (read-only) \ref ResidualDigraph adaptor. |
|
| 2871 |
/// \ingroup graph_adaptors |
|
| 2872 |
/// \relates ResidualDigraph |
|
| 2873 |
template<typename DGR, typename CM, typename FM> |
|
| 2874 |
ResidualDigraph<DGR, CM, FM> |
|
| 2875 |
residualDigraph(const DGR& digraph, const CM& capacity_map, FM& flow_map) {
|
|
| 2876 |
return ResidualDigraph<DGR, CM, FM> (digraph, capacity_map, flow_map); |
|
| 2877 |
} |
|
| 2878 |
|
|
| 2879 |
|
|
| 2880 |
template <typename DGR> |
|
| 2881 |
class SplitNodesBase {
|
|
| 2882 |
typedef DigraphAdaptorBase<const DGR> Parent; |
|
| 2883 |
|
|
| 2884 |
public: |
|
| 2885 |
|
|
| 2886 |
typedef DGR Digraph; |
|
| 2887 |
typedef SplitNodesBase Adaptor; |
|
| 2888 |
|
|
| 2889 |
typedef typename DGR::Node DigraphNode; |
|
| 2890 |
typedef typename DGR::Arc DigraphArc; |
|
| 2891 |
|
|
| 2892 |
class Node; |
|
| 2893 |
class Arc; |
|
| 2894 |
|
|
| 2895 |
private: |
|
| 2896 |
|
|
| 2897 |
template <typename T> class NodeMapBase; |
|
| 2898 |
template <typename T> class ArcMapBase; |
|
| 2899 |
|
|
| 2900 |
public: |
|
| 2901 |
|
|
| 2902 |
class Node : public DigraphNode {
|
|
| 2903 |
friend class SplitNodesBase; |
|
| 2904 |
template <typename T> friend class NodeMapBase; |
|
| 2905 |
private: |
|
| 2906 |
|
|
| 2907 |
bool _in; |
|
| 2908 |
Node(DigraphNode node, bool in) |
|
| 2909 |
: DigraphNode(node), _in(in) {}
|
|
| 2910 |
|
|
| 2911 |
public: |
|
| 2912 |
|
|
| 2913 |
Node() {}
|
|
| 2914 |
Node(Invalid) : DigraphNode(INVALID), _in(true) {}
|
|
| 2915 |
|
|
| 2916 |
bool operator==(const Node& node) const {
|
|
| 2917 |
return DigraphNode::operator==(node) && _in == node._in; |
|
| 2918 |
} |
|
| 2919 |
|
|
| 2920 |
bool operator!=(const Node& node) const {
|
|
| 2921 |
return !(*this == node); |
|
| 2922 |
} |
|
| 2923 |
|
|
| 2924 |
bool operator<(const Node& node) const {
|
|
| 2925 |
return DigraphNode::operator<(node) || |
|
| 2926 |
(DigraphNode::operator==(node) && _in < node._in); |
|
| 2927 |
} |
|
| 2928 |
}; |
|
| 2929 |
|
|
| 2930 |
class Arc {
|
|
| 2931 |
friend class SplitNodesBase; |
|
| 2932 |
template <typename T> friend class ArcMapBase; |
|
| 2933 |
private: |
|
| 2934 |
typedef BiVariant<DigraphArc, DigraphNode> ArcImpl; |
|
| 2935 |
|
|
| 2936 |
explicit Arc(const DigraphArc& arc) : _item(arc) {}
|
|
| 2937 |
explicit Arc(const DigraphNode& node) : _item(node) {}
|
|
| 2938 |
|
|
| 2939 |
ArcImpl _item; |
|
| 2940 |
|
|
| 2941 |
public: |
|
| 2942 |
Arc() {}
|
|
| 2943 |
Arc(Invalid) : _item(DigraphArc(INVALID)) {}
|
|
| 2944 |
|
|
| 2945 |
bool operator==(const Arc& arc) const {
|
|
| 2946 |
if (_item.firstState()) {
|
|
| 2947 |
if (arc._item.firstState()) {
|
|
| 2948 |
return _item.first() == arc._item.first(); |
|
| 2949 |
} |
|
| 2950 |
} else {
|
|
| 2951 |
if (arc._item.secondState()) {
|
|
| 2952 |
return _item.second() == arc._item.second(); |
|
| 2953 |
} |
|
| 2954 |
} |
|
| 2955 |
return false; |
|
| 2956 |
} |
|
| 2957 |
|
|
| 2958 |
bool operator!=(const Arc& arc) const {
|
|
| 2959 |
return !(*this == arc); |
|
| 2960 |
} |
|
| 2961 |
|
|
| 2962 |
bool operator<(const Arc& arc) const {
|
|
| 2963 |
if (_item.firstState()) {
|
|
| 2964 |
if (arc._item.firstState()) {
|
|
| 2965 |
return _item.first() < arc._item.first(); |
|
| 2966 |
} |
|
| 2967 |
return false; |
|
| 2968 |
} else {
|
|
| 2969 |
if (arc._item.secondState()) {
|
|
| 2970 |
return _item.second() < arc._item.second(); |
|
| 2971 |
} |
|
| 2972 |
return true; |
|
| 2973 |
} |
|
| 2974 |
} |
|
| 2975 |
|
|
| 2976 |
operator DigraphArc() const { return _item.first(); }
|
|
| 2977 |
operator DigraphNode() const { return _item.second(); }
|
|
| 2978 |
|
|
| 2979 |
}; |
|
| 2980 |
|
|
| 2981 |
void first(Node& n) const {
|
|
| 2982 |
_digraph->first(n); |
|
| 2983 |
n._in = true; |
|
| 2984 |
} |
|
| 2985 |
|
|
| 2986 |
void next(Node& n) const {
|
|
| 2987 |
if (n._in) {
|
|
| 2988 |
n._in = false; |
|
| 2989 |
} else {
|
|
| 2990 |
n._in = true; |
|
| 2991 |
_digraph->next(n); |
|
| 2992 |
} |
|
| 2993 |
} |
|
| 2994 |
|
|
| 2995 |
void first(Arc& e) const {
|
|
| 2996 |
e._item.setSecond(); |
|
| 2997 |
_digraph->first(e._item.second()); |
|
| 2998 |
if (e._item.second() == INVALID) {
|
|
| 2999 |
e._item.setFirst(); |
|
| 3000 |
_digraph->first(e._item.first()); |
|
| 3001 |
} |
|
| 3002 |
} |
|
| 3003 |
|
|
| 3004 |
void next(Arc& e) const {
|
|
| 3005 |
if (e._item.secondState()) {
|
|
| 3006 |
_digraph->next(e._item.second()); |
|
| 3007 |
if (e._item.second() == INVALID) {
|
|
| 3008 |
e._item.setFirst(); |
|
| 3009 |
_digraph->first(e._item.first()); |
|
| 3010 |
} |
|
| 3011 |
} else {
|
|
| 3012 |
_digraph->next(e._item.first()); |
|
| 3013 |
} |
|
| 3014 |
} |
|
| 3015 |
|
|
| 3016 |
void firstOut(Arc& e, const Node& n) const {
|
|
| 3017 |
if (n._in) {
|
|
| 3018 |
e._item.setSecond(n); |
|
| 3019 |
} else {
|
|
| 3020 |
e._item.setFirst(); |
|
| 3021 |
_digraph->firstOut(e._item.first(), n); |
|
| 3022 |
} |
|
| 3023 |
} |
|
| 3024 |
|
|
| 3025 |
void nextOut(Arc& e) const {
|
|
| 3026 |
if (!e._item.firstState()) {
|
|
| 3027 |
e._item.setFirst(INVALID); |
|
| 3028 |
} else {
|
|
| 3029 |
_digraph->nextOut(e._item.first()); |
|
| 3030 |
} |
|
| 3031 |
} |
|
| 3032 |
|
|
| 3033 |
void firstIn(Arc& e, const Node& n) const {
|
|
| 3034 |
if (!n._in) {
|
|
| 3035 |
e._item.setSecond(n); |
|
| 3036 |
} else {
|
|
| 3037 |
e._item.setFirst(); |
|
| 3038 |
_digraph->firstIn(e._item.first(), n); |
|
| 3039 |
} |
|
| 3040 |
} |
|
| 3041 |
|
|
| 3042 |
void nextIn(Arc& e) const {
|
|
| 3043 |
if (!e._item.firstState()) {
|
|
| 3044 |
e._item.setFirst(INVALID); |
|
| 3045 |
} else {
|
|
| 3046 |
_digraph->nextIn(e._item.first()); |
|
| 3047 |
} |
|
| 3048 |
} |
|
| 3049 |
|
|
| 3050 |
Node source(const Arc& e) const {
|
|
| 3051 |
if (e._item.firstState()) {
|
|
| 3052 |
return Node(_digraph->source(e._item.first()), false); |
|
| 3053 |
} else {
|
|
| 3054 |
return Node(e._item.second(), true); |
|
| 3055 |
} |
|
| 3056 |
} |
|
| 3057 |
|
|
| 3058 |
Node target(const Arc& e) const {
|
|
| 3059 |
if (e._item.firstState()) {
|
|
| 3060 |
return Node(_digraph->target(e._item.first()), true); |
|
| 3061 |
} else {
|
|
| 3062 |
return Node(e._item.second(), false); |
|
| 3063 |
} |
|
| 3064 |
} |
|
| 3065 |
|
|
| 3066 |
int id(const Node& n) const {
|
|
| 3067 |
return (_digraph->id(n) << 1) | (n._in ? 0 : 1); |
|
| 3068 |
} |
|
| 3069 |
Node nodeFromId(int ix) const {
|
|
| 3070 |
return Node(_digraph->nodeFromId(ix >> 1), (ix & 1) == 0); |
|
| 3071 |
} |
|
| 3072 |
int maxNodeId() const {
|
|
| 3073 |
return 2 * _digraph->maxNodeId() + 1; |
|
| 3074 |
} |
|
| 3075 |
|
|
| 3076 |
int id(const Arc& e) const {
|
|
| 3077 |
if (e._item.firstState()) {
|
|
| 3078 |
return _digraph->id(e._item.first()) << 1; |
|
| 3079 |
} else {
|
|
| 3080 |
return (_digraph->id(e._item.second()) << 1) | 1; |
|
| 3081 |
} |
|
| 3082 |
} |
|
| 3083 |
Arc arcFromId(int ix) const {
|
|
| 3084 |
if ((ix & 1) == 0) {
|
|
| 3085 |
return Arc(_digraph->arcFromId(ix >> 1)); |
|
| 3086 |
} else {
|
|
| 3087 |
return Arc(_digraph->nodeFromId(ix >> 1)); |
|
| 3088 |
} |
|
| 3089 |
} |
|
| 3090 |
int maxArcId() const {
|
|
| 3091 |
return std::max(_digraph->maxNodeId() << 1, |
|
| 3092 |
(_digraph->maxArcId() << 1) | 1); |
|
| 3093 |
} |
|
| 3094 |
|
|
| 3095 |
static bool inNode(const Node& n) {
|
|
| 3096 |
return n._in; |
|
| 3097 |
} |
|
| 3098 |
|
|
| 3099 |
static bool outNode(const Node& n) {
|
|
| 3100 |
return !n._in; |
|
| 3101 |
} |
|
| 3102 |
|
|
| 3103 |
static bool origArc(const Arc& e) {
|
|
| 3104 |
return e._item.firstState(); |
|
| 3105 |
} |
|
| 3106 |
|
|
| 3107 |
static bool bindArc(const Arc& e) {
|
|
| 3108 |
return e._item.secondState(); |
|
| 3109 |
} |
|
| 3110 |
|
|
| 3111 |
static Node inNode(const DigraphNode& n) {
|
|
| 3112 |
return Node(n, true); |
|
| 3113 |
} |
|
| 3114 |
|
|
| 3115 |
static Node outNode(const DigraphNode& n) {
|
|
| 3116 |
return Node(n, false); |
|
| 3117 |
} |
|
| 3118 |
|
|
| 3119 |
static Arc arc(const DigraphNode& n) {
|
|
| 3120 |
return Arc(n); |
|
| 3121 |
} |
|
| 3122 |
|
|
| 3123 |
static Arc arc(const DigraphArc& e) {
|
|
| 3124 |
return Arc(e); |
|
| 3125 |
} |
|
| 3126 |
|
|
| 3127 |
typedef True NodeNumTag; |
|
| 3128 |
int nodeNum() const {
|
|
| 3129 |
return 2 * countNodes(*_digraph); |
|
| 3130 |
} |
|
| 3131 |
|
|
| 3132 |
typedef True ArcNumTag; |
|
| 3133 |
int arcNum() const {
|
|
| 3134 |
return countArcs(*_digraph) + countNodes(*_digraph); |
|
| 3135 |
} |
|
| 3136 |
|
|
| 3137 |
typedef True FindArcTag; |
|
| 3138 |
Arc findArc(const Node& u, const Node& v, |
|
| 3139 |
const Arc& prev = INVALID) const {
|
|
| 3140 |
if (inNode(u) && outNode(v)) {
|
|
| 3141 |
if (static_cast<const DigraphNode&>(u) == |
|
| 3142 |
static_cast<const DigraphNode&>(v) && prev == INVALID) {
|
|
| 3143 |
return Arc(u); |
|
| 3144 |
} |
|
| 3145 |
} |
|
| 3146 |
else if (outNode(u) && inNode(v)) {
|
|
| 3147 |
return Arc(::lemon::findArc(*_digraph, u, v, prev)); |
|
| 3148 |
} |
|
| 3149 |
return INVALID; |
|
| 3150 |
} |
|
| 3151 |
|
|
| 3152 |
private: |
|
| 3153 |
|
|
| 3154 |
template <typename V> |
|
| 3155 |
class NodeMapBase |
|
| 3156 |
: public MapTraits<typename Parent::template NodeMap<V> > {
|
|
| 3157 |
typedef typename Parent::template NodeMap<V> NodeImpl; |
|
| 3158 |
public: |
|
| 3159 |
typedef Node Key; |
|
| 3160 |
typedef V Value; |
|
| 3161 |
typedef typename MapTraits<NodeImpl>::ReferenceMapTag ReferenceMapTag; |
|
| 3162 |
typedef typename MapTraits<NodeImpl>::ReturnValue ReturnValue; |
|
| 3163 |
typedef typename MapTraits<NodeImpl>::ConstReturnValue ConstReturnValue; |
|
| 3164 |
typedef typename MapTraits<NodeImpl>::ReturnValue Reference; |
|
| 3165 |
typedef typename MapTraits<NodeImpl>::ConstReturnValue ConstReference; |
|
| 3166 |
|
|
| 3167 |
NodeMapBase(const SplitNodesBase<DGR>& adaptor) |
|
| 3168 |
: _in_map(*adaptor._digraph), _out_map(*adaptor._digraph) {}
|
|
| 3169 |
NodeMapBase(const SplitNodesBase<DGR>& adaptor, const V& value) |
|
| 3170 |
: _in_map(*adaptor._digraph, value), |
|
| 3171 |
_out_map(*adaptor._digraph, value) {}
|
|
| 3172 |
|
|
| 3173 |
void set(const Node& key, const V& val) {
|
|
| 3174 |
if (SplitNodesBase<DGR>::inNode(key)) { _in_map.set(key, val); }
|
|
| 3175 |
else {_out_map.set(key, val); }
|
|
| 3176 |
} |
|
| 3177 |
|
|
| 3178 |
ReturnValue operator[](const Node& key) {
|
|
| 3179 |
if (SplitNodesBase<DGR>::inNode(key)) { return _in_map[key]; }
|
|
| 3180 |
else { return _out_map[key]; }
|
|
| 3181 |
} |
|
| 3182 |
|
|
| 3183 |
ConstReturnValue operator[](const Node& key) const {
|
|
| 3184 |
if (Adaptor::inNode(key)) { return _in_map[key]; }
|
|
| 3185 |
else { return _out_map[key]; }
|
|
| 3186 |
} |
|
| 3187 |
|
|
| 3188 |
private: |
|
| 3189 |
NodeImpl _in_map, _out_map; |
|
| 3190 |
}; |
|
| 3191 |
|
|
| 3192 |
template <typename V> |
|
| 3193 |
class ArcMapBase |
|
| 3194 |
: public MapTraits<typename Parent::template ArcMap<V> > {
|
|
| 3195 |
typedef typename Parent::template ArcMap<V> ArcImpl; |
|
| 3196 |
typedef typename Parent::template NodeMap<V> NodeImpl; |
|
| 3197 |
public: |
|
| 3198 |
typedef Arc Key; |
|
| 3199 |
typedef V Value; |
|
| 3200 |
typedef typename MapTraits<ArcImpl>::ReferenceMapTag ReferenceMapTag; |
|
| 3201 |
typedef typename MapTraits<ArcImpl>::ReturnValue ReturnValue; |
|
| 3202 |
typedef typename MapTraits<ArcImpl>::ConstReturnValue ConstReturnValue; |
|
| 3203 |
typedef typename MapTraits<ArcImpl>::ReturnValue Reference; |
|
| 3204 |
typedef typename MapTraits<ArcImpl>::ConstReturnValue ConstReference; |
|
| 3205 |
|
|
| 3206 |
ArcMapBase(const SplitNodesBase<DGR>& adaptor) |
|
| 3207 |
: _arc_map(*adaptor._digraph), _node_map(*adaptor._digraph) {}
|
|
| 3208 |
ArcMapBase(const SplitNodesBase<DGR>& adaptor, const V& value) |
|
| 3209 |
: _arc_map(*adaptor._digraph, value), |
|
| 3210 |
_node_map(*adaptor._digraph, value) {}
|
|
| 3211 |
|
|
| 3212 |
void set(const Arc& key, const V& val) {
|
|
| 3213 |
if (SplitNodesBase<DGR>::origArc(key)) {
|
|
| 3214 |
_arc_map.set(static_cast<const DigraphArc&>(key), val); |
|
| 3215 |
} else {
|
|
| 3216 |
_node_map.set(static_cast<const DigraphNode&>(key), val); |
|
| 3217 |
} |
|
| 3218 |
} |
|
| 3219 |
|
|
| 3220 |
ReturnValue operator[](const Arc& key) {
|
|
| 3221 |
if (SplitNodesBase<DGR>::origArc(key)) {
|
|
| 3222 |
return _arc_map[static_cast<const DigraphArc&>(key)]; |
|
| 3223 |
} else {
|
|
| 3224 |
return _node_map[static_cast<const DigraphNode&>(key)]; |
|
| 3225 |
} |
|
| 3226 |
} |
|
| 3227 |
|
|
| 3228 |
ConstReturnValue operator[](const Arc& key) const {
|
|
| 3229 |
if (SplitNodesBase<DGR>::origArc(key)) {
|
|
| 3230 |
return _arc_map[static_cast<const DigraphArc&>(key)]; |
|
| 3231 |
} else {
|
|
| 3232 |
return _node_map[static_cast<const DigraphNode&>(key)]; |
|
| 3233 |
} |
|
| 3234 |
} |
|
| 3235 |
|
|
| 3236 |
private: |
|
| 3237 |
ArcImpl _arc_map; |
|
| 3238 |
NodeImpl _node_map; |
|
| 3239 |
}; |
|
| 3240 |
|
|
| 3241 |
public: |
|
| 3242 |
|
|
| 3243 |
template <typename V> |
|
| 3244 |
class NodeMap |
|
| 3245 |
: public SubMapExtender<SplitNodesBase<DGR>, NodeMapBase<V> > {
|
|
| 3246 |
typedef SubMapExtender<SplitNodesBase<DGR>, NodeMapBase<V> > Parent; |
|
| 3247 |
|
|
| 3248 |
public: |
|
| 3249 |
typedef V Value; |
|
| 3250 |
|
|
| 3251 |
NodeMap(const SplitNodesBase<DGR>& adaptor) |
|
| 3252 |
: Parent(adaptor) {}
|
|
| 3253 |
|
|
| 3254 |
NodeMap(const SplitNodesBase<DGR>& adaptor, const V& value) |
|
| 3255 |
: Parent(adaptor, value) {}
|
|
| 3256 |
|
|
| 3257 |
private: |
|
| 3258 |
NodeMap& operator=(const NodeMap& cmap) {
|
|
| 3259 |
return operator=<NodeMap>(cmap); |
|
| 3260 |
} |
|
| 3261 |
|
|
| 3262 |
template <typename CMap> |
|
| 3263 |
NodeMap& operator=(const CMap& cmap) {
|
|
| 3264 |
Parent::operator=(cmap); |
|
| 3265 |
return *this; |
|
| 3266 |
} |
|
| 3267 |
}; |
|
| 3268 |
|
|
| 3269 |
template <typename V> |
|
| 3270 |
class ArcMap |
|
| 3271 |
: public SubMapExtender<SplitNodesBase<DGR>, ArcMapBase<V> > {
|
|
| 3272 |
typedef SubMapExtender<SplitNodesBase<DGR>, ArcMapBase<V> > Parent; |
|
| 3273 |
|
|
| 3274 |
public: |
|
| 3275 |
typedef V Value; |
|
| 3276 |
|
|
| 3277 |
ArcMap(const SplitNodesBase<DGR>& adaptor) |
|
| 3278 |
: Parent(adaptor) {}
|
|
| 3279 |
|
|
| 3280 |
ArcMap(const SplitNodesBase<DGR>& adaptor, const V& value) |
|
| 3281 |
: Parent(adaptor, value) {}
|
|
| 3282 |
|
|
| 3283 |
private: |
|
| 3284 |
ArcMap& operator=(const ArcMap& cmap) {
|
|
| 3285 |
return operator=<ArcMap>(cmap); |
|
| 3286 |
} |
|
| 3287 |
|
|
| 3288 |
template <typename CMap> |
|
| 3289 |
ArcMap& operator=(const CMap& cmap) {
|
|
| 3290 |
Parent::operator=(cmap); |
|
| 3291 |
return *this; |
|
| 3292 |
} |
|
| 3293 |
}; |
|
| 3294 |
|
|
| 3295 |
protected: |
|
| 3296 |
|
|
| 3297 |
SplitNodesBase() : _digraph(0) {}
|
|
| 3298 |
|
|
| 3299 |
DGR* _digraph; |
|
| 3300 |
|
|
| 3301 |
void initialize(Digraph& digraph) {
|
|
| 3302 |
_digraph = &digraph; |
|
| 3303 |
} |
|
| 3304 |
|
|
| 3305 |
}; |
|
| 3306 |
|
|
| 3307 |
/// \ingroup graph_adaptors |
|
| 3308 |
/// |
|
| 3309 |
/// \brief Adaptor class for splitting the nodes of a digraph. |
|
| 3310 |
/// |
|
| 3311 |
/// SplitNodes adaptor can be used for splitting each node into an |
|
| 3312 |
/// \e in-node and an \e out-node in a digraph. Formaly, the adaptor |
|
| 3313 |
/// replaces each node \f$ u \f$ in the digraph with two nodes, |
|
| 3314 |
/// namely node \f$ u_{in} \f$ and node \f$ u_{out} \f$.
|
|
| 3315 |
/// If there is a \f$ (v, u) \f$ arc in the original digraph, then the |
|
| 3316 |
/// new target of the arc will be \f$ u_{in} \f$ and similarly the
|
|
| 3317 |
/// source of each original \f$ (u, v) \f$ arc will be \f$ u_{out} \f$.
|
|
| 3318 |
/// The adaptor adds an additional \e bind \e arc from \f$ u_{in} \f$
|
|
| 3319 |
/// to \f$ u_{out} \f$ for each node \f$ u \f$ of the original digraph.
|
|
| 3320 |
/// |
|
| 3321 |
/// The aim of this class is running an algorithm with respect to node |
|
| 3322 |
/// costs or capacities if the algorithm considers only arc costs or |
|
| 3323 |
/// capacities directly. |
|
| 3324 |
/// In this case you can use \c SplitNodes adaptor, and set the node |
|
| 3325 |
/// costs/capacities of the original digraph to the \e bind \e arcs |
|
| 3326 |
/// in the adaptor. |
|
| 3327 |
/// |
|
| 3328 |
/// \tparam DGR The type of the adapted digraph. |
|
| 3329 |
/// It must conform to the \ref concepts::Digraph "Digraph" concept. |
|
| 3330 |
/// It is implicitly \c const. |
|
| 3331 |
/// |
|
| 3332 |
/// \note The \c Node type of this adaptor is converible to the \c Node |
|
| 3333 |
/// type of the adapted digraph. |
|
| 3334 |
template <typename DGR> |
|
| 3335 |
#ifdef DOXYGEN |
|
| 3336 |
class SplitNodes {
|
|
| 3337 |
#else |
|
| 3338 |
class SplitNodes |
|
| 3339 |
: public DigraphAdaptorExtender<SplitNodesBase<const DGR> > {
|
|
| 3340 |
#endif |
|
| 3341 |
typedef DigraphAdaptorExtender<SplitNodesBase<const DGR> > Parent; |
|
| 3342 |
|
|
| 3343 |
public: |
|
| 3344 |
typedef DGR Digraph; |
|
| 3345 |
|
|
| 3346 |
typedef typename DGR::Node DigraphNode; |
|
| 3347 |
typedef typename DGR::Arc DigraphArc; |
|
| 3348 |
|
|
| 3349 |
typedef typename Parent::Node Node; |
|
| 3350 |
typedef typename Parent::Arc Arc; |
|
| 3351 |
|
|
| 3352 |
/// \brief Constructor |
|
| 3353 |
/// |
|
| 3354 |
/// Constructor of the adaptor. |
|
| 3355 |
SplitNodes(const DGR& g) {
|
|
| 3356 |
Parent::initialize(g); |
|
| 3357 |
} |
|
| 3358 |
|
|
| 3359 |
/// \brief Returns \c true if the given node is an in-node. |
|
| 3360 |
/// |
|
| 3361 |
/// Returns \c true if the given node is an in-node. |
|
| 3362 |
static bool inNode(const Node& n) {
|
|
| 3363 |
return Parent::inNode(n); |
|
| 3364 |
} |
|
| 3365 |
|
|
| 3366 |
/// \brief Returns \c true if the given node is an out-node. |
|
| 3367 |
/// |
|
| 3368 |
/// Returns \c true if the given node is an out-node. |
|
| 3369 |
static bool outNode(const Node& n) {
|
|
| 3370 |
return Parent::outNode(n); |
|
| 3371 |
} |
|
| 3372 |
|
|
| 3373 |
/// \brief Returns \c true if the given arc is an original arc. |
|
| 3374 |
/// |
|
| 3375 |
/// Returns \c true if the given arc is one of the arcs in the |
|
| 3376 |
/// original digraph. |
|
| 3377 |
static bool origArc(const Arc& a) {
|
|
| 3378 |
return Parent::origArc(a); |
|
| 3379 |
} |
|
| 3380 |
|
|
| 3381 |
/// \brief Returns \c true if the given arc is a bind arc. |
|
| 3382 |
/// |
|
| 3383 |
/// Returns \c true if the given arc is a bind arc, i.e. it connects |
|
| 3384 |
/// an in-node and an out-node. |
|
| 3385 |
static bool bindArc(const Arc& a) {
|
|
| 3386 |
return Parent::bindArc(a); |
|
| 3387 |
} |
|
| 3388 |
|
|
| 3389 |
/// \brief Returns the in-node created from the given original node. |
|
| 3390 |
/// |
|
| 3391 |
/// Returns the in-node created from the given original node. |
|
| 3392 |
static Node inNode(const DigraphNode& n) {
|
|
| 3393 |
return Parent::inNode(n); |
|
| 3394 |
} |
|
| 3395 |
|
|
| 3396 |
/// \brief Returns the out-node created from the given original node. |
|
| 3397 |
/// |
|
| 3398 |
/// Returns the out-node created from the given original node. |
|
| 3399 |
static Node outNode(const DigraphNode& n) {
|
|
| 3400 |
return Parent::outNode(n); |
|
| 3401 |
} |
|
| 3402 |
|
|
| 3403 |
/// \brief Returns the bind arc that corresponds to the given |
|
| 3404 |
/// original node. |
|
| 3405 |
/// |
|
| 3406 |
/// Returns the bind arc in the adaptor that corresponds to the given |
|
| 3407 |
/// original node, i.e. the arc connecting the in-node and out-node |
|
| 3408 |
/// of \c n. |
|
| 3409 |
static Arc arc(const DigraphNode& n) {
|
|
| 3410 |
return Parent::arc(n); |
|
| 3411 |
} |
|
| 3412 |
|
|
| 3413 |
/// \brief Returns the arc that corresponds to the given original arc. |
|
| 3414 |
/// |
|
| 3415 |
/// Returns the arc in the adaptor that corresponds to the given |
|
| 3416 |
/// original arc. |
|
| 3417 |
static Arc arc(const DigraphArc& a) {
|
|
| 3418 |
return Parent::arc(a); |
|
| 3419 |
} |
|
| 3420 |
|
|
| 3421 |
/// \brief Node map combined from two original node maps |
|
| 3422 |
/// |
|
| 3423 |
/// This map adaptor class adapts two node maps of the original digraph |
|
| 3424 |
/// to get a node map of the split digraph. |
|
| 3425 |
/// Its value type is inherited from the first node map type (\c IN). |
|
| 3426 |
/// \tparam IN The type of the node map for the in-nodes. |
|
| 3427 |
/// \tparam OUT The type of the node map for the out-nodes. |
|
| 3428 |
template <typename IN, typename OUT> |
|
| 3429 |
class CombinedNodeMap {
|
|
| 3430 |
public: |
|
| 3431 |
|
|
| 3432 |
/// The key type of the map |
|
| 3433 |
typedef Node Key; |
|
| 3434 |
/// The value type of the map |
|
| 3435 |
typedef typename IN::Value Value; |
|
| 3436 |
|
|
| 3437 |
typedef typename MapTraits<IN>::ReferenceMapTag ReferenceMapTag; |
|
| 3438 |
typedef typename MapTraits<IN>::ReturnValue ReturnValue; |
|
| 3439 |
typedef typename MapTraits<IN>::ConstReturnValue ConstReturnValue; |
|
| 3440 |
typedef typename MapTraits<IN>::ReturnValue Reference; |
|
| 3441 |
typedef typename MapTraits<IN>::ConstReturnValue ConstReference; |
|
| 3442 |
|
|
| 3443 |
/// Constructor |
|
| 3444 |
CombinedNodeMap(IN& in_map, OUT& out_map) |
|
| 3445 |
: _in_map(in_map), _out_map(out_map) {}
|
|
| 3446 |
|
|
| 3447 |
/// Returns the value associated with the given key. |
|
| 3448 |
Value operator[](const Key& key) const {
|
|
| 3449 |
if (SplitNodesBase<const DGR>::inNode(key)) {
|
|
| 3450 |
return _in_map[key]; |
|
| 3451 |
} else {
|
|
| 3452 |
return _out_map[key]; |
|
| 3453 |
} |
|
| 3454 |
} |
|
| 3455 |
|
|
| 3456 |
/// Returns a reference to the value associated with the given key. |
|
| 3457 |
Value& operator[](const Key& key) {
|
|
| 3458 |
if (SplitNodesBase<const DGR>::inNode(key)) {
|
|
| 3459 |
return _in_map[key]; |
|
| 3460 |
} else {
|
|
| 3461 |
return _out_map[key]; |
|
| 3462 |
} |
|
| 3463 |
} |
|
| 3464 |
|
|
| 3465 |
/// Sets the value associated with the given key. |
|
| 3466 |
void set(const Key& key, const Value& value) {
|
|
| 3467 |
if (SplitNodesBase<const DGR>::inNode(key)) {
|
|
| 3468 |
_in_map.set(key, value); |
|
| 3469 |
} else {
|
|
| 3470 |
_out_map.set(key, value); |
|
| 3471 |
} |
|
| 3472 |
} |
|
| 3473 |
|
|
| 3474 |
private: |
|
| 3475 |
|
|
| 3476 |
IN& _in_map; |
|
| 3477 |
OUT& _out_map; |
|
| 3478 |
|
|
| 3479 |
}; |
|
| 3480 |
|
|
| 3481 |
|
|
| 3482 |
/// \brief Returns a combined node map |
|
| 3483 |
/// |
|
| 3484 |
/// This function just returns a combined node map. |
|
| 3485 |
template <typename IN, typename OUT> |
|
| 3486 |
static CombinedNodeMap<IN, OUT> |
|
| 3487 |
combinedNodeMap(IN& in_map, OUT& out_map) {
|
|
| 3488 |
return CombinedNodeMap<IN, OUT>(in_map, out_map); |
|
| 3489 |
} |
|
| 3490 |
|
|
| 3491 |
template <typename IN, typename OUT> |
|
| 3492 |
static CombinedNodeMap<const IN, OUT> |
|
| 3493 |
combinedNodeMap(const IN& in_map, OUT& out_map) {
|
|
| 3494 |
return CombinedNodeMap<const IN, OUT>(in_map, out_map); |
|
| 3495 |
} |
|
| 3496 |
|
|
| 3497 |
template <typename IN, typename OUT> |
|
| 3498 |
static CombinedNodeMap<IN, const OUT> |
|
| 3499 |
combinedNodeMap(IN& in_map, const OUT& out_map) {
|
|
| 3500 |
return CombinedNodeMap<IN, const OUT>(in_map, out_map); |
|
| 3501 |
} |
|
| 3502 |
|
|
| 3503 |
template <typename IN, typename OUT> |
|
| 3504 |
static CombinedNodeMap<const IN, const OUT> |
|
| 3505 |
combinedNodeMap(const IN& in_map, const OUT& out_map) {
|
|
| 3506 |
return CombinedNodeMap<const IN, const OUT>(in_map, out_map); |
|
| 3507 |
} |
|
| 3508 |
|
|
| 3509 |
/// \brief Arc map combined from an arc map and a node map of the |
|
| 3510 |
/// original digraph. |
|
| 3511 |
/// |
|
| 3512 |
/// This map adaptor class adapts an arc map and a node map of the |
|
| 3513 |
/// original digraph to get an arc map of the split digraph. |
|
| 3514 |
/// Its value type is inherited from the original arc map type (\c AM). |
|
| 3515 |
/// \tparam AM The type of the arc map. |
|
| 3516 |
/// \tparam NM the type of the node map. |
|
| 3517 |
template <typename AM, typename NM> |
|
| 3518 |
class CombinedArcMap {
|
|
| 3519 |
public: |
|
| 3520 |
|
|
| 3521 |
/// The key type of the map |
|
| 3522 |
typedef Arc Key; |
|
| 3523 |
/// The value type of the map |
|
| 3524 |
typedef typename AM::Value Value; |
|
| 3525 |
|
|
| 3526 |
typedef typename MapTraits<AM>::ReferenceMapTag ReferenceMapTag; |
|
| 3527 |
typedef typename MapTraits<AM>::ReturnValue ReturnValue; |
|
| 3528 |
typedef typename MapTraits<AM>::ConstReturnValue ConstReturnValue; |
|
| 3529 |
typedef typename MapTraits<AM>::ReturnValue Reference; |
|
| 3530 |
typedef typename MapTraits<AM>::ConstReturnValue ConstReference; |
|
| 3531 |
|
|
| 3532 |
/// Constructor |
|
| 3533 |
CombinedArcMap(AM& arc_map, NM& node_map) |
|
| 3534 |
: _arc_map(arc_map), _node_map(node_map) {}
|
|
| 3535 |
|
|
| 3536 |
/// Returns the value associated with the given key. |
|
| 3537 |
Value operator[](const Key& arc) const {
|
|
| 3538 |
if (SplitNodesBase<const DGR>::origArc(arc)) {
|
|
| 3539 |
return _arc_map[arc]; |
|
| 3540 |
} else {
|
|
| 3541 |
return _node_map[arc]; |
|
| 3542 |
} |
|
| 3543 |
} |
|
| 3544 |
|
|
| 3545 |
/// Returns a reference to the value associated with the given key. |
|
| 3546 |
Value& operator[](const Key& arc) {
|
|
| 3547 |
if (SplitNodesBase<const DGR>::origArc(arc)) {
|
|
| 3548 |
return _arc_map[arc]; |
|
| 3549 |
} else {
|
|
| 3550 |
return _node_map[arc]; |
|
| 3551 |
} |
|
| 3552 |
} |
|
| 3553 |
|
|
| 3554 |
/// Sets the value associated with the given key. |
|
| 3555 |
void set(const Arc& arc, const Value& val) {
|
|
| 3556 |
if (SplitNodesBase<const DGR>::origArc(arc)) {
|
|
| 3557 |
_arc_map.set(arc, val); |
|
| 3558 |
} else {
|
|
| 3559 |
_node_map.set(arc, val); |
|
| 3560 |
} |
|
| 3561 |
} |
|
| 3562 |
|
|
| 3563 |
private: |
|
| 3564 |
|
|
| 3565 |
AM& _arc_map; |
|
| 3566 |
NM& _node_map; |
|
| 3567 |
|
|
| 3568 |
}; |
|
| 3569 |
|
|
| 3570 |
/// \brief Returns a combined arc map |
|
| 3571 |
/// |
|
| 3572 |
/// This function just returns a combined arc map. |
|
| 3573 |
template <typename ArcMap, typename NodeMap> |
|
| 3574 |
static CombinedArcMap<ArcMap, NodeMap> |
|
| 3575 |
combinedArcMap(ArcMap& arc_map, NodeMap& node_map) {
|
|
| 3576 |
return CombinedArcMap<ArcMap, NodeMap>(arc_map, node_map); |
|
| 3577 |
} |
|
| 3578 |
|
|
| 3579 |
template <typename ArcMap, typename NodeMap> |
|
| 3580 |
static CombinedArcMap<const ArcMap, NodeMap> |
|
| 3581 |
combinedArcMap(const ArcMap& arc_map, NodeMap& node_map) {
|
|
| 3582 |
return CombinedArcMap<const ArcMap, NodeMap>(arc_map, node_map); |
|
| 3583 |
} |
|
| 3584 |
|
|
| 3585 |
template <typename ArcMap, typename NodeMap> |
|
| 3586 |
static CombinedArcMap<ArcMap, const NodeMap> |
|
| 3587 |
combinedArcMap(ArcMap& arc_map, const NodeMap& node_map) {
|
|
| 3588 |
return CombinedArcMap<ArcMap, const NodeMap>(arc_map, node_map); |
|
| 3589 |
} |
|
| 3590 |
|
|
| 3591 |
template <typename ArcMap, typename NodeMap> |
|
| 3592 |
static CombinedArcMap<const ArcMap, const NodeMap> |
|
| 3593 |
combinedArcMap(const ArcMap& arc_map, const NodeMap& node_map) {
|
|
| 3594 |
return CombinedArcMap<const ArcMap, const NodeMap>(arc_map, node_map); |
|
| 3595 |
} |
|
| 3596 |
|
|
| 3597 |
}; |
|
| 3598 |
|
|
| 3599 |
/// \brief Returns a (read-only) SplitNodes adaptor |
|
| 3600 |
/// |
|
| 3601 |
/// This function just returns a (read-only) \ref SplitNodes adaptor. |
|
| 3602 |
/// \ingroup graph_adaptors |
|
| 3603 |
/// \relates SplitNodes |
|
| 3604 |
template<typename DGR> |
|
| 3605 |
SplitNodes<DGR> |
|
| 3606 |
splitNodes(const DGR& digraph) {
|
|
| 3607 |
return SplitNodes<DGR>(digraph); |
|
| 3608 |
} |
|
| 3609 |
|
|
| 3610 |
#undef LEMON_SCOPE_FIX |
|
| 3611 |
|
|
| 3612 |
} //namespace lemon |
|
| 3613 |
|
|
| 3614 |
#endif //LEMON_ADAPTORS_H |
| ... | ... |
@@ -24,3 +24,3 @@ |
| 24 | 24 |
doc/Doxyfile |
| 25 |
cmake/ |
|
| 25 |
cmake/version.cmake |
|
| 26 | 26 |
.dirstamp |
| ... | ... |
@@ -29,2 +29,7 @@ |
| 29 | 29 |
demo/*.eps |
| 30 |
m4/libtool.m4 |
|
| 31 |
m4/ltoptions.m4 |
|
| 32 |
m4/ltsugar.m4 |
|
| 33 |
m4/ltversion.m4 |
|
| 34 |
m4/lt~obsolete.m4 |
|
| 30 | 35 |
|
| ... | ... |
@@ -37,6 +42,7 @@ |
| 37 | 42 |
^build-aux/.* |
| 38 |
^objs.*/.* |
|
| 43 |
^.*objs.*/.* |
|
| 39 | 44 |
^test/[a-z_]*$ |
| 45 |
^tools/[a-z-_]*$ |
|
| 40 | 46 |
^demo/.*_demo$ |
| 41 |
^build/.* |
|
| 47 |
^.*build.*/.* |
|
| 42 | 48 |
^doc/gen-images/.* |
| ... | ... |
@@ -2,20 +2,38 @@ |
| 2 | 2 |
|
| 3 |
IF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
|
|
| 4 |
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/version.cmake)
|
|
| 5 |
ELSE(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
|
|
| 6 | 3 |
SET(PROJECT_NAME "LEMON") |
| 7 |
SET(PROJECT_VERSION "hg-tip" CACHE STRING "LEMON version string.") |
|
| 8 |
ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake)
|
|
| 9 |
|
|
| 10 | 4 |
PROJECT(${PROJECT_NAME})
|
| 11 | 5 |
|
| 12 |
|
|
| 6 |
IF(EXISTS ${PROJECT_SOURCE_DIR}/cmake/version.cmake)
|
|
| 7 |
INCLUDE(${PROJECT_SOURCE_DIR}/cmake/version.cmake)
|
|
| 8 |
ELSEIF(DEFINED ENV{LEMON_VERSION})
|
|
| 9 |
SET(LEMON_VERSION $ENV{LEMON_VERSION} CACHE STRING "LEMON version string.")
|
|
| 10 |
ELSE() |
|
| 11 |
EXECUTE_PROCESS( |
|
| 12 |
COMMAND hg id -i |
|
| 13 |
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
|
| 14 |
OUTPUT_VARIABLE HG_REVISION |
|
| 15 |
ERROR_QUIET |
|
| 16 |
OUTPUT_STRIP_TRAILING_WHITESPACE |
|
| 17 |
) |
|
| 18 |
IF(HG_REVISION STREQUAL "") |
|
| 19 |
SET(HG_REVISION "hg-tip") |
|
| 20 |
ENDIF() |
|
| 21 |
SET(LEMON_VERSION ${HG_REVISION} CACHE STRING "LEMON version string.")
|
|
| 22 |
ENDIF() |
|
| 13 | 23 |
|
| 14 |
INCLUDE(FindDoxygen) |
|
| 15 |
INCLUDE(FindGhostscript) |
|
| 24 |
SET(PROJECT_VERSION ${LEMON_VERSION})
|
|
| 16 | 25 |
|
| 17 |
|
|
| 26 |
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
|
| 27 |
|
|
| 28 |
FIND_PACKAGE(Doxygen) |
|
| 29 |
FIND_PACKAGE(Ghostscript) |
|
| 30 |
FIND_PACKAGE(GLPK 4.33) |
|
| 31 |
FIND_PACKAGE(CPLEX) |
|
| 32 |
FIND_PACKAGE(COIN) |
|
| 18 | 33 |
|
| 19 | 34 |
INCLUDE(CheckTypeSize) |
| 20 |
CHECK_TYPE_SIZE("long long"
|
|
| 35 |
CHECK_TYPE_SIZE("long long" LONG_LONG)
|
|
| 36 |
SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG})
|
|
| 37 |
|
|
| 38 |
INCLUDE(FindPythonInterp) |
|
| 21 | 39 |
|
| ... | ... |
@@ -24,7 +42,27 @@ |
| 24 | 42 |
ADD_SUBDIRECTORY(lemon) |
| 43 |
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
|
|
| 25 | 44 |
ADD_SUBDIRECTORY(demo) |
| 45 |
ADD_SUBDIRECTORY(tools) |
|
| 26 | 46 |
ADD_SUBDIRECTORY(doc) |
| 27 | 47 |
ADD_SUBDIRECTORY(test) |
| 48 |
ENDIF() |
|
| 28 | 49 |
|
| 29 |
|
|
| 50 |
CONFIGURE_FILE( |
|
| 51 |
${PROJECT_SOURCE_DIR}/cmake/LEMONConfig.cmake.in
|
|
| 52 |
${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
|
|
| 53 |
@ONLY |
|
| 54 |
) |
|
| 55 |
IF(UNIX) |
|
| 56 |
INSTALL( |
|
| 57 |
FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
|
|
| 58 |
DESTINATION share/lemon/cmake |
|
| 59 |
) |
|
| 60 |
ELSEIF(WIN32) |
|
| 61 |
INSTALL( |
|
| 62 |
FILES ${PROJECT_BINARY_DIR}/cmake/LEMONConfig.cmake
|
|
| 63 |
DESTINATION cmake |
|
| 64 |
) |
|
| 65 |
ENDIF() |
|
| 66 |
|
|
| 67 |
IF(${CMAKE_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR} AND WIN32)
|
|
| 30 | 68 |
SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
|
| ... | ... |
@@ -32,4 +70,4 @@ |
| 32 | 70 |
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY |
| 33 |
"LEMON - Library of Efficient Models and Optimization in Networks") |
|
| 34 |
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
|
|
| 71 |
"LEMON - Library for Efficient Modeling and Optimization in Networks") |
|
| 72 |
SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
|
|
| 35 | 73 |
|
| ... | ... |
@@ -42,3 +80,3 @@ |
| 42 | 80 |
|
| 43 |
SET(CPACK_COMPONENTS_ALL headers library html_documentation) |
|
| 81 |
SET(CPACK_COMPONENTS_ALL headers library html_documentation bin) |
|
| 44 | 82 |
|
| ... | ... |
@@ -46,2 +84,3 @@ |
| 46 | 84 |
SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Dynamic-link library") |
| 85 |
SET(CPACK_COMPONENT_BIN_DISPLAY_NAME "Command line utilities") |
|
| 47 | 86 |
SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation") |
| ... | ... |
@@ -52,2 +91,4 @@ |
| 52 | 91 |
"DLL and import library") |
| 92 |
SET(CPACK_COMPONENT_BIN_DESCRIPTION |
|
| 93 |
"Command line utilities") |
|
| 53 | 94 |
SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION |
| ... | ... |
@@ -73,5 +114,5 @@ |
| 73 | 114 |
SET(CPACK_GENERATOR "NSIS") |
| 74 |
SET(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis/lemon.ico")
|
|
| 75 |
SET(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/cmake/nsis/uninstall.ico")
|
|
| 76 |
|
|
| 115 |
SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis/lemon.ico")
|
|
| 116 |
SET(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/cmake/nsis/uninstall.ico")
|
|
| 117 |
#SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/cmake/nsis\\\\installer.bmp")
|
|
| 77 | 118 |
SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico") |
| ... | ... |
@@ -90,2 +131,2 @@ |
| 90 | 131 |
INCLUDE(CPack) |
| 91 |
ENDIF( |
|
| 132 |
ENDIF() |
| ... | ... |
@@ -29,4 +29,4 @@ |
| 29 | 29 |
This command compiles the non-template part of LEMON into libemon.a |
| 30 |
file. It also compiles the programs in the tools and demo subdirectories |
|
| 31 |
when enabled. |
|
| 30 |
file. It also compiles the programs in the tools subdirectory by |
|
| 31 |
default. |
|
| 32 | 32 |
|
| ... | ... |
@@ -77,10 +77,2 @@ |
| 77 | 77 |
|
| 78 |
--enable-demo |
|
| 79 |
|
|
| 80 |
Build the examples in the demo subdirectory. |
|
| 81 |
|
|
| 82 |
--disable-demo |
|
| 83 |
|
|
| 84 |
Do not build the examples in the demo subdirectory (default). |
|
| 85 |
|
|
| 86 | 78 |
--enable-tools |
| ... | ... |
@@ -160,1 +152,24 @@ |
| 160 | 152 |
Disable SoPlex support. |
| 153 |
|
|
| 154 |
--with-coin[=PREFIX] |
|
| 155 |
|
|
| 156 |
Enable support for COIN-OR solvers (CLP and CBC). You should |
|
| 157 |
specify the prefix too. (by default, COIN-OR tools install |
|
| 158 |
themselves to the source code directory). This command enables the |
|
| 159 |
solvers that are actually found. |
|
| 160 |
|
|
| 161 |
--with-coin-includedir=DIR |
|
| 162 |
|
|
| 163 |
The directory where the COIN-OR header files are located. This is |
|
| 164 |
only useful when the COIN-OR headers and libraries are not under |
|
| 165 |
the same prefix (which is unlikely). |
|
| 166 |
|
|
| 167 |
--with-coin-libdir=DIR |
|
| 168 |
|
|
| 169 |
The directory where the COIN-OR libraries are located. This is only |
|
| 170 |
useful when the COIN-OR headers and libraries are not under the |
|
| 171 |
same prefix (which is unlikely). |
|
| 172 |
|
|
| 173 |
--without-coin |
|
| 174 |
|
|
| 175 |
Disable COIN-OR support. |
| ... | ... |
@@ -2,2 +2,4 @@ |
| 2 | 2 |
|
| 3 |
AM_CXXFLAGS = $(WARNINGCXXFLAGS) |
|
| 4 |
|
|
| 3 | 5 |
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) |
| ... | ... |
@@ -11,4 +13,9 @@ |
| 11 | 13 |
m4/lx_check_soplex.m4 \ |
| 14 |
m4/lx_check_coin.m4 \ |
|
| 12 | 15 |
CMakeLists.txt \ |
| 13 | 16 |
cmake/FindGhostscript.cmake \ |
| 17 |
cmake/FindCPLEX.cmake \ |
|
| 18 |
cmake/FindGLPK.cmake \ |
|
| 19 |
cmake/FindCOIN.cmake \ |
|
| 20 |
cmake/LEMONConfig.cmake.in \ |
|
| 14 | 21 |
cmake/version.cmake.in \ |
| ... | ... |
@@ -38,5 +45,9 @@ |
| 38 | 45 |
include doc/Makefile.am |
| 39 |
include demo/Makefile.am |
|
| 40 | 46 |
include tools/Makefile.am |
| 41 | 47 |
|
| 48 |
DIST_SUBDIRS = demo |
|
| 49 |
|
|
| 50 |
demo: |
|
| 51 |
$(MAKE) $(AM_MAKEFLAGS) -C demo |
|
| 52 |
|
|
| 42 | 53 |
MRPROPERFILES = \ |
| ... | ... |
@@ -67,2 +78,2 @@ |
| 67 | 78 |
|
| 68 |
.PHONY: mrproper dist-bz2 distcheck-bz2 |
|
| 79 |
.PHONY: demo mrproper dist-bz2 distcheck-bz2 |
| 1 |
2009-05-13 Version 1.1 released |
|
| 2 |
|
|
| 3 |
This is the second stable release of the 1.x series. It |
|
| 4 |
features a better coverage of the tools available in the 0.x |
|
| 5 |
series, a thoroughly reworked LP/MIP interface plus various |
|
| 6 |
improvements in the existing tools. |
|
| 7 |
|
|
| 8 |
* Much improved M$ Windows support |
|
| 9 |
* Various improvements in the CMAKE build system |
|
| 10 |
* Compilation warnings are fixed/suppressed |
|
| 11 |
* Support IBM xlC compiler |
|
| 12 |
* New algorithms |
|
| 13 |
* Connectivity related algorithms (#61) |
|
| 14 |
* Euler walks (#65) |
|
| 15 |
* Preflow push-relabel max. flow algorithm (#176) |
|
| 16 |
* Circulation algorithm (push-relabel based) (#175) |
|
| 17 |
* Suurballe algorithm (#47) |
|
| 18 |
* Gomory-Hu algorithm (#66) |
|
| 19 |
* Hao-Orlin algorithm (#58) |
|
| 20 |
* Edmond's maximum cardinality and weighted matching algorithms |
|
| 21 |
in general graphs (#48,#265) |
|
| 22 |
* Minimum cost arborescence/branching (#60) |
|
| 23 |
* Network Simplex min. cost flow algorithm (#234) |
|
| 24 |
* New data structures |
|
| 25 |
* Full graph structure (#57) |
|
| 26 |
* Grid graph structure (#57) |
|
| 27 |
* Hypercube graph structure (#57) |
|
| 28 |
* Graph adaptors (#67) |
|
| 29 |
* ArcSet and EdgeSet classes (#67) |
|
| 30 |
* Elevator class (#174) |
|
| 31 |
* Other new tools |
|
| 32 |
* LP/MIP interface (#44) |
|
| 33 |
* Support for GLPK, CPLEX, Soplex, COIN-OR CLP and CBC |
|
| 34 |
* Reader for the Nauty file format (#55) |
|
| 35 |
* DIMACS readers (#167) |
|
| 36 |
* Radix sort algorithms (#72) |
|
| 37 |
* RangeIdMap and CrossRefMap (#160) |
|
| 38 |
* New command line tools |
|
| 39 |
* DIMACS to LGF converter (#182) |
|
| 40 |
* lgf-gen - a graph generator (#45) |
|
| 41 |
* DIMACS solver utility (#226) |
|
| 42 |
* Other code improvements |
|
| 43 |
* Lognormal distribution added to Random (#102) |
|
| 44 |
* Better (i.e. O(1) time) item counting in SmartGraph (#3) |
|
| 45 |
* The standard maps of graphs are guaranteed to be |
|
| 46 |
reference maps (#190) |
|
| 47 |
* Miscellaneous |
|
| 48 |
* Various doc improvements |
|
| 49 |
* Improved 0.x -> 1.x converter script |
|
| 50 |
|
|
| 51 |
* Several bugfixes (compared to release 1.0): |
|
| 52 |
#170: Bugfix SmartDigraph::split() |
|
| 53 |
#171: Bugfix in SmartGraph::restoreSnapshot() |
|
| 54 |
#172: Extended test cases for graphs and digraphs |
|
| 55 |
#173: Bugfix in Random |
|
| 56 |
* operator()s always return a double now |
|
| 57 |
* the faulty real<Num>(Num) and real<Num>(Num,Num) |
|
| 58 |
have been removed |
|
| 59 |
#187: Remove DijkstraWidestPathOperationTraits |
|
| 60 |
#61: Bugfix in DfsVisit |
|
| 61 |
#193: Bugfix in GraphReader::skipSection() |
|
| 62 |
#195: Bugfix in ConEdgeIt() |
|
| 63 |
#197: Bugfix in heap unionfind |
|
| 64 |
* This bug affects Edmond's general matching algorithms |
|
| 65 |
#207: Fix 'make install' without 'make html' using CMAKE |
|
| 66 |
#208: Suppress or fix VS2008 compilation warnings |
|
| 67 |
----: Update the LEMON icon |
|
| 68 |
----: Enable the component-based installer |
|
| 69 |
(in installers made by CPACK) |
|
| 70 |
----: Set the proper version for CMAKE in the tarballs |
|
| 71 |
(made by autotools) |
|
| 72 |
----: Minor clarification in the LICENSE file |
|
| 73 |
----: Add missing unistd.h include to time_measure.h |
|
| 74 |
#204: Compilation bug fixed in graph_to_eps.h with VS2005 |
|
| 75 |
#214,#215: windows.h should never be included by lemon headers |
|
| 76 |
#230: Build systems check the availability of 'long long' type |
|
| 77 |
#229: Default implementation of Tolerance<> is used for integer types |
|
| 78 |
#211,#212: Various fixes for compiling on AIX |
|
| 79 |
----: Improvements in CMAKE config |
|
| 80 |
- docs is installed in share/doc/ |
|
| 81 |
- detects newer versions of Ghostscript |
|
| 82 |
#239: Fix missing 'inline' specifier in time_measure.h |
|
| 83 |
#274,#280: Install lemon/config.h |
|
| 84 |
#275: Prefix macro names with LEMON_ in lemon/config.h |
|
| 85 |
----: Small script for making the release tarballs added |
|
| 86 |
----: Minor improvement in unify-sources.sh (a76f55d7d397) |
|
| 87 |
|
|
| 1 | 88 |
2009-03-27 LEMON joins to the COIN-OR initiative |
| 1 |
================================================================== |
|
| 2 |
LEMON - a Library of Efficient Models and Optimization in Networks |
|
| 3 |
================================================================== |
|
| 1 |
===================================================================== |
|
| 2 |
LEMON - a Library for Efficient Modeling and Optimization in Networks |
|
| 3 |
===================================================================== |
|
| 4 | 4 |
| ... | ... |
@@ -7,6 +7,9 @@ |
| 7 | 7 |
m4_define([lemon_hg_path], [m4_normalize(esyscmd([./scripts/chg-len.py]))]) |
| 8 |
m4_define([lemon_hg_revision], [m4_normalize(esyscmd([hg id -i]))]) |
|
| 8 |
m4_define([lemon_hg_revision], [m4_normalize(esyscmd([hg id -i 2> /dev/null]))]) |
|
| 9 | 9 |
m4_define([lemon_version], [ifelse(lemon_version_number(), |
| 10 | 10 |
[], |
| 11 |
|
|
| 11 |
[ifelse(lemon_hg_revision(), |
|
| 12 |
[], |
|
| 13 |
[hg-tip], |
|
| 14 |
[lemon_hg_path().lemon_hg_revision()])], |
|
| 12 | 15 |
[lemon_version_number()])]) |
| ... | ... |
@@ -21,3 +24,3 @@ |
| 21 | 24 |
|
| 22 |
|
|
| 25 |
AC_DEFINE([LEMON_VERSION], [lemon_version()], [The version string]) |
|
| 23 | 26 |
|
| ... | ... |
@@ -40,2 +43,3 @@ |
| 40 | 43 |
AC_CHECK_PROG([doxygen_found],[doxygen],[yes],[no]) |
| 44 |
AC_CHECK_PROG([python_found],[python],[yes],[no]) |
|
| 41 | 45 |
AC_CHECK_PROG([gs_found],[gs],[yes],[no]) |
| ... | ... |
@@ -54,23 +58,15 @@ |
| 54 | 58 |
dnl Set custom compiler flags when using g++. |
| 55 |
if test x"$lx_cmdline_cxxflags_set" != x"set" -a "$GXX" = yes -a "$ICC" = no; then |
|
| 56 |
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" |
|
| 59 |
if test "$GXX" = yes -a "$ICC" = no; then |
|
| 60 |
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" |
|
| 57 | 61 |
fi |
| 62 |
AC_SUBST([WARNINGCXXFLAGS]) |
|
| 58 | 63 |
|
| 59 | 64 |
dnl Checks for libraries. |
| 60 |
#LX_CHECK_GLPK |
|
| 61 |
#LX_CHECK_CPLEX |
|
| 62 |
|
|
| 65 |
LX_CHECK_GLPK |
|
| 66 |
LX_CHECK_CPLEX |
|
| 67 |
LX_CHECK_SOPLEX |
|
| 68 |
LX_CHECK_COIN |
|
| 63 | 69 |
|
| 64 |
dnl Disable/enable building the demo programs. |
|
| 65 |
AC_ARG_ENABLE([demo], |
|
| 66 |
AS_HELP_STRING([--enable-demo], [build the demo programs]) |
|
| 67 |
AS_HELP_STRING([--disable-demo], [do not build the demo programs @<:@default@:>@]), |
|
| 68 |
[], [enable_demo=no]) |
|
| 69 |
AC_MSG_CHECKING([whether to build the demo programs]) |
|
| 70 |
if test x"$enable_demo" != x"no"; then |
|
| 71 |
AC_MSG_RESULT([yes]) |
|
| 72 |
else |
|
| 73 |
AC_MSG_RESULT([no]) |
|
| 74 |
fi |
|
| 75 |
AM_CONDITIONAL([WANT_DEMO], [test x"$enable_demo" != x"no"]) |
|
| 70 |
AM_CONDITIONAL([HAVE_LP], [test x"$lx_lp_found" = x"yes"]) |
|
| 71 |
AM_CONDITIONAL([HAVE_MIP], [test x"$lx_mip_found" = x"yes"]) |
|
| 76 | 72 |
|
| ... | ... |
@@ -109,2 +105,3 @@ |
| 109 | 105 |
Makefile |
| 106 |
demo/Makefile |
|
| 110 | 107 |
cmake/version.cmake |
| ... | ... |
@@ -122,3 +119,3 @@ |
| 122 | 119 |
echo C++ compiler.................. : $CXX |
| 123 |
echo C++ compiles flags............ : $CXXFLAGS |
|
| 120 |
echo C++ compiles flags............ : $WARNINGCXXFLAGS $CXXFLAGS |
|
| 124 | 121 |
echo |
| ... | ... |
@@ -126,7 +123,8 @@ |
| 126 | 123 |
echo |
| 127 |
#echo GLPK support.................. : $lx_glpk_found |
|
| 128 |
#echo CPLEX support................. : $lx_cplex_found |
|
| 129 |
#echo SOPLEX support................ : $lx_soplex_found |
|
| 130 |
#echo |
|
| 131 |
echo |
|
| 124 |
echo GLPK support.................. : $lx_glpk_found |
|
| 125 |
echo CPLEX support................. : $lx_cplex_found |
|
| 126 |
echo SOPLEX support................ : $lx_soplex_found |
|
| 127 |
echo CLP support................... : $lx_clp_found |
|
| 128 |
echo CBC support................... : $lx_cbc_found |
|
| 129 |
echo |
|
| 132 | 130 |
echo Build additional tools........ : $enable_tools |
| 1 | 1 |
INCLUDE_DIRECTORIES( |
| 2 |
${
|
|
| 2 |
${PROJECT_SOURCE_DIR}
|
|
| 3 | 3 |
${PROJECT_BINARY_DIR}
|
| ... | ... |
@@ -5,3 +5,5 @@ |
| 5 | 5 |
|
| 6 |
LINK_DIRECTORIES( |
|
| 6 |
LINK_DIRECTORIES( |
|
| 7 |
${PROJECT_BINARY_DIR}/lemon
|
|
| 8 |
) |
|
| 7 | 9 |
|
| ... | ... |
@@ -10,3 +12,4 @@ |
| 10 | 12 |
graph_to_eps_demo |
| 11 |
lgf_demo |
|
| 13 |
lgf_demo |
|
| 14 |
) |
|
| 12 | 15 |
|
| ... | ... |
@@ -15,2 +18,2 @@ |
| 15 | 18 |
TARGET_LINK_LIBRARIES(${DEMO_NAME} lemon)
|
| 16 |
ENDFOREACH( |
|
| 19 |
ENDFOREACH() |
| 1 |
EXTRA_DIST += \ |
|
| 2 |
demo/CMakeLists.txt \ |
|
| 3 |
|
|
| 1 |
AM_CXXFLAGS = $(WARNINGCXXFLAGS) |
|
| 4 | 2 |
|
| 5 |
|
|
| 3 |
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) |
|
| 4 |
LDADD = $(top_builddir)/lemon/libemon.la |
|
| 6 | 5 |
|
| 7 |
noinst_PROGRAMS += \ |
|
| 8 |
demo/arg_parser_demo \ |
|
| 9 |
demo/graph_to_eps_demo \ |
|
| 10 |
demo/lgf_demo |
|
| 6 |
EXTRA_DIST = \ |
|
| 7 |
CMakeLists.txt \ |
|
| 8 |
digraph.lgf |
|
| 11 | 9 |
|
| 12 |
|
|
| 10 |
noinst_PROGRAMS = \ |
|
| 11 |
arg_parser_demo \ |
|
| 12 |
graph_to_eps_demo \ |
|
| 13 |
lgf_demo |
|
| 13 | 14 |
|
| 14 |
demo_arg_parser_demo_SOURCES = demo/arg_parser_demo.cc |
|
| 15 |
demo_graph_to_eps_demo_SOURCES = demo/graph_to_eps_demo.cc |
|
| 16 |
|
|
| 15 |
arg_parser_demo_SOURCES = arg_parser_demo.cc |
|
| 16 |
graph_to_eps_demo_SOURCES = graph_to_eps_demo.cc |
|
| 17 |
lgf_demo_SOURCES = lgf_demo.cc |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2009 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -87,3 +87,3 @@ |
| 87 | 87 |
title("Sample .eps figure").
|
| 88 |
copyright("(C) 2003-
|
|
| 88 |
copyright("(C) 2003-2009 LEMON Project").
|
|
| 89 | 89 |
run(); |
| ... | ... |
@@ -94,3 +94,3 @@ |
| 94 | 94 |
title("Sample .eps figure").
|
| 95 |
copyright("(C) 2003-
|
|
| 95 |
copyright("(C) 2003-2009 LEMON Project").
|
|
| 96 | 96 |
absoluteNodeSizes().absoluteArcWidths(). |
| ... | ... |
@@ -107,3 +107,3 @@ |
| 107 | 107 |
title("Sample .eps figure (with arrowheads)").
|
| 108 |
copyright("(C) 2003-
|
|
| 108 |
copyright("(C) 2003-2009 LEMON Project").
|
|
| 109 | 109 |
absoluteNodeSizes().absoluteArcWidths(). |
| ... | ... |
@@ -134,3 +134,3 @@ |
| 134 | 134 |
title("Sample .eps figure (parallel arcs)").
|
| 135 |
copyright("(C) 2003-
|
|
| 135 |
copyright("(C) 2003-2009 LEMON Project").
|
|
| 136 | 136 |
absoluteNodeSizes().absoluteArcWidths(). |
| ... | ... |
@@ -149,3 +149,3 @@ |
| 149 | 149 |
title("Sample .eps figure (parallel arcs and arrowheads)").
|
| 150 |
copyright("(C) 2003-
|
|
| 150 |
copyright("(C) 2003-2009 LEMON Project").
|
|
| 151 | 151 |
absoluteNodeSizes().absoluteArcWidths(). |
| ... | ... |
@@ -165,3 +165,3 @@ |
| 165 | 165 |
title("Sample .eps figure (fits to A4)").
|
| 166 |
copyright("(C) 2003-
|
|
| 166 |
copyright("(C) 2003-2009 LEMON Project").
|
|
| 167 | 167 |
scaleToA4(). |
| ... | ... |
@@ -184,3 +184,3 @@ |
| 184 | 184 |
|
| 185 |
int cols=int(sqrt(double(palette.size()))); |
|
| 185 |
int cols=int(std::sqrt(double(palette.size()))); |
|
| 186 | 186 |
for(int i=0;i<int(paletteW.size());i++) {
|
| ... | ... |
@@ -195,3 +195,3 @@ |
| 195 | 195 |
title("Sample .eps figure (Palette demo)").
|
| 196 |
copyright("(C) 2003-
|
|
| 196 |
copyright("(C) 2003-2009 LEMON Project").
|
|
| 197 | 197 |
coords(hcoords). |
| ... | ... |
@@ -2,41 +2,51 @@ |
| 2 | 2 |
SET(PACKAGE_VERSION ${PROJECT_VERSION})
|
| 3 |
SET(abs_top_srcdir ${CMAKE_SOURCE_DIR})
|
|
| 4 |
SET(abs_top_builddir ${CMAKE_BINARY_DIR})
|
|
| 3 |
SET(abs_top_srcdir ${PROJECT_SOURCE_DIR})
|
|
| 4 |
SET(abs_top_builddir ${PROJECT_BINARY_DIR})
|
|
| 5 | 5 |
|
| 6 | 6 |
CONFIGURE_FILE( |
| 7 |
${CMAKE_SOURCE_DIR}/doc/Doxyfile.in
|
|
| 8 |
${CMAKE_BINARY_DIR}/doc/Doxyfile
|
|
| 9 |
|
|
| 7 |
${PROJECT_SOURCE_DIR}/doc/Doxyfile.in
|
|
| 8 |
${PROJECT_BINARY_DIR}/doc/Doxyfile
|
|
| 9 |
@ONLY |
|
| 10 |
) |
|
| 10 | 11 |
|
| 11 |
IF(DOXYGEN_EXECUTABLE AND GHOSTSCRIPT_EXECUTABLE) |
|
| 12 |
IF(DOXYGEN_EXECUTABLE AND PYTHONINTERP_FOUND AND GHOSTSCRIPT_EXECUTABLE) |
|
| 12 | 13 |
FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/)
|
| 14 |
SET(GHOSTSCRIPT_OPTIONS -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha) |
|
| 15 |
ADD_CUSTOM_TARGET(html |
|
| 16 |
COMMAND ${CMAKE_COMMAND} -E remove_directory gen-images
|
|
| 17 |
COMMAND ${CMAKE_COMMAND} -E make_directory gen-images
|
|
| 18 |
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/bipartite_matching.png ${CMAKE_CURRENT_SOURCE_DIR}/images/bipartite_matching.eps
|
|
| 19 |
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/bipartite_partitions.png ${CMAKE_CURRENT_SOURCE_DIR}/images/bipartite_partitions.eps
|
|
| 20 |
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/connected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/connected_components.eps
|
|
| 21 |
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/edge_biconnected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/edge_biconnected_components.eps
|
|
| 22 |
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/grid_graph.png ${CMAKE_CURRENT_SOURCE_DIR}/images/grid_graph.eps
|
|
| 23 |
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/node_biconnected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/node_biconnected_components.eps
|
|
| 24 |
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_0.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_0.eps
|
|
| 25 |
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_1.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_1.eps
|
|
| 26 |
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_2.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_2.eps
|
|
| 27 |
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_3.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_3.eps
|
|
| 28 |
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_4.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_4.eps
|
|
| 29 |
COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/strongly_connected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/strongly_connected_components.eps
|
|
| 30 |
COMMAND ${CMAKE_COMMAND} -E remove_directory html
|
|
| 31 |
COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/bib2dox.py ${CMAKE_CURRENT_SOURCE_DIR}/references.bib >references.dox
|
|
| 32 |
COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
|
|
| 33 |
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
| 34 |
) |
|
| 35 |
|
|
| 36 |
SET_TARGET_PROPERTIES(html PROPERTIES PROJECT_LABEL BUILD_DOC) |
|
| 37 |
|
|
| 13 | 38 |
IF(UNIX) |
| 14 |
ADD_CUSTOM_TARGET(html |
|
| 15 |
COMMAND rm -rf gen-images |
|
| 16 |
COMMAND mkdir gen-images |
|
| 17 |
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
|
|
| 18 |
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 |
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
|
|
| 20 |
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
|
|
| 21 |
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
|
|
| 22 |
COMMAND rm -rf html |
|
| 23 |
COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
|
|
| 24 |
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
|
| 25 |
ELSEIF(WIN32) |
|
| 26 |
ADD_CUSTOM_TARGET(html |
|
| 27 |
COMMAND if exist gen-images rmdir /s /q gen-images |
|
| 28 |
COMMAND mkdir gen-images |
|
| 29 |
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
|
|
| 30 |
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
|
|
| 31 |
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
|
|
| 32 |
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
|
|
| 33 |
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
|
|
| 34 |
COMMAND if exist html rmdir /s /q html |
|
| 35 |
COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
|
|
| 36 |
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
|
| 37 |
ENDIF(UNIX) |
|
| 38 | 39 |
INSTALL( |
| 39 | 40 |
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
|
| 40 |
DESTINATION share/doc |
|
| 41 |
COMPONENT html_documentation) |
|
| 42 |
|
|
| 41 |
DESTINATION share/doc/lemon/html |
|
| 42 |
COMPONENT html_documentation |
|
| 43 |
) |
|
| 44 |
ELSEIF(WIN32) |
|
| 45 |
INSTALL( |
|
| 46 |
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
|
|
| 47 |
DESTINATION doc |
|
| 48 |
COMPONENT html_documentation |
|
| 49 |
) |
|
| 50 |
ENDIF() |
|
| 51 |
|
|
| 52 |
ENDIF() |
| 1 |
# Doxyfile 1.5. |
|
| 1 |
# Doxyfile 1.5.9 |
|
| 2 | 2 |
|
| ... | ... |
@@ -23,3 +23,2 @@ |
| 23 | 23 |
MULTILINE_CPP_IS_BRIEF = NO |
| 24 |
DETAILS_AT_TOP = YES |
|
| 25 | 24 |
INHERIT_DOCS = NO |
| ... | ... |
@@ -68,3 +67,3 @@ |
| 68 | 67 |
MAX_INITIALIZER_LINES = 5 |
| 69 |
SHOW_USED_FILES = |
|
| 68 |
SHOW_USED_FILES = NO |
|
| 70 | 69 |
SHOW_DIRECTORIES = YES |
| ... | ... |
@@ -93,3 +92,4 @@ |
| 93 | 92 |
"@abs_top_srcdir@/tools" \ |
| 94 |
"@abs_top_srcdir@/test/test_tools.h" |
|
| 93 |
"@abs_top_srcdir@/test/test_tools.h" \ |
|
| 94 |
"@abs_top_builddir@/doc/references.dox" |
|
| 95 | 95 |
INPUT_ENCODING = UTF-8 |
| ... | ... |
@@ -225,3 +225,3 @@ |
| 225 | 225 |
#--------------------------------------------------------------------------- |
| 226 |
# |
|
| 226 |
# Options related to the search engine |
|
| 227 | 227 |
#--------------------------------------------------------------------------- |
| ... | ... |
@@ -10,2 +10,3 @@ |
| 10 | 10 |
doc/migration.dox \ |
| 11 |
doc/min_cost_flow.dox \ |
|
| 11 | 12 |
doc/named-param.dox \ |
| ... | ... |
@@ -16,2 +17,3 @@ |
| 16 | 17 |
DOC_EPS_IMAGES18 = \ |
| 18 |
grid_graph.eps \ |
|
| 17 | 19 |
nodeshape_0.eps \ |
| ... | ... |
@@ -22,4 +24,13 @@ |
| 22 | 24 |
|
| 25 |
DOC_EPS_IMAGES27 = \ |
|
| 26 |
bipartite_matching.eps \ |
|
| 27 |
bipartite_partitions.eps \ |
|
| 28 |
connected_components.eps \ |
|
| 29 |
edge_biconnected_components.eps \ |
|
| 30 |
node_biconnected_components.eps \ |
|
| 31 |
strongly_connected_components.eps |
|
| 32 |
|
|
| 23 | 33 |
DOC_EPS_IMAGES = \ |
| 24 |
$(DOC_EPS_IMAGES18) |
|
| 34 |
$(DOC_EPS_IMAGES18) \ |
|
| 35 |
$(DOC_EPS_IMAGES27) |
|
| 25 | 36 |
|
| ... | ... |
@@ -46,3 +57,26 @@ |
| 46 | 57 |
|
| 47 |
|
|
| 58 |
$(DOC_EPS_IMAGES27:%.eps=doc/gen-images/%.png): doc/gen-images/%.png: doc/images/%.eps |
|
| 59 |
-mkdir doc/gen-images |
|
| 60 |
if test ${gs_found} = yes; then \
|
|
| 61 |
$(GS_COMMAND) -sDEVICE=pngalpha -r27 -sOutputFile=$@ $<; \ |
|
| 62 |
else \ |
|
| 63 |
echo; \ |
|
| 64 |
echo "Ghostscript not found."; \ |
|
| 65 |
echo; \ |
|
| 66 |
exit 1; \ |
|
| 67 |
fi |
|
| 68 |
|
|
| 69 |
references.dox: doc/references.bib |
|
| 70 |
if test ${python_found} = yes; then \
|
|
| 71 |
cd doc; \ |
|
| 72 |
python @abs_top_srcdir@/scripts/bib2dox.py @abs_top_builddir@/$< >$@; \ |
|
| 73 |
cd ..; \ |
|
| 74 |
else \ |
|
| 75 |
echo; \ |
|
| 76 |
echo "Python not found."; \ |
|
| 77 |
echo; \ |
|
| 78 |
exit 1; \ |
|
| 79 |
fi |
|
| 80 |
|
|
| 81 |
html-local: $(DOC_PNG_IMAGES) references.dox |
|
| 48 | 82 |
if test ${doxygen_found} = yes; then \
|
| ... | ... |
@@ -71,7 +105,7 @@ |
| 71 | 105 |
@$(NORMAL_INSTALL) |
| 72 |
$(mkinstalldirs) $(DESTDIR)$(htmldir)/ |
|
| 106 |
$(mkinstalldirs) $(DESTDIR)$(htmldir)/html |
|
| 73 | 107 |
for p in doc/html/*.{html,css,png,map,gif,tag} ; do \
|
| 74 | 108 |
f="`echo $$p | sed -e 's|^.*/||'`"; \ |
| 75 |
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(htmldir)/docs/$$f"; \ |
|
| 76 |
$(INSTALL_DATA) $$p $(DESTDIR)$(htmldir)/docs/$$f; \ |
|
| 109 |
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(htmldir)/html/$$f"; \ |
|
| 110 |
$(INSTALL_DATA) $$p $(DESTDIR)$(htmldir)/html/$$f; \ |
|
| 77 | 111 |
done |
| ... | ... |
@@ -82,4 +116,4 @@ |
| 82 | 116 |
f="`echo $$p | sed -e 's|^.*/||'`"; \ |
| 83 |
echo " rm -f $(DESTDIR)$(htmldir)/docs/$$f"; \ |
|
| 84 |
rm -f $(DESTDIR)$(htmldir)/docs/$$f; \ |
|
| 117 |
echo " rm -f $(DESTDIR)$(htmldir)/html/$$f"; \ |
|
| 118 |
rm -f $(DESTDIR)$(htmldir)/html/$$f; \ |
|
| 85 | 119 |
done |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2009 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -18,5 +18,7 @@ |
| 18 | 18 |
|
| 19 |
namespace lemon {
|
|
| 20 |
|
|
| 19 | 21 |
/** |
| 20 | 22 |
@defgroup datas Data Structures |
| 21 |
This group |
|
| 23 |
This group contains the several data structures implemented in LEMON. |
|
| 22 | 24 |
*/ |
| ... | ... |
@@ -62,9 +64,75 @@ |
| 62 | 64 |
/** |
| 63 |
@defgroup |
|
| 65 |
@defgroup graph_adaptors Adaptor Classes for Graphs |
|
| 64 | 66 |
@ingroup graphs |
| 65 |
\brief |
|
| 67 |
\brief Adaptor classes for digraphs and graphs |
|
| 66 | 68 |
|
| 67 |
This group describes some graph types between real graphs and graph adaptors. |
|
| 68 |
These classes wrap graphs to give new functionality as the adaptors do it. |
|
| 69 |
|
|
| 69 |
This group contains several useful adaptor classes for digraphs and graphs. |
|
| 70 |
|
|
| 71 |
The main parts of LEMON are the different graph structures, generic |
|
| 72 |
graph algorithms, graph concepts, which couple them, and graph |
|
| 73 |
adaptors. While the previous notions are more or less clear, the |
|
| 74 |
latter one needs further explanation. Graph adaptors are graph classes |
|
| 75 |
which serve for considering graph structures in different ways. |
|
| 76 |
|
|
| 77 |
A short example makes this much clearer. Suppose that we have an |
|
| 78 |
instance \c g of a directed graph type, say ListDigraph and an algorithm |
|
| 79 |
\code |
|
| 80 |
template <typename Digraph> |
|
| 81 |
int algorithm(const Digraph&); |
|
| 82 |
\endcode |
|
| 83 |
is needed to run on the reverse oriented graph. It may be expensive |
|
| 84 |
(in time or in memory usage) to copy \c g with the reversed |
|
| 85 |
arcs. In this case, an adaptor class is used, which (according |
|
| 86 |
to LEMON \ref concepts::Digraph "digraph concepts") works as a digraph. |
|
| 87 |
The adaptor uses the original digraph structure and digraph operations when |
|
| 88 |
methods of the reversed oriented graph are called. This means that the adaptor |
|
| 89 |
have minor memory usage, and do not perform sophisticated algorithmic |
|
| 90 |
actions. The purpose of it is to give a tool for the cases when a |
|
| 91 |
graph have to be used in a specific alteration. If this alteration is |
|
| 92 |
obtained by a usual construction like filtering the node or the arc set or |
|
| 93 |
considering a new orientation, then an adaptor is worthwhile to use. |
|
| 94 |
To come back to the reverse oriented graph, in this situation |
|
| 95 |
\code |
|
| 96 |
template<typename Digraph> class ReverseDigraph; |
|
| 97 |
\endcode |
|
| 98 |
template class can be used. The code looks as follows |
|
| 99 |
\code |
|
| 100 |
ListDigraph g; |
|
| 101 |
ReverseDigraph<ListDigraph> rg(g); |
|
| 102 |
int result = algorithm(rg); |
|
| 103 |
\endcode |
|
| 104 |
During running the algorithm, the original digraph \c g is untouched. |
|
| 105 |
This techniques give rise to an elegant code, and based on stable |
|
| 106 |
graph adaptors, complex algorithms can be implemented easily. |
|
| 107 |
|
|
| 108 |
In flow, circulation and matching problems, the residual |
|
| 109 |
graph is of particular importance. Combining an adaptor implementing |
|
| 110 |
this with shortest path algorithms or minimum mean cycle algorithms, |
|
| 111 |
a range of weighted and cardinality optimization algorithms can be |
|
| 112 |
obtained. For other examples, the interested user is referred to the |
|
| 113 |
detailed documentation of particular adaptors. |
|
| 114 |
|
|
| 115 |
The behavior of graph adaptors can be very different. Some of them keep |
|
| 116 |
capabilities of the original graph while in other cases this would be |
|
| 117 |
meaningless. This means that the concepts that they meet depend |
|
| 118 |
on the graph adaptor, and the wrapped graph. |
|
| 119 |
For example, if an arc of a reversed digraph is deleted, this is carried |
|
| 120 |
out by deleting the corresponding arc of the original digraph, thus the |
|
| 121 |
adaptor modifies the original digraph. |
|
| 122 |
However in case of a residual digraph, this operation has no sense. |
|
| 123 |
|
|
| 124 |
Let us stand one more example here to simplify your work. |
|
| 125 |
ReverseDigraph has constructor |
|
| 126 |
\code |
|
| 127 |
ReverseDigraph(Digraph& digraph); |
|
| 128 |
\endcode |
|
| 129 |
This means that in a situation, when a <tt>const %ListDigraph&</tt> |
|
| 130 |
reference to a graph is given, then it have to be instantiated with |
|
| 131 |
<tt>Digraph=const %ListDigraph</tt>. |
|
| 132 |
\code |
|
| 133 |
int algorithm1(const ListDigraph& g) {
|
|
| 134 |
ReverseDigraph<const ListDigraph> rg(g); |
|
| 135 |
return algorithm2(rg); |
|
| 136 |
} |
|
| 137 |
\endcode |
|
| 70 | 138 |
*/ |
| ... | ... |
@@ -76,3 +144,3 @@ |
| 76 | 144 |
|
| 77 |
This group |
|
| 145 |
This group contains the map structures implemented in LEMON. |
|
| 78 | 146 |
|
| ... | ... |
@@ -89,4 +157,7 @@ |
| 89 | 157 |
|
| 90 |
This group describes maps that are specifically designed to assign |
|
| 91 |
values to the nodes and arcs of graphs. |
|
| 158 |
This group contains maps that are specifically designed to assign |
|
| 159 |
values to the nodes and arcs/edges of graphs. |
|
| 160 |
|
|
| 161 |
If you are looking for the standard graph maps (\c NodeMap, \c ArcMap, |
|
| 162 |
\c EdgeMap), see the \ref graph_concepts "Graph Structure Concepts". |
|
| 92 | 163 |
*/ |
| ... | ... |
@@ -98,6 +169,6 @@ |
| 98 | 169 |
|
| 99 |
This group |
|
| 170 |
This group contains map adaptors that are used to create "implicit" |
|
| 100 | 171 |
maps from other maps. |
| 101 | 172 |
|
| 102 |
Most of them are \ref |
|
| 173 |
Most of them are \ref concepts::ReadMap "read-only maps". |
|
| 103 | 174 |
They can make arithmetic and logical operations between one or two maps |
| ... | ... |
@@ -157,10 +228,2 @@ |
| 157 | 228 |
/** |
| 158 |
@defgroup matrices Matrices |
|
| 159 |
@ingroup datas |
|
| 160 |
\brief Two dimensional data storages implemented in LEMON. |
|
| 161 |
|
|
| 162 |
This group describes two dimensional data storages implemented in LEMON. |
|
| 163 |
*/ |
|
| 164 |
|
|
| 165 |
/** |
|
| 166 | 229 |
@defgroup paths Path Structures |
| ... | ... |
@@ -169,3 +232,3 @@ |
| 169 | 232 |
|
| 170 |
This group |
|
| 233 |
This group contains the path structures implemented in LEMON. |
|
| 171 | 234 |
|
| ... | ... |
@@ -177,3 +240,32 @@ |
| 177 | 240 |
|
| 178 |
\sa |
|
| 241 |
\sa \ref concepts::Path "Path concept" |
|
| 242 |
*/ |
|
| 243 |
|
|
| 244 |
/** |
|
| 245 |
@defgroup heaps Heap Structures |
|
| 246 |
@ingroup datas |
|
| 247 |
\brief %Heap structures implemented in LEMON. |
|
| 248 |
|
|
| 249 |
This group contains the heap structures implemented in LEMON. |
|
| 250 |
|
|
| 251 |
LEMON provides several heap classes. They are efficient implementations |
|
| 252 |
of the abstract data type \e priority \e queue. They store items with |
|
| 253 |
specified values called \e priorities in such a way that finding and |
|
| 254 |
removing the item with minimum priority are efficient. |
|
| 255 |
The basic operations are adding and erasing items, changing the priority |
|
| 256 |
of an item, etc. |
|
| 257 |
|
|
| 258 |
Heaps are crucial in several algorithms, such as Dijkstra and Prim. |
|
| 259 |
The heap implementations have the same interface, thus any of them can be |
|
| 260 |
used easily in such algorithms. |
|
| 261 |
|
|
| 262 |
\sa \ref concepts::Heap "Heap concept" |
|
| 263 |
*/ |
|
| 264 |
|
|
| 265 |
/** |
|
| 266 |
@defgroup matrices Matrices |
|
| 267 |
@ingroup datas |
|
| 268 |
\brief Two dimensional data storages implemented in LEMON. |
|
| 269 |
|
|
| 270 |
This group contains two dimensional data storages implemented in LEMON. |
|
| 179 | 271 |
*/ |
| ... | ... |
@@ -185,3 +277,3 @@ |
| 185 | 277 |
|
| 186 |
This group |
|
| 278 |
This group contains some data structures implemented in LEMON in |
|
| 187 | 279 |
order to make it easier to implement combinatorial algorithms. |
| ... | ... |
@@ -190,7 +282,29 @@ |
| 190 | 282 |
/** |
| 283 |
@defgroup geomdat Geometric Data Structures |
|
| 284 |
@ingroup auxdat |
|
| 285 |
\brief Geometric data structures implemented in LEMON. |
|
| 286 |
|
|
| 287 |
This group contains geometric data structures implemented in LEMON. |
|
| 288 |
|
|
| 289 |
- \ref lemon::dim2::Point "dim2::Point" implements a two dimensional |
|
| 290 |
vector with the usual operations. |
|
| 291 |
- \ref lemon::dim2::Box "dim2::Box" can be used to determine the |
|
| 292 |
rectangular bounding box of a set of \ref lemon::dim2::Point |
|
| 293 |
"dim2::Point"'s. |
|
| 294 |
*/ |
|
| 295 |
|
|
| 296 |
/** |
|
| 297 |
@defgroup matrices Matrices |
|
| 298 |
@ingroup auxdat |
|
| 299 |
\brief Two dimensional data storages implemented in LEMON. |
|
| 300 |
|
|
| 301 |
This group contains two dimensional data storages implemented in LEMON. |
|
| 302 |
*/ |
|
| 303 |
|
|
| 304 |
/** |
|
| 191 | 305 |
@defgroup algs Algorithms |
| 192 |
\brief This group |
|
| 306 |
\brief This group contains the several algorithms |
|
| 193 | 307 |
implemented in LEMON. |
| 194 | 308 |
|
| 195 |
This group |
|
| 309 |
This group contains the several algorithms |
|
| 196 | 310 |
implemented in LEMON. |
| ... | ... |
@@ -203,4 +317,5 @@ |
| 203 | 317 |
|
| 204 |
This group describes the common graph search algorithms like |
|
| 205 |
Breadth-First Search (BFS) and Depth-First Search (DFS). |
|
| 318 |
This group contains the common graph search algorithms, namely |
|
| 319 |
\e breadth-first \e search (BFS) and \e depth-first \e search (DFS) |
|
| 320 |
\ref clrs01algorithms. |
|
| 206 | 321 |
*/ |
| ... | ... |
@@ -212,3 +327,26 @@ |
| 212 | 327 |
|
| 213 |
This group |
|
| 328 |
This group contains the algorithms for finding shortest paths in digraphs |
|
| 329 |
\ref clrs01algorithms. |
|
| 330 |
|
|
| 331 |
- \ref Dijkstra algorithm for finding shortest paths from a source node |
|
| 332 |
when all arc lengths are non-negative. |
|
| 333 |
- \ref BellmanFord "Bellman-Ford" algorithm for finding shortest paths |
|
| 334 |
from a source node when arc lenghts can be either positive or negative, |
|
| 335 |
but the digraph should not contain directed cycles with negative total |
|
| 336 |
length. |
|
| 337 |
- \ref FloydWarshall "Floyd-Warshall" and \ref Johnson "Johnson" algorithms |
|
| 338 |
for solving the \e all-pairs \e shortest \e paths \e problem when arc |
|
| 339 |
lenghts can be either positive or negative, but the digraph should |
|
| 340 |
not contain directed cycles with negative total length. |
|
| 341 |
- \ref Suurballe A successive shortest path algorithm for finding |
|
| 342 |
arc-disjoint paths between two nodes having minimum total length. |
|
| 343 |
*/ |
|
| 344 |
|
|
| 345 |
/** |
|
| 346 |
@defgroup spantree Minimum Spanning Tree Algorithms |
|
| 347 |
@ingroup algs |
|
| 348 |
\brief Algorithms for finding minimum cost spanning trees and arborescences. |
|
| 349 |
|
|
| 350 |
This group contains the algorithms for finding minimum cost spanning |
|
| 351 |
trees and arborescences \ref clrs01algorithms. |
|
| 214 | 352 |
*/ |
| ... | ... |
@@ -220,26 +358,36 @@ |
| 220 | 358 |
|
| 221 |
This group describes the algorithms for finding maximum flows and |
|
| 222 |
feasible circulations. |
|
| 359 |
This group contains the algorithms for finding maximum flows and |
|
| 360 |
feasible circulations \ref clrs01algorithms, \ref amo93networkflows. |
|
| 223 | 361 |
|
| 224 |
The maximum flow problem is to find a flow between a single source and |
|
| 225 |
a single target that is maximum. Formally, there is a \f$G=(V,A)\f$ |
|
| 226 |
directed graph, an \f$c_a:A\rightarrow\mathbf{R}^+_0\f$ capacity
|
|
| 227 |
function and given \f$s, t \in V\f$ source and target node. The |
|
| 228 |
maximum flow is |
|
| 362 |
The \e maximum \e flow \e problem is to find a flow of maximum value between |
|
| 363 |
a single source and a single target. Formally, there is a \f$G=(V,A)\f$ |
|
| 364 |
digraph, a \f$cap: A\rightarrow\mathbf{R}^+_0\f$ capacity function and
|
|
| 365 |
\f$s, t \in V\f$ source and target nodes. |
|
| 366 |
A maximum flow is an \f$f: A\rightarrow\mathbf{R}^+_0\f$ solution of the
|
|
| 367 |
following optimization problem. |
|
| 229 | 368 |
|
| 230 |
\f[ 0 \le f_a \le c_a \f] |
|
| 231 |
\f[ \sum_{v\in\delta^{-}(u)}f_{vu}=\sum_{v\in\delta^{+}(u)}f_{uv}
|
|
| 232 |
\qquad \forall u \in V \setminus \{s,t\}\f]
|
|
| 233 |
\f[ \max \sum_{v\in\delta^{+}(s)}f_{uv} - \sum_{v\in\delta^{-}(s)}f_{vu}\f]
|
|
| 369 |
\f[ \max\sum_{sv\in A} f(sv) - \sum_{vs\in A} f(vs) \f]
|
|
| 370 |
\f[ \sum_{uv\in A} f(uv) = \sum_{vu\in A} f(vu)
|
|
| 371 |
\quad \forall u\in V\setminus\{s,t\} \f]
|
|
| 372 |
\f[ 0 \leq f(uv) \leq cap(uv) \quad \forall uv\in A \f] |
|
| 234 | 373 |
|
| 235 | 374 |
LEMON contains several algorithms for solving maximum flow problems: |
| 236 |
- \ref lemon::EdmondsKarp "Edmonds-Karp" |
|
| 237 |
- \ref lemon::Preflow "Goldberg's Preflow algorithm" |
|
| 238 |
- \ref lemon::DinitzSleatorTarjan "Dinitz's blocking flow algorithm with dynamic trees" |
|
| 239 |
- \ref lemon::GoldbergTarjan "Preflow algorithm with dynamic trees" |
|
| 375 |
- \ref EdmondsKarp Edmonds-Karp algorithm |
|
| 376 |
\ref edmondskarp72theoretical. |
|
| 377 |
- \ref Preflow Goldberg-Tarjan's preflow push-relabel algorithm |
|
| 378 |
\ref goldberg88newapproach. |
|
| 379 |
- \ref DinitzSleatorTarjan Dinitz's blocking flow algorithm with dynamic trees |
|
| 380 |
\ref dinic70algorithm, \ref sleator83dynamic. |
|
| 381 |
- \ref GoldbergTarjan !Preflow push-relabel algorithm with dynamic trees |
|
| 382 |
\ref goldberg88newapproach, \ref sleator83dynamic. |
|
| 240 | 383 |
|
| 241 |
In most cases the \ref lemon::Preflow "Preflow" algorithm provides the |
|
| 242 |
fastest method to compute the maximum flow. All impelementations |
|
| 243 |
provides functions to query the minimum cut, which is the dual linear |
|
| 244 |
programming problem of the maximum flow. |
|
| 384 |
In most cases the \ref Preflow algorithm provides the |
|
| 385 |
fastest method for computing a maximum flow. All implementations |
|
| 386 |
also provide functions to query the minimum cut, which is the dual |
|
| 387 |
problem of maximum flow. |
|
| 388 |
|
|
| 389 |
\ref Circulation is a preflow push-relabel algorithm implemented directly |
|
| 390 |
for finding feasible circulations, which is a somewhat different problem, |
|
| 391 |
but it is strongly related to maximum flow. |
|
| 392 |
For more information, see \ref Circulation. |
|
| 245 | 393 |
*/ |
| ... | ... |
@@ -247,3 +395,3 @@ |
| 247 | 395 |
/** |
| 248 |
@defgroup |
|
| 396 |
@defgroup min_cost_flow_algs Minimum Cost Flow Algorithms |
|
| 249 | 397 |
@ingroup algs |
| ... | ... |
@@ -252,4 +400,24 @@ |
| 252 | 400 |
|
| 253 |
This group describes the algorithms for finding minimum cost flows and |
|
| 254 |
circulations. |
|
| 401 |
This group contains the algorithms for finding minimum cost flows and |
|
| 402 |
circulations \ref amo93networkflows. For more information about this |
|
| 403 |
problem and its dual solution, see \ref min_cost_flow |
|
| 404 |
"Minimum Cost Flow Problem". |
|
| 405 |
|
|
| 406 |
LEMON contains several algorithms for this problem. |
|
| 407 |
- \ref NetworkSimplex Primal Network Simplex algorithm with various |
|
| 408 |
pivot strategies \ref dantzig63linearprog, \ref kellyoneill91netsimplex. |
|
| 409 |
- \ref CostScaling Push-Relabel and Augment-Relabel algorithms based on |
|
| 410 |
cost scaling \ref goldberg90approximation, \ref goldberg97efficient, |
|
| 411 |
\ref bunnagel98efficient. |
|
| 412 |
- \ref CapacityScaling Successive Shortest %Path algorithm with optional |
|
| 413 |
capacity scaling \ref edmondskarp72theoretical. |
|
| 414 |
- \ref CancelAndTighten The Cancel and Tighten algorithm |
|
| 415 |
\ref goldberg89cyclecanceling. |
|
| 416 |
- \ref CycleCanceling Cycle-Canceling algorithms |
|
| 417 |
\ref klein67primal, \ref goldberg89cyclecanceling. |
|
| 418 |
|
|
| 419 |
In general NetworkSimplex is the most efficient implementation, |
|
| 420 |
but in special cases other algorithms could be faster. |
|
| 421 |
For example, if the total supply and/or capacities are rather small, |
|
| 422 |
CapacityScaling is usually the fastest algorithm (without effective scaling). |
|
| 255 | 423 |
*/ |
| ... | ... |
@@ -262,8 +430,8 @@ |
| 262 | 430 |
|
| 263 |
This group |
|
| 431 |
This group contains the algorithms for finding minimum cut in graphs. |
|
| 264 | 432 |
|
| 265 |
The minimum cut problem is to find a non-empty and non-complete |
|
| 266 |
\f$X\f$ subset of the vertices with minimum overall capacity on |
|
| 267 |
outgoing arcs. Formally, there is \f$G=(V,A)\f$ directed graph, an |
|
| 268 |
\f$c_a:A\rightarrow\mathbf{R}^+_0\f$ capacity function. The minimum
|
|
| 433 |
The \e minimum \e cut \e problem is to find a non-empty and non-complete |
|
| 434 |
\f$X\f$ subset of the nodes with minimum overall capacity on |
|
| 435 |
outgoing arcs. Formally, there is a \f$G=(V,A)\f$ digraph, a |
|
| 436 |
\f$cap: A\rightarrow\mathbf{R}^+_0\f$ capacity function. The minimum
|
|
| 269 | 437 |
cut is the \f$X\f$ solution of the next optimization problem: |
| ... | ... |
@@ -271,3 +439,3 @@ |
| 271 | 439 |
\f[ \min_{X \subset V, X\not\in \{\emptyset, V\}}
|
| 272 |
\sum_{uv\in A
|
|
| 440 |
\sum_{uv\in A: u\in X, v\not\in X}cap(uv) \f]
|
|
| 273 | 441 |
|
| ... | ... |
@@ -275,11 +443,11 @@ |
| 275 | 443 |
|
| 276 |
- \ref lemon::HaoOrlin "Hao-Orlin algorithm" to calculate minimum cut |
|
| 277 |
in directed graphs |
|
| 278 |
- \ref lemon::NagamochiIbaraki "Nagamochi-Ibaraki algorithm" to |
|
| 279 |
calculate minimum cut in undirected graphs |
|
| 280 |
- \ref lemon::GomoryHuTree "Gomory-Hu tree computation" to calculate all |
|
| 281 |
pairs minimum cut in undirected graphs |
|
| 444 |
- \ref HaoOrlin "Hao-Orlin algorithm" for calculating minimum cut |
|
| 445 |
in directed graphs. |
|
| 446 |
- \ref NagamochiIbaraki "Nagamochi-Ibaraki algorithm" for |
|
| 447 |
calculating minimum cut in undirected graphs. |
|
| 448 |
- \ref GomoryHu "Gomory-Hu tree computation" for calculating |
|
| 449 |
all-pairs minimum cut in undirected graphs. |
|
| 282 | 450 |
|
| 283 | 451 |
If you want to find minimum cut just between two distinict nodes, |
| 284 |
|
|
| 452 |
see the \ref max_flow "maximum flow problem". |
|
| 285 | 453 |
*/ |
| ... | ... |
@@ -287,3 +455,80 @@ |
| 287 | 455 |
/** |
| 288 |
@defgroup |
|
| 456 |
@defgroup min_mean_cycle Minimum Mean Cycle Algorithms |
|
| 457 |
@ingroup algs |
|
| 458 |
\brief Algorithms for finding minimum mean cycles. |
|
| 459 |
|
|
| 460 |
This group contains the algorithms for finding minimum mean cycles |
|
| 461 |
\ref clrs01algorithms, \ref amo93networkflows. |
|
| 462 |
|
|
| 463 |
The \e minimum \e mean \e cycle \e problem is to find a directed cycle |
|
| 464 |
of minimum mean length (cost) in a digraph. |
|
| 465 |
The mean length of a cycle is the average length of its arcs, i.e. the |
|
| 466 |
ratio between the total length of the cycle and the number of arcs on it. |
|
| 467 |
|
|
| 468 |
This problem has an important connection to \e conservative \e length |
|
| 469 |
\e functions, too. A length function on the arcs of a digraph is called |
|
| 470 |
conservative if and only if there is no directed cycle of negative total |
|
| 471 |
length. For an arbitrary length function, the negative of the minimum |
|
| 472 |
cycle mean is the smallest \f$\epsilon\f$ value so that increasing the |
|
| 473 |
arc lengths uniformly by \f$\epsilon\f$ results in a conservative length |
|
| 474 |
function. |
|
| 475 |
|
|
| 476 |
LEMON contains three algorithms for solving the minimum mean cycle problem: |
|
| 477 |
- \ref Karp "Karp"'s original algorithm \ref amo93networkflows, |
|
| 478 |
\ref dasdan98minmeancycle. |
|
| 479 |
- \ref HartmannOrlin "Hartmann-Orlin"'s algorithm, which is an improved |
|
| 480 |
version of Karp's algorithm \ref dasdan98minmeancycle. |
|
| 481 |
- \ref Howard "Howard"'s policy iteration algorithm |
|
| 482 |
\ref dasdan98minmeancycle. |
|
| 483 |
|
|
| 484 |
In practice, the Howard algorithm proved to be by far the most efficient |
|
| 485 |
one, though the best known theoretical bound on its running time is |
|
| 486 |
exponential. |
|
| 487 |
Both Karp and HartmannOrlin algorithms run in time O(ne) and use space |
|
| 488 |
O(n<sup>2</sup>+e), but the latter one is typically faster due to the |
|
| 489 |
applied early termination scheme. |
|
| 490 |
*/ |
|
| 491 |
|
|
| 492 |
/** |
|
| 493 |
@defgroup matching Matching Algorithms |
|
| 494 |
@ingroup algs |
|
| 495 |
\brief Algorithms for finding matchings in graphs and bipartite graphs. |
|
| 496 |
|
|
| 497 |
This group contains the algorithms for calculating |
|
| 498 |
matchings in graphs and bipartite graphs. The general matching problem is |
|
| 499 |
finding a subset of the edges for which each node has at most one incident |
|
| 500 |
edge. |
|
| 501 |
|
|
| 502 |
There are several different algorithms for calculate matchings in |
|
| 503 |
graphs. The matching problems in bipartite graphs are generally |
|
| 504 |
easier than in general graphs. The goal of the matching optimization |
|
| 505 |
can be finding maximum cardinality, maximum weight or minimum cost |
|
| 506 |
matching. The search can be constrained to find perfect or |
|
| 507 |
maximum cardinality matching. |
|
| 508 |
|
|
| 509 |
The matching algorithms implemented in LEMON: |
|
| 510 |
- \ref MaxBipartiteMatching Hopcroft-Karp augmenting path algorithm |
|
| 511 |
for calculating maximum cardinality matching in bipartite graphs. |
|
| 512 |
- \ref PrBipartiteMatching Push-relabel algorithm |
|
| 513 |
for calculating maximum cardinality matching in bipartite graphs. |
|
| 514 |
- \ref MaxWeightedBipartiteMatching |
|
| 515 |
Successive shortest path algorithm for calculating maximum weighted |
|
| 516 |
matching and maximum weighted bipartite matching in bipartite graphs. |
|
| 517 |
- \ref MinCostMaxBipartiteMatching |
|
| 518 |
Successive shortest path algorithm for calculating minimum cost maximum |
|
| 519 |
matching in bipartite graphs. |
|
| 520 |
- \ref MaxMatching Edmond's blossom shrinking algorithm for calculating |
|
| 521 |
maximum cardinality matching in general graphs. |
|
| 522 |
- \ref MaxWeightedMatching Edmond's blossom shrinking algorithm for calculating |
|
| 523 |
maximum weighted matching in general graphs. |
|
| 524 |
- \ref MaxWeightedPerfectMatching |
|
| 525 |
Edmond's blossom shrinking algorithm for calculating maximum weighted |
|
| 526 |
perfect matching in general graphs. |
|
| 527 |
|
|
| 528 |
\image html bipartite_matching.png |
|
| 529 |
\image latex bipartite_matching.eps "Bipartite Matching" width=\textwidth |
|
| 530 |
*/ |
|
| 531 |
|
|
| 532 |
/** |
|
| 533 |
@defgroup graph_properties Connectivity and Other Graph Properties |
|
| 289 | 534 |
@ingroup algs |
| ... | ... |
@@ -291,7 +536,7 @@ |
| 291 | 536 |
|
| 292 |
This group |
|
| 537 |
This group contains the algorithms for discovering the graph properties |
|
| 293 | 538 |
like connectivity, bipartiteness, euler property, simplicity etc. |
| 294 | 539 |
|
| 295 |
\image html edge_biconnected_components.png |
|
| 296 |
\image latex edge_biconnected_components.eps "bi-edge-connected components" width=\textwidth |
|
| 540 |
\image html connected_components.png |
|
| 541 |
\image latex connected_components.eps "Connected components" width=\textwidth |
|
| 297 | 542 |
*/ |
| ... | ... |
@@ -303,3 +548,3 @@ |
| 303 | 548 |
|
| 304 |
This group |
|
| 549 |
This group contains the algorithms for planarity checking, |
|
| 305 | 550 |
embedding and drawing. |
| ... | ... |
@@ -311,49 +556,8 @@ |
| 311 | 556 |
/** |
| 312 |
@defgroup |
|
| 557 |
@defgroup approx Approximation Algorithms |
|
| 313 | 558 |
@ingroup algs |
| 314 |
\brief |
|
| 559 |
\brief Approximation algorithms. |
|
| 315 | 560 |
|
| 316 |
This group contains algorithm objects and functions to calculate |
|
| 317 |
matchings in graphs and bipartite graphs. The general matching problem is |
|
| 318 |
finding a subset of the arcs which does not shares common endpoints. |
|
| 319 |
|
|
| 320 |
There are several different algorithms for calculate matchings in |
|
| 321 |
graphs. The matching problems in bipartite graphs are generally |
|
| 322 |
easier than in general graphs. The goal of the matching optimization |
|
| 323 |
can be the finding maximum cardinality, maximum weight or minimum cost |
|
| 324 |
matching. The search can be constrained to find perfect or |
|
| 325 |
maximum cardinality matching. |
|
| 326 |
|
|
| 327 |
LEMON contains the next algorithms: |
|
| 328 |
- \ref lemon::MaxBipartiteMatching "MaxBipartiteMatching" Hopcroft-Karp |
|
| 329 |
augmenting path algorithm for calculate maximum cardinality matching in |
|
| 330 |
bipartite graphs |
|
| 331 |
- \ref lemon::PrBipartiteMatching "PrBipartiteMatching" Push-Relabel |
|
| 332 |
algorithm for calculate maximum cardinality matching in bipartite graphs |
|
| 333 |
- \ref lemon::MaxWeightedBipartiteMatching "MaxWeightedBipartiteMatching" |
|
| 334 |
Successive shortest path algorithm for calculate maximum weighted matching |
|
| 335 |
and maximum weighted bipartite matching in bipartite graph |
|
| 336 |
- \ref lemon::MinCostMaxBipartiteMatching "MinCostMaxBipartiteMatching" |
|
| 337 |
Successive shortest path algorithm for calculate minimum cost maximum |
|
| 338 |
matching in bipartite graph |
|
| 339 |
- \ref lemon::MaxMatching "MaxMatching" Edmond's blossom shrinking algorithm |
|
| 340 |
for calculate maximum cardinality matching in general graph |
|
| 341 |
- \ref lemon::MaxWeightedMatching "MaxWeightedMatching" Edmond's blossom |
|
| 342 |
shrinking algorithm for calculate maximum weighted matching in general |
|
| 343 |
graph |
|
| 344 |
- \ref lemon::MaxWeightedPerfectMatching "MaxWeightedPerfectMatching" |
|
| 345 |
Edmond's blossom shrinking algorithm for calculate maximum weighted |
|
| 346 |
perfect matching in general graph |
|
| 347 |
|
|
| 348 |
\image html bipartite_matching.png |
|
| 349 |
\image latex bipartite_matching.eps "Bipartite Matching" width=\textwidth |
|
| 350 |
*/ |
|
| 351 |
|
|
| 352 |
/** |
|
| 353 |
@defgroup spantree Minimum Spanning Tree Algorithms |
|
| 354 |
@ingroup algs |
|
| 355 |
\brief Algorithms for finding a minimum cost spanning tree in a graph. |
|
| 356 |
|
|
| 357 |
This group describes the algorithms for finding a minimum cost spanning |
|
| 358 |
|
|
| 561 |
This group contains the approximation and heuristic algorithms |
|
| 562 |
implemented in LEMON. |
|
| 359 | 563 |
*/ |
| ... | ... |
@@ -365,3 +569,3 @@ |
| 365 | 569 |
|
| 366 |
This group |
|
| 570 |
This group contains some algorithms implemented in LEMON |
|
| 367 | 571 |
in order to make it easier to implement complex algorithms. |
| ... | ... |
@@ -370,7 +574,7 @@ |
| 370 | 574 |
/** |
| 371 |
@defgroup approx Approximation Algorithms |
|
| 372 |
@ingroup algs |
|
| 373 |
|
|
| 575 |
@defgroup gen_opt_group General Optimization Tools |
|
| 576 |
\brief This group contains some general optimization frameworks |
|
| 577 |
implemented in LEMON. |
|
| 374 | 578 |
|
| 375 |
This group |
|
| 579 |
This group contains some general optimization frameworks |
|
| 376 | 580 |
implemented in LEMON. |
| ... | ... |
@@ -379,18 +583,12 @@ |
| 379 | 583 |
/** |
| 380 |
@defgroup gen_opt_group General Optimization Tools |
|
| 381 |
\brief This group describes some general optimization frameworks |
|
| 382 |
|
|
| 584 |
@defgroup lp_group LP and MIP Solvers |
|
| 585 |
@ingroup gen_opt_group |
|
| 586 |
\brief LP and MIP solver interfaces for LEMON. |
|
| 383 | 587 |
|
| 384 |
This group describes some general optimization frameworks |
|
| 385 |
implemented in LEMON. |
|
| 386 |
|
|
| 588 |
This group contains LP and MIP solver interfaces for LEMON. |
|
| 589 |
Various LP solvers could be used in the same manner with this |
|
| 590 |
high-level interface. |
|
| 387 | 591 |
|
| 388 |
/** |
|
| 389 |
@defgroup lp_group Lp and Mip Solvers |
|
| 390 |
@ingroup gen_opt_group |
|
| 391 |
\brief Lp and Mip solver interfaces for LEMON. |
|
| 392 |
|
|
| 393 |
This group describes Lp and Mip solver interfaces for LEMON. The |
|
| 394 |
various LP solvers could be used in the same manner with this |
|
| 395 |
interface. |
|
| 592 |
The currently supported solvers are \ref glpk, \ref clp, \ref cbc, |
|
| 593 |
\ref cplex, \ref soplex. |
|
| 396 | 594 |
*/ |
| ... | ... |
@@ -411,3 +609,3 @@ |
| 411 | 609 |
|
| 412 |
This group |
|
| 610 |
This group contains some metaheuristic optimization tools. |
|
| 413 | 611 |
*/ |
| ... | ... |
@@ -426,3 +624,3 @@ |
| 426 | 624 |
|
| 427 |
This group |
|
| 625 |
This group contains some simple basic graph utilities. |
|
| 428 | 626 |
*/ |
| ... | ... |
@@ -434,3 +632,3 @@ |
| 434 | 632 |
|
| 435 |
This group |
|
| 633 |
This group contains several useful tools for development, |
|
| 436 | 634 |
debugging and testing. |
| ... | ... |
@@ -443,3 +641,3 @@ |
| 443 | 641 |
|
| 444 |
This group |
|
| 642 |
This group contains simple tools for measuring the performance |
|
| 445 | 643 |
of algorithms. |
| ... | ... |
@@ -452,3 +650,3 @@ |
| 452 | 650 |
|
| 453 |
This group |
|
| 651 |
This group contains the exceptions defined in LEMON. |
|
| 454 | 652 |
*/ |
| ... | ... |
@@ -459,3 +657,3 @@ |
| 459 | 657 |
|
| 460 |
This group |
|
| 658 |
This group contains the tools for importing and exporting graphs |
|
| 461 | 659 |
and graph related data. Now it supports the \ref lgf-format |
| ... | ... |
@@ -466,3 +664,3 @@ |
| 466 | 664 |
/** |
| 467 |
@defgroup lemon_io LEMON |
|
| 665 |
@defgroup lemon_io LEMON Graph Format |
|
| 468 | 666 |
@ingroup io_group |
| ... | ... |
@@ -470,3 +668,3 @@ |
| 470 | 668 |
|
| 471 |
This group |
|
| 669 |
This group contains methods for reading and writing |
|
| 472 | 670 |
\ref lgf-format "LEMON Graph Format". |
| ... | ... |
@@ -479,3 +677,3 @@ |
| 479 | 677 |
|
| 480 |
This group |
|
| 678 |
This group contains general \c EPS drawing methods and special |
|
| 481 | 679 |
graph exporting tools. |
| ... | ... |
@@ -484,2 +682,18 @@ |
| 484 | 682 |
/** |
| 683 |
@defgroup dimacs_group DIMACS Format |
|
| 684 |
@ingroup io_group |
|
| 685 |
\brief Read and write files in DIMACS format |
|
| 686 |
|
|
| 687 |
Tools to read a digraph from or write it to a file in DIMACS format data. |
|
| 688 |
*/ |
|
| 689 |
|
|
| 690 |
/** |
|
| 691 |
@defgroup nauty_group NAUTY Format |
|
| 692 |
@ingroup io_group |
|
| 693 |
\brief Read \e Nauty format |
|
| 694 |
|
|
| 695 |
Tool to read graphs from \e Nauty format data. |
|
| 696 |
*/ |
|
| 697 |
|
|
| 698 |
/** |
|
| 485 | 699 |
@defgroup concept Concepts |
| ... | ... |
@@ -487,3 +701,3 @@ |
| 487 | 701 |
|
| 488 |
This group |
|
| 702 |
This group contains the data/algorithm skeletons and concept checking |
|
| 489 | 703 |
classes implemented in LEMON. |
| ... | ... |
@@ -517,4 +731,4 @@ |
| 517 | 731 |
|
| 518 |
This group describes the skeletons and concept checking classes of LEMON's |
|
| 519 |
graph structures and helper classes used to implement these. |
|
| 732 |
This group contains the skeletons and concept checking classes of |
|
| 733 |
graph structures. |
|
| 520 | 734 |
*/ |
| ... | ... |
@@ -526,3 +740,3 @@ |
| 526 | 740 |
|
| 527 |
This group |
|
| 741 |
This group contains the skeletons and concept checking classes of maps. |
|
| 528 | 742 |
*/ |
| ... | ... |
@@ -530,15 +744,3 @@ |
| 530 | 744 |
/** |
| 531 |
\anchor demoprograms |
|
| 532 |
|
|
| 533 |
@defgroup demos Demo programs |
|
| 534 |
|
|
| 535 |
Some demo programs are listed here. Their full source codes can be found in |
|
| 536 |
the \c demo subdirectory of the source tree. |
|
| 537 |
|
|
| 538 |
It order to compile them, use <tt>--enable-demo</tt> configure option when |
|
| 539 |
build the library. |
|
| 540 |
*/ |
|
| 541 |
|
|
| 542 |
/** |
|
| 543 |
@defgroup tools Standalone |
|
| 745 |
@defgroup tools Standalone Utility Applications |
|
| 544 | 746 |
|
| ... | ... |
@@ -550,1 +752,14 @@ |
| 550 | 752 |
|
| 753 |
/** |
|
| 754 |
\anchor demoprograms |
|
| 755 |
|
|
| 756 |
@defgroup demos Demo Programs |
|
| 757 |
|
|
| 758 |
Some demo programs are listed here. Their full source codes can be found in |
|
| 759 |
the \c demo subdirectory of the source tree. |
|
| 760 |
|
|
| 761 |
In order to compile them, use the <tt>make demo</tt> or the |
|
| 762 |
<tt>make check</tt> commands. |
|
| 763 |
*/ |
|
| 764 |
|
|
| 765 |
} |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2009 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -23,11 +23,7 @@ |
| 23 | 23 |
|
| 24 |
\subsection whatis What is LEMON |
|
| 25 |
|
|
| 26 |
LEMON stands for |
|
| 27 |
<b>L</b>ibrary of <b>E</b>fficient <b>M</b>odels |
|
| 28 |
and <b>O</b>ptimization in <b>N</b>etworks. |
|
| 29 |
It is a C++ template |
|
| 30 |
library aimed at combinatorial optimization tasks which |
|
| 31 |
often involve in working |
|
| 32 |
|
|
| 24 |
<b>LEMON</b> stands for <i><b>L</b>ibrary for <b>E</b>fficient <b>M</b>odeling |
|
| 25 |
and <b>O</b>ptimization in <b>N</b>etworks</i>. |
|
| 26 |
It is a C++ template library providing efficient implementation of common |
|
| 27 |
data structures and algorithms with focus on combinatorial optimization |
|
| 28 |
problems in graphs and networks. |
|
| 33 | 29 |
|
| ... | ... |
@@ -41,18 +37,18 @@ |
| 41 | 37 |
|
| 42 |
|
|
| 38 |
The project is maintained by the |
|
| 39 |
<a href="http://www.cs.elte.hu/egres/">Egerváry Research Group on |
|
| 40 |
Combinatorial Optimization</a> \ref egres |
|
| 41 |
at the Operations Research Department of the |
|
| 42 |
<a href="http://www.elte.hu/">Eötvös Loránd University, |
|
| 43 |
Budapest</a>, Hungary. |
|
| 44 |
LEMON is also a member of the <a href="http://www.coin-or.org/">COIN-OR</a> |
|
| 45 |
initiative \ref coinor. |
|
| 43 | 46 |
|
| 44 |
If you want to get a quick start and see the most important features then |
|
| 45 |
take a look at our \ref quicktour |
|
| 46 |
|
|
| 47 |
\section howtoread How to Read the Documentation |
|
| 47 | 48 |
|
| 48 |
If you already feel like using our library, see the page that tells you |
|
| 49 |
\ref getstart "How to start using LEMON". |
|
| 49 |
If you would like to get to know the library, see |
|
| 50 |
<a class="el" href="http://lemon.cs.elte.hu/pub/tutorial/">LEMON Tutorial</a>. |
|
| 50 | 51 |
|
| 51 |
If you |
|
| 52 |
want to see how LEMON works, see |
|
| 53 |
some \ref demoprograms "demo programs". |
|
| 54 |
|
|
| 55 |
If you know what you are looking for then try to find it under the |
|
| 56 |
<a class="el" href="modules.html">Modules</a> |
|
| 57 |
|
|
| 52 |
If you know what you are looking for, then try to find it under the |
|
| 53 |
<a class="el" href="modules.html">Modules</a> section. |
|
| 58 | 54 |
| ... | ... |
@@ -4,3 +4,3 @@ |
| 4 | 4 |
* |
| 5 |
* Copyright (C) 2003- |
|
| 5 |
* Copyright (C) 2003-2009 |
|
| 6 | 6 |
* Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
| ... | ... |
@@ -27,3 +27,3 @@ |
| 27 | 27 |
Many of these changes adjusted automatically by the |
| 28 |
<tt> |
|
| 28 |
<tt>lemon-0.x-to-1.x.sh</tt> tool. Those requiring manual |
|
| 29 | 29 |
update are typeset <b>boldface</b>. |
| ... | ... |
@@ -55,5 +55,7 @@ |
| 55 | 55 |
\warning |
| 56 |
<b>The <tt>script/lemon-0.x-to-1.x.sh</tt> tool replaces all instances of |
|
| 57 |
the words \c graph, \c digraph, \c edge and \c arc, so it replaces them |
|
| 58 |
|
|
| 56 |
<b>The <tt>lemon-0.x-to-1.x.sh</tt> script replaces the words \c graph, |
|
| 57 |
\c ugraph, \c edge and \c uedge in your own identifiers and in |
|
| 58 |
strings, comments etc. as well as in all LEMON specific identifiers. |
|
| 59 |
So use the script carefully and make a backup copy of your source files |
|
| 60 |
before applying the script to them.</b> |
|
| 59 | 61 |
| 1 | 1 |
INCLUDE_DIRECTORIES( |
| 2 |
${
|
|
| 2 |
${PROJECT_SOURCE_DIR}
|
|
| 3 | 3 |
${PROJECT_BINARY_DIR}
|
| ... | ... |
@@ -10,3 +10,3 @@ |
| 10 | 10 |
|
| 11 |
|
|
| 11 |
SET(LEMON_SOURCES |
|
| 12 | 12 |
arg_parser.cc |
| ... | ... |
@@ -14,2 +14,4 @@ |
| 14 | 14 |
color.cc |
| 15 |
lp_base.cc |
|
| 16 |
lp_skeleton.cc |
|
| 15 | 17 |
random.cc |
| ... | ... |
@@ -18,2 +20,32 @@ |
| 18 | 20 |
|
| 21 |
IF(LEMON_HAVE_GLPK) |
|
| 22 |
SET(LEMON_SOURCES ${LEMON_SOURCES} glpk.cc)
|
|
| 23 |
INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIRS})
|
|
| 24 |
IF(WIN32) |
|
| 25 |
INSTALL(FILES ${GLPK_BIN_DIR}/glpk.dll DESTINATION bin)
|
|
| 26 |
INSTALL(FILES ${GLPK_BIN_DIR}/libltdl3.dll DESTINATION bin)
|
|
| 27 |
INSTALL(FILES ${GLPK_BIN_DIR}/zlib1.dll DESTINATION bin)
|
|
| 28 |
ENDIF() |
|
| 29 |
ENDIF() |
|
| 30 |
|
|
| 31 |
IF(LEMON_HAVE_CPLEX) |
|
| 32 |
SET(LEMON_SOURCES ${LEMON_SOURCES} cplex.cc)
|
|
| 33 |
INCLUDE_DIRECTORIES(${CPLEX_INCLUDE_DIRS})
|
|
| 34 |
ENDIF() |
|
| 35 |
|
|
| 36 |
IF(LEMON_HAVE_CLP) |
|
| 37 |
SET(LEMON_SOURCES ${LEMON_SOURCES} clp.cc)
|
|
| 38 |
INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS})
|
|
| 39 |
ENDIF() |
|
| 40 |
|
|
| 41 |
IF(LEMON_HAVE_CBC) |
|
| 42 |
SET(LEMON_SOURCES ${LEMON_SOURCES} cbc.cc)
|
|
| 43 |
INCLUDE_DIRECTORIES(${COIN_INCLUDE_DIRS})
|
|
| 44 |
ENDIF() |
|
| 45 |
|
|
| 46 |
ADD_LIBRARY(lemon ${LEMON_SOURCES})
|
|
| 47 |
IF(UNIX) |
|
| 48 |
SET_TARGET_PROPERTIES(lemon PROPERTIES OUTPUT_NAME emon) |
|
| 49 |
ENDIF() |
|
| 50 |
|
|
| 19 | 51 |
INSTALL( |
| ... | ... |
@@ -21,3 +53,4 @@ |
| 21 | 53 |
ARCHIVE DESTINATION lib |
| 22 |
COMPONENT library |
|
| 54 |
COMPONENT library |
|
| 55 |
) |
|
| 23 | 56 |
|
| ... | ... |
@@ -27,3 +60,4 @@ |
| 27 | 60 |
COMPONENT headers |
| 28 |
FILES_MATCHING PATTERN "*.h" |
|
| 61 |
FILES_MATCHING PATTERN "*.h" |
|
| 62 |
) |
|
| 29 | 63 |
|
| ... | ... |
@@ -32,2 +66,3 @@ |
| 32 | 66 |
DESTINATION include/lemon |
| 33 |
COMPONENT headers |
|
| 67 |
COMPONENT headers |
|
| 68 |
) |
| ... | ... |
@@ -2,3 +2,4 @@ |
| 2 | 2 |
lemon/lemon.pc.in \ |
| 3 |
lemon/CMakeLists.txt |
|
| 3 |
lemon/CMakeLists.txt \ |
|
| 4 |
lemon/config.h.cmake |
|
| 4 | 5 |
|
| ... | ... |
@@ -12,2 +13,4 @@ |
| 12 | 13 |
lemon/color.cc \ |
| 14 |
lemon/lp_base.cc \ |
|
| 15 |
lemon/lp_skeleton.cc \ |
|
| 13 | 16 |
lemon/random.cc \ |
| ... | ... |
@@ -15,16 +18,57 @@ |
| 15 | 18 |
|
| 16 |
#lemon_libemon_la_CXXFLAGS = $(GLPK_CFLAGS) $(CPLEX_CFLAGS) $(SOPLEX_CXXFLAGS) |
|
| 17 |
#lemon_libemon_la_LDFLAGS = $(GLPK_LIBS) $(CPLEX_LIBS) $(SOPLEX_LIBS) |
|
| 18 |
|
|
| 19 | 19 |
nodist_lemon_HEADERS = lemon/config.h |
| 20 | 20 |
|
| 21 |
lemon_libemon_la_CXXFLAGS = \ |
|
| 22 |
$(AM_CXXFLAGS) \ |
|
| 23 |
$(GLPK_CFLAGS) \ |
|
| 24 |
$(CPLEX_CFLAGS) \ |
|
| 25 |
$(SOPLEX_CXXFLAGS) \ |
|
| 26 |
$(CLP_CXXFLAGS) \ |
|
| 27 |
$(CBC_CXXFLAGS) |
|
| 28 |
|
|
| 29 |
lemon_libemon_la_LDFLAGS = \ |
|
| 30 |
$(GLPK_LIBS) \ |
|
| 31 |
$(CPLEX_LIBS) \ |
|
| 32 |
$(SOPLEX_LIBS) \ |
|
| 33 |
$(CLP_LIBS) \ |
|
| 34 |
$(CBC_LIBS) |
|
| 35 |
|
|
| 36 |
if HAVE_GLPK |
|
| 37 |
lemon_libemon_la_SOURCES += lemon/glpk.cc |
|
| 38 |
endif |
|
| 39 |
|
|
| 40 |
if HAVE_CPLEX |
|
| 41 |
lemon_libemon_la_SOURCES += lemon/cplex.cc |
|
| 42 |
endif |
|
| 43 |
|
|
| 44 |
if HAVE_SOPLEX |
|
| 45 |
lemon_libemon_la_SOURCES += lemon/soplex.cc |
|
| 46 |
endif |
|
| 47 |
|
|
| 48 |
if HAVE_CLP |
|
| 49 |
lemon_libemon_la_SOURCES += lemon/clp.cc |
|
| 50 |
endif |
|
| 51 |
|
|
| 52 |
if HAVE_CBC |
|
| 53 |
lemon_libemon_la_SOURCES += lemon/cbc.cc |
|
| 54 |
endif |
|
| 55 |
|
|
| 21 | 56 |
lemon_HEADERS += \ |
| 57 |
lemon/adaptors.h \ |
|
| 22 | 58 |
lemon/arg_parser.h \ |
| 23 | 59 |
lemon/assert.h \ |
| 60 |
lemon/bellman_ford.h \ |
|
| 24 | 61 |
lemon/bfs.h \ |
| 25 | 62 |
lemon/bin_heap.h \ |
| 63 |
lemon/binom_heap.h \ |
|
| 64 |
lemon/bucket_heap.h \ |
|
| 65 |
lemon/cbc.h \ |
|
| 66 |
lemon/circulation.h \ |
|
| 67 |
lemon/clp.h \ |
|
| 26 | 68 |
lemon/color.h \ |
| 27 | 69 |
lemon/concept_check.h \ |
| 70 |
lemon/connectivity.h \ |
|
| 28 | 71 |
lemon/counter.h \ |
| 29 | 72 |
lemon/core.h \ |
| 73 |
lemon/cplex.h \ |
|
| 30 | 74 |
lemon/dfs.h \ |
| ... | ... |
@@ -32,5 +76,21 @@ |
| 32 | 76 |
lemon/dim2.h \ |
| 77 |
lemon/dimacs.h \ |
|
| 78 |
lemon/edge_set.h \ |
|
| 79 |
lemon/elevator.h \ |
|
| 33 | 80 |
lemon/error.h \ |
| 81 |
lemon/euler.h \ |
|
| 82 |
lemon/fib_heap.h \ |
|
| 83 |
lemon/fourary_heap.h \ |
|
| 84 |
lemon/full_graph.h \ |
|
| 85 |
lemon/glpk.h \ |
|
| 86 |
lemon/gomory_hu.h \ |
|
| 34 | 87 |
lemon/graph_to_eps.h \ |
| 88 |
lemon/grid_graph.h \ |
|
| 89 |
lemon/hartmann_orlin.h \ |
|
| 90 |
lemon/howard.h \ |
|
| 91 |
lemon/hypercube_graph.h \ |
|
| 92 |
lemon/karp.h \ |
|
| 93 |
lemon/kary_heap.h \ |
|
| 35 | 94 |
lemon/kruskal.h \ |
| 95 |
lemon/hao_orlin.h \ |
|
| 36 | 96 |
lemon/lgf_reader.h \ |
| ... | ... |
@@ -38,7 +98,21 @@ |
| 38 | 98 |
lemon/list_graph.h \ |
| 99 |
lemon/lp.h \ |
|
| 100 |
lemon/lp_base.h \ |
|
| 101 |
lemon/lp_skeleton.h \ |
|
| 39 | 102 |
lemon/maps.h \ |
| 103 |
lemon/matching.h \ |
|
| 40 | 104 |
lemon/math.h \ |
| 105 |
lemon/min_cost_arborescence.h \ |
|
| 106 |
lemon/nauty_reader.h \ |
|
| 107 |
lemon/network_simplex.h \ |
|
| 108 |
lemon/pairing_heap.h \ |
|
| 41 | 109 |
lemon/path.h \ |
| 110 |
lemon/preflow.h \ |
|
| 111 |
lemon/radix_heap.h \ |
|
| 112 |
lemon/radix_sort.h \ |
|
| 42 | 113 |
lemon/random.h \ |
| 43 | 114 |
lemon/smart_graph.h \ |
| 115 |
lemon/soplex.h \ |
|
| 116 |
lemon/static_graph.h \ |
|
| 117 |
lemon/suurballe.h \ |
|
| 44 | 118 |
lemon/time_measure.h \ |
| ... | ... |
@@ -51,6 +125,7 @@ |
| 51 | 125 |
lemon/bits/array_map.h \ |
| 52 |
lemon/bits/base_extender.h \ |
|
| 53 | 126 |
lemon/bits/bezier.h \ |
| 54 | 127 |
lemon/bits/default_map.h \ |
| 128 |
lemon/bits/edge_set_extender.h \ |
|
| 55 | 129 |
lemon/bits/enable_if.h \ |
| 130 |
lemon/bits/graph_adaptor_extender.h \ |
|
| 56 | 131 |
lemon/bits/graph_extender.h \ |
| ... | ... |
@@ -58,3 +133,5 @@ |
| 58 | 133 |
lemon/bits/path_dump.h \ |
| 134 |
lemon/bits/solver_bits.h \ |
|
| 59 | 135 |
lemon/bits/traits.h \ |
| 136 |
lemon/bits/variant.h \ |
|
| 60 | 137 |
lemon/bits/vector_map.h |
Changeset was too big and was cut off... Show full diff
0 comments (0 inline)