Ignore:
Timestamp:
12/02/08 16:33:22 (16 years ago)
Branch:
default
Children:
Parents:
429:d8b87e9b90c3 (diff), 433:6ff53afe98b5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Message:

Merge

Files:
6 edited

Unmodified
Removed
• ## doc/groups.dox

 r422 See also: \ref graph_concepts "Graph Structure Concepts". */ /** @defgroup graph_adaptors Adaptor Classes for graphs @ingroup graphs \brief This group contains several adaptor classes for digraphs and graphs The main parts of LEMON are the different graph structures, generic graph algorithms, graph concepts which couple these, and graph adaptors. While the previous notions are more or less clear, the latter one needs further explanation. Graph adaptors are graph classes which serve for considering graph structures in different ways. A short example makes this much clearer.  Suppose that we have an instance \c g of a directed graph type say ListDigraph and an algorithm \code template int algorithm(const Digraph&); \endcode is needed to run on the reverse oriented graph.  It may be expensive (in time or in memory usage) to copy \c g with the reversed arcs.  In this case, an adaptor class is used, which (according to LEMON digraph concepts) works as a digraph.  The adaptor uses the original digraph structure and digraph operations when methods of the reversed oriented graph are called.  This means that the adaptor have minor memory usage, and do not perform sophisticated algorithmic actions.  The purpose of it is to give a tool for the cases when a graph have to be used in a specific alteration.  If this alteration is obtained by a usual construction like filtering the arc-set or considering a new orientation, then an adaptor is worthwhile to use. To come back to the reverse oriented graph, in this situation \code template class ReverseDigraph; \endcode template class can be used. The code looks as follows \code ListDigraph g; ReverseDigraph rg(g); int result = algorithm(rg); \endcode After running the algorithm, the original graph \c g is untouched. This techniques gives rise to an elegant code, and based on stable graph adaptors, complex algorithms can be implemented easily. In flow, circulation and bipartite matching problems, the residual graph is of particular importance. Combining an adaptor implementing this, shortest path algorithms and minimum mean cycle algorithms, a range of weighted and cardinality optimization algorithms can be obtained. For other examples, the interested user is referred to the detailed documentation of particular adaptors. The behavior of graph adaptors can be very different. Some of them keep capabilities of the original graph while in other cases this would be meaningless. This means that the concepts that they are models of depend on the graph adaptor, and the wrapped graph(s). If an arc of \c rg is deleted, this is carried out by deleting the corresponding arc of \c g, thus the adaptor modifies the original graph. But for a residual graph, this operation has no sense. Let us stand one more example here to simplify your work. RevGraphAdaptor has constructor \code ReverseDigraph(Digraph& digraph); \endcode This means that in a situation, when a const ListDigraph& reference to a graph is given, then it have to be instantiated with Digraph=const ListDigraph. \code int algorithm1(const ListDigraph& g) { RevGraphAdaptor rg(g); return algorithm2(rg); } \endcode */
