[Lemon-commits] Alpar Juttner: Merge #68 (Port static graph impl...

Lemon HG hg at lemon.cs.elte.hu
Thu Nov 5 10:24:29 CET 2009


details:   http://lemon.cs.elte.hu/hg/lemon/rev/580af8cf2f6a
changeset: 840:580af8cf2f6a
user:      Alpar Juttner <alpar [at] cs.elte.hu>
date:      Thu Nov 05 10:23:16 2009 +0100
description:
	Merge #68 (Port static graph implementation)

diffstat:

 CMakeLists.txt                    |     2 +
 Makefile.am                       |     1 +
 configure.ac                      |     1 +
 doc/CMakeLists.txt                |     3 +-
 doc/Doxyfile.in                   |     8 +-
 doc/Makefile.am                   |    14 +-
 doc/groups.dox                    |   233 ++++++--
 doc/mainpage.dox                  |    24 +-
 doc/min_cost_flow.dox             |     2 +-
 doc/references.bib                |   301 +++++++++++
 lemon/Makefile.am                 |     8 +
 lemon/bellman_ford.h              |  1100 ++++++++++++++++++++++++++++++++++++++++
 lemon/bfs.h                       |   121 ++--
 lemon/bin_heap.h                  |   220 ++++----
 lemon/binom_heap.h                |   445 ++++++++++++++++
 lemon/bits/map_extender.h         |     4 +
 lemon/bucket_heap.h               |   305 ++++++-----
 lemon/cbc.cc                      |    12 +
 lemon/cbc.h                       |     1 +
 lemon/circulation.h               |    27 +-
 lemon/clp.cc                      |    13 +
 lemon/clp.h                       |     1 +
 lemon/concepts/digraph.h          |   335 ++++++------
 lemon/concepts/graph.h            |   656 ++++++++++++-----------
 lemon/concepts/graph_components.h |     2 +-
 lemon/concepts/heap.h             |   130 ++--
 lemon/concepts/maps.h             |     3 +-
 lemon/cplex.cc                    |    33 +
 lemon/cplex.h                     |     1 +
 lemon/dfs.h                       |   115 ++--
 lemon/dijkstra.h                  |   120 ++--
 lemon/dim2.h                      |    11 +-
 lemon/fib_heap.h                  |   243 ++++----
 lemon/fourary_heap.h              |   342 ++++++++++++
 lemon/full_graph.h                |   110 ++-
 lemon/glpk.cc                     |    36 +
 lemon/glpk.h                      |     1 +
 lemon/gomory_hu.h                 |     8 +-
 lemon/grid_graph.h                |    72 +-
 lemon/hartmann_orlin.h            |   640 +++++++++++++++++++++++
 lemon/howard.h                    |   597 ++++++++++++++++++++++
 lemon/hypercube_graph.h           |    33 +-
 lemon/karp.h                      |   582 +++++++++++++++++++++
 lemon/kary_heap.h                 |   352 +++++++++++++
 lemon/list_graph.h                |   479 +++++++++--------
 lemon/lp_base.h                   |    22 +-
 lemon/lp_skeleton.cc              |     5 +
 lemon/lp_skeleton.h               |     2 +
 lemon/maps.h                      |  1080 +++++++++++++++++++++++++++++++++++++--
 lemon/min_cost_arborescence.h     |     4 +-
 lemon/network_simplex.h           |   156 ++--
 lemon/pairing_heap.h              |   474 +++++++++++++++++
 lemon/path.h                      |    10 +-
 lemon/preflow.h                   |    34 +-
 lemon/radix_heap.h                |   363 ++++++------
 lemon/smart_graph.h               |   334 ++++++------
 lemon/soplex.cc                   |    13 +
 lemon/soplex.h                    |     1 +
 m4/lx_check_coin.m4               |     2 +-
 scripts/bib2dox.py                |   811 ++++++++++++++++++++++++++++++
 scripts/bootstrap.sh              |   134 ++++
 scripts/chg-len.py                |    14 +
 scripts/mk-release.sh             |    14 +
 scripts/unify-sources.sh          |    14 +
 test/CMakeLists.txt               |     2 +
 test/Makefile.am                  |     4 +
 test/bellman_ford_test.cc         |   283 ++++++++++
 test/circulation_test.cc          |     5 +
 test/digraph_test.cc              |    16 +
 test/graph_test.cc                |    28 +
 test/heap_test.cc                 |    74 ++-
 test/maps_test.cc                 |   416 +++++++++++++++
 test/min_mean_cycle_test.cc       |   216 ++++++++
 test/mip_test.cc                  |     3 +-
 test/preflow_test.cc              |     5 +
 test/test_tools.h                 |    14 +-
 tools/lemon-0.x-to-1.x.sh         |     9 +-
 77 files changed, 10267 insertions(+), 2042 deletions(-)

