# HG changeset patch # User alpar # Date 1077026686 0 # Node ID 25ab81446a07af26704de46115c3ac2a7ff0d127 # Parent a7f9e2fda93ab1ba24c3cfd0e2149cc1fefb2293 It is working... diff -r a7f9e2fda93a -r 25ab81446a07 src/work/alpar/f_ed_ka.h --- a/src/work/alpar/f_ed_ka.h Tue Feb 17 13:26:44 2004 +0000 +++ b/src/work/alpar/f_ed_ka.h Tue Feb 17 14:04:46 2004 +0000 @@ -19,6 +19,7 @@ typename Graph::EachNodeIt s, typename Graph::EachNodeIt t) { + typedef typename Graph::NodeIt NodeIt; typedef typename Graph::EachNodeIt EachNodeIt; typedef typename Graph::EdgeIt EdgeIt; typedef typename Graph::EachEdgeIt EachEdgeIt; @@ -29,10 +30,10 @@ T flow_val = 0; T aug_val; - for(EachEdgeIt e(G);G.valid(e);G.next(e)) + for(EachEdgeIt e(G);G.valid(e);G.goNext(e)) f.set(e,0); - std::queue bfs_queue; + std::queue bfs_queue; typename Graph::NodeMap visited(G); //0: unvisited, //1: reached by a forward edge //2: reached by a backward edge @@ -43,7 +44,7 @@ augment: - for(EachNodeIt n(G);G.valid(n);G.next(n)) + for(EachNodeIt n(G);G.valid(n);G.goNext(n)) visited.set(n,0); visited.set(s,3); @@ -55,20 +56,25 @@ while(!bfs_queue.empty() && !visited.get(t)) { - EachNodeIt n(bfs_queue.front()); - for(OutEdgeIt e(G,n);G.valid(e);G.next(e)) + NodeIt n(bfs_queue.front()); + bfs_queue.pop(); + for(OutEdgeIt e(G,n);G.valid(e);G.goNext(e)) if(f.get(e)0 && //FIXME: > !visited.get(G.bNode(e))) { - tree.set(G.bNode(e),e); - visited.set(G.bNode(e),2); + NodeIt nn(G.bNode(e)); + tree.set(nn,e); + visited.set(nn,2); + bfs_queue.push(nn); } } @@ -81,12 +87,12 @@ gn = visited.get(t)==1 ? G.tail(tree.get(t)) : G.head(tree.get(t)); while(gn!=s) if(visited.get(gn)==1) { - //FIXME: nonstandars. gcc extension! + //FIXME: nonstandard gcc extension! aug_val