diff -r f1de2ab64e1c -r d2ac583ed195 src/work/jacint/preflow_hl2.h --- a/src/work/jacint/preflow_hl2.h Wed Feb 18 17:27:13 2004 +0000 +++ b/src/work/jacint/preflow_hl2.h Wed Feb 18 21:50:45 2004 +0000 @@ -80,7 +80,7 @@ IntMap level(G,n); TMap excess(G); - std::vector numb(n+1); + std::vector numb(n); /* The number of nodes on level i < n. It is initialized to n+1, because of the reverse_bfs-part. @@ -118,13 +118,14 @@ /* Starting flow. It is everywhere 0 at the moment. */ for(OutEdgeIt e=G.template first(s); e.valid(); ++e) { - if ( capacity.get(e) == 0 ) continue; + T c=capacity.get(e); + if ( c == 0 ) continue; NodeIt w=G.head(e); if ( w!=s ) { if ( excess.get(w) == 0 && w!=t ) stack[level.get(w)].push(w); - flow.set(e, capacity.get(e)); - excess.set(w, excess.get(w)+capacity.get(e)); - } + flow.set(e, c); + excess.set(w, excess.get(w)+c); + } } /* @@ -155,7 +156,7 @@ stack[b].pop(); int lev=level.get(w); int exc=excess.get(w); - int newlevel=2*n-2; //In newlevel we bound the next level of w. + int newlevel=2*n; //In newlevel we bound the next level of w. // if ( level.get(w) < n ) { //Nem tudom ez mukodik-e for(OutEdgeIt e=G.template first(w); e.valid(); ++e) {