diffs (truncated from 16746 to 300 lines):

diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,6 +35,8 @@
 CHECK_TYPE_SIZE("long long" LONG_LONG)
 SET(LEMON_HAVE_LONG_LONG ${HAVE_LONG_LONG})
 
+INCLUDE(FindPythonInterp)
+
 ENABLE_TESTING()
 
 ADD_SUBDIRECTORY(lemon)
diff --git a/Makefile.am b/Makefile.am
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,6 +17,7 @@
 	cmake/FindCPLEX.cmake \
 	cmake/FindGLPK.cmake \
 	cmake/FindCOIN.cmake \
+	cmake/LEMONConfig.cmake.in \
 	cmake/version.cmake.in \
 	cmake/version.cmake \
 	cmake/nsis/lemon.ico \
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -41,6 +41,7 @@
 AC_PROG_LIBTOOL
 
 AC_CHECK_PROG([doxygen_found],[doxygen],[yes],[no])
+AC_CHECK_PROG([python_found],[python],[yes],[no])
 AC_CHECK_PROG([gs_found],[gs],[yes],[no])
 
 dnl Detect Intel compiler.
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -9,7 +9,7 @@
   @ONLY
 )
 
-IF(DOXYGEN_EXECUTABLE AND GHOSTSCRIPT_EXECUTABLE)
+IF(DOXYGEN_EXECUTABLE AND PYTHONINTERP_FOUND AND GHOSTSCRIPT_EXECUTABLE)
   FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/)
   SET(GHOSTSCRIPT_OPTIONS -dNOPAUSE -dBATCH -q -dEPSCrop -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sDEVICE=pngalpha)
   ADD_CUSTOM_TARGET(html
@@ -28,6 +28,7 @@
     COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/nodeshape_4.png ${CMAKE_CURRENT_SOURCE_DIR}/images/nodeshape_4.eps
     COMMAND ${GHOSTSCRIPT_EXECUTABLE} ${GHOSTSCRIPT_OPTIONS} -r18 -sOutputFile=gen-images/strongly_connected_components.png ${CMAKE_CURRENT_SOURCE_DIR}/images/strongly_connected_components.eps
     COMMAND ${CMAKE_COMMAND} -E remove_directory html
+    COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/bib2dox.py ${CMAKE_CURRENT_SOURCE_DIR}/references.bib >references.dox
     COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
   )
diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in
--- a/doc/Doxyfile.in
+++ b/doc/Doxyfile.in
@@ -1,4 +1,4 @@
-# Doxyfile 1.5.7.1
+# Doxyfile 1.5.9
 
 #---------------------------------------------------------------------------
 # Project related configuration options
@@ -21,7 +21,6 @@
 JAVADOC_AUTOBRIEF      = NO
 QT_AUTOBRIEF           = NO
 MULTILINE_CPP_IS_BRIEF = NO
-DETAILS_AT_TOP         = YES
 INHERIT_DOCS           = NO
 SEPARATE_MEMBER_PAGES  = NO
 TAB_SIZE               = 8
@@ -91,7 +90,8 @@
                          "@abs_top_srcdir@/lemon/concepts" \
                          "@abs_top_srcdir@/demo" \
                          "@abs_top_srcdir@/tools" \
-                         "@abs_top_srcdir@/test/test_tools.h"
+                         "@abs_top_srcdir@/test/test_tools.h" \
+                         "@abs_top_builddir@/doc/references.dox"
 INPUT_ENCODING         = UTF-8
 FILE_PATTERNS          = *.h \
                          *.cc \
@@ -223,7 +223,7 @@
 EXPAND_AS_DEFINED      = 
 SKIP_FUNCTION_MACROS   = YES
 #---------------------------------------------------------------------------
