daggy
daggy copied to clipboard
Transactional adds/removes
As a compromise between the status quo and https://github.com/mitchmindtree/daggy/issues/12, what about adding a transactional add/remove of nodes and edges?
For example, some code like this:
for node_ind in nodes_to_remove.iter() {
tree.remove_node(*node_ind);
}
for edge_ind in edges_to_remove.iter() {
tree.remove_edge(*edge_ind);
}
As I understand it, this code has somewhat random behavior since each run through the loop will cause the tree to change. However, if I could specify something like tree.transact(&nodes_to_remove, tree.remove_node)
, that would solve my own stability needs without needing the whole graph to be redone.
On the other hand, it's a very database thing to do.