Index: src/work/jacint/preflow_push_hl.h
===================================================================
--- src/work/jacint/preflow_push_hl.h	(revision 78)
+++ src/work/jacint/preflow_push_hl.h	(revision 83)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
 /*
-preflow_push_hl.hh
+preflow_push_hl.h
 by jacint. 
 Runs the highest label variant of the preflow push algorithm with 
@@ -14,9 +14,9 @@
 T maxflow() : returns the value of a maximum flow
 
-T flowonEdge(Edge_iterator e) : for a fixed maximum flow x it returns x(e) 
-
-EdgeMap<graph_type, T> allflow() : returns the fixed maximum flow x
-
-NodeMap<graph_type, bool> mincut() : returns a 
+T flowonedge(EdgeIt e) : for a fixed maximum flow x it returns x(e) 
+
+Graph::EdgeMap<T> allflow() : returns the fixed maximum flow x
+
+Graph::NodeMap<bool> mincut() : returns a 
      characteristic vector of a minimum cut. (An empty level 
      in the algorithm gives a minimum cut.)
@@ -30,4 +30,5 @@
 #include <stack>
 
+#include <list_graph.hh>
 #include <reverse_bfs.h>
 
@@ -42,7 +43,5 @@
     typedef typename Graph::OutEdgeIt OutEdgeIt;
     typedef typename Graph::InEdgeIt InEdgeIt;
-    typedef typename Graph::EachEdgeIt EachEdgeIt;
-    
-
+    
     Graph& G;
     NodeIt s;
@@ -53,12 +52,10 @@
     typename Graph::NodeMap<bool> mincutvector;
 
-   
   public:
 
     preflow_push_hl(Graph& _G, NodeIt _s, NodeIt _t, 
 		    typename Graph::EdgeMap<T>& _capacity) :
-      G(_G), s(_s), t(_t), flow(_G, 0), capacity(_capacity), mincutvector(_G, true) { }
-
-
+      G(_G), s(_s), t(_t), flow(_G, 0), capacity(_capacity), 
+      mincutvector(_G, true) { }
 
 
@@ -69,40 +66,42 @@
     void run() {
  
-      typename Graph::NodeMap<int> level(G);         //level of Node
-      typename Graph::NodeMap<T> excess(G);          //excess of Node
+      int i=0;//DELME
+
+      typename Graph::NodeMap<int> level(G);      
+      typename Graph::NodeMap<T> excess(G);      
             
-      int n=G.nodeNum();                        //number of Nodes 
-      int b=n; 
-      /*b is a bound on the highest level of an active Node. In the beginning it is at most n-2.*/
-
-      std::vector<std::stack<NodeIt> > stack(2*n-1);    //Stack of the active Nodes in level i.
-
-
+      int n=G.nodeNum();    
+      int b=n-2; 
+      /*
+	b is a bound on the highest level of an active node. 
+	In the beginning it is at most n-2.
+      */
+
+      std::vector<std::stack<NodeIt> > stack(2*n-1);    
+      //Stack of the active nodes in level i.
 
 
       /*Reverse_bfs from t, to find the starting level.*/
-
       reverse_bfs<Graph> bfs(G, t);
       bfs.run();
-      for(EachNodeIt v=G.template first<EachNodeIt>(); v.valid(); ++v) {
-	level.set(v, bfs.dist(v)); 
-	//std::cout << "the level of " << v << " is " << bfs.dist(v);
-      }
-
-      /*The level of s is fixed to n*/ 
+      for(EachNodeIt v=G.template first<EachNodeIt>(); v.valid(); ++v) 
+	{
+	  level.set(v, bfs.dist(v)); 
+	}
+
+      std::cout << "the level of t is " << bfs.dist(t);//delme
+
       level.set(s,n);
 
 
-
-
-
-      /* Starting flow. It is everywhere 0 at the moment. */
-     
-      for(OutEdgeIt i=G.template first<OutEdgeIt>(s); i.valid(); ++i) 
+      /* Starting flow. It is everywhere 0 at the moment. */     
+      for(OutEdgeIt e=G.template first<OutEdgeIt>(s); e.valid(); ++e) 
 	{
-	  NodeIt w=G.head(i);
-	  flow.set(i, capacity.get(i)); 
-	  stack[bfs.dist(w)].push(w); 
-	  excess.set(w, capacity.get(i));
+	  if ( capacity.get(e) > 0 ) {
+	    NodeIt w=G.head(e);
+	    flow.set(e, capacity.get(e)); 
+	    stack[level.get(w)].push(w); 
+	    excess.set(w, excess.get(w)+capacity.get(e));
+	  }
 	}
 
@@ -146,4 +145,6 @@
 		  if (excess.get(v)==0 && v != s) stack[level.get(v)].push(v); 
 		  /*v becomes active.*/
