lemon/list_graph.h
changeset 1812 a6f019fa6e7a
parent 1791 62e7d237e1fb
child 1875 98698b69a902
     1.1 --- a/lemon/list_graph.h	Thu Nov 17 10:14:55 2005 +0000
     1.2 +++ b/lemon/list_graph.h	Thu Nov 17 10:16:29 2005 +0000
     1.3 @@ -430,6 +430,22 @@
     1.4        return b;
     1.5      }
     1.6        
     1.7 +    ///Split an edge.
     1.8 +
     1.9 +    ///This function splits an edge. First a new node \c b is added to the graph,
    1.10 +    ///then the original edge is re-targetes to \c b. Finally an edge
    1.11 +    ///from \c b to the original target is added.
    1.12 +    ///\return The newly created node.
    1.13 +    ///\warning This functionality cannot be used together with the Snapshot
    1.14 +    ///feature.
    1.15 +    Node split(Edge e) 
    1.16 +    {
    1.17 +      Node b = addNode();
    1.18 +      addEdge(b,target(e));
    1.19 +      changeTarget(e,b);
    1.20 +      return b;
    1.21 +    }
    1.22 +      
    1.23      ///Class to make a snapshot of the graph and to restrore to it later.
    1.24  
    1.25      ///Class to make a snapshot of the graph and to restrore to it later.