src/work/marci/edmonds_karp.h
changeset 317 6e6db1c49bc1
parent 312 54e07057eb47
child 330 7ac0d4e8a31c
     1.1 --- a/src/work/marci/edmonds_karp.h	Thu Apr 08 13:11:58 2004 +0000
     1.2 +++ b/src/work/marci/edmonds_karp.h	Tue Apr 13 20:35:47 2004 +0000
     1.3 @@ -599,13 +599,19 @@
     1.4   	pred.set(s, INVALID);
     1.5    	//invalid iterators for sources
     1.6  
     1.7 -  	typename ErasingResGW::NodeMap<Number> free(erasing_res_graph);
     1.8 +  	typename ErasingResGW::NodeMap<Number> free1(erasing_res_graph);
     1.9  
    1.10 - 	dfs.pushAndSetReached(s);
    1.11 + 	dfs.pushAndSetReached(
    1.12 +	  typename ErasingResGW::Node(
    1.13 +	    typename FilterResGW::Node(
    1.14 +	      typename ResGW::Node(s)
    1.15 +	      )
    1.16 +	    )
    1.17 +	  );
    1.18   	while (!dfs.finished()) {
    1.19   	  ++dfs;
    1.20   	  if (erasing_res_graph.valid(
    1.21 - 		/*typename ErasingResGW::OutEdgeIt*/(dfs))) 
    1.22 + 		typename ErasingResGW::OutEdgeIt(dfs))) 
    1.23   	  { 
    1.24    	    if (dfs.isBNodeNewlyReached()) {
    1.25  	  
    1.26 @@ -614,9 +620,11 @@
    1.27  
    1.28   	      pred.set(w, /*typename ErasingResGW::OutEdgeIt*/(dfs));
    1.29   	      if (erasing_res_graph.valid(pred[v])) {
    1.30 - 		free.set(w, std::min(free[v], res_graph.resCap(dfs)));
    1.31 + 		free1.set(w, std::min(free1[v], res_graph.resCap(
    1.32 +				       typename ErasingResGW::OutEdgeIt(dfs))));
    1.33   	      } else {
    1.34 - 		free.set(w, res_graph.resCap(dfs)); 
    1.35 + 		free1.set(w, res_graph.resCap(
    1.36 +			   typename ErasingResGW::OutEdgeIt(dfs))); 
    1.37   	      }
    1.38  	      
    1.39   	      if (w==t) { 
    1.40 @@ -631,8 +639,17 @@
    1.41  	}	
    1.42  
    1.43    	if (__augment) {
    1.44 -  	  typename ErasingResGW::Node n=t;
    1.45 - 	  Number augment_value=free[n];
    1.46 +   	  typename ErasingResGW::Node n=typename FilterResGW::Node(typename ResGW::Node(t));
    1.47 +// 	  typename ResGW::NodeMap<Number> a(res_graph);
    1.48 +// 	  typename ResGW::Node b;
    1.49 +// 	  Number j=a[b];
    1.50 +// 	  typename FilterResGW::NodeMap<Number> a1(filter_res_graph);
    1.51 +// 	  typename FilterResGW::Node b1;
    1.52 +// 	  Number j1=a1[b1];
    1.53 +// 	  typename ErasingResGW::NodeMap<Number> a2(erasing_res_graph);
    1.54 +// 	  typename ErasingResGW::Node b2;
    1.55 +// 	  Number j2=a2[b2];
    1.56 + 	  Number augment_value=free1[n];
    1.57   	  while (erasing_res_graph.valid(pred[n])) { 
    1.58   	    typename ErasingResGW::OutEdgeIt e=pred[n];
    1.59   	    res_graph.augment(e, augment_value);