+
+		  //std::cout<<++i;
 		  
 		  flow.set(e, flow.get(e)+excess.get(w));
@@ -164,4 +165,6 @@
 		  if (excess.get(w)==0) break;
 		  /*If w is not active any more, then we go on to the next Node.*/
+		  
+		  //std::cout<<++i;
 		  
 		} // if (capacity.get(e)-flow.get(e) > excess.get(w))
Index: src/work/jacint/preflow_push_max_flow.h
===================================================================
--- src/work/jacint/preflow_push_max_flow.h	(revision 78)
+++ src/work/jacint/preflow_push_max_flow.h	(revision 83)
@@ -3,6 +3,6 @@
 by jacint. 
 Runs a preflow push algorithm with the modification, 
-that we do not push on Nodes with level at least n. 
-Moreover, if a level gets empty, we.set all Nodes above that
+that we do not push on nodes with level at least n. 
+Moreover, if a level gets empty, we set all nodes above that
 level to level n. Hence, in the end, we arrive at a maximum preflow 
 with value of a max flow value. An empty level gives a minimum cut.
@@ -16,5 +16,5 @@
 T maxflow() : returns the value of a maximum flow
 
-NodeMap<Graph, bool> mincut(): returns a 
+NodeMap<bool> mincut(): returns a 
      characteristic vector of a minimum cut.
 */
@@ -52,29 +52,32 @@
   public:
         
-    preflow_push_max_flow(Graph& _G, NodeIt _s, NodeIt _t, typename Graph::EdgeMap<T>& _capacity) : G(_G), s(_s), t(_t), capacity(_capacity), mincutvector(_G, false) { }
+    preflow_push_max_flow ( Graph& _G, NodeIt _s, NodeIt _t, 
+			    typename Graph::EdgeMap<T>& _capacity) : 
+      G(_G), s(_s), t(_t), capacity(_capacity), mincutvector(_G, false) { }
 
 
     /*
-      The run() function runs a modified version of the highest label preflow-push, which only 
+      The run() function runs a modified version of the 
+      highest label preflow-push, which only 
       finds a maximum preflow, hence giving the value of a maximum flow.
     */
     void run() {
  
-      typename Graph::EdgeMap<T> flow(G, 0);         //the flow value, 0 everywhere  
-      typename Graph::NodeMap<int> level(G);         //level of Node
-      typename Graph::NodeMap<T> excess(G);          //excess of Node
+      typename Graph::EdgeMap<T> flow(G, 0); 
+      typename Graph::NodeMap<int> level(G);   
+      typename Graph::NodeMap<T> excess(G);    
             
-      int n=G.nodeNum();                        //number of Nodes 
+      int n=G.nodeNum();                       
       int b=n-2; 
-      /*b is a bound on the highest level of an active Node. In the beginning it is at most n-2.*/
-      
-      std::vector<int> numb(n);                                //The number of Nodes on level i < n.
-
-      std::vector<std::stack<NodeIt> > stack(2*n-1);    //Stack of the active Nodes in level i.
-
-
+      /*
+	b is a bound on the highest level of an active Node. 
+	In the beginning it is at most n-2.
+      */
+      
+      std::vector<int> numb(n);     //The number of Nodes on level i < n.
+      std::vector<std::stack<NodeIt> > stack(2*n-1);    
+      //Stack of the active Nodes in level i.
 
       /*Reverse_bfs from t, to find the starting level.*/
-
       reverse_bfs<Graph> bfs(G, t);
       bfs.run();
@@ -86,23 +89,20 @@
 	}
 
-      /*The level of s is fixed to n*/ 
       level.set(s,n);
 
-
       /* Starting flow. It is everywhere 0 at the moment. */
-     
-      for(OutEdgeIt i=G.template first<OutEdgeIt>(s); i.valid(); ++i) 
+      for(OutEdgeIt e=G.template first<OutEdgeIt>(s); e.valid(); ++e) 
 	{
-	  NodeIt w=G.head(i);
-	  flow.set(i, capacity.get(i)); 
-	  stack[bfs.dist(w)].push(w); 
-	  excess.set(w, capacity.get(i));
+	  if ( capacity.get(e) > 0 ) {
+	    NodeIt w=G.head(e);
+	    flow.set(e, capacity.get(e)); 
+	    stack[level.get(w)].push(w); 
+	    excess.set(w, excess.get(w)+capacity.get(e));
+	  }
 	}
-
 
       /* 
 	 End of preprocessing 
       */
-
 
 
@@ -115,5 +115,5 @@
       while (b) { 
 
-	/*We decrease the bound if there is no active Node of level b.*/
+	/*We decrease the bound if there is no active node of level b.*/
 	if (stack[b].empty()) {
 	  --b;
