Changeset 91:81bf58164f60 in lemon-0.x for src/work
- Timestamp:
- 02/17/04 13:27:49 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@118
- Location:
- src/work/alpar
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/alpar/f_ed_ka.h
r80 r91 17 17 FlowMap &f, 18 18 CapacityMap &c, 19 typename Graph:: NodeIt s,20 typename Graph:: NodeIt t)19 typename Graph::EachNodeIt s, 20 typename Graph::EachNodeIt t) 21 21 { 22 typedef typename Graph:: NodeItNodeIt;22 typedef typename Graph::EachNodeIt EachNodeIt; 23 23 typedef typename Graph::EdgeIt EdgeIt; 24 24 typedef typename Graph::EachEdgeIt EachEdgeIt; … … 33 33 f.set(e,0); 34 34 35 std::queue< NodeIt> bfs_queue;35 std::queue<EachNodeIt> bfs_queue; 36 36 typename Graph::NodeMap<int> visited(G); //0: unvisited, 37 37 //1: reached by a forward edge … … 40 40 typename Graph::NodeMap<EdgeIt> tree(G); 41 41 42 NodeIt gn; //FIXME: it might be too global for some people...42 EachNodeIt gn; //FIXME: it might be too global for some people... 43 43 44 44 augment: 45 45 46 for( NodeIt n(G);G.valid(n);G.next(n))46 for(EachNodeIt n(G);G.valid(n);G.next(n)) 47 47 visited.set(n,0); 48 48 … … 56 56 while(!bfs_queue.empty() && !visited.get(t)) 57 57 { 58 NodeIt n(bfs_queue.front());58 EachNodeIt n(bfs_queue.front()); 59 59 for(OutEdgeIt e(G,n);G.valid(e);G.next(e)) 60 60 if(f.get(e)<c.get(e) && //FIXME: < -
src/work/alpar/f_ed_ka_demo.cc
r74 r91 13 13 14 14 int main(int, char **) { 15 typedef ListGraph:: NodeItNodeIt;15 typedef ListGraph::EachNodeIt EachNodeIt; 16 16 typedef ListGraph::EachEdgeIt EachEdgeIt; 17 17 18 18 ListGraph G; 19 NodeIt s, t;19 EachNodeIt s, t; 20 20 ListGraph::EdgeMap<int> cap(G); 21 21 readDimacsMaxFlow(std::cin, G, s, t, cap);
Note: See TracChangeset
for help on using the changeset viewer.