# Changeset 83:3654324ec035 in lemon-1.2 for doc/groups.dox

Ignore:
Timestamp:
03/15/08 23:42:33 (15 years ago)
Branch:
default
Phase:
public
Message:

Improvements in groups.dox

• Apply the graph renamings.
• Apply the current map renamings.
File:
1 edited

Unmodified
Removed
• ## doc/groups.dox

 r71 the diverging requirements of the possible users.  In order to save on running time or on memory usage, some structures may fail to provide some graph features like edge or node deletion. some graph features like arc/edge or node deletion. Alteration of standard containers need a very limited number of In the case of graph structures, different operations are needed which do not alter the physical graph, but gives another view. If some nodes or edges have to be hidden or the reverse oriented graph have to be used, then arcs have to be hidden or the reverse oriented graph have to be used, then this is the case. It also may happen that in a flow implementation the residual graph can be accessed by another algorithm, or a node-set @defgroup graph_maps Graph Maps @ingroup maps \brief Special Graph-Related Maps. \brief Special graph-related maps. This group describes maps that are specifically designed to assign values to the nodes and edges of graphs. values to the nodes and arcs of graphs. */ maps from other maps. Most of them are \ref lemon::concepts::ReadMap "ReadMap"s. They can make arithmetic operations between one or two maps (negation, scaling, addition, multiplication etc.) or e.g. convert a map to another one of different Value type. Most of them are \ref lemon::concepts::ReadMap "read-only maps". They can make arithmetic and logical operations between one or two maps (negation, shifting, addition, multiplication, logical 'and', 'or', 'not' etc.) or e.g. convert a map to another one of different Value type. The typical usage of this classes is passing implicit maps to algorithms.  If a function type algorithm is called then the function type map adaptors can be used comfortable. For example let's see the usage of map adaptors with the \c graphToEps() function: usage of map adaptors with the \c digraphToEps() function. \code Color nodeColor(int deg) { } Graph::NodeMap degree_map(graph); Digraph::NodeMap degree_map(graph); graphToEps(graph, "graph.eps") digraphToEps(graph, "graph.eps") .coords(coords).scaleToA4().undirected() .nodeColors(composeMap(functorMap(nodeColor), degree_map)) .nodeColors(composeMap(functorToMap(nodeColor), degree_map)) .run(); \endcode The \c functorMap() function makes an \c int to \c Color map from the The \c functorToMap() function makes an \c int to \c Color map from the \e nodeColor() function. The \c composeMap() compose the \e degree_map and the previous created map. The composed map is proper function to get color of each node. and the previously created map. The composed map is a proper function to get the color of each node. The usage with class type algorithms is little bit harder. In this function map adaptors give back temporary objects. \code Graph graph; typedef Graph::EdgeMap DoubleEdgeMap; DoubleEdgeMap length(graph); DoubleEdgeMap speed(graph); typedef DivMap TimeMap; Digraph graph; typedef Digraph::ArcMap DoubleArcMap; DoubleArcMap length(graph); DoubleArcMap speed(graph); typedef DivMap TimeMap; TimeMap time(length, speed); Dijkstra dijkstra(graph, time); Dijkstra dijkstra(graph, time); dijkstra.run(source, target); \endcode We have a length map and a maximum speed map on a graph. The minimum time to pass the edge can be calculated as the division of the two maps which can be done implicitly with the \c DivMap template We have a length map and a maximum speed map on the arcs of a digraph. The minimum time to pass the arc can be calculated as the division of the two maps which can be done implicitly with the \c DivMap template class. We use the implicit minimum time map as the length map of the \c Dijkstra algorithm. This group contains algorithm objects and functions to calculate matchings in graphs and bipartite graphs. The general matching problem is finding a subset of the edges which does not shares common endpoints. finding a subset of the arcs which does not shares common endpoints. There are several different algorithms for calculate matchings in
Note: See TracChangeset for help on using the changeset viewer.