• ## doc/groups.dox

 r432 * */ namespace lemon { /** This group describes maps that are specifically designed to assign values to the nodes and arcs of graphs. values to the nodes and arcs/edges of graphs. If you are looking for the standard graph maps (\c NodeMap, \c ArcMap, \c EdgeMap), see the \ref graph_concepts "Graph Structure Concepts". */ maps from other maps. Most of them are \ref lemon::concepts::ReadMap "read-only maps". Most of them are \ref concepts::ReadMap "read-only maps". They can make arithmetic and logical operations between one or two maps (negation, shifting, addition, multiplication, logical 'and', 'or', \brief Common graph search algorithms. This group describes the common graph search algorithms like Breadth-First Search (BFS) and Depth-First Search (DFS). This group describes the common graph search algorithms, namely \e breadth-first \e search (BFS) and \e depth-first \e search (DFS). */ \brief Algorithms for finding shortest paths. This group describes the algorithms for finding shortest paths in graphs. This group describes the algorithms for finding shortest paths in digraphs. - \ref Dijkstra algorithm for finding shortest paths from a source node when all arc lengths are non-negative. - \ref BellmanFord "Bellman-Ford" algorithm for finding shortest paths from a source node when arc lenghts can be either positive or negative, but the digraph should not contain directed cycles with negative total length. - \ref FloydWarshall "Floyd-Warshall" and \ref Johnson "Johnson" algorithms for solving the \e all-pairs \e shortest \e paths \e problem when arc lenghts can be either positive or negative, but the digraph should not contain directed cycles with negative total length. - \ref Suurballe A successive shortest path algorithm for finding arc-disjoint paths between two nodes having minimum total length. */ feasible circulations. The maximum flow problem is to find a flow between a single source and a single target that is maximum. Formally, there is a \f$G=(V,A)\f$ directed graph, an \f$c_a:A\rightarrow\mathbf{R}^+_0\f$ capacity function and given \f$s, t \in V\f$ source and target node. The maximum flow is the \f$f_a\f$ solution of the next optimization problem: \f[ 0 \le f_a \le c_a \f] \f[ \sum_{v\in\delta^{-}(u)}f_{vu}=\sum_{v\in\delta^{+}(u)}f_{uv} \qquad \forall u \in V \setminus \{s,t\}\f] \f[ \max \sum_{v\in\delta^{+}(s)}f_{uv} - \sum_{v\in\delta^{-}(s)}f_{vu}\f] 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$ digraph, a \f$cap:A\rightarrow\mathbf{R}^+_0\f$ capacity function and \f$s, t \in V\f$ source and target nodes. A maximum flow is an \f$f:A\rightarrow\mathbf{R}^+_0\f$ solution of the following optimization problem. \f[ \max\sum_{a\in\delta_{out}(s)}f(a) - \sum_{a\in\delta_{in}(s)}f(a) \f] \f[ \sum_{a\in\delta_{out}(v)} f(a) = \sum_{a\in\delta_{in}(v)} f(a) \qquad \forall v\in V\setminus\{s,t\} \f] \f[ 0 \leq f(a) \leq cap(a) \qquad \forall a\in A \f] LEMON contains several algorithms for solving maximum flow problems: - \ref lemon::EdmondsKarp "Edmonds-Karp" - \ref lemon::Preflow "Goldberg's Preflow algorithm" - \ref lemon::DinitzSleatorTarjan "Dinitz's blocking flow algorithm with dynamic trees" - \ref lemon::GoldbergTarjan "Preflow algorithm with dynamic trees" In most cases the \ref lemon::Preflow "Preflow" algorithm provides the fastest method to compute the maximum flow. All impelementations provides functions to query the minimum cut, which is the dual linear programming problem of the maximum flow. - \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. In most cases the \ref Preflow "Preflow" algorithm provides the fastest method for computing a maximum flow. All implementations provides functions to also query the minimum cut, which is the dual problem of the maximum flow. */ This group describes the algorithms for finding minimum cost flows and circulations. The \e minimum \e cost \e flow \e problem is to find a feasible flow of minimum total cost from a set of supply nodes to a set of demand nodes in a network with capacity constraints and arc costs. Formally, let \f$G=(V,A)\f$ be a digraph, \f$lower, upper: A\rightarrow\mathbf{Z}^+_0\f$ denote the lower and upper bounds for the flow values on the arcs, \f$cost: A\rightarrow\mathbf{Z}^+_0\f$ denotes the cost per unit flow on the arcs, and \f$supply: V\rightarrow\mathbf{Z}\f$ denotes the supply/demand values of the nodes. A minimum cost flow is an \f$f:A\rightarrow\mathbf{R}^+_0\f$ solution of the following optimization problem. \f[ \min\sum_{a\in A} f(a) cost(a) \f] \f[ \sum_{a\in\delta_{out}(v)} f(a) - \sum_{a\in\delta_{in}(v)} f(a) = supply(v) \qquad \forall v\in V \f] \f[ lower(a) \leq f(a) \leq upper(a) \qquad \forall a\in A \f] LEMON contains several algorithms for solving minimum cost flow problems: - \ref CycleCanceling Cycle-canceling algorithms. - \ref CapacityScaling Successive shortest path algorithm with optional capacity scaling. - \ref CostScaling Push-relabel and augment-relabel algorithms based on cost scaling. - \ref NetworkSimplex Primal network simplex algorithm with various pivot strategies. */ This group describes the algorithms for finding minimum cut in graphs. The minimum cut problem is to find a non-empty and non-complete \f$X\f$ subset of the vertices with minimum overall capacity on outgoing arcs. Formally, there is \f$G=(V,A)\f$ directed graph, an \f$c_a:A\rightarrow\mathbf{R}^+_0\f$ capacity function. The minimum The \e minimum \e cut \e problem is to find a non-empty and non-complete \f$X\f$ subset of the nodes with minimum overall capacity on outgoing arcs. Formally, there is a \f$G=(V,A)\f$ digraph, a \f$cap: A\rightarrow\mathbf{R}^+_0\f$ capacity function. The minimum 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}c_{uv}\f] \sum_{uv\in A, u\in X, v\not\in X}cap(uv) \f] LEMON contains several algorithms related to minimum cut problems: - \ref lemon::HaoOrlin "Hao-Orlin algorithm" to calculate minimum cut in directed graphs - \ref lemon::NagamochiIbaraki "Nagamochi-Ibaraki algorithm" to calculate minimum cut in undirected graphs - \ref lemon::GomoryHuTree "Gomory-Hu tree computation" to calculate all pairs minimum cut in undirected graphs - \ref HaoOrlin "Hao-Orlin algorithm" for calculating minimum cut in directed graphs. - \ref NagamochiIbaraki "Nagamochi-Ibaraki algorithm" for calculating minimum cut in undirected graphs. - \ref GomoryHuTree "Gomory-Hu tree computation" for calculating all-pairs minimum cut in undirected graphs. If you want to find minimum cut just between two distinict nodes, please see the \ref max_flow "Maximum Flow page". see the \ref max_flow "maximum flow problem". */ graphs.  The matching problems in bipartite graphs are generally easier than in general graphs. The goal of the matching optimization can be the finding maximum cardinality, maximum weight or minimum cost can be finding maximum cardinality, maximum weight or minimum cost matching. The search can be constrained to find perfect or maximum cardinality matching. LEMON contains the next algorithms: - \ref lemon::MaxBipartiteMatching "MaxBipartiteMatching" Hopcroft-Karp augmenting path algorithm for calculate maximum cardinality matching in bipartite graphs - \ref lemon::PrBipartiteMatching "PrBipartiteMatching" Push-Relabel algorithm for calculate maximum cardinality matching in bipartite graphs - \ref lemon::MaxWeightedBipartiteMatching "MaxWeightedBipartiteMatching" Successive shortest path algorithm for calculate maximum weighted matching and maximum weighted bipartite matching in bipartite graph - \ref lemon::MinCostMaxBipartiteMatching "MinCostMaxBipartiteMatching" Successive shortest path algorithm for calculate minimum cost maximum matching in bipartite graph - \ref lemon::MaxMatching "MaxMatching" Edmond's blossom shrinking algorithm for calculate maximum cardinality matching in general graph - \ref lemon::MaxWeightedMatching "MaxWeightedMatching" Edmond's blossom shrinking algorithm for calculate maximum weighted matching in general graph - \ref lemon::MaxWeightedPerfectMatching "MaxWeightedPerfectMatching" Edmond's blossom shrinking algorithm for calculate maximum weighted perfect matching in general graph The matching algorithms implemented in LEMON: - \ref MaxBipartiteMatching Hopcroft-Karp augmenting path algorithm for calculating maximum cardinality matching in bipartite graphs. - \ref PrBipartiteMatching Push-relabel algorithm for calculating maximum cardinality matching in bipartite graphs. - \ref MaxWeightedBipartiteMatching Successive shortest path algorithm for calculating maximum weighted matching and maximum weighted bipartite matching in bipartite graphs. - \ref MinCostMaxBipartiteMatching Successive shortest path algorithm for calculating minimum cost maximum matching in bipartite graphs. - \ref MaxMatching Edmond's blossom shrinking algorithm for calculating maximum cardinality matching in general graphs. - \ref MaxWeightedMatching Edmond's blossom shrinking algorithm for calculating maximum weighted matching in general graphs. - \ref MaxWeightedPerfectMatching Edmond's blossom shrinking algorithm for calculating maximum weighted perfect matching in general graphs. \image html bipartite_matching.png This group describes the algorithms for finding a minimum cost spanning tree in a graph tree in a graph. */ \anchor demoprograms @defgroup demos Demo programs @defgroup demos Demo Programs Some demo programs are listed here. Their full source codes can be found in /** @defgroup tools Standalone utility applications @defgroup tools Standalone Utility Applications Some utility applications are listed here. */ }
