# HG changeset patch # User alpar # Date 1132222589 0 # Node ID a6f019fa6e7a8096319eba486a4f3b3a4fe570f2 # Parent 597ce92fae738355348521d8c8c2e54b1948e23b split(Edge) member function added. diff -r 597ce92fae73 -r a6f019fa6e7a lemon/list_graph.h --- a/lemon/list_graph.h Thu Nov 17 10:14:55 2005 +0000 +++ b/lemon/list_graph.h Thu Nov 17 10:16:29 2005 +0000 @@ -430,6 +430,22 @@ return b; } + ///Split an edge. + + ///This function splits an edge. First a new node \c b is added to the graph, + ///then the original edge is re-targetes to \c b. Finally an edge + ///from \c b to the original target is added. + ///\return The newly created node. + ///\warning This functionality cannot be used together with the Snapshot + ///feature. + Node split(Edge e) + { + Node b = addNode(); + addEdge(b,target(e)); + changeTarget(e,b); + return b; + } + ///Class to make a snapshot of the graph and to restrore to it later. ///Class to make a snapshot of the graph and to restrore to it later.