[Lemon-commits] [lemon_svn] marci: r1669 - hugo/trunk/src/lemon

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:46:53 CET 2006


Author: marci
Date: Tue Mar 22 17:00:00 2005
New Revision: 1669

Modified:
   hugo/trunk/src/lemon/graph_wrapper.h

Log:
small improvment in documentation


Modified: hugo/trunk/src/lemon/graph_wrapper.h
==============================================================================
--- hugo/trunk/src/lemon/graph_wrapper.h	(original)
+++ hugo/trunk/src/lemon/graph_wrapper.h	Tue Mar 22 17:00:00 2005
@@ -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)<c(uv)\}\f$ and 
+  \f$A_{backward}=\{vu : 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<int> f(g);
+  Graph::EdgeMap<int> c(g);
+  ResGraphWrapper<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > gw(g);
+  \endcode
+  \author Marton Makai
+  */
   template<typename Graph, typename Number, 
 	   typename CapacityMap, typename FlowMap>
   class ResGraphWrapper : 



More information about the Lemon-commits mailing list