• ## lemon/Makefile.am

 r425 lemon_HEADERS += \ lemon/adaptors.h \ lemon/arg_parser.h \ lemon/assert.h \ lemon/bits/default_map.h \ lemon/bits/enable_if.h \ lemon/bits/graph_adaptor_extender.h \ lemon/bits/graph_extender.h \ lemon/bits/map_extender.h \ lemon/bits/path_dump.h \ lemon/bits/traits.h \ lemon/bits/variant.h \ lemon/bits/vector_map.h
• ## lemon/Makefile.am

 r432 lemon/bfs.h \ lemon/bin_heap.h \ lemon/circulation.h \ lemon/color.h \ lemon/concept_check.h \ lemon/hypercube_graph.h \ lemon/kruskal.h \ lemon/hao_orlin.h \ lemon/lgf_reader.h \ lemon/lgf_writer.h \
• ## test/Makefile.am

 r426 test/dim_test \ test/error_test \ test/graph_adaptor_test \ test/graph_copy_test \ test/graph_test \ test_dim_test_SOURCES = test/dim_test.cc test_error_test_SOURCES = test/error_test.cc test_graph_adaptor_test_SOURCES = test/graph_adaptor_test.cc test_graph_copy_test_SOURCES = test/graph_copy_test.cc test_graph_test_SOURCES = test/graph_test.cc
• ## test/Makefile.am

 r430 check_PROGRAMS += \ test/bfs_test \ test/circulation_test \ test/counter_test \ test/dfs_test \ test/heap_test \ test/kruskal_test \ test/hao_orlin_test \ test/maps_test \ test/max_matching_test \ test_bfs_test_SOURCES = test/bfs_test.cc test_circulation_test_SOURCES = test/circulation_test.cc test_counter_test_SOURCES = test/counter_test.cc test_dfs_test_SOURCES = test/dfs_test.cc test_heap_test_SOURCES = test/heap_test.cc test_kruskal_test_SOURCES = test/kruskal_test.cc test_hao_orlin_test_SOURCES = test/hao_orlin_test.cc test_maps_test_SOURCES = test/maps_test.cc test_max_matching_test_SOURCES = test/max_matching_test.cc
Note: See TracChangeset for help on using the changeset viewer.