# HG changeset patch # User marci # Date 1111507200 0 # Node ID e48c4fe47aaf5eb4eadf52762ea26bf1469d8797 # Parent dadc9987c5374325b20a80b60ebcf05cf9e800c0 small improvment in documentation diff -r dadc9987c537 -r e48c4fe47aaf src/lemon/graph_wrapper.h --- a/src/lemon/graph_wrapper.h Tue Mar 22 12:02:29 2005 +0000 +++ b/src/lemon/graph_wrapper.h Tue Mar 22 16:00:00 2005 +0000 @@ -41,10 +41,10 @@ /*! Base type for the Graph Wrappers - + \warning Graph wrappers are in even more experimental state than the other parts of the lib. Use them at you own risk. - + This is the base type for most of LEMON graph wrappers. This class implements a trivial graph wrapper i.e. it only wraps the functions and types of the graph. The purpose of this class is to @@ -314,20 +314,30 @@ }; /*! \brief A graph wrapper for hiding nodes and edges from a graph. - + \warning Graph wrappers are in even more experimental state than the other parts of the lib. Use them at you own risk. - This wrapper shows a graph with filtered node-set and + SubGraphWrapper shows the graph with filtered node-set and edge-set. - Given a bool-valued map on the node-set and one on - the edge-set of the graph, the iterators show only the objects - having true value. We have to note that this does not mean that an + Let \f$G=(V, A)\f$ be a directed graph + and suppose that the graph instance \c g of type ListGraph implements + \f$G\f$. + Let moreover \f$b_V\f$ and + \f$b_A\f$ be bool-valued functions resp. on the node-set and edge-set. + SubGraphWrapper<...>::NodeIt iterates + on the node-set \f$\{v\in V : b_V(v)=true\}\f$ and + SubGraphWrapper<...>::EdgeIt iterates + on the edge-set \f$\{e\in A : b_A(e)=true\}\f$. Similarly, + SubGraphWrapper<...>::OutEdgeIt and SubGraphWrapper<...>::InEdgeIt iterates + only on edges leaving and entering a specific node which have true value. + + We have to note that this does not mean that an induced subgraph is obtained, the node-iterator cares only the filter on the node-set, and the edge-iterators care only the filter on the - edge-set. + edge-set. \code - typedef SmartGraph Graph; + typedef ListGraph Graph; Graph g; typedef Graph::Node Node; typedef Graph::Edge Edge; @@ -1019,12 +1029,38 @@ }; - /// A wrapper for composing the residual graph for directed flow and circulation problems. + /*! \brief A wrapper for composing the residual graph for directed flow and circulation problems. - ///\warning Graph wrappers are in even more experimental state than the other - ///parts of the lib. Use them at you own risk. - /// - /// A wrapper for composing the residual graph for directed flow and circulation problems. + A wrapper for composing the residual graph for directed flow and circulation problems. + Let \f$G=(V, A)\f$ be a directed graph and let \f$F\f$ be a + number type. Let moreover + \f$f,c:A\to F\f$, be functions on the edge-set. + In the appications of ResGraphWrapper, \f$f\f$ usually stands for a flow + and \f$c\f$ for a capacity function. + Suppose that a graph instange \c g of type + \c ListGraph implements \f$G\f$. + \code + ListGraph g; + \endcode + Then RevGraphWrapper implements the graph structure with node-set + \f$V\f$ and edge-set \f$A_{forward}\cup A_{backward}\f$, where + \f$A_{forward}=\{uv : uv\in A, f(uv)0\}\f$, + i.e. the so called residual graph. + When we take the union \f$A_{forward}\cup A_{backward}\f$, + multilicities are counted, i.e. if an edge is in both + \f$A_{forward}\f$ and \f$A_{backward}\f$, then in the wrapper it + appears twice. + The following code shows how + such an instance can be constructed. + \code + typedef ListGraph Graph; + Graph::EdgeMap f(g); + Graph::EdgeMap c(g); + ResGraphWrapper, Graph::EdgeMap > gw(g); + \endcode + \author Marton Makai + */ template class ResGraphWrapper :