Naming changes:
authoralpar
Sat, 13 Nov 2004 12:53:28 +0000
changeset 986e997802b855c
parent 985 741f3108a90f
child 987 87f7c54892df
Naming changes:
- head -> target
- tail -> source
doc/graphs.dox
doc/maps.dox
src/benchmark/bfs-bench.cc
src/demo/dim_to_dot.cc
src/demo/sub_graph_wrapper_demo.cc
src/demo/tight_edge_filter_map.h
src/lemon/bfs.h
src/lemon/concept/graph.h
src/lemon/concept/graph_component.h
src/lemon/concept/path.h
src/lemon/concept/sym_graph.h
src/lemon/concept/undir_graph.h
src/lemon/concept_check.h
src/lemon/dfs.h
src/lemon/dijkstra.h
src/lemon/dimacs.h
src/lemon/full_graph.h
src/lemon/graph_utils.h
src/lemon/graph_wrapper.h
src/lemon/kruskal.h
src/lemon/list_graph.h
src/lemon/min_cost_flow.h
src/lemon/path.h
src/lemon/preflow.h
src/lemon/smart_graph.h
src/lemon/suurballe.h
src/lemon/undir_graph_extender.h
src/test/bfs_test.cc
src/test/dfs_test.cc
src/test/dijkstra_heap_test.cc
src/test/dijkstra_test.cc
src/test/graph_factory_test.cc
src/test/graph_test.h
src/test/path_test.cc
src/test/preflow_test.cc
src/test/sym_graph_test.cc
src/test/sym_graph_test.h
src/test/test_tools.h
src/work/alpar/bfs-named-param.cc
src/work/alpar/boolmap_iter.cc
src/work/alpar/dijkstra.h
src/work/alpar/f_ed_ka.h
src/work/alpar/f_ed_ka_demo.cc
src/work/alpar/graph.h
src/work/alpar/gwrapper.h
src/work/alpar/list_graph_demo.cc
src/work/alpar/rw_nonref_map.cc
src/work/alpar/smart_graph_demo.cc
src/work/athos/bfs_test.cc
src/work/athos/dijkstra_demo.cc
src/work/athos/mincostflow.h
src/work/athos/old/minlengthpaths.h
src/work/athos/preflow_push_wogw.h
src/work/deba/list_graph.h
src/work/jacint/max_flow.h
src/work/jacint/max_flow_bug.cc
src/work/jacint/max_flow_test.cc
src/work/jacint/max_matching.cc
src/work/jacint/max_matching.h
src/work/jacint/max_save.h
src/work/jacint/preflow.cc
src/work/jacint/preflow_excess.h
src/work/jacint/preflow_excess_test.cc
src/work/jacint/preflow_res.h
src/work/jacint/prim.h
src/work/johanna/ma_order.h
src/work/marci/augmenting_flow.h
src/work/marci/bfs_dfs.h
src/work/marci/bfs_mm.h
src/work/marci/bfs_mm_test.cc
src/work/marci/bfsit_vs_byhand.cc
src/work/marci/bipartite_graph_wrapper.h
src/work/marci/bipartite_graph_wrapper_test.cc
src/work/marci/experiment/edmonds_karp.h
src/work/marci/experiment/edmonds_karp_1.h
src/work/marci/experiment/edmonds_karp_demo.cc
src/work/marci/experiment/edmonds_karp_demo_1.cc
src/work/marci/experiment/graph_wrapper.h
src/work/marci/experiment/graph_wrapper_1.h
src/work/marci/experiment/graph_wrapper_st_ostream_op.h
src/work/marci/experiment/iterator_bfs_demo.cc
src/work/marci/experiment/iterator_bfs_demo_1.cc
src/work/marci/experiment/list_graph.h
src/work/marci/graph_concept.h
src/work/marci/iterator_bfs_demo.cc
src/work/marci/leda/bipartite_matching_comparison.cc
src/work/marci/leda/leda_graph_wrapper.h
src/work/marci/leda/max_bipartite_matching_demo.cc
src/work/marci/leda_bfs_dfs.cc
src/work/marci/leda_graph_demo.cc
src/work/marci/lp/max_flow_by_lp.cc
src/work/marci/max_flow_demo.cc
src/work/marci/oldies/edmonds_karp.h
src/work/marci/oldies/marci_graph_demo.cc
src/work/marci/preflow_bug.cc
src/work/marci/preflow_demo_athos.cc
src/work/marci/preflow_demo_jacint.cc
src/work/peter/edgepathgraph.h
src/work/peter/edgepathgraph_test.cc
src/work/peter/hierarchygraph.h
src/work/peter/path/path.h
src/work/peter/path/path_skeleton.h
src/work/peter/path/path_test.cc
src/work/sage_graph.h
     1.1 --- a/doc/graphs.dox	Sat Nov 13 12:24:01 2004 +0000
     1.2 +++ b/doc/graphs.dox	Sat Nov 13 12:53:28 2004 +0000
     1.3 @@ -125,7 +125,7 @@
     1.4  \code
     1.5    std::cout << "Edges:";
     1.6    for (EdgeIt i(g); i!=INVALID; ++i)
     1.7 -    std::cout << " (" << g.id(g.tail(i)) << "," << g.id(g.head(i)) << ")";
     1.8 +    std::cout << " (" << g.id(g.source(i)) << "," << g.id(g.target(i)) << ")";
     1.9    std::cout << std::endl;
    1.10  \endcode
    1.11  
    1.12 @@ -133,20 +133,20 @@
    1.13  Edges: (0,2) (1,2) (0,1) (2,1) (1,0) (2,0)
    1.14  \endcode
    1.15  
    1.16 -We can also iterate through all edges of the graph very similarly. The head and
    1.17 -tail member functions can be used to access the endpoints of an edge.
    1.18 +We can also iterate through all edges of the graph very similarly. The target and
    1.19 +source member functions can be used to access the endpoints of an edge.
    1.20  
    1.21  \code
    1.22    NodeIt first_node(g);
    1.23  
    1.24    std::cout << "Out-edges of node " << g.id(first_node) << ":";
    1.25    for (OutEdgeIt i(g, first_node); i!=INVALID; ++i)
    1.26 -    std::cout << " (" << g.id(g.tail(i)) << "," << g.id(g.head(i)) << ")"; 
    1.27 +    std::cout << " (" << g.id(g.source(i)) << "," << g.id(g.target(i)) << ")"; 
    1.28    std::cout << std::endl;
    1.29  
    1.30    std::cout << "In-edges of node " << g.id(first_node) << ":";
    1.31    for (InEdgeIt i(g, first_node); i!=INVALID; ++i)
    1.32 -    std::cout << " (" << g.id(g.tail(i)) << "," << g.id(g.head(i)) << ")"; 
    1.33 +    std::cout << " (" << g.id(g.source(i)) << "," << g.id(g.target(i)) << ")"; 
    1.34    std::cout << std::endl;
    1.35  \endcode
    1.36  
    1.37 @@ -166,7 +166,7 @@
    1.38    
    1.39    std::cout << "Id Edge  Value" << std::endl;
    1.40    for (EdgeIt e(g); e!=INVALID; ++e)
    1.41 -    std::cout << g.id(e) << "  (" << g.id(g.tail(e)) << "," << g.id(g.head(e))
    1.42 +    std::cout << g.id(e) << "  (" << g.id(g.source(e)) << "," << g.id(g.target(e))
    1.43        << ") " << m[e] << std::endl;
    1.44  \endcode
    1.45  
     2.1 --- a/doc/maps.dox	Sat Nov 13 12:24:01 2004 +0000
     2.2 +++ b/doc/maps.dox	Sat Nov 13 12:53:28 2004 +0000
     2.3 @@ -112,7 +112,7 @@
     2.4    
     2.5  public:
     2.6    ValueType operator[](KeyType e) const {
     2.7 -    return orig_len.get(e)-pot.get(G.head(e))-pot.get(G.tail(e));
     2.8 +    return orig_len.get(e)-pot.get(G.target(e))-pot.get(G.source(e));
     2.9    }
    2.10    
    2.11    MyLengthMap(const Graph &g, const Graph::EdgeMap &o,const Graph::NodeMap &p)
     3.1 --- a/src/benchmark/bfs-bench.cc	Sat Nov 13 12:24:01 2004 +0000
     3.2 +++ b/src/benchmark/bfs-bench.cc	Sat Nov 13 12:53:28 2004 +0000
     3.3 @@ -46,7 +46,7 @@
     3.4      Node m;
     3.5      Q.pop();
     3.6      for(OutEdgeIt e(G,n);e!=INVALID;++e)
     3.7 -      if(!visited[m=G.head(e)]) {
     3.8 +      if(!visited[m=G.target(e)]) {
     3.9  	Q.push(m);
    3.10  	visited.set(m,true);
    3.11        }
    3.12 @@ -74,7 +74,7 @@
    3.13      Node m;
    3.14      Node n=Q[Qt++];
    3.15      for(OutEdgeIt e(G,n);e!=INVALID;++e)
    3.16 -      if(!visited[m=G.head(e)]) {
    3.17 +      if(!visited[m=G.target(e)]) {
    3.18  	Q[Qh++]=m;
    3.19  	visited.set(m,true);
    3.20        }
     4.1 --- a/src/demo/dim_to_dot.cc	Sat Nov 13 12:24:01 2004 +0000
     4.2 +++ b/src/demo/dim_to_dot.cc	Sat Nov 13 12:53:28 2004 +0000
     4.3 @@ -51,7 +51,7 @@
     4.4    }
     4.5    cout << "  edge [ shape=ellipse, fontname=Helvetica, fontsize=10 ];" << endl;
     4.6    for(EdgeIt e(g); e!=INVALID; ++e) {
     4.7 -    cout << "  n" << g.id(g.tail(e)) << " -> " << " n" << g.id(g.head(e))
     4.8 +    cout << "  n" << g.id(g.source(e)) << " -> " << " n" << g.id(g.target(e))
     4.9  	 << " [ label=\"" << g.id(e) 
    4.10  	 << ", length:" << length[e] << "\" ]; " << endl;
    4.11    } 
     5.1 --- a/src/demo/sub_graph_wrapper_demo.cc	Sat Nov 13 12:24:01 2004 +0000
     5.2 +++ b/src/demo/sub_graph_wrapper_demo.cc	Sat Nov 13 12:53:28 2004 +0000
     5.3 @@ -37,10 +37,10 @@
     5.4  
     5.5    readDimacs(std::cin, g, length, s, t);
     5.6  
     5.7 -  cout << "edges with lengths (of form id, tail--length->head): " << endl;
     5.8 +  cout << "edges with lengths (of form id, source--length->target): " << endl;
     5.9    for(EdgeIt e(g); e!=INVALID; ++e) 
    5.10 -    cout << " " << g.id(e) << ", " << g.id(g.tail(e)) << "--" 
    5.11 -	 << length[e] << "->" << g.id(g.head(e)) << endl;
    5.12 +    cout << " " << g.id(e) << ", " << g.id(g.source(e)) << "--" 
    5.13 +	 << length[e] << "->" << g.id(g.target(e)) << endl;
    5.14  
    5.15    cout << "s: " << g.id(s) << " t: " << g.id(t) << endl;
    5.16  
    5.17 @@ -75,6 +75,6 @@
    5.18    for(EdgeIt e(g); e!=INVALID; ++e) 
    5.19      if (flow[e])
    5.20        cout << " " << g.id(e) << ", "
    5.21 -	   << g.id(g.tail(e)) << "--" 
    5.22 -	   << length[e] << "->" << g.id(g.head(e)) << endl;
    5.23 +	   << g.id(g.source(e)) << "--" 
    5.24 +	   << length[e] << "->" << g.id(g.target(e)) << endl;
    5.25  }
     6.1 --- a/src/demo/tight_edge_filter_map.h	Sat Nov 13 12:24:01 2004 +0000
     6.2 +++ b/src/demo/tight_edge_filter_map.h	Sat Nov 13 12:53:28 2004 +0000
     6.3 @@ -31,8 +31,8 @@
     6.4    ///
     6.5    /// A node-map node_potential is said to be a potential w.r.t. 
     6.6    /// an edge-map edge_distance 
     6.7 -  /// if and only if for each edge e, node_potential[g.head(e)] 
     6.8 -  /// <= edge_distance[e]+node_potential[g.tail(e)] 
     6.9 +  /// if and only if for each edge e, node_potential[g.target(e)] 
    6.10 +  /// <= edge_distance[e]+node_potential[g.source(e)] 
    6.11    /// (or the reverse inequality holds for each edge).
    6.12    /// An edge is said to be tight if this inequality holds with equality, 
    6.13    /// and the map returns true exactly for those edges.
    6.14 @@ -51,8 +51,8 @@
    6.15        g(&_g), node_potential(&_node_potential), 
    6.16        edge_distance(&_edge_distance) { }
    6.17      bool operator[](const typename Graph::Edge& e) const {
    6.18 -      return ((*node_potential)[g->head(e)] == 
    6.19 -	      (*edge_distance)[e]+(*node_potential)[g->tail(e)]);
    6.20 +      return ((*node_potential)[g->target(e)] == 
    6.21 +	      (*edge_distance)[e]+(*node_potential)[g->source(e)]);
    6.22      }
    6.23    };
    6.24  
     7.1 --- a/src/lemon/bfs.h	Sat Nov 13 12:24:01 2004 +0000
     7.2 +++ b/src/lemon/bfs.h	Sat Nov 13 12:53:28 2004 +0000
     7.3 @@ -209,7 +209,7 @@
     7.4  	int d= (*distance)[n]+1;
     7.5  	
     7.6  	for(OutEdgeIt e(*G,n);e!=INVALID;++e)
     7.7 -	  if((m=G->head(e))!=s && (*predecessor)[m]==INVALID) {
     7.8 +	  if((m=G->target(e))!=s && (*predecessor)[m]==INVALID) {
     7.9  	    Q[Qh++]=m;
    7.10  	    predecessor->set(m,e);
    7.11  	    pred_node->set(m,n);
     8.1 --- a/src/lemon/concept/graph.h	Sat Nov 13 12:24:01 2004 +0000
     8.2 +++ b/src/lemon/concept/graph.h	Sat Nov 13 12:53:28 2004 +0000
     8.3 @@ -363,16 +363,16 @@
     8.4  //       ///
     8.5  //       EdgeIt& first(EdgeIt& i) const { return i; }
     8.6  
     8.7 -//       ///Gives back the head node of an edge.
     8.8 +//       ///Gives back the target node of an edge.
     8.9  
    8.10 -//       ///Gives back the head node of an edge.
    8.11 +//       ///Gives back the target node of an edge.
    8.12  //       ///
    8.13 -//       Node head(Edge) const { return INVALID; }
    8.14 -//       ///Gives back the tail node of an edge.
    8.15 +//       Node target(Edge) const { return INVALID; }
    8.16 +//       ///Gives back the source node of an edge.
    8.17  
    8.18 -//       ///Gives back the tail node of an edge.
    8.19 +//       ///Gives back the source node of an edge.
    8.20  //       ///
    8.21 -//       Node tail(Edge) const { return INVALID; }
    8.22 +//       Node source(Edge) const { return INVALID; }
    8.23    
    8.24  //       ///Gives back the \e id of a node.
    8.25  
    8.26 @@ -538,8 +538,8 @@
    8.27  // 	n=m=INVALID;
    8.28  // 	Edge e;
    8.29  // 	e=INVALID;
    8.30 -// 	n=G.tail(e);
    8.31 -// 	n=G.head(e);
    8.32 +// 	n=G.source(e);
    8.33 +// 	n=G.target(e);
    8.34  //       }
    8.35  //       // id tests
    8.36  //       { Node n; int i=G.id(n); i=i; }
    8.37 @@ -665,8 +665,8 @@
    8.38  //       Node addNode() { return INVALID; }
    8.39  //       ///Add a new edge to the graph.
    8.40  
    8.41 -//       ///Add a new edge to the graph with tail node \c t
    8.42 -//       ///and head node \c h.
    8.43 +//       ///Add a new edge to the graph with source node \c t
    8.44 +//       ///and target node \c h.
    8.45  //       ///\return the new edge.
    8.46  //       Edge addEdge(Node h, Node t) { return INVALID; }
    8.47      
    8.48 @@ -800,8 +800,8 @@
    8.49        void nextOutEdge(Edge &e) const { }
    8.50        void nextInEdge(Edge &e) const { }
    8.51  
    8.52 -      Node head(Edge) const { return Node(); }
    8.53 -      Node tail(Edge) const { return Node(); }
    8.54 +      Node target(Edge) const { return Node(); }
    8.55 +      Node source(Edge) const { return Node(); }
    8.56        
    8.57  
    8.58        // Do we need id, nodeNum, edgeNum and co. in this basic graphbase
     9.1 --- a/src/lemon/concept/graph_component.h	Sat Nov 13 12:24:01 2004 +0000
     9.2 +++ b/src/lemon/concept/graph_component.h	Sat Nov 13 12:53:28 2004 +0000
     9.3 @@ -242,17 +242,17 @@
     9.4  	bool operator<(const Edge&) const { return true;}
     9.5        };
     9.6  
     9.7 -      ///Gives back the head node of an edge.
     9.8 +      ///Gives back the target node of an edge.
     9.9  
    9.10 -      ///Gives back the head node of an edge.
    9.11 +      ///Gives back the target node of an edge.
    9.12        ///
    9.13 -      Node head(const Edge&) const { return INVALID;}
    9.14 +      Node target(const Edge&) const { return INVALID;}
    9.15  
    9.16 -      ///Gives back the tail node of an edge.
    9.17 +      ///Gives back the source node of an edge.
    9.18  
    9.19 -      ///Gives back the tail node of an edge.
    9.20 +      ///Gives back the source node of an edge.
    9.21        ///
    9.22 -      Node tail(const Edge&) const { return INVALID;}
    9.23 +      Node source(const Edge&) const { return INVALID;}
    9.24      };
    9.25  
    9.26  
    9.27 @@ -272,8 +272,8 @@
    9.28  	{
    9.29  	  Node n;
    9.30  	  Edge e;
    9.31 -	  n = graph.tail(e);
    9.32 -	  n = graph.head(e);
    9.33 +	  n = graph.source(e);
    9.34 +	  n = graph.target(e);
    9.35  	}      
    9.36        }
    9.37        
    10.1 --- a/src/lemon/concept/path.h	Sat Nov 13 12:24:01 2004 +0000
    10.2 +++ b/src/lemon/concept/path.h	Sat Nov 13 12:53:28 2004 +0000
    10.3 @@ -66,12 +66,12 @@
    10.4        ///
    10.5        /// Starting point of the path.
    10.6        /// Returns INVALID if the path is empty.
    10.7 -      GraphNode/*It*/ head() const {return INVALID;}
    10.8 +      GraphNode/*It*/ target() const {return INVALID;}
    10.9        /// \brief End point of the path.
   10.10        ///
   10.11        /// End point of the path.
   10.12        /// Returns INVALID if the path is empty.
   10.13 -      GraphNode/*It*/ tail() const {return INVALID;}
   10.14 +      GraphNode/*It*/ source() const {return INVALID;}
   10.15  
   10.16        /// \brief First NodeIt/EdgeIt.
   10.17        ///
   10.18 @@ -80,17 +80,17 @@
   10.19        template<typename It>
   10.20        It& first(It &i) const { return i=It(*this); }
   10.21  
   10.22 -      /// \brief The head of an edge.
   10.23 +      /// \brief The target of an edge.
   10.24        ///
   10.25 -      /// Returns node iterator pointing to the head node of the
   10.26 +      /// Returns node iterator pointing to the target node of the
   10.27        /// given edge iterator.
   10.28 -      NodeIt head(const EdgeIt& e) const {return INVALID;}
   10.29 +      NodeIt target(const EdgeIt& e) const {return INVALID;}
   10.30  
   10.31 -      /// \brief The tail of an edge.
   10.32 +      /// \brief The source of an edge.
   10.33        ///
   10.34 -      /// Returns node iterator pointing to the tail node of the
   10.35 +      /// Returns node iterator pointing to the source node of the
   10.36        /// given edge iterator.
   10.37 -      NodeIt tail(const EdgeIt& e) const {return INVALID;}
   10.38 +      NodeIt source(const EdgeIt& e) const {return INVALID;}
   10.39  
   10.40  
   10.41        /* Iterator classes */
    11.1 --- a/src/lemon/concept/sym_graph.h	Sat Nov 13 12:24:01 2004 +0000
    11.2 +++ b/src/lemon/concept/sym_graph.h	Sat Nov 13 12:53:28 2004 +0000
    11.3 @@ -450,27 +450,27 @@
    11.4        ///
    11.5        SymEdgeIt& first(SymEdgeIt& i) const { return i; }
    11.6  
    11.7 -      ///Gives back the head node of an edge.
    11.8 +      ///Gives back the target node of an edge.
    11.9  
   11.10 -      ///Gives back the head node of an edge.
   11.11 +      ///Gives back the target node of an edge.
   11.12        ///
   11.13 -      Node head(Edge) const { return INVALID; }
   11.14 -      ///Gives back the tail node of an edge.
   11.15 +      Node target(Edge) const { return INVALID; }
   11.16 +      ///Gives back the source node of an edge.
   11.17  
   11.18 -      ///Gives back the tail node of an edge.
   11.19 +      ///Gives back the source node of an edge.
   11.20        ///
   11.21 -      Node tail(Edge) const { return INVALID; }
   11.22 +      Node source(Edge) const { return INVALID; }
   11.23    
   11.24        ///Gives back the first node of an symmetric edge.
   11.25  
   11.26        ///Gives back the first node of an symmetric edge.
   11.27        ///
   11.28 -      Node head(SymEdge) const { return INVALID; }
   11.29 +      Node target(SymEdge) const { return INVALID; }
   11.30        ///Gives back the second node of an symmetric edge.
   11.31  
   11.32        ///Gives back the second node of an symmetric edge.
   11.33        ///
   11.34 -      Node tail(SymEdge) const { return INVALID; }
   11.35 +      Node source(SymEdge) const { return INVALID; }
   11.36        ///Gives back the \e id of a node.
   11.37  
   11.38        ///\warning Not all graph structures provide this feature.
   11.39 @@ -607,8 +607,8 @@
   11.40        Node addNode() { return INVALID; }
   11.41        ///Add a new edge to the graph.
   11.42  
   11.43 -      ///Add a new symmetric edge to the graph with tail node \c t
   11.44 -      ///and head node \c h.
   11.45 +      ///Add a new symmetric edge to the graph with source node \c t
   11.46 +      ///and target node \c h.
   11.47        ///\return the new edge.
   11.48        SymEdge addEdge(Node h, Node t) { return INVALID; }
   11.49      
    12.1 --- a/src/lemon/concept/undir_graph.h	Sat Nov 13 12:24:01 2004 +0000
    12.2 +++ b/src/lemon/concept/undir_graph.h	Sat Nov 13 12:53:28 2004 +0000
    12.3 @@ -47,8 +47,8 @@
    12.4  	ue = e;
    12.5  
    12.6  	Node n;
    12.7 -	n = graph.head(ue);
    12.8 -	n = graph.tail(ue);
    12.9 +	n = graph.target(ue);
   12.10 +	n = graph.source(ue);
   12.11  
   12.12  	graph.first(ue);
   12.13  	graph.next(ue);
    13.1 --- a/src/lemon/concept_check.h	Sat Nov 13 12:24:01 2004 +0000
    13.2 +++ b/src/lemon/concept_check.h	Sat Nov 13 12:53:28 2004 +0000
    13.3 @@ -25,7 +25,7 @@
    13.4    /*
    13.5      "inline" is used for ignore_unused_variable_warning()
    13.6      and function_requires() to make sure there is no
    13.7 -    overhead with g++.
    13.8 +    overtarget with g++.
    13.9    */
   13.10  
   13.11    template <class T> inline void ignore_unused_variable_warning(const T&) { }
    14.1 --- a/src/lemon/dfs.h	Sat Nov 13 12:24:01 2004 +0000
    14.2 +++ b/src/lemon/dfs.h	Sat Nov 13 12:53:28 2004 +0000
    14.3 @@ -206,7 +206,7 @@
    14.4        OutEdgeIt e;
    14.5        do {
    14.6  	if((e=Q[Qh])!=INVALID)
    14.7 -	  if((m=G->head(e))!=s && (*predecessor)[m=G->head(e)]==INVALID) {
    14.8 +	  if((m=G->target(e))!=s && (*predecessor)[m=G->target(e)]==INVALID) {
    14.9  	    predecessor->set(m,e);
   14.10  	    pred_node->set(m,n);
   14.11  	    Q[++Qh] = OutEdgeIt(*G, m);
   14.12 @@ -214,7 +214,7 @@
   14.13  	    n=m;
   14.14  	  }
   14.15  	  else ++Q[Qh];
   14.16 -	else if(--Qh>=0) n=G->tail(Q[Qh]);
   14.17 +	else if(--Qh>=0) n=G->source(Q[Qh]);
   14.18        } while(Qh>=0);
   14.19      }
   14.20      
    15.1 --- a/src/lemon/dijkstra.h	Sat Nov 13 12:24:01 2004 +0000
    15.2 +++ b/src/lemon/dijkstra.h	Sat Nov 13 12:53:28 2004 +0000
    15.3 @@ -254,7 +254,7 @@
    15.4  	
    15.5  	
    15.6  	for(OutEdgeIt e(*G,v); e!=INVALID; ++e) {
    15.7 -	  Node w=G->head(e); 
    15.8 +	  Node w=G->target(e); 
    15.9  	  switch(heap.state(w)) {
   15.10  	  case HeapType::PRE_HEAP:
   15.11  	    heap.push(w,oldvalue+(*length)[e]); 
    16.1 --- a/src/lemon/dimacs.h	Sat Nov 13 12:24:01 2004 +0000
    16.2 +++ b/src/lemon/dimacs.h	Sat Nov 13 12:53:28 2004 +0000
    16.3 @@ -208,7 +208,7 @@
    16.4      os << "p mat " << g.nodeNum() << " " << g.edgeNum() << std::endl;
    16.5  
    16.6      for(EdgeIt e(g); e!=INVALID; ++e) {
    16.7 -      os << "a " << nodes[g.tail(e)] << " " << nodes[g.head(e)] << std::endl; 
    16.8 +      os << "a " << nodes[g.source(e)] << " " << nodes[g.target(e)] << std::endl; 
    16.9      }
   16.10  
   16.11    }
    17.1 --- a/src/lemon/full_graph.h	Sat Nov 13 12:24:01 2004 +0000
    17.2 +++ b/src/lemon/full_graph.h	Sat Nov 13 12:53:28 2004 +0000
    17.3 @@ -78,8 +78,8 @@
    17.4      ///\sa id(Edge)
    17.5      int maxId(Edge = INVALID) const { return EdgeNum-1; }
    17.6  
    17.7 -    Node tail(Edge e) const { return e.id % NodeNum; }
    17.8 -    Node head(Edge e) const { return e.id / NodeNum; }
    17.9 +    Node source(Edge e) const { return e.id % NodeNum; }
   17.10 +    Node target(Edge e) const { return e.id / NodeNum; }
   17.11  
   17.12  
   17.13      /// Node ID.
   17.14 @@ -136,12 +136,12 @@
   17.15        friend class FullGraphBase;
   17.16        
   17.17      protected:
   17.18 -      int id;  // NodeNum * head + tail;
   17.19 +      int id;  // NodeNum * target + source;
   17.20  
   17.21        Edge(int _id) : id(_id) {}
   17.22  
   17.23 -      Edge(const FullGraphBase& _graph, int tail, int head) 
   17.24 -	: id(_graph.NodeNum * head+tail) {}
   17.25 +      Edge(const FullGraphBase& _graph, int source, int target) 
   17.26 +	: id(_graph.NodeNum * target+source) {}
   17.27      public:
   17.28        Edge() { }
   17.29        Edge (Invalid) { id = -1; }
   17.30 @@ -250,14 +250,14 @@
   17.31      ///\sa id(Edge)
   17.32      int maxId(Edge = INVALID) const { return EdgeNum-1; }
   17.33  
   17.34 -    Node tail(Edge e) const { 
   17.35 +    Node source(Edge e) const { 
   17.36        /// \todo we may do it faster
   17.37        return ((int)sqrt((double)(1 + 8 * e.id)) + 1) / 2; 
   17.38      }
   17.39  
   17.40 -    Node head(Edge e) const { 
   17.41 -      int tail = ((int)sqrt((double)(1 + 8 * e.id)) + 1) / 2;;
   17.42 -      return e.id - (tail) * (tail - 1) / 2; 
   17.43 +    Node target(Edge e) const { 
   17.44 +      int source = ((int)sqrt((double)(1 + 8 * e.id)) + 1) / 2;;
   17.45 +      return e.id - (source) * (source - 1) / 2; 
   17.46      }
   17.47  
   17.48  
   17.49 @@ -315,12 +315,12 @@
   17.50        friend class UndirFullGraphBase;
   17.51        
   17.52      protected:
   17.53 -      int id;  // NodeNum * head + tail;
   17.54 +      int id;  // NodeNum * target + source;
   17.55  
   17.56        Edge(int _id) : id(_id) {}
   17.57  
   17.58 -      Edge(const UndirFullGraphBase& _graph, int tail, int head) 
   17.59 -	: id(_graph.NodeNum * head+tail) {}
   17.60 +      Edge(const UndirFullGraphBase& _graph, int source, int target) 
   17.61 +	: id(_graph.NodeNum * target+source) {}
   17.62      public:
   17.63        Edge() { }
   17.64        Edge (Invalid) { id = -1; }
   17.65 @@ -351,10 +351,10 @@
   17.66  
   17.67      /// \todo with specialized iterators we can make faster iterating
   17.68      void nextOut(Edge& e) const {
   17.69 -      int tail = ((int)sqrt((double)(1 + 8 * e.id)) + 1) / 2;;
   17.70 -      int head = e.id - (tail) * (tail - 1) / 2; 
   17.71 -      ++head;
   17.72 -      e.id = head < tail ? tail * (tail - 1) / 2 + head : -1;
   17.73 +      int source = ((int)sqrt((double)(1 + 8 * e.id)) + 1) / 2;;
   17.74 +      int target = e.id - (source) * (source - 1) / 2; 
   17.75 +      ++target;
   17.76 +      e.id = target < source ? source * (source - 1) / 2 + target : -1;
   17.77      }
   17.78  
   17.79      void firstIn(Edge& edge, const Node& node) const {
   17.80 @@ -362,10 +362,10 @@
   17.81      }
   17.82      
   17.83      void nextIn(Edge& e) const {
   17.84 -      int tail = ((int)sqrt((double)(1 + 8 * e.id)) + 1) / 2;;
   17.85 -      int head = e.id - (tail) * (tail - 1) / 2; ++head;
   17.86 -      ++tail;
   17.87 -      e.id = tail < NodeNum ? tail * (tail - 1) / 2 + head : -1;
   17.88 +      int source = ((int)sqrt((double)(1 + 8 * e.id)) + 1) / 2;;
   17.89 +      int target = e.id - (source) * (source - 1) / 2; ++target;
   17.90 +      ++source;
   17.91 +      e.id = source < NodeNum ? source * (source - 1) / 2 + target : -1;
   17.92      }
   17.93  
   17.94    };
    18.1 --- a/src/lemon/graph_utils.h	Sat Nov 13 12:24:01 2004 +0000
    18.2 +++ b/src/lemon/graph_utils.h	Sat Nov 13 12:53:28 2004 +0000
    18.3 @@ -149,7 +149,7 @@
    18.4      typename Graph::OutEdgeIt e(g,prev);
    18.5      if(prev==INVALID) g.first(e,u);
    18.6      else ++e;
    18.7 -    while(e!=INVALID && g.tail(e)!=v) ++e;
    18.8 +    while(e!=INVALID && g.source(e)!=v) ++e;
    18.9      return e;
   18.10    }
   18.11    
   18.12 @@ -192,7 +192,7 @@
   18.13    void copyEdges(DestinationGraph& _d, const SourceGraph& _s,
   18.14  		 const NodeBijection& _nb, EdgeBijection& _eb) {    
   18.15      for (typename SourceGraph::EdgeIt it(_s); it != INVALID; ++it) {
   18.16 -      _eb[it] = _d.addEdge(_nb[_s.tail(it)], _nb[_s.head(it)]);
   18.17 +      _eb[it] = _d.addEdge(_nb[_s.source(it)], _nb[_s.target(it)]);
   18.18      }
   18.19    }
   18.20  
    19.1 --- a/src/lemon/graph_wrapper.h	Sat Nov 13 12:24:01 2004 +0000
    19.2 +++ b/src/lemon/graph_wrapper.h	Sat Nov 13 12:53:28 2004 +0000
    19.3 @@ -150,19 +150,19 @@
    19.4      void nextIn(Edge& i) const { graph->nextIn(i); }
    19.5      void nextOut(Edge& i) const { graph->nextOut(i); }
    19.6  
    19.7 -    Node tail(const Edge& e) const { return graph->tail(e); }
    19.8 -    Node head(const Edge& e) const { return graph->head(e); }
    19.9 -//     Node tail(const Edge& e) const { 
   19.10 -//       return Node(graph->tail(static_cast<typename Graph::Edge>(e))); }
   19.11 -//     Node head(const Edge& e) const { 
   19.12 -//       return Node(graph->head(static_cast<typename Graph::Edge>(e))); }
   19.13 +    Node source(const Edge& e) const { return graph->source(e); }
   19.14 +    Node target(const Edge& e) const { return graph->target(e); }
   19.15 +//     Node source(const Edge& e) const { 
   19.16 +//       return Node(graph->source(static_cast<typename Graph::Edge>(e))); }
   19.17 +//     Node target(const Edge& e) const { 
   19.18 +//       return Node(graph->target(static_cast<typename Graph::Edge>(e))); }
   19.19  
   19.20      int nodeNum() const { return graph->nodeNum(); }
   19.21      int edgeNum() const { return graph->edgeNum(); }
   19.22    
   19.23      Node addNode() const { return Node(graph->addNode()); }
   19.24 -    Edge addEdge(const Node& tail, const Node& head) const { 
   19.25 -      return Edge(graph->addEdge(tail, head)); }
   19.26 +    Edge addEdge(const Node& source, const Node& target) const { 
   19.27 +      return Edge(graph->addEdge(source, target)); }
   19.28  
   19.29      void erase(const Node& i) const { graph->erase(i); }
   19.30      void erase(const Edge& i) const { graph->erase(i); }
   19.31 @@ -290,10 +290,10 @@
   19.32        i=InEdgeIt(*this, p); return i;
   19.33      }
   19.34  
   19.35 -    Node tail(const Edge& e) const { 
   19.36 -      return GraphWrapper<Graph>::head(e); }
   19.37 -    Node head(const Edge& e) const { 
   19.38 -      return GraphWrapper<Graph>::tail(e); }
   19.39 +    Node source(const Edge& e) const { 
   19.40 +      return GraphWrapper<Graph>::target(e); }
   19.41 +    Node target(const Edge& e) const { 
   19.42 +      return GraphWrapper<Graph>::source(e); }
   19.43  
   19.44      //    KEEP_MAPS(Parent, RevGraphWrapper);
   19.45  
   19.46 @@ -625,10 +625,10 @@
   19.47  
   19.48    readDimacs(std::cin, g, length, s, t);
   19.49  
   19.50 -  cout << "edges with lengths (of form id, tail--length->head): " << endl;
   19.51 +  cout << "edges with lengths (of form id, source--length->target): " << endl;
   19.52    for(EdgeIt e(g); e!=INVALID; ++e) 
   19.53 -    cout << g.id(e) << ", " << g.id(g.tail(e)) << "--" 
   19.54 -         << length[e] << "->" << g.id(g.head(e)) << endl;
   19.55 +    cout << g.id(e) << ", " << g.id(g.source(e)) << "--" 
   19.56 +         << length[e] << "->" << g.id(g.target(e)) << endl;
   19.57  
   19.58    cout << "s: " << g.id(s) << " t: " << g.id(t) << endl;
   19.59    \endcode
   19.60 @@ -665,12 +665,12 @@
   19.61         << endl;
   19.62    for(EdgeIt e(g); e!=INVALID; ++e) 
   19.63      if (flow[e])
   19.64 -      cout << " " << g.id(g.tail(e)) << "--" 
   19.65 -	   << length[e] << "->" << g.id(g.head(e)) << endl;
   19.66 +      cout << " " << g.id(g.source(e)) << "--" 
   19.67 +	   << length[e] << "->" << g.id(g.target(e)) << endl;
   19.68    \endcode
   19.69    The program has the following (expected :-)) output:
   19.70    \code
   19.71 -  edges with lengths (of form id, tail--length->head):
   19.72 +  edges with lengths (of form id, source--length->target):
   19.73     9, 5--4->6
   19.74     8, 4--2->6
   19.75     7, 3--1->5
   19.76 @@ -756,7 +756,7 @@
   19.77  
   19.78      OutEdgeIt& next(OutEdgeIt& e) const {
   19.79        if (e.out_or_in) {
   19.80 -	typename Graph::Node n=this->graph->tail(e.out);
   19.81 +	typename Graph::Node n=this->graph->source(e.out);
   19.82  	this->graph->next(e.out);
   19.83  	if (!this->graph->valid(e.out)) { 
   19.84  	  e.out_or_in=false; this->graph->first(e.in, n); }
   19.85 @@ -767,11 +767,11 @@
   19.86      }
   19.87  
   19.88      Node aNode(const OutEdgeIt& e) const { 
   19.89 -      if (e.out_or_in) return this->graph->tail(e); else 
   19.90 -	return this->graph->head(e); }
   19.91 +      if (e.out_or_in) return this->graph->source(e); else 
   19.92 +	return this->graph->target(e); }
   19.93      Node bNode(const OutEdgeIt& e) const { 
   19.94 -      if (e.out_or_in) return this->graph->head(e); else 
   19.95 -	return this->graph->tail(e); }
   19.96 +      if (e.out_or_in) return this->graph->target(e); else 
   19.97 +	return this->graph->source(e); }
   19.98  
   19.99      //    KEEP_MAPS(Parent, UndirGraphWrapper);
  19.100  
  19.101 @@ -937,7 +937,7 @@
  19.102  	Edge(e), gw(&_gw) { }
  19.103        OutEdgeIt& operator++() { 
  19.104  	if (!this->backward) {
  19.105 -	  Node n=gw->tail(*this);
  19.106 +	  Node n=gw->source(*this);
  19.107  	  *(static_cast<GraphEdge*>(this))=
  19.108  	    ++(typename Graph::OutEdgeIt(*(gw->graph), *this));
  19.109  	  while (*static_cast<GraphEdge*>(this)!=INVALID && 
  19.110 @@ -994,7 +994,7 @@
  19.111  	Edge(e), gw(&_gw) { }
  19.112        InEdgeIt& operator++() { 
  19.113  	if (!this->backward) {
  19.114 -	  Node n=gw->tail(*this);
  19.115 +	  Node n=gw->source(*this);
  19.116  	  *(static_cast<GraphEdge*>(this))=
  19.117  	    ++(typename Graph::InEdgeIt(*(gw->graph), *this));
  19.118  	  while (*static_cast<GraphEdge*>(this)!=INVALID && 
  19.119 @@ -1089,10 +1089,10 @@
  19.120  //     }
  19.121    
  19.122  
  19.123 -    Node tail(Edge e) const { 
  19.124 -      return ((!e.backward) ? this->graph->tail(e) : this->graph->head(e)); }
  19.125 -    Node head(Edge e) const { 
  19.126 -      return ((!e.backward) ? this->graph->head(e) : this->graph->tail(e)); }
  19.127 +    Node source(Edge e) const { 
  19.128 +      return ((!e.backward) ? this->graph->source(e) : this->graph->target(e)); }
  19.129 +    Node target(Edge e) const { 
  19.130 +      return ((!e.backward) ? this->graph->target(e) : this->graph->source(e)); }
  19.131  
  19.132      /// Gives back the opposite edge.
  19.133      Edge opposite(const Edge& e) const { 
  19.134 @@ -1413,7 +1413,7 @@
  19.135  //       i=OutEdgeIt(*this, p); return i;
  19.136  //     }
  19.137      void erase(const Edge& e) const {
  19.138 -      Node n=tail(e);
  19.139 +      Node n=source(e);
  19.140        typename Graph::OutEdgeIt f(*Parent::graph, n);
  19.141        ++f;
  19.142        first_out_edges->set(n, f);
    20.1 --- a/src/lemon/kruskal.h	Sat Nov 13 12:24:01 2004 +0000
    20.2 +++ b/src/lemon/kruskal.h	Sat Nov 13 12:53:28 2004 +0000
    20.3 @@ -82,8 +82,8 @@
    20.4      EdgeCost tot_cost = 0;
    20.5      for (typename IN::const_iterator p = in.begin(); 
    20.6  	 p!=in.end(); ++p ) {
    20.7 -      if ( uf.join(G.head((*p).first),
    20.8 -		   G.tail((*p).first)) ) {
    20.9 +      if ( uf.join(G.target((*p).first),
   20.10 +		   G.source((*p).first)) ) {
   20.11  	out.set((*p).first, true);
   20.12  	tot_cost += (*p).second;
   20.13        }
    21.1 --- a/src/lemon/list_graph.h	Sat Nov 13 12:24:01 2004 +0000
    21.2 +++ b/src/lemon/list_graph.h	Sat Nov 13 12:53:28 2004 +0000
    21.3 @@ -43,7 +43,7 @@
    21.4      };
    21.5   
    21.6      struct EdgeT {
    21.7 -      int head, tail;
    21.8 +      int target, source;
    21.9        int prev_in, prev_out;
   21.10        int next_in, next_out;
   21.11      };
   21.12 @@ -111,8 +111,8 @@
   21.13      ///\sa id(Edge)
   21.14      int maxId(Edge = INVALID) const { return edges.size()-1; }
   21.15  
   21.16 -    Node tail(Edge e) const { return edges[e.id].tail; }
   21.17 -    Node head(Edge e) const { return edges[e.id].head; }
   21.18 +    Node source(Edge e) const { return edges[e.id].source; }
   21.19 +    Node target(Edge e) const { return edges[e.id].target; }
   21.20  
   21.21  
   21.22      void first(Node& node) const { 
   21.23 @@ -137,7 +137,7 @@
   21.24  	edge.id = edges[edge.id].next_in;
   21.25        } else {
   21.26  	int n;
   21.27 -	for(n = nodes[edges[edge.id].head].next;
   21.28 +	for(n = nodes[edges[edge.id].target].next;
   21.29  	  n!=-1 && nodes[n].first_in == -1; 
   21.30  	  n = nodes[n].next);
   21.31  	edge.id = (n == -1) ? -1 : nodes[n].first_in;
   21.32 @@ -198,8 +198,8 @@
   21.33  	first_free_edge = edges[n].next_in;
   21.34        }
   21.35        
   21.36 -      edges[n].tail = u.id; 
   21.37 -      edges[n].head = v.id;
   21.38 +      edges[n].source = u.id; 
   21.39 +      edges[n].target = v.id;
   21.40  
   21.41        edges[n].next_out = nodes[u.id].first_out;
   21.42        if(nodes[u.id].first_out != -1) {
   21.43 @@ -246,7 +246,7 @@
   21.44        if(edges[n].prev_in!=-1) {
   21.45  	edges[edges[n].prev_in].next_in = edges[n].next_in;
   21.46        } else {
   21.47 -	nodes[edges[n].head].first_in = edges[n].next_in;
   21.48 +	nodes[edges[n].target].first_in = edges[n].next_in;
   21.49        }
   21.50  
   21.51        
   21.52 @@ -257,7 +257,7 @@
   21.53        if(edges[n].prev_out!=-1) {
   21.54  	edges[edges[n].prev_out].next_out = edges[n].next_out;
   21.55        } else {
   21.56 -	nodes[edges[n].tail].first_out = edges[n].next_out;
   21.57 +	nodes[edges[n].source].first_out = edges[n].next_out;
   21.58        }
   21.59        
   21.60        edges[n].next_in = first_free_edge;
   21.61 @@ -272,26 +272,26 @@
   21.62      }
   21.63  
   21.64    protected:
   21.65 -    void _moveHead(Edge e, Node n) 
   21.66 +    void _moveTarget(Edge e, Node n) 
   21.67      {
   21.68        if(edges[e.id].next_in != -1)
   21.69  	edges[edges[e.id].next_in].prev_in = edges[e.id].prev_in;
   21.70        if(edges[e.id].prev_in != -1)
   21.71  	edges[edges[e.id].prev_in].next_in = edges[e.id].next_in;
   21.72 -      else nodes[edges[e.id].head].first_in = edges[e.id].next_in;
   21.73 -      edges[e.id].head = n.id;
   21.74 +      else nodes[edges[e.id].target].first_in = edges[e.id].next_in;
   21.75 +      edges[e.id].target = n.id;
   21.76        edges[e.id].prev_in = -1;
   21.77        edges[e.id].next_in = nodes[n.id].first_in;
   21.78        nodes[n.id].first_in = e.id;
   21.79      }
   21.80 -    void _moveTail(Edge e, Node n) 
   21.81 +    void _moveSource(Edge e, Node n) 
   21.82      {
   21.83        if(edges[e.id].next_out != -1)
   21.84  	edges[edges[e.id].next_out].prev_out = edges[e.id].prev_out;
   21.85        if(edges[e.id].prev_out != -1)
   21.86  	edges[edges[e.id].prev_out].next_out = edges[e.id].next_out;
   21.87 -      else nodes[edges[e.id].tail].first_out = edges[e.id].next_out;
   21.88 -      edges[e.id].tail = n.id;
   21.89 +      else nodes[edges[e.id].source].first_out = edges[e.id].next_out;
   21.90 +      edges[e.id].source = n.id;
   21.91        edges[e.id].prev_out = -1;
   21.92        edges[e.id].next_out = nodes[n.id].first_out;
   21.93        nodes[n.id].first_out = e.id;
   21.94 @@ -320,16 +320,16 @@
   21.95    class ListGraph : public ErasableListGraphBase 
   21.96    {
   21.97    public:
   21.98 -    /// Moves the head of \c e to \c n
   21.99 +    /// Moves the target of \c e to \c n
  21.100  
  21.101 -    /// Moves the head of \c e to \c n
  21.102 +    /// Moves the target of \c e to \c n
  21.103      ///
  21.104 -    void moveHead(Edge e, Node n) { _moveHead(e,n); }
  21.105 -    /// Moves the tail of \c e to \c n
  21.106 +    void moveTarget(Edge e, Node n) { _moveTarget(e,n); }
  21.107 +    /// Moves the source of \c e to \c n
  21.108  
  21.109 -    /// Moves the tail of \c e to \c n
  21.110 +    /// Moves the source of \c e to \c n
  21.111      ///
  21.112 -    void moveTail(Edge e, Node n) { _moveTail(e,n); }
  21.113 +    void moveSource(Edge e, Node n) { _moveSource(e,n); }
  21.114  
  21.115      ///Using this it possible to avoid the superfluous memory allocation.
  21.116      ///\todo more docs...
    22.1 --- a/src/lemon/min_cost_flow.h	Sat Nov 13 12:24:01 2004 +0000
    22.2 +++ b/src/lemon/min_cost_flow.h	Sat Nov 13 12:53:28 2004 +0000
    22.3 @@ -103,9 +103,9 @@
    22.4  	
    22.5        ValueType operator[](typename ResGW::Edge e) const {     
    22.6  	if (g.forward(e))
    22.7 -	  return  length[e]-(pot[g.head(e)]-pot[g.tail(e)]);   
    22.8 +	  return  length[e]-(pot[g.target(e)]-pot[g.source(e)]);   
    22.9  	else
   22.10 -	  return -length[e]-(pot[g.head(e)]-pot[g.tail(e)]);   
   22.11 +	  return -length[e]-(pot[g.target(e)]-pot[g.source(e)]);   
   22.12        }     
   22.13  	
   22.14      }; //ModLengthMap
   22.15 @@ -235,7 +235,7 @@
   22.16        Length fl_e;
   22.17          for(typename Graph::EdgeIt e(g); e!=INVALID; ++e) {
   22.18  	//C^{\Pi}_{i,j}
   22.19 -	mod_pot = length[e]-potential[g.head(e)]+potential[g.tail(e)];
   22.20 +	mod_pot = length[e]-potential[g.target(e)]+potential[g.source(e)];
   22.21  	fl_e = flow[e];
   22.22  	if (0<fl_e && fl_e<capacity[e]) {
   22.23  	  /// \todo better comparison is needed for real types, moreover, 
    23.1 --- a/src/lemon/path.h	Sat Nov 13 12:24:01 2004 +0000
    23.2 +++ b/src/lemon/path.h	Sat Nov 13 12:53:28 2004 +0000
    23.3 @@ -111,15 +111,15 @@
    23.4      ///
    23.5      /// Starting point of the path.
    23.6      /// Returns INVALID if the path is empty.
    23.7 -    GraphNode tail() const {
    23.8 -      return empty() ? INVALID : gr->tail(edges[0]);
    23.9 +    GraphNode source() const {
   23.10 +      return empty() ? INVALID : gr->source(edges[0]);
   23.11      }
   23.12      /// \brief End point of the path.
   23.13      ///
   23.14      /// End point of the path.
   23.15      /// Returns INVALID if the path is empty.
   23.16 -    GraphNode head() const {
   23.17 -      return empty() ? INVALID : gr->head(edges[length()-1]);
   23.18 +    GraphNode target() const {
   23.19 +      return empty() ? INVALID : gr->target(edges[length()-1]);
   23.20      }
   23.21  
   23.22      /// \brief Initializes node or edge iterator to point to the first
   23.23 @@ -139,15 +139,15 @@
   23.24        return i=EdgeIt(*this, n);
   23.25      }
   23.26  
   23.27 -    /// \brief Returns node iterator pointing to the head node of the
   23.28 +    /// \brief Returns node iterator pointing to the target node of the
   23.29      /// given edge iterator.
   23.30 -    NodeIt head(const EdgeIt& e) const {
   23.31 +    NodeIt target(const EdgeIt& e) const {
   23.32        return NodeIt(*this, e.idx+1);
   23.33      }
   23.34  
   23.35 -    /// \brief Returns node iterator pointing to the tail node of the
   23.36 +    /// \brief Returns node iterator pointing to the source node of the
   23.37      /// given edge iterator.
   23.38 -    NodeIt tail(const EdgeIt& e) const {
   23.39 +    NodeIt source(const EdgeIt& e) const {
   23.40        return NodeIt(*this, e.idx);
   23.41      }
   23.42  
   23.43 @@ -230,9 +230,9 @@
   23.44        ///Conversion to Graph::Node
   23.45        operator const GraphNode& () const {
   23.46  	if(idx >= p->length())
   23.47 -	  return p->head();
   23.48 +	  return p->target();
   23.49  	else if(idx >= 0)
   23.50 -	  return p->gr->tail(p->edges[idx]);
   23.51 +	  return p->gr->source(p->edges[idx]);
   23.52  	else
   23.53  	  return INVALID;
   23.54        }
   23.55 @@ -335,23 +335,23 @@
   23.56  	return front.empty() && back.empty() && P.empty();
   23.57        }
   23.58  
   23.59 -      GraphNode tail() const {
   23.60 +      GraphNode source() const {
   23.61  	if( ! front.empty() )
   23.62 -	  return P.gr->tail(front[front.size()-1]);
   23.63 +	  return P.gr->source(front[front.size()-1]);
   23.64  	else if( ! P.empty() )
   23.65 -	  return P.gr->tail(P.edges[0]);
   23.66 +	  return P.gr->source(P.edges[0]);
   23.67  	else if( ! back.empty() )
   23.68 -	  return P.gr->tail(back[0]);
   23.69 +	  return P.gr->source(back[0]);
   23.70  	else
   23.71  	  return INVALID;
   23.72        }
   23.73 -      GraphNode head() const {
   23.74 +      GraphNode target() const {
   23.75  	if( ! back.empty() )
   23.76 -	  return P.gr->head(back[back.size()-1]);
   23.77 +	  return P.gr->target(back[back.size()-1]);
   23.78  	else if( ! P.empty() )
   23.79 -	  return P.gr->head(P.edges[P.length()-1]);
   23.80 +	  return P.gr->target(P.edges[P.length()-1]);
   23.81  	else if( ! front.empty() )
   23.82 -	  return P.gr->head(front[0]);
   23.83 +	  return P.gr->target(front[0]);
   23.84  	else
   23.85  	  return INVALID;
   23.86        }
   23.87 @@ -437,15 +437,15 @@
   23.88      ///
   23.89      /// Starting point of the path.
   23.90      /// Returns INVALID if the path is empty.
   23.91 -    GraphNode tail() const {
   23.92 -      return empty() ? INVALID : gr->tail(edges[0]);
   23.93 +    GraphNode source() const {
   23.94 +      return empty() ? INVALID : gr->source(edges[0]);
   23.95      }
   23.96      /// \brief End point of the path.
   23.97      ///
   23.98      /// End point of the path.
   23.99      /// Returns INVALID if the path is empty.
  23.100 -    GraphNode head() const {
  23.101 -      return empty() ? INVALID : gr->head(edges[length()-1]);
  23.102 +    GraphNode target() const {
  23.103 +      return empty() ? INVALID : gr->target(edges[length()-1]);
  23.104      }
  23.105  
  23.106      /// \brief Initializes node or edge iterator to point to the first
  23.107 @@ -477,15 +477,15 @@
  23.108        return ++e;
  23.109      }
  23.110  
  23.111 -    /// \brief Returns node iterator pointing to the head node of the
  23.112 +    /// \brief Returns node iterator pointing to the target node of the
  23.113      /// given edge iterator.
  23.114 -    NodeIt head(const EdgeIt& e) const {
  23.115 +    NodeIt target(const EdgeIt& e) const {
  23.116        return NodeIt(*this, e.idx+1);
  23.117      }
  23.118  
  23.119 -    /// \brief Returns node iterator pointing to the tail node of the
  23.120 +    /// \brief Returns node iterator pointing to the source node of the
  23.121      /// given edge iterator.
  23.122 -    NodeIt tail(const EdgeIt& e) const {
  23.123 +    NodeIt source(const EdgeIt& e) const {
  23.124        return NodeIt(*this, e.idx);
  23.125      }
  23.126  
  23.127 @@ -570,9 +570,9 @@
  23.128        ///Conversion to Graph::Node
  23.129        operator const GraphNode& () const {
  23.130  	if(idx >= p->length())
  23.131 -	  return p->head();
  23.132 +	  return p->target();
  23.133  	else if(idx >= 0)
  23.134 -	  return p->gr->tail(p->edges[idx]);
  23.135 +	  return p->gr->source(p->edges[idx]);
  23.136  	else
  23.137  	  return INVALID;
  23.138        }
  23.139 @@ -676,23 +676,23 @@
  23.140  	return front.empty() && back.empty() && P.empty();
  23.141        }
  23.142  
  23.143 -      GraphNode tail() const {
  23.144 +      GraphNode source() const {
  23.145  	if( ! front.empty() )
  23.146 -	  return P.gr->tail(front[front.size()-1]);
  23.147 +	  return P.gr->source(front[front.size()-1]);
  23.148  	else if( ! P.empty() )
  23.149 -	  return P.gr->tail(P.edges[0]);
  23.150 +	  return P.gr->source(P.edges[0]);
  23.151  	else if( ! back.empty() )
  23.152 -	  return P.gr->tail(back[0]);
  23.153 +	  return P.gr->source(back[0]);
  23.154  	else
  23.155  	  return INVALID;
  23.156        }
  23.157 -      GraphNode head() const {
  23.158 +      GraphNode target() const {
  23.159  	if( ! back.empty() )
  23.160 -	  return P.gr->head(back[back.size()-1]);
  23.161 +	  return P.gr->target(back[back.size()-1]);
  23.162  	else if( ! P.empty() )
  23.163 -	  return P.gr->head(P.edges[P.length()-1]);
  23.164 +	  return P.gr->target(P.edges[P.length()-1]);
  23.165  	else if( ! front.empty() )
  23.166 -	  return P.gr->head(front[0]);
  23.167 +	  return P.gr->target(front[0]);
  23.168  	else
  23.169  	  return INVALID;
  23.170        }
    24.1 --- a/src/lemon/preflow.h	Sat Nov 13 12:24:01 2004 +0000
    24.2 +++ b/src/lemon/preflow.h	Sat Nov 13 12:53:28 2004 +0000
    24.3 @@ -305,7 +305,7 @@
    24.4  
    24.5  	for(InEdgeIt e(*g,v); e!=INVALID; ++e) {
    24.6  	  if ( (*capacity)[e] <= (*flow)[e] ) continue;
    24.7 -	  Node u=g->tail(e);
    24.8 +	  Node u=g->source(e);
    24.9  	  if ( level[u] >= n ) {
   24.10  	    bfs_queue.push(u);
   24.11  	    level.set(u, l);
   24.12 @@ -318,7 +318,7 @@
   24.13  
   24.14  	for(OutEdgeIt e(*g,v); e!=INVALID; ++e) {
   24.15  	  if ( 0 >= (*flow)[e] ) continue;
   24.16 -	  Node u=g->head(e);
   24.17 +	  Node u=g->target(e);
   24.18  	  if ( level[u] >= n ) {
   24.19  	    bfs_queue.push(u);
   24.20  	    level.set(u, l);
   24.21 @@ -410,7 +410,7 @@
   24.22  	queue.pop();
   24.23  	
   24.24  	for(OutEdgeIt e(*g,w) ; e!=INVALID; ++e) {
   24.25 -	  Node v=g->head(e);
   24.26 +	  Node v=g->target(e);
   24.27  	  if (!M[v] && (*flow)[e] < (*capacity)[e] ) {
   24.28  	    queue.push(v);
   24.29  	    M.set(v, true);
   24.30 @@ -418,7 +418,7 @@
   24.31  	}
   24.32  	
   24.33  	for(InEdgeIt e(*g,w) ; e!=INVALID; ++e) {
   24.34 -	  Node v=g->tail(e);
   24.35 +	  Node v=g->source(e);
   24.36  	  if (!M[v] && (*flow)[e] > 0 ) {
   24.37  	    queue.push(v);
   24.38  	    M.set(v, true);
   24.39 @@ -448,7 +448,7 @@
   24.40  	queue.pop();
   24.41  
   24.42  	for(InEdgeIt e(*g,w) ; e!=INVALID; ++e) {
   24.43 -	  Node v=g->tail(e);
   24.44 +	  Node v=g->source(e);
   24.45  	  if (M[v] && (*flow)[e] < (*capacity)[e] ) {
   24.46  	    queue.push(v);
   24.47  	    M.set(v, false);
   24.48 @@ -456,7 +456,7 @@
   24.49  	}
   24.50  
   24.51  	for(OutEdgeIt e(*g,w) ; e!=INVALID; ++e) {
   24.52 -	  Node v=g->head(e);
   24.53 +	  Node v=g->target(e);
   24.54  	  if (M[v] && (*flow)[e] > 0 ) {
   24.55  	    queue.push(v);
   24.56  	    M.set(v, false);
   24.57 @@ -515,7 +515,7 @@
   24.58  
   24.59        for(OutEdgeIt e(*g,w) ; e!=INVALID; ++e) {
   24.60  	if ( (*flow)[e] >= (*capacity)[e] ) continue;
   24.61 -	Node v=g->head(e);
   24.62 +	Node v=g->target(e);
   24.63  
   24.64  	if( lev > level[v] ) { //Push is allowed now
   24.65  	  
   24.66 @@ -547,7 +547,7 @@
   24.67  	for(InEdgeIt e(*g,w) ; e!=INVALID; ++e) {
   24.68  	  
   24.69  	  if( (*flow)[e] <= 0 ) continue;
   24.70 -	  Node v=g->tail(e);
   24.71 +	  Node v=g->source(e);
   24.72  
   24.73  	  if( lev > level[v] ) { //Push is allowed now
   24.74  
   24.75 @@ -602,7 +602,7 @@
   24.76  	  
   24.77  	  for(InEdgeIt e(*g,v) ; e!=INVALID; ++e) {
   24.78  	    if ( (*capacity)[e] <= (*flow)[e] ) continue;
   24.79 -	    Node w=g->tail(e);
   24.80 +	    Node w=g->source(e);
   24.81  	    if ( level[w] == n && w != s ) {
   24.82  	      bfs_queue.push(w);
   24.83  	      Node z=level_list[l];
   24.84 @@ -615,7 +615,7 @@
   24.85  	  
   24.86  	  for(OutEdgeIt e(*g,v) ; e!=INVALID; ++e) {
   24.87  	    if ( 0 >= (*flow)[e] ) continue;
   24.88 -	    Node w=g->head(e);
   24.89 +	    Node w=g->target(e);
   24.90  	    if ( level[w] == n && w != s ) {
   24.91  	      bfs_queue.push(w);
   24.92  	      Node z=level_list[l];
   24.93 @@ -646,7 +646,7 @@
   24.94  	  int l=level[v]+1;
   24.95  	  
   24.96  	  for(InEdgeIt e(*g,v) ; e!=INVALID; ++e) {
   24.97 -	    Node w=g->tail(e);
   24.98 +	    Node w=g->source(e);
   24.99  	    if ( level[w] == n && w != s ) {
  24.100  	      bfs_queue.push(w);
  24.101  	      Node z=level_list[l];
  24.102 @@ -662,7 +662,7 @@
  24.103  	for(OutEdgeIt e(*g,s) ; e!=INVALID; ++e) {
  24.104  	  Num c=(*capacity)[e];
  24.105  	  if ( c <= 0 ) continue;
  24.106 -	  Node w=g->head(e);
  24.107 +	  Node w=g->target(e);
  24.108  	  if ( level[w] < n ) {
  24.109  	    if ( excess[w] <= 0 && w!=t ) { //putting into the stack
  24.110  	      next.set(w,first[level[w]]);
  24.111 @@ -687,7 +687,7 @@
  24.112  	for(OutEdgeIt e(*g,s); e!=INVALID; ++e)	{
  24.113  	  Num rem=(*capacity)[e]-(*flow)[e];
  24.114  	  if ( rem <= 0 ) continue;
  24.115 -	  Node w=g->head(e);
  24.116 +	  Node w=g->target(e);
  24.117  	  if ( level[w] < n ) {
  24.118  	    if ( excess[w] <= 0 && w!=t ) { //putting into the stack
  24.119  	      next.set(w,first[level[w]]);
  24.120 @@ -700,7 +700,7 @@
  24.121  	
  24.122  	for(InEdgeIt e(*g,s); e!=INVALID; ++e) {
  24.123  	  if ( (*flow)[e] <= 0 ) continue;
  24.124 -	  Node w=g->tail(e);
  24.125 +	  Node w=g->source(e);
  24.126  	  if ( level[w] < n ) {
  24.127  	    if ( excess[w] <= 0 && w!=t ) {
  24.128  	      next.set(w,first[level[w]]);
  24.129 @@ -717,13 +717,13 @@
  24.130  	for(OutEdgeIt e(*g,s) ; e!=INVALID; ++e) {
  24.131  	  Num rem=(*capacity)[e]-(*flow)[e];
  24.132  	  if ( rem <= 0 ) continue;
  24.133 -	  Node w=g->head(e);
  24.134 +	  Node w=g->target(e);
  24.135  	  if ( level[w] < n ) flow->set(e, (*capacity)[e]);
  24.136  	}
  24.137  	
  24.138  	for(InEdgeIt e(*g,s) ; e!=INVALID; ++e) {
  24.139  	  if ( (*flow)[e] <= 0 ) continue;
  24.140 -	  Node w=g->tail(e);
  24.141 +	  Node w=g->source(e);
  24.142  	  if ( level[w] < n ) flow->set(e, 0);
  24.143  	}
  24.144  	
    25.1 --- a/src/lemon/smart_graph.h	Sat Nov 13 12:24:01 2004 +0000
    25.2 +++ b/src/lemon/smart_graph.h	Sat Nov 13 12:53:28 2004 +0000
    25.3 @@ -55,7 +55,7 @@
    25.4      };
    25.5      struct EdgeT 
    25.6      {
    25.7 -      int head, tail, next_in, next_out;      
    25.8 +      int target, source, next_in, next_out;      
    25.9        //FIXME: is this necessary?
   25.10        EdgeT() : next_in(-1), next_out(-1) {}  
   25.11      };
   25.12 @@ -97,8 +97,8 @@
   25.13      ///\sa id(Edge)
   25.14      int maxId(Edge = INVALID) const { return edges.size()-1; }
   25.15  
   25.16 -    Node tail(Edge e) const { return edges[e.n].tail; }
   25.17 -    Node head(Edge e) const { return edges[e.n].head; }
   25.18 +    Node source(Edge e) const { return edges[e.n].source; }
   25.19 +    Node target(Edge e) const { return edges[e.n].target; }
   25.20  
   25.21      /// Node ID.
   25.22      
   25.23 @@ -127,7 +127,7 @@
   25.24      
   25.25      Edge addEdge(Node u, Node v) {
   25.26        Edge e; e.n=edges.size(); edges.push_back(EdgeT()); //FIXME: Hmmm...
   25.27 -      edges[e.n].tail=u.n; edges[e.n].head=v.n;
   25.28 +      edges[e.n].source=u.n; edges[e.n].target=v.n;
   25.29        edges[e.n].next_out=nodes[u.n].first_out;
   25.30        edges[e.n].next_in=nodes[v.n].first_in;
   25.31        nodes[u.n].first_out=nodes[v.n].first_in=e.n;
   25.32 @@ -211,7 +211,7 @@
   25.33      Edge _findEdge(Node u,Node v, Edge prev = INVALID) 
   25.34      {
   25.35        int e = (prev.n==-1)? nodes[u.n].first_out : edges[prev.n].next_out;
   25.36 -      while(e!=-1 && edges[e].tail!=v.n) e = edges[e].next_out;
   25.37 +      while(e!=-1 && edges[e].source!=v.n) e = edges[e].next_out;
   25.38        prev.n=e;
   25.39        return prev;
   25.40      }
   25.41 @@ -307,8 +307,8 @@
   25.42      {
   25.43        while(s.edge_num>edges.size()) {
   25.44  	edge_observers.erase(Edge(edges.size()-1));
   25.45 -	nodes[edges.back().head].first_in=edges.back().next_in;
   25.46 -	nodes[edges.back().tail].first_out=edges.back().next_out;
   25.47 +	nodes[edges.back().target].first_in=edges.back().next_in;
   25.48 +	nodes[edges.back().source].first_out=edges.back().next_out;
   25.49  	edges.pop_back();
   25.50        }
   25.51        //nodes.resize(s.nodes_num);
    26.1 --- a/src/lemon/suurballe.h	Sat Nov 13 12:24:01 2004 +0000
    26.2 +++ b/src/lemon/suurballe.h	Sat Nov 13 12:53:28 2004 +0000
    26.3 @@ -133,7 +133,7 @@
    26.4  	  while (!reversed[e]){
    26.5  	    ++e;
    26.6  	  }
    26.7 -	  n = G.head(e);
    26.8 +	  n = G.target(e);
    26.9  	  paths[j].push_back(e);
   26.10  	  //total_length += length[e];
   26.11  	  reversed[e] = 1-reversed[e];
    27.1 --- a/src/lemon/undir_graph_extender.h	Sat Nov 13 12:24:01 2004 +0000
    27.2 +++ b/src/lemon/undir_graph_extender.h	Sat Nov 13 12:53:28 2004 +0000
    27.3 @@ -70,23 +70,23 @@
    27.4        return Edge(e,!e.forward);
    27.5      }
    27.6  
    27.7 -    /// Tail of the given Edge.
    27.8 -    Node tail(const Edge &e) const {
    27.9 -      return e.forward ? Parent::tail(e) : Parent::head(e);
   27.10 +    /// Source of the given Edge.
   27.11 +    Node source(const Edge &e) const {
   27.12 +      return e.forward ? Parent::source(e) : Parent::target(e);
   27.13      }
   27.14  
   27.15 -    /// \todo Shouldn't the "tail" of an undirected edge be called "aNode"
   27.16 +    /// \todo Shouldn't the "source" of an undirected edge be called "aNode"
   27.17      /// or something???
   27.18 -    using Parent::tail;
   27.19 +    using Parent::source;
   27.20  
   27.21 -    /// Head of the given Edge.
   27.22 -    Node head(const Edge &e) const {
   27.23 -      return e.forward ? Parent::head(e) : Parent::tail(e);
   27.24 +    /// Target of the given Edge.
   27.25 +    Node target(const Edge &e) const {
   27.26 +      return e.forward ? Parent::target(e) : Parent::source(e);
   27.27      }
   27.28  
   27.29 -    /// \todo Shouldn't the "head" of an undirected edge be called "bNode"
   27.30 +    /// \todo Shouldn't the "target" of an undirected edge be called "bNode"
   27.31      /// or something???
   27.32 -    using Parent::head;
   27.33 +    using Parent::target;
   27.34  
   27.35      /// Returns whether the given directed edge is same orientation as the
   27.36      /// corresponding undirected edge.
   27.37 @@ -96,10 +96,10 @@
   27.38      bool forward(const Edge &e) const { return e.forward; }
   27.39  
   27.40      Node oppsiteNode(const Node &n, const Edge &e) const {
   27.41 -      if( n == Parent::tail(e))
   27.42 -	return Parent::head(e);
   27.43 -      else if( n == Parent::head(e))
   27.44 -	return Parent::tail(e);
   27.45 +      if( n == Parent::source(e))
   27.46 +	return Parent::target(e);
   27.47 +      else if( n == Parent::target(e))
   27.48 +	return Parent::source(e);
   27.49        else
   27.50  	return INVALID;
   27.51      }
   27.52 @@ -147,7 +147,7 @@
   27.53        if( e.forward ) {
   27.54  	Parent::nextOut(e);
   27.55  	if( UndirEdge(e) == INVALID ) {
   27.56 -	  Parent::firstIn(e, Parent::tail(e));
   27.57 +	  Parent::firstIn(e, Parent::source(e));
   27.58  	  e.forward = false;
   27.59  	}
   27.60        }
   27.61 @@ -159,7 +159,7 @@
   27.62        if( e.forward ) {
   27.63  	Parent::nextIn(e);
   27.64  	if( UndirEdge(e) == INVALID ) {
   27.65 -	  Parent::firstOut(e, Parent::head(e));
   27.66 +	  Parent::firstOut(e, Parent::target(e));
   27.67  	  e.forward = false;
   27.68  	}
   27.69        }
    28.1 --- a/src/test/bfs_test.cc	Sat Nov 13 12:24:01 2004 +0000
    28.2 +++ b/src/test/bfs_test.cc	Sat Nov 13 12:53:28 2004 +0000
    28.3 @@ -83,8 +83,8 @@
    28.4  
    28.5  
    28.6    for(EdgeIt e(G); e==INVALID; ++e) {
    28.7 -    Node u=G.tail(e);
    28.8 -    Node v=G.head(e);
    28.9 +    Node u=G.source(e);
   28.10 +    Node v=G.target(e);
   28.11      check( !bfs_test.reached(u) ||
   28.12  	   (bfs_test.dist(v) > bfs_test.dist(u)+1),
   28.13  	   "Wrong output.");
   28.14 @@ -94,7 +94,7 @@
   28.15      check(bfs_test.reached(v),"Each node should be reached.");
   28.16      if ( bfs_test.pred(v)!=INVALID ) {
   28.17        Edge e=bfs_test.pred(v);
   28.18 -      Node u=G.tail(e);
   28.19 +      Node u=G.source(e);
   28.20        check(u==bfs_test.predNode(v),"Wrong tree.");
   28.21        check(bfs_test.dist(v) - bfs_test.dist(u) == 1,
   28.22  	    "Wrong distance. Difference: " 
    29.1 --- a/src/test/dfs_test.cc	Sat Nov 13 12:24:01 2004 +0000
    29.2 +++ b/src/test/dfs_test.cc	Sat Nov 13 12:53:28 2004 +0000
    29.3 @@ -83,7 +83,7 @@
    29.4      check(dfs_test.reached(v),"Each node should be reached.");
    29.5      if ( dfs_test.pred(v)!=INVALID ) {
    29.6        Edge e=dfs_test.pred(v);
    29.7 -      Node u=G.tail(e);
    29.8 +      Node u=G.source(e);
    29.9        check(u==dfs_test.predNode(v),"Wrong tree.");
   29.10        check(dfs_test.dist(v) - dfs_test.dist(u) == 1,
   29.11  	    "Wrong distance." << dfs_test.dist(v) << " " <<dfs_test.dist(u) );
    30.1 --- a/src/test/dijkstra_heap_test.cc	Sat Nov 13 12:24:01 2004 +0000
    30.2 +++ b/src/test/dijkstra_heap_test.cc	Sat Nov 13 12:53:28 2004 +0000
    30.3 @@ -73,11 +73,11 @@
    30.4  
    30.5    EdgeIt e;
    30.6    for(G.first(e); e!=INVALID; ++e) {
    30.7 -    Node u=G.tail(e);
    30.8 -    Node v=G.head(e);
    30.9 +    Node u=G.source(e);
   30.10 +    Node v=G.target(e);
   30.11      if ( dijkstra_test.dist(v) - dijkstra_test.dist(u) > cap[e] )
   30.12        if ( dijkstra_test.reached(u) ) {
   30.13 -	std::cout<<"Error! dist(head)-dist(tail)- edge_length= " 
   30.14 +	std::cout<<"Error! dist(target)-dist(source)- edge_length= " 
   30.15  		 <<dijkstra_test.dist(v) - dijkstra_test.dist(u) 
   30.16  	  - cap[e]<<std::endl;
   30.17  	++error1;
   30.18 @@ -88,7 +88,7 @@
   30.19    for(G.first(v); v!=INVALID; ++v) {
   30.20      if ( dijkstra_test.reached(v) ) {
   30.21        Edge e=dijkstra_test.pred(v);
   30.22 -      Node u=G.tail(e);
   30.23 +      Node u=G.source(e);
   30.24        if ( dijkstra_test.dist(v) - dijkstra_test.dist(u) != cap[e] ) {
   30.25  	std::cout<<"Error in a shortest path tree edge! Difference: " 
   30.26  		 <<std::abs(dijkstra_test.dist(v) - dijkstra_test.dist(u) 
   30.27 @@ -122,11 +122,11 @@
   30.28    error2=0;
   30.29  
   30.30    for(G.first(e); e!=INVALID; ++e) {
   30.31 -    Node u=G.tail(e);
   30.32 -    Node v=G.head(e);
   30.33 +    Node u=G.source(e);
   30.34 +    Node v=G.target(e);
   30.35      if ( dijkstra_test2.dist(v) - dijkstra_test2.dist(u) > cap[e] )
   30.36        if ( dijkstra_test2.reached(u) ) {
   30.37 -	std::cout<<"Error! dist(head)-dist(tail)- edge_length= " 
   30.38 +	std::cout<<"Error! dist(target)-dist(source)- edge_length= " 
   30.39  		 <<dijkstra_test2.dist(v) - dijkstra_test2.dist(u) 
   30.40  	  - cap[e]<<std::endl;
   30.41  	++error1;
   30.42 @@ -136,7 +136,7 @@
   30.43    for(G.first(v); v!=INVALID; ++v) {
   30.44      if ( dijkstra_test2.reached(v) ) {
   30.45        Edge e=dijkstra_test2.pred(v);
   30.46 -      Node u=G.tail(e);
   30.47 +      Node u=G.source(e);
   30.48        if ( dijkstra_test2.dist(v) - dijkstra_test2.dist(u) != cap[e] ) {
   30.49  	std::cout<<"Error in a shortest path tree edge! Difference: " 
   30.50  		 <<std::abs(dijkstra_test2.dist(v) - dijkstra_test2.dist(u) 
    31.1 --- a/src/test/dijkstra_test.cc	Sat Nov 13 12:24:01 2004 +0000
    31.2 +++ b/src/test/dijkstra_test.cc	Sat Nov 13 12:53:28 2004 +0000
    31.3 @@ -93,11 +93,11 @@
    31.4  
    31.5  
    31.6    for(EdgeIt e(G); e!=INVALID; ++e) {
    31.7 -    Node u=G.tail(e);
    31.8 -    Node v=G.head(e);
    31.9 +    Node u=G.source(e);
   31.10 +    Node v=G.target(e);
   31.11      check( !dijkstra_test.reached(u) ||
   31.12  	   (dijkstra_test.dist(v) - dijkstra_test.dist(u) <= cap[e]),
   31.13 -	   "dist(head)-dist(tail)- edge_length= " 
   31.14 +	   "dist(target)-dist(source)- edge_length= " 
   31.15  	   << dijkstra_test.dist(v) - dijkstra_test.dist(u) 
   31.16  	   - cap[e]);
   31.17    }
   31.18 @@ -107,7 +107,7 @@
   31.19      check(dijkstra_test.reached(v),"Each node should be reached.");
   31.20      if ( dijkstra_test.pred(v)!=INVALID ) {
   31.21        Edge e=dijkstra_test.pred(v);
   31.22 -      Node u=G.tail(e);
   31.23 +      Node u=G.source(e);
   31.24        check(u==dijkstra_test.predNode(v),"Wrong tree.");
   31.25        check(dijkstra_test.dist(v) - dijkstra_test.dist(u) == cap[e],
   31.26  	    "Wrong distance! Difference: " 
    32.1 --- a/src/test/graph_factory_test.cc	Sat Nov 13 12:24:01 2004 +0000
    32.2 +++ b/src/test/graph_factory_test.cc	Sat Nov 13 12:53:28 2004 +0000
    32.3 @@ -28,7 +28,7 @@
    32.4  \file
    32.5  This test makes consistency checks of list graph structures.
    32.6  
    32.7 -G.addNode(), G.addEdge(), G.tail(), G.head()
    32.8 +G.addNode(), G.addEdge(), G.source(), G.target()
    32.9  
   32.10  \todo Checks for empty graphs and isolated points.
   32.11  conversion.
   32.12 @@ -48,7 +48,7 @@
   32.13    for(EdgeIt e(G);e!=INVALID;++e) ee.push_back(e);
   32.14  
   32.15    for(typename std::vector<Edge>::iterator p=ee.begin();p!=ee.end();p++)
   32.16 -    G.addEdge(G.head(*p),G.tail(*p));
   32.17 +    G.addEdge(G.target(*p),G.source(*p));
   32.18  }
   32.19  
   32.20  template<class Graph> void checkPetersen(Graph &G)
    33.1 --- a/src/test/graph_test.h	Sat Nov 13 12:24:01 2004 +0000
    33.2 +++ b/src/test/graph_test.h	Sat Nov 13 12:53:28 2004 +0000
    33.3 @@ -53,7 +53,7 @@
    33.4      typename Graph::OutEdgeIt e(G,n);
    33.5      for(int i=0;i<nn;i++) {
    33.6        check(e!=INVALID,"Wrong OutEdge list linking.");
    33.7 -      check(n==G.tail(e), "Wrong OutEdge list linking.");
    33.8 +      check(n==G.source(e), "Wrong OutEdge list linking.");
    33.9        ++e;
   33.10      }
   33.11      check(e==INVALID,"Wrong OutEdge list linking.");
   33.12 @@ -65,7 +65,7 @@
   33.13      typename Graph::InEdgeIt e(G,n);
   33.14      for(int i=0;i<nn;i++) {
   33.15        check(e!=INVALID,"Wrong InEdge list linking.");
   33.16 -      check(n==G.head(e), "Wrong InEdge list linking.");
   33.17 +      check(n==G.target(e), "Wrong InEdge list linking.");
   33.18        ++e;
   33.19      }
   33.20      check(e==INVALID,"Wrong InEdge list linking.");
   33.21 @@ -81,7 +81,7 @@
   33.22    }
   33.23  
   33.24    ///\file
   33.25 -  ///\todo Check head(), tail() as well;
   33.26 +  ///\todo Check target(), source() as well;
   33.27  
   33.28    
   33.29  } //namespace lemon
    34.1 --- a/src/test/path_test.cc	Sat Nov 13 12:24:01 2004 +0000
    34.2 +++ b/src/test/path_test.cc	Sat Nov 13 12:53:28 2004 +0000
    34.3 @@ -47,13 +47,13 @@
    34.4    b=P.empty();                    //bool empty() const {}
    34.5    P.clear();                      //void clear() {}
    34.6  
    34.7 -  gn=P.head();                    //GraphNode/*It*/ head() const {return INVALID;}
    34.8 -  gn=P.tail();                    //GraphNode/*It*/ tail() const {return INVALID;}
    34.9 +  gn=P.target();                    //GraphNode/*It*/ target() const {return INVALID;}
   34.10 +  gn=P.source();                    //GraphNode/*It*/ source() const {return INVALID;}
   34.11  
   34.12    ei=P.first(ei);                 //It& first(It &i) const { return i=It(*this); }
   34.13  
   34.14 -  ni=P.head(ei);                  //NodeIt head(const EdgeIt& e) const {}
   34.15 -  ni=P.tail(ei);                  //NodeIt tail(const EdgeIt& e) const {}
   34.16 +  ni=P.target(ei);                  //NodeIt target(const EdgeIt& e) const {}
   34.17 +  ni=P.source(ei);                  //NodeIt source(const EdgeIt& e) const {}
   34.18  
   34.19  
   34.20    ListGraph lg;
    35.1 --- a/src/test/preflow_test.cc	Sat Nov 13 12:24:01 2004 +0000
    35.2 +++ b/src/test/preflow_test.cc	Sat Nov 13 12:53:28 2004 +0000
    35.3 @@ -67,7 +67,7 @@
    35.4    
    35.5    int c=0;
    35.6    for(SmartGraph::EdgeIt e(g); e!=INVALID; ++e) {
    35.7 -    if (cut[g.tail(e)] && !cut[g.head(e)]) c+=cap[e];
    35.8 +    if (cut[g.source(e)] && !cut[g.target(e)]) c+=cap[e];
    35.9    }
   35.10    return c;
   35.11  }
    36.1 --- a/src/test/sym_graph_test.cc	Sat Nov 13 12:24:01 2004 +0000
    36.2 +++ b/src/test/sym_graph_test.cc	Sat Nov 13 12:53:28 2004 +0000
    36.3 @@ -30,7 +30,7 @@
    36.4  \file
    36.5  This test makes consistency checks of list graph structures.
    36.6  
    36.7 -G.addNode(), G.addEdge(), G.tail(), G.head()
    36.8 +G.addNode(), G.addEdge(), G.source(), G.target()
    36.9  
   36.10  \todo Checks for empty graphs and isolated points.
   36.11  conversion.
    37.1 --- a/src/test/sym_graph_test.h	Sat Nov 13 12:24:01 2004 +0000
    37.2 +++ b/src/test/sym_graph_test.h	Sat Nov 13 12:53:28 2004 +0000
    37.3 @@ -73,8 +73,8 @@
    37.4  	Node n;
    37.5  	SymEdge se;
    37.6  	se=INVALID;
    37.7 -	n=G.tail(se);
    37.8 -	n=G.head(se);
    37.9 +	n=G.source(se);
   37.10 +	n=G.target(se);
   37.11        }
   37.12        // id tests
   37.13        { SymEdge n; int i=G.id(n); i=i; }
   37.14 @@ -174,7 +174,7 @@
   37.15      }
   37.16  
   37.17    ///\file
   37.18 -  ///\todo Check head(), tail() as well;
   37.19 +  ///\todo Check target(), source() as well;
   37.20  
   37.21    
   37.22  } //namespace lemon
    38.1 --- a/src/test/test_tools.h	Sat Nov 13 12:24:01 2004 +0000
    38.2 +++ b/src/test/test_tools.h	Sat Nov 13 12:53:28 2004 +0000
    38.3 @@ -105,7 +105,7 @@
    38.4    for(EdgeIt e(G);e!=INVALID;++e) ee.push_back(e);
    38.5  
    38.6    for(typename std::vector<Edge>::iterator p=ee.begin();p!=ee.end();p++)
    38.7 -    G.addEdge(G.head(*p),G.tail(*p));
    38.8 +    G.addEdge(G.target(*p),G.source(*p));
    38.9  }
   38.10  
   38.11  
    39.1 --- a/src/work/alpar/bfs-named-param.cc	Sat Nov 13 12:24:01 2004 +0000
    39.2 +++ b/src/work/alpar/bfs-named-param.cc	Sat Nov 13 12:53:28 2004 +0000
    39.3 @@ -10,34 +10,39 @@
    39.4  struct _BFS_DEFAULT_VIS {};
    39.5  struct _BFS_CUSTOM_VIS {};
    39.6  
    39.7 -template<class GT,class VT,class DVT,class PNT,class PET,class PT >
    39.8 -class _BFS 
    39.9 +
   39.10 +class _Bfs_Traits 
   39.11 +{
   39.12 +  typedef ListGraph Graph;
   39.13 +}
   39.14 +
   39.15 +template<class T>
   39.16 +class _Bfs 
   39.17  {
   39.18   public:
   39.19 -  typedef GT Graph;
   39.20 -  typedef VT Visited;
   39.21 -  typedef PNT PredNode;
   39.22 -  typedef PET PredEdge;
   39.23 -  typedef PT Priority;
   39.24 -  //  typedef QDT QueueData;
   39.25 +  typedef typename T::Graph Graph;
   39.26 +  typedef typename T::Reached Reached;
   39.27 +  typedef typename T::PredNode PredNode;
   39.28 +  typedef typename T::PredEdge PredEdge;
   39.29 +  typedef typename T::Priority Priority;
   39.30 +  
   39.31 +  typedef typename T::DefaultReachedTag DefaultReachedTag;
   39.32    
   39.33    typedef typename Graph::Node Node;
   39.34    typedef typename Graph::OutEdgeIt OutEdgeIt;
   39.35  
   39.36 -  typedef DVT DefaultVisitedTag;
   39.37 -  
   39.38    const Graph &_graph;
   39.39  
   39.40    Node _source;
   39.41    
   39.42 -  Visited *_visited;
   39.43 +  Reached *_visited;
   39.44    PredNode _predNode;
   39.45    PredEdge _predEdge;
   39.46    Priority _priority;
   39.47  
   39.48 -  _BFS(const Graph &g,
   39.49 +  _Bfs(const Graph &g,
   39.50         Node s,
   39.51 -       Visited *v,
   39.52 +       Reached *v,
   39.53         PredNode &pn,
   39.54         PredEdge &pe,
   39.55         Priority &pr) :_graph(g), _source(s),
   39.56 @@ -45,7 +50,7 @@
   39.57  		     _predNode(pn), _predEdge(pe), _priority(pr) { }
   39.58  
   39.59    
   39.60 -  int run(const _BFS_CUSTOM_VIS &) 
   39.61 +  int run(const _Bfs_CUSTOM_VIS &) 
   39.62    {
   39.63      using namespace std;
   39.64      
   39.65 @@ -63,7 +68,7 @@
   39.66        Node m;
   39.67        Node n=Q[Qt++];
   39.68        for(OutEdgeIt e(_graph,n);e!=INVALID;++e)
   39.69 -	if(!(*_visited)[m=_graph.head(e)]) {
   39.70 +	if(!(*_visited)[m=_graph.target(e)]) {
   39.71  	  Q[Qh++]=m;
   39.72  	  _visited->set(m,true);
   39.73  	  _predNode.set(m,n);
   39.74 @@ -75,44 +80,44 @@
   39.75    }
   39.76    int run(const _BFS_DEFAULT_VIS &) 
   39.77    {
   39.78 -    _visited= new Visited(_graph);
   39.79 +    _visited= new Reached(_graph);
   39.80      int r = run(_BFS_CUSTOM_VIS());
   39.81      delete _visited;
   39.82      return r;
   39.83    }
   39.84 -  int run() { return run(DefaultVisitedTag());}
   39.85 +  int run() { return run(DefaultReachedTag());}
   39.86  
   39.87 -  template<class T> _BFS<Graph,T,_BFS_CUSTOM_VIS,PredNode,PredEdge,Priority>
   39.88 +  template<class T> _Bfs<Graph,T,_BFS_CUSTOM_VIS,PredNode,PredEdge,Priority>
   39.89    setVisitMap(T &t)
   39.90    {
   39.91 -    return _BFS<Graph,T,_BFS_CUSTOM_VIS,PredNode,PredEdge,Priority>
   39.92 +    return _Bfs<Graph,T,_BFS_CUSTOM_VIS,PredNode,PredEdge,Priority>
   39.93        (_graph,_source,&t,_predNode,_predEdge,_priority);
   39.94    }
   39.95  
   39.96    template<class T>
   39.97 -  _BFS<Graph,Visited,DefaultVisitedTag,T,PredEdge,Priority>
   39.98 +  _Bfs<Graph,Reached,DefaultReachedTag,T,PredEdge,Priority>
   39.99    setPredNodeMap(T &t)
  39.100    {
  39.101 -    return _BFS<Graph,Visited,DefaultVisitedTag,T,PredEdge,Priority>
  39.102 +    return _BFS<Graph,Reached,DefaultReachedTag,T,PredEdge,Priority>
  39.103        (_graph,_source,
  39.104         _visited,
  39.105         t,_predEdge,_priority);
  39.106    }
  39.107  
  39.108    template<class T>
  39.109 -  _BFS<Graph,Visited,DefaultVisitedTag,PredNode,T,Priority>
  39.110 +  _BFS<Graph,Reached,DefaultReachedTag,PredNode,T,Priority>
  39.111    setPredEdgeMap(T &t)
  39.112    {
  39.113 -    return _BFS<Graph,Visited,DefaultVisitedTag,PredNode,T,Priority>
  39.114 +    return _BFS<Graph,Reached,DefaultReachedTag,PredNode,T,Priority>
  39.115        (_graph,_source,
  39.116         _visited,
  39.117        _predNode,t,_priority);
  39.118    }
  39.119  
  39.120 -  _BFS<Graph,Visited,DefaultVisitedTag,PredNode,PredEdge,Priority>
  39.121 +  _Bfs<Graph,Reached,DefaultReachedTag,PredNode,PredEdge,Priority>
  39.122    setNothing()
  39.123    {
  39.124 -    return _BFS<Graph,Visited,DefaultVisitedTag,PredNode,PredEdge,Priority>
  39.125 +    return _Bfs<Graph,Reached,DefaultReachedTag,PredNode,PredEdge,Priority>
  39.126        (_graph,_source,
  39.127         _visited,
  39.128         _predNode,_predEdge,_priority);
  39.129 @@ -121,7 +126,7 @@
  39.130  
  39.131  
  39.132  template<class G>
  39.133 -_BFS<G,
  39.134 +_Bfs<G,
  39.135       typename G::template NodeMap<bool>,
  39.136       _BFS_DEFAULT_VIS,
  39.137       NullMap<typename G::Node,typename G::Node>,
  39.138 @@ -131,7 +136,7 @@
  39.139  {
  39.140    //  typename G::template NodeMap<bool> v(g);
  39.141  
  39.142 -  return _BFS < G,
  39.143 +  return _Bfs < G,
  39.144      typename G::template NodeMap<bool>,
  39.145      _BFS_DEFAULT_VIS,
  39.146       NullMap<typename G::Node,typename G::Node>,
  39.147 @@ -146,11 +151,11 @@
  39.148  }
  39.149  
  39.150  
  39.151 -class MyVisitedMap : public SmartGraph::NodeMap<bool>
  39.152 +class MyReachedMap : public SmartGraph::NodeMap<bool>
  39.153  {
  39.154    const SmartGraph &_G;
  39.155  public:
  39.156 -  MyVisitedMap(const SmartGraph &G) : SmartGraph::NodeMap<bool>(G), _G(G) {}
  39.157 +  MyReachedMap(const SmartGraph &G) : SmartGraph::NodeMap<bool>(G), _G(G) {}
  39.158    void set(SmartGraph::Node n,bool b)
  39.159    {
  39.160      SmartGraph::NodeMap<bool>::set(n,b);
  39.161 @@ -180,7 +185,7 @@
  39.162    SmartGraph::NodeMap<SmartGraph::Node> m(G);
  39.163    SmartGraph::NodeMap<SmartGraph::Edge> em(G);
  39.164  
  39.165 -  MyVisitedMap vm(G);
  39.166 +  MyReachedMap vm(G);
  39.167  
  39.168  
  39.169    //Runs BFS on graph 'G' from node 's'.
    40.1 --- a/src/work/alpar/boolmap_iter.cc	Sat Nov 13 12:24:01 2004 +0000
    40.2 +++ b/src/work/alpar/boolmap_iter.cc	Sat Nov 13 12:53:28 2004 +0000
    40.3 @@ -119,13 +119,13 @@
    40.4    std::cout << true << '\n';
    40.5  
    40.6    for(EdgeIt e(G);G.valid(e);G.next(e))
    40.7 -    std::cout << G.id(G.tail(e)) << "->" << G.id(G.head(e))
    40.8 +    std::cout << G.id(G.source(e)) << "->" << G.id(G.target(e))
    40.9        << ": " << map[e] << '\n';
   40.10    std::cout << "True Edges:\n";
   40.11    for(BoolIterEdgeMap<Graph>::TrueIterator i(map);i;++i)
   40.12 -    std::cout << G.id(G.tail(i)) << "->" << G.id(G.head(i)) << '\n';
   40.13 +    std::cout << G.id(G.source(i)) << "->" << G.id(G.target(i)) << '\n';
   40.14    std::cout << "False Edges:\n";
   40.15    for(BoolIterEdgeMap<Graph>::FalseIterator i(map);i;++i)
   40.16 -    std::cout << G.id(G.tail(i)) << "->" << G.id(G.head(i)) << '\n';
   40.17 +    std::cout << G.id(G.source(i)) << "->" << G.id(G.target(i)) << '\n';
   40.18  }
   40.19  
    41.1 --- a/src/work/alpar/dijkstra.h	Sat Nov 13 12:24:01 2004 +0000
    41.2 +++ b/src/work/alpar/dijkstra.h	Sat Nov 13 12:53:28 2004 +0000
    41.3 @@ -393,7 +393,7 @@
    41.4  	
    41.5  	
    41.6  	for(OutEdgeIt e(*G,v); e!=INVALID; ++e) {
    41.7 -	  Node w=G->head(e); 
    41.8 +	  Node w=G->target(e); 
    41.9  	  switch(heap.state(w)) {
   41.10  	  case Heap::PRE_HEAP:
   41.11  	    heap.push(w,oldvalue+(*length)[e]); 
    42.1 --- a/src/work/alpar/f_ed_ka.h	Sat Nov 13 12:24:01 2004 +0000
    42.2 +++ b/src/work/alpar/f_ed_ka.h	Sat Nov 13 12:53:28 2004 +0000
    42.3 @@ -84,17 +84,17 @@
    42.4      aug_val = visited.get(t)==1 ?
    42.5        c.get(tree.get(t))-f.get(tree.get(t)) : f.get(tree.get(t));
    42.6      //FIXME: I would need 'G.opposite(e,n)'
    42.7 -    gn = visited.get(t)==1 ? G.tail(tree.get(t)) : G.head(tree.get(t));
    42.8 +    gn = visited.get(t)==1 ? G.source(tree.get(t)) : G.target(tree.get(t));
    42.9      while(gn!=s) if(visited.get(gn)==1)
   42.10        {
   42.11  	//FIXME: nonstandard gcc extension!
   42.12  	aug_val <?= c.get(tree.get(gn))-f.get(tree.get(gn));
   42.13 -	gn=G.tail(tree.get(gn));
   42.14 +	gn=G.source(tree.get(gn));
   42.15        }
   42.16      else {
   42.17        //FIXME: nonstandard gcc extension!
   42.18        aug_val <?= f.get(tree.get(gn));
   42.19 -      gn=G.head(tree.get(gn));
   42.20 +      gn=G.target(tree.get(gn));
   42.21      }
   42.22  	
   42.23      // The augmentation itself
   42.24 @@ -102,11 +102,11 @@
   42.25      while(gn!=s) if(visited.get(gn)==1)
   42.26        {
   42.27  	f.set(tree.get(gn),f.get(tree.get(gn))+aug_val);
   42.28 -	gn=G.tail(tree.get(gn));
   42.29 +	gn=G.source(tree.get(gn));
   42.30        }
   42.31      else {
   42.32        f.set(tree.get(gn),f.get(tree.get(gn))-aug_val);
   42.33 -      gn=G.head(tree.get(gn));
   42.34 +      gn=G.target(tree.get(gn));
   42.35      }
   42.36  
   42.37      flow_val+=aug_val;
    43.1 --- a/src/work/alpar/f_ed_ka_demo.cc	Sat Nov 13 12:24:01 2004 +0000
    43.2 +++ b/src/work/alpar/f_ed_ka_demo.cc	Sat Nov 13 12:53:28 2004 +0000
    43.3 @@ -41,7 +41,7 @@
    43.4  
    43.5    //std::cout << "maximum flow: "<< std::endl;
    43.6    //for(EachEdgeIt e=G.first<EachEdgeIt>(); e.valid(); ++e) { 
    43.7 -  //  std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
    43.8 +  //  std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
    43.9    //}
   43.10    //std::cout<<std::endl;
   43.11    //  std::cout<<"elapsed time: " << post_time-pre_time << " sec"<< std::endl; 
    44.1 --- a/src/work/alpar/graph.h	Sat Nov 13 12:24:01 2004 +0000
    44.2 +++ b/src/work/alpar/graph.h	Sat Nov 13 12:53:28 2004 +0000
    44.3 @@ -106,10 +106,10 @@
    44.4        
    44.5        // Lehet, hogy ez a ketto nem kell!!!
    44.6        
    44.7 -      NodeIterator tail() const {NodeIterator i;i.G=G;i.n=e->From();return i;}
    44.8 -      NodeIterator head() const {NodeIterator i;i.G=G;i.n=e->To();return i;}
    44.9 +      NodeIterator source() const {NodeIterator i;i.G=G;i.n=e->From();return i;}
   44.10 +      NodeIterator target() const {NodeIterator i;i.G=G;i.n=e->To();return i;}
   44.11        NodeIterator opposite(const NodeIterator &n) const
   44.12 -      {return n==tail()?head():tail();}
   44.13 +      {return n==source()?target():source();}
   44.14        
   44.15        bool valid() {return e;}
   44.16        E &operator*() const { return G->Data(e); }
   44.17 @@ -190,8 +190,8 @@
   44.18        OutEdgeIterator operator++(int)
   44.19        {OutEdgeIterator tmp(*this); goNext(); return tmp;}
   44.20        
   44.21 -      NodeIterator aNode() const {return tail();}
   44.22 -      NodeIterator bNode() const {return head();}
   44.23 +      NodeIterator aNode() const {return source();}
   44.24 +      NodeIterator bNode() const {return target();}
   44.25        
   44.26        operator const InEdgeIterator ()
   44.27        {InEdgeIterator i; i.G=G;i.e=e;return i;}
   44.28 @@ -218,7 +218,7 @@
   44.29        {SymEdgeIterator tmp(*this); goNext(); return tmp;}
   44.30        
   44.31        NodeIterator aNode() const {return n;}
   44.32 -      NodeIterator bNode() const {return n.n==tail().n?head():tail();}
   44.33 +      NodeIterator bNode() const {return n.n==source().n?target():source();}
   44.34        
   44.35        operator const InEdgeIterator ()
   44.36        {InEdgeIterator i; i.G=G;i.e=e;return i;}
   44.37 @@ -254,7 +254,7 @@
   44.38        
   44.39        
   44.40        NodeIterator aNode() const {return n;}
   44.41 -      NodeIterator bNode() const {return n.n==tail().n?head():tail();}
   44.42 +      NodeIterator bNode() const {return n.n==source().n?target():source();}
   44.43        
   44.44        operator const EdgeIterator ()
   44.45        {EdgeIterator i; i.G=G;i.e=e;return i;}
   44.46 @@ -463,14 +463,14 @@
   44.47      NodeIterator GetNode(int n) // What about path of length 1?
   44.48      {
   44.49        return n?
   44.50 -	reversed[n-1]?path[n-1].tail():path[n-1].head():
   44.51 -	reversed[0]?path[0].head():path[0].tail();
   44.52 +	reversed[n-1]?path[n-1].source():path[n-1].target():
   44.53 +	reversed[0]?path[0].target():path[0].source();
   44.54      }
   44.55      void setRevert(int n,bool r=true) {reversed[n]=r;}
   44.56      void setEdge(int n,SymEdgeIterator i)
   44.57      {
   44.58        path[n]=i;
   44.59 -      reversed[n] = i.head()==i.aNode();
   44.60 +      reversed[n] = i.target()==i.aNode();
   44.61      }
   44.62      void setEdge(int n,EdgeIterator i,bool r)
   44.63      {
   44.64 @@ -478,8 +478,8 @@
   44.65        reversed[n] = r;
   44.66      }
   44.67  
   44.68 -    NodeIterator tail() { return getNode(0); }
   44.69 -    NodeIterator head() { return getNode(getLength()); }
   44.70 +    NodeIterator source() { return getNode(0); }
   44.71 +    NodeIterator target() { return getNode(getLength()); }
   44.72    };
   44.73    
   44.74    /*   Ez itt a fiam kommentje:
    45.1 --- a/src/work/alpar/gwrapper.h	Sat Nov 13 12:24:01 2004 +0000
    45.2 +++ b/src/work/alpar/gwrapper.h	Sat Nov 13 12:53:28 2004 +0000
    45.3 @@ -27,10 +27,10 @@
    45.4    template<typename I> I next(const I i); { return graph->goNext(i); }
    45.5    template<typename I> I &goNext(I &i); { return graph->goNext(i); }
    45.6  
    45.7 -  NodeIt head(const EdgeIt &e);
    45.8 -  { return graph->head(e); }
    45.9 -  NodeIt tail(const EdgeIt &e);
   45.10 -  { return graph->tail(e); }
   45.11 +  NodeIt target(const EdgeIt &e);
   45.12 +  { return graph->target(e); }
   45.13 +  NodeIt source(const EdgeIt &e);
   45.14 +  { return graph->source(e); }
   45.15    
   45.16    template<typename I> NodeIt aNode(const I e);
   45.17    { return graph->aNode(e); }
   45.18 @@ -83,10 +83,10 @@
   45.19    template<typename I> I next(const I i); { return graph->goNext(i); }
   45.20    template<typename I> I &goNext(I &i); { return graph->goNext(i); }
   45.21  
   45.22 -  NodeIt head(const EdgeIt &e);
   45.23 -  { return graph->tail(e); }
   45.24 -  NodeIt tail(const EdgeIt &e);
   45.25 -  { return graph->head(e); }
   45.26 +  NodeIt target(const EdgeIt &e);
   45.27 +  { return graph->source(e); }
   45.28 +  NodeIt source(const EdgeIt &e);
   45.29 +  { return graph->target(e); }
   45.30    
   45.31    template<typename I> NodeIt aNode(const I e);
   45.32    { return graph->aNode(e); }
   45.33 @@ -137,10 +137,10 @@
   45.34  //   template<typename I> I next(const I i); { return graph->goNext(i); }
   45.35  //   template<typename I> I &goNext(I &i); { return graph->goNext(i); }
   45.36  
   45.37 -  NodeIt head(const EdgeIt &e);
   45.38 -  { return G::tail(e); }
   45.39 -  NodeIt tail(const EdgeIt &e);
   45.40 -  { return G::head(e); }
   45.41 +  NodeIt target(const EdgeIt &e);
   45.42 +  { return G::source(e); }
   45.43 +  NodeIt source(const EdgeIt &e);
   45.44 +  { return G::target(e); }
   45.45    
   45.46  //   template<typename I> NodeIt aNode(const I e);
   45.47  //   { return graph->aNode(e); }
   45.48 @@ -194,10 +194,10 @@
   45.49    template<typename I> I next(const I i); { return graph->goNext(i); }
   45.50    template<typename I> I &goNext(I &i); { return graph->goNext(i); }
   45.51  
   45.52 -  NodeIt head(const EdgeIt &e);
   45.53 -  { return graph->head(e); }
   45.54 -  NodeIt tail(const EdgeIt &e);
   45.55 -  { return graph->tail(e); }
   45.56 +  NodeIt target(const EdgeIt &e);
   45.57 +  { return graph->target(e); }
   45.58 +  NodeIt source(const EdgeIt &e);
   45.59 +  { return graph->source(e); }
   45.60    
   45.61    template<typename I> NodeIt aNode(const I e);
   45.62    { return graph->aNode(e); }
   45.63 @@ -343,10 +343,10 @@
   45.64    template<typename I> I &goNext(I &i); { return graph->goNext(i); }
   45.65    template<typename I> I next(const I i); { return graph->goNext(i); }
   45.66  
   45.67 -  NodeIt head(const EdgeIt &e);
   45.68 -  { return graph->head(e); }
   45.69 -  NodeIt tail(const EdgeIt &e);
   45.70 -  { return graph->tail(e); }
   45.71 +  NodeIt target(const EdgeIt &e);
   45.72 +  { return graph->target(e); }
   45.73 +  NodeIt source(const EdgeIt &e);
   45.74 +  { return graph->source(e); }
   45.75    
   45.76    template<typename I> NodeIt aNode(const I e);
   45.77    { return graph->aNode(e); }
    46.1 --- a/src/work/alpar/list_graph_demo.cc	Sat Nov 13 12:24:01 2004 +0000
    46.2 +++ b/src/work/alpar/list_graph_demo.cc	Sat Nov 13 12:53:28 2004 +0000
    46.3 @@ -111,10 +111,10 @@
    46.4      Graph::SymEdgeMap<int> sm(G);
    46.5      for(EdgeIt e(G);G.valid(e);G.next(e)) em[e]=G.id(e);
    46.6      for(EdgeIt e(G);G.valid(e);G.next(e))
    46.7 -      if(G.tail(e)<G.head(e)) sm[e]=G.id(e);
    46.8 +      if(G.source(e)<G.target(e)) sm[e]=G.id(e);
    46.9      
   46.10      for(EdgeIt e(G);G.valid(e);G.next(e))
   46.11 -      std::cout << G.id(G.tail(e)) << "->" << G.id(G.head(e))
   46.12 +      std::cout << G.id(G.source(e)) << "->" << G.id(G.target(e))
   46.13  		<< ": id=" << G.id(e) << " oppid=" << G.id(G.opposite(e))
   46.14  		<< " em=" << em[e]
   46.15  		<< " sm=" << sm[e] << "\n";
    47.1 --- a/src/work/alpar/rw_nonref_map.cc	Sat Nov 13 12:24:01 2004 +0000
    47.2 +++ b/src/work/alpar/rw_nonref_map.cc	Sat Nov 13 12:53:28 2004 +0000
    47.3 @@ -23,15 +23,15 @@
    47.4      operator ValueType() const 
    47.5      {
    47.6        ValueType tmp;
    47.7 -      std::cout << G.id(G.tail(e)) << "->"
    47.8 -		<< G.id(G.head(e)) << ": ";
    47.9 +      std::cout << G.id(G.source(e)) << "->"
   47.10 +		<< G.id(G.target(e)) << ": ";
   47.11        std::cin  >> tmp;
   47.12        return tmp;
   47.13      }
   47.14      ValueType operator = (ValueType v) const
   47.15      {
   47.16 -      std::cout << G.id(G.tail(e)) << "->"
   47.17 -		<< G.id(G.head(e)) << ": " << v << '\n';
   47.18 +      std::cout << G.id(G.source(e)) << "->"
   47.19 +		<< G.id(G.target(e)) << ": " << v << '\n';
   47.20        return v;
   47.21      }
   47.22    };
    48.1 --- a/src/work/alpar/smart_graph_demo.cc	Sat Nov 13 12:24:01 2004 +0000
    48.2 +++ b/src/work/alpar/smart_graph_demo.cc	Sat Nov 13 12:53:28 2004 +0000
    48.3 @@ -111,10 +111,10 @@
    48.4      Graph::SymEdgeMap<int> sm(G);
    48.5      for(EdgeIt e(G);G.valid(e);G.next(e)) em[e]=G.id(e);
    48.6      for(EdgeIt e(G);G.valid(e);G.next(e))
    48.7 -      if(G.tail(e)<G.head(e)) sm[e]=G.id(e);
    48.8 +      if(G.source(e)<G.target(e)) sm[e]=G.id(e);
    48.9      
   48.10      for(EdgeIt e(G);G.valid(e);G.next(e))
   48.11 -      std::cout << G.id(G.tail(e)) << "->" << G.id(G.head(e))
   48.12 +      std::cout << G.id(G.source(e)) << "->" << G.id(G.target(e))
   48.13  		<< ": id=" << G.id(e) << " oppid=" << G.id(G.opposite(e))
   48.14  		<< " em=" << em[e]
   48.15  		<< " sm=" << sm[e] << "\n";
    49.1 --- a/src/work/athos/bfs_test.cc	Sat Nov 13 12:24:01 2004 +0000
    49.2 +++ b/src/work/athos/bfs_test.cc	Sat Nov 13 12:53:28 2004 +0000
    49.3 @@ -41,7 +41,7 @@
    49.4        bfs_queue.pop();
    49.5        OutEdgeIt e;
    49.6        for(g.first(e,v); g.valid(e); g.next(e)) {
    49.7 -	Node w=g.head(e);
    49.8 +	Node w=g.target(e);
    49.9  	if (!reached[w]) {
   49.10  	  bfs_queue.push(w);
   49.11  	  reached.set(w, true);
    50.1 --- a/src/work/athos/dijkstra_demo.cc	Sat Nov 13 12:24:01 2004 +0000
    50.2 +++ b/src/work/athos/dijkstra_demo.cc	Sat Nov 13 12:53:28 2004 +0000
    50.3 @@ -129,10 +129,10 @@
    50.4      std::cout << node_name.get(i) << ": ";
    50.5      std::cout << "out edges: ";
    50.6      for(out_edge_iterator j=flow_test.first_out_edge(i); j.valid(); ++j) 
    50.7 -      std::cout << node_name.get(flow_test.tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flow_test.head(j)) << " ";
    50.8 +      std::cout << node_name.get(flow_test.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flow_test.target(j)) << " ";
    50.9      std::cout << "in edges: ";
   50.10      for(in_edge_iterator j=flow_test.first_in_edge(i); j.valid(); ++j) 
   50.11 -      std::cout << node_name.get(flow_test.tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flow_test.head(j)) << " ";
   50.12 +      std::cout << node_name.get(flow_test.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flow_test.target(j)) << " ";
   50.13      std::cout << std::endl;
   50.14    }
   50.15    */
    51.1 --- a/src/work/athos/mincostflow.h	Sat Nov 13 12:24:01 2004 +0000
    51.2 +++ b/src/work/athos/mincostflow.h	Sat Nov 13 12:53:28 2004 +0000
    51.3 @@ -73,9 +73,9 @@
    51.4  	
    51.5        ValueType operator[](typename ResGraph::Edge e) const {     
    51.6  	if (res_graph.forward(e))
    51.7 -	  return  ol[e]-(pot[res_graph.head(e)]-pot[res_graph.tail(e)]);   
    51.8 +	  return  ol[e]-(pot[res_graph.target(e)]-pot[res_graph.source(e)]);   
    51.9  	else
   51.10 -	  return -ol[e]-(pot[res_graph.head(e)]-pot[res_graph.tail(e)]);   
   51.11 +	  return -ol[e]-(pot[res_graph.target(e)]-pot[res_graph.source(e)]);   
   51.12        }     
   51.13  	
   51.14        ModCostMap(const ResGraph& _res_graph,
   51.15 @@ -258,8 +258,8 @@
   51.16  	  typename std::list<Edge>::iterator i = nonabundant_arcs.begin();
   51.17  	  while ( i != nonabundant_arcs.end() ){
   51.18  	    if (flow[*i]>=buf){
   51.19 -	      Node a = abundant_components.find(res_graph.head(*i));
   51.20 -	      Node b = abundant_components.find(res_graph.tail(*i));
   51.21 +	      Node a = abundant_components.find(res_graph.target(*i));
   51.22 +	      Node b = abundant_components.find(res_graph.source(*i));
   51.23  	      //Merge
   51.24  	      if (a != b){
   51.25  		abundant_components.join(a,b);
   51.26 @@ -284,7 +284,7 @@
   51.27  		  ResGraphEdge e;
   51.28  		  while (n!=non_root){
   51.29  		    e = bfs_pred[n];
   51.30 -		    n = res_graph.tail(e);
   51.31 +		    n = res_graph.source(e);
   51.32  		    res_graph.augment(e,qty_to_augment);
   51.33  		  }
   51.34  	  
   51.35 @@ -454,7 +454,7 @@
   51.36        Cost fl_e;
   51.37        FOR_EACH_LOC(typename Graph::EdgeIt, e, graph){
   51.38  	//C^{\Pi}_{i,j}
   51.39 -	mod_pot = cost[e]-potential[graph.head(e)]+potential[graph.tail(e)];
   51.40 +	mod_pot = cost[e]-potential[graph.target(e)]+potential[graph.source(e)];
   51.41  	fl_e = flow[e];
   51.42  	//	std::cout << fl_e << std::endl;
   51.43  	if (mod_pot > 0 && fl_e != 0)
   51.44 @@ -483,8 +483,8 @@
   51.45  
   51.46  	  return false;
   51.47  	}
   51.48 -	supdem[graph.tail(e)] += flow[e];
   51.49 -	supdem[graph.head(e)] -= flow[e];
   51.50 +	supdem[graph.source(e)] += flow[e];
   51.51 +	supdem[graph.target(e)] -= flow[e];
   51.52        }
   51.53        //write_property_vector(supdem, "supdem");
   51.54        //write_property_vector(supply_demand, "supply_demand");
    52.1 --- a/src/work/athos/old/minlengthpaths.h	Sat Nov 13 12:24:01 2004 +0000
    52.2 +++ b/src/work/athos/old/minlengthpaths.h	Sat Nov 13 12:53:28 2004 +0000
    52.3 @@ -53,10 +53,10 @@
    52.4        typedef typename LengthMap::ValueType ValueType;
    52.5  	
    52.6        ValueType operator[](typename ResGraphType::Edge e) const {     
    52.7 -	//if ( (1-2*rev[e])*ol[e]-(pot[G.head(e)]-pot[G.tail(e)] ) <0 ){
    52.8 +	//if ( (1-2*rev[e])*ol[e]-(pot[G.target(e)]-pot[G.source(e)] ) <0 ){
    52.9  	//  std::cout<<"Negative length!!"<<std::endl;
   52.10  	//}
   52.11 -	return (1-2*rev[e])*ol[e]-(pot[G.head(e)]-pot[G.tail(e)]);   
   52.12 +	return (1-2*rev[e])*ol[e]-(pot[G.target(e)]-pot[G.source(e)]);   
   52.13        }     
   52.14  	
   52.15        ModLengthMap(const ResGraphType& _G, const EdgeIntMap& _rev, 
   52.16 @@ -161,7 +161,7 @@
   52.17  	  while (!reversed[e]){
   52.18  	    G.next(e);
   52.19  	  }
   52.20 -	  n = G.head(e);
   52.21 +	  n = G.target(e);
   52.22  	  paths[j].push_back(e);
   52.23  	  total_length += length[e];
   52.24  	  reversed[e] = 1-reversed[e];
    53.1 --- a/src/work/athos/preflow_push_wogw.h	Sat Nov 13 12:24:01 2004 +0000
    53.2 +++ b/src/work/athos/preflow_push_wogw.h	Sat Nov 13 12:53:28 2004 +0000
    53.3 @@ -139,7 +139,7 @@
    53.4    
    53.5      //This private procedure is supposed to modify the preflow on edge j
    53.6      //by value v (which can be positive or negative as well) 
    53.7 -    //and maintain the excess on the head and tail
    53.8 +    //and maintain the excess on the target and source
    53.9      //Here we do not check whether this is possible or not
   53.10      void modify_preflow(Edge j, const T& v){
   53.11  
   53.12 @@ -147,11 +147,11 @@
   53.13        preflow[j] += v;
   53.14  
   53.15  
   53.16 -      //Modifiyng the head
   53.17 -      modify_excess(G.head(j),v);
   53.18 +      //Modifiyng the target
   53.19 +      modify_excess(G.target(j),v);
   53.20  	
   53.21 -      //Modifiyng the tail
   53.22 -      modify_excess(G.tail(j),-v);
   53.23 +      //Modifiyng the source
   53.24 +      modify_excess(G.source(j),-v);
   53.25  
   53.26      }
   53.27  
   53.28 @@ -272,7 +272,7 @@
   53.29  
   53.30  	InEdgeIt e;
   53.31  	for(G.first(e,v); G.valid(e); G.next(e)) {
   53.32 -	  Node w=G.tail(e);
   53.33 +	  Node w=G.source(e);
   53.34  	  if ( level[w] == number_of_nodes && w != s ) {
   53.35  	    bfs_queue.push(w);
   53.36  	    //Node first=level_list[l];
   53.37 @@ -310,8 +310,8 @@
   53.38        //we push as much preflow from s as possible to start with
   53.39        for(OutEdgeIt j=G.template first<OutEdgeIt>(s); G.valid(j); G.next(j)){ 
   53.40  	modify_preflow(j,capacity[j] );
   53.41 -	make_active(G.head(j));
   53.42 -	int lev=level[G.head(j)];
   53.43 +	make_active(G.target(j));
   53.44 +	int lev=level[G.target(j)];
   53.45  	if(highest_active<lev){
   53.46  	  highest_active=lev;
   53.47  	}
   53.48 @@ -325,12 +325,12 @@
   53.49      bool is_admissible_forward_edge(Edge j, int& new_level){
   53.50  
   53.51        if (capacity[j]>preflow[j]){
   53.52 -	if(level[G.tail(j)]==level[G.head(j)]+1){
   53.53 +	if(level[G.source(j)]==level[G.target(j)]+1){
   53.54  	  return true;
   53.55  	}
   53.56  	else{
   53.57 -	  if (level[G.head(j)] < new_level)
   53.58 -	    new_level=level[G.head(j)];
   53.59 +	  if (level[G.target(j)] < new_level)
   53.60 +	    new_level=level[G.target(j)];
   53.61  	}
   53.62        }
   53.63        return false;
   53.64 @@ -341,13 +341,13 @@
   53.65      bool is_admissible_backward_edge(Edge j, int& new_level){
   53.66        
   53.67        if (0<preflow[j]){
   53.68 -	if(level[G.tail(j)]==level[G.head(j)]-1){
   53.69 +	if(level[G.source(j)]==level[G.target(j)]-1){
   53.70  	 
   53.71  	  return true;
   53.72  	}
   53.73  	else{
   53.74 -	  if (level[G.tail(j)] < new_level)
   53.75 -	    new_level=level[G.tail(j)];
   53.76 +	  if (level[G.source(j)] < new_level)
   53.77 +	    new_level=level[G.source(j)];
   53.78  	}
   53.79  	
   53.80        }
   53.81 @@ -388,8 +388,8 @@
   53.82  	      v=min(e,capacity[j] - preflow[j]);
   53.83  	      e -= v;
   53.84  	      //New node might become active
   53.85 -	      if (excess[G.head(j)]==0){
   53.86 -		make_active(G.head(j));
   53.87 +	      if (excess[G.target(j)]==0){
   53.88 +		make_active(G.target(j));
   53.89  	      }
   53.90  	      modify_preflow(j,v);
   53.91  	    }
   53.92 @@ -404,8 +404,8 @@
   53.93  	      v=min(e,preflow[j]);
   53.94  	      e -= v;
   53.95  	      //New node might become active
   53.96 -	      if (excess[G.tail(j)]==0){
   53.97 -		make_active(G.tail(j));
   53.98 +	      if (excess[G.source(j)]==0){
   53.99 +		make_active(G.source(j));
  53.100  	      }
  53.101  	      modify_preflow(j,-v);
  53.102  	    }
    54.1 --- a/src/work/deba/list_graph.h	Sat Nov 13 12:24:01 2004 +0000
    54.2 +++ b/src/work/deba/list_graph.h	Sat Nov 13 12:53:28 2004 +0000
    54.3 @@ -43,7 +43,7 @@
    54.4      //The free edges are only single linked using the "next_in" field.
    54.5      struct EdgeT 
    54.6      {
    54.7 -      int head, tail;
    54.8 +      int target, source;
    54.9        int prev_in, prev_out;
   54.10        int next_in, next_out;
   54.11        //FIXME: is this necessary?
   54.12 @@ -104,14 +104,14 @@
   54.13      ///its name would suggests...
   54.14      int maxEdgeId() const { return edges.size(); }  //FIXME: What is this?
   54.15  
   54.16 -    Node tail(Edge e) const { return edges[e.n].tail; }
   54.17 -    Node head(Edge e) const { return edges[e.n].head; }
   54.18 +    Node source(Edge e) const { return edges[e.n].source; }
   54.19 +    Node target(Edge e) const { return edges[e.n].target; }
   54.20  
   54.21 -    Node aNode(OutEdgeIt e) const { return edges[e.n].tail; }
   54.22 -    Node aNode(InEdgeIt e) const { return edges[e.n].head; }
   54.23 +    Node aNode(OutEdgeIt e) const { return edges[e.n].source; }
   54.24 +    Node aNode(InEdgeIt e) const { return edges[e.n].target; }
   54.25  
   54.26 -    Node bNode(OutEdgeIt e) const { return edges[e.n].head; }
   54.27 -    Node bNode(InEdgeIt e) const { return edges[e.n].tail; }
   54.28 +    Node bNode(OutEdgeIt e) const { return edges[e.n].target; }
   54.29 +    Node bNode(InEdgeIt e) const { return edges[e.n].source; }
   54.30  
   54.31      NodeIt& first(NodeIt& v) const { 
   54.32        v=NodeIt(*this); return v; }
   54.33 @@ -151,7 +151,7 @@
   54.34        }
   54.35        else {
   54.36  	int n;
   54.37 -	for(n=nodes[edges[it.n].head].next;
   54.38 +	for(n=nodes[edges[it.n].target].next;
   54.39  	    n!=-1 && nodes[n].first_in == -1;
   54.40  	    n = nodes[n].next) ;
   54.41  	it.n = (n==-1)?-1:nodes[n].first_in;
   54.42 @@ -207,7 +207,7 @@
   54.43  	first_free_edge = edges[n].next_in;
   54.44        }
   54.45        
   54.46 -      edges[n].tail = u.n; edges[n].head = v.n;
   54.47 +      edges[n].source = u.n; edges[n].target = v.n;
   54.48  
   54.49        edges[n].next_out = nodes[u.n].first_out;
   54.50        if(nodes[u.n].first_out != -1) edges[nodes[u.n].first_out].prev_out = n;
   54.51 @@ -232,13 +232,13 @@
   54.52  	edges[edges[n].next_in].prev_in = edges[n].prev_in;
   54.53        if(edges[n].prev_in!=-1)
   54.54  	edges[edges[n].prev_in].next_in = edges[n].next_in;
   54.55 -      else nodes[edges[n].head].first_in = edges[n].next_in;
   54.56 +      else nodes[edges[n].target].first_in = edges[n].next_in;
   54.57        
   54.58        if(edges[n].next_out!=-1)
   54.59  	edges[edges[n].next_out].prev_out = edges[n].prev_out;
   54.60        if(edges[n].prev_out!=-1)
   54.61  	edges[edges[n].prev_out].next_out = edges[n].next_out;
   54.62 -      else nodes[edges[n].tail].first_out = edges[n].next_out;
   54.63 +      else nodes[edges[n].source].first_out = edges[n].next_out;
   54.64        
   54.65        edges[n].next_in = first_free_edge;
   54.66        first_free_edge = n;      
    55.1 --- a/src/work/jacint/max_flow.h	Sat Nov 13 12:24:01 2004 +0000
    55.2 +++ b/src/work/jacint/max_flow.h	Sat Nov 13 12:53:28 2004 +0000
    55.3 @@ -326,7 +326,7 @@
    55.4  
    55.5  	OutEdgeIt e;
    55.6  	for(g->first(e,w) ; g->valid(e); g->next(e)) {
    55.7 -	  Node v=g->head(e);
    55.8 +	  Node v=g->target(e);
    55.9  	  if (!M[v] && (*flow)[e] < (*capacity)[e] ) {
   55.10  	    queue.push(v);
   55.11  	    M.set(v, true);
   55.12 @@ -335,7 +335,7 @@
   55.13  
   55.14  	InEdgeIt f;
   55.15  	for(g->first(f,w) ; g->valid(f); g->next(f)) {
   55.16 -	  Node v=g->tail(f);
   55.17 +	  Node v=g->source(f);
   55.18  	  if (!M[v] && (*flow)[f] > 0 ) {
   55.19  	    queue.push(v);
   55.20  	    M.set(v, true);
   55.21 @@ -370,7 +370,7 @@
   55.22  
   55.23  	InEdgeIt e;
   55.24  	for(g->first(e,w) ; g->valid(e); g->next(e)) {
   55.25 -	  Node v=g->tail(e);
   55.26 +	  Node v=g->source(e);
   55.27  	  if (M[v] && (*flow)[e] < (*capacity)[e] ) {
   55.28  	    queue.push(v);
   55.29  	    M.set(v, false);
   55.30 @@ -379,7 +379,7 @@
   55.31  
   55.32  	OutEdgeIt f;
   55.33  	for(g->first(f,w) ; g->valid(f); g->next(f)) {
   55.34 -	  Node v=g->head(f);
   55.35 +	  Node v=g->target(f);
   55.36  	  if (M[v] && (*flow)[f] > 0 ) {
   55.37  	    queue.push(v);
   55.38  	    M.set(v, false);
   55.39 @@ -433,7 +433,7 @@
   55.40        for(g->first(e,w); g->valid(e); g->next(e)) {
   55.41  
   55.42  	if ( (*flow)[e] >= (*capacity)[e] ) continue;
   55.43 -	Node v=g->head(e);
   55.44 +	Node v=g->target(e);
   55.45  
   55.46  	if( lev > level[v] ) { //Push is allowed now
   55.47  
   55.48 @@ -466,7 +466,7 @@
   55.49  	for(g->first(e,w); g->valid(e); g->next(e)) {
   55.50  
   55.51  	  if( (*flow)[e] <= 0 ) continue;
   55.52 -	  Node v=g->tail(e);
   55.53 +	  Node v=g->source(e);
   55.54  
   55.55  	  if( lev > level[v] ) { //Push is allowed now
   55.56  
   55.57 @@ -521,7 +521,7 @@
   55.58  
   55.59  	    InEdgeIt e;
   55.60  	    for(g->first(e,v); g->valid(e); g->next(e)) {
   55.61 -	      Node w=g->tail(e);
   55.62 +	      Node w=g->source(e);
   55.63  	      if ( level[w] == n && w != s ) {
   55.64  		bfs_queue.push(w);
   55.65  		Node first=level_list[l];
   55.66 @@ -539,7 +539,7 @@
   55.67  	    {
   55.68  	      Num c=(*capacity)[e];
   55.69  	      if ( c <= 0 ) continue;
   55.70 -	      Node w=g->head(e);
   55.71 +	      Node w=g->target(e);
   55.72  	      if ( level[w] < n ) {
   55.73  		if ( excess[w] <= 0 && w!=t ) active[level[w]].push(w);
   55.74  		flow->set(e, c);
   55.75 @@ -566,7 +566,7 @@
   55.76  	    InEdgeIt e;
   55.77  	    for(g->first(e,v); g->valid(e); g->next(e)) {
   55.78  	      if ( (*capacity)[e] <= (*flow)[e] ) continue;
   55.79 -	      Node w=g->tail(e);
   55.80 +	      Node w=g->source(e);
   55.81  	      if ( level[w] == n && w != s ) {
   55.82  		bfs_queue.push(w);
   55.83  		Node first=level_list[l];
   55.84 @@ -580,7 +580,7 @@
   55.85  	    OutEdgeIt f;
   55.86  	    for(g->first(f,v); g->valid(f); g->next(f)) {
   55.87  	      if ( 0 >= (*flow)[f] ) continue;
   55.88 -	      Node w=g->head(f);
   55.89 +	      Node w=g->target(f);
   55.90  	      if ( level[w] == n && w != s ) {
   55.91  		bfs_queue.push(w);
   55.92  		Node first=level_list[l];
   55.93 @@ -599,7 +599,7 @@
   55.94  	    {
   55.95  	      Num rem=(*capacity)[e]-(*flow)[e];
   55.96  	      if ( rem <= 0 ) continue;
   55.97 -	      Node w=g->head(e);
   55.98 +	      Node w=g->target(e);
   55.99  	      if ( level[w] < n ) {
  55.100  		if ( excess[w] <= 0 && w!=t ) active[level[w]].push(w);
  55.101  		flow->set(e, (*capacity)[e]);
  55.102 @@ -611,7 +611,7 @@
  55.103  	  for(g->first(f,s); g->valid(f); g->next(f))
  55.104  	    {
  55.105  	      if ( (*flow)[f] <= 0 ) continue;
  55.106 -	      Node w=g->tail(f);
  55.107 +	      Node w=g->source(f);
  55.108  	      if ( level[w] < n ) {
  55.109  		if ( excess[w] <= 0 && w!=t ) active[level[w]].push(w);
  55.110  		excess.set(w, excess[w]+(*flow)[f]);
  55.111 @@ -710,9 +710,9 @@
  55.112        //       int get(const typename MapGraphWrapper::Node& n) const {
  55.113        // 	return dist[n]; }
  55.114        //       bool get(const typename MapGraphWrapper::Edge& e) const {
  55.115 -      // 	return (dist.get(g->tail(e))<dist.get(g->head(e))); }
  55.116 +      // 	return (dist.get(g->source(e))<dist.get(g->target(e))); }
  55.117        bool operator[](const typename MapGraphWrapper::Edge& e) const {
  55.118 -	return (dist[g->tail(e)]<dist[g->head(e)]);
  55.119 +	return (dist[g->source(e)]<dist[g->target(e)]);
  55.120        }
  55.121      };
  55.122  
  55.123 @@ -860,7 +860,7 @@
  55.124        InEdgeIt e;
  55.125        for(g->first(e,v); g->valid(e); g->next(e)) {
  55.126  	if ( (*capacity)[e] <= (*flow)[e] ) continue;
  55.127 -	Node u=g->tail(e);
  55.128 +	Node u=g->source(e);
  55.129  	if ( level[u] >= n ) {
  55.130  	  bfs_queue.push(u);
  55.131  	  level.set(u, l);
  55.132 @@ -871,7 +871,7 @@
  55.133        OutEdgeIt f;
  55.134        for(g->first(f,v); g->valid(f); g->next(f)) {
  55.135  	if ( 0 >= (*flow)[f] ) continue;
  55.136 -	Node u=g->head(f);
  55.137 +	Node u=g->target(f);
  55.138  	if ( level[u] >= n ) {
  55.139  	  bfs_queue.push(u);
  55.140  	  level.set(u, l);
  55.141 @@ -925,15 +925,15 @@
  55.142      while ( !bfs.finished() ) {
  55.143        ResGWOutEdgeIt e=bfs;
  55.144        if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
  55.145 -	Node v=res_graph.tail(e);
  55.146 -	Node w=res_graph.head(e);
  55.147 +	Node v=res_graph.source(e);
  55.148 +	Node w=res_graph.target(e);
  55.149  	pred.set(w, e);
  55.150  	if (res_graph.valid(pred[v])) {
  55.151  	  free.set(w, std::min(free[v], res_graph.resCap(e)));
  55.152  	} else {
  55.153  	  free.set(w, res_graph.resCap(e));
  55.154  	}
  55.155 -	if (res_graph.head(e)==t) { _augment=true; break; }
  55.156 +	if (res_graph.target(e)==t) { _augment=true; break; }
  55.157        }
  55.158  
  55.159        ++bfs;
  55.160 @@ -945,7 +945,7 @@
  55.161        while (res_graph.valid(pred[n])) {
  55.162  	ResGWEdge e=pred[n];
  55.163  	res_graph.augment(e, augment_value);
  55.164 -	n=res_graph.tail(e);
  55.165 +	n=res_graph.source(e);
  55.166        }
  55.167      }
  55.168  
  55.169 @@ -983,15 +983,15 @@
  55.170      while ( !bfs.finished() ) {
  55.171        ResGWOutEdgeIt e=bfs;
  55.172        if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
  55.173 -	Node v=res_graph.tail(e);
  55.174 -	Node w=res_graph.head(e);
  55.175 +	Node v=res_graph.source(e);
  55.176 +	Node w=res_graph.target(e);
  55.177  	pred.set(w, e);
  55.178  	if (res_graph.valid(pred[v])) {
  55.179  	  free.set(w, std::min(free[v], res_graph.resCap(e)));
  55.180  	} else {
  55.181  	  free.set(w, res_graph.resCap(e));
  55.182  	}
  55.183 -	if (res_graph.head(e)==t) { _augment=true; break; }
  55.184 +	if (res_graph.target(e)==t) { _augment=true; break; }
  55.185        }
  55.186  
  55.187        ++bfs;
  55.188 @@ -1003,7 +1003,7 @@
  55.189        while (res_graph.valid(pred[n])) {
  55.190  	ResGWEdge e=pred[n];
  55.191  	res_graph.augment(e, augment_value);
  55.192 -	n=res_graph.tail(e);
  55.193 +	n=res_graph.source(e);
  55.194        }
  55.195      }
  55.196  
  55.197 @@ -1050,17 +1050,17 @@
  55.198        ResGWOutEdgeIt e=bfs;
  55.199        if (res_graph.valid(e)) {
  55.200  	if (bfs.isBNodeNewlyReached()) {
  55.201 -	  dist.set(res_graph.head(e), dist[res_graph.tail(e)]+1);
  55.202 -	  typename MG::Edge f=F.addEdge(res_graph_to_F[res_graph.tail(e)],
  55.203 -					res_graph_to_F[res_graph.head(e)]);
  55.204 +	  dist.set(res_graph.target(e), dist[res_graph.source(e)]+1);
  55.205 +	  typename MG::Edge f=F.addEdge(res_graph_to_F[res_graph.source(e)],
  55.206 +					res_graph_to_F[res_graph.target(e)]);
  55.207  	  original_edge.update();
  55.208  	  original_edge.set(f, e);
  55.209  	  residual_capacity.update();
  55.210  	  residual_capacity.set(f, res_graph.resCap(e));
  55.211  	} else {
  55.212 -	  if (dist[res_graph.head(e)]==(dist[res_graph.tail(e)]+1)) {
  55.213 -	    typename MG::Edge f=F.addEdge(res_graph_to_F[res_graph.tail(e)],
  55.214 -					  res_graph_to_F[res_graph.head(e)]);
  55.215 +	  if (dist[res_graph.target(e)]==(dist[res_graph.source(e)]+1)) {
  55.216 +	    typename MG::Edge f=F.addEdge(res_graph_to_F[res_graph.source(e)],
  55.217 +					  res_graph_to_F[res_graph.target(e)]);
  55.218  	    original_edge.update();
  55.219  	    original_edge.set(f, e);
  55.220  	    residual_capacity.update();
  55.221 @@ -1114,7 +1114,7 @@
  55.222  	while (F.valid(pred[n])) {
  55.223  	  typename MG::Edge e=pred[n];
  55.224  	  res_graph.augment(original_edge[e], augment_value);
  55.225 -	  n=F.tail(e);
  55.226 +	  n=F.source(e);
  55.227  	  if (residual_capacity[e]==augment_value)
  55.228  	    F.erase(e);
  55.229  	  else
  55.230 @@ -1147,7 +1147,7 @@
  55.231      while ( !bfs.finished() ) {
  55.232        ResGWOutEdgeIt e=bfs;
  55.233        if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
  55.234 -	dist.set(res_graph.head(e), dist[res_graph.tail(e)]+1);
  55.235 +	dist.set(res_graph.target(e), dist[res_graph.source(e)]+1);
  55.236        }
  55.237        ++bfs;
  55.238      } //computing distances from s in the residual graph
  55.239 @@ -1247,7 +1247,7 @@
  55.240  	while (erasing_res_graph.valid(pred[n])) {
  55.241  	  typename ErasingResGW::OutEdgeIt e=pred[n];
  55.242  	  res_graph.augment(e, augment_value);
  55.243 -	  n=erasing_res_graph.tail(e);
  55.244 +	  n=erasing_res_graph.source(e);
  55.245  	  if (res_graph.resCap(e)==0)
  55.246  	    erasing_res_graph.erase(e);
  55.247  	}
    56.1 --- a/src/work/jacint/max_flow_bug.cc	Sat Nov 13 12:24:01 2004 +0000
    56.2 +++ b/src/work/jacint/max_flow_bug.cc	Sat Nov 13 12:53:28 2004 +0000
    56.3 @@ -42,14 +42,14 @@
    56.4    int min_min_cut_value=0;
    56.5    EdgeIt e;
    56.6    for(G.first(e); G.valid(e); G.next(e)) {
    56.7 -    if (mincut[G.tail(e)] && !mincut[G.head(e)]) min_min_cut_value+=cap[e];
    56.8 +    if (mincut[G.source(e)] && !mincut[G.target(e)]) min_min_cut_value+=cap[e];
    56.9    }
   56.10  
   56.11    Graph::NodeMap<bool> cut(G);
   56.12    max_flow_test_no_stack.minCut(cut); 
   56.13    int min_cut_value=0;
   56.14    for(G.first(e); G.valid(e); G.next(e)) {
   56.15 -    if (cut[G.tail(e)] && !cut[G.head(e)]) 
   56.16 +    if (cut[G.source(e)] && !cut[G.target(e)]) 
   56.17        min_cut_value+=cap[e];
   56.18    }
   56.19  
   56.20 @@ -57,7 +57,7 @@
   56.21    max_flow_test_no_stack.maxMinCut(maxcut); 
   56.22    int max_min_cut_value=0;
   56.23    for(G.first(e); G.valid(e); G.next(e)) {
   56.24 -    if (maxcut[G.tail(e)] && !maxcut[G.head(e)]) 
   56.25 +    if (maxcut[G.source(e)] && !maxcut[G.target(e)]) 
   56.26        max_min_cut_value+=cap[e];
   56.27        }
   56.28  
   56.29 @@ -88,14 +88,14 @@
   56.30    max_flow_test.minMinCut(mincut2); 
   56.31    int min_min_cut_value2=0;
   56.32      for(G.first(e); G.valid(e); G.next(e)) {
   56.33 -    if (mincut2[G.tail(e)] && !mincut2[G.head(e)]) min_min_cut_value2+=cap[e];
   56.34 +    if (mincut2[G.source(e)] && !mincut2[G.target(e)]) min_min_cut_value2+=cap[e];
   56.35    }
   56.36  
   56.37    Graph::NodeMap<bool> cut2(G);
   56.38    max_flow_test.minCut(cut2); 
   56.39    int min_cut_value2=0;
   56.40    for(G.first(e); G.valid(e); G.next(e)) {
   56.41 -    if (cut2[G.tail(e)] && !cut2[G.head(e)]) 
   56.42 +    if (cut2[G.source(e)] && !cut2[G.target(e)]) 
   56.43        min_cut_value2+=cap[e];
   56.44    }
   56.45  
   56.46 @@ -103,7 +103,7 @@
   56.47    max_flow_test.maxMinCut(maxcut2); 
   56.48    int max_min_cut_value2=0;
   56.49    for(G.first(e); G.valid(e); G.next(e)) {
   56.50 -    if (maxcut2[G.tail(e)] && !maxcut2[G.head(e)]) 
   56.51 +    if (maxcut2[G.source(e)] && !maxcut2[G.target(e)]) 
   56.52        max_min_cut_value2+=cap[e];
   56.53        }
   56.54    
   56.55 @@ -127,14 +127,14 @@
   56.56    max_flow_test3.minMinCut(mincut3); 
   56.57    int min_min_cut_value3=0;
   56.58    for(G.first(e); G.valid(e); G.next(e)) {
   56.59 -    if (mincut3[G.tail(e)] && !mincut3[G.head(e)]) min_min_cut_value3+=cap[e];
   56.60 +    if (mincut3[G.source(e)] && !mincut3[G.target(e)]) min_min_cut_value3+=cap[e];
   56.61    }
   56.62  
   56.63    Graph::NodeMap<bool> cut3(G);
   56.64    max_flow_test3.minCut(cut3); 
   56.65    int min_cut_value3=0;
   56.66    for(G.first(e); G.valid(e); G.next(e)) {
   56.67 -    if (cut3[G.tail(e)] && !cut3[G.head(e)]) 
   56.68 +    if (cut3[G.source(e)] && !cut3[G.target(e)]) 
   56.69        min_cut_value3+=cap[e];
   56.70    }
   56.71  
   56.72 @@ -142,7 +142,7 @@
   56.73    max_flow_test3.maxMinCut(maxcut3); 
   56.74    int max_min_cut_value3=0;
   56.75    for(G.first(e); G.valid(e); G.next(e)) {
   56.76 -    if (maxcut3[G.tail(e)] && !maxcut3[G.head(e)]) 
   56.77 +    if (maxcut3[G.source(e)] && !maxcut3[G.target(e)]) 
   56.78        max_min_cut_value3+=cap[e];
   56.79    }
   56.80  
    57.1 --- a/src/work/jacint/max_flow_test.cc	Sat Nov 13 12:24:01 2004 +0000
    57.2 +++ b/src/work/jacint/max_flow_test.cc	Sat Nov 13 12:53:28 2004 +0000
    57.3 @@ -45,14 +45,14 @@
    57.4    int min_min_cut_value=0;
    57.5    EdgeIt e;
    57.6    for(G.first(e); G.valid(e); G.next(e)) {
    57.7 -    if (mincut[G.tail(e)] && !mincut[G.head(e)]) min_min_cut_value+=cap[e];
    57.8 +    if (mincut[G.source(e)] && !mincut[G.target(e)]) min_min_cut_value+=cap[e];
    57.9    }
   57.10  
   57.11    Graph::NodeMap<bool> cut(G);
   57.12    max_flow_test_no_stack.minCut(cut); 
   57.13    int min_cut_value=0;
   57.14    for(G.first(e); G.valid(e); G.next(e)) {
   57.15 -    if (cut[G.tail(e)] && !cut[G.head(e)]) 
   57.16 +    if (cut[G.source(e)] && !cut[G.target(e)]) 
   57.17        min_cut_value+=cap[e];
   57.18    }
   57.19  
   57.20 @@ -60,7 +60,7 @@
   57.21    max_flow_test_no_stack.maxMinCut(maxcut); 
   57.22    int max_min_cut_value=0;
   57.23    for(G.first(e); G.valid(e); G.next(e)) {
   57.24 -    if (maxcut[G.tail(e)] && !maxcut[G.head(e)]) 
   57.25 +    if (maxcut[G.source(e)] && !maxcut[G.target(e)]) 
   57.26        max_min_cut_value+=cap[e];
   57.27        }
   57.28  
   57.29 @@ -91,14 +91,14 @@
   57.30    max_flow_test.minMinCut(mincut2); 
   57.31    int min_min_cut_value2=0;
   57.32      for(G.first(e); G.valid(e); G.next(e)) {
   57.33 -    if (mincut2[G.tail(e)] && !mincut2[G.head(e)]) min_min_cut_value2+=cap[e];
   57.34 +    if (mincut2[G.source(e)] && !mincut2[G.target(e)]) min_min_cut_value2+=cap[e];
   57.35    }
   57.36  
   57.37    Graph::NodeMap<bool> cut2(G);
   57.38    max_flow_test.minCut(cut2); 
   57.39    int min_cut_value2=0;
   57.40    for(G.first(e); G.valid(e); G.next(e)) {
   57.41 -    if (cut2[G.tail(e)] && !cut2[G.head(e)]) 
   57.42 +    if (cut2[G.source(e)] && !cut2[G.target(e)]) 
   57.43        min_cut_value2+=cap[e];
   57.44    }
   57.45  
   57.46 @@ -106,7 +106,7 @@
   57.47    max_flow_test.maxMinCut(maxcut2); 
   57.48    int max_min_cut_value2=0;
   57.49    for(G.first(e); G.valid(e); G.next(e)) {
   57.50 -    if (maxcut2[G.tail(e)] && !maxcut2[G.head(e)]) 
   57.51 +    if (maxcut2[G.source(e)] && !maxcut2[G.target(e)]) 
   57.52        max_min_cut_value2+=cap[e];
   57.53        }
   57.54    
   57.55 @@ -130,14 +130,14 @@
   57.56    max_flow_test3.minMinCut(mincut3); 
   57.57    int min_min_cut_value3=0;
   57.58    for(G.first(e); G.valid(e); G.next(e)) {
   57.59 -    if (mincut3[G.tail(e)] && !mincut3[G.head(e)]) min_min_cut_value3+=cap[e];
   57.60 +    if (mincut3[G.source(e)] && !mincut3[G.target(e)]) min_min_cut_value3+=cap[e];
   57.61    }
   57.62  
   57.63    Graph::NodeMap<bool> cut3(G);
   57.64    max_flow_test3.minCut(cut3); 
   57.65    int min_cut_value3=0;
   57.66    for(G.first(e); G.valid(e); G.next(e)) {
   57.67 -    if (cut3[G.tail(e)] && !cut3[G.head(e)]) 
   57.68 +    if (cut3[G.source(e)] && !cut3[G.target(e)]) 
   57.69        min_cut_value3+=cap[e];
   57.70    }
   57.71  
   57.72 @@ -145,7 +145,7 @@
   57.73    max_flow_test3.maxMinCut(maxcut3); 
   57.74    int max_min_cut_value3=0;
   57.75    for(G.first(e); G.valid(e); G.next(e)) {
   57.76 -    if (maxcut3[G.tail(e)] && !maxcut3[G.head(e)]) 
   57.77 +    if (maxcut3[G.source(e)] && !maxcut3[G.target(e)]) 
   57.78        max_min_cut_value3+=cap[e];
   57.79    }
   57.80  
    58.1 --- a/src/work/jacint/max_matching.cc	Sat Nov 13 12:24:01 2004 +0000
    58.2 +++ b/src/work/jacint/max_matching.cc	Sat Nov 13 12:53:28 2004 +0000
    58.3 @@ -190,8 +190,8 @@
    58.4    bool noedge=true;
    58.5    EdgeIt e;
    58.6    for(G.first(e); G.valid(e); G.next(e) ) {
    58.7 -    if ( (pos[G.head(e)]==max_matching.C && pos[G.tail(e)]==max_matching.D) || 
    58.8 -	 (pos[G.head(e)]==max_matching.D && pos[G.tail(e)]==max_matching.C) )
    58.9 +    if ( (pos[G.target(e)]==max_matching.C && pos[G.source(e)]==max_matching.D) || 
   58.10 +	 (pos[G.target(e)]==max_matching.D && pos[G.source(e)]==max_matching.C) )
   58.11        noedge=false; 
   58.12    }
   58.13    if ( noedge ) std::cout<<"OK"<<std::endl;
    59.1 --- a/src/work/jacint/max_matching.h	Sat Nov 13 12:24:01 2004 +0000
    59.2 +++ b/src/work/jacint/max_matching.h	Sat Nov 13 12:53:28 2004 +0000
    59.3 @@ -153,7 +153,7 @@
    59.4        for( G.first(v); G.valid(v); G.next(v)) {
    59.5  	Edge e=map[v];
    59.6  	if ( G.valid(e) )
    59.7 -	  G.tail(e) == v ? mate.set(v,G.head(e)) : mate.set(v,G.tail(e)); 
    59.8 +	  G.source(e) == v ? mate.set(v,G.target(e)) : mate.set(v,G.source(e)); 
    59.9        } 
   59.10      } 
   59.11      
   59.12 @@ -172,9 +172,9 @@
   59.13        }
   59.14        NodeIt e;
   59.15        for( G.first(e); G.valid(e); G.next(e)) {
   59.16 -	if ( todo[G.head(e)] && todo[G.tail(e)] ) {
   59.17 -	  Node u=G.tail(e);
   59.18 -	  Node v=G.head(e); 
   59.19 +	if ( todo[G.target(e)] && todo[G.source(e)] ) {
   59.20 +	  Node u=G.source(e);
   59.21 +	  Node v=G.target(e); 
   59.22  	  if ( mate[u]=v && mate[v]=u ) {
   59.23  	    map.set(u,e);
   59.24  	    map.set(v,e);
   59.25 @@ -196,8 +196,8 @@
   59.26        EdgeIt e;
   59.27        for( G.first(e); G.valid(e); G.next(e)) {
   59.28  	if ( G.valid(e) ) {
   59.29 -	  Node u=G.tail(e);	  
   59.30 -	  Node v=G.head(e);
   59.31 +	  Node u=G.source(e);	  
   59.32 +	  Node v=G.target(e);
   59.33  	  mate.set(u,v);
   59.34  	  mate.set(v,u);
   59.35  	} 
   59.36 @@ -222,9 +222,9 @@
   59.37        NodeIt e;
   59.38        for( G.first(e); G.valid(e); G.next(e)) {
   59.39  	map.set(e,false);
   59.40 -	if ( todo[G.head(e)] && todo[G.tail(e)] ) {
   59.41 -	  Node u=G.tail(e);
   59.42 -	  Node v=G.head(e); 
   59.43 +	if ( todo[G.target(e)] && todo[G.source(e)] ) {
   59.44 +	  Node u=G.source(e);
   59.45 +	  Node v=G.target(e); 
   59.46  	  if ( mate[u]=v && mate[v]=u ) {
   59.47  	    map.set(e,true);
   59.48  	    todo.set(u,false);
    60.1 --- a/src/work/jacint/max_save.h	Sat Nov 13 12:24:01 2004 +0000
    60.2 +++ b/src/work/jacint/max_save.h	Sat Nov 13 12:53:28 2004 +0000
    60.3 @@ -258,7 +258,7 @@
    60.4  
    60.5  	OutEdgeIt e;
    60.6  	for(g->first(e,w) ; g->valid(e); g->next(e)) {
    60.7 -	  Node v=g->head(e);
    60.8 +	  Node v=g->target(e);
    60.9  	  if (!M[v] && (*flow)[e] < (*capacity)[e] ) {
   60.10  	    queue.push(v);
   60.11  	    M.set(v, true);
   60.12 @@ -267,7 +267,7 @@
   60.13  
   60.14  	InEdgeIt f;
   60.15  	for(g->first(f,w) ; g->valid(f); g->next(f)) {
   60.16 -	  Node v=g->tail(f);
   60.17 +	  Node v=g->source(f);
   60.18  	  if (!M[v] && (*flow)[f] > 0 ) {
   60.19  	    queue.push(v);
   60.20  	    M.set(v, true);
   60.21 @@ -304,7 +304,7 @@
   60.22  
   60.23  	InEdgeIt e;
   60.24  	for(g->first(e,w) ; g->valid(e); g->next(e)) {
   60.25 -	  Node v=g->tail(e);
   60.26 +	  Node v=g->source(e);
   60.27  	  if (M[v] && (*flow)[e] < (*capacity)[e] ) {
   60.28  	    queue.push(v);
   60.29  	    M.set(v, false);
   60.30 @@ -313,7 +313,7 @@
   60.31  	
   60.32  	OutEdgeIt f;
   60.33  	for(g->first(f,w) ; g->valid(f); g->next(f)) {
   60.34 -	  Node v=g->head(f);
   60.35 +	  Node v=g->target(f);
   60.36  	  if (M[v] && (*flow)[f] > 0 ) {
   60.37  	    queue.push(v);
   60.38  	    M.set(v, false);
   60.39 @@ -369,7 +369,7 @@
   60.40        for(g->first(e,w); g->valid(e); g->next(e)) {
   60.41  	    
   60.42  	if ( (*flow)[e] >= (*capacity)[e] ) continue; 
   60.43 -	Node v=g->head(e);            
   60.44 +	Node v=g->target(e);            
   60.45  	    
   60.46  	if( lev > level[v] ) { //Push is allowed now
   60.47  	  
   60.48 @@ -402,7 +402,7 @@
   60.49  	for(g->first(e,w); g->valid(e); g->next(e)) {
   60.50  	  
   60.51  	  if( (*flow)[e] <= 0 ) continue; 
   60.52 -	  Node v=g->tail(e); 
   60.53 +	  Node v=g->source(e); 
   60.54  	  
   60.55  	  if( lev > level[v] ) { //Push is allowed now
   60.56  	    
   60.57 @@ -456,7 +456,7 @@
   60.58  	    
   60.59  				  InEdgeIt e;
   60.60  				  for(g->first(e,v); g->valid(e); g->next(e)) {
   60.61 -				    Node w=g->tail(e);
   60.62 +				    Node w=g->source(e);
   60.63  				    if ( level[w] == n && w != s ) {
   60.64  				      bfs_queue.push(w);
   60.65  				      Node first=level_list[l];
   60.66 @@ -474,7 +474,7 @@
   60.67  				  {
   60.68  				    Num c=(*capacity)[e];
   60.69  				    if ( c <= 0 ) continue;
   60.70 -				    Node w=g->head(e);
   60.71 +				    Node w=g->target(e);
   60.72  				    if ( level[w] < n ) {	  
   60.73  				      if ( excess[w] <= 0 && w!=t ) active[level[w]].push(w);
   60.74  				      flow->set(e, c); 
   60.75 @@ -501,7 +501,7 @@
   60.76  				  InEdgeIt e;
   60.77  				  for(g->first(e,v); g->valid(e); g->next(e)) {
   60.78  				    if ( (*capacity)[e] <= (*flow)[e] ) continue;
   60.79 -				    Node w=g->tail(e);
   60.80 +				    Node w=g->source(e);
   60.81  				    if ( level[w] == n && w != s ) {
   60.82  				      bfs_queue.push(w);
   60.83  				      Node first=level_list[l];
   60.84 @@ -515,7 +515,7 @@
   60.85  				  OutEdgeIt f;
   60.86  				  for(g->first(f,v); g->valid(f); g->next(f)) {
   60.87  				    if ( 0 >= (*flow)[f] ) continue;
   60.88 -				    Node w=g->head(f);
   60.89 +				    Node w=g->target(f);
   60.90  				    if ( level[w] == n && w != s ) {
   60.91  				      bfs_queue.push(w);
   60.92  				      Node first=level_list[l];
   60.93 @@ -534,7 +534,7 @@
   60.94  				  {
   60.95  				    Num rem=(*capacity)[e]-(*flow)[e];
   60.96  				    if ( rem <= 0 ) continue;
   60.97 -				    Node w=g->head(e);
   60.98 +				    Node w=g->target(e);
   60.99  				    if ( level[w] < n ) {	  
  60.100  				      if ( excess[w] <= 0 && w!=t ) active[level[w]].push(w);
  60.101  				      flow->set(e, (*capacity)[e]); 
  60.102 @@ -546,7 +546,7 @@
  60.103  				for(g->first(f,s); g->valid(f); g->next(f)) 
  60.104  				  {
  60.105  				    if ( (*flow)[f] <= 0 ) continue;
  60.106 -				    Node w=g->tail(f);
  60.107 +				    Node w=g->source(f);
  60.108  				    if ( level[w] < n ) {	  
  60.109  				      if ( excess[w] <= 0 && w!=t ) active[level[w]].push(w);
  60.110  				      excess.set(w, excess[w]+(*flow)[f]);
  60.111 @@ -644,9 +644,9 @@
  60.112        //       int get(const typename MapGraphWrapper::Node& n) const { 
  60.113        // 	return dist[n]; }
  60.114        //       bool get(const typename MapGraphWrapper::Edge& e) const { 
  60.115 -      // 	return (dist.get(g->tail(e))<dist.get(g->head(e))); }
  60.116 +      // 	return (dist.get(g->source(e))<dist.get(g->target(e))); }
  60.117        bool operator[](const typename MapGraphWrapper::Edge& e) const { 
  60.118 -	return (dist[g->tail(e)]<dist[g->head(e)]); 
  60.119 +	return (dist[g->source(e)]<dist[g->target(e)]); 
  60.120        }
  60.121      };
  60.122      
  60.123 @@ -783,7 +783,7 @@
  60.124        InEdgeIt e;
  60.125        for(g->first(e,v); g->valid(e); g->next(e)) {
  60.126  	if ( (*capacity)[e] <= (*flow)[e] ) continue;
  60.127 -	Node u=g->tail(e);
  60.128 +	Node u=g->source(e);
  60.129  	if ( level[u] >= n ) { 
  60.130  	  bfs_queue.push(u);
  60.131  	  level.set(u, l);
  60.132 @@ -794,7 +794,7 @@
  60.133        OutEdgeIt f;
  60.134        for(g->first(f,v); g->valid(f); g->next(f)) {
  60.135  	if ( 0 >= (*flow)[f] ) continue;
  60.136 -	Node u=g->head(f);
  60.137 +	Node u=g->target(f);
  60.138  	if ( level[u] >= n ) { 
  60.139  	  bfs_queue.push(u);
  60.140  	  level.set(u, l);
  60.141 @@ -846,15 +846,15 @@
  60.142      while ( !bfs.finished() ) { 
  60.143        ResGWOutEdgeIt e=bfs;
  60.144        if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
  60.145 -	Node v=res_graph.tail(e);
  60.146 -	Node w=res_graph.head(e);
  60.147 +	Node v=res_graph.source(e);
  60.148 +	Node w=res_graph.target(e);
  60.149  	pred.set(w, e);
  60.150  	if (res_graph.valid(pred[v])) {
  60.151  	  free.set(w, std::min(free[v], res_graph.resCap(e)));
  60.152  	} else {
  60.153  	  free.set(w, res_graph.resCap(e)); 
  60.154  	}
  60.155 -	if (res_graph.head(e)==t) { _augment=true; break; }
  60.156 +	if (res_graph.target(e)==t) { _augment=true; break; }
  60.157        }
  60.158  	
  60.159        ++bfs;
  60.160 @@ -866,7 +866,7 @@
  60.161        while (res_graph.valid(pred[n])) { 
  60.162  	ResGWEdge e=pred[n];
  60.163  	res_graph.augment(e, augment_value); 
  60.164 -	n=res_graph.tail(e);
  60.165 +	n=res_graph.source(e);
  60.166        }
  60.167      }
  60.168  
  60.169 @@ -919,15 +919,15 @@
  60.170        ResGWOutEdgeIt e=bfs;
  60.171        if (res_graph.valid(e)) {
  60.172  	if (bfs.isBNodeNewlyReached()) {
  60.173 -	  dist.set(res_graph.head(e), dist[res_graph.tail(e)]+1);
  60.174 -	  typename MG::Edge f=F.addEdge(res_graph_to_F[res_graph.tail(e)], res_graph_to_F[res_graph.head(e)]);
  60.175 +	  dist.set(res_graph.target(e), dist[res_graph.source(e)]+1);
  60.176 +	  typename MG::Edge f=F.addEdge(res_graph_to_F[res_graph.source(e)], res_graph_to_F[res_graph.target(e)]);
  60.177  	  original_edge.update();
  60.178  	  original_edge.set(f, e);
  60.179  	  residual_capacity.update();
  60.180  	  residual_capacity.set(f, res_graph.resCap(e));
  60.181  	} else {
  60.182 -	  if (dist[res_graph.head(e)]==(dist[res_graph.tail(e)]+1)) {
  60.183 -	    typename MG::Edge f=F.addEdge(res_graph_to_F[res_graph.tail(e)], res_graph_to_F[res_graph.head(e)]);
  60.184 +	  if (dist[res_graph.target(e)]==(dist[res_graph.source(e)]+1)) {
  60.185 +	    typename MG::Edge f=F.addEdge(res_graph_to_F[res_graph.source(e)], res_graph_to_F[res_graph.target(e)]);
  60.186  	    original_edge.update();
  60.187  	    original_edge.set(f, e);
  60.188  	    residual_capacity.update();
  60.189 @@ -981,7 +981,7 @@
  60.190  	while (F.valid(pred[n])) { 
  60.191  	  typename MG::Edge e=pred[n];
  60.192  	  res_graph.augment(original_edge[e], augment_value); 
  60.193 -	  n=F.tail(e);
  60.194 +	  n=F.source(e);
  60.195  	  if (residual_capacity[e]==augment_value) 
  60.196  	    F.erase(e); 
  60.197  	  else 
  60.198 @@ -1015,7 +1015,7 @@
  60.199      while ( !bfs.finished() ) { 
  60.200        ResGWOutEdgeIt e=bfs;
  60.201        if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
  60.202 -	dist.set(res_graph.head(e), dist[res_graph.tail(e)]+1);
  60.203 +	dist.set(res_graph.target(e), dist[res_graph.source(e)]+1);
  60.204        }
  60.205        ++bfs;
  60.206      } //computing distances from s in the residual graph
  60.207 @@ -1112,7 +1112,7 @@
  60.208  	while (erasing_res_graph.valid(pred[n])) { 
  60.209  	  typename ErasingResGW::OutEdgeIt e=pred[n];
  60.210  	  res_graph.augment(e, augment_value);
  60.211 -	  n=erasing_res_graph.tail(e);
  60.212 +	  n=erasing_res_graph.source(e);
  60.213  	  if (res_graph.resCap(e)==0)
  60.214  	    erasing_res_graph.erase(e);
  60.215  	}
    61.1 --- a/src/work/jacint/preflow.cc	Sat Nov 13 12:24:01 2004 +0000
    61.2 +++ b/src/work/jacint/preflow.cc	Sat Nov 13 12:53:28 2004 +0000
    61.3 @@ -46,9 +46,9 @@
    61.4    EdgeIt e;
    61.5    for(G.first(e); G.valid(e); G.next(e)) {
    61.6      int c=cap[e];
    61.7 -    if (mincut[G.tail(e)] && !mincut[G.head(e)]) min_min_cut_value+=c;
    61.8 -    if (cut[G.tail(e)] && !cut[G.head(e)]) min_cut_value+=c; 
    61.9 -    if (maxcut[G.tail(e)] && !maxcut[G.head(e)]) max_min_cut_value+=c;
   61.10 +    if (mincut[G.source(e)] && !mincut[G.target(e)]) min_min_cut_value+=c;
   61.11 +    if (cut[G.source(e)] && !cut[G.target(e)]) min_cut_value+=c; 
   61.12 +    if (maxcut[G.source(e)] && !maxcut[G.target(e)]) max_min_cut_value+=c;
   61.13    }
   61.14  
   61.15    std::cout << "\nChecking the result: " <<std::endl;  
   61.16 @@ -86,9 +86,9 @@
   61.17    int max_min_cut2_value=0;
   61.18    for(G.first(e); G.valid(e); G.next(e)) {
   61.19      int c=cap[e];
   61.20 -    if (mincut2[G.tail(e)] && !mincut2[G.head(e)]) min_min_cut2_value+=c;
   61.21 -    if (cut2[G.tail(e)] && !cut2[G.head(e)]) min_cut2_value+=c; 
   61.22 -    if (maxcut2[G.tail(e)] && !maxcut2[G.head(e)]) max_min_cut2_value+=c;
   61.23 +    if (mincut2[G.source(e)] && !mincut2[G.target(e)]) min_min_cut2_value+=c;
   61.24 +    if (cut2[G.source(e)] && !cut2[G.target(e)]) min_cut2_value+=c; 
   61.25 +    if (maxcut2[G.source(e)] && !maxcut2[G.target(e)]) max_min_cut2_value+=c;
   61.26    }
   61.27  
   61.28    std::cout << "\nThe given flow value is "
   61.29 @@ -138,10 +138,10 @@
   61.30    
   61.31    for(G.first(e); G.valid(e); G.next(e)) {
   61.32      int c=cap[e];
   61.33 -    if (mincut3[G.tail(e)] && !mincut3[G.head(e)]) min_min_cut3_value+=c;
   61.34 -    if (cut3[G.tail(e)] && !cut3[G.head(e)]) min_cut3_value+=c; 
   61.35 -    if (maxcut3[G.tail(e)] && !maxcut3[G.head(e)]) max_min_cut3_value+=c;
   61.36 -    if (actcut3[G.tail(e)] && !actcut3[G.head(e)]) act_min_cut3_value+=c;
   61.37 +    if (mincut3[G.source(e)] && !mincut3[G.target(e)]) min_min_cut3_value+=c;
   61.38 +    if (cut3[G.source(e)] && !cut3[G.target(e)]) min_cut3_value+=c; 
   61.39 +    if (maxcut3[G.source(e)] && !maxcut3[G.target(e)]) max_min_cut3_value+=c;
   61.40 +    if (actcut3[G.source(e)] && !actcut3[G.target(e)]) act_min_cut3_value+=c;
   61.41    }
   61.42  
   61.43   std::cout << "\nThe min cut value given by actMinCut() after phase 0 is "<<
   61.44 @@ -195,9 +195,9 @@
   61.45    int max_min_cut4_value=0;
   61.46    for(G.first(e); G.valid(e); G.next(e)) {
   61.47      int c=cap[e];
   61.48 -    if (mincut4[G.tail(e)] && !mincut4[G.head(e)]) min_min_cut4_value+=c;
   61.49 -    if (cut4[G.tail(e)] && !cut4[G.head(e)]) min_cut4_value+=c; 
   61.50 -    if (maxcut4[G.tail(e)] && !maxcut4[G.head(e)]) max_min_cut4_value+=c;
   61.51 +    if (mincut4[G.source(e)] && !mincut4[G.target(e)]) min_min_cut4_value+=c;
   61.52 +    if (cut4[G.source(e)] && !cut4[G.target(e)]) min_cut4_value+=c; 
   61.53 +    if (maxcut4[G.source(e)] && !maxcut4[G.target(e)]) max_min_cut4_value+=c;
   61.54    }
   61.55  
   61.56    std::cout << "\nThe given flow value is "
   61.57 @@ -238,9 +238,9 @@
   61.58    int max_min_cut5_value=0;
   61.59    for(G.first(e); G.valid(e); G.next(e)) {
   61.60      int c=cap[e];
   61.61 -    if (mincut5[G.tail(e)] && !mincut5[G.head(e)]) min_min_cut5_value+=c;
   61.62 -    if (cut5[G.tail(e)] && !cut5[G.head(e)]) min_cut5_value+=c; 
   61.63 -    if (maxcut5[G.tail(e)] && !maxcut5[G.head(e)]) max_min_cut5_value+=c;
   61.64 +    if (mincut5[G.source(e)] && !mincut5[G.target(e)]) min_min_cut5_value+=c;
   61.65 +    if (cut5[G.source(e)] && !cut5[G.target(e)]) min_cut5_value+=c; 
   61.66 +    if (maxcut5[G.source(e)] && !maxcut5[G.target(e)]) max_min_cut5_value+=c;
   61.67    }
   61.68  
   61.69    std::cout << "\nThe given flow value is "
    62.1 --- a/src/work/jacint/preflow_excess.h	Sat Nov 13 12:24:01 2004 +0000
    62.2 +++ b/src/work/jacint/preflow_excess.h	Sat Nov 13 12:53:28 2004 +0000
    62.3 @@ -136,7 +136,7 @@
    62.4  	  
    62.5  	  InEdgeIt e;
    62.6  	  for(G.first(e,v); G.valid(e); G.next(e)) {
    62.7 -	    Node w=G.tail(e);
    62.8 +	    Node w=G.source(e);
    62.9  	    if ( level[w] == n && w != s ) {
   62.10  	      bfs_queue.push(w);
   62.11  	      Node first=level_list[l];
   62.12 @@ -154,7 +154,7 @@
   62.13  	{
   62.14  	  T c=capacity[e];
   62.15  	  if ( c == 0 ) continue;
   62.16 -	  Node w=G.head(e);
   62.17 +	  Node w=G.target(e);
   62.18  	  if ( level[w] < n ) {	  
   62.19  	    if ( excess[w] == 0 && w!=t ) active[level[w]].push(w);
   62.20  	    flow.set(e, c); 
   62.21 @@ -182,7 +182,7 @@
   62.22  	  InEdgeIt e;
   62.23  	  for(G.first(e,v); G.valid(e); G.next(e)) {
   62.24  	    if ( capacity[e] == flow[e] ) continue;
   62.25 -	    Node w=G.tail(e);
   62.26 +	    Node w=G.source(e);
   62.27  	    if ( level[w] == n && w != s ) {
   62.28  	      bfs_queue.push(w);
   62.29  	      Node first=level_list[l];
   62.30 @@ -196,7 +196,7 @@
   62.31  	  OutEdgeIt f;
   62.32  	  for(G.first(f,v); G.valid(f); G.next(f)) {
   62.33  	    if ( 0 == flow[f] ) continue;
   62.34 -	    Node w=G.head(f);
   62.35 +	    Node w=G.target(f);
   62.36  	    if ( level[w] == n && w != s ) {
   62.37  	      bfs_queue.push(w);
   62.38  	      Node first=level_list[l];
   62.39 @@ -247,7 +247,7 @@
   62.40  	{
   62.41  	  T rem=capacity[e]-flow[e];
   62.42  	  if ( rem == 0 ) continue;
   62.43 -	  Node w=G.head(e);
   62.44 +	  Node w=G.target(e);
   62.45  	  if ( level[w] < n ) {	  
   62.46  	    if ( excess[w] == 0 && w!=t ) active[level[w]].push(w);
   62.47  	    flow.set(e, capacity[e]); 
   62.48 @@ -259,7 +259,7 @@
   62.49  	for(G.first(f,s); G.valid(f); G.next(f)) 
   62.50  	{
   62.51  	  if ( flow[f] == 0 ) continue;
   62.52 -	  Node w=G.tail(f);
   62.53 +	  Node w=G.source(f);
   62.54  	  if ( level[w] < n ) {	  
   62.55  	    if ( excess[w] == 0 && w!=t ) active[level[w]].push(w);
   62.56  	    excess.set(w, excess[w]+flow[f]);
   62.57 @@ -303,7 +303,7 @@
   62.58  	      InEdgeIt e;
   62.59  	      for(G.first(e,v); G.valid(e); G.next(e)) {
   62.60  		if ( capacity[e] == flow[e] ) continue;
   62.61 -		Node u=G.tail(e);
   62.62 +		Node u=G.source(e);
   62.63  		if ( level[u] >= n ) { 
   62.64  		  bfs_queue.push(u);
   62.65  		  level.set(u, l);
   62.66 @@ -314,7 +314,7 @@
   62.67  	      OutEdgeIt f;
   62.68  	      for(G.first(f,v); G.valid(f); G.next(f)) {
   62.69  		if ( 0 == flow[f] ) continue;
   62.70 -		Node u=G.head(f);
   62.71 +		Node u=G.target(f);
   62.72  		if ( level[u] >= n ) { 
   62.73  		  bfs_queue.push(u);
   62.74  		  level.set(u, l);
   62.75 @@ -343,7 +343,7 @@
   62.76  	  for(G.first(e,w); G.valid(e); G.next(e)) {
   62.77  	    
   62.78  	    if ( flow[e] == capacity[e] ) continue; 
   62.79 -	    Node v=G.head(e);            
   62.80 +	    Node v=G.target(e);            
   62.81  	    //e=wv	    
   62.82  	    
   62.83  	    if( lev > level[v] ) {      
   62.84 @@ -385,7 +385,7 @@
   62.85  	  for(G.first(e,w); G.valid(e); G.next(e)) {
   62.86  	    
   62.87  	    if( flow[e] == 0 ) continue; 
   62.88 -	    Node v=G.tail(e);  
   62.89 +	    Node v=G.source(e);  
   62.90  	    //e=vw
   62.91  	    
   62.92  	    if( lev > level[v] ) {  
   62.93 @@ -569,7 +569,7 @@
   62.94  
   62.95  	OutEdgeIt e;
   62.96  	for(G.first(e,w) ; G.valid(e); G.next(e)) {
   62.97 -	  Node v=G.head(e);
   62.98 +	  Node v=G.target(e);
   62.99  	  if (!M[v] && flow[e] < capacity[e] ) {
  62.100  	    queue.push(v);
  62.101  	    M.set(v, true);
  62.102 @@ -578,7 +578,7 @@
  62.103  
  62.104  	InEdgeIt f;
  62.105  	for(G.first(f,w) ; G.valid(f); G.next(f)) {
  62.106 -	  Node v=G.tail(f);
  62.107 +	  Node v=G.source(f);
  62.108  	  if (!M[v] && flow[f] > 0 ) {
  62.109  	    queue.push(v);
  62.110  	    M.set(v, true);
  62.111 @@ -609,7 +609,7 @@
  62.112  
  62.113  	InEdgeIt e;
  62.114  	for(G.first(e,w) ; G.valid(e); G.next(e)) {
  62.115 -	  Node v=G.tail(e);
  62.116 +	  Node v=G.source(e);
  62.117  	  if (!M[v] && flow[e] < capacity[e] ) {
  62.118  	    queue.push(v);
  62.119  	    M.set(v, true);
  62.120 @@ -618,7 +618,7 @@
  62.121  	
  62.122  	OutEdgeIt f;
  62.123  	for(G.first(f,w) ; G.valid(f); G.next(f)) {
  62.124 -	  Node v=G.head(f);
  62.125 +	  Node v=G.target(f);
  62.126  	  if (!M[v] && flow[f] > 0 ) {
  62.127  	    queue.push(v);
  62.128  	    M.set(v, true);
    63.1 --- a/src/work/jacint/preflow_excess_test.cc	Sat Nov 13 12:24:01 2004 +0000
    63.2 +++ b/src/work/jacint/preflow_excess_test.cc	Sat Nov 13 12:53:28 2004 +0000
    63.3 @@ -52,14 +52,14 @@
    63.4    int min_min_cut_value=0;
    63.5    EdgeIt e;
    63.6    for(G.first(e); G.valid(e); G.next(e)) {
    63.7 -    if (mincut[G.tail(e)] && !mincut[G.head(e)]) min_min_cut_value+=cap[e];
    63.8 +    if (mincut[G.source(e)] && !mincut[G.target(e)]) min_min_cut_value+=cap[e];
    63.9    }
   63.10  
   63.11    Graph::NodeMap<bool> cut(G);
   63.12    max_flow_test.minCut(cut); 
   63.13    int min_cut_value=0;
   63.14    for(G.first(e); G.valid(e); G.next(e)) {
   63.15 -    if (cut[G.tail(e)] && !cut[G.head(e)]) 
   63.16 +    if (cut[G.source(e)] && !cut[G.target(e)]) 
   63.17        min_cut_value+=cap[e];
   63.18    }
   63.19  
   63.20 @@ -67,7 +67,7 @@
   63.21    max_flow_test.maxMinCut(maxcut); 
   63.22    int max_min_cut_value=0;
   63.23    for(G.first(e); G.valid(e); G.next(e)) {
   63.24 -    if (maxcut[G.tail(e)] && !maxcut[G.head(e)]) 
   63.25 +    if (maxcut[G.source(e)] && !maxcut[G.target(e)]) 
   63.26        max_min_cut_value+=cap[e];
   63.27        }
   63.28  
   63.29 @@ -99,14 +99,14 @@
   63.30    max_flow_test2.minMinCut(mincut2); 
   63.31    int min_min_cut_value2=0;
   63.32      for(G.first(e); G.valid(e); G.next(e)) {
   63.33 -    if (mincut2[G.tail(e)] && !mincut2[G.head(e)]) min_min_cut_value2+=cap[e];
   63.34 +    if (mincut2[G.source(e)] && !mincut2[G.target(e)]) min_min_cut_value2+=cap[e];
   63.35    }
   63.36  
   63.37    Graph::NodeMap<bool> cut2(G);
   63.38    max_flow_test2.minCut(cut2); 
   63.39    int min_cut_value2=0;
   63.40    for(G.first(e); G.valid(e); G.next(e)) {
   63.41 -    if (cut2[G.tail(e)] && !cut2[G.head(e)]) 
   63.42 +    if (cut2[G.source(e)] && !cut2[G.target(e)]) 
   63.43        min_cut_value2+=cap[e];
   63.44    }
   63.45  
   63.46 @@ -114,7 +114,7 @@
   63.47    max_flow_test2.maxMinCut(maxcut2); 
   63.48    int max_min_cut_value2=0;
   63.49    for(G.first(e); G.valid(e); G.next(e)) {
   63.50 -    if (maxcut2[G.tail(e)] && !maxcut2[G.head(e)]) 
   63.51 +    if (maxcut2[G.source(e)] && !maxcut2[G.target(e)]) 
   63.52        max_min_cut_value2+=cap[e];
   63.53        }
   63.54    
   63.55 @@ -144,14 +144,14 @@
   63.56    max_flow_test3.minMinCut(mincut3); 
   63.57    int min_min_cut_value3=0;
   63.58    for(G.first(e); G.valid(e); G.next(e)) {
   63.59 -    if (mincut3[G.tail(e)] && !mincut3[G.head(e)]) min_min_cut_value3+=cap[e];
   63.60 +    if (mincut3[G.source(e)] && !mincut3[G.target(e)]) min_min_cut_value3+=cap[e];
   63.61    }
   63.62  
   63.63    Graph::NodeMap<bool> cut3(G);
   63.64    max_flow_test3.minCut(cut3); 
   63.65    int min_cut_value3=0;
   63.66    for(G.first(e); G.valid(e); G.next(e)) {
   63.67 -    if (cut3[G.tail(e)] && !cut3[G.head(e)]) 
   63.68 +    if (cut3[G.source(e)] && !cut3[G.target(e)]) 
   63.69        min_cut_value3+=cap[e];
   63.70    }
   63.71  
   63.72 @@ -159,7 +159,7 @@
   63.73    max_flow_test3.maxMinCut(maxcut3); 
   63.74    int max_min_cut_value3=0;
   63.75    for(G.first(e); G.valid(e); G.next(e)) {
   63.76 -    if (maxcut3[G.tail(e)] && !maxcut3[G.head(e)]) 
   63.77 +    if (maxcut3[G.source(e)] && !maxcut3[G.target(e)]) 
   63.78        max_min_cut_value3+=cap[e];
   63.79        }
   63.80  
    64.1 --- a/src/work/jacint/preflow_res.h	Sat Nov 13 12:24:01 2004 +0000
    64.2 +++ b/src/work/jacint/preflow_res.h	Sat Nov 13 12:53:28 2004 +0000
    64.3 @@ -102,7 +102,7 @@
    64.4  	ResInEdgeIt e;
    64.5  	for(res_graph.first(e,v); res_graph.valid(e); 
    64.6  	    res_graph.next(e)) {
    64.7 -	  Node w=res_graph.tail(e);
    64.8 +	  Node w=res_graph.source(e);
    64.9  	  if ( level[w] == n && w != s ) {
   64.10  	    bfs_queue.push(w);
   64.11  	    Node first=level_list[l];
   64.12 @@ -145,7 +145,7 @@
   64.13        ResOutEdgeIt e;
   64.14        for(res_graph.first(e,s); res_graph.valid(e); 
   64.15  	  res_graph.next(e)) {
   64.16 -	  Node w=res_graph.head(e);
   64.17 +	  Node w=res_graph.target(e);
   64.18  	  if ( level[w] < n ) {	  
   64.19  	    if ( excess[w] == 0 && w!=t ) {
   64.20  	      next.set(w,active[level[w]]);
   64.21 @@ -190,7 +190,7 @@
   64.22  	      ResInEdgeIt e;
   64.23  	      for(res_graph.first(e,v); 
   64.24  		  res_graph.valid(e); res_graph.next(e)) {
   64.25 -		Node u=res_graph.tail(e);
   64.26 +		Node u=res_graph.source(e);
   64.27  		if ( level[u] >= n ) { 
   64.28  		  bfs_queue.push(u);
   64.29  		  level.set(u, l);
   64.30 @@ -221,7 +221,7 @@
   64.31  	  ResOutEdgeIt e;
   64.32  	  for(res_graph.first(e,w); res_graph.valid(e); res_graph.next(e)) {
   64.33  	    
   64.34 -	    Node v=res_graph.head(e);            
   64.35 +	    Node v=res_graph.target(e);            
   64.36  	    if( lev > level[v] ) {      
   64.37  	      /*Push is allowed now*/
   64.38  	      
   64.39 @@ -400,7 +400,7 @@
   64.40  
   64.41  	OutEdgeIt e;
   64.42  	for(G.first(e,w) ; G.valid(e); G.next(e)) {
   64.43 -	  Node v=G.head(e);
   64.44 +	  Node v=G.target(e);
   64.45  	  if (!M[v] && flow[e] < capacity[e] ) {
   64.46  	    queue.push(v);
   64.47  	    M.set(v, true);
   64.48 @@ -409,7 +409,7 @@
   64.49  
   64.50  	InEdgeIt f;
   64.51  	for(G.first(f,w) ; G.valid(f); G.next(f)) {
   64.52 -	  Node v=G.tail(f);
   64.53 +	  Node v=G.source(f);
   64.54  	  if (!M[v] && flow[f] > 0 ) {
   64.55  	    queue.push(v);
   64.56  	    M.set(v, true);
   64.57 @@ -440,7 +440,7 @@
   64.58  
   64.59  	InEdgeIt e;
   64.60  	for(G.first(e,w) ; G.valid(e); G.next(e)) {
   64.61 -	  Node v=G.tail(e);
   64.62 +	  Node v=G.source(e);
   64.63  	  if (!M[v] && flow[e] < capacity[e] ) {
   64.64  	    queue.push(v);
   64.65  	    M.set(v, true);
   64.66 @@ -449,7 +449,7 @@
   64.67  	
   64.68  	OutEdgeIt f;
   64.69  	for(G.first(f,w) ; G.valid(f); G.next(f)) {
   64.70 -	  Node v=G.head(f);
   64.71 +	  Node v=G.target(f);
   64.72  	  if (!M[v] && flow[f] > 0 ) {
   64.73  	    queue.push(v);
   64.74  	    M.set(v, true);
    65.1 --- a/src/work/jacint/prim.h	Sat Nov 13 12:24:01 2004 +0000
    65.2 +++ b/src/work/jacint/prim.h	Sat Nov 13 12:53:28 2004 +0000
    65.3 @@ -95,7 +95,7 @@
    65.4  
    65.5  	  OutEdgeIt e;
    65.6  	  for( G.first(e,v); G.valid(e); G.next(e)) {
    65.7 -	    Node w=G.head(e); 
    65.8 +	    Node w=G.target(e); 
    65.9  	    
   65.10  	    if ( !scanned[w] ) {
   65.11  	      if ( !reach[w] ) {
   65.12 @@ -111,7 +111,7 @@
   65.13  
   65.14  	  InEdgeIt f;
   65.15  	  for( G.first(f,v); G.valid(f); G.next(f)) {
   65.16 -	    Node w=G.tail(f); 
   65.17 +	    Node w=G.source(f); 
   65.18  	    
   65.19  	    if ( !scanned[w] ) {
   65.20  	      if ( !reach[w] ) {
    66.1 --- a/src/work/johanna/ma_order.h	Sat Nov 13 12:24:01 2004 +0000
    66.2 +++ b/src/work/johanna/ma_order.h	Sat Nov 13 12:53:28 2004 +0000
    66.3 @@ -57,7 +57,7 @@
    66.4  	  OutEdgeIt e;
    66.5  	  G.first(e,a);
    66.6  	  for (;G.valid(e);G.next(e)) {
    66.7 -	    Node v = G.head(e); // hmm
    66.8 +	    Node v = G.target(e); // hmm
    66.9  	    if (heap.state(v) == Heap::IN_HEAP ) {
   66.10  	      heap.decrease(v, heap[v]+1);
   66.11  	    }
    67.1 --- a/src/work/marci/augmenting_flow.h	Sat Nov 13 12:24:01 2004 +0000
    67.2 +++ b/src/work/marci/augmenting_flow.h	Sat Nov 13 12:53:28 2004 +0000
    67.3 @@ -210,7 +210,7 @@
    67.4  
    67.5  	OutEdgeIt e;
    67.6  	for(g->first(e,w) ; e!=INVALID; ++e) {
    67.7 -	  Node v=g->head(e);
    67.8 +	  Node v=g->target(e);
    67.9  	  if (!M[v] && (*flow)[e] < (*capacity)[e] ) {
   67.10  	    queue.push(v);
   67.11  	    M.set(v, true);
   67.12 @@ -219,7 +219,7 @@
   67.13  
   67.14  	InEdgeIt f;
   67.15  	for(g->first(f,w) ; f!=INVALID; ++f) {
   67.16 -	  Node v=g->tail(f);
   67.17 +	  Node v=g->source(f);
   67.18  	  if (!M[v] && (*flow)[f] > 0 ) {
   67.19  	    queue.push(v);
   67.20  	    M.set(v, true);
   67.21 @@ -270,15 +270,15 @@
   67.22      while ( !bfs.finished() ) {
   67.23        ResGWEdge e=bfs;
   67.24        if (e!=INVALID && bfs.isBNodeNewlyReached()) {
   67.25 -	Node v=res_graph.tail(e);
   67.26 -	Node w=res_graph.head(e);
   67.27 +	Node v=res_graph.source(e);
   67.28 +	Node w=res_graph.target(e);
   67.29  	pred.set(w, e);
   67.30  	if (pred[v]!=INVALID) {
   67.31  	  free.set(w, std::min(free[v], res_cap[e]));
   67.32  	} else {
   67.33  	  free.set(w, res_cap[e]);
   67.34  	}
   67.35 -	if (res_graph.head(e)==t) { _augment=true; break; }
   67.36 +	if (res_graph.target(e)==t) { _augment=true; break; }
   67.37        }
   67.38  
   67.39        ++bfs;
   67.40 @@ -290,7 +290,7 @@
   67.41        while (pred[n]!=INVALID) {
   67.42  	ResGWEdge e=pred[n];
   67.43  	res_graph.augment(e, augment_value);
   67.44 -	n=res_graph.tail(e);
   67.45 +	n=res_graph.source(e);
   67.46        }
   67.47      }
   67.48  
   67.49 @@ -329,15 +329,15 @@
   67.50      while ( !bfs.finished() ) {
   67.51        ResGWEdge e=bfs;
   67.52        if (e!=INVALID && bfs.isBNodeNewlyReached()) {
   67.53 -	Node v=res_graph.tail(e);
   67.54 -	Node w=res_graph.head(e);
   67.55 +	Node v=res_graph.source(e);
   67.56 +	Node w=res_graph.target(e);
   67.57  	pred.set(w, e);
   67.58  	if (pred[v]!=INVALID) {
   67.59  	  free.set(w, std::min(free[v], res_cap[e]));
   67.60  	} else {
   67.61  	  free.set(w, res_cap[e]);
   67.62  	}
   67.63 -	if (res_graph.head(e)==t) { _augment=true; break; }
   67.64 +	if (res_graph.target(e)==t) { _augment=true; break; }
   67.65        }
   67.66  
   67.67        ++bfs;
   67.68 @@ -349,7 +349,7 @@
   67.69        while (pred[n]!=INVALID) {
   67.70  	ResGWEdge e=pred[n];
   67.71  	res_graph.augment(e, augment_value);
   67.72 -	n=res_graph.tail(e);
   67.73 +	n=res_graph.source(e);
   67.74        }
   67.75      }
   67.76  
   67.77 @@ -395,17 +395,17 @@
   67.78        ResGWEdge e=bfs;
   67.79        if (e!=INVALID) {
   67.80  	if (bfs.isBNodeNewlyReached()) {
   67.81 -	  dist.set(res_graph.head(e), dist[res_graph.tail(e)]+1);
   67.82 -	  typename MG::Edge f=F.addEdge(res_graph_to_F[res_graph.tail(e)],
   67.83 -					res_graph_to_F[res_graph.head(e)]);
   67.84 +	  dist.set(res_graph.target(e), dist[res_graph.source(e)]+1);
   67.85 +	  typename MG::Edge f=F.addEdge(res_graph_to_F[res_graph.source(e)],
   67.86 +					res_graph_to_F[res_graph.target(e)]);
   67.87  	  //original_edge.update();
   67.88  	  original_edge.set(f, e);
   67.89  	  //residual_capacity.update();
   67.90  	  residual_capacity.set(f, res_cap[e]);
   67.91  	} else {
   67.92 -	  if (dist[res_graph.head(e)]==(dist[res_graph.tail(e)]+1)) {
   67.93 -	    typename MG::Edge f=F.addEdge(res_graph_to_F[res_graph.tail(e)],
   67.94 -					  res_graph_to_F[res_graph.head(e)]);
   67.95 +	  if (dist[res_graph.target(e)]==(dist[res_graph.source(e)]+1)) {
   67.96 +	    typename MG::Edge f=F.addEdge(res_graph_to_F[res_graph.source(e)],
   67.97 +					  res_graph_to_F[res_graph.target(e)]);
   67.98  	    //original_edge.update();
   67.99  	    original_edge.set(f, e);
  67.100  	    //residual_capacity.update();
  67.101 @@ -433,8 +433,8 @@
  67.102  	++dfs;
  67.103  	if (typename MG::Edge(dfs)!=INVALID) {
  67.104  	  if (dfs.isBNodeNewlyReached()) {
  67.105 -	    typename MG::Node v=F.tail(dfs);
  67.106 -	    typename MG::Node w=F.head(dfs);
  67.107 +	    typename MG::Node v=F.source(dfs);
  67.108 +	    typename MG::Node w=F.target(dfs);
  67.109  	    pred.set(w, dfs);
  67.110  	    if (pred[v]!=INVALID) {
  67.111  	      free.set(w, std::min(free[v], residual_capacity[dfs]));
  67.112 @@ -459,7 +459,7 @@
  67.113  	while (pred[n]!=INVALID) {
  67.114  	  typename MG::Edge e=pred[n];
  67.115  	  res_graph.augment(original_edge[e], augment_value);
  67.116 -	  n=F.tail(e);
  67.117 +	  n=F.source(e);
  67.118  	  if (residual_capacity[e]==augment_value)
  67.119  	    F.erase(e);
  67.120  	  else
  67.121 @@ -498,7 +498,7 @@
  67.122      while ( !bfs.finished() ) {
  67.123        ResGWEdge e=bfs;
  67.124        if (e!=INVALID && bfs.isBNodeNewlyReached())
  67.125 -	potential.set(res_graph.head(e), potential[res_graph.tail(e)]+1);
  67.126 +	potential.set(res_graph.target(e), potential[res_graph.source(e)]+1);
  67.127        ++bfs;
  67.128      } 
  67.129  
  67.130 @@ -553,8 +553,8 @@
  67.131  	if (typename ErasingResGW::Edge(dfs)!=INVALID) {
  67.132  	  if (dfs.isBNodeNewlyReached()) {
  67.133  	    
  67.134 -	    typename ErasingResGW::Node v=erasing_res_graph.tail(dfs);
  67.135 -	    typename ErasingResGW::Node w=erasing_res_graph.head(dfs);
  67.136 +	    typename ErasingResGW::Node v=erasing_res_graph.source(dfs);
  67.137 +	    typename ErasingResGW::Node w=erasing_res_graph.target(dfs);
  67.138  
  67.139  	    pred.set(w, typename ErasingResGW::Edge(dfs));
  67.140  	    if (pred[v]!=INVALID) {
  67.141 @@ -585,7 +585,7 @@
  67.142  	while (pred[n]!=INVALID) {
  67.143  	  typename ErasingResGW::Edge e=pred[n];
  67.144  	  res_graph.augment(e, augment_value);
  67.145 -	  n=erasing_res_graph.tail(e);
  67.146 +	  n=erasing_res_graph.source(e);
  67.147  	  if (res_cap[e]==0)
  67.148  	    erasing_res_graph.erase(e);
  67.149  	}
    68.1 --- a/src/work/marci/bfs_dfs.h	Sat Nov 13 12:24:01 2004 +0000
    68.2 +++ b/src/work/marci/bfs_dfs.h	Sat Nov 13 12:53:28 2004 +0000
    68.3 @@ -63,7 +63,7 @@
    68.4  	actual_edge=OutEdgeIt(*graph, s);
    68.5  	//graph->first(actual_edge, s);
    68.6  	if (actual_edge!=INVALID) { 
    68.7 -	  Node w=graph->head(actual_edge);
    68.8 +	  Node w=graph->target(actual_edge);
    68.9  	  if (!reached[w]) {
   68.10  	    bfs_queue.push(w);
   68.11  	    reached.set(w, true);
   68.12 @@ -85,7 +85,7 @@
   68.13  	actual_edge=++OutEdgeIt(*graph, actual_edge);
   68.14  	//++actual_edge;
   68.15  	if (actual_edge!=INVALID) {
   68.16 -	  Node w=graph->head(actual_edge);
   68.17 +	  Node w=graph->target(actual_edge);
   68.18  	  if (!reached[w]) {
   68.19  	    bfs_queue.push(w);
   68.20  	    reached.set(w, true);
   68.21 @@ -100,7 +100,7 @@
   68.22  	  actual_edge=OutEdgeIt(*graph, bfs_queue.front());
   68.23  	  //graph->first(actual_edge, bfs_queue.front());
   68.24  	  if (actual_edge!=INVALID) {
   68.25 -	    Node w=graph->head(actual_edge);
   68.26 +	    Node w=graph->target(actual_edge);
   68.27  	    if (!reached[w]) {
   68.28  	      bfs_queue.push(w);
   68.29  	      reached.set(w, true);
   68.30 @@ -124,9 +124,9 @@
   68.31      /// Returns if a-node is examined.
   68.32      bool isANodeExamined() const { return actual_edge==INVALID; }
   68.33      /// Returns a-node of the actual edge, so does if the edge is invalid.
   68.34 -    Node tail() const { return bfs_queue.front(); }
   68.35 +    Node source() const { return bfs_queue.front(); }
   68.36      /// \pre The actual edge have to be valid.
   68.37 -    Node head() const { return graph->head(actual_edge); }
   68.38 +    Node target() const { return graph->target(actual_edge); }
   68.39      /// Guess what?
   68.40      /// \deprecated 
   68.41      const ReachedMap& getReachedMap() const { return reached; }
   68.42 @@ -186,8 +186,8 @@
   68.43        Parent::operator++();
   68.44        if (this->graph->valid(this->actual_edge) && this->b_node_newly_reached) 
   68.45        {
   68.46 -	pred.set(this->head(), this->actual_edge);
   68.47 -	dist.set(this->head(), dist[this->tail()]);
   68.48 +	pred.set(this->target(), this->actual_edge);
   68.49 +	dist.set(this->target(), dist[this->source()]);
   68.50        }
   68.51        return *this;
   68.52      }
   68.53 @@ -246,7 +246,7 @@
   68.54      operator++() { 
   68.55        actual_edge=dfs_stack.top();
   68.56        if (actual_edge!=INVALID/*.valid()*/) { 
   68.57 -	Node w=graph->head(actual_edge);
   68.58 +	Node w=graph->target(actual_edge);
   68.59  	actual_node=w;
   68.60  	if (!reached[w]) {
   68.61  	  OutEdgeIt e(*graph, w);
   68.62 @@ -255,7 +255,7 @@
   68.63  	  reached.set(w, true);
   68.64  	  b_node_newly_reached=true;
   68.65  	} else {
   68.66 -	  actual_node=graph->tail(actual_edge);
   68.67 +	  actual_node=graph->source(actual_edge);
   68.68  	  ++dfs_stack.top();
   68.69  	  b_node_newly_reached=false;
   68.70  	}
   68.71 @@ -276,10 +276,10 @@
   68.72      /// Returns if a-node is examined.
   68.73      bool isANodeExamined() const { return actual_edge==INVALID; }
   68.74      /// Returns a-node of the actual edge, so does if the edge is invalid.
   68.75 -    Node tail() const { return actual_node; /*FIXME*/}
   68.76 +    Node source() const { return actual_node; /*FIXME*/}
   68.77      /// Returns b-node of the actual edge. 
   68.78      /// \pre The actual edge have to be valid.
   68.79 -    Node head() const { return graph->head(actual_edge); }
   68.80 +    Node target() const { return graph->target(actual_edge); }
   68.81      /// Guess what?
   68.82      /// \deprecated
   68.83      const ReachedMap& getReachedMap() const { return reached; }
   68.84 @@ -333,7 +333,7 @@
   68.85        Parent::operator++();
   68.86        if (this->graph->valid(this->actual_edge) && this->b_node_newly_reached) 
   68.87        {
   68.88 -	pred.set(this->head(), this->actual_edge);
   68.89 +	pred.set(this->target(), this->actual_edge);
   68.90        }
   68.91        return *this;
   68.92      }
    69.1 --- a/src/work/marci/bfs_mm.h	Sat Nov 13 12:24:01 2004 +0000
    69.2 +++ b/src/work/marci/bfs_mm.h	Sat Nov 13 12:53:28 2004 +0000
    69.3 @@ -71,7 +71,7 @@
    69.4  	actual_edge=OutEdgeIt(*graph, s);
    69.5  	//graph->first(actual_edge, s);
    69.6  	if (actual_edge!=INVALID) { 
    69.7 -	  Node w=graph->head(actual_edge);
    69.8 +	  Node w=graph->target(actual_edge);
    69.9  	  if (!(*reached_map)[w]) {
   69.10  	    bfs_queue.push(w);
   69.11  	    reached_map->set(w, true);
   69.12 @@ -93,7 +93,7 @@
   69.13  	actual_edge=++OutEdgeIt(*graph, actual_edge);
   69.14  	//++actual_edge;
   69.15  	if (actual_edge!=INVALID) {
   69.16 -	  Node w=graph->head(actual_edge);
   69.17 +	  Node w=graph->target(actual_edge);
   69.18  	  if (!(*reached_map)[w]) {
   69.19  	    bfs_queue.push(w);
   69.20  	    reached_map->set(w, true);
   69.21 @@ -108,7 +108,7 @@
   69.22  	  actual_edge=OutEdgeIt(*graph, bfs_queue.front());
   69.23  	  //graph->first(actual_edge, bfs_queue.front());
   69.24  	  if (actual_edge!=INVALID) {
   69.25 -	    Node w=graph->head(actual_edge);
   69.26 +	    Node w=graph->target(actual_edge);
   69.27  	    if (!(*reached_map)[w]) {
   69.28  	      bfs_queue.push(w);
   69.29  	      reached_map->set(w, true);
   69.30 @@ -132,9 +132,9 @@
   69.31      /// Returns if a-node is examined.
   69.32      bool isANodeExamined() const { return actual_edge==INVALID; }
   69.33      /// Returns a-node of the actual edge, so does if the edge is invalid.
   69.34 -    Node tail() const { return bfs_queue.front(); }
   69.35 +    Node source() const { return bfs_queue.front(); }
   69.36      /// \pre The actual edge have to be valid.
   69.37 -    Node head() const { return graph->head(actual_edge); }
   69.38 +    Node target() const { return graph->target(actual_edge); }
   69.39      /// Guess what?
   69.40      /// \deprecated 
   69.41      const ReachedMap& reachedMap() const { return *reached_map; }
   69.42 @@ -231,9 +231,9 @@
   69.43        Parent::operator++();
   69.44        if ((this->actual_edge)!=INVALID && this->b_node_newly_reached) 
   69.45        {
   69.46 -	pred_map->set(this->head(), this->actual_edge);
   69.47 -	pred_node_map->set(this->head(), this->tail());
   69.48 -	dist_map->set(this->head(), (*dist_map)[this->tail()]);
   69.49 +	pred_map->set(this->target(), this->actual_edge);
   69.50 +	pred_node_map->set(this->target(), this->source());
   69.51 +	dist_map->set(this->target(), (*dist_map)[this->source()]);
   69.52        }
   69.53        return *this;
   69.54      }
   69.55 @@ -457,7 +457,7 @@
   69.56      operator++() { 
   69.57        actual_edge=dfs_stack.top();
   69.58        if (actual_edge!=INVALID/*.valid()*/) { 
   69.59 -	Node w=graph->head(actual_edge);
   69.60 +	Node w=graph->target(actual_edge);
   69.61  	actual_node=w;
   69.62  	if (!reached[w]) {
   69.63  	  OutEdgeIt e(*graph, w);
   69.64 @@ -466,7 +466,7 @@
   69.65  	  reached.set(w, true);
   69.66  	  b_node_newly_reached=true;
   69.67  	} else {
   69.68 -	  actual_node=graph->tail(actual_edge);
   69.69 +	  actual_node=graph->source(actual_edge);
   69.70  	  ++dfs_stack.top();
   69.71  	  b_node_newly_reached=false;
   69.72  	}
   69.73 @@ -487,10 +487,10 @@
   69.74      /// Returns if a-node is examined.
   69.75      bool isANodeExamined() const { return actual_edge==INVALID; }
   69.76      /// Returns a-node of the actual edge, so does if the edge is invalid.
   69.77 -    Node tail() const { return actual_node; /*FIXME*/}
   69.78 +    Node source() const { return actual_node; /*FIXME*/}
   69.79      /// Returns b-node of the actual edge. 
   69.80      /// \pre The actual edge have to be valid.
   69.81 -    Node head() const { return graph->head(actual_edge); }
   69.82 +    Node target() const { return graph->target(actual_edge); }
   69.83      /// Guess what?
   69.84      /// \deprecated
   69.85      const ReachedMap& getReachedMap() const { return reached; }
   69.86 @@ -544,7 +544,7 @@
   69.87        Parent::operator++();
   69.88        if (this->graph->valid(this->actual_edge) && this->b_node_newly_reached) 
   69.89        {
   69.90 -	pred.set(this->head(), this->actual_edge);
   69.91 +	pred.set(this->target(), this->actual_edge);
   69.92        }
   69.93        return *this;
   69.94      }
    70.1 --- a/src/work/marci/bfs_mm_test.cc	Sat Nov 13 12:24:01 2004 +0000
    70.2 +++ b/src/work/marci/bfs_mm_test.cc	Sat Nov 13 12:53:28 2004 +0000
    70.3 @@ -91,8 +91,8 @@
    70.4  
    70.5  
    70.6  //   for(EdgeIt e(G); e==INVALID; ++e) {
    70.7 -//     Node u=G.tail(e);
    70.8 -//     Node v=G.head(e);
    70.9 +//     Node u=G.source(e);
   70.10 +//     Node v=G.target(e);
   70.11  //     check( !bfs_test.reached(u) ||
   70.12  // 	   (bfs_test.dist(v) > bfs_test.dist(u)+1),
   70.13  // 	   "Wrong output.");
   70.14 @@ -102,7 +102,7 @@
   70.15  //     check(bfs_test.reached(v),"Each node should be reached.");
   70.16  //     if ( bfs_test.pred(v)!=INVALID ) {
   70.17  //       Edge e=bfs_test.pred(v);
   70.18 -//       Node u=G.tail(e);
   70.19 +//       Node u=G.source(e);
   70.20  //       check(u==bfs_test.predNode(v),"Wrong tree.");
   70.21  //       check(bfs_test.dist(v) - bfs_test.dist(u) == 1,
   70.22  // 	    "Wrong distance. Difference: " 
    71.1 --- a/src/work/marci/bfsit_vs_byhand.cc	Sat Nov 13 12:24:01 2004 +0000
    71.2 +++ b/src/work/marci/bfsit_vs_byhand.cc	Sat Nov 13 12:53:28 2004 +0000
    71.3 @@ -48,7 +48,7 @@
    71.4        Node v=bfs_queue.front();	
    71.5        bfs_queue.pop();
    71.6        for(OutEdgeIt e(g,v); e!=INVALID; ++e) {
    71.7 -	Node w=g.head(e);
    71.8 +	Node w=g.target(e);
    71.9  	if (!reached[w]) {
   71.10  	  bfs_queue.push(w);
   71.11  	  reached.set(w, true);
   71.12 @@ -70,7 +70,7 @@
   71.13      while (!bfs.finished()) { 
   71.14        ++bfs; 
   71.15        if (Graph::Edge(bfs)!=INVALID && bfs.isBNodeNewlyReached()) 
   71.16 -	pred.set(bfs.head(), Graph::Edge(bfs));
   71.17 +	pred.set(bfs.target(), Graph::Edge(bfs));
   71.18      }
   71.19    }
   71.20    std::cout << ts << std::endl;
    72.1 --- a/src/work/marci/bipartite_graph_wrapper.h	Sat Nov 13 12:24:01 2004 +0000
    72.2 +++ b/src/work/marci/bipartite_graph_wrapper.h	Sat Nov 13 12:53:28 2004 +0000
    72.3 @@ -167,17 +167,17 @@
    72.4  //     OutEdgeIt& next(OutEdgeIt& i) const { this->graph->next(i.e); return i; }
    72.5  //     InEdgeIt& next(InEdgeIt& i) const { this->graph->next(i.e); return i; }
    72.6  
    72.7 -//     Node tail(const Edge& e) { 
    72.8 -//       if (!(*(this->s_false_t_true_map))[this->graph->tail(e)]) 
    72.9 -// 	return Node(this->graph->tail(e));
   72.10 +//     Node source(const Edge& e) { 
   72.11 +//       if (!(*(this->s_false_t_true_map))[this->graph->source(e)]) 
   72.12 +// 	return Node(this->graph->source(e));
   72.13  //       else
   72.14 -// 	return Node(this->graph->head(e));	
   72.15 +// 	return Node(this->graph->target(e));	
   72.16  //     }
   72.17 -//     Node head(const Edge& e) { 
   72.18 -//       if (!(*(this->s_false_t_true_map))[this->graph->tail(e)]) 
   72.19 -// 	return Node(this->graph->head(e));
   72.20 +//     Node target(const Edge& e) { 
   72.21 +//       if (!(*(this->s_false_t_true_map))[this->graph->source(e)]) 
   72.22 +// 	return Node(this->graph->target(e));
   72.23  //       else
   72.24 -// 	return Node(this->graph->tail(e));	
   72.25 +// 	return Node(this->graph->source(e));	
   72.26  //     }
   72.27  
   72.28  //     Node aNode(const OutEdgeIt& e) const { 
   72.29 @@ -252,9 +252,9 @@
   72.30      }
   72.31  
   72.32      /// A new edge is inserted.
   72.33 -    ///\pre \c tail have to be in \c S_Class and \c head in \c T_Class.
   72.34 -    Edge addEdge(const Node& tail, const Node& head) {
   72.35 -      return Parent::graph->addEdge(tail, head);
   72.36 +    ///\pre \c source have to be in \c S_Class and \c target in \c T_Class.
   72.37 +    Edge addEdge(const Node& source, const Node& target) {
   72.38 +      return Parent::graph->addEdge(source, target);
   72.39      }
   72.40  
   72.41      void erase(const Node& n) {
   72.42 @@ -695,10 +695,10 @@
   72.43        return i; 
   72.44      }    
   72.45  
   72.46 -    Node tail(const Edge& e) const { 
   72.47 +    Node source(const Edge& e) const { 
   72.48        switch (e.spec) {
   72.49        case 0: 
   72.50 -	return Node(this->graph->tail(e));
   72.51 +	return Node(this->graph->source(e));
   72.52  	break;
   72.53        case 1:
   72.54  	return S_NODE;
   72.55 @@ -709,10 +709,10 @@
   72.56  	break;
   72.57        }
   72.58      }
   72.59 -    Node head(const Edge& e) const { 
   72.60 +    Node target(const Edge& e) const { 
   72.61        switch (e.spec) {
   72.62        case 0: 
   72.63 -	return Node(this->graph->head(e));
   72.64 +	return Node(this->graph->target(e));
   72.65  	break;
   72.66        case 1:
   72.67  	return Node(e.n);
   72.68 @@ -732,17 +732,17 @@
   72.69        return this->graph->edgeNum()+this->graph->nodeNum(); 
   72.70      }
   72.71    
   72.72 -    Node aNode(const OutEdgeIt& e) const { return tail(e); }
   72.73 -    Node aNode(const InEdgeIt& e) const { return head(e); }
   72.74 -    Node bNode(const OutEdgeIt& e) const { return head(e); }
   72.75 -    Node bNode(const InEdgeIt& e) const { return tail(e); }
   72.76 +    Node aNode(const OutEdgeIt& e) const { return source(e); }
   72.77 +    Node aNode(const InEdgeIt& e) const { return target(e); }
   72.78 +    Node bNode(const OutEdgeIt& e) const { return target(e); }
   72.79 +    Node bNode(const InEdgeIt& e) const { return source(e); }
   72.80  
   72.81      void addNode() const { }
   72.82      void addEdge() const { }
   72.83      
   72.84  //    Node addNode() const { return Node(this->graph->addNode()); }
   72.85 -//    Edge addEdge(const Node& tail, const Node& head) const { 
   72.86 -//      return Edge(this->graph->addEdge(tail, head)); }
   72.87 +//    Edge addEdge(const Node& source, const Node& target) const { 
   72.88 +//      return Edge(this->graph->addEdge(source, target)); }
   72.89  
   72.90  //    void erase(const Node& i) const { this->graph->erase(i); }
   72.91  //    void erase(const Edge& i) const { this->graph->erase(i); }
    73.1 --- a/src/work/marci/bipartite_graph_wrapper_test.cc	Sat Nov 13 12:24:01 2004 +0000
    73.2 +++ b/src/work/marci/bipartite_graph_wrapper_test.cc	Sat Nov 13 12:53:28 2004 +0000
    73.3 @@ -87,7 +87,7 @@
    73.4  
    73.5    cout << "Edges of the bipartite graph:" << endl;
    73.6    for (BGW::EdgeIt e(bgw); e!=INVALID; ++e)
    73.7 -    cout << g.id(bgw.tail(e)) << "->" << g.id(bgw.head(e)) << endl;
    73.8 +    cout << g.id(bgw.source(e)) << "->" << g.id(bgw.target(e)) << endl;
    73.9  
   73.10    BGW::NodeMap<int> dbyj(bgw);
   73.11    BGW::EdgeMap<int> dbyxcj(bgw);
    74.1 --- a/src/work/marci/experiment/edmonds_karp.h	Sat Nov 13 12:24:01 2004 +0000
    74.2 +++ b/src/work/marci/experiment/edmonds_karp.h	Sat Nov 13 12:53:28 2004 +0000
    74.3 @@ -40,7 +40,7 @@
    74.4        Edge() { } 
    74.5        //Edge(const Edge& e) : resG(e.resG), sym(e.sym) { }
    74.6        Number free() const { 
    74.7 -	if (resG->G.aNode(sym)==resG->G.tail(sym)) { 
    74.8 +	if (resG->G.aNode(sym)==resG->G.source(sym)) { 
    74.9  	  return (resG->capacity.get(sym)-resG->flow.get(sym)); 
   74.10  	} else { 
   74.11  	  return (resG->flow.get(sym)); 
   74.12 @@ -48,7 +48,7 @@
   74.13        }
   74.14        bool valid() const { return sym.valid(); }
   74.15        void augment(Number a) const {
   74.16 -	if (resG->G.aNode(sym)==resG->G.tail(sym)) { 
   74.17 +	if (resG->G.aNode(sym)==resG->G.source(sym)) { 
   74.18  	  resG->flow.set(sym, resG->flow.get(sym)+a);
   74.19  	  //resG->flow[sym]+=a;
   74.20  	} else { 
   74.21 @@ -96,8 +96,8 @@
   74.22        return e; 
   74.23      }
   74.24  
   74.25 -    Node tail(Edge e) const { return G.aNode(e.sym); }
   74.26 -    Node head(Edge e) const { return G.bNode(e.sym); }
   74.27 +    Node source(Edge e) const { return G.aNode(e.sym); }
   74.28 +    Node target(Edge e) const { return G.bNode(e.sym); }
   74.29  
   74.30      Node aNode(OutEdgeIt e) const { return G.aNode(e.sym); }
   74.31      Node bNode(OutEdgeIt e) const { return G.bNode(e.sym); }
   74.32 @@ -223,9 +223,9 @@
   74.33        return e; 
   74.34      }
   74.35  
   74.36 -    Node tail(Edge e) const { 
   74.37 +    Node source(Edge e) const { 
   74.38        return ((e.out_or_in) ? G.aNode(e.out) : G.aNode(e.in)); }
   74.39 -    Node head(Edge e) const { 
   74.40 +    Node target(Edge e) const { 
   74.41        return ((e.out_or_in) ? G.bNode(e.out) : G.bNode(e.in)); }
   74.42  
   74.43      Node aNode(OutEdgeIt e) const { 
   74.44 @@ -287,15 +287,15 @@
   74.45        while ( !bfs.finished() ) { 
   74.46  	ResGWOutEdgeIt e=bfs;
   74.47  	if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
   74.48 -	  Node v=res_graph.tail(e);
   74.49 -	  Node w=res_graph.head(e);
   74.50 +	  Node v=res_graph.source(e);
   74.51 +	  Node w=res_graph.target(e);
   74.52  	  pred.set(w, e);
   74.53  	  if (res_graph.valid(pred.get(v))) {
   74.54  	    free.set(w, std::min(free.get(v), res_graph.resCap(e)));
   74.55  	  } else {
   74.56  	    free.set(w, res_graph.resCap(e)); 
   74.57  	  }
   74.58 -	  if (res_graph.head(e)==t) { _augment=true; break; }
   74.59 +	  if (res_graph.target(e)==t) { _augment=true; break; }
   74.60  	}
   74.61  	
   74.62  	++bfs;
   74.63 @@ -307,7 +307,7 @@
   74.64  	while (res_graph.valid(pred.get(n))) { 
   74.65  	  ResGWEdge e=pred.get(n);
   74.66  	  res_graph.augment(e, augment_value); 
   74.67 -	  n=res_graph.tail(e);
   74.68 +	  n=res_graph.source(e);
   74.69  	}
   74.70        }
   74.71  
   74.72 @@ -324,7 +324,7 @@
   74.73        void set(const typename MapGraphWrapper::Node& n, int a) { dist[n]=a; }
   74.74        int get(const typename MapGraphWrapper::Node& n) const { return dist[n]; }
   74.75        bool get(const typename MapGraphWrapper::Edge& e) const { 
   74.76 -	return (dist.get(gw.tail(e))<dist.get(gw.head(e))); 
   74.77 +	return (dist.get(gw.source(e))<dist.get(gw.target(e))); 
   74.78        }
   74.79      };
   74.80  
   74.81 @@ -343,7 +343,7 @@
   74.82        while ( !bfs.finished() ) { 
   74.83  	ResGWOutEdgeIt e=bfs;
   74.84  	if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
   74.85 -	  dist.set(res_graph.head(e), dist.get(res_graph.tail(e))+1);
   74.86 +	  dist.set(res_graph.target(e), dist.get(res_graph.source(e))+1);
   74.87  	}
   74.88  	++bfs;
   74.89        } //computing distances from s in the residual graph
   74.90 @@ -369,8 +369,8 @@
   74.91        {
   74.92  	typename FilterResGW::EdgeIt e;
   74.93  	for(filter_res_graph.first(e); filter_res_graph.valid(e); filter_res_graph.next(e)) {
   74.94 -	  //if (dist.get(res_graph.head(e))==dist.get(res_graph.tail(e))+1) {
   74.95 -	  typename MG::Edge f=F.addEdge(res_graph_to_F.get(res_graph.tail(e)), res_graph_to_F.get(res_graph.head(e)));
   74.96 +	  //if (dist.get(res_graph.target(e))==dist.get(res_graph.source(e))+1) {
   74.97 +	  typename MG::Edge f=F.addEdge(res_graph_to_F.get(res_graph.source(e)), res_graph_to_F.get(res_graph.target(e)));
   74.98  	  original_edge.update();
   74.99  	  original_edge.set(f, e);
  74.100  	  residual_capacity.update();
  74.101 @@ -423,7 +423,7 @@
  74.102  	  while (F.valid(pred.get(n))) { 
  74.103  	    typename MG::Edge e=pred.get(n);
  74.104  	    res_graph.augment(original_edge.get(e), augment_value); 
  74.105 -	    n=F.tail(e);
  74.106 +	    n=F.source(e);
  74.107  	    if (residual_capacity.get(e)==augment_value) 
  74.108  	      F.erase(e); 
  74.109  	    else 
  74.110 @@ -468,15 +468,15 @@
  74.111  	ResGWOutEdgeIt e=bfs;
  74.112  	if (res_graph.valid(e)) {
  74.113  	  if (bfs.isBNodeNewlyReached()) {
  74.114 -	    dist.set(res_graph.head(e), dist.get(res_graph.tail(e))+1);
  74.115 -	    typename MG::Edge f=F.addEdge(res_graph_to_F.get(res_graph.tail(e)), res_graph_to_F.get(res_graph.head(e)));
  74.116 +	    dist.set(res_graph.target(e), dist.get(res_graph.source(e))+1);
  74.117 +	    typename MG::Edge f=F.addEdge(res_graph_to_F.get(res_graph.source(e)), res_graph_to_F.get(res_graph.target(e)));
  74.118  	    original_edge.update();
  74.119  	    original_edge.set(f, e);
  74.120  	    residual_capacity.update();
  74.121  	    residual_capacity.set(f, res_graph.resCap(e));
  74.122  	  } else {
  74.123 -	    if (dist.get(res_graph.head(e))==(dist.get(res_graph.tail(e))+1)) {
  74.124 -	      typename MG::Edge f=F.addEdge(res_graph_to_F.get(res_graph.tail(e)), res_graph_to_F.get(res_graph.head(e)));
  74.125 +	    if (dist.get(res_graph.target(e))==(dist.get(res_graph.source(e))+1)) {
  74.126 +	      typename MG::Edge f=F.addEdge(res_graph_to_F.get(res_graph.source(e)), res_graph_to_F.get(res_graph.target(e)));
  74.127  	      original_edge.update();
  74.128  	      original_edge.set(f, e);
  74.129  	      residual_capacity.update();
  74.130 @@ -531,7 +531,7 @@
  74.131  	  while (F.valid(pred.get(n))) { 
  74.132  	    typename MG::Edge e=pred.get(n);
  74.133  	    res_graph.augment(original_edge.get(e), augment_value); 
  74.134 -	    n=F.tail(e);
  74.135 +	    n=F.source(e);
  74.136  	    if (residual_capacity.get(e)==augment_value) 
  74.137  	      F.erase(e); 
  74.138  	    else 
  74.139 @@ -557,7 +557,7 @@
  74.140        while ( !bfs.finished() ) { 
  74.141   	ResGWOutEdgeIt e=bfs;
  74.142   	if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
  74.143 - 	  dist.set(res_graph.head(e), dist.get(res_graph.tail(e))+1);
  74.144 + 	  dist.set(res_graph.target(e), dist.get(res_graph.source(e))+1);
  74.145   	}
  74.146  	++bfs;
  74.147        } //computing distances from s in the residual graph
  74.148 @@ -633,7 +633,7 @@
  74.149   	  while (erasing_res_graph.valid(pred.get(n))) { 
  74.150   	    typename ErasingResGW::OutEdgeIt e=pred.get(n);
  74.151   	    res_graph.augment(e, augment_value);
  74.152 - 	    n=erasing_res_graph.tail(e);
  74.153 + 	    n=erasing_res_graph.source(e);
  74.154   	    if (res_graph.resCap(e)==0)
  74.155   	      erasing_res_graph.erase(e);
  74.156   	  }
  74.157 @@ -668,7 +668,7 @@
  74.158  //       while ( !bfs.finished() ) {
  74.159  // 	typename ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::OutEdgeIt e=bfs;
  74.160  // 	if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
  74.161 -// 	  dist.set(res_graph.head(e), dist.get(res_graph.tail(e))+1);
  74.162 +// 	  dist.set(res_graph.target(e), dist.get(res_graph.source(e))+1);
  74.163  // 	}
  74.164  // 	++bfs;	
  74.165  //       } //computing distances from s in the residual graph
  74.166 @@ -722,7 +722,7 @@
  74.167  // 	  while (res_graph.valid(pred.get(n))) { 
  74.168  // 	    EAugEdge e=pred.get(n);
  74.169  // 	    res_graph.augment(e, augment_value);
  74.170 -// 	    n=res_graph.tail(e);
  74.171 +// 	    n=res_graph.source(e);
  74.172  // 	    if (res_graph.free(e)==0)
  74.173  // 	      res_graph.erase(e);
  74.174  // 	  }
  74.175 @@ -817,15 +817,15 @@
  74.176  //       while ( !bfs.finished() ) { 
  74.177  // 	AugOutEdgeIt e=bfs;
  74.178  // 	if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
  74.179 -// 	  Node v=res_graph.tail(e);
  74.180 -// 	  Node w=res_graph.head(e);
  74.181 +// 	  Node v=res_graph.source(e);
  74.182 +// 	  Node w=res_graph.target(e);
  74.183  // 	  pred.set(w, e);
  74.184  // 	  if (res_graph.valid(pred.get(v))) {
  74.185  // 	    free.set(w, std::min(free.get(v), res_graph.free(e)));
  74.186  // 	  } else {
  74.187  // 	    free.set(w, res_graph.free(e)); 
  74.188  // 	  }
  74.189 -// 	  n=res_graph.head(e);
  74.190 +// 	  n=res_graph.target(e);
  74.191  // 	  if (T->get(n) && (used.get(n)<1) ) { 
  74.192  // 	    //Number u=0;
  74.193  // 	    //for(InEdgeIt f=G->template first<InEdgeIt>(n); G->valid(f); G->next(f))
  74.194 @@ -847,7 +847,7 @@
  74.195  // 	while (res_graph.valid(pred.get(n))) { 
  74.196  // 	  AugEdge e=pred.get(n);
  74.197  // 	  res_graph.augment(e, augment_value); 
  74.198 -// 	  n=res_graph.tail(e);
  74.199 +// 	  n=res_graph.source(e);
  74.200  // 	}
  74.201  // 	used.set(n, 1); //mind2 vegen jav
  74.202  //       }
  74.203 @@ -888,7 +888,7 @@
  74.204  // //       while ( !bfs.finished() ) { 
  74.205  // // 	AugOutEdgeIt e=bfs;
  74.206  // // 	if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
  74.207 -// // 	  dist.set(res_graph.head(e), dist.get(res_graph.tail(e))+1);
  74.208 +// // 	  dist.set(res_graph.target(e), dist.get(res_graph.source(e))+1);
  74.209  // // 	}
  74.210  	
  74.211  // // 	++bfs;
  74.212 @@ -910,8 +910,8 @@
  74.213  // //       //Making F to the graph containing the edges of the residual graph 
  74.214  // //       //which are in some shortest paths
  74.215  // //       for(typename AugGraph::EdgeIt e=res_graph.template first<typename AugGraph::EdgeIt>(); res_graph.valid(e); res_graph.next(e)) {
  74.216 -// // 	if (dist.get(res_graph.head(e))==dist.get(res_graph.tail(e))+1) {
  74.217 -// // 	  typename MutableGraph::Edge f=F.addEdge(res_graph_to_F.get(res_graph.tail(e)), res_graph_to_F.get(res_graph.head(e)));
  74.218 +// // 	if (dist.get(res_graph.target(e))==dist.get(res_graph.source(e))+1) {
  74.219 +// // 	  typename MutableGraph::Edge f=F.addEdge(res_graph_to_F.get(res_graph.source(e)), res_graph_to_F.get(res_graph.target(e)));
  74.220  // // 	  original_edge.update();
  74.221  // // 	  original_edge.set(f, e);
  74.222  // // 	  residual_capacity.update();
  74.223 @@ -963,7 +963,7 @@
  74.224  // // 	  while (F.valid(pred.get(n))) { 
  74.225  // // 	    typename MutableGraph::Edge e=pred.get(n);
  74.226  // // 	    res_graph.augment(original_edge.get(e), augment_value); 
  74.227 -// // 	    n=F.tail(e);
  74.228 +// // 	    n=F.source(e);
  74.229  // // 	    if (residual_capacity.get(e)==augment_value) 
  74.230  // // 	      F.erase(e); 
  74.231  // // 	    else 
  74.232 @@ -1014,7 +1014,7 @@
  74.233  //       while ( !bfs.finished() ) {
  74.234  // 	typename ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::OutEdgeIt e=bfs;
  74.235  // 	if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
  74.236 -// 	  dist.set(res_graph.head(e), dist.get(res_graph.tail(e))+1);
  74.237 +// 	  dist.set(res_graph.target(e), dist.get(res_graph.source(e))+1);
  74.238  // 	}
  74.239  // 	++bfs;	
  74.240  //       } //computing distances from s in the residual graph
  74.241 @@ -1091,7 +1091,7 @@
  74.242  // 	  while (res_graph.valid(pred.get(n))) { 
  74.243  // 	    EAugEdge e=pred.get(n);
  74.244  // 	    res_graph.augment(e, augment_value);
  74.245 -// 	    n=res_graph.tail(e);
  74.246 +// 	    n=res_graph.source(e);
  74.247  // 	    if (res_graph.free(e)==0)
  74.248  // 	      res_graph.erase(e);
  74.249  // 	  }
  74.250 @@ -1184,17 +1184,17 @@
  74.251  // //       while ( !bfs.finished() ) { 
  74.252  // // 	AugOutEdgeIt e=/*AugOutEdgeIt*/(bfs);
  74.253  // // 	if (e.valid() && bfs.isBNodeNewlyReached()) {
  74.254 -// // 	  Node v=res_graph.tail(e);
  74.255 -// // 	  Node w=res_graph.head(e);
  74.256 +// // 	  Node v=res_graph.source(e);
  74.257 +// // 	  Node w=res_graph.target(e);
  74.258  // // 	  pred.set(w, e);
  74.259  // // 	  if (pred.get(v).valid()) {
  74.260  // // 	    free.set(w, std::min(free.get(v), e.free()));
  74.261  // // 	  } else {
  74.262  // // 	    free.set(w, e.free()); 
  74.263  // // 	  }
  74.264 -// // 	  if (TMap.get(res_graph.head(e))) { 
  74.265 +// // 	  if (TMap.get(res_graph.target(e))) { 
  74.266  // // 	    _augment=true; 
  74.267 -// // 	    reached_t_node=res_graph.head(e);
  74.268 +// // 	    reached_t_node=res_graph.target(e);
  74.269  // // 	    break; 
  74.270  // // 	  }
  74.271  // // 	}
  74.272 @@ -1208,7 +1208,7 @@
  74.273  // // 	while (pred.get(n).valid()) { 
  74.274  // // 	  AugEdge e=pred.get(n);
  74.275  // // 	  e.augment(augment_value); 
  74.276 -// // 	  n=res_graph.tail(e);
  74.277 +// // 	  n=res_graph.source(e);
  74.278  // // 	}
  74.279  // //       }
  74.280  
    75.1 --- a/src/work/marci/experiment/edmonds_karp_1.h	Sat Nov 13 12:24:01 2004 +0000
    75.2 +++ b/src/work/marci/experiment/edmonds_karp_1.h	Sat Nov 13 12:53:28 2004 +0000
    75.3 @@ -41,7 +41,7 @@
    75.4        Edge() { } 
    75.5        //Edge(const Edge& e) : resG(e.resG), sym(e.sym) { }
    75.6        Number free() const { 
    75.7 -	if (resG->G.aNode(sym)==resG->G.tail(sym)) { 
    75.8 +	if (resG->G.aNode(sym)==resG->G.source(sym)) { 
    75.9  	  return (resG->capacity.get(sym)-resG->flow.get(sym)); 
   75.10  	} else { 
   75.11  	  return (resG->flow.get(sym)); 
   75.12 @@ -49,7 +49,7 @@
   75.13        }
   75.14        bool valid() const { return sym.valid(); }
   75.15        void augment(Number a) const {
   75.16 -	if (resG->G.aNode(sym)==resG->G.tail(sym)) { 
   75.17 +	if (resG->G.aNode(sym)==resG->G.source(sym)) { 
   75.18  	  resG->flow.set(sym, resG->flow.get(sym)+a);
   75.19  	  //resG->flow[sym]+=a;
   75.20  	} else { 
   75.21 @@ -97,8 +97,8 @@
   75.22        return e; 
   75.23      }
   75.24  
   75.25 -    Node tail(Edge e) const { return G.aNode(e.sym); }
   75.26 -    Node head(Edge e) const { return G.bNode(e.sym); }
   75.27 +    Node source(Edge e) const { return G.aNode(e.sym); }
   75.28 +    Node target(Edge e) const { return G.bNode(e.sym); }
   75.29  
   75.30      Node aNode(OutEdgeIt e) const { return G.aNode(e.sym); }
   75.31      Node bNode(OutEdgeIt e) const { return G.bNode(e.sym); }
   75.32 @@ -224,9 +224,9 @@
   75.33        return e; 
   75.34      }
   75.35  
   75.36 -    Node tail(Edge e) const { 
   75.37 +    Node source(Edge e) const { 
   75.38        return ((e.out_or_in) ? G.aNode(e.out) : G.aNode(e.in)); }
   75.39 -    Node head(Edge e) const { 
   75.40 +    Node target(Edge e) const { 
   75.41        return ((e.out_or_in) ? G.bNode(e.out) : G.bNode(e.in)); }
   75.42  
   75.43      Node aNode(OutEdgeIt e) const { 
   75.44 @@ -286,15 +286,15 @@
   75.45        while ( !bfs.finished() ) { 
   75.46  	ResGWOutEdgeIt e=bfs;
   75.47  	if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
   75.48 -	  Node v=res_graph.tail(e);
   75.49 -	  Node w=res_graph.head(e);
   75.50 +	  Node v=res_graph.source(e);
   75.51 +	  Node w=res_graph.target(e);
   75.52  	  pred.set(w, e);
   75.53  	  if (res_graph.valid(pred.get(v))) {
   75.54  	    free.set(w, std::min(free.get(v), res_graph.resCap(e)));
   75.55  	  } else {
   75.56  	    free.set(w, res_graph.resCap(e)); 
   75.57  	  }
   75.58 -	  if (res_graph.head(e)==t) { _augment=true; break; }
   75.59 +	  if (res_graph.target(e)==t) { _augment=true; break; }
   75.60  	}
   75.61  	
   75.62  	++bfs;
   75.63 @@ -306,7 +306,7 @@
   75.64  	while (res_graph.valid(pred.get(n))) { 
   75.65  	  ResGWEdge e=pred.get(n);
   75.66  	  res_graph.augment(e, augment_value); 
   75.67 -	  n=res_graph.tail(e);
   75.68 +	  n=res_graph.source(e);
   75.69  	}
   75.70        }
   75.71  
   75.72 @@ -323,7 +323,7 @@
   75.73        void set(const typename MapGraphWrapper::Node& n, int a) { dist[n]=a; }
   75.74        int get(const typename MapGraphWrapper::Node& n) const { return dist[n]; }
   75.75        bool get(const typename MapGraphWrapper::Edge& e) const { 
   75.76 -	return (dist.get(g->tail(e))<dist.get(g->head(e))); 
   75.77 +	return (dist.get(g->source(e))<dist.get(g->target(e))); 
   75.78        }
   75.79      };
   75.80  
   75.81 @@ -342,7 +342,7 @@
   75.82        while ( !bfs.finished() ) { 
   75.83  	ResGWOutEdgeIt e=bfs;
   75.84  	if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
   75.85 -	  dist.set(res_graph.head(e), dist.get(res_graph.tail(e))+1);
   75.86 +	  dist.set(res_graph.target(e), dist.get(res_graph.source(e))+1);
   75.87  	}
   75.88  	++bfs;
   75.89        } //computing distances from s in the residual graph
   75.90 @@ -368,8 +368,8 @@
   75.91        {
   75.92  	typename FilterResGW::EdgeIt e;
   75.93  	for(filter_res_graph.first(e); filter_res_graph.valid(e); filter_res_graph.next(e)) {
   75.94 -	  //if (dist.get(res_graph.head(e))==dist.get(res_graph.tail(e))+1) {
   75.95 -	  typename MG::Edge f=F.addEdge(res_graph_to_F.get(res_graph.tail(e)), res_graph_to_F.get(res_graph.head(e)));
   75.96 +	  //if (dist.get(res_graph.target(e))==dist.get(res_graph.source(e))+1) {
   75.97 +	  typename MG::Edge f=F.addEdge(res_graph_to_F.get(res_graph.source(e)), res_graph_to_F.get(res_graph.target(e)));
   75.98  	  original_edge.update();
   75.99  	  original_edge.set(f, e);
  75.100  	  residual_capacity.update();
  75.101 @@ -422,7 +422,7 @@
  75.102  	  while (F.valid(pred.get(n))) { 
  75.103  	    typename MG::Edge e=pred.get(n);
  75.104  	    res_graph.augment(original_edge.get(e), augment_value); 
  75.105 -	    n=F.tail(e);
  75.106 +	    n=F.source(e);
  75.107  	    if (residual_capacity.get(e)==augment_value) 
  75.108  	      F.erase(e); 
  75.109  	    else 
  75.110 @@ -467,15 +467,15 @@
  75.111  	ResGWOutEdgeIt e=bfs;
  75.112  	if (res_graph.valid(e)) {
  75.113  	  if (bfs.isBNodeNewlyReached()) {
  75.114 -	    dist.set(res_graph.head(e), dist.get(res_graph.tail(e))+1);
  75.115 -	    typename MG::Edge f=F.addEdge(res_graph_to_F.get(res_graph.tail(e)), res_graph_to_F.get(res_graph.head(e)));
  75.116 +	    dist.set(res_graph.target(e), dist.get(res_graph.source(e))+1);
  75.117 +	    typename MG::Edge f=F.addEdge(res_graph_to_F.get(res_graph.source(e)), res_graph_to_F.get(res_graph.target(e)));
  75.118  	    original_edge.update();
  75.119  	    original_edge.set(f, e);
  75.120  	    residual_capacity.update();
  75.121  	    residual_capacity.set(f, res_graph.resCap(e));
  75.122  	  } else {
  75.123 -	    if (dist.get(res_graph.head(e))==(dist.get(res_graph.tail(e))+1)) {
  75.124 -	      typename MG::Edge f=F.addEdge(res_graph_to_F.get(res_graph.tail(e)), res_graph_to_F.get(res_graph.head(e)));
  75.125 +	    if (dist.get(res_graph.target(e))==(dist.get(res_graph.source(e))+1)) {
  75.126 +	      typename MG::Edge f=F.addEdge(res_graph_to_F.get(res_graph.source(e)), res_graph_to_F.get(res_graph.target(e)));
  75.127  	      original_edge.update();
  75.128  	      original_edge.set(f, e);
  75.129  	      residual_capacity.update();
  75.130 @@ -530,7 +530,7 @@
  75.131  	  while (F.valid(pred.get(n))) { 
  75.132  	    typename MG::Edge e=pred.get(n);
  75.133  	    res_graph.augment(original_edge.get(e), augment_value); 
  75.134 -	    n=F.tail(e);
  75.135 +	    n=F.source(e);
  75.136  	    if (residual_capacity.get(e)==augment_value) 
  75.137  	      F.erase(e); 
  75.138  	    else 
  75.139 @@ -556,7 +556,7 @@
  75.140        while ( !bfs.finished() ) { 
  75.141   	ResGWOutEdgeIt e=bfs;
  75.142   	if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
  75.143 - 	  dist.set(res_graph.head(e), dist.get(res_graph.tail(e))+1);
  75.144 + 	  dist.set(res_graph.target(e), dist.get(res_graph.source(e))+1);
  75.145   	}
  75.146  	++bfs;
  75.147        } //computing distances from s in the residual graph
  75.148 @@ -632,7 +632,7 @@
  75.149   	  while (erasing_res_graph.valid(pred.get(n))) { 
  75.150   	    typename ErasingResGW::OutEdgeIt e=pred.get(n);
  75.151   	    res_graph.augment(e, augment_value);
  75.152 - 	    n=erasing_res_graph.tail(e);
  75.153 + 	    n=erasing_res_graph.source(e);
  75.154   	    if (res_graph.resCap(e)==0)
  75.155   	      erasing_res_graph.erase(e);
  75.156   	  }
  75.157 @@ -727,15 +727,15 @@
  75.158  //       while ( !bfs.finished() ) { 
  75.159  // 	AugOutEdgeIt e=bfs;
  75.160  // 	if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
  75.161 -// 	  Node v=res_graph.tail(e);
  75.162 -// 	  Node w=res_graph.head(e);
  75.163 +// 	  Node v=res_graph.source(e);
  75.164 +// 	  Node w=res_graph.target(e);
  75.165  // 	  pred.set(w, e);
  75.166  // 	  if (res_graph.valid(pred.get(v))) {
  75.167  // 	    free.set(w, std::min(free.get(v), res_graph.free(e)));
  75.168  // 	  } else {
  75.169  // 	    free.set(w, res_graph.free(e)); 
  75.170  // 	  }
  75.171 -// 	  n=res_graph.head(e);
  75.172 +// 	  n=res_graph.target(e);
  75.173  // 	  if (T->get(n) && (used.get(n)<1) ) { 
  75.174  // 	    //Number u=0;
  75.175  // 	    //for(InEdgeIt f=G->template first<InEdgeIt>(n); G->valid(f); G->next(f))
  75.176 @@ -757,7 +757,7 @@
  75.177  // 	while (res_graph.valid(pred.get(n))) { 
  75.178  // 	  AugEdge e=pred.get(n);
  75.179  // 	  res_graph.augment(e, augment_value); 
  75.180 -// 	  n=res_graph.tail(e);
  75.181 +// 	  n=res_graph.source(e);
  75.182  // 	}
  75.183  // 	used.set(n, 1); //mind2 vegen jav
  75.184  //       }
  75.185 @@ -798,7 +798,7 @@
  75.186  // //       while ( !bfs.finished() ) { 
  75.187  // // 	AugOutEdgeIt e=bfs;
  75.188  // // 	if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
  75.189 -// // 	  dist.set(res_graph.head(e), dist.get(res_graph.tail(e))+1);
  75.190 +// // 	  dist.set(res_graph.target(e), dist.get(res_graph.source(e))+1);
  75.191  // // 	}
  75.192  	
  75.193  // // 	++bfs;
  75.194 @@ -820,8 +820,8 @@
  75.195  // //       //Making F to the graph containing the edges of the residual graph 
  75.196  // //       //which are in some shortest paths
  75.197  // //       for(typename AugGraph::EdgeIt e=res_graph.template first<typename AugGraph::EdgeIt>(); res_graph.valid(e); res_graph.next(e)) {
  75.198 -// // 	if (dist.get(res_graph.head(e))==dist.get(res_graph.tail(e))+1) {
  75.199 -// // 	  typename MutableGraph::Edge f=F.addEdge(res_graph_to_F.get(res_graph.tail(e)), res_graph_to_F.get(res_graph.head(e)));
  75.200 +// // 	if (dist.get(res_graph.target(e))==dist.get(res_graph.source(e))+1) {
  75.201 +// // 	  typename MutableGraph::Edge f=F.addEdge(res_graph_to_F.get(res_graph.source(e)), res_graph_to_F.get(res_graph.target(e)));
  75.202  // // 	  original_edge.update();
  75.203  // // 	  original_edge.set(f, e);
  75.204  // // 	  residual_capacity.update();
  75.205 @@ -873,7 +873,7 @@
  75.206  // // 	  while (F.valid(pred.get(n))) { 
  75.207  // // 	    typename MutableGraph::Edge e=pred.get(n);
  75.208  // // 	    res_graph.augment(original_edge.get(e), augment_value); 
  75.209 -// // 	    n=F.tail(e);
  75.210 +// // 	    n=F.source(e);
  75.211  // // 	    if (residual_capacity.get(e)==augment_value) 
  75.212  // // 	      F.erase(e); 
  75.213  // // 	    else 
  75.214 @@ -924,7 +924,7 @@
  75.215  //       while ( !bfs.finished() ) {
  75.216  // 	typename ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::OutEdgeIt e=bfs;
  75.217  // 	if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
  75.218 -// 	  dist.set(res_graph.head(e), dist.get(res_graph.tail(e))+1);
  75.219 +// 	  dist.set(res_graph.target(e), dist.get(res_graph.source(e))+1);
  75.220  // 	}
  75.221  // 	++bfs;	
  75.222  //       } //computing distances from s in the residual graph
  75.223 @@ -1001,7 +1001,7 @@
  75.224  // 	  while (res_graph.valid(pred.get(n))) { 
  75.225  // 	    EAugEdge e=pred.get(n);
  75.226  // 	    res_graph.augment(e, augment_value);
  75.227 -// 	    n=res_graph.tail(e);
  75.228 +// 	    n=res_graph.source(e);
  75.229  // 	    if (res_graph.free(e)==0)
  75.230  // 	      res_graph.erase(e);
  75.231  // 	  }
  75.232 @@ -1094,17 +1094,17 @@
  75.233  // //       while ( !bfs.finished() ) { 
  75.234  // // 	AugOutEdgeIt e=/*AugOutEdgeIt*/(bfs);
  75.235  // // 	if (e.valid() && bfs.isBNodeNewlyReached()) {
  75.236 -// // 	  Node v=res_graph.tail(e);
  75.237 -// // 	  Node w=res_graph.head(e);
  75.238 +// // 	  Node v=res_graph.source(e);
  75.239 +// // 	  Node w=res_graph.target(e);
  75.240  // // 	  pred.set(w, e);
  75.241  // // 	  if (pred.get(v).valid()) {
  75.242  // // 	    free.set(w, std::min(free.get(v), e.free()));
  75.243  // // 	  } else {
  75.244  // // 	    free.set(w, e.free()); 
  75.245  // // 	  }
  75.246 -// // 	  if (TMap.get(res_graph.head(e))) { 
  75.247 +// // 	  if (TMap.get(res_graph.target(e))) { 
  75.248  // // 	    _augment=true; 
  75.249 -// // 	    reached_t_node=res_graph.head(e);
  75.250 +// // 	    reached_t_node=res_graph.target(e);
  75.251  // // 	    break; 
  75.252  // // 	  }
  75.253  // // 	}
  75.254 @@ -1118,7 +1118,7 @@
  75.255  // // 	while (pred.get(n).valid()) { 
  75.256  // // 	  AugEdge e=pred.get(n);
  75.257  // // 	  e.augment(augment_value); 
  75.258 -// // 	  n=res_graph.tail(e);
  75.259 +// // 	  n=res_graph.source(e);
  75.260  // // 	}
  75.261  // //       }
  75.262  
    76.1 --- a/src/work/marci/experiment/edmonds_karp_demo.cc	Sat Nov 13 12:24:01 2004 +0000
    76.2 +++ b/src/work/marci/experiment/edmonds_karp_demo.cc	Sat Nov 13 12:53:28 2004 +0000
    76.3 @@ -104,7 +104,7 @@
    76.4      int i=0;
    76.5      while (max_flow_test.augmentOnBlockingFlow<MutableGraph>()) { 
    76.6  //     for(EdgeIt e=G.template first<EdgeIt>(); e.valid(); ++e) { 
    76.7 -//       std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
    76.8 +//       std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
    76.9  //     }
   76.10  //     std::cout<<std::endl;
   76.11        ++i; 
   76.12 @@ -112,7 +112,7 @@
   76.13  
   76.14  //   std::cout << "maximum flow: "<< std::endl;
   76.15  //   for(EdgeIt e=G.first<EdgeIt>(); e.valid(); ++e) { 
   76.16 -//     std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
   76.17 +//     std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
   76.18  //   }
   76.19  //   std::cout<<std::endl;
   76.20      std::cout << "elapsed time: " << ts << std::endl;
   76.21 @@ -135,7 +135,7 @@
   76.22      int i=0;
   76.23      while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { 
   76.24  //     for(EdgeIt e=G.template first<EdgeIt>(); e.valid(); ++e) { 
   76.25 -//       std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
   76.26 +//       std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
   76.27  //     }
   76.28  //     std::cout<<std::endl;
   76.29        ++i; 
   76.30 @@ -143,7 +143,7 @@
   76.31  
   76.32  //   std::cout << "maximum flow: "<< std::endl;
   76.33  //   for(EdgeIt e=G.first<EdgeIt>(); e.valid(); ++e) { 
   76.34 -//     std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
   76.35 +//     std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
   76.36  //   }
   76.37  //   std::cout<<std::endl;
   76.38      std::cout << "elapsed time: " << ts << std::endl;
   76.39 @@ -166,7 +166,7 @@
   76.40      int i=0;
   76.41      while (max_flow_test.augmentOnBlockingFlow2()) { 
   76.42  //     for(EdgeIt e=G.template first<EdgeIt>(); e.valid(); ++e) { 
   76.43 -//       std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
   76.44 +//       std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
   76.45  //     }
   76.46  //     std::cout<<std::endl;
   76.47        ++i; 
   76.48 @@ -174,7 +174,7 @@
   76.49  
   76.50  //   std::cout << "maximum flow: "<< std::endl;
   76.51  //   for(EdgeIt e=G.first<EdgeIt>(); e.valid(); ++e) { 
   76.52 -//     std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
   76.53 +//     std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
   76.54  //   }
   76.55  //   std::cout<<std::endl;
   76.56      std::cout << "elapsed time: " << ts << std::endl;
   76.57 @@ -197,7 +197,7 @@
   76.58      int i=0;
   76.59      while (max_flow_test.augmentOnShortestPath()) { 
   76.60  //     for(EdgeIt e=G.template first<EdgeIt>(); e.valid(); ++e) { 
   76.61 -//       std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
   76.62 +//       std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
   76.63  //     }
   76.64  //     std::cout<<std::endl;
   76.65        ++i; 
   76.66 @@ -205,7 +205,7 @@
   76.67  
   76.68  //   std::cout << "maximum flow: "<< std::endl;
   76.69  //   for(EdgeIt e=G.first<EdgeIt>(); e.valid(); ++e) { 
   76.70 -//     std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
   76.71 +//     std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
   76.72  //   }
   76.73  //   std::cout<<std::endl;
   76.74      std::cout << "elapsed time: " << ts << std::endl;
    77.1 --- a/src/work/marci/experiment/edmonds_karp_demo_1.cc	Sat Nov 13 12:24:01 2004 +0000
    77.2 +++ b/src/work/marci/experiment/edmonds_karp_demo_1.cc	Sat Nov 13 12:53:28 2004 +0000
    77.3 @@ -104,7 +104,7 @@
    77.4      int i=0;
    77.5      while (max_flow_test.augmentOnBlockingFlow<MutableGraph>()) { 
    77.6  //     for(EdgeIt e=G.template first<EdgeIt>(); e.valid(); ++e) { 
    77.7 -//       std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
    77.8 +//       std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
    77.9  //     }
   77.10  //     std::cout<<std::endl;
   77.11        ++i; 
   77.12 @@ -112,7 +112,7 @@
   77.13  
   77.14  //   std::cout << "maximum flow: "<< std::endl;
   77.15  //   for(EdgeIt e=G.first<EdgeIt>(); e.valid(); ++e) { 
   77.16 -//     std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
   77.17 +//     std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
   77.18  //   }
   77.19  //   std::cout<<std::endl;
   77.20      std::cout << "elapsed time: " << ts << std::endl;
   77.21 @@ -135,7 +135,7 @@
   77.22      int i=0;
   77.23      while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { 
   77.24  //     for(EdgeIt e=G.template first<EdgeIt>(); e.valid(); ++e) { 
   77.25 -//       std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
   77.26 +//       std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
   77.27  //     }
   77.28  //     std::cout<<std::endl;
   77.29        ++i; 
   77.30 @@ -143,7 +143,7 @@
   77.31  
   77.32  //   std::cout << "maximum flow: "<< std::endl;
   77.33  //   for(EdgeIt e=G.first<EdgeIt>(); e.valid(); ++e) { 
   77.34 -//     std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
   77.35 +//     std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
   77.36  //   }
   77.37  //   std::cout<<std::endl;
   77.38      std::cout << "elapsed time: " << ts << std::endl;
   77.39 @@ -166,7 +166,7 @@
   77.40      int i=0;
   77.41      while (max_flow_test.augmentOnBlockingFlow2()) { 
   77.42  //     for(EdgeIt e=G.template first<EdgeIt>(); e.valid(); ++e) { 
   77.43 -//       std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
   77.44 +//       std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
   77.45  //     }
   77.46  //     std::cout<<std::endl;
   77.47        ++i; 
   77.48 @@ -174,7 +174,7 @@
   77.49  
   77.50  //   std::cout << "maximum flow: "<< std::endl;
   77.51  //   for(EdgeIt e=G.first<EdgeIt>(); e.valid(); ++e) { 
   77.52 -//     std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
   77.53 +//     std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
   77.54  //   }
   77.55  //   std::cout<<std::endl;
   77.56      std::cout << "elapsed time: " << ts << std::endl;
   77.57 @@ -197,7 +197,7 @@
   77.58      int i=0;
   77.59      while (max_flow_test.augmentOnShortestPath()) { 
   77.60  //     for(EdgeIt e=G.template first<EdgeIt>(); e.valid(); ++e) { 
   77.61 -//       std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
   77.62 +//       std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
   77.63  //     }
   77.64  //     std::cout<<std::endl;
   77.65        ++i; 
   77.66 @@ -205,7 +205,7 @@
   77.67  
   77.68  //   std::cout << "maximum flow: "<< std::endl;
   77.69  //   for(EdgeIt e=G.first<EdgeIt>(); e.valid(); ++e) { 
   77.70 -//     std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
   77.71 +//     std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
   77.72  //   }
   77.73  //   std::cout<<std::endl;
   77.74      std::cout << "elapsed time: " << ts << std::endl;
    78.1 --- a/src/work/marci/experiment/graph_wrapper.h	Sat Nov 13 12:24:01 2004 +0000
    78.2 +++ b/src/work/marci/experiment/graph_wrapper.h	Sat Nov 13 12:53:28 2004 +0000
    78.3 @@ -96,8 +96,8 @@
    78.4      template< typename It > It first(const Node& v) const { 
    78.5        It e; first(e, v); return e; }
    78.6  
    78.7 -    Node head(const Edge& e) const { return graph->head(e); }
    78.8 -    Node tail(const Edge& e) const { return graph->tail(e); }
    78.9 +    Node target(const Edge& e) const { return graph->target(e); }
   78.10 +    Node source(const Edge& e) const { return graph->source(e); }
   78.11  
   78.12      template<typename I> bool valid(const I& i) const 
   78.13        { return graph->valid(i); }
   78.14 @@ -114,8 +114,8 @@
   78.15        return graph->bNode(e); }
   78.16    
   78.17      Node addNode() const { return graph->addNode(); }
   78.18 -    Edge addEdge(const Node& tail, const Node& head) const { 
   78.19 -      return graph->addEdge(tail, head); }
   78.20 +    Edge addEdge(const Node& source, const Node& target) const { 
   78.21 +      return graph->addEdge(source, target); }
   78.22    
   78.23      template<typename I> void erase(const I& i) const { graph->erase(i); }
   78.24    
   78.25 @@ -245,8 +245,8 @@
   78.26      template< typename It > It first(const Node& v) const { 
   78.27        It e; this->first(e, v); return e; }
   78.28  
   78.29 -    Node head(const Edge& e) const { return gw.head(e); }
   78.30 -    Node tail(const Edge& e) const { return gw.tail(e); }
   78.31 +    Node target(const Edge& e) const { return gw.target(e); }
   78.32 +    Node source(const Edge& e) const { return gw.source(e); }
   78.33  
   78.34      template<typename I> bool valid(const I& i) const { return gw.valid(i); }
   78.35    
   78.36 @@ -260,8 +260,8 @@
   78.37      template<typename I> Node bNode(const I& e) const { return gw.bNode(e); }
   78.38    
   78.39      Node addNode() const { return gw.addNode(); }
   78.40 -    Edge addEdge(const Node& tail, const Node& head) const { 
   78.41 -      return gw.addEdge(tail, head); }
   78.42 +    Edge addEdge(const Node& source, const Node& target) const { 
   78.43 +      return gw.addEdge(source, target); }
   78.44    
   78.45      template<typename I> void erase(const I& i) const { gw.erase(i); }
   78.46    
   78.47 @@ -322,8 +322,8 @@
   78.48  //     template< typename It > It first(const Node& v) const { 
   78.49  //       It e; first(e, v); return e; }
   78.50  
   78.51 -//     Node head(const Edge& e) const { return graph->tail(e); }
   78.52 -//     Node tail(const Edge& e) const { return graph->head(e); }
   78.53 +//     Node target(const Edge& e) const { return graph->source(e); }
   78.54 +//     Node source(const Edge& e) const { return graph->target(e); }
   78.55    
   78.56  //     template<typename I> bool valid(const I& i) const 
   78.57  //       { return graph->valid(i); }
   78.58 @@ -337,8 +337,8 @@
   78.59  //       return graph->bNode(e); }
   78.60  
   78.61  //     Node addNode() const { return graph->addNode(); }
   78.62 -//     Edge addEdge(const Node& tail, const Node& head) const { 
   78.63 -//       return graph->addEdge(tail, head); }
   78.64 +//     Edge addEdge(const Node& source, const Node& target) const { 
   78.65 +//       return graph->addEdge(source, target); }
   78.66    
   78.67  //     int nodeNum() const { return graph->nodeNum(); }
   78.68  //     int edgeNum() const { return graph->edgeNum(); }
   78.69 @@ -403,8 +403,8 @@
   78.70  //     //template< typename It > It first(const Node& v) const { 
   78.71  //     //  It e; first(e, v); return e; }
   78.72  
   78.73 -//     //Node head(const Edge& e) const { return graph->tail(e); }
   78.74 -//     //Node tail(const Edge& e) const { return graph->head(e); }
   78.75 +//     //Node target(const Edge& e) const { return graph->source(e); }
   78.76 +//     //Node source(const Edge& e) const { return graph->target(e); }
   78.77    
   78.78  //     //template<typename I> bool valid(const I& i) const 
   78.79  //     //  { return graph->valid(i); }
   78.80 @@ -418,8 +418,8 @@
   78.81  //     //  return graph->bNode(e); }
   78.82  
   78.83  //     //Node addNode() const { return graph->addNode(); }
   78.84 -//     //Edge addEdge(const Node& tail, const Node& head) const { 
   78.85 -//     //  return graph->addEdge(tail, head); }
   78.86 +//     //Edge addEdge(const Node& source, const Node& target) const { 
   78.87 +//     //  return graph->addEdge(source, target); }
   78.88    
   78.89  //     //int nodeNum() const { return graph->nodeNum(); }
   78.90  //     //int edgeNum() const { return graph->edgeNum(); }
   78.91 @@ -467,10 +467,10 @@
   78.92      RevGraphWrapper(GraphWrapper _gw) : 
   78.93        GraphWrapper<GraphWrapper>(_gw) { }  
   78.94  
   78.95 -    Node head(const Edge& e) const 
   78.96 -      { return GraphWrapper<GraphWrapper>::tail(e); }
   78.97 -    Node tail(const Edge& e) const 
   78.98 -      { return GraphWrapper<GraphWrapper>::head(e); }
   78.99 +    Node target(const Edge& e) const 
  78.100 +      { return GraphWrapper<GraphWrapper>::source(e); }
  78.101 +    Node source(const Edge& e) const 
  78.102 +      { return GraphWrapper<GraphWrapper>::target(e); }
  78.103    };
  78.104  
  78.105    //Subgraph on the same node-set and partial edge-set
  78.106 @@ -599,7 +599,7 @@
  78.107  
  78.108  //     OutEdgeIt& next(OutEdgeIt& e) const {
  78.109  //       if (e.out_or_in) {
  78.110 -// 	Node n=gw.tail(e.out);
  78.111 +// 	Node n=gw.source(e.out);
  78.112  // 	gw.next(e.out);
  78.113  // 	if (!gw.valid(e.out)) {
  78.114  // 	  e.out_or_in=false;
  78.115 @@ -612,9 +612,9 @@
  78.116  //     }
  78.117  
  78.118  //     Node aNode(const OutEdgeIt& e) const { 
  78.119 -//       if (e.out_or_in) return gw.tail(e); else return gw.head(e); }
  78.120 +//       if (e.out_or_in) return gw.source(e); else return gw.target(e); }
  78.121  //     Node bNode(const OutEdgeIt& e) const { 
  78.122 -//       if (e.out_or_in) return gw.head(e); else return gw.tail(e); }
  78.123 +//       if (e.out_or_in) return gw.target(e); else return gw.source(e); }
  78.124  
  78.125  //     typedef OutEdgeIt InEdgeIt; 
  78.126  
  78.127 @@ -632,8 +632,8 @@
  78.128  //     template< typename It > It first(const Node& v) const { 
  78.129  //       It e; first(e, v); return e; }
  78.130  
  78.131 -//     Node head(const Edge& e) const { return gw.head(e); }
  78.132 -//     Node tail(const Edge& e) const { return gw.tail(e); }
  78.133 +//     Node target(const Edge& e) const { return gw.target(e); }
  78.134 +//     Node source(const Edge& e) const { return gw.source(e); }
  78.135  
  78.136  //     template<typename I> bool valid(const I& i) const 
  78.137  //       { return gw.valid(i); }
  78.138 @@ -651,8 +651,8 @@
  78.139    
  78.140  //     Node addNode() const { return gw.addNode(); }
  78.141  // // FIXME: ez igy nem jo, mert nem
  78.142 -// //    Edge addEdge(const Node& tail, const Node& head) const { 
  78.143 -// //      return graph->addEdge(tail, head); }
  78.144 +// //    Edge addEdge(const Node& source, const Node& target) const { 
  78.145 +// //      return graph->addEdge(source, target); }
  78.146    
  78.147  //     template<typename I> void erase(const I& i) const { gw.erase(i); }
  78.148    
  78.149 @@ -798,7 +798,7 @@
  78.150  
  78.151      OutEdgeIt& next(OutEdgeIt& e) const {
  78.152        if (e.out_or_in) {
  78.153 -	Node n=gw.tail(e.out);
  78.154 +	Node n=gw.source(e.out);
  78.155  	gw.next(e.out);
  78.156  	if (!gw.valid(e.out)) { e.out_or_in=false; gw.first(e.in, n); }
  78.157        } else {
  78.158 @@ -808,7 +808,7 @@
  78.159      }
  78.160  
  78.161      EdgeIt& next(EdgeIt& e) const {
  78.162 -      //NodeIt v=tail(e);
  78.163 +      //NodeIt v=source(e);
  78.164        gw.next(e.out);
  78.165        while (valid(e.v) && !gw.valid(e.out)) { 
  78.166  	next(e.v); 
  78.167 @@ -826,8 +826,8 @@
  78.168      template< typename It > It first(const Node& v) const { 
  78.169        It e; first(e, v); return e; }
  78.170  
  78.171 -//    Node head(const Edge& e) const { return gw.head(e); }
  78.172 -//    Node tail(const Edge& e) const { return gw.tail(e); }
  78.173 +//    Node target(const Edge& e) const { return gw.target(e); }
  78.174 +//    Node source(const Edge& e) const { return gw.source(e); }
  78.175  
  78.176  //    template<typename I> bool valid(const I& i) const 
  78.177  //      { return gw.valid(i); }
  78.178 @@ -841,15 +841,15 @@
  78.179  //       return graph->bNode(e); }
  78.180  
  78.181      Node aNode(const OutEdgeIt& e) const { 
  78.182 -      if (e.out_or_in) return gw.tail(e); else return gw.head(e); }
  78.183 +      if (e.out_or_in) return gw.source(e); else return gw.target(e); }
  78.184      Node bNode(const OutEdgeIt& e) const { 
  78.185 -      if (e.out_or_in) return gw.head(e); else return gw.tail(e); }
  78.186 +      if (e.out_or_in) return gw.target(e); else return gw.source(e); }
  78.187    
  78.188  //    Node addNode() const { return gw.addNode(); }
  78.189  
  78.190  // FIXME: ez igy nem jo, mert nem
  78.191 -//    Edge addEdge(const Node& tail, const Node& head) const { 
  78.192 -//      return graph->addEdge(tail, head); }
  78.193 +//    Edge addEdge(const Node& source, const Node& target) const { 
  78.194 +//      return graph->addEdge(source, target); }
  78.195    
  78.196  //    template<typename I> void erase(const I& i) const { gw.erase(i); }
  78.197    
  78.198 @@ -913,8 +913,8 @@
  78.199  //     template< typename It > It first(Node v) const { 
  78.200  //       It e; first(e, v); return e; }
  78.201  
  78.202 -//     Node head(const Edge& e) const { return graph->head(e); }
  78.203 -//     Node tail(const Edge& e) const { return graph->tail(e); }
  78.204 +//     Node target(const Edge& e) const { return graph->target(e); }
  78.205 +//     Node source(const Edge& e) const { return graph->source(e); }
  78.206    
  78.207  //     template<typename I> Node aNode(const I& e) const { 
  78.208  //       return graph->aNode(e); }
  78.209 @@ -928,8 +928,8 @@
  78.210  //     //{ return graph->setInvalid(i); }
  78.211    
  78.212  //     Node addNode() { return graph->addNode(); }
  78.213 -//     Edge addEdge(const Node& tail, const Node& head) { 
  78.214 -//       return graph->addEdge(tail, head); }
  78.215 +//     Edge addEdge(const Node& source, const Node& target) { 
  78.216 +//       return graph->addEdge(source, target); }
  78.217    
  78.218  //     template<typename I> void erase(const I& i) { graph->erase(i); }
  78.219    
  78.220 @@ -1180,9 +1180,9 @@
  78.221        return e; 
  78.222      }
  78.223  
  78.224 -    Node tail(Edge e) const { 
  78.225 +    Node source(Edge e) const { 
  78.226        return ((e.out_or_in) ? gw.aNode(e.out) : gw.aNode(e.in)); }
  78.227 -    Node head(Edge e) const { 
  78.228 +    Node target(Edge e) const { 
  78.229        return ((e.out_or_in) ? gw.bNode(e.out) : gw.bNode(e.in)); }
  78.230  
  78.231      Node aNode(OutEdgeIt e) const { 
  78.232 @@ -1311,7 +1311,7 @@
  78.233      void erase(const OutEdgeIt& e) const {
  78.234        OutEdgeIt f=e;
  78.235        this->next(f);
  78.236 -      first_out_edges->set(this->tail(e), f);
  78.237 +      first_out_edges->set(this->source(e), f);
  78.238      }
  78.239    };
  78.240  
  78.241 @@ -1381,8 +1381,8 @@
  78.242  //     template< typename It > It first(const Node& v) const { 
  78.243  //       It e; first(e, v); return e; }
  78.244  
  78.245 -//     //Node head(const Edge& e) const { return gw.head(e); }
  78.246 -//     //Node tail(const Edge& e) const { return gw.tail(e); }
  78.247 +//     //Node target(const Edge& e) const { return gw.target(e); }
  78.248 +//     //Node source(const Edge& e) const { return gw.source(e); }
  78.249  
  78.250  //     //template<typename I> bool valid(const I& i) const 
  78.251  //     //  { return gw.valid(i); }
  78.252 @@ -1396,16 +1396,16 @@
  78.253  //     //  return gw.bNode(e); }
  78.254    
  78.255  //     //Node addNode() const { return gw.addNode(); }
  78.256 -//     //Edge addEdge(const Node& tail, const Node& head) const { 
  78.257 -//     //  return gw.addEdge(tail, head); }
  78.258 +//     //Edge addEdge(const Node& source, const Node& target) const { 
  78.259 +//     //  return gw.addEdge(source, target); }
  78.260    
  78.261  //     //void erase(const OutEdgeIt& e) {
  78.262 -//     //  first_out_edge(this->tail(e))=e;
  78.263 +//     //  first_out_edge(this->source(e))=e;
  78.264  //     //}
  78.265  //     void erase(const Edge& e) {
  78.266  //       OutEdgeIt f(e);
  78.267  //       next(f);
  78.268 -//       first_out_edges.set(this->tail(e), f);
  78.269 +//       first_out_edges.set(this->source(e), f);
  78.270  //     }
  78.271  //     //template<typename I> void erase(const I& i) const { gw.erase(i); }
  78.272    
  78.273 @@ -1459,7 +1459,7 @@
  78.274  
  78.275  //     OutEdgeIt& first(OutEdgeIt& e, const Node& n) const {
  78.276  //       ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::first(e, n);
  78.277 -//       while (valid(e) && (dist.get(tail(e))/*+1!=*/>=dist.get(head(e)))) 
  78.278 +//       while (valid(e) && (dist.get(source(e))/*+1!=*/>=dist.get(target(e)))) 
  78.279  // 	ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::next(e);
  78.280  //       return e;
  78.281  //     }
  78.282 @@ -1470,7 +1470,7 @@
  78.283  
  78.284  //     OutEdgeIt& next(OutEdgeIt& e) const {
  78.285  //       ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::next(e);
  78.286 -//       while (valid(e) && (dist.get(tail(e))/*+1!*/>=dist.get(head(e)))) 
  78.287 +//       while (valid(e) && (dist.get(source(e))/*+1!*/>=dist.get(target(e)))) 
  78.288  // 	ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::next(e);
  78.289  //       return e;
  78.290  //     }
  78.291 @@ -1482,9 +1482,9 @@
  78.292  //     void erase(const Edge& e) {
  78.293  //       OutEdgeIt f(e);
  78.294  //       ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::next(f);
  78.295 -//       while (valid(f) && (dist.get(tail(f))/*+1!=*/>=dist.get(head(f)))) 
  78.296 +//       while (valid(f) && (dist.get(source(f))/*+1!=*/>=dist.get(target(f)))) 
  78.297  // 	ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::next(f);
  78.298 -//       first_out_edges.set(this->tail(e), f);
  78.299 +//       first_out_edges.set(this->source(e), f);
  78.300  //     }
  78.301  
  78.302  //     //TrivGraphWrapper() : graph(0) { }
  78.303 @@ -1507,8 +1507,8 @@
  78.304  //     template< typename It > It first(const Node& v) const { 
  78.305  //       It e; first(e, v); return e; }
  78.306  
  78.307 -//     //Node head(const Edge& e) const { return gw.head(e); }
  78.308 -//     //Node tail(const Edge& e) const { return gw.tail(e); }
  78.309 +//     //Node target(const Edge& e) const { return gw.target(e); }
  78.310 +//     //Node source(const Edge& e) const { return gw.source(e); }
  78.311  
  78.312  //     //template<typename I> bool valid(const I& i) const 
  78.313  //     //  { return gw.valid(i); }
  78.314 @@ -1525,8 +1525,8 @@
  78.315  //     //  return gw.bNode(e); }
  78.316    
  78.317  //     //Node addNode() const { return gw.addNode(); }
  78.318 -//     //Edge addEdge(const Node& tail, const Node& head) const { 
  78.319 -//     //  return gw.addEdge(tail, head); }
  78.320 +//     //Edge addEdge(const Node& source, const Node& target) const { 
  78.321 +//     //  return gw.addEdge(source, target); }
  78.322    
  78.323  //     //template<typename I> void erase(const I& i) const { gw.erase(i); }
  78.324    
  78.325 @@ -1669,8 +1669,8 @@
  78.326  //     template< typename It > It first(Node v) const { 
  78.327  //       It e; first(e, v); return e; }
  78.328  
  78.329 -//     Node head(const Edge& e) const { return gw.head(e); }
  78.330 -//     Node tail(const Edge& e) const { return gw.tail(e); }
  78.331 +//     Node target(const Edge& e) const { return gw.target(e); }
  78.332 +//     Node source(const Edge& e) const { return gw.source(e); }
  78.333    
  78.334  //     template<typename I> Node aNode(const I& e) const { 
  78.335  //       return gw.aNode(e); }
  78.336 @@ -1684,8 +1684,8 @@
  78.337  //     //{ return gw.setInvalid(i); }
  78.338    
  78.339  //     Node addNode() { return gw.addNode(); }
  78.340 -//     Edge addEdge(const Node& tail, const Node& head) { 
  78.341 -//       return gw.addEdge(tail, head); }
  78.342 +//     Edge addEdge(const Node& source, const Node& target) { 
  78.343 +//       return gw.addEdge(source, target); }
  78.344    
  78.345  //     template<typename I> void erase(const I& i) { gw.erase(i); }
  78.346    
    79.1 --- a/src/work/marci/experiment/graph_wrapper_1.h	Sat Nov 13 12:24:01 2004 +0000
    79.2 +++ b/src/work/marci/experiment/graph_wrapper_1.h	Sat Nov 13 12:53:28 2004 +0000
    79.3 @@ -90,8 +90,8 @@
    79.4      template< typename It > It first(const Node& v) const { 
    79.5        It e; this->first(e, v); return e; }
    79.6  
    79.7 -    Node head(const Edge& e) const { return graph->head(e); }
    79.8 -    Node tail(const Edge& e) const { return graph->tail(e); }
    79.9 +    Node target(const Edge& e) const { return graph->target(e); }
   79.10 +    Node source(const Edge& e) const { return graph->source(e); }
   79.11  
   79.12      template<typename I> bool valid(const I& i) const { 
   79.13        return graph->valid(i); }
   79.14 @@ -108,8 +108,8 @@
   79.15        return graph->bNode(e); }
   79.16    
   79.17      Node addNode() const { return graph->addNode(); }
   79.18 -    Edge addEdge(const Node& tail, const Node& head) const { 
   79.19 -      return graph->addEdge(tail, head); }
   79.20 +    Edge addEdge(const Node& source, const Node& target) const { 
   79.21 +      return graph->addEdge(source, target); }
   79.22    
   79.23      template<typename I> void erase(const I& i) const { graph->erase(i); }
   79.24    
   79.25 @@ -235,8 +235,8 @@
   79.26      template< typename It > It first(const Node& v) const { 
   79.27        It e; this->first(e, v); return e; }
   79.28  
   79.29 -    Node head(const Edge& e) const { return graph->head(e); }
   79.30 -    Node tail(const Edge& e) const { return graph->tail(e); }
   79.31 +    Node target(const Edge& e) const { return graph->target(e); }
   79.32 +    Node source(const Edge& e) const { return graph->source(e); }
   79.33  
   79.34      template<typename I> bool valid(const I& i) const { 
   79.35        return graph->valid(i); }
   79.36 @@ -253,8 +253,8 @@
   79.37        return graph->bNode(e); }
   79.38    
   79.39      Node addNode() const { return graph->addNode(); }
   79.40 -    Edge addEdge(const Node& tail, const Node& head) const { 
   79.41 -      return graph->addEdge(tail, head); }
   79.42 +    Edge addEdge(const Node& source, const Node& target) const { 
   79.43 +      return graph->addEdge(source, target); }
   79.44    
   79.45      template<typename I> void erase(const I& i) const { graph->erase(i); }
   79.46    
   79.47 @@ -316,8 +316,8 @@
   79.48  //     template< typename It > It first(const Node& v) const { 
   79.49  //       It e; first(e, v); return e; }
   79.50  
   79.51 -//     Node head(const Edge& e) const { return graph->tail(e); }
   79.52 -//     Node tail(const Edge& e) const { return graph->head(e); }
   79.53 +//     Node target(const Edge& e) const { return graph->source(e); }
   79.54 +//     Node source(const Edge& e) const { return graph->target(e); }
   79.55    
   79.56  //     template<typename I> bool valid(const I& i) const 
   79.57  //       { return graph->valid(i); }
   79.58 @@ -331,8 +331,8 @@
   79.59  //       return graph->bNode(e); }
   79.60  
   79.61  //     Node addNode() const { return graph->addNode(); }
   79.62 -//     Edge addEdge(const Node& tail, const Node& head) const { 
   79.63 -//       return graph->addEdge(tail, head); }
   79.64 +//     Edge addEdge(const Node& source, const Node& target) const { 
   79.65 +//       return graph->addEdge(source, target); }
   79.66    
   79.67  //     int nodeNum() const { return graph->nodeNum(); }
   79.68  //     int edgeNum() const { return graph->edgeNum(); }
   79.69 @@ -378,10 +378,10 @@
   79.70  //     RevGraphWrapper() : GraphWrapper<Graph>() { }
   79.71      RevGraphWrapper(Graph& _graph) : GraphWrapper<Graph>(_graph) { }  
   79.72  
   79.73 -    Node head(const Edge& e) const 
   79.74 -      { return GraphWrapper<Graph>::tail(e); }
   79.75 -    Node tail(const Edge& e) const 
   79.76 -      { return GraphWrapper<Graph>::head(e); }
   79.77 +    Node target(const Edge& e) const 
   79.78 +      { return GraphWrapper<Graph>::source(e); }
   79.79 +    Node source(const Edge& e) const 
   79.80 +      { return GraphWrapper<Graph>::target(e); }
   79.81    };
   79.82  
   79.83    //Subgraph on the same node-set and partial edge-set
   79.84 @@ -511,7 +511,7 @@
   79.85  
   79.86  //     OutEdgeIt& next(OutEdgeIt& e) const {
   79.87  //       if (e.out_or_in) {
   79.88 -// 	Node n=gw.tail(e.out);
   79.89 +// 	Node n=gw.source(e.out);
   79.90  // 	gw.next(e.out);
   79.91  // 	if (!gw.valid(e.out)) {
   79.92  // 	  e.out_or_in=false;
   79.93 @@ -524,9 +524,9 @@
   79.94  //     }
   79.95  
   79.96  //     Node aNode(const OutEdgeIt& e) const { 
   79.97 -//       if (e.out_or_in) return gw.tail(e); else return gw.head(e); }
   79.98 +//       if (e.out_or_in) return gw.source(e); else return gw.target(e); }
   79.99  //     Node bNode(const OutEdgeIt& e) const { 
  79.100 -//       if (e.out_or_in) return gw.head(e); else return gw.tail(e); }
  79.101 +//       if (e.out_or_in) return gw.target(e); else return gw.source(e); }
  79.102  
  79.103  //     typedef OutEdgeIt InEdgeIt; 
  79.104  
  79.105 @@ -544,8 +544,8 @@
  79.106  //     template< typename It > It first(const Node& v) const { 
  79.107  //       It e; first(e, v); return e; }
  79.108  
  79.109 -//     Node head(const Edge& e) const { return gw.head(e); }
  79.110 -//     Node tail(const Edge& e) const { return gw.tail(e); }
  79.111 +//     Node target(const Edge& e) const { return gw.target(e); }
  79.112 +//     Node source(const Edge& e) const { return gw.source(e); }
  79.113  
  79.114  //     template<typename I> bool valid(const I& i) const 
  79.115  //       { return gw.valid(i); }
  79.116 @@ -563,8 +563,8 @@
  79.117    
  79.118  //     Node addNode() const { return gw.addNode(); }
  79.119  // // FIXME: ez igy nem jo, mert nem
  79.120 -// //    Edge addEdge(const Node& tail, const Node& head) const { 
  79.121 -// //      return graph->addEdge(tail, head); }
  79.122 +// //    Edge addEdge(const Node& source, const Node& target) const { 
  79.123 +// //      return graph->addEdge(source, target); }
  79.124    
  79.125  //     template<typename I> void erase(const I& i) const { gw.erase(i); }
  79.126    
  79.127 @@ -692,7 +692,7 @@
  79.128  
  79.129      OutEdgeIt& next(OutEdgeIt& e) const {
  79.130        if (e.out_or_in) {
  79.131 -	Node n=graph->tail(e.out);
  79.132 +	Node n=graph->source(e.out);
  79.133  	graph->next(e.out);
  79.134  	if (!graph->valid(e.out)) { e.out_or_in=false; graph->first(e.in, n); }
  79.135        } else {
  79.136 @@ -702,7 +702,7 @@
  79.137      }
  79.138  
  79.139      EdgeIt& next(EdgeIt& e) const {
  79.140 -      //NodeIt v=tail(e);
  79.141 +      //NodeIt v=source(e);
  79.142        graph->next(e.out);
  79.143        while (valid(e.v) && !graph->valid(e.out)) { 
  79.144  	next(e.v); 
  79.145 @@ -720,8 +720,8 @@
  79.146      template< typename It > It first(const Node& v) const { 
  79.147        It e; this->first(e, v); return e; }
  79.148  
  79.149 -//    Node head(const Edge& e) const { return gw.head(e); }
  79.150 -//    Node tail(const Edge& e) const { return gw.tail(e); }
  79.151 +//    Node target(const Edge& e) const { return gw.target(e); }
  79.152 +//    Node source(const Edge& e) const { return gw.source(e); }
  79.153  
  79.154  //    template<typename I> bool valid(const I& i) const 
  79.155  //      { return gw.valid(i); }
  79.156 @@ -735,15 +735,15 @@
  79.157  //       return graph->bNode(e); }
  79.158  
  79.159      Node aNode(const OutEdgeIt& e) const { 
  79.160 -      if (e.out_or_in) return graph->tail(e); else return graph->head(e); }
  79.161 +      if (e.out_or_in) return graph->source(e); else return graph->target(e); }
  79.162      Node bNode(const OutEdgeIt& e) const { 
  79.163 -      if (e.out_or_in) return graph->head(e); else return graph->tail(e); }
  79.164 +      if (e.out_or_in) return graph->target(e); else return graph->source(e); }
  79.165    
  79.166  //    Node addNode() const { return gw.addNode(); }
  79.167  
  79.168  // FIXME: ez igy nem jo, mert nem
  79.169 -//    Edge addEdge(const Node& tail, const Node& head) const { 
  79.170 -//      return graph->addEdge(tail, head); }
  79.171 +//    Edge addEdge(const Node& source, const Node& target) const { 
  79.172 +//      return graph->addEdge(source, target); }
  79.173    
  79.174  //    template<typename I> void erase(const I& i) const { gw.erase(i); }
  79.175    
  79.176 @@ -807,8 +807,8 @@
  79.177  //     template< typename It > It first(Node v) const { 
  79.178  //       It e; first(e, v); return e; }
  79.179  
  79.180 -//     Node head(const Edge& e) const { return graph->head(e); }
  79.181 -//     Node tail(const Edge& e) const { return graph->tail(e); }
  79.182 +//     Node target(const Edge& e) const { return graph->target(e); }
  79.183 +//     Node source(const Edge& e) const { return graph->source(e); }
  79.184    
  79.185  //     template<typename I> Node aNode(const I& e) const { 
  79.186  //       return graph->aNode(e); }
  79.187 @@ -822,8 +822,8 @@
  79.188  //     //{ return graph->setInvalid(i); }
  79.189    
  79.190  //     Node addNode() { return graph->addNode(); }
  79.191 -//     Edge addEdge(const Node& tail, const Node& head) { 
  79.192 -//       return graph->addEdge(tail, head); }
  79.193 +//     Edge addEdge(const Node& source, const Node& target) { 
  79.194 +//       return graph->addEdge(source, target); }
  79.195    
  79.196  //     template<typename I> void erase(const I& i) { graph->erase(i); }
  79.197    
  79.198 @@ -1063,9 +1063,9 @@
  79.199        return e; 
  79.200      }
  79.201  
  79.202 -    Node tail(Edge e) const { 
  79.203 +    Node source(Edge e) const { 
  79.204        return ((e.out_or_in) ? graph->aNode(e.out) : graph->aNode(e.in)); }
  79.205 -    Node head(Edge e) const { 
  79.206 +    Node target(Edge e) const { 
  79.207        return ((e.out_or_in) ? graph->bNode(e.out) : graph->bNode(e.in)); }
  79.208  
  79.209      Node aNode(OutEdgeIt e) const { 
  79.210 @@ -1192,7 +1192,7 @@
  79.211      void erase(const OutEdgeIt& e) const {
  79.212        OutEdgeIt f=e;
  79.213        this->next(f);
  79.214 -      first_out_edges->set(this->tail(e), f);
  79.215 +      first_out_edges->set(this->source(e), f);
  79.216      }
  79.217    };
  79.218  
  79.219 @@ -1310,8 +1310,8 @@
  79.220  //     template< typename It > It first(Node v) const { 
  79.221  //       It e; first(e, v); return e; }
  79.222  
  79.223 -//     Node head(const Edge& e) const { return gw.head(e); }
  79.224 -//     Node tail(const Edge& e) const { return gw.tail(e); }
  79.225 +//     Node target(const Edge& e) const { return gw.target(e); }
  79.226 +//     Node source(const Edge& e) const { return gw.source(e); }
  79.227    
  79.228  //     template<typename I> Node aNode(const I& e) const { 
  79.229  //       return gw.aNode(e); }
  79.230 @@ -1325,8 +1325,8 @@
  79.231  //     //{ return gw.setInvalid(i); }
  79.232    
  79.233  //     Node addNode() { return gw.addNode(); }
  79.234 -//     Edge addEdge(const Node& tail, const Node& head) { 
  79.235 -//       return gw.addEdge(tail, head); }
  79.236 +//     Edge addEdge(const Node& source, const Node& target) { 
  79.237 +//       return gw.addEdge(source, target); }
  79.238    
  79.239  //     template<typename I> void erase(const I& i) { gw.erase(i); }
  79.240    
    80.1 --- a/src/work/marci/experiment/graph_wrapper_st_ostream_op.h	Sat Nov 13 12:24:01 2004 +0000
    80.2 +++ b/src/work/marci/experiment/graph_wrapper_st_ostream_op.h	Sat Nov 13 12:53:28 2004 +0000
    80.3 @@ -166,10 +166,10 @@
    80.4      InEdgeIt& next(InEdgeIt& i) const { graph->next(i.e); return i; }
    80.5      EdgeIt& next(EdgeIt& i) const { graph->next(i.e); return i; }    
    80.6  
    80.7 -    Node tail(const Edge& e) const { 
    80.8 -      return Node(graph->tail(static_cast<typename Graph::Edge>(e))); }
    80.9 -    Node head(const Edge& e) const { 
   80.10 -      return Node(graph->head(static_cast<typename Graph::Edge>(e))); }
   80.11 +    Node source(const Edge& e) const { 
   80.12 +      return Node(graph->source(static_cast<typename Graph::Edge>(e))); }
   80.13 +    Node target(const Edge& e) const { 
   80.14 +      return Node(graph->target(static_cast<typename Graph::Edge>(e))); }
   80.15  
   80.16      bool valid(const Node& n) const { 
   80.17        return graph->valid(static_cast<typename Graph::Node>(n)); }
   80.18 @@ -185,8 +185,8 @@
   80.19      Node bNode(const InEdgeIt& e) const { return Node(graph->bNode(e.e)); }
   80.20    
   80.21      Node addNode() const { return Node(graph->addNode()); }
   80.22 -    Edge addEdge(const Node& tail, const Node& head) const { 
   80.23 -      return Edge(graph->addEdge(tail, head)); }
   80.24 +    Edge addEdge(const Node& source, const Node& target) const { 
   80.25 +      return Edge(graph->addEdge(source, target)); }
   80.26  
   80.27      void erase(const Node& i) const { graph->erase(i); }
   80.28      void erase(const Edge& i) const { graph->erase(i); }
   80.29 @@ -272,10 +272,10 @@
   80.30      Node bNode(const InEdgeIt& e) const { 
   80.31        return Node(this->graph->bNode(e.e)); }
   80.32  
   80.33 -    Node tail(const Edge& e) const { 
   80.34 -      return GraphWrapper<Graph>::head(e); }
   80.35 -    Node head(const Edge& e) const { 
   80.36 -      return GraphWrapper<Graph>::tail(e); }
   80.37 +    Node source(const Edge& e) const { 
   80.38 +      return GraphWrapper<Graph>::target(e); }
   80.39 +    Node target(const Edge& e) const { 
   80.40 +      return GraphWrapper<Graph>::source(e); }
   80.41  
   80.42    };
   80.43  
   80.44 @@ -489,7 +489,7 @@
   80.45  //     }
   80.46      OutEdgeIt& next(OutEdgeIt& e) const {
   80.47        if (e.out_or_in) {
   80.48 -	typename Graph::Node n=this->graph->tail(e.out);
   80.49 +	typename Graph::Node n=this->graph->source(e.out);
   80.50  	this->graph->next(e.out);
   80.51  	if (!this->graph->valid(e.out)) { 
   80.52  	  e.out_or_in=false; this->graph->first(e.in, n); }
   80.53 @@ -506,11 +506,11 @@
   80.54  //     }
   80.55  
   80.56      Node aNode(const OutEdgeIt& e) const { 
   80.57 -      if (e.out_or_in) return this->graph->tail(e); else 
   80.58 -	return this->graph->head(e); }
   80.59 +      if (e.out_or_in) return this->graph->source(e); else 
   80.60 +	return this->graph->target(e); }
   80.61      Node bNode(const OutEdgeIt& e) const { 
   80.62 -      if (e.out_or_in) return this->graph->head(e); else 
   80.63 -	return this->graph->tail(e); }
   80.64 +      if (e.out_or_in) return this->graph->target(e); else 
   80.65 +	return this->graph->source(e); }
   80.66    };
   80.67    
   80.68    /// A wrapper for composing the residual graph for directed flow and circulation problems.
   80.69 @@ -724,10 +724,10 @@
   80.70        return e;
   80.71      }
   80.72  
   80.73 -    Node tail(Edge e) const { 
   80.74 -      return ((e.forward) ? this->graph->tail(e) : this->graph->head(e)); }
   80.75 -    Node head(Edge e) const { 
   80.76 -      return ((e.forward) ? this->graph->head(e) : this->graph->tail(e)); }
   80.77 +    Node source(Edge e) const { 
   80.78 +      return ((e.forward) ? this->graph->source(e) : this->graph->target(e)); }
   80.79 +    Node target(Edge e) const { 
   80.80 +      return ((e.forward) ? this->graph->target(e) : this->graph->source(e)); }
   80.81  
   80.82      Node aNode(OutEdgeIt e) const { 
   80.83        return ((e.forward) ? this->graph->aNode(e.out) : 
   80.84 @@ -913,7 +913,7 @@
   80.85      void erase(const OutEdgeIt& e) const {
   80.86        OutEdgeIt f=e;
   80.87        this->next(f);
   80.88 -      first_out_edges->set(this->tail(e), f.e);
   80.89 +      first_out_edges->set(this->source(e), f.e);
   80.90      }
   80.91    };
   80.92  
   80.93 @@ -1041,17 +1041,17 @@
   80.94      OutEdgeIt& next(OutEdgeIt& i) const { this->graph->next(i.e); return i; }
   80.95      InEdgeIt& next(InEdgeIt& i) const { this->graph->next(i.e); return i; }
   80.96  
   80.97 -    Node tail(const Edge& e) { 
   80.98 -      if (!(*(this->s_false_t_true_map))[this->graph->tail(e)]) 
   80.99 -	return Node(this->graph->tail(e));
  80.100 +    Node source(const Edge& e) { 
  80.101 +      if (!(*(this->s_false_t_true_map))[this->graph->source(e)]) 
  80.102 +	return Node(this->graph->source(e));
  80.103        else
  80.104 -	return Node(this->graph->head(e));	
  80.105 +	return Node(this->graph->target(e));	
  80.106      }
  80.107 -    Node head(const Edge& e) { 
  80.108 -      if (!(*(this->s_false_t_true_map))[this->graph->tail(e)]) 
  80.109 -	return Node(this->graph->head(e));
  80.110 +    Node target(const Edge& e) { 
  80.111 +      if (!(*(this->s_false_t_true_map))[this->graph->source(e)]) 
  80.112 +	return Node(this->graph->target(e));
  80.113        else
  80.114 -	return Node(this->graph->tail(e));	
  80.115 +	return Node(this->graph->source(e));	
  80.116      }
  80.117  
  80.118      Node aNode(const OutEdgeIt& e) const { 
  80.119 @@ -1469,10 +1469,10 @@
  80.120        return i; 
  80.121      }    
  80.122  
  80.123 -    Node tail(const Edge& e) const { 
  80.124 +    Node source(const Edge& e) const { 
  80.125        switch (e.spec) {
  80.126        case 0: 
  80.127 -	return Node(this->graph->tail(e));
  80.128 +	return Node(this->graph->source(e));
  80.129  	break;
  80.130        case 1:
  80.131  	return S_NODE;
  80.132 @@ -1483,10 +1483,10 @@
  80.133  	break;
  80.134        }
  80.135      }
  80.136 -    Node head(const Edge& e) const { 
  80.137 +    Node target(const Edge& e) const { 
  80.138        switch (e.spec) {
  80.139        case 0: 
  80.140 -	return Node(this->graph->head(e));
  80.141 +	return Node(this->graph->target(e));
  80.142  	break;
  80.143        case 1:
  80.144  	return Node(e.n);
  80.145 @@ -1506,17 +1506,17 @@
  80.146        return this->graph->edgeNum()+this->graph->nodeNum(); 
  80.147      }
  80.148    
  80.149 -    Node aNode(const OutEdgeIt& e) const { return tail(e); }
  80.150 -    Node aNode(const InEdgeIt& e) const { return head(e); }
  80.151 -    Node bNode(const OutEdgeIt& e) const { return head(e); }
  80.152 -    Node bNode(const InEdgeIt& e) const { return tail(e); }
  80.153 +    Node aNode(const OutEdgeIt& e) const { return source(e); }
  80.154 +    Node aNode(const InEdgeIt& e) const { return target(e); }
  80.155 +    Node bNode(const OutEdgeIt& e) const { return target(e); }
  80.156 +    Node bNode(const InEdgeIt& e) const { return source(e); }
  80.157  
  80.158      void addNode() const { }
  80.159      void addEdge() const { }
  80.160      
  80.161  //    Node addNode() const { return Node(this->graph->addNode()); }
  80.162 -//    Edge addEdge(const Node& tail, const Node& head) const { 
  80.163 -//      return Edge(this->graph->addEdge(tail, head)); }
  80.164 +//    Edge addEdge(const Node& source, const Node& target) const { 
  80.165 +//      return Edge(this->graph->addEdge(source, target)); }
  80.166  
  80.167  //    void erase(const Node& i) const { this->graph->erase(i); }
  80.168  //    void erase(const Edge& i) const { this->graph->erase(i); }
    81.1 --- a/src/work/marci/experiment/iterator_bfs_demo.cc	Sat Nov 13 12:24:01 2004 +0000
    81.2 +++ b/src/work/marci/experiment/iterator_bfs_demo.cc	Sat Nov 13 12:53:28 2004 +0000
    81.3 @@ -22,7 +22,7 @@
    81.4      graph(_graph), node_name_map(_node_name_map) { }
    81.5    string get(typename Graph::Edge e) const { 
    81.6      return 
    81.7 -      (node_name_map.get(graph.tail(e))+"->"+node_name_map.get(graph.head(e)));
    81.8 +      (node_name_map.get(graph.source(e))+"->"+node_name_map.get(graph.target(e)));
    81.9    }
   81.10  };
   81.11  
    82.1 --- a/src/work/marci/experiment/iterator_bfs_demo_1.cc	Sat Nov 13 12:24:01 2004 +0000
    82.2 +++ b/src/work/marci/experiment/iterator_bfs_demo_1.cc	Sat Nov 13 12:53:28 2004 +0000
    82.3 @@ -22,7 +22,7 @@
    82.4      graph(_graph), node_name_map(_node_name_map) { }
    82.5    string get(typename Graph::Edge e) const { 
    82.6      return 
    82.7 -      (node_name_map.get(graph.tail(e))+"->"+node_name_map.get(graph.head(e)));
    82.8 +      (node_name_map.get(graph.source(e))+"->"+node_name_map.get(graph.target(e)));
    82.9    }
   82.10  };
   82.11  
    83.1 --- a/src/work/marci/experiment/list_graph.h	Sat Nov 13 12:24:01 2004 +0000
    83.2 +++ b/src/work/marci/experiment/list_graph.h	Sat Nov 13 12:53:28 2004 +0000
    83.3 @@ -122,8 +122,8 @@
    83.4        friend std::ostream& operator<<(std::ostream& os, const Edge& i);
    83.5        //ListGraph* G;
    83.6        int id;
    83.7 -      node_item* _tail;
    83.8 -      node_item* _head;
    83.9 +      node_item* _source;
   83.10 +      node_item* _target;
   83.11        edge_item* _next_out;
   83.12        edge_item* _prev_out;
   83.13        edge_item* _next_in;
   83.14 @@ -149,22 +149,22 @@
   83.15        return p;
   83.16      }
   83.17  
   83.18 -    edge_item* _add_edge(node_item* _tail, node_item* _head) {
   83.19 +    edge_item* _add_edge(node_item* _source, node_item* _target) {
   83.20        edge_item* e=new edge_item;
   83.21        e->id=edge_id++;
   83.22 -      e->_tail=_tail;
   83.23 -      e->_head=_head;
   83.24 +      e->_source=_source;
   83.25 +      e->_target=_target;
   83.26        
   83.27 -      e->_prev_out=_tail->_last_out_edge;
   83.28 -      if (_tail->_last_out_edge) (_tail->_last_out_edge)->_next_out=e;
   83.29 -      _tail->_last_out_edge=e;
   83.30 -      if (!_tail->_first_out_edge) _tail->_first_out_edge=e; 
   83.31 +      e->_prev_out=_source->_last_out_edge;
   83.32 +      if (_source->_last_out_edge) (_source->_last_out_edge)->_next_out=e;
   83.33 +      _source->_last_out_edge=e;
   83.34 +      if (!_source->_first_out_edge) _source->_first_out_edge=e; 
   83.35        e->_next_out=0;
   83.36   
   83.37 -      e->_prev_in=_head->_last_in_edge;
   83.38 -      if (_head->_last_in_edge) (_head->_last_in_edge)->_next_in=e;
   83.39 -      _head->_last_in_edge=e;
   83.40 -      if (!_head->_first_in_edge) { _head->_first_in_edge=e; } 
   83.41 +      e->_prev_in=_target->_last_in_edge;
   83.42 +      if (_target->_last_in_edge) (_target->_last_in_edge)->_next_in=e;
   83.43 +      _target->_last_in_edge=e;
   83.44 +      if (!_target->_first_in_edge) { _target->_first_in_edge=e; } 
   83.45        e->_next_in=0;
   83.46  
   83.47        ++_edge_num;
   83.48 @@ -184,45 +184,45 @@
   83.49  
   83.50      void _delete_edge(edge_item* e) {
   83.51        if (e->_next_out) (e->_next_out)->_prev_out=e->_prev_out; else 
   83.52 -	(e->_tail)->_last_out_edge=e->_prev_out;
   83.53 +	(e->_source)->_last_out_edge=e->_prev_out;
   83.54        if (e->_prev_out) (e->_prev_out)->_next_out=e->_next_out; else 
   83.55 -	(e->_tail)->_first_out_edge=e->_next_out;
   83.56 +	(e->_source)->_first_out_edge=e->_next_out;
   83.57        if (e->_next_in) (e->_next_in)->_prev_in=e->_prev_in; else 
   83.58 -	(e->_head)->_last_in_edge=e->_prev_in;
   83.59 +	(e->_target)->_last_in_edge=e->_prev_in;
   83.60        if (e->_prev_in) (e->_prev_in)->_next_in=e->_next_in; else 
   83.61 -	(e->_head)->_first_in_edge=e->_next_in;
   83.62 +	(e->_target)->_first_in_edge=e->_next_in;
   83.63  
   83.64        delete e;
   83.65        --_edge_num;
   83.66      }
   83.67  
   83.68 -    void _set_tail(edge_item* e, node_item* _tail) {
   83.69 +    void _set_source(edge_item* e, node_item* _source) {
   83.70        if (e->_next_out) (e->_next_out)->_prev_out=e->_prev_out; else 
   83.71 -	(e->_tail)->_last_out_edge=e->_prev_out;
   83.72 +	(e->_source)->_last_out_edge=e->_prev_out;
   83.73        if (e->_prev_out) (e->_prev_out)->_next_out=e->_next_out; else 
   83.74 -	(e->_tail)->_first_out_edge=e->_next_out;
   83.75 +	(e->_source)->_first_out_edge=e->_next_out;
   83.76        
   83.77 -      e->_tail=_tail;
   83.78 +      e->_source=_source;
   83.79        
   83.80 -      e->_prev_out=_tail->_last_out_edge;
   83.81 -      if (_tail->_last_out_edge) (_tail->_last_out_edge)->_next_out=e;
   83.82 -      _tail->_last_out_edge=e;
   83.83 -      if (!_tail->_first_out_edge) _tail->_first_out_edge=e; 
   83.84 +      e->_prev_out=_source->_last_out_edge;
   83.85 +      if (_source->_last_out_edge) (_source->_last_out_edge)->_next_out=e;
   83.86 +      _source->_last_out_edge=e;
   83.87 +      if (!_source->_first_out_edge) _source->_first_out_edge=e; 
   83.88        e->_next_out=0;
   83.89      }
   83.90  
   83.91 -    void _set_head(edge_item* e, node_item* _head) {
   83.92 +    void _set_target(edge_item* e, node_item* _target) {
   83.93        if (e->_next_in) (e->_next_in)->_prev_in=e->_prev_in; else 
   83.94 -	(e->_head)->_last_in_edge=e->_prev_in;
   83.95 +	(e->_target)->_last_in_edge=e->_prev_in;
   83.96        if (e->_prev_in) (e->_prev_in)->_next_in=e->_next_in; else 
   83.97 -	(e->_head)->_first_in_edge=e->_next_in;
   83.98 +	(e->_target)->_first_in_edge=e->_next_in;
   83.99        
  83.100 -      e->_head=_head;
  83.101 +      e->_target=_target;
  83.102        
  83.103 -      e->_prev_in=_head->_last_in_edge;
  83.104 -      if (_head->_last_in_edge) (_head->_last_in_edge)->_next_in=e;
  83.105 -      _head->_last_in_edge=e;
  83.106 -      if (!_head->_first_in_edge) { _head->_first_in_edge=e; } 
  83.107 +      e->_prev_in=_target->_last_in_edge;
  83.108 +      if (_target->_last_in_edge) (_target->_last_in_edge)->_next_in=e;
  83.109 +      _target->_last_in_edge=e;
  83.110 +      if (!_target->_first_in_edge) { _target->_first_in_edge=e; } 
  83.111        e->_next_in=0;
  83.112      }
  83.113  
  83.114 @@ -247,8 +247,8 @@
  83.115      //OutEdgeIt firstOutEdge(const Node v) const { return OutEdgeIt(v); }
  83.116      //InEdgeIt firstInEdge(const Node v) const { return InEdgeIt(v); }
  83.117      //SymEdgeIt firstSymEdge(const Node v) const { return SymEdgeIt(v); }
  83.118 -    Node tail(Edge e) const { return e.tailNode(); }
  83.119 -    Node head(Edge e) const { return e.headNode(); }
  83.120 +    Node source(Edge e) const { return e.sourceNode(); }
  83.121 +    Node target(Edge e) const { return e.targetNode(); }
  83.122  
  83.123      Node aNode(const OutEdgeIt& e) const { return e.aNode(); }
  83.124      Node aNode(const InEdgeIt& e) const { return e.aNode(); }
  83.125 @@ -277,8 +277,8 @@
  83.126        e=InEdgeIt(*this, v); return e; }
  83.127      SymEdgeIt& /*getF*/first(SymEdgeIt& e, Node v) const { 
  83.128        e=SymEdgeIt(*this, v); return e; }
  83.129 -    //void getTail(Node& n, const Edge& e) const { n=tail(e); }
  83.130 -    //void getHead(Node& n, const Edge& e) const { n=head(e); }
  83.131 +    //void getSource(Node& n, const Edge& e) const { n=source(e); }
  83.132 +    //void getTarget(Node& n, const Edge& e) const { n=target(e); }
  83.133  
  83.134      //void getANode(Node& n, const OutEdgeIt& e) const { n=e.aNode(); }
  83.135      //void getANode(Node& n, const InEdgeIt& e) const { n=e.aNode(); }
  83.136 @@ -345,12 +345,12 @@
  83.137        while (first<NodeIt>().valid()) erase(first<NodeIt>());
  83.138      }
  83.139  
  83.140 -    void setTail(Edge e, Node tail) {
  83.141 -      _set_tail(e.edge, tail.node); 
  83.142 +    void setSource(Edge e, Node source) {
  83.143 +      _set_source(e.edge, source.node); 
  83.144      }
  83.145  
  83.146 -    void setHead(Edge e, Node head) {
  83.147 -      _set_head(e.edge, head.node); 
  83.148 +    void setTarget(Edge e, Node target) {
  83.149 +      _set_target(e.edge, target.node); 
  83.150      }
  83.151  
  83.152      /* stream operations, for testing purpose */
  83.153 @@ -359,7 +359,7 @@
  83.154        os << i.node->id; return os; 
  83.155      }
  83.156      friend std::ostream& operator<<(std::ostream& os, const Edge& i) { 
  83.157 -      os << "(" << i.edge->_tail->id << "--" << i.edge->id << "->" << i.edge->_head->id << ")"; 
  83.158 +      os << "(" << i.edge->_source->id << "--" << i.edge->id << "->" << i.edge->_target->id << ")"; 
  83.159        return os; 
  83.160      }
  83.161  
  83.162 @@ -426,8 +426,8 @@
  83.163        friend bool operator==(Edge u, Edge v) { return v.edge==u.edge; } 
  83.164        friend bool operator!=(Edge u, Edge v) { return v.edge!=u.edge; } 
  83.165      protected:
  83.166 -      Node tailNode() const { return Node(edge->_tail); }
  83.167 -      Node headNode() const { return Node(edge->_head); }
  83.168 +      Node sourceNode() const { return Node(edge->_source); }
  83.169 +      Node targetNode() const { return Node(edge->_target); }
  83.170      public:
  83.171        friend std::ostream& operator<<(std::ostream& os, const Edge& i);
  83.172      };
  83.173 @@ -447,7 +447,7 @@
  83.174      protected:
  83.175        EdgeIt(edge_item* _e) : Edge(_e) { }
  83.176        EdgeIt& operator++() { 
  83.177 -	node_item* v=edge->_tail;
  83.178 +	node_item* v=edge->_source;
  83.179  	edge=edge->_next_out; 
  83.180  	while (v && !edge) { v=v->_next_node; if (v) edge=v->_first_out_edge; }
  83.181  	return *this;
  83.182 @@ -467,8 +467,8 @@
  83.183      protected:
  83.184        OutEdgeIt& operator++() { edge=edge->_next_out; return *this; }
  83.185      protected:
  83.186 -      Node aNode() const { return Node(edge->_tail); }
  83.187 -      Node bNode() const { return Node(edge->_head); }
  83.188 +      Node aNode() const { return Node(edge->_source); }
  83.189 +      Node bNode() const { return Node(edge->_target); }
  83.190      };
  83.191      
  83.192      class InEdgeIt : public Edge {
  83.193 @@ -484,8 +484,8 @@
  83.194      protected:
  83.195        InEdgeIt& operator++() { edge=edge->_next_in; return *this; }
  83.196      protected:
  83.197 -      Node aNode() const { return Node(edge->_head); }
  83.198 -      Node bNode() const { return Node(edge->_tail); }
  83.199 +      Node aNode() const { return Node(edge->_target); }
  83.200 +      Node bNode() const { return Node(edge->_source); }
  83.201      };
  83.202  
  83.203      class SymEdgeIt : public Edge {
  83.204 @@ -510,7 +510,7 @@
  83.205      protected:
  83.206        SymEdgeIt& operator++() { 
  83.207  	if (out_or_in) { 
  83.208 -	  node_item* v=edge->_tail;
  83.209 +	  node_item* v=edge->_source;
  83.210  	  edge=edge->_next_out; 
  83.211  	  if (!edge) { out_or_in=0; edge=v->_first_in_edge; }
  83.212  	} else {
  83.213 @@ -520,9 +520,9 @@
  83.214        }
  83.215      protected:
  83.216        Node aNode() const { 
  83.217 -	return (out_or_in) ? Node(edge->_tail) : Node(edge->_head); }
  83.218 +	return (out_or_in) ? Node(edge->_source) : Node(edge->_target); }
  83.219        Node bNode() const { 
  83.220 -	return (out_or_in) ? Node(edge->_head) : Node(edge->_tail); }
  83.221 +	return (out_or_in) ? Node(edge->_target) : Node(edge->_source); }
  83.222      };
  83.223  
  83.224    };
    84.1 --- a/src/work/marci/graph_concept.h	Sat Nov 13 12:24:01 2004 +0000
    84.2 +++ b/src/work/marci/graph_concept.h	Sat Nov 13 12:53:28 2004 +0000
    84.3 @@ -103,10 +103,10 @@
    84.4      //SymEdgeIt &next(SymEdgeIt &) const {}
    84.5  
    84.6  
    84.7 -    /// Gives back the head node of an edge.
    84.8 -    Node head(const Edge&) const { return INVALID; }
    84.9 -    /// Gives back the tail node of an edge.
   84.10 -    Node tail(const Edge&) const { return INVALID; }
   84.11 +    /// Gives back the target node of an edge.
   84.12 +    Node target(const Edge&) const { return INVALID; }
   84.13 +    /// Gives back the source node of an edge.
   84.14 +    Node source(const Edge&) const { return INVALID; }
   84.15    
   84.16      //   Node aNode(SymEdgeIt) const {}
   84.17      //   Node bNode(SymEdgeIt) const {}
   84.18 @@ -142,10 +142,10 @@
   84.19      Node addNode() { return INVALID; }
   84.20      /// \brief Add a new edge to the graph.
   84.21      ///
   84.22 -    /// Add a new edge to the graph with tail node \c tail
   84.23 -    /// and head node \c head.
   84.24 +    /// Add a new edge to the graph with source node \c source
   84.25 +    /// and target node \c target.
   84.26      /// \return the new edge.
   84.27 -    Edge addEdge(const Node& tail, const Node& head) { return INVALID; }
   84.28 +    Edge addEdge(const Node& source, const Node& target) { return INVALID; }
   84.29      
   84.30      /// \brief Resets the graph.
   84.31      /// 
    85.1 --- a/src/work/marci/iterator_bfs_demo.cc	Sat Nov 13 12:24:01 2004 +0000
    85.2 +++ b/src/work/marci/iterator_bfs_demo.cc	Sat Nov 13 12:53:28 2004 +0000
    85.3 @@ -23,7 +23,7 @@
    85.4      graph(_graph), node_name_map(_node_name_map) { }
    85.5    string operator[](typename Graph::Edge e) const { 
    85.6      return 
    85.7 -      (node_name_map[graph.tail(e)]+"->"+node_name_map[graph.head(e)]);
    85.8 +      (node_name_map[graph.source(e)]+"->"+node_name_map[graph.target(e)]);
    85.9    }
   85.10  };
   85.11  
   85.12 @@ -95,14 +95,14 @@
   85.13        //cout << "edge: ";
   85.14        if (Graph::Edge(bfs)!=INVALID) {
   85.15  	cout << edge_name[bfs] << /*endl*/", " << 
   85.16 -	  node_name[G.tail(bfs)] << 
   85.17 +	  node_name[G.source(bfs)] << 
   85.18  	  (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 
   85.19 -	  node_name[G.head(bfs)] << 
   85.20 +	  node_name[G.target(bfs)] << 
   85.21  	  (bfs.isBNodeNewlyReached() ? ": is newly reached." : 
   85.22  	   ": is not newly reached.");
   85.23        } else { 
   85.24  	cout << "invalid" << /*endl*/", " << 
   85.25 -	  node_name[bfs.tail()] << 
   85.26 +	  node_name[bfs.source()] << 
   85.27  	  (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 
   85.28  	  
   85.29  	  "invalid.";
   85.30 @@ -129,14 +129,14 @@
   85.31        //cout << "edge: ";
   85.32        if (Graph::Edge(dfs)!=INVALID) {
   85.33  	cout << edge_name[dfs] << /*endl*/", " << 
   85.34 -	  node_name[G.tail(dfs)] << 
   85.35 +	  node_name[G.source(dfs)] << 
   85.36  	  (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 
   85.37 -	  node_name[G.head(dfs)] << 
   85.38 +	  node_name[G.target(dfs)] << 
   85.39  	  (dfs.isBNodeNewlyReached() ? ": is newly reached." : 
   85.40  	   ": is not newly reached.");
   85.41        } else { 
   85.42  	cout << "invalid" << /*endl*/", " << 
   85.43 -	  node_name[dfs.tail()] << 
   85.44 +	  node_name[dfs.source()] << 
   85.45  	  (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 
   85.46  	  
   85.47  	  "invalid.";
   85.48 @@ -171,14 +171,14 @@
   85.49        //cout << "edge: ";
   85.50        if (GW::Edge(bfs)!=INVALID) {
   85.51  	cout << edge_name[GW::Edge(bfs)] << /*endl*/", " << 
   85.52 -	  node_name[gw.tail(bfs)] << 
   85.53 +	  node_name[gw.source(bfs)] << 
   85.54  	  (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 
   85.55 -	  node_name[gw.head(bfs)] << 
   85.56 +	  node_name[gw.target(bfs)] << 
   85.57  	  (bfs.isBNodeNewlyReached() ? ": is newly reached." : 
   85.58  	   ": is not newly reached.");
   85.59        } else { 
   85.60  	cout << "invalid" << /*endl*/", " << 
   85.61 -	  node_name[bfs.tail()] << 
   85.62 +	  node_name[bfs.source()] << 
   85.63  	  (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 
   85.64  	  
   85.65  	  "invalid.";
   85.66 @@ -205,14 +205,14 @@
   85.67        //cout << "edge: ";
   85.68        if (GW::Edge(dfs)!=INVALID) {
   85.69  	cout << edge_name[GW::Edge(dfs)] << /*endl*/", " << 
   85.70 -	  node_name[gw.tail(dfs)] << 
   85.71 +	  node_name[gw.source(dfs)] << 
   85.72  	  (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 
   85.73 -	  node_name[gw.head(dfs)] << 
   85.74 +	  node_name[gw.target(dfs)] << 
   85.75  	  (dfs.isBNodeNewlyReached() ? ": is newly reached." : 
   85.76  	   ": is not newly reached.");
   85.77        } else { 
   85.78  	cout << "invalid" << /*endl*/", " << 
   85.79 -	  node_name[dfs.tail()] << 
   85.80 +	  node_name[dfs.source()] << 
   85.81  	  (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 
   85.82  	  
   85.83  	  "invalid.";
   85.84 @@ -310,7 +310,7 @@
   85.85      
   85.86      cout << "bfs and dfs iterator demo on the bidirected graph" << endl;
   85.87  //     for(GW::EdgeIt e(gw); e!=INVALID; ++e) {
   85.88 -//       cout << node_name[gw.tail(e)] << "->" << node_name[gw.head(e)] << " ";
   85.89 +//       cout << node_name[gw.source(e)] << "->" << node_name[gw.target(e)] << " ";
   85.90  //     } 
   85.91      for(GW::NodeIt n(gw); n!=INVALID; ++n) { 
   85.92        cout << node_name[GW::Node(n)] << ": ";
   85.93 @@ -334,14 +334,14 @@
   85.94        //cout << "edge: ";
   85.95        if (GW::Edge(bfs)!=INVALID) {
   85.96  	cout << edge_name[GW::Edge(bfs)] << /*endl*/", " << 
   85.97 -	  node_name[gw.tail(bfs)] << 
   85.98 +	  node_name[gw.source(bfs)] << 
   85.99  	  (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 
  85.100 -	  node_name[gw.head(bfs)] << 
  85.101 +	  node_name[gw.target(bfs)] << 
  85.102  	  (bfs.isBNodeNewlyReached() ? ": is newly reached." : 
  85.103  	   ": is not newly reached.");
  85.104        } else { 
  85.105  	cout << "invalid" << /*endl*/", " << 
  85.106 -	  node_name[bfs.tail()] << 
  85.107 +	  node_name[bfs.source()] << 
  85.108  	  (bfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 
  85.109  	  
  85.110  	  "invalid.";
  85.111 @@ -368,14 +368,14 @@
  85.112        //cout << "edge: ";
  85.113        if (GW::Edge(dfs)!=INVALID) {
  85.114  	cout << edge_name[GW::Edge(dfs)] << /*endl*/", " << 
  85.115 -	  node_name[gw.tail(dfs)] << 
  85.116 +	  node_name[gw.source(dfs)] << 
  85.117  	  (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 
  85.118 -	  node_name[gw.head(dfs)] << 
  85.119 +	  node_name[gw.target(dfs)] << 
  85.120  	  (dfs.isBNodeNewlyReached() ? ": is newly reached." : 
  85.121  	   ": is not newly reached.");
  85.122        } else { 
  85.123  	cout << "invalid" << /*endl*/", " << 
  85.124 -	  node_name[dfs.tail()] << 
  85.125 +	  node_name[dfs.source()] << 
  85.126  	  (dfs.isANodeExamined() ? ": is examined, " : ": is not examined, ") << 
  85.127  	  
  85.128  	  "invalid.";
    86.1 --- a/src/work/marci/leda/bipartite_matching_comparison.cc	Sat Nov 13 12:24:01 2004 +0000
    86.2 +++ b/src/work/marci/leda/bipartite_matching_comparison.cc	Sat Nov 13 12:53:28 2004 +0000
    86.3 @@ -129,7 +129,7 @@
    86.4    }
    86.5  
    86.6    FOR_EACH_LOC(BGW::EdgeIt, e, bgw) 
    86.7 -    hg.addEdge(b_s_nodes[bgw.tail(e)], b_t_nodes[bgw.head(e)]);
    86.8 +    hg.addEdge(b_s_nodes[bgw.source(e)], b_t_nodes[bgw.target(e)]);
    86.9  
   86.10    ConstMap<SageGraph::Edge, int> cm(1);
   86.11    SageGraph::EdgeMap<int> flow(hg); //0
    87.1 --- a/src/work/marci/leda/leda_graph_wrapper.h	Sat Nov 13 12:24:01 2004 +0000
    87.2 +++ b/src/work/marci/leda/leda_graph_wrapper.h	Sat Nov 13 12:53:28 2004 +0000
    87.3 @@ -213,21 +213,21 @@
    87.4  //       return e; 
    87.5  //     }
    87.6  
    87.7 -    ///Gives back the head node of an edge.
    87.8 -    Node head(Edge e) const { 
    87.9 +    ///Gives back the target node of an edge.
   87.10 +    Node target(Edge e) const { 
   87.11        return Node(l_graph->target(e.l_e)); 
   87.12      }
   87.13 -    ///Gives back the tail node of an edge.
   87.14 -    Node tail(Edge e) const { 
   87.15 +    ///Gives back the source node of an edge.
   87.16 +    Node source(Edge e) const { 
   87.17        return Node(l_graph->source(e.l_e)); 
   87.18      }
   87.19    
   87.20 -    Node aNode(InEdgeIt e) const { return head(e); }
   87.21 -    Node aNode(OutEdgeIt e) const { return tail(e); }
   87.22 +    Node aNode(InEdgeIt e) const { return target(e); }
   87.23 +    Node aNode(OutEdgeIt e) const { return source(e); }
   87.24      //   Node aNode(SymEdgeIt) const {}
   87.25  
   87.26 -    Node bNode(InEdgeIt e) const { return tail(e); }
   87.27 -    Node bNode(OutEdgeIt e) const { return head(e); }
   87.28 +    Node bNode(InEdgeIt e) const { return source(e); }
   87.29 +    Node bNode(OutEdgeIt e) const { return target(e); }
   87.30      //   Node bNode(SymEdgeIt) const {}
   87.31  
   87.32      /// Checks if a node iterator is valid
   87.33 @@ -244,8 +244,8 @@
   87.34      //void setInvalid(Edge &) const {};
   87.35    
   87.36      Node addNode() const { return Node(l_graph->new_node()); }
   87.37 -    Edge addEdge(Node tail, Node head) const { 
   87.38 -      return Edge(l_graph->new_edge(tail.l_n, head.l_n));
   87.39 +    Edge addEdge(Node source, Node target) const { 
   87.40 +      return Edge(l_graph->new_edge(source.l_n, target.l_n));
   87.41      }
   87.42      
   87.43      void erase(Node n) const { l_graph->del_node(n.l_n); }
    88.1 --- a/src/work/marci/leda/max_bipartite_matching_demo.cc	Sat Nov 13 12:24:01 2004 +0000
    88.2 +++ b/src/work/marci/leda/max_bipartite_matching_demo.cc	Sat Nov 13 12:53:28 2004 +0000
    88.3 @@ -103,10 +103,10 @@
    88.4  //     cout << G.id(n) << ": ";
    88.5  //     cout << "out edges: ";
    88.6  //     for(OutEdgeIt e=G.first<OutEdgeIt>(n); G.valid(e); G.next(e)) 
    88.7 -//       cout << G.id(G.tail(e)) << "->" << G.id(G.head(e)) << " ";
    88.8 +//       cout << G.id(G.source(e)) << "->" << G.id(G.target(e)) << " ";
    88.9  //     cout << "in edges: ";
   88.10  //     for(InEdgeIt e=G.first<InEdgeIt>(n); G.valid(e); G.next(e)) 
   88.11 -//       cout << G.id(G.tail(e)) << "->" << G.id(G.head(e)) << " ";
   88.12 +//       cout << G.id(G.source(e)) << "->" << G.id(G.target(e)) << " ";
   88.13  //     cout << endl;
   88.14  //   }
   88.15  
   88.16 @@ -123,7 +123,7 @@
   88.17      int i=0;
   88.18      while (max_flow_test.augmentOnShortestPath()) { 
   88.19  //       for(EdgeIt e=G.first<EdgeIt>(); G.valid(e); G.next(e))  
   88.20 -// 	std::cout << G.id(G.tail(e)) << "-" << flow.get(e) << "->" << G.id(G.head(e)) << " ";
   88.21 +// 	std::cout << G.id(G.source(e)) << "-" << flow.get(e) << "->" << G.id(G.target(e)) << " ";
   88.22  //       std::cout<<std::endl;
   88.23        ++i; 
   88.24      }
   88.25 @@ -131,12 +131,12 @@
   88.26  //     std::cout << "maximum matching: "<< std::endl;
   88.27  //     for(EdgeIt e=G.first<EdgeIt>(); G.valid(e); G.next(e))  
   88.28  //       if (flow.get(e))
   88.29 -// 	std::cout << G.id(G.tail(e)) << "-" << flow.get(e) << "->" << G.id(G.head(e)) << " ";
   88.30 +// 	std::cout << G.id(G.source(e)) << "-" << flow.get(e) << "->" << G.id(G.target(e)) << " ";
   88.31  //     std::cout<<std::endl;
   88.32  //     std::cout << "edges which are not in this maximum matching: "<< std::endl;
   88.33  //     for(EdgeIt e=G.first<EdgeIt>(); G.valid(e); G.next(e))  
   88.34  //       if (!flow.get(e))
   88.35 -// 	std::cout << G.id(G.tail(e)) << "-" << flow.get(e) << "->" << G.id(G.head(e)) << " ";
   88.36 +// 	std::cout << G.id(G.source(e)) << "-" << flow.get(e) << "->" << G.id(G.target(e)) << " ";
   88.37  //     std::cout<<std::endl;
   88.38      
   88.39      std::cout << "elapsed time: " << ts << std::endl;
   88.40 @@ -156,7 +156,7 @@
   88.41  //     int i=0;
   88.42  //     while (max_flow_test.augmentOnBlockingFlow2()) { 
   88.43  // //       for(EdgeIt e=G.first<EdgeIt>(); G.valid(e); G.next(e))  
   88.44 -// // 	std::cout << G.id(G.tail(e)) << "-" << flow.get(e) << "->" << G.id(G.head(e)) << " ";
   88.45 +// // 	std::cout << G.id(G.source(e)) << "-" << flow.get(e) << "->" << G.id(G.target(e)) << " ";
   88.46  // //       std::cout<<std::endl;
   88.47  //       ++i; 
   88.48  //     }
   88.49 @@ -164,12 +164,12 @@
   88.50  // //     std::cout << "maximum matching: "<< std::endl;
   88.51  // //     for(EdgeIt e=G.first<EdgeIt>(); G.valid(e); G.next(e))  
   88.52  // //       if (flow.get(e))
   88.53 -// // 	std::cout << G.id(G.tail(e)) << "-" << flow.get(e) << "->" << G.id(G.head(e)) << " ";
   88.54 +// // 	std::cout << G.id(G.source(e)) << "-" << flow.get(e) << "->" << G.id(G.target(e)) << " ";
   88.55  // //     std::cout<<std::endl;
   88.56  // //     std::cout << "edges which are not in this maximum matching: "<< std::endl;
   88.57  // //     for(EdgeIt e=G.first<EdgeIt>(); G.valid(e); G.next(e))  
   88.58  // //       if (!flow.get(e))
   88.59 -// // 	std::cout << G.id(G.tail(e)) << "-" << flow.get(e) << "->" << G.id(G.head(e)) << " ";
   88.60 +// // 	std::cout << G.id(G.source(e)) << "-" << flow.get(e) << "->" << G.id(G.target(e)) << " ";
   88.61  // //     std::cout<<std::endl;
   88.62      
   88.63  //     std::cout << "elapsed time: " << ts << std::endl;
   88.64 @@ -198,12 +198,12 @@
   88.65  //     std::cout << "maximum matching: "<< std::endl;
   88.66  //     for(EdgeIt e=G.first<EdgeIt>(); G.valid(e); G.next(e))  
   88.67  //       if (flow.get(e))
   88.68 -// 	std::cout << G.id(G.tail(e)) << "-" << flow.get(e) << "->" << G.id(G.head(e)) << " ";
   88.69 +// 	std::cout << G.id(G.source(e)) << "-" << flow.get(e) << "->" << G.id(G.target(e)) << " ";
   88.70  //     std::cout<<std::endl;
   88.71  //     std::cout << "edges which are not in this maximum matching: "<< std::endl;
   88.72  //     for(EdgeIt e=G.first<EdgeIt>(); G.valid(e); G.next(e))  
   88.73  //       if (!flow.get(e))
   88.74 -// 	std::cout << G.id(G.tail(e)) << "-" << flow.get(e) << "->" << G.id(G.head(e)) << " ";
   88.75 +// 	std::cout << G.id(G.source(e)) << "-" << flow.get(e) << "->" << G.id(G.target(e)) << " ";
   88.76  //     std::cout<<std::endl;
   88.77      
   88.78      
    89.1 --- a/src/work/marci/leda_bfs_dfs.cc	Sat Nov 13 12:24:01 2004 +0000
    89.2 +++ b/src/work/marci/leda_bfs_dfs.cc	Sat Nov 13 12:53:28 2004 +0000
    89.3 @@ -25,7 +25,7 @@
    89.4      graph(_graph), node_name_map(_node_name_map) { }
    89.5    string get(typename Graph::Edge e) const { 
    89.6      return 
    89.7 -      (node_name_map.get(graph.tail(e))+"->"+node_name_map.get(graph.head(e)));
    89.8 +      (node_name_map.get(graph.source(e))+"->"+node_name_map.get(graph.target(e)));
    89.9    }
   89.10  };
   89.11  
    90.1 --- a/src/work/marci/leda_graph_demo.cc	Sat Nov 13 12:24:01 2004 +0000
    90.2 +++ b/src/work/marci/leda_graph_demo.cc	Sat Nov 13 12:53:28 2004 +0000
    90.3 @@ -38,10 +38,10 @@
    90.4  //     cout << G.id(n) << ": ";
    90.5  //     cout << "out edges: ";
    90.6  //     for(OutEdgeIt e=G.first<OutEdgeIt>(n); G.valid(e); G.next(e)) 
    90.7 -//       cout << G.id(G.tail(e)) << "-" << cap.get(e) << "->" << G.id(G.head(e)) << " ";
    90.8 +//       cout << G.id(G.source(e)) << "-" << cap.get(e) << "->" << G.id(G.target(e)) << " ";
    90.9  //     cout << "in edges: ";
   90.10  //     for(InEdgeIt e=G.first<InEdgeIt>(n); G.valid(e); G.next(e)) 
   90.11 -//       cout << G.id(G.tail(e)) << "-" << cap.get(e) << "->" << G.id(G.head(e)) << " ";
   90.12 +//       cout << G.id(G.source(e)) << "-" << cap.get(e) << "->" << G.id(G.target(e)) << " ";
   90.13  //     cout << endl;
   90.14  //   }
   90.15  
   90.16 @@ -64,7 +64,7 @@
   90.17      int i=0;
   90.18      while (max_flow_test.augmentOnShortestPath()) { 
   90.19  //     for(EdgeIt e=G.template first<EdgeIt>(); e.valid(); ++e) { 
   90.20 -//       std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
   90.21 +//       std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
   90.22  //     }
   90.23  //     std::cout<<std::endl;
   90.24        ++i; 
   90.25 @@ -72,7 +72,7 @@
   90.26  
   90.27  //   std::cout << "maximum flow: "<< std::endl;
   90.28  //   for(EdgeIt e=G.first<EdgeIt>(); e.valid(); ++e) { 
   90.29 -//     std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
   90.30 +//     std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
   90.31  //   }
   90.32  //   std::cout<<std::endl;
   90.33      std::cout << "elapsed time: " << ts << std::endl;
    91.1 --- a/src/work/marci/lp/max_flow_by_lp.cc	Sat Nov 13 12:24:01 2004 +0000
    91.2 +++ b/src/work/marci/lp/max_flow_by_lp.cc	Sat Nov 13 12:53:28 2004 +0000
    91.3 @@ -63,9 +63,9 @@
    91.4      max_flow_test.actMinCut(cut);
    91.5  
    91.6      FOR_EACH_LOC(Graph::EdgeIt, e, g) {
    91.7 -      if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) 
    91.8 +      if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) 
    91.9  	std::cout << "Slackness does not hold!" << std::endl;
   91.10 -      if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) 
   91.11 +      if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) 
   91.12  	std::cout << "Slackness does not hold!" << std::endl;
   91.13      }
   91.14    }
   91.15 @@ -79,9 +79,9 @@
   91.16  //     std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
   91.17  
   91.18  //     FOR_EACH_LOC(Graph::EdgeIt, e, g) {
   91.19 -//       if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) 
   91.20 +//       if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) 
   91.21  // 	std::cout << "Slackness does not hold!" << std::endl;
   91.22 -//       if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) 
   91.23 +//       if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) 
   91.24  // 	std::cout << "Slackness does not hold!" << std::endl;
   91.25  //     }
   91.26  //   }
   91.27 @@ -106,9 +106,9 @@
   91.28      std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl;
   91.29  
   91.30      FOR_EACH_LOC(Graph::EdgeIt, e, g) {
   91.31 -      if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) 
   91.32 +      if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) 
   91.33  	std::cout << "Slackness does not hold!" << std::endl;
   91.34 -      if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) 
   91.35 +      if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) 
   91.36  	std::cout << "Slackness does not hold!" << std::endl;
   91.37      }
   91.38    }
   91.39 @@ -135,9 +135,9 @@
   91.40      std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl;
   91.41  
   91.42      FOR_EACH_LOC(Graph::EdgeIt, e, g) {
   91.43 -      if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) 
   91.44 +      if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) 
   91.45  	std::cout << "Slackness does not hold!" << std::endl;
   91.46 -      if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) 
   91.47 +      if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) 
   91.48  	std::cout << "Slackness does not hold!" << std::endl;
   91.49      }
   91.50    }
   91.51 @@ -153,9 +153,9 @@
   91.52  //     std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl;
   91.53  
   91.54  //     FOR_EACH_LOC(Graph::EdgeIt, e, g) {
   91.55 -//       if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) 
   91.56 +//       if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) 
   91.57  // 	std::cout << "Slackness does not hold!" << std::endl;
   91.58 -//       if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) 
   91.59 +//       if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) 
   91.60  // 	std::cout << "Slackness does not hold!" << std::endl;
   91.61  //     }
   91.62  //   }
   91.63 @@ -171,9 +171,9 @@
   91.64  //     std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl;
   91.65  
   91.66  //     FOR_EACH_LOC(Graph::EdgeIt, e, g) {
   91.67 -//       if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) 
   91.68 +//       if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) 
   91.69  // 	std::cout << "Slackness does not hold!" << std::endl;
   91.70 -//       if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) 
   91.71 +//       if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) 
   91.72  // 	std::cout << "Slackness does not hold!" << std::endl;
   91.73  //     }
   91.74  //   }
    92.1 --- a/src/work/marci/max_flow_demo.cc	Sat Nov 13 12:24:01 2004 +0000
    92.2 +++ b/src/work/marci/max_flow_demo.cc	Sat Nov 13 12:53:28 2004 +0000
    92.3 @@ -47,9 +47,9 @@
    92.4      max_flow_test.minCut(cut);
    92.5  
    92.6      for(Graph::EdgeIt e(g); e!=INVALID; ++e) {
    92.7 -      if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) 
    92.8 +      if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) 
    92.9  	std::cout << "Slackness does not hold!" << std::endl;
   92.10 -      if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) 
   92.11 +      if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) 
   92.12  	std::cout << "Slackness does not hold!" << std::endl;
   92.13      }
   92.14    }
   92.15 @@ -63,9 +63,9 @@
   92.16      std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
   92.17  
   92.18      for(Graph::EdgeIt e(g); e!=INVALID; ++e) {
   92.19 -      if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) 
   92.20 +      if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) 
   92.21  	std::cout << "Slackness does not hold!" << std::endl;
   92.22 -      if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) 
   92.23 +      if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) 
   92.24  	std::cout << "Slackness does not hold!" << std::endl;
   92.25      }
   92.26    }
   92.27 @@ -90,9 +90,9 @@
   92.28      std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl;
   92.29  
   92.30      for(Graph::EdgeIt e(g); e!=INVALID; ++e) {
   92.31 -      if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) 
   92.32 +      if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) 
   92.33  	std::cout << "Slackness does not hold!" << std::endl;
   92.34 -      if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) 
   92.35 +      if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) 
   92.36  	std::cout << "Slackness does not hold!" << std::endl;
   92.37      }
   92.38    }
   92.39 @@ -108,9 +108,9 @@
   92.40      std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl;
   92.41  
   92.42      for(Graph::EdgeIt e(g); e!=INVALID; ++e) {
   92.43 -      if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) 
   92.44 +      if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) 
   92.45  	std::cout << "Slackness does not hold!" << std::endl;
   92.46 -      if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) 
   92.47 +      if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) 
   92.48  	std::cout << "Slackness does not hold!" << std::endl;
   92.49      }
   92.50    }
   92.51 @@ -126,9 +126,9 @@
   92.52      std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl;
   92.53  
   92.54      for(Graph::EdgeIt e(g); e!=INVALID; ++e) {
   92.55 -      if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) 
   92.56 +      if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) 
   92.57  	std::cout << "Slackness does not hold!" << std::endl;
   92.58 -      if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) 
   92.59 +      if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) 
   92.60  	std::cout << "Slackness does not hold!" << std::endl;
   92.61      }
   92.62    }
   92.63 @@ -144,9 +144,9 @@
   92.64      std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl;
   92.65  
   92.66      for(Graph::EdgeIt e(g); e!=INVALID; ++e) {
   92.67 -      if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) 
   92.68 +      if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) 
   92.69  	std::cout << "Slackness does not hold!" << std::endl;
   92.70 -      if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) 
   92.71 +      if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) 
   92.72  	std::cout << "Slackness does not hold!" << std::endl;
   92.73      }
   92.74    }
    93.1 --- a/src/work/marci/oldies/edmonds_karp.h	Sat Nov 13 12:24:01 2004 +0000
    93.2 +++ b/src/work/marci/oldies/edmonds_karp.h	Sat Nov 13 12:53:28 2004 +0000
    93.3 @@ -59,15 +59,15 @@
    93.4        while ( !bfs.finished() ) { 
    93.5  	ResGWOutEdgeIt e=bfs;
    93.6  	if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
    93.7 -	  Node v=res_graph.tail(e);
    93.8 -	  Node w=res_graph.head(e);
    93.9 +	  Node v=res_graph.source(e);
   93.10 +	  Node w=res_graph.target(e);
   93.11  	  pred.set(w, e);
   93.12  	  if (res_graph.valid(pred[v])) {
   93.13  	    free.set(w, std::min(free[v], res_graph.resCap(e)));
   93.14  	  } else {
   93.15  	    free.set(w, res_graph.resCap(e)); 
   93.16  	  }
   93.17 -	  if (res_graph.head(e)==t) { _augment=true; break; }
   93.18 +	  if (res_graph.target(e)==t) { _augment=true; break; }
   93.19  	}
   93.20  	
   93.21  	++bfs;
   93.22 @@ -79,7 +79,7 @@
   93.23  	while (res_graph.valid(pred[n])) { 
   93.24  	  ResGWEdge e=pred[n];
   93.25  	  res_graph.augment(e, augment_value); 
   93.26 -	  n=res_graph.tail(e);
   93.27 +	  n=res_graph.source(e);
   93.28  	}
   93.29        }
   93.30  
   93.31 @@ -101,9 +101,9 @@
   93.32  //       int get(const typename MapGraphWrapper::Node& n) const { 
   93.33  // 	return dist[n]; }
   93.34  //       bool get(const typename MapGraphWrapper::Edge& e) const { 
   93.35 -// 	return (dist.get(g->tail(e))<dist.get(g->head(e))); }
   93.36 +// 	return (dist.get(g->source(e))<dist.get(g->target(e))); }
   93.37        bool operator[](const typename MapGraphWrapper::Edge& e) const { 
   93.38 -	return (dist[g->tail(e)]<dist[g->head(e)]); 
   93.39 +	return (dist[g->source(e)]<dist[g->target(e)]); 
   93.40        }
   93.41      };
   93.42  
   93.43 @@ -123,7 +123,7 @@
   93.44        while ( !bfs.finished() ) { 
   93.45  	ResGWOutEdgeIt e=bfs;
   93.46  	if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
   93.47 -	  dist.set(res_graph.head(e), dist[res_graph.tail(e)]+1);
   93.48 +	  dist.set(res_graph.target(e), dist[res_graph.source(e)]+1);
   93.49  	}
   93.50  	++bfs;
   93.51        } //computing distances from s in the residual graph
   93.52 @@ -152,8 +152,8 @@
   93.53        {
   93.54  	typename FilterResGW::EdgeIt e;
   93.55  	for(filter_res_graph.first(e); filter_res_graph.valid(e); filter_res_graph.next(e)) {
   93.56 -	  //if (dist.get(res_graph.head(e))==dist.get(res_graph.tail(e))+1) {
   93.57 -	  typename MG::Edge f=F.addEdge(res_graph_to_F[res_graph.tail(e)], res_graph_to_F[res_graph.head(e)]);
   93.58 +	  //if (dist.get(res_graph.target(e))==dist.get(res_graph.source(e))+1) {
   93.59 +	  typename MG::Edge f=F.addEdge(res_graph_to_F[res_graph.source(e)], res_graph_to_F[res_graph.target(e)]);
   93.60  	  original_edge.update();
   93.61  	  original_edge.set(f, e);
   93.62  	  residual_capacity.update();
   93.63 @@ -206,7 +206,7 @@
   93.64  	  while (F.valid(pred[n])) { 
   93.65  	    typename MG::Edge e=pred[n];
   93.66  	    res_graph.augment(original_edge[e], augment_value); 
   93.67 -	    n=F.tail(e);
   93.68 +	    n=F.source(e);
   93.69  	    if (residual_capacity[e]==augment_value) 
   93.70  	      F.erase(e); 
   93.71  	    else 
   93.72 @@ -254,15 +254,15 @@
   93.73  	ResGWOutEdgeIt e=bfs;
   93.74  	if (res_graph.valid(e)) {
   93.75  	  if (bfs.isBNodeNewlyReached()) {
   93.76 -	    dist.set(res_graph.head(e), dist[res_graph.tail(e)]+1);
   93.77 -	    typename MG::Edge f=F.addEdge(res_graph_to_F[res_graph.tail(e)], res_graph_to_F[res_graph.head(e)]);
   93.78 +	    dist.set(res_graph.target(e), dist[res_graph.source(e)]+1);
   93.79 +	    typename MG::Edge f=F.addEdge(res_graph_to_F[res_graph.source(e)], res_graph_to_F[res_graph.target(e)]);
   93.80  	    original_edge.update();
   93.81  	    original_edge.set(f, e);
   93.82  	    residual_capacity.update();
   93.83  	    residual_capacity.set(f, res_graph.resCap(e));
   93.84  	  } else {
   93.85 -	    if (dist[res_graph.head(e)]==(dist[res_graph.tail(e)]+1)) {
   93.86 -	      typename MG::Edge f=F.addEdge(res_graph_to_F[res_graph.tail(e)], res_graph_to_F[res_graph.head(e)]);
   93.87 +	    if (dist[res_graph.target(e)]==(dist[res_graph.source(e)]+1)) {
   93.88 +	      typename MG::Edge f=F.addEdge(res_graph_to_F[res_graph.source(e)], res_graph_to_F[res_graph.target(e)]);
   93.89  	      original_edge.update();
   93.90  	      original_edge.set(f, e);
   93.91  	      residual_capacity.update();
   93.92 @@ -316,7 +316,7 @@
   93.93  	  while (F.valid(pred[n])) { 
   93.94  	    typename MG::Edge e=pred[n];
   93.95  	    res_graph.augment(original_edge[e], augment_value); 
   93.96 -	    n=F.tail(e);
   93.97 +	    n=F.source(e);
   93.98  	    if (residual_capacity[e]==augment_value) 
   93.99  	      F.erase(e); 
  93.100  	    else 
  93.101 @@ -343,7 +343,7 @@
  93.102        while ( !bfs.finished() ) { 
  93.103   	ResGWOutEdgeIt e=bfs;
  93.104   	if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
  93.105 - 	  dist.set(res_graph.head(e), dist[res_graph.tail(e)]+1);
  93.106 + 	  dist.set(res_graph.target(e), dist[res_graph.source(e)]+1);
  93.107   	}
  93.108  	++bfs;
  93.109        } //computing distances from s in the residual graph
  93.110 @@ -440,7 +440,7 @@
  93.111   	  while (erasing_res_graph.valid(pred[n])) { 
  93.112   	    typename ErasingResGW::OutEdgeIt e=pred[n];
  93.113   	    res_graph.augment(e, augment_value);
  93.114 - 	    n=erasing_res_graph.tail(e);
  93.115 + 	    n=erasing_res_graph.source(e);
  93.116   	    if (res_graph.resCap(e)==0)
  93.117   	      erasing_res_graph.erase(e);
  93.118  	}
  93.119 @@ -535,15 +535,15 @@
  93.120  //       while ( !bfs.finished() ) { 
  93.121  // 	AugOutEdgeIt e=bfs;
  93.122  // 	if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
  93.123 -// 	  Node v=res_graph.tail(e);
  93.124 -// 	  Node w=res_graph.head(e);
  93.125 +// 	  Node v=res_graph.source(e);
  93.126 +// 	  Node w=res_graph.target(e);
  93.127  // 	  pred.set(w, e);
  93.128  // 	  if (res_graph.valid(pred.get(v))) {
  93.129  // 	    free.set(w, std::min(free.get(v), res_graph.free(e)));
  93.130  // 	  } else {
  93.131  // 	    free.set(w, res_graph.free(e)); 
  93.132  // 	  }
  93.133 -// 	  n=res_graph.head(e);
  93.134 +// 	  n=res_graph.target(e);
  93.135  // 	  if (T->get(n) && (used.get(n)<1) ) { 
  93.136  // 	    //Num u=0;
  93.137  // 	    //for(InEdgeIt f=G->template first<InEdgeIt>(n); G->valid(f); G->next(f))
  93.138 @@ -565,7 +565,7 @@
  93.139  // 	while (res_graph.valid(pred.get(n))) { 
  93.140  // 	  AugEdge e=pred.get(n);
  93.141  // 	  res_graph.augment(e, augment_value); 
  93.142 -// 	  n=res_graph.tail(e);
  93.143 +// 	  n=res_graph.source(e);
  93.144  // 	}
  93.145  // 	used.set(n, 1); //mind2 vegen jav
  93.146  //       }
  93.147 @@ -606,7 +606,7 @@
  93.148  // //       while ( !bfs.finished() ) { 
  93.149  // // 	AugOutEdgeIt e=bfs;
  93.150  // // 	if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
  93.151 -// // 	  dist.set(res_graph.head(e), dist.get(res_graph.tail(e))+1);
  93.152 +// // 	  dist.set(res_graph.target(e), dist.get(res_graph.source(e))+1);
  93.153  // // 	}
  93.154  	
  93.155  // // 	++bfs;
  93.156 @@ -628,8 +628,8 @@
  93.157  // //       //Making F to the graph containing the edges of the residual graph 
  93.158  // //       //which are in some shortest paths
  93.159  // //       for(typename AugGraph::EdgeIt e=res_graph.template first<typename AugGraph::EdgeIt>(); res_graph.valid(e); res_graph.next(e)) {
  93.160 -// // 	if (dist.get(res_graph.head(e))==dist.get(res_graph.tail(e))+1) {
  93.161 -// // 	  typename MutableGraph::Edge f=F.addEdge(res_graph_to_F.get(res_graph.tail(e)), res_graph_to_F.get(res_graph.head(e)));
  93.162 +// // 	if (dist.get(res_graph.target(e))==dist.get(res_graph.source(e))+1) {
  93.163 +// // 	  typename MutableGraph::Edge f=F.addEdge(res_graph_to_F.get(res_graph.source(e)), res_graph_to_F.get(res_graph.target(e)));
  93.164  // // 	  original_edge.update();
  93.165  // // 	  original_edge.set(f, e);
  93.166  // // 	  residual_capacity.update();
  93.167 @@ -681,7 +681,7 @@
  93.168  // // 	  while (F.valid(pred.get(n))) { 
  93.169  // // 	    typename MutableGraph::Edge e=pred.get(n);
  93.170  // // 	    res_graph.augment(original_edge.get(e), augment_value); 
  93.171 -// // 	    n=F.tail(e);
  93.172 +// // 	    n=F.source(e);
  93.173  // // 	    if (residual_capacity.get(e)==augment_value) 
  93.174  // // 	      F.erase(e); 
  93.175  // // 	    else 
  93.176 @@ -732,7 +732,7 @@
  93.177  //       while ( !bfs.finished() ) {
  93.178  // 	typename ErasingResGraphWrapper<Graph, Num, FlowMap, CapMap>::OutEdgeIt e=bfs;
  93.179  // 	if (res_graph.valid(e) && bfs.isBNodeNewlyReached()) {
  93.180 -// 	  dist.set(res_graph.head(e), dist.get(res_graph.tail(e))+1);
  93.181 +// 	  dist.set(res_graph.target(e), dist.get(res_graph.source(e))+1);
  93.182  // 	}
  93.183  // 	++bfs;	
  93.184  //       } //computing distances from s in the residual graph
  93.185 @@ -809,7 +809,7 @@
  93.186  // 	  while (res_graph.valid(pred.get(n))) { 
  93.187  // 	    EAugEdge e=pred.get(n);
  93.188  // 	    res_graph.augment(e, augment_value);
  93.189 -// 	    n=res_graph.tail(e);
  93.190 +// 	    n=res_graph.source(e);
  93.191  // 	    if (res_graph.free(e)==0)
  93.192  // 	      res_graph.erase(e);
  93.193  // 	  }
  93.194 @@ -902,17 +902,17 @@
  93.195  // //       while ( !bfs.finished() ) { 
  93.196  // // 	AugOutEdgeIt e=/*AugOutEdgeIt*/(bfs);
  93.197  // // 	if (e.valid() && bfs.isBNodeNewlyReached()) {
  93.198 -// // 	  Node v=res_graph.tail(e);
  93.199 -// // 	  Node w=res_graph.head(e);
  93.200 +// // 	  Node v=res_graph.source(e);
  93.201 +// // 	  Node w=res_graph.target(e);
  93.202  // // 	  pred.set(w, e);
  93.203  // // 	  if (pred.get(v).valid()) {
  93.204  // // 	    free.set(w, std::min(free.get(v), e.free()));
  93.205  // // 	  } else {
  93.206  // // 	    free.set(w, e.free()); 
  93.207  // // 	  }
  93.208 -// // 	  if (TMap.get(res_graph.head(e))) { 
  93.209 +// // 	  if (TMap.get(res_graph.target(e))) { 
  93.210  // // 	    _augment=true; 
  93.211 -// // 	    reached_t_node=res_graph.head(e);
  93.212 +// // 	    reached_t_node=res_graph.target(e);
  93.213  // // 	    break; 
  93.214  // // 	  }
  93.215  // // 	}
  93.216 @@ -926,7 +926,7 @@
  93.217  // // 	while (pred.get(n).valid()) { 
  93.218  // // 	  AugEdge e=pred.get(n);
  93.219  // // 	  e.augment(augment_value); 
  93.220 -// // 	  n=res_graph.tail(e);
  93.221 +// // 	  n=res_graph.source(e);
  93.222  // // 	}
  93.223  // //       }
  93.224  
    94.1 --- a/src/work/marci/oldies/marci_graph_demo.cc	Sat Nov 13 12:24:01 2004 +0000
    94.2 +++ b/src/work/marci/oldies/marci_graph_demo.cc	Sat Nov 13 12:53:28 2004 +0000
    94.3 @@ -31,7 +31,7 @@
    94.4      std::cout << "node " << G.id(i) << std::endl;
    94.5      std::cout << " outdegree (OutEdgeIt): " << count(G.first<OutEdgeIt>(i)) << " "; 
    94.6      for(OutEdgeIt j=G.first<OutEdgeIt>(i); G.valid(j); G.next(j)) { 
    94.7 -      std::cout << "(" << G.id(G.tail(j)) << "--" << G.id(j) << "->" << G.id(G.head(j)) << ") ";
    94.8 +      std::cout << "(" << G.id(G.source(j)) << "--" << G.id(j) << "->" << G.id(G.target(j)) << ") ";
    94.9      }
   94.10      std::cout << std::endl; 
   94.11  
   94.12 @@ -89,9 +89,9 @@
   94.13      _i*=_ii; ++_ii;
   94.14    }
   94.15  
   94.16 -  std::cout << "node and edge property values on the tails and heads of edges..." << std::endl;
   94.17 +  std::cout << "node and edge property values on the sources and targets of edges..." << std::endl;
   94.18    for(EdgeIt j=G.first<EdgeIt>(); G.valid(j); G.next(j)) {
   94.19 -    std::cout << my_property_vector.get(G.tail(j)) << "--" << my_edge_property.get(j) << "-->" << my_property_vector.get(G.head(j)) << " ";
   94.20 +    std::cout << my_property_vector.get(G.source(j)) << "--" << my_edge_property.get(j) << "-->" << my_property_vector.get(G.target(j)) << " ";
   94.21    }
   94.22    std::cout << std::endl;
   94.23  /*
   94.24 @@ -158,10 +158,10 @@
   94.25      std::cout << node_name.get(i) << ": ";
   94.26      std::cout << "out edges: ";
   94.27      for(OutEdgeIt j=flowG.first<OutEdgeIt>(i); flowG.valid(j); flowG.next(j)) 
   94.28 -      std::cout << node_name.get(flowG.tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";
   94.29 +      std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " ";
   94.30      std::cout << "in edges: ";
   94.31      for(InEdgeIt j=flowG.first<InEdgeIt>(i); flowG.valid(j); flowG.next(j)) 
   94.32 -      std::cout << node_name.get(flowG.tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";
   94.33 +      std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " ";
   94.34      std::cout << std::endl;
   94.35    }
   94.36  
   94.37 @@ -171,22 +171,22 @@
   94.38    //flowG.deleteEdge(v1_v3);
   94.39    
   94.40  
   94.41 -  //flowG.setTail(v3_t, v2);
   94.42 -  //flowG.setHead(v3_t, s);
   94.43 +  //flowG.setSource(v3_t, v2);
   94.44 +  //flowG.setTarget(v3_t, s);
   94.45  /*
   94.46    for(NodeIt i=flowG.first<NodeIt>(); flowG.valid(i); flowG.next(i)) { 
   94.47      std::cout << node_name.get(i) << ": ";
   94.48      std::cout << "out edges: ";
   94.49      for(OutEdgeIt j=flowG.first<OutEdgeIt>(i); flowG.valid(j); flowG.next(j)) 
   94.50 -      std::cout << node_name.get(flowG.tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";
   94.51 +      std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " ";
   94.52      std::cout << "in edges: ";
   94.53      for(InEdgeIt j=flowG.first<InEdgeIt>(i); flowG.valid(j); flowG.next(j)) 
   94.54 -      std::cout << node_name.get(flowG.tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";
   94.55 +      std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " ";
   94.56      std::cout << std::endl;
   94.57    }
   94.58    
   94.59    for(EdgeIt e=flowG.first<EdgeIt>(); flowG.valid(e); flowG.next(e)) {
   94.60 -    std::cout << node_name.get(flowG.tail(e)) << "-"<< cap.get(e) << "->" << node_name.get(flowG.head(e)) << " ";
   94.61 +    std::cout << node_name.get(flowG.source(e)) << "-"<< cap.get(e) << "->" << node_name.get(flowG.target(e)) << " ";
   94.62    }
   94.63  */
   94.64    /*
   94.65 @@ -196,10 +196,10 @@
   94.66        std::cout << node_name.get(i) << ": ";
   94.67        std::cout << "out edges: ";
   94.68        for(OutEdgeIt j=flowG.first<OutEdgeIt>(i); flowG.valid(j); flowG.next(j)) 
   94.69 -	std::cout << node_name.get(flowG.tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";
   94.70 +	std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " ";
   94.71        std::cout << "in edges: ";
   94.72        for(InEdgeIt j=flowG.first<InEdgeIt>(i); flowG.valid(j); flowG.next(j)) 
   94.73 -	std::cout << node_name.get(flowG.tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";
   94.74 +	std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " ";
   94.75        std::cout << std::endl;
   94.76      }
   94.77    }
   94.78 @@ -210,10 +210,10 @@
   94.79        std::cout << node_name.get(i) << ": ";
   94.80        std::cout << "out edges: ";
   94.81        for(OutEdgeIt j=flowG.first<OutEdgeIt>(i); flowG.valid(j); flowG.next(j)) 
   94.82 -	std::cout << node_name.get(flowG.tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";
   94.83 +	std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " ";
   94.84        std::cout << "in edges: ";
   94.85        for(InEdgeIt j=flowG.first<InEdgeIt>(i); flowG.valid(j); flowG.next(j)) 
   94.86 -	std::cout << node_name.get(flowG.tail(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.head(j)) << " ";
   94.87 +	std::cout << node_name.get(flowG.source(j)) << "-"<< cap.get(j) << "->" << node_name.get(flowG.target(j)) << " ";
   94.88        std::cout << std::endl;
   94.89      }
   94.90    }
   94.91 @@ -228,12 +228,12 @@
   94.92      /*
   94.93      max_flow_test.augmentOnBlockingFlow<ListGraph>();
   94.94      for(EdgeIt e=flowG.template first<EdgeIt>(); flowG.valid(e); flowG.next(e)) { 
   94.95 -      std::cout<<"("<<flowG.tail(e)<< "-"<<flow.get(e)<<"->"<<flowG.head(e)<<") ";
   94.96 +      std::cout<<"("<<flowG.source(e)<< "-"<<flow.get(e)<<"->"<<flowG.target(e)<<") ";
   94.97      }
   94.98      std::cout<<std::endl;
   94.99      max_flow_test.augmentOnBlockingFlow<ListGraph>();
  94.100      for(EdgeIt e=flowG.template first<EdgeIt>(); flowG.valid(e); flowG.next(e)) { 
  94.101 -      std::cout<<"("<<flowG.tail(e)<< "-"<<flow.get(e)<<"->"<<flowG.head(e)<<") ";
  94.102 +      std::cout<<"("<<flowG.source(e)<< "-"<<flow.get(e)<<"->"<<flowG.target(e)<<") ";
  94.103      }
  94.104      std::cout<<std::endl;*/
  94.105      //max_flow_test.run();
  94.106 @@ -241,7 +241,7 @@
  94.107      //std::cout << "maximum flow: "<< std::endl;
  94.108      while (max_flow_test.augmentOnShortestPath()) {
  94.109        for(EdgeIt e=flowG.template first<EdgeIt>(); flowG.valid(e); flowG.next(e)) { 
  94.110 -	std::cout<<"("<<flowG.tail(e)<< "-"<<flow.get(e)<<"->"<<flowG.head(e)<<") ";
  94.111 +	std::cout<<"("<<flowG.source(e)<< "-"<<flow.get(e)<<"->"<<flowG.target(e)<<") ";
  94.112        }
  94.113        std::cout<<std::endl;
  94.114      }
  94.115 @@ -260,7 +260,7 @@
  94.116      
  94.117      std::cout << "maximum flow: "<< std::endl;
  94.118      for(EdgeIt e=flowG.template first<EdgeIt>(); flowG.valid(e); flowG.next(e)) { 
  94.119 -      std::cout<<"("<<flowG.tail(e)<< "-"<<flow.get(e)<<"->"<<flowG.head(e)<<") ";
  94.120 +      std::cout<<"("<<flowG.source(e)<< "-"<<flow.get(e)<<"->"<<flowG.target(e)<<") ";
  94.121      }
  94.122      std::cout<<std::endl;
  94.123      std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
    95.1 --- a/src/work/marci/preflow_bug.cc	Sat Nov 13 12:24:01 2004 +0000
    95.2 +++ b/src/work/marci/preflow_bug.cc	Sat Nov 13 12:53:28 2004 +0000
    95.3 @@ -45,7 +45,7 @@
    95.4    {
    95.5      Graph::EdgeIt e;
    95.6      for (g.first(e); g.valid(e); g.next(e))
    95.7 -      cout << 1+g.id(g.tail(e)) << "->" << 1+g.id(g.head(e)) << " cap: " << cap[e] << " preflow: " << flow[e] << endl;
    95.8 +      cout << 1+g.id(g.source(e)) << "->" << 1+g.id(g.target(e)) << " cap: " << cap[e] << " preflow: " << flow[e] << endl;
    95.9    }
   95.10    {
   95.11      Graph::NodeIt n;
   95.12 @@ -75,15 +75,15 @@
   95.13      
   95.14      Graph::EdgeIt e;
   95.15      for (g.first(e); g.valid(e); g.next(e)) {
   95.16 -      if (cut[g.tail(e)] && !cut[g.head(e)]) {
   95.17 -	cout << 1+g.id(g.tail(e)) << "->" << 1+g.id(g.head(e)) 
   95.18 +      if (cut[g.source(e)] && !cut[g.target(e)]) {
   95.19 +	cout << 1+g.id(g.source(e)) << "->" << 1+g.id(g.target(e)) 
   95.20  	     << "(forward edge) flow: " << flow[e] 
   95.21  	     << " cap: " << cap[e]<< endl;
   95.22  	if (flow[e]!=cap[e]) 
   95.23  	std::cout << "Slackness does not hold!" << std::endl;
   95.24        }
   95.25 -      if (!cut[g.tail(e)] && cut[g.head(e)]) {
   95.26 -	cout << 1+g.id(g.tail(e)) << "->" << 1+g.id(g.head(e)) 
   95.27 +      if (!cut[g.source(e)] && cut[g.target(e)]) {
   95.28 +	cout << 1+g.id(g.source(e)) << "->" << 1+g.id(g.target(e)) 
   95.29  	     << "(backward edge) flow: " << flow[e] << endl;
   95.30  	if (flow[e]!=0) 
   95.31  	std::cout << "Slackness does not hold!" << std::endl;
   95.32 @@ -105,9 +105,9 @@
   95.33  //     max_flow_test.actMinCut(cut);
   95.34  
   95.35  //     FOR_EACH_LOC(Graph::EdgeIt, e, g) {
   95.36 -//       if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) 
   95.37 +//       if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) 
   95.38  // 	std::cout << "Slackness does not hold!" << std::endl;
   95.39 -//       if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) 
   95.40 +//       if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) 
   95.41  // 	std::cout << "Slackness does not hold!" << std::endl;
   95.42  //     }
   95.43  //   }
   95.44 @@ -121,9 +121,9 @@
   95.45  //     std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
   95.46  
   95.47  //     FOR_EACH_LOC(Graph::EdgeIt, e, g) {
   95.48 -//       if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) 
   95.49 +//       if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) 
   95.50  // 	std::cout << "Slackness does not hold!" << std::endl;
   95.51 -//       if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) 
   95.52 +//       if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) 
   95.53  // 	std::cout << "Slackness does not hold!" << std::endl;
   95.54  //     }
   95.55  //   }
   95.56 @@ -148,9 +148,9 @@
   95.57  //     std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl;
   95.58  
   95.59  //     FOR_EACH_LOC(Graph::EdgeIt, e, g) {
   95.60 -//       if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) 
   95.61 +//       if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) 
   95.62  // 	std::cout << "Slackness does not hold!" << std::endl;
   95.63 -//       if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) 
   95.64 +//       if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) 
   95.65  // 	std::cout << "Slackness does not hold!" << std::endl;
   95.66  //     }
   95.67  //   }
   95.68 @@ -177,9 +177,9 @@
   95.69  //     std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl;
   95.70  
   95.71  //     FOR_EACH_LOC(Graph::EdgeIt, e, g) {
   95.72 -//       if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) 
   95.73 +//       if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) 
   95.74  // 	std::cout << "Slackness does not hold!" << std::endl;
   95.75 -//       if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) 
   95.76 +//       if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) 
   95.77  // 	std::cout << "Slackness does not hold!" << std::endl;
   95.78  //     }
   95.79  //   }
   95.80 @@ -195,9 +195,9 @@
   95.81  //     std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl;
   95.82  
   95.83  //     FOR_EACH_LOC(Graph::EdgeIt, e, g) {
   95.84 -//       if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) 
   95.85 +//       if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) 
   95.86  // 	std::cout << "Slackness does not hold!" << std::endl;
   95.87 -//       if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) 
   95.88 +//       if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) 
   95.89  // 	std::cout << "Slackness does not hold!" << std::endl;
   95.90  //     }
   95.91  //   }
   95.92 @@ -213,9 +213,9 @@
   95.93  //     std::cout << "flow value: "<< augmenting_flow_test.flowValue() << std::endl;
   95.94  
   95.95  //     FOR_EACH_LOC(Graph::EdgeIt, e, g) {
   95.96 -//       if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e]) 
   95.97 +//       if (cut[g.source(e)] && !cut[g.target(e)] && !flow[e]==cap[e]) 
   95.98  // 	std::cout << "Slackness does not hold!" << std::endl;
   95.99 -//       if (!cut[g.tail(e)] && cut[g.head(e)] && flow[e]>0) 
  95.100 +//       if (!cut[g.source(e)] && cut[g.target(e)] && flow[e]>0) 
  95.101  // 	std::cout << "Slackness does not hold!" << std::endl;
  95.102  //     }
  95.103  //   }
    96.1 --- a/src/work/marci/preflow_demo_athos.cc	Sat Nov 13 12:24:01 2004 +0000
    96.2 +++ b/src/work/marci/preflow_demo_athos.cc	Sat Nov 13 12:53:28 2004 +0000
    96.3 @@ -28,12 +28,12 @@
    96.4    //ListGraph::NodeMap<bool> cut=max_flow_test.mincut();
    96.5    //int cut_value=0;
    96.6    //for(EachEdgeIt e=G.first<EachEdgeIt>(); e.valid(); ++e) {
    96.7 -  //  if (cut.get(G.tail(e)) && !cut.get(G.head(e))) cut_value+=cap.get(e);
    96.8 +  //  if (cut.get(G.source(e)) && !cut.get(G.target(e))) cut_value+=cap.get(e);
    96.9    //}
   96.10    double post_time=currTime();
   96.11    //std::cout << "maximum flow: "<< std::endl;
   96.12    //for(EachEdgeIt e=G.first<EachEdgeIt>(); e.valid(); ++e) { 
   96.13 -  //  std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
   96.14 +  //  std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
   96.15    //}
   96.16    //std::cout<<std::endl;
   96.17    std::cout << "elapsed time: " << post_time-pre_time << " sec"<< std::endl; 
    97.1 --- a/src/work/marci/preflow_demo_jacint.cc	Sat Nov 13 12:24:01 2004 +0000
    97.2 +++ b/src/work/marci/preflow_demo_jacint.cc	Sat Nov 13 12:53:28 2004 +0000
    97.3 @@ -31,12 +31,12 @@
    97.4    max_flow_test.mincut(cut);
    97.5    int cut_value=0;
    97.6    for(EachEdgeIt e=G.first<EachEdgeIt>(); e.valid(); ++e) {
    97.7 -    if (cut.get(G.tail(e)) && !cut.get(G.head(e))) cut_value+=cap.get(e);
    97.8 +    if (cut.get(G.source(e)) && !cut.get(G.target(e))) cut_value+=cap.get(e);
    97.9    }
   97.10    double post_time=currTime();
   97.11    //std::cout << "maximum flow: "<< std::endl;
   97.12    //for(EachEdgeIt e=G.first<EachEdgeIt>(); e.valid(); ++e) { 
   97.13 -  //  std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
   97.14 +  //  std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
   97.15    //}
   97.16    //std::cout<<std::endl;
   97.17    std::cout << "elapsed time: " << post_time-pre_time << " sec"<< std::endl; 
   97.18 @@ -55,12 +55,12 @@
   97.19    max_flow_test.mincut(cut);
   97.20    int cut_value=0;
   97.21    for(EachEdgeIt e=G.first<EachEdgeIt>(); e.valid(); ++e) {
   97.22 -    if (cut.get(G.tail(e)) && !cut.get(G.head(e))) cut_value+=cap.get(e);
   97.23 +    if (cut.get(G.source(e)) && !cut.get(G.target(e))) cut_value+=cap.get(e);
   97.24    }
   97.25    double post_time=currTime();
   97.26    //std::cout << "maximum flow: "<< std::endl;
   97.27    //for(EachEdgeIt e=G.first<EachEdgeIt>(); e.valid(); ++e) { 
   97.28 -  //  std::cout<<"("<<G.tail(e)<< "-"<<flow.get(e)<<"->"<<G.head(e)<<") ";
   97.29 +  //  std::cout<<"("<<G.source(e)<< "-"<<flow.get(e)<<"->"<<G.target(e)<<") ";
   97.30    //}
   97.31    //std::cout<<std::endl;
   97.32    std::cout << "elapsed time: " << post_time-pre_time << " sec"<< std::endl; 
    98.1 --- a/src/work/peter/edgepathgraph.h	Sat Nov 13 12:24:01 2004 +0000
    98.2 +++ b/src/work/peter/edgepathgraph.h	Sat Nov 13 12:53:28 2004 +0000
    98.3 @@ -73,7 +73,7 @@
    98.4  	typedef typename P::EdgeIt PEdgeIt;
    98.5  	PEdgeIt f;
    98.6  
    98.7 -	//dep//cout << "Edge " << id(tail(e)) << " - " << id(head(e)) << " in actual layer is";
    98.8 +	//dep//cout << "Edge " << id(source(e)) << " - " << id(target(e)) << " in actual layer is";
    98.9  	T1 incr=actmap[e];
   98.10  	//cout << incr << endl;
   98.11  
   98.12 @@ -82,10 +82,10 @@
   98.13  	  //dep//cout << endl << "Path";
   98.14  	  for(edgepath[e]->first(f); edgepath[e]->valid(f); edgepath[e]->next(f))
   98.15  	  {
   98.16 -	    //dep//cout << " " << sublayer->id(sublayer->tail(f)) << "-" << sublayer->id(sublayer->head(f));
   98.17 +	    //dep//cout << " " << sublayer->id(sublayer->source(f)) << "-" << sublayer->id(sublayer->target(f));
   98.18  	    submap[f]+=incr;
   98.19  	  }
   98.20 -	  //dep////cout << EPGr2.id(EPGr2.head(f)) << endl;
   98.21 +	  //dep////cout << EPGr2.id(EPGr2.target(f)) << endl;
   98.22  	  //dep//cout << endl;
   98.23  	}
   98.24  	else
   98.25 @@ -107,15 +107,15 @@
   98.26  	typedef typename P::EdgeIt PEdgeIt;
   98.27  	PEdgeIt f;
   98.28  
   98.29 -	cout << "Edge " << id(tail(e)) << " - " << id(head(e)) << " in actual layer is";
   98.30 +	cout << "Edge " << id(source(e)) << " - " << id(target(e)) << " in actual layer is";
   98.31          if(edgepath[e])
   98.32  	{
   98.33  	  cout << endl << "Path";
   98.34  	  for(edgepath[e]->first(f); edgepath[e]->valid(f); edgepath[e]->next(f))
   98.35  	  {
   98.36 -	    cout << " " << sublayer->id(sublayer->tail(f)) << "-" << sublayer->id(sublayer->head(f));
   98.37 +	    cout << " " << sublayer->id(sublayer->source(f)) << "-" << sublayer->id(sublayer->target(f));
   98.38  	  }
   98.39 -	  //cout << EPGr2.id(EPGr2.head(f)) << endl;
   98.40 +	  //cout << EPGr2.id(EPGr2.target(f)) << endl;
   98.41  	  cout << endl;
   98.42  	}
   98.43  	else
   98.44 @@ -234,10 +234,10 @@
   98.45      /// Go to the next edge.
   98.46      typename Gact::EdgeIt &next(typename Gact::EdgeIt &i) const { return actuallayer.next(i);}
   98.47  
   98.48 -    ///Gives back the head node of an edge.
   98.49 -    typename Gact::Node head(typename Gact::Edge edge) const { return actuallayer.head(edge); }
   98.50 -    ///Gives back the tail node of an edge.
   98.51 -    typename Gact::Node tail(typename Gact::Edge edge) const { return actuallayer.tail(edge); }
   98.52 +    ///Gives back the target node of an edge.
   98.53 +    typename Gact::Node target(typename Gact::Edge edge) const { return actuallayer.target(edge); }
   98.54 +    ///Gives back the source node of an edge.
   98.55 +    typename Gact::Node source(typename Gact::Edge edge) const { return actuallayer.source(edge); }
   98.56    
   98.57      //   Node aNode(InEdgeIt) const {}
   98.58      //   Node aNode(OutEdgeIt) const {}
   98.59 @@ -279,8 +279,8 @@
   98.60      typename Gact::Node addNode() { return actuallayer.addNode();}
   98.61      ///Add a new edge to the graph.
   98.62  
   98.63 -    ///Add a new edge to the graph with tail node \c tail
   98.64 -    ///and head node \c head.
   98.65 +    ///Add a new edge to the graph with source node \c source
   98.66 +    ///and target node \c target.
   98.67      ///\return the new edge.
   98.68      typename Gact::Edge addEdge(typename Gact::Node node1, typename Gact::Node node2) { return actuallayer.addEdge(node1, node2);}
   98.69      
    99.1 --- a/src/work/peter/edgepathgraph_test.cc	Sat Nov 13 12:24:01 2004 +0000
    99.2 +++ b/src/work/peter/edgepathgraph_test.cc	Sat Nov 13 12:53:28 2004 +0000
    99.3 @@ -135,15 +135,15 @@
    99.4  	typedef DPath::EdgeIt PEdgeIt;
    99.5  	PEdgeIt f;
    99.6  
    99.7 -	cout << "Edge " << EPGr.id(EPGr.tail(e)) << " - " << EPGr.id(EPGr.head(e)) << " in actual layer is";
    99.8 +	cout << "Edge " << EPGr.id(EPGr.source(e)) << " - " << EPGr.id(EPGr.target(e)) << " in actual layer is";
    99.9          if(EPGr.edgepath[e])
   99.10  	{
   99.11  	  cout << endl << "Path";
   99.12  	  for(EPGr.edgepath[e]->first(f); EPGr.edgepath[e]->valid(f); EPGr.edgepath[e]->next(f))
   99.13  	  {
   99.14 -	    cout << " " << EPGr2.id(EPGr2.tail(f)) << "-" << EPGr2.id(EPGr2.head(f));
   99.15 +	    cout << " " << EPGr2.id(EPGr2.source(f)) << "-" << EPGr2.id(EPGr2.target(f));
   99.16  	  }
   99.17 -	  //cout << EPGr2.id(EPGr2.head(f)) << endl;
   99.18 +	  //cout << EPGr2.id(EPGr2.target(f)) << endl;
   99.19  	  cout << endl;
   99.20  	}
   99.21  	else
   99.22 @@ -169,13 +169,13 @@
   99.23        cout << "actlaymap: ";
   99.24        for(EdgeIt e(EPGr.actuallayer);EPGr.actuallayer.valid(e);EPGr.actuallayer.next(e))
   99.25        {
   99.26 -	cout << EPGr.id(EPGr.tail(e)) << "-" << EPGr.id(EPGr.head(e)) << ":" << actlaymap[e] << " ";
   99.27 +	cout << EPGr.id(EPGr.source(e)) << "-" << EPGr.id(EPGr.target(e)) << ":" << actlaymap[e] << " ";
   99.28        }
   99.29        cout << endl;
   99.30        cout << "sublaymap: ";
   99.31        for(ListGraph::EdgeIt e(EPGr2.actuallayer);EPGr2.actuallayer.valid(e);EPGr2.actuallayer.next(e))
   99.32        {
   99.33 -	cout << EPGr2.id(EPGr2.tail(e)) << "-" << EPGr2.id(EPGr2.head(e)) << ":" << sublaymap[e] << " ";
   99.34 +	cout << EPGr2.id(EPGr2.source(e)) << "-" << EPGr2.id(EPGr2.target(e)) << ":" << sublaymap[e] << " ";
   99.35        }
   99.36        cout << endl;
   99.37        //EdgeMap-ok kiirasa#vege
   99.38 @@ -190,13 +190,13 @@
   99.39        cout << "actlaymap: ";
   99.40        for(EdgeIt e(EPGr.actuallayer);EPGr.actuallayer.valid(e);EPGr.actuallayer.next(e))
   99.41        {
   99.42 -	cout << EPGr.id(EPGr.tail(e)) << "-" << EPGr.id(EPGr.head(e)) << ":" << actlaymap[e] << " ";
   99.43 +	cout << EPGr.id(EPGr.source(e)) << "-" << EPGr.id(EPGr.target(e)) << ":" << actlaymap[e] << " ";
   99.44        }
   99.45        cout << endl;
   99.46        cout << "sublaymap: ";
   99.47        for(ListGraph::EdgeIt e(EPGr2.actuallayer);EPGr2.actuallayer.valid(e);EPGr2.actuallayer.next(e))
   99.48        {
   99.49 -	cout << EPGr2.id(EPGr2.tail(e)) << "-" << EPGr2.id(EPGr2.head(e)) << ":" << sublaymap[e] << " ";
   99.50 +	cout << EPGr2.id(EPGr2.source(e)) << "-" << EPGr2.id(EPGr2.target(e)) << ":" << sublaymap[e] << " ";
   99.51        }
   99.52        cout << endl;
   99.53        //EdgeMap-ok kiirasa#vege
   100.1 --- a/src/work/peter/hierarchygraph.h	Sat Nov 13 12:24:01 2004 +0000
   100.2 +++ b/src/work/peter/hierarchygraph.h	Sat Nov 13 12:53:28 2004 +0000
   100.3 @@ -60,9 +60,9 @@
   100.4  	    cerr << "The given edge is not in the given network!" << endl;
   100.5  	    return -1;
   100.6  	  }
   100.7 -	else if ((actuallayer->id (actuallayer->tail (actedge)) !=
   100.8 +	else if ((actuallayer->id (actuallayer->source (actedge)) !=
   100.9  		  actuallayer->id (*actuallayernode))
  100.10 -		 && (actuallayer->id (actuallayer->head (actedge)) !=
  100.11 +		 && (actuallayer->id (actuallayer->target (actedge)) !=
  100.12  		     actuallayer->id (*actuallayernode)))
  100.13  	  {
  100.14  	    cerr << "The given edge does not connect to the given node!" <<
  100.15 @@ -132,23 +132,23 @@
  100.16  	  {
  100.17  	    for (iei = actuallayer->first (iei, (*actuallayernode));
  100.18  		 ((actuallayer->valid (iei))
  100.19 -		  && (actuallayer->head (iei) == (*actuallayernode)));
  100.20 +		  && (actuallayer->target (iei) == (*actuallayernode)));
  100.21  		 actuallayer->next (iei))
  100.22  	      {
  100.23  		cout << actuallayer->id (actuallayer->
  100.24 -					 tail (iei)) << " " << actuallayer->
  100.25 -		  id (actuallayer->head (iei)) << endl;
  100.26 +					 source (iei)) << " " << actuallayer->
  100.27 +		  id (actuallayer->target (iei)) << endl;
  100.28  		edgenumber++;
  100.29  	      }
  100.30  	    //cout << "Number of in-edges: " << edgenumber << endl;
  100.31  	    for (oei = actuallayer->first (oei, (*actuallayernode));
  100.32  		 ((actuallayer->valid (oei))
  100.33 -		  && (actuallayer->tail (oei) == (*actuallayernode)));
  100.34 +		  && (actuallayer->source (oei) == (*actuallayernode)));
  100.35  		 actuallayer->next (oei))
  100.36  	      {
  100.37  		cout << actuallayer->id (actuallayer->
  100.38 -					 tail (oei)) << " " << actuallayer->
  100.39 -		  id (actuallayer->head (oei)) << endl;
  100.40 +					 source (oei)) << " " << actuallayer->
  100.41 +		  id (actuallayer->target (oei)) << endl;
  100.42  		edgenumber++;
  100.43  	      }
  100.44  	    //cout << "Number of in+out-edges: " << edgenumber << endl;
  100.45 @@ -327,15 +327,15 @@
  100.46        return actuallayer.next (i);
  100.47      }
  100.48  
  100.49 -    ///Gives back the head node of an edge.
  100.50 -    typename Gact::Node head (typename Gact::Edge edge) const
  100.51 +    ///Gives back the target node of an edge.
  100.52 +    typename Gact::Node target (typename Gact::Edge edge) const
  100.53      {
  100.54 -      return actuallayer.head (edge);
  100.55 +      return actuallayer.target (edge);
  100.56      }
  100.57 -    ///Gives back the tail node of an edge.
  100.58 -    typename Gact::Node tail (typename Gact::Edge edge) const
  100.59 +    ///Gives back the source node of an edge.
  100.60 +    typename Gact::Node source (typename Gact::Edge edge) const
  100.61      {
  100.62 -      return actuallayer.tail (edge);
  100.63 +      return actuallayer.source (edge);
  100.64      }
  100.65  
  100.66      //   Node aNode(InEdgeIt) const {}
  100.67 @@ -393,8 +393,8 @@
  100.68      }
  100.69      ///Add a new edge to the graph.
  100.70  
  100.71 -    ///Add a new edge to the graph with tail node \c tail
  100.72 -    ///and head node \c head.
  100.73 +    ///Add a new edge to the graph with source node \c source
  100.74 +    ///and target node \c target.
  100.75      ///\return the new edge.
  100.76      typename Gact::Edge addEdge (typename Gact::Node node1,
  100.77  				 typename Gact::Node node2)
   101.1 --- a/src/work/peter/path/path.h	Sat Nov 13 12:24:01 2004 +0000
   101.2 +++ b/src/work/peter/path/path.h	Sat Nov 13 12:53:28 2004 +0000
   101.3 @@ -108,14 +108,14 @@
   101.4      /// Starting point of the path.
   101.5      /// Returns INVALID if the path is empty.
   101.6      GraphNode from() const {
   101.7 -      return empty() ? INVALID : gr->tail(edges[0]);
   101.8 +      return empty() ? INVALID : gr->source(edges[0]);
   101.9      }
  101.10      /// \brief End point of the path.
  101.11      ///
  101.12      /// End point of the path.
  101.13      /// Returns INVALID if the path is empty.
  101.14      GraphNode to() const {
  101.15 -      return empty() ? INVALID : gr->head(edges[length()-1]);
  101.16 +      return empty() ? INVALID : gr->target(edges[length()-1]);
  101.17      }
  101.18  
  101.19      /// \brief Initializes node or edge iterator to point to the first
  101.20 @@ -153,19 +153,19 @@
  101.21        return ++e;
  101.22      }
  101.23  
  101.24 -    /// \brief Returns node iterator pointing to the head node of the
  101.25 +    /// \brief Returns node iterator pointing to the target node of the
  101.26      /// given edge iterator.
  101.27 -    NodeIt head(const EdgeIt& e) const {
  101.28 +    NodeIt target(const EdgeIt& e) const {
  101.29        if( DM::range_check && !e.valid() )
  101.30 -	fault("DirPath::head() on invalid iterator");
  101.31 +	fault("DirPath::target() on invalid iterator");
  101.32        return NodeIt(*this, e.idx+1);
  101.33      }
  101.34  
  101.35 -    /// \brief Returns node iterator pointing to the tail node of the
  101.36 +    /// \brief Returns node iterator pointing to the source node of the
  101.37      /// given edge iterator.
  101.38 -    NodeIt tail(const EdgeIt& e) const {
  101.39 +    NodeIt source(const EdgeIt& e) const {
  101.40        if( DM::range_check && !e.valid() )
  101.41 -	fault("DirPath::tail() on invalid iterator");
  101.42 +	fault("DirPath::source() on invalid iterator");
  101.43        return NodeIt(*this, e.idx);
  101.44      }
  101.45  
  101.46 @@ -254,7 +254,7 @@
  101.47  	if(idx >= p->length())
  101.48  	  return p->to();
  101.49  	else if(idx >= 0)
  101.50 -	  return p->gr->tail(p->edges[idx]);
  101.51 +	  return p->gr->source(p->edges[idx]);
  101.52  	else
  101.53  	  return INVALID;
  101.54        }
  101.55 @@ -312,7 +312,7 @@
  101.56        ///Push a new edge to the front of the path.
  101.57        ///\sa setStartNode
  101.58        void pushFront(const GraphEdge& e) {
  101.59 -	if( DM::consistensy_check && !empty() && P.gr->head(e)!=from() ) {
  101.60 +	if( DM::consistensy_check && !empty() && P.gr->target(e)!=from() ) {
  101.61  	  fault("DirPath::Builder::pushFront: nonincident edge");
  101.62  	}
  101.63  	front.push_back(e);
  101.64 @@ -323,7 +323,7 @@
  101.65        ///Push a new edge to the back of the path.
  101.66        ///\sa setStartNode
  101.67        void pushBack(const GraphEdge& e) {
  101.68 -	if( DM::consistensy_check && !empty() && P.gr->tail(e)!=to() ) {
  101.69 +	if( DM::consistensy_check && !empty() && P.gr->source(e)!=to() ) {
  101.70  	  fault("DirPath::Builder::pushBack: nonincident edge");
  101.71  	}
  101.72  	back.push_back(e);
  101.73 @@ -362,21 +362,21 @@
  101.74  
  101.75        GraphNode from() const {
  101.76  	if( ! front.empty() )
  101.77 -	  return P.gr->tail(front[front.size()-1]);
  101.78 +	  return P.gr->source(front[front.size()-1]);
  101.79  	else if( ! P.empty() )
  101.80 -	  return P.gr->tail(P.edges[0]);
  101.81 +	  return P.gr->source(P.edges[0]);
  101.82  	else if( ! back.empty() )
  101.83 -	  return P.gr->tail(back[0]);
  101.84 +	  return P.gr->source(back[0]);
  101.85  	else
  101.86  	  return INVALID;
  101.87        }
  101.88        GraphNode to() const {
  101.89  	if( ! back.empty() )
  101.90 -	  return P.gr->head(back[back.size()-1]);
  101.91 +	  return P.gr->target(back[back.size()-1]);
  101.92  	else if( ! P.empty() )
  101.93 -	  return P.gr->head(P.edges[P.length()-1]);
  101.94 +	  return P.gr->target(P.edges[P.length()-1]);
  101.95  	else if( ! front.empty() )
  101.96 -	  return P.gr->head(front[0]);
  101.97 +	  return P.gr->target(front[0]);
  101.98  	else
  101.99  	  return INVALID;
 101.100        }
 101.101 @@ -471,14 +471,14 @@
 101.102      /// Starting point of the path.
 101.103      /// Returns INVALID if the path is empty.
 101.104      GraphNode from() const {
 101.105 -      return empty() ? INVALID : gr->tail(edges[0]);
 101.106 +      return empty() ? INVALID : gr->source(edges[0]);
 101.107      }
 101.108      /// \brief End point of the path.
 101.109      ///
 101.110      /// End point of the path.
 101.111      /// Returns INVALID if the path is empty.
 101.112      GraphNode to() const {
 101.113 -      return empty() ? INVALID : gr->head(edges[length()-1]);
 101.114 +      return empty() ? INVALID : gr->target(edges[length()-1]);
 101.115      }
 101.116  
 101.117      /// \brief Initializes node or edge iterator to point to the first
 101.118 @@ -516,19 +516,19 @@
 101.119        return ++e;
 101.120      }
 101.121  
 101.122 -    /// \brief Returns node iterator pointing to the head node of the
 101.123 +    /// \brief Returns node iterator pointing to the target node of the
 101.124      /// given edge iterator.
 101.125 -    NodeIt head(const EdgeIt& e) const {
 101.126 +    NodeIt target(const EdgeIt& e) const {
 101.127        if( DM::range_check && !e.valid() )
 101.128 -	fault("UndirPath::head() on invalid iterator");
 101.129 +	fault("UndirPath::target() on invalid iterator");
 101.130        return NodeIt(*this, e.idx+1);
 101.131      }
 101.132  
 101.133 -    /// \brief Returns node iterator pointing to the tail node of the
 101.134 +    /// \brief Returns node iterator pointing to the source node of the
 101.135      /// given edge iterator.
 101.136 -    NodeIt tail(const EdgeIt& e) const {
 101.137 +    NodeIt source(const EdgeIt& e) const {
 101.138        if( DM::range_check && !e.valid() )
 101.139 -	fault("UndirPath::tail() on invalid iterator");
 101.140 +	fault("UndirPath::source() on invalid iterator");
 101.141        return NodeIt(*this, e.idx);
 101.142      }
 101.143  
 101.144 @@ -615,7 +615,7 @@
 101.145  	if(idx >= p->length())
 101.146  	  return p->to();
 101.147  	else if(idx >= 0)
 101.148 -	  return p->gr->tail(p->edges[idx]);
 101.149 +	  return p->gr->source(p->edges[idx]);
 101.150  	else
 101.151  	  return INVALID;
 101.152        }
 101.153 @@ -673,7 +673,7 @@
 101.154        ///Push a new edge to the front of the path.
 101.155        ///\sa setStartNode
 101.156        void pushFront(const GraphEdge& e) {
 101.157 -	if( DM::consistensy_check && !empty() && P.gr->head(e)!=from() ) {
 101.158 +	if( DM::consistensy_check && !empty() && P.gr->target(e)!=from() ) {
 101.159  	  fault("UndirPath::Builder::pushFront: nonincident edge");
 101.160  	}
 101.161  	front.push_back(e);
 101.162 @@ -684,7 +684,7 @@
 101.163        ///Push a new edge to the back of the path.
 101.164        ///\sa setStartNode
 101.165        void pushBack(const GraphEdge& e) {
 101.166 -	if( DM::consistensy_check && !empty() && P.gr->tail(e)!=to() ) {
 101.167 +	if( DM::consistensy_check && !empty() && P.gr->source(e)!=to() ) {
 101.168  	  fault("UndirPath::Builder::pushBack: nonincident edge");
 101.169  	}
 101.170  	back.push_back(e);
 101.171 @@ -723,21 +723,21 @@
 101.172  
 101.173        GraphNode from() const {
 101.174  	if( ! front.empty() )
 101.175 -	  return P.gr->tail(front[front.size()-1]);
 101.176 +	  return P.gr->source(front[front.size()-1]);
 101.177  	else if( ! P.empty() )
 101.178 -	  return P.gr->tail(P.edges[0]);
 101.179 +	  return P.gr->source(P.edges[0]);
 101.180  	else if( ! back.empty() )
 101.181 -	  return P.gr->tail(back[0]);
 101.182 +	  return P.gr->source(back[0]);
 101.183  	else
 101.184  	  return INVALID;
 101.185        }
 101.186        GraphNode to() const {
 101.187  	if( ! back.empty() )
 101.188 -	  return P.gr->head(back[back.size()-1]);
 101.189 +	  return P.gr->target(back[back.size()-1]);
 101.190  	else if( ! P.empty() )
 101.191 -	  return P.gr->head(P.edges[P.length()-1]);
 101.192 +	  return P.gr->target(P.edges[P.length()-1]);
 101.193  	else if( ! front.empty() )
 101.194 -	  return P.gr->head(front[0]);
 101.195 +	  return P.gr->target(front[0]);
 101.196  	else
 101.197  	  return INVALID;
 101.198        }
 101.199 @@ -840,12 +840,12 @@
 101.200      bool setFrom(const GraphNode &n);
 101.201      bool setTo(const GraphNode &n);
 101.202  
 101.203 -    // WARNING: these two functions return the head/tail of an edge with
 101.204 +    // WARNING: these two functions return the target/source of an edge with
 101.205      // respect to the direction of the path!
 101.206 -    // So G.head(P.graphEdge(e)) == P.graphNode(P.head(e)) holds only if 
 101.207 +    // So G.target(P.graphEdge(e)) == P.graphNode(P.target(e)) holds only if 
 101.208      // P.forward(e) is true (or the edge is a loop)!
 101.209 -    NodeIt head(const EdgeIt& e) const;
 101.210 -    NodeIt tail(const EdgeIt& e) const;
 101.211 +    NodeIt target(const EdgeIt& e) const;
 101.212 +    NodeIt source(const EdgeIt& e) const;
 101.213  
 101.214      // FIXME: ezeknek valami jobb nev kellene!!!
 101.215      GraphEdge graphEdge(const EdgeIt& e) const;
 101.216 @@ -873,7 +873,7 @@
 101.217        friend class DynamicPath;
 101.218  
 101.219        size_t idx;
 101.220 -      bool tail;  // Is this node the tail of the edge with same idx?
 101.221 +      bool source;  // Is this node the source of the edge with same idx?
 101.222  
 101.223      public:
 101.224        // FIXME: jarna neki ilyen is...
 101.225 @@ -896,7 +896,7 @@
 101.226      if( e.it == edges.end() ) 
 101.227        return e;
 101.228  
 101.229 -    GraphNode common_node = ( e.forw ? G.head(*e.it) : G.tail(*e.it) );
 101.230 +    GraphNode common_node = ( e.forw ? G.target(*e.it) : G.source(*e.it) );
 101.231      ++e.it;
 101.232  
 101.233      // Invalid edgeit is always forward :)
 101.234 @@ -905,7 +905,7 @@
 101.235        return e;
 101.236      }
 101.237  
 101.238 -    e.forw = ( G.tail(*e.it) == common_node );
 101.239 +    e.forw = ( G.source(*e.it) == common_node );
 101.240      return e;
 101.241    }
 101.242  
 101.243 @@ -918,14 +918,14 @@
 101.244      }
 101.245  
 101.246      
 101.247 -    GraphNode next_node = ( n.tail ? G.head(edges[n.idx]) :
 101.248 -			      G.tail(edges[n.idx]) );
 101.249 +    GraphNode next_node = ( n.source ? G.target(edges[n.idx]) :
 101.250 +			      G.source(edges[n.idx]) );
 101.251      ++n.idx;
 101.252      if( n.idx < length() ) {
 101.253 -      n.tail = ( next_node == G.tail(edges[n.idx]) );
 101.254 +      n.source = ( next_node == G.source(edges[n.idx]) );
 101.255      }
 101.256      else {
 101.257 -      n.tail = true;
 101.258 +      n.source = true;
 101.259      }
 101.260  
 101.261      return n;
 101.262 @@ -934,12 +934,12 @@
 101.263    template<typename Gr>
 101.264    bool DynamicPath<Gr>::edgeIncident(const GraphEdge &e, const GraphNode &a,
 101.265  			  GraphNode &b) {
 101.266 -    if( G.tail(e) == a ) {
 101.267 -      b=G.head(e);
 101.268 +    if( G.source(e) == a ) {
 101.269 +      b=G.target(e);
 101.270        return true;
 101.271      }
 101.272 -    if( G.head(e) == a ) {
 101.273 -      b=G.tail(e);
 101.274 +    if( G.target(e) == a ) {
 101.275 +      b=G.source(e);
 101.276        return true;
 101.277      }
 101.278      return false;
 101.279 @@ -948,12 +948,12 @@
 101.280    template<typename Gr>
 101.281    bool DynamicPath<Gr>::connectTwoEdges(const GraphEdge &e,
 101.282  			     const GraphEdge &f) {
 101.283 -    if( edgeIncident(f, G.tail(e), _last) ) {
 101.284 -      _first = G.head(e);
 101.285 +    if( edgeIncident(f, G.source(e), _last) ) {
 101.286 +      _first = G.target(e);
 101.287        return true;
 101.288      }
 101.289 -    if( edgeIncident(f, G.head(e), _last) ) {
 101.290 -      _first = G.tail(e);
 101.291 +    if( edgeIncident(f, G.target(e), _last) ) {
 101.292 +      _first = G.source(e);
 101.293        return true;
 101.294      }
 101.295      return false;
 101.296 @@ -1039,31 +1039,31 @@
 101.297  
 101.298    template<typename Gr>
 101.299    typename DynamicPath<Gr>::NodeIt
 101.300 -  DynamicPath<Gr>::tail(const EdgeIt& e) const {
 101.301 +  DynamicPath<Gr>::source(const EdgeIt& e) const {
 101.302      NodeIt n;
 101.303  
 101.304      if( e.it == edges.end() ) {
 101.305        // FIXME: invalid-> invalid
 101.306        n.idx = length() + 1;
 101.307 -      n.tail = true;
 101.308 +      n.source = true;
 101.309        return n;
 101.310      }
 101.311  
 101.312      n.idx = e.it-edges.begin();
 101.313 -    n.tail = e.forw;
 101.314 +    n.source = e.forw;
 101.315      return n;
 101.316    }
 101.317  
 101.318    template<typename Gr>
 101.319    typename DynamicPath<Gr>::NodeIt
 101.320 -  DynamicPath<Gr>::head(const EdgeIt& e) const {
 101.321 +  DynamicPath<Gr>::target(const EdgeIt& e) const {
 101.322      if( e.it == edges.end()-1 ) {
 101.323        return _last;
 101.324      }
 101.325  
 101.326      EdgeIt next_edge = e;
 101.327      next(next_edge);
 101.328 -    return tail(next_edge);
 101.329 +    return source(next_edge);
 101.330    }
 101.331        
 101.332    template<typename Gr>
 101.333 @@ -1081,7 +1081,7 @@
 101.334    typename DynamicPath<Gr>::GraphNode
 101.335    DynamicPath<Gr>::graphNode(const NodeIt& n) const {
 101.336      if( n.idx < length() ) {
 101.337 -      return n.tail ? G.tail(edges[n.idx]) : G.head(edges[n.idx]);
 101.338 +      return n.source ? G.source(edges[n.idx]) : G.target(edges[n.idx]);
 101.339      }
 101.340      else if( n.idx == length() ) {
 101.341        return _last;
 101.342 @@ -1103,11 +1103,11 @@
 101.343  
 101.344      e.it = edges.begin()+k;
 101.345      if(k==0) {
 101.346 -      e.forw = ( G.tail(*e.it) == _first );
 101.347 +      e.forw = ( G.source(*e.it) == _first );
 101.348      }
 101.349      else {
 101.350 -      e.forw = ( G.tail(*e.it) == G.tail(edges[k-1]) ||
 101.351 -		 G.tail(*e.it) == G.head(edges[k-1]) );
 101.352 +      e.forw = ( G.source(*e.it) == G.source(edges[k-1]) ||
 101.353 +		 G.source(*e.it) == G.target(edges[k-1]) );
 101.354      }
 101.355      return e;
 101.356    }
 101.357 @@ -1118,15 +1118,15 @@
 101.358      if( k>length() ) {
 101.359        // FIXME: invalid NodeIt
 101.360        n.idx = length()+1;
 101.361 -      n.tail = true;
 101.362 +      n.source = true;
 101.363        return n;
 101.364      }
 101.365      if( k==length() ) {
 101.366        n.idx = length();
 101.367 -      n.tail = true;
 101.368 +      n.source = true;
 101.369        return n;
 101.370      }
 101.371 -    n = tail(nth<EdgeIt>(k));
 101.372 +    n = source(nth<EdgeIt>(k));
 101.373      return n;
 101.374    }
 101.375  
 101.376 @@ -1139,9 +1139,9 @@
 101.377      G(P.G), edges(a.it, b.it)    // WARNING: if b.it < a.it this will blow up! 
 101.378    {
 101.379      if( G.valid(P._first) && a.it < P.edges.end() ) {
 101.380 -      _first = ( a.forw ? G.tail(*a.it) : G.head(*a.it) );
 101.381 +      _first = ( a.forw ? G.source(*a.it) : G.target(*a.it) );
 101.382        if( b.it < P.edges.end() ) {
 101.383 -	_last = ( b.forw ? G.tail(*b.it) : G.head(*b.it) );
 101.384 +	_last = ( b.forw ? G.source(*b.it) : G.target(*b.it) );
 101.385        }
 101.386        else {
 101.387  	_last = P._last;
   102.1 --- a/src/work/peter/path/path_skeleton.h	Sat Nov 13 12:24:01 2004 +0000
   102.2 +++ b/src/work/peter/path/path_skeleton.h	Sat Nov 13 12:53:28 2004 +0000
   102.3 @@ -53,12 +53,12 @@
   102.4        ///
   102.5        /// Starting point of the path.
   102.6        /// Returns INVALID if the path is empty.
   102.7 -      GraphNode head() const {}
   102.8 +      GraphNode target() const {}
   102.9        /// \brief End point of the path.
  102.10        ///
  102.11        /// End point of the path.
  102.12        /// Returns INVALID if the path is empty.
  102.13 -      GraphNode tail() const {}
  102.14 +      GraphNode source() const {}
  102.15  
  102.16        /// \brief First NodeIt/EdgeIt.
  102.17        ///
  102.18 @@ -67,17 +67,17 @@
  102.19        template<typename It>
  102.20        It& first(It &i) const { return i=It(*this); }
  102.21  
  102.22 -      /// \brief The head of an edge.
  102.23 +      /// \brief The target of an edge.
  102.24        ///
  102.25 -      /// Returns node iterator pointing to the head node of the
  102.26 +      /// Returns node iterator pointing to the target node of the
  102.27        /// given edge iterator.
  102.28 -      NodeIt head(const EdgeIt& e) const {}
  102.29 +      NodeIt target(const EdgeIt& e) const {}
  102.30  
  102.31 -      /// \brief The tail of an edge.
  102.32 +      /// \brief The source of an edge.
  102.33        ///
  102.34 -      /// Returns node iterator pointing to the tail node of the
  102.35 +      /// Returns node iterator pointing to the source node of the
  102.36        /// given edge iterator.
  102.37 -      NodeIt tail(const EdgeIt& e) const {}
  102.38 +      NodeIt source(const EdgeIt& e) const {}
  102.39  
  102.40  
  102.41        /* Iterator classes */
   103.1 --- a/src/work/peter/path/path_test.cc	Sat Nov 13 12:24:01 2004 +0000
   103.2 +++ b/src/work/peter/path/path_test.cc	Sat Nov 13 12:53:28 2004 +0000
   103.3 @@ -66,10 +66,10 @@
   103.4        check(P.length() == 0);
   103.5  
   103.6  #ifdef SKELETON
   103.7 -      cout << "P.tail() valid? " << (P.tail()!=INVALID) << endl;
   103.8 -      check(! (P.tail()!=INVALID));
   103.9 +      cout << "P.source() valid? " << (P.source()!=INVALID) << endl;
  103.10 +      check(! (P.source()!=INVALID));
  103.11  #else
  103.12 -      cout << "P.tail() valid? " << (P.from()!=INVALID) << endl;
  103.13 +      cout << "P.source() valid? " << (P.from()!=INVALID) << endl;
  103.14        check(! (P.to()!=INVALID));
  103.15  #endif
  103.16        {
  103.17 @@ -89,14 +89,14 @@
  103.18  	check(P.length() == 2);
  103.19  
  103.20  #ifdef SKELETON
  103.21 -	cout << "P.tail() valid? " << (P.tail()!=INVALID) << endl;
  103.22 -	check(P.tail()!=INVALID);
  103.23 -	cout << "P.tail()==v1 ? " << (P.tail()==v1) << endl;
  103.24 -	check(P.tail() == v1);
  103.25 +	cout << "P.source() valid? " << (P.source()!=INVALID) << endl;
  103.26 +	check(P.source()!=INVALID);
  103.27 +	cout << "P.source()==v1 ? " << (P.source()==v1) << endl;
  103.28 +	check(P.source() == v1);
  103.29  #else
  103.30 -	cout << "P.tail() valid? " << (P.from()!=INVALID) << endl;
  103.31 +	cout << "P.source() valid? " << (P.from()!=INVALID) << endl;
  103.32  	check(P.from()!=INVALID);
  103.33 -	cout << "P.tail()==v1 ? " << (P.from()==v1) << endl;
  103.34 +	cout << "P.source()==v1 ? " << (P.from()==v1) << endl;
  103.35  	check(P.from() == v1);
  103.36  #endif
  103.37  
  103.38 @@ -128,10 +128,10 @@
  103.39        check(P.length() == 4);
  103.40  
  103.41  #ifdef SKELETON
  103.42 -      cout << "P.head()==v3 ? " << (P.head()==v3) << endl;
  103.43 -      check(P.head() == v3);
  103.44 +      cout << "P.target()==v3 ? " << (P.target()==v3) << endl;
  103.45 +      check(P.target() == v3);
  103.46  #else
  103.47 -      cout << "P.head()==v3 ? " << (P.to()==v3) << endl;
  103.48 +      cout << "P.target()==v3 ? " << (P.to()==v3) << endl;
  103.49        check(P.to() == v3);
  103.50  #endif
  103.51  
   104.1 --- a/src/work/sage_graph.h	Sat Nov 13 12:24:01 2004 +0000
   104.2 +++ b/src/work/sage_graph.h	Sat Nov 13 12:53:28 2004 +0000
   104.3 @@ -96,8 +96,8 @@
   104.4  
   104.5      struct edge_item {
   104.6        int id;
   104.7 -      node_item* _tail;
   104.8 -      node_item* _head;
   104.9 +      node_item* _source;
  104.10 +      node_item* _target;
  104.11        edge_item* _next_out;
  104.12        edge_item* _prev_out;
  104.13        edge_item* _next_in;
  104.14 @@ -121,22 +121,22 @@
  104.15        return p;
  104.16      }
  104.17  
  104.18 -    edge_item* _add_edge(node_item* _tail, node_item* _head) {
  104.19 +    edge_item* _add_edge(node_item* _source, node_item* _target) {
  104.20        edge_item* e=new edge_item;
  104.21        e->id=edge_id++;
  104.22 -      e->_tail=_tail;
  104.23 -      e->_head=_head;
  104.24 +      e->_source=_source;
  104.25 +      e->_target=_target;
  104.26        
  104.27 -      e->_prev_out=_tail->_last_out_edge;
  104.28 -      if (_tail->_last_out_edge) (_tail->_last_out_edge)->_next_out=e;
  104.29 -      _tail->_last_out_edge=e;
  104.30 -      if (!_tail->_first_out_edge) _tail->_first_out_edge=e; 
  104.31 +      e->_prev_out=_source->_last_out_edge;
  104.32 +      if (_source->_last_out_edge) (_source->_last_out_edge)->_next_out=e;
  104.33 +      _source->_last_out_edge=e;
  104.34 +      if (!_source->_first_out_edge) _source->_first_out_edge=e; 
  104.35        e->_next_out=0;
  104.36   
  104.37 -      e->_prev_in=_head->_last_in_edge;
  104.38 -      if (_head->_last_in_edge) (_head->_last_in_edge)->_next_in=e;
  104.39 -      _head->_last_in_edge=e;
  104.40 -      if (!_head->_first_in_edge) { _head->_first_in_edge=e; } 
  104.41 +      e->_prev_in=_target->_last_in_edge;
  104.42 +      if (_target->_last_in_edge) (_target->_last_in_edge)->_next_in=e;
  104.43 +      _target->_last_in_edge=e;
  104.44 +      if (!_target->_first_in_edge) { _target->_first_in_edge=e; } 
  104.45        e->_next_in=0;
  104.46  
  104.47        ++_edge_num;
  104.48 @@ -156,45 +156,45 @@
  104.49  
  104.50      void _delete_edge(edge_item* e) {
  104.51        if (e->_next_out) (e->_next_out)->_prev_out=e->_prev_out; else 
  104.52 -	(e->_tail)->_last_out_edge=e->_prev_out;
  104.53 +	(e->_source)->_last_out_edge=e->_prev_out;
  104.54        if (e->_prev_out) (e->_prev_out)->_next_out=e->_next_out; else 
  104.55 -	(e->_tail)->_first_out_edge=e->_next_out;
  104.56 +	(e->_source)->_first_out_edge=e->_next_out;
  104.57        if (e->_next_in) (e->_next_in)->_prev_in=e->_prev_in; else 
  104.58 -	(e->_head)->_last_in_edge=e->_prev_in;
  104.59 +	(e->_target)->_last_in_edge=e->_prev_in;
  104.60        if (e->_prev_in) (e->_prev_in)->_next_in=e->_next_in; else 
  104.61 -	(e->_head)->_first_in_edge=e->_next_in;
  104.62 +	(e->_target)->_first_in_edge=e->_next_in;
  104.63  
  104.64        delete e;
  104.65        --_edge_num;
  104.66      }
  104.67  
  104.68 -    void _set_tail(edge_item* e, node_item* _tail) {
  104.69 +    void _set_source(edge_item* e, node_item* _source) {
  104.70        if (e->_next_out) (e->_next_out)->_prev_out=e->_prev_out; else 
  104.71 -	(e->_tail)->_last_out_edge=e->_prev_out;
  104.72 +	(e->_source)->_last_out_edge=e->_prev_out;
  104.73        if (e->_prev_out) (e->_prev_out)->_next_out=e->_next_out; else 
  104.74 -	(e->_tail)->_first_out_edge=e->_next_out;
  104.75 +	(e->_source)->_first_out_edge=e->_next_out;
  104.76        
  104.77 -      e->_tail=_tail;
  104.78 +      e->_source=_source;
  104.79        
  104.80 -      e->_prev_out=_tail->_last_out_edge;
  104.81 -      if (_tail->_last_out_edge) (_tail->_last_out_edge)->_next_out=e;
  104.82 -      _tail->_last_out_edge=e;
  104.83 -      if (!_tail->_first_out_edge) _tail->_first_out_edge=e; 
  104.84 +      e->_prev_out=_source->_last_out_edge;
  104.85 +      if (_source->_last_out_edge) (_source->_last_out_edge)->_next_out=e;
  104.86 +      _source->_last_out_edge=e;
  104.87 +      if (!_source->_first_out_edge) _source->_first_out_edge=e; 
  104.88        e->_next_out=0;
  104.89      }
  104.90  
  104.91 -    void _set_head(edge_item* e, node_item* _head) {
  104.92 +    void _set_target(edge_item* e, node_item* _target) {
  104.93        if (e->_next_in) (e->_next_in)->_prev_in=e->_prev_in; else 
  104.94 -	(e->_head)->_last_in_edge=e->_prev_in;
  104.95 +	(e->_target)->_last_in_edge=e->_prev_in;
  104.96        if (e->_prev_in) (e->_prev_in)->_next_in=e->_next_in; else 
  104.97 -	(e->_head)->_first_in_edge=e->_next_in;
  104.98 +	(e->_target)->_first_in_edge=e->_next_in;
  104.99        
 104.100 -      e->_head=_head;
 104.101 +      e->_target=_target;
 104.102        
 104.103 -      e->_prev_in=_head->_last_in_edge;
 104.104 -      if (_head->_last_in_edge) (_head->_last_in_edge)->_next_in=e;
 104.105 -      _head->_last_in_edge=e;
 104.106 -      if (!_head->_first_in_edge) { _head->_first_in_edge=e; } 
 104.107 +      e->_prev_in=_target->_last_in_edge;
 104.108 +      if (_target->_last_in_edge) (_target->_last_in_edge)->_next_in=e;
 104.109 +      _target->_last_in_edge=e;
 104.110 +      if (!_target->_first_in_edge) { _target->_first_in_edge=e; } 
 104.111        e->_next_in=0;
 104.112      }
 104.113  
 104.114 @@ -221,8 +221,8 @@
 104.115      //OutEdgeIt firstOutEdge(const Node v) const { return OutEdgeIt(v); }
 104.116      //InEdgeIt firstInEdge(const Node v) const { return InEdgeIt(v); }
 104.117      //SymEdgeIt firstSymEdge(const Node v) const { return SymEdgeIt(v); }
 104.118 -    Node tail(Edge e) const { return e.tailNode(); }
 104.119 -    Node head(Edge e) const { return e.headNode(); }
 104.120 +    Node source(Edge e) const { return e.sourceNode(); }
 104.121 +    Node target(Edge e) const { return e.targetNode(); }
 104.122  
 104.123      Node aNode(const OutEdgeIt& e) const { return e.aNode(); }
 104.124      Node aNode(const InEdgeIt& e) const { return e.aNode(); }
 104.125 @@ -251,8 +251,8 @@
 104.126        e=InEdgeIt(*this, v); return e; }
 104.127      SymEdgeIt& first(SymEdgeIt& e, Node v) const { 
 104.128        e=SymEdgeIt(*this, v); return e; }
 104.129 -    //void getTail(Node& n, const Edge& e) const { n=tail(e); }
 104.130 -    //void getHead(Node& n, const Edge& e) const { n=head(e); }
 104.131 +    //void getSource(Node& n, const Edge& e) const { n=source(e); }
 104.132 +    //void getTarget(Node& n, const Edge& e) const { n=target(e); }
 104.133  
 104.134      //void getANode(Node& n, const OutEdgeIt& e) const { n=e.aNode(); }
 104.135      //void getANode(Node& n, const InEdgeIt& e) const { n=e.aNode(); }
 104.136 @@ -329,12 +329,12 @@
 104.137        //while (first<NodeIt>().valid()) erase(first<NodeIt>());
 104.138      }
 104.139  
 104.140 -    void setTail(Edge e, Node tail) {
 104.141 -      _set_tail(e.edge, tail.node); 
 104.142 +    void setSource(Edge e, Node source) {
 104.143 +      _set_source(e.edge, source.node); 
 104.144      }
 104.145  
 104.146 -    void setHead(Edge e, Node head) {
 104.147 -      _set_head(e.edge, head.node); 
 104.148 +    void setTarget(Edge e, Node target) {
 104.149 +      _set_target(e.edge, target.node); 
 104.150      }
 104.151  
 104.152      /* stream operations, for testing purpose */
 104.153 @@ -348,7 +348,7 @@
 104.154  //     }
 104.155  //     friend std::ostream& operator<<(std::ostream& os, const Edge& i) { 
 104.156  //       if (i.valid()) 
 104.157 -// 	os << "(" << i.edge->_tail->id << "--" << i.edge->id << "->" << i.edge->_head->id << ")"; 
 104.158 +// 	os << "(" << i.edge->_source->id << "--" << i.edge->id << "->" << i.edge->_target->id << ")"; 
 104.159  //       else 
 104.160  // 	os << "invalid";
 104.161  //       return os; 
 104.162 @@ -419,8 +419,8 @@
 104.163        friend bool operator==(Edge u, Edge v) { return v.edge==u.edge; } 
 104.164        friend bool operator!=(Edge u, Edge v) { return v.edge!=u.edge; } 
 104.165      protected:
 104.166 -      Node tailNode() const { return Node(edge->_tail); }
 104.167 -      Node headNode() const { return Node(edge->_head); }
 104.168 +      Node sourceNode() const { return Node(edge->_source); }
 104.169 +      Node targetNode() const { return Node(edge->_target); }
 104.170      public:
 104.171        friend std::ostream& operator<<(std::ostream& os, const Edge& i);
 104.172      };
 104.173 @@ -440,7 +440,7 @@
 104.174  //       EdgeIt(edge_item* _e) : Edge(_e) { }
 104.175      public:
 104.176        EdgeIt& operator++() { 
 104.177 -	node_item* v=edge->_tail;
 104.178 +	node_item* v=edge->_source;
 104.179  	edge=edge->_next_out; 
 104.180  	while (v && !edge) { v=v->_next_node; if (v) edge=v->_first_out_edge; }
 104.181  	return *this;
 104.182 @@ -456,8 +456,8 @@
 104.183        OutEdgeIt(const SageGraph&, const Edge& e) : Edge(e) { }
 104.184        OutEdgeIt& operator++() { edge=edge->_next_out; return *this; }
 104.185      protected:
 104.186 -      Node aNode() const { return Node(edge->_tail); }
 104.187 -      Node bNode() const { return Node(edge->_head); }
 104.188 +      Node aNode() const { return Node(edge->_source); }
 104.189 +      Node bNode() const { return Node(edge->_target); }
 104.190      };
 104.191      
 104.192      class InEdgeIt : public Edge {
 104.193 @@ -469,8 +469,8 @@
 104.194        InEdgeIt(const SageGraph&, const Edge& e) : Edge(e) { }
 104.195        InEdgeIt& operator++() { edge=edge->_next_in; return *this; }
 104.196      protected:
 104.197 -      Node aNode() const { return Node(edge->_head); }
 104.198 -      Node bNode() const { return Node(edge->_tail); }
 104.199 +      Node aNode() const { return Node(edge->_target); }
 104.200 +      Node bNode() const { return Node(edge->_source); }
 104.201      };
 104.202  
 104.203      class SymEdgeIt : public Edge {
 104.204 @@ -495,7 +495,7 @@
 104.205      protected:
 104.206        SymEdgeIt& operator++() { 
 104.207  	if (out_or_in) { 
 104.208 -	  node_item* v=edge->_tail;
 104.209 +	  node_item* v=edge->_source;
 104.210  	  edge=edge->_next_out; 
 104.211  	  if (!edge) { out_or_in=0; edge=v->_first_in_edge; }
 104.212  	} else {
 104.213 @@ -505,9 +505,9 @@
 104.214        }
 104.215      protected:
 104.216        Node aNode() const { 
 104.217 -	return (out_or_in) ? Node(edge->_tail) : Node(edge->_head); }
 104.218 +	return (out_or_in) ? Node(edge->_source) : Node(edge->_target); }
 104.219        Node bNode() const { 
 104.220 -	return (out_or_in) ? Node(edge->_head) : Node(edge->_tail); }
 104.221 +	return (out_or_in) ? Node(edge->_target) : Node(edge->_source); }
 104.222      };
 104.223    };
 104.224  
 104.225 @@ -523,8 +523,8 @@
 104.226    inline
 104.227    std::ostream& operator<<(std::ostream& os, const SageGraph::Edge& i) { 
 104.228      if (i.valid()) 
 104.229 -      os << "(" << i.tailNode() << "--" << i.edge->id << "->" 
 104.230 -	 << i.headNode() << ")"; 
 104.231 +      os << "(" << i.sourceNode() << "--" << i.edge->id << "->" 
 104.232 +	 << i.targetNode() << ")"; 
 104.233      else 
 104.234        os << "invalid";
 104.235      return os;