src/work/marci/oldies/marci_graph_demo.cc
changeset 986 e997802b855c
parent 921 818510fa3d99
     1.1 --- a/src/work/marci/oldies/marci_graph_demo.cc	Sat Nov 13 12:24:01 2004 +0000
     1.2 +++ b/src/work/marci/oldies/marci_graph_demo.cc	Sat Nov 13 12:53:28 2004 +0000
     1.3 @@ -31,7 +31,7 @@
     1.4      std::cout << "node " << G.id(i) << std::endl;
     1.5      std::cout << " outdegree (OutEdgeIt): " << count(G.first<OutEdgeIt>(i)) << " "; 
     1.6      for(OutEdgeIt j=G.first<OutEdgeIt>(i); G.valid(j); G.next(j)) { 
     1.7 -      std::cout << "(" << G.id(G.tail(j)) << "--" << G.id(j) << "->" << G.id(G.head(j)) << ") ";
     1.8 +      std::cout << "(" << G.id(G.source(j)) << "--" << G.id(j) << "->" << G.id(G.target(j)) << ") ";
     1.9      }
    1.10      std::cout << std::endl; 
    1.11  
    1.12 @@ -89,9 +89,9 @@
    1.13      _i*=_ii; ++_ii;
    1.14    }
    1.15  
    1.16 -  std::cout << "node and edge property values on the tails and heads of edges..." << std::endl;
    1.17 +  std::cout << "node and edge property values on the sources and targets of edges..." << std::endl;
    1.18    for(EdgeIt j=G.first<EdgeIt>(); G.valid(j); G.next(j)) {
    1.19 -    std::cout << my_property_vector.get(G.tail(j)) << "--" << my_edge_property.get(j) << "-->" << my_property_vector.get(G.head(j)) << " ";
    1.20 +    std::cout << my_property_vector.get(G.source(j)) << "--" << my_edge_property.get(j) << "-->" << my_property_vector.get(G.target(j)) << " ";
    1.21    }
    1.22    std::cout << std::endl;
    1.23  /*
    1.24 @@ -158,10 +158,10 @@
    1.25      std::cout << node_name.get(i) << ": ";
    1.26      std::cout << "out edges: ";
    1.27      for(OutEdgeIt j=flowG.first<OutEdgeIt>(i); flowG.valid(j); flowG.next(j)) 
    1.28 -      std::cout << node_name.get(flowG.tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";
    1.29 +      std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " ";
    1.30      std::cout << "in edges: ";
    1.31      for(InEdgeIt j=flowG.first<InEdgeIt>(i); flowG.valid(j); flowG.next(j)) 
    1.32 -      std::cout << node_name.get(flowG.tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";
    1.33 +      std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " ";
    1.34      std::cout << std::endl;
    1.35    }
    1.36  
    1.37 @@ -171,22 +171,22 @@
    1.38    //flowG.deleteEdge(v1_v3);
    1.39    
    1.40  
    1.41 -  //flowG.setTail(v3_t, v2);
    1.42 -  //flowG.setHead(v3_t, s);
    1.43 +  //flowG.setSource(v3_t, v2);
    1.44 +  //flowG.setTarget(v3_t, s);
    1.45  /*
    1.46    for(NodeIt i=flowG.first<NodeIt>(); flowG.valid(i); flowG.next(i)) { 
    1.47      std::cout << node_name.get(i) << ": ";
    1.48      std::cout << "out edges: ";
    1.49      for(OutEdgeIt j=flowG.first<OutEdgeIt>(i); flowG.valid(j); flowG.next(j)) 
    1.50 -      std::cout << node_name.get(flowG.tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";
    1.51 +      std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " ";
    1.52      std::cout << "in edges: ";
    1.53      for(InEdgeIt j=flowG.first<InEdgeIt>(i); flowG.valid(j); flowG.next(j)) 
    1.54 -      std::cout << node_name.get(flowG.tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";
    1.55 +      std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " ";
    1.56      std::cout << std::endl;
    1.57    }
    1.58    
    1.59    for(EdgeIt e=flowG.first<EdgeIt>(); flowG.valid(e); flowG.next(e)) {
    1.60 -    std::cout << node_name.get(flowG.tail(e)) << "-"<< cap.get(e) << "->" << node_name.get(flowG.head(e)) << " ";
    1.61 +    std::cout << node_name.get(flowG.source(e)) << "-"<< cap.get(e) << "->" << node_name.get(flowG.target(e)) << " ";
    1.62    }
    1.63  */
    1.64    /*
    1.65 @@ -196,10 +196,10 @@
    1.66        std::cout << node_name.get(i) << ": ";
    1.67        std::cout << "out edges: ";
    1.68        for(OutEdgeIt j=flowG.first<OutEdgeIt>(i); flowG.valid(j); flowG.next(j)) 
    1.69 -	std::cout << node_name.get(flowG.tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";
    1.70 +	std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " ";
    1.71        std::cout << "in edges: ";
    1.72        for(InEdgeIt j=flowG.first<InEdgeIt>(i); flowG.valid(j); flowG.next(j)) 
    1.73 -	std::cout << node_name.get(flowG.tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";
    1.74 +	std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " ";
    1.75        std::cout << std::endl;
    1.76      }
    1.77    }
    1.78 @@ -210,10 +210,10 @@
    1.79        std::cout << node_name.get(i) << ": ";
    1.80        std::cout << "out edges: ";
    1.81        for(OutEdgeIt j=flowG.first<OutEdgeIt>(i); flowG.valid(j); flowG.next(j)) 
    1.82 -	std::cout << node_name.get(flowG.tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";
    1.83 +	std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " ";
    1.84        std::cout << "in edges: ";
    1.85        for(InEdgeIt j=flowG.first<InEdgeIt>(i); flowG.valid(j); flowG.next(j)) 
    1.86 -	std::cout << node_name.get(flowG.tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";
    1.87 +	std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " ";
    1.88        std::cout << std::endl;
    1.89      }
    1.90    }
    1.91 @@ -228,12 +228,12 @@
    1.92      /*
    1.93      max_flow_test.augmentOnBlockingFlow<ListGraph>();
    1.94      for(EdgeIt e=flowG.template first<EdgeIt>(); flowG.valid(e); flowG.next(e)) { 
    1.95 -      std::cout<<"("<<flowG.tail(e)<< "-"<<flow.get(e)<<"->"<<flowG.head(e)<<") ";
    1.96 +      std::cout<<"("<<flowG.source(e)<< "-"<<flow.get(e)<<"->"<<flowG.target(e)<<") ";
    1.97      }
    1.98      std::cout<<std::endl;
    1.99      max_flow_test.augmentOnBlockingFlow<ListGraph>();
   1.100      for(EdgeIt e=flowG.template first<EdgeIt>(); flowG.valid(e); flowG.next(e)) { 
   1.101 -      std::cout<<"("<<flowG.tail(e)<< "-"<<flow.get(e)<<"->"<<flowG.head(e)<<") ";
   1.102 +      std::cout<<"("<<flowG.source(e)<< "-"<<flow.get(e)<<"->"<<flowG.target(e)<<") ";
   1.103      }
   1.104      std::cout<<std::endl;*/
   1.105      //max_flow_test.run();
   1.106 @@ -241,7 +241,7 @@
   1.107      //std::cout << "maximum flow: "<< std::endl;
   1.108      while (max_flow_test.augmentOnShortestPath()) {
   1.109        for(EdgeIt e=flowG.template first<EdgeIt>(); flowG.valid(e); flowG.next(e)) { 
   1.110 -	std::cout<<"("<<flowG.tail(e)<< "-"<<flow.get(e)<<"->"<<flowG.head(e)<<") ";
   1.111 +	std::cout<<"("<<flowG.source(e)<< "-"<<flow.get(e)<<"->"<<flowG.target(e)<<") ";
   1.112        }
   1.113        std::cout<<std::endl;
   1.114      }
   1.115 @@ -260,7 +260,7 @@
   1.116      
   1.117      std::cout << "maximum flow: "<< std::endl;
   1.118      for(EdgeIt e=flowG.template first<EdgeIt>(); flowG.valid(e); flowG.next(e)) { 
   1.119 -      std::cout<<"("<<flowG.tail(e)<< "-"<<flow.get(e)<<"->"<<flowG.head(e)<<") ";
   1.120 +      std::cout<<"("<<flowG.source(e)<< "-"<<flow.get(e)<<"->"<<flowG.target(e)<<") ";
   1.121      }
   1.122      std::cout<<std::endl;
   1.123      std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;