Index: src/work/peter/path/path.h
===================================================================
--- src/work/peter/path/path.h	(revision 959)
+++ src/work/peter/path/path.h	(revision 986)
@@ -109,5 +109,5 @@
     /// Returns INVALID if the path is empty.
     GraphNode from() const {
-      return empty() ? INVALID : gr->tail(edges[0]);
+      return empty() ? INVALID : gr->source(edges[0]);
     }
     /// \brief End point of the path.
@@ -116,5 +116,5 @@
     /// Returns INVALID if the path is empty.
     GraphNode to() const {
-      return empty() ? INVALID : gr->head(edges[length()-1]);
+      return empty() ? INVALID : gr->target(edges[length()-1]);
     }
 
@@ -154,17 +154,17 @@
     }
 
-    /// \brief Returns node iterator pointing to the head node of the
+    /// \brief Returns node iterator pointing to the target node of the
     /// given edge iterator.
-    NodeIt head(const EdgeIt& e) const {
+    NodeIt target(const EdgeIt& e) const {
       if( DM::range_check && !e.valid() )
-	fault("DirPath::head() on invalid iterator");
+	fault("DirPath::target() on invalid iterator");
       return NodeIt(*this, e.idx+1);
     }
 
-    /// \brief Returns node iterator pointing to the tail node of the
+    /// \brief Returns node iterator pointing to the source node of the
     /// given edge iterator.
-    NodeIt tail(const EdgeIt& e) const {
+    NodeIt source(const EdgeIt& e) const {
       if( DM::range_check && !e.valid() )
-	fault("DirPath::tail() on invalid iterator");
+	fault("DirPath::source() on invalid iterator");
       return NodeIt(*this, e.idx);
     }
@@ -255,5 +255,5 @@
 	  return p->to();
 	else if(idx >= 0)
-	  return p->gr->tail(p->edges[idx]);
+	  return p->gr->source(p->edges[idx]);
 	else
 	  return INVALID;
@@ -313,5 +313,5 @@
       ///\sa setStartNode
       void pushFront(const GraphEdge& e) {
-	if( DM::consistensy_check && !empty() && P.gr->head(e)!=from() ) {
+	if( DM::consistensy_check && !empty() && P.gr->target(e)!=from() ) {
 	  fault("DirPath::Builder::pushFront: nonincident edge");
 	}
@@ -324,5 +324,5 @@
       ///\sa setStartNode
       void pushBack(const GraphEdge& e) {
-	if( DM::consistensy_check && !empty() && P.gr->tail(e)!=to() ) {
+	if( DM::consistensy_check && !empty() && P.gr->source(e)!=to() ) {
 	  fault("DirPath::Builder::pushBack: nonincident edge");
 	}
@@ -363,9 +363,9 @@
       GraphNode from() const {
 	if( ! front.empty() )
-	  return P.gr->tail(front[front.size()-1]);
+	  return P.gr->source(front[front.size()-1]);
 	else if( ! P.empty() )
-	  return P.gr->tail(P.edges[0]);
+	  return P.gr->source(P.edges[0]);
 	else if( ! back.empty() )
-	  return P.gr->tail(back[0]);
+	  return P.gr->source(back[0]);
 	else
 	  return INVALID;
@@ -373,9 +373,9 @@
       GraphNode to() const {
 	if( ! back.empty() )
-	  return P.gr->head(back[back.size()-1]);
+	  return P.gr->target(back[back.size()-1]);
 	else if( ! P.empty() )
-	  return P.gr->head(P.edges[P.length()-1]);
+	  return P.gr->target(P.edges[P.length()-1]);
 	else if( ! front.empty() )
-	  return P.gr->head(front[0]);
+	  return P.gr->target(front[0]);
 	else
 	  return INVALID;
@@ -472,5 +472,5 @@
     /// Returns INVALID if the path is empty.
     GraphNode from() const {
-      return empty() ? INVALID : gr->tail(edges[0]);
+      return empty() ? INVALID : gr->source(edges[0]);
     }
     /// \brief End point of the path.
@@ -479,5 +479,5 @@
     /// Returns INVALID if the path is empty.
     GraphNode to() const {
-      return empty() ? INVALID : gr->head(edges[length()-1]);
+      return empty() ? INVALID : gr->target(edges[length()-1]);
     }
 
@@ -517,17 +517,17 @@
     }
 
-    /// \brief Returns node iterator pointing to the head node of the
+    /// \brief Returns node iterator pointing to the target node of the
     /// given edge iterator.
-    NodeIt head(const EdgeIt& e) const {
+    NodeIt target(const EdgeIt& e) const {
       if( DM::range_check && !e.valid() )
-	fault("UndirPath::head() on invalid iterator");
+	fault("UndirPath::target() on invalid iterator");
       return NodeIt(*this, e.idx+1);
     }
 
-    /// \brief Returns node iterator pointing to the tail node of the
+    /// \brief Returns node iterator pointing to the source node of the
     /// given edge iterator.
-    NodeIt tail(const EdgeIt& e) const {
+    NodeIt source(const EdgeIt& e) const {
       if( DM::range_check && !e.valid() )
-	fault("UndirPath::tail() on invalid iterator");
+	fault("UndirPath::source() on invalid iterator");
       return NodeIt(*this, e.idx);
     }
@@ -616,5 +616,5 @@
 	  return p->to();
 	else if(idx >= 0)
-	  return p->gr->tail(p->edges[idx]);
+	  return p->gr->source(p->edges[idx]);
 	else
 	  return INVALID;
@@ -674,5 +674,5 @@
       ///\sa setStartNode
       void pushFront(const GraphEdge& e) {
-	if( DM::consistensy_check && !empty() && P.gr->head(e)!=from() ) {
+	if( DM::consistensy_check && !empty() && P.gr->target(e)!=from() ) {
 	  fault("UndirPath::Builder::pushFront: nonincident edge");
 	}
@@ -685,5 +685,5 @@
       ///\sa setStartNode
       void pushBack(const GraphEdge& e) {
-	if( DM::consistensy_check && !empty() && P.gr->tail(e)!=to() ) {
+	if( DM::consistensy_check && !empty() && P.gr->source(e)!=to() ) {
 	  fault("UndirPath::Builder::pushBack: nonincident edge");
 	}
@@ -724,9 +724,9 @@
       GraphNode from() const {
 	if( ! front.empty() )
-	  return P.gr->tail(front[front.size()-1]);
+	  return P.gr->source(front[front.size()-1]);
 	else if( ! P.empty() )
-	  return P.gr->tail(P.edges[0]);
+	  return P.gr->source(P.edges[0]);
 	else if( ! back.empty() )
-	  return P.gr->tail(back[0]);
+	  return P.gr->source(back[0]);
 	else
 	  return INVALID;
@@ -734,9 +734,9 @@
       GraphNode to() const {
 	if( ! back.empty() )
-	  return P.gr->head(back[back.size()-1]);
+	  return P.gr->target(back[back.size()-1]);
 	else if( ! P.empty() )
-	  return P.gr->head(P.edges[P.length()-1]);
+	  return P.gr->target(P.edges[P.length()-1]);
 	else if( ! front.empty() )
-	  return P.gr->head(front[0]);
+	  return P.gr->target(front[0]);
 	else
 	  return INVALID;
@@ -841,10 +841,10 @@
     bool setTo(const GraphNode &n);
 
-    // WARNING: these two functions return the head/tail of an edge with
+    // WARNING: these two functions return the target/source of an edge with
     // respect to the direction of the path!
-    // So G.head(P.graphEdge(e)) == P.graphNode(P.head(e)) holds only if 
+    // So G.target(P.graphEdge(e)) == P.graphNode(P.target(e)) holds only if 
     // P.forward(e) is true (or the edge is a loop)!
-    NodeIt head(const EdgeIt& e) const;
-    NodeIt tail(const EdgeIt& e) const;
+    NodeIt target(const EdgeIt& e) const;
+    NodeIt source(const EdgeIt& e) const;
 
     // FIXME: ezeknek valami jobb nev kellene!!!
@@ -874,5 +874,5 @@
 
       size_t idx;
-      bool tail;  // Is this node the tail of the edge with same idx?
+      bool source;  // Is this node the source of the edge with same idx?
 
     public:
@@ -897,5 +897,5 @@
       return e;
 
-    GraphNode common_node = ( e.forw ? G.head(*e.it) : G.tail(*e.it) );
+    GraphNode common_node = ( e.forw ? G.target(*e.it) : G.source(*e.it) );
     ++e.it;
 
@@ -906,5 +906,5 @@
     }
 
-    e.forw = ( G.tail(*e.it) == common_node );
+    e.forw = ( G.source(*e.it) == common_node );
     return e;
   }
@@ -919,12 +919,12 @@
 
     
-    GraphNode next_node = ( n.tail ? G.head(edges[n.idx]) :
-			      G.tail(edges[n.idx]) );
+    GraphNode next_node = ( n.source ? G.target(edges[n.idx]) :
+			      G.source(edges[n.idx]) );
     ++n.idx;
     if( n.idx < length() ) {
-      n.tail = ( next_node == G.tail(edges[n.idx]) );
+      n.source = ( next_node == G.source(edges[n.idx]) );
     }
     else {
-      n.tail = true;
+      n.source = true;
     }
 
@@ -935,10 +935,10 @@
   bool DynamicPath<Gr>::edgeIncident(const GraphEdge &e, const GraphNode &a,
 			  GraphNode &b) {
-    if( G.tail(e) == a ) {
-      b=G.head(e);
+    if( G.source(e) == a ) {
+      b=G.target(e);
       return true;
     }
-    if( G.head(e) == a ) {
-      b=G.tail(e);
+    if( G.target(e) == a ) {
+      b=G.source(e);
       return true;
     }
@@ -949,10 +949,10 @@
   bool DynamicPath<Gr>::connectTwoEdges(const GraphEdge &e,
 			     const GraphEdge &f) {
-    if( edgeIncident(f, G.tail(e), _last) ) {
-      _first = G.head(e);
+    if( edgeIncident(f, G.source(e), _last) ) {
+      _first = G.target(e);
       return true;
     }
-    if( edgeIncident(f, G.head(e), _last) ) {
-      _first = G.tail(e);
+    if( edgeIncident(f, G.target(e), _last) ) {
+      _first = G.source(e);
       return true;
     }
@@ -1040,5 +1040,5 @@
   template<typename Gr>
   typename DynamicPath<Gr>::NodeIt
-  DynamicPath<Gr>::tail(const EdgeIt& e) const {
+  DynamicPath<Gr>::source(const EdgeIt& e) const {
     NodeIt n;
 
@@ -1046,10 +1046,10 @@
       // FIXME: invalid-> invalid
       n.idx = length() + 1;
-      n.tail = true;
+      n.source = true;
       return n;
     }
 
     n.idx = e.it-edges.begin();
-    n.tail = e.forw;
+    n.source = e.forw;
     return n;
   }
@@ -1057,5 +1057,5 @@
   template<typename Gr>
   typename DynamicPath<Gr>::NodeIt
-  DynamicPath<Gr>::head(const EdgeIt& e) const {
+  DynamicPath<Gr>::target(const EdgeIt& e) const {
     if( e.it == edges.end()-1 ) {
       return _last;
@@ -1064,5 +1064,5 @@
     EdgeIt next_edge = e;
     next(next_edge);
-    return tail(next_edge);
+    return source(next_edge);
   }
       
@@ -1082,5 +1082,5 @@
   DynamicPath<Gr>::graphNode(const NodeIt& n) const {
     if( n.idx < length() ) {
-      return n.tail ? G.tail(edges[n.idx]) : G.head(edges[n.idx]);
+      return n.source ? G.source(edges[n.idx]) : G.target(edges[n.idx]);
     }
     else if( n.idx == length() ) {
@@ -1104,9 +1104,9 @@
     e.it = edges.begin()+k;
     if(k==0) {
-      e.forw = ( G.tail(*e.it) == _first );
+      e.forw = ( G.source(*e.it) == _first );
     }
     else {
-      e.forw = ( G.tail(*e.it) == G.tail(edges[k-1]) ||
-		 G.tail(*e.it) == G.head(edges[k-1]) );
+      e.forw = ( G.source(*e.it) == G.source(edges[k-1]) ||
+		 G.source(*e.it) == G.target(edges[k-1]) );
     }
     return e;
@@ -1119,13 +1119,13 @@
       // FIXME: invalid NodeIt
       n.idx = length()+1;
-      n.tail = true;
+      n.source = true;
       return n;
     }
     if( k==length() ) {
       n.idx = length();
-      n.tail = true;
+      n.source = true;
       return n;
     }
-    n = tail(nth<EdgeIt>(k));
+    n = source(nth<EdgeIt>(k));
     return n;
   }
@@ -1140,7 +1140,7 @@
   {
     if( G.valid(P._first) && a.it < P.edges.end() ) {
-      _first = ( a.forw ? G.tail(*a.it) : G.head(*a.it) );
+      _first = ( a.forw ? G.source(*a.it) : G.target(*a.it) );
       if( b.it < P.edges.end() ) {
-	_last = ( b.forw ? G.tail(*b.it) : G.head(*b.it) );
+	_last = ( b.forw ? G.source(*b.it) : G.target(*b.it) );
       }
       else {
