.
authoralpar
Tue, 17 Feb 2004 12:27:49 +0000
changeset 9181bf58164f60
parent 90 6a14044089d9
child 92 a7f9e2fda93a
.
src/work/alpar/f_ed_ka.h
src/work/alpar/f_ed_ka_demo.cc
     1.1 --- a/src/work/alpar/f_ed_ka.h	Tue Feb 17 12:26:25 2004 +0000
     1.2 +++ b/src/work/alpar/f_ed_ka.h	Tue Feb 17 12:27:49 2004 +0000
     1.3 @@ -16,10 +16,10 @@
     1.4    typename FlowMap::ValueType maxFlow(Graph &G,
     1.5  				      FlowMap &f,
     1.6  				      CapacityMap &c,
     1.7 -				      typename Graph::NodeIt s,
     1.8 -				      typename Graph::NodeIt t)
     1.9 +				      typename Graph::EachNodeIt s,
    1.10 +				      typename Graph::EachNodeIt t)
    1.11    { 
    1.12 -    typedef typename Graph::NodeIt NodeIt;
    1.13 +    typedef typename Graph::EachNodeIt EachNodeIt;
    1.14      typedef typename Graph::EdgeIt EdgeIt;
    1.15      typedef typename Graph::EachEdgeIt EachEdgeIt;
    1.16      typedef typename Graph::OutEdgeIt OutEdgeIt;
    1.17 @@ -32,18 +32,18 @@
    1.18      for(EachEdgeIt e(G);G.valid(e);G.next(e))
    1.19        f.set(e,0);
    1.20      
    1.21 -    std::queue<NodeIt> bfs_queue;
    1.22 +    std::queue<EachNodeIt> bfs_queue;
    1.23      typename Graph::NodeMap<int> visited(G); //0: unvisited,
    1.24                                               //1: reached by a forward edge
    1.25                                               //2: reached by a backward edge
    1.26                                               //3: it is node s
    1.27      typename Graph::NodeMap<EdgeIt> tree(G);
    1.28      
    1.29 -    NodeIt gn;  //FIXME: it might be too global for some people...
    1.30 +    EachNodeIt gn;  //FIXME: it might be too global for some people...
    1.31      
    1.32    augment:
    1.33      
    1.34 -    for(NodeIt n(G);G.valid(n);G.next(n))
    1.35 +    for(EachNodeIt n(G);G.valid(n);G.next(n))
    1.36        visited.set(n,0);
    1.37      
    1.38      visited.set(s,3);
    1.39 @@ -55,7 +55,7 @@
    1.40      
    1.41      while(!bfs_queue.empty() && !visited.get(t))
    1.42        {
    1.43 -	NodeIt n(bfs_queue.front());
    1.44 +	EachNodeIt n(bfs_queue.front());
    1.45  	for(OutEdgeIt e(G,n);G.valid(e);G.next(e))
    1.46  	  if(f.get(e)<c.get(e) &&   //FIXME: <
    1.47  	     !visited.get(G.bNode(e))) 
     2.1 --- a/src/work/alpar/f_ed_ka_demo.cc	Tue Feb 17 12:26:25 2004 +0000
     2.2 +++ b/src/work/alpar/f_ed_ka_demo.cc	Tue Feb 17 12:27:49 2004 +0000
     2.3 @@ -12,11 +12,11 @@
     2.4  // read_dimacs_demo < dimacs_max_flow_file
     2.5  
     2.6  int main(int, char **) {
     2.7 -  typedef ListGraph::NodeIt NodeIt;
     2.8 +  typedef ListGraph::EachNodeIt EachNodeIt;
     2.9    typedef ListGraph::EachEdgeIt EachEdgeIt;
    2.10  
    2.11    ListGraph G;
    2.12 -  NodeIt s, t;
    2.13 +  EachNodeIt s, t;
    2.14    ListGraph::EdgeMap<int> cap(G);
    2.15    readDimacsMaxFlow(std::cin, G, s, t, cap);
    2.16