Changeset 93:25ab81446a07 in lemon-0.x for src
- Timestamp:
- 02/17/04 15:04:46 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@120
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/alpar/f_ed_ka.h
r91 r93 20 20 typename Graph::EachNodeIt t) 21 21 { 22 typedef typename Graph::NodeIt NodeIt; 22 23 typedef typename Graph::EachNodeIt EachNodeIt; 23 24 typedef typename Graph::EdgeIt EdgeIt; … … 30 31 T aug_val; 31 32 32 for(EachEdgeIt e(G);G.valid(e);G. next(e))33 for(EachEdgeIt e(G);G.valid(e);G.goNext(e)) 33 34 f.set(e,0); 34 35 35 std::queue< EachNodeIt> bfs_queue;36 std::queue<NodeIt> bfs_queue; 36 37 typename Graph::NodeMap<int> visited(G); //0: unvisited, 37 38 //1: reached by a forward edge … … 44 45 augment: 45 46 46 for(EachNodeIt n(G);G.valid(n);G. next(n))47 for(EachNodeIt n(G);G.valid(n);G.goNext(n)) 47 48 visited.set(n,0); 48 49 … … 56 57 while(!bfs_queue.empty() && !visited.get(t)) 57 58 { 58 EachNodeIt n(bfs_queue.front()); 59 for(OutEdgeIt e(G,n);G.valid(e);G.next(e)) 59 NodeIt n(bfs_queue.front()); 60 bfs_queue.pop(); 61 for(OutEdgeIt e(G,n);G.valid(e);G.goNext(e)) 60 62 if(f.get(e)<c.get(e) && //FIXME: < 61 63 !visited.get(G.bNode(e))) 62 64 { 63 tree.set(G.bNode(e),e); 64 visited.set(G.bNode(e),1); 65 NodeIt nn(G.bNode(e)); //It improves nothing 66 tree.set(nn,e); 67 visited.set(nn,1); 68 bfs_queue.push(nn); 65 69 } 66 for(InEdgeIt e(G,n);G.valid(e);G. next(e))70 for(InEdgeIt e(G,n);G.valid(e);G.goNext(e)) 67 71 if(f.get(e)>0 && //FIXME: > 68 72 !visited.get(G.bNode(e))) 69 73 { 70 tree.set(G.bNode(e),e); 71 visited.set(G.bNode(e),2); 74 NodeIt nn(G.bNode(e)); 75 tree.set(nn,e); 76 visited.set(nn,2); 77 bfs_queue.push(nn); 72 78 } 73 79 } … … 82 88 while(gn!=s) if(visited.get(gn)==1) 83 89 { 84 //FIXME: nonstandar s.gcc extension!90 //FIXME: nonstandard gcc extension! 85 91 aug_val <?= c.get(tree.get(gn))-f.get(tree.get(gn)); 86 92 gn=G.tail(tree.get(gn)); 87 93 } 88 94 else { 89 //FIXME: nonstandar s.gcc extension!95 //FIXME: nonstandard gcc extension! 90 96 aug_val <?= f.get(tree.get(gn)); 91 97 gn=G.head(tree.get(gn));
Note: See TracChangeset
for help on using the changeset viewer.