-# Configuration::additions related to external references   
+# Options related to the search engine   
 #---------------------------------------------------------------------------
 TAGFILES               = "@abs_top_srcdir@/doc/libstdc++.tag = http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/  "
 GENERATE_TAGFILE       = html/lemon.tag
diff --git a/doc/Makefile.am b/doc/Makefile.am
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -66,7 +66,19 @@
 	  exit 1; \
 	fi
 
-html-local: $(DOC_PNG_IMAGES)
+references.dox: doc/references.bib
+	if test ${python_found} = yes; then \
+	  cd doc; \
+	  python @abs_top_srcdir@/scripts/bib2dox.py @abs_top_builddir@/$< >$@; \
+	  cd ..; \
+	else \
+	  echo; \
+	  echo "Python not found."; \
+	  echo; \
+	  exit 1; \
+	fi
+
+html-local: $(DOC_PNG_IMAGES) references.dox
 	if test ${doxygen_found} = yes; then \
 	  cd doc; \
 	  doxygen Doxyfile; \
diff --git a/doc/groups.dox b/doc/groups.dox
--- a/doc/groups.dox
+++ b/doc/groups.dox
@@ -226,14 +226,6 @@
 */
 
 /**
- at defgroup matrices Matrices
- at ingroup datas
-\brief Two dimensional data storages implemented in LEMON.
-
-This group contains two dimensional data storages implemented in LEMON.
-*/
-
-/**
 @defgroup paths Path Structures
 @ingroup datas
 \brief %Path structures implemented in LEMON.
@@ -246,7 +238,36 @@
 efficient to have e.g. the Dijkstra algorithm to store its result in
 any kind of path structure.
 
-\sa lemon::concepts::Path
+\sa \ref concepts::Path "Path concept"
+*/
+
+/**
+ at defgroup heaps Heap Structures
+ at ingroup datas
+\brief %Heap structures implemented in LEMON.
+
+This group contains the heap structures implemented in LEMON.
+
+LEMON provides several heap classes. They are efficient implementations
+of the abstract data type \e priority \e queue. They store items with
+specified values called \e priorities in such a way that finding and
+removing the item with minimum priority are efficient.
+The basic operations are adding and erasing items, changing the priority
+of an item, etc.
+
+Heaps are crucial in several algorithms, such as Dijkstra and Prim.
+The heap implementations have the same interface, thus any of them can be
+used easily in such algorithms.
+
+\sa \ref concepts::Heap "Heap concept"
+*/
+
+/**
+ at defgroup matrices Matrices
+ at ingroup datas
+\brief Two dimensional data storages implemented in LEMON.
+
+This group contains two dimensional data storages implemented in LEMON.
 */
 
 /**
@@ -259,6 +280,28 @@
 */
 
 /**
+ at defgroup geomdat Geometric Data Structures
+ at ingroup auxdat
+\brief Geometric data structures implemented in LEMON.
+
+This group contains geometric data structures implemented in LEMON.
+
+ - \ref lemon::dim2::Point "dim2::Point" implements a two dimensional
+   vector with the usual operations.
+ - \ref lemon::dim2::Box "dim2::Box" can be used to determine the
+   rectangular bounding box of a set of \ref lemon::dim2::Point
+   "dim2::Point"'s.
+*/
+
+/**
+ at defgroup matrices Matrices
+ at ingroup auxdat
+\brief Two dimensional data storages implemented in LEMON.
+
+This group contains two dimensional data storages implemented in LEMON.
+*/
+
+/**
 @defgroup algs Algorithms
 \brief This group contains the several algorithms
 implemented in LEMON.
@@ -273,7 +316,8 @@
 \brief Common graph search algorithms.
 
 This group contains the common graph search algorithms, namely
-\e breadth-first \e search (BFS) and \e depth-first \e search (DFS).
+\e breadth-first \e search (BFS) and \e depth-first \e search (DFS)
+\ref clrs01algorithms.
 */
 
 /**
@@ -281,7 +325,8 @@
 @ingroup algs
 \brief Algorithms for finding shortest paths.
 
-This group contains the algorithms for finding shortest paths in digraphs.
+This group contains the algorithms for finding shortest paths in digraphs
+\ref clrs01algorithms.
 
  - \ref Dijkstra algorithm for finding shortest paths from a source node
    when all arc lengths are non-negative.
@@ -298,12 +343,21 @@
 */
 
 /**
+ at defgroup spantree Minimum Spanning Tree Algorithms
+ at ingroup algs
+\brief Algorithms for finding minimum cost spanning trees and arborescences.
+
+This group contains the algorithms for finding minimum cost spanning
+trees and arborescences \ref clrs01algorithms.
+*/
+
+/**
 @defgroup max_flow Maximum Flow Algorithms
 @ingroup algs
 \brief Algorithms for finding maximum flows.
 
 This group contains the algorithms for finding maximum flows and
-feasible circulations.
+feasible circulations \ref clrs01algorithms, \ref amo93networkflows.
 
 The \e maximum \e flow \e problem is to find a flow of maximum value between
 a single source and a single target. Formally, there is a \f$G=(V,A)\f$
@@ -318,12 +372,16 @@
 \f[ 0 \leq f(uv) \leq cap(uv) \quad \forall uv\in A \f]
 
 LEMON contains several algorithms for solving maximum flow problems:
-- \ref EdmondsKarp Edmonds-Karp algorithm.
-- \ref Preflow Goldberg-Tarjan's preflow push-relabel algorithm.
-- \ref DinitzSleatorTarjan Dinitz's blocking flow algorithm with dynamic trees.
-- \ref GoldbergTarjan Preflow push-relabel algorithm with dynamic trees.
+- \ref EdmondsKarp Edmonds-Karp algorithm
+  \ref edmondskarp72theoretical.
+- \ref Preflow Goldberg-Tarjan's preflow push-relabel algorithm
+  \ref goldberg88newapproach.
+- \ref DinitzSleatorTarjan Dinitz's blocking flow algorithm with dynamic trees
+  \ref dinic70algorithm, \ref sleator83dynamic.
+- \ref GoldbergTarjan !Preflow push-relabel algorithm with dynamic trees
+  \ref goldberg88newapproach, \ref sleator83dynamic.
 
-In most cases the \ref Preflow "Preflow" algorithm provides the
+In most cases the \ref Preflow algorithm provides the
 fastest method for computing a maximum flow. All implementations
 also provide functions to query the minimum cut, which is the dual
 problem of maximum flow.
@@ -341,18 +399,22 @@
 \brief Algorithms for finding minimum cost flows and circulations.
 
 This group contains the algorithms for finding minimum cost flows and
-circulations. For more information about this problem and its dual
-solution see \ref min_cost_flow "Minimum Cost Flow Problem".
+circulations \ref amo93networkflows. For more information about this
+problem and its dual solution, see \ref min_cost_flow
+"Minimum Cost Flow Problem".
 
 LEMON contains several algorithms for this problem.
  - \ref NetworkSimplex Primal Network Simplex algorithm with various
-   pivot strategies.
+   pivot strategies \ref dantzig63linearprog, \ref kellyoneill91netsimplex.
  - \ref CostScaling Push-Relabel and Augment-Relabel algorithms based on
-   cost scaling.
+   cost scaling \ref goldberg90approximation, \ref goldberg97efficient,
+   \ref bunnagel98efficient.
  - \ref CapacityScaling Successive Shortest %Path algorithm with optional
-   capacity scaling.
- - \ref CancelAndTighten The Cancel and Tighten algorithm.
- - \ref CycleCanceling Cycle-Canceling algorithms.
+   capacity scaling \ref edmondskarp72theoretical.
+ - \ref CancelAndTighten The Cancel and Tighten algorithm
+   \ref goldberg89cyclecanceling.
+ - \ref CycleCanceling Cycle-Canceling algorithms
+   \ref klein67primal, \ref goldberg89cyclecanceling.
 
 In general NetworkSimplex is the most efficient implementation,
 but in special cases other algorithms could be faster.
@@ -375,7 +437,7 @@
 cut is the \f$X\f$ solution of the next optimization problem:
 
 \f[ \min_{X \subset V, X\not\in \{\emptyset, V\}}
-    \sum_{uv\in A, u\in X, v\not\in X}cap(uv) \f]
+    \sum_{uv\in A: u\in X, v\not\in X}cap(uv) \f]



More information about the Lemon-commits mailing list