[Lemon-user] graphCopy() does not overwrite target
Allan Zelener
allanzelener at gmail.com
Mon Jun 21 23:15:33 CEST 2010
Hello,
I've been using graphCopy() to backup and restore a graph's state and
noticed that rather than overwriting the contents of the target graph it
seems to append the source graph's contents to it somehow. This does not
seem to be the intended behavior and is not mentioned in the documentation.
There also does not seem to be a built-in way to clear the contents of a
graph. As a work around I had to use something like the following code
segment:
while(countNodes(graph) != 0) {
ListGraph::NodeIt n(graph);
graph.erase(n);
}
graphCopy(backupGraph, graph).nodemap(backupNodemap, nodemap).run()
I am also aware of the Snapshot class for saving the state of a graph but
because I contract nodes in my graph it would invalidate the snapshot.
Thank you,
Allan Zelener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lemon.cs.elte.hu/pipermail/lemon-user/attachments/20100621/937ba292/attachment.html>
More information about the Lemon-user
mailing list