27 Aug
2014
27 Aug
'14
6:49 a.m.
As your traversal events are easily simulated by that and IMO do not possess a canonical semantics for undirected or non-tree graphs, I don't think it wise to load the interface with them.
So does what you're suggesting generalize to non-tree graphs? I believe it does. If so, it sounds good.
I think it does in some sense: the spanning tree (or rather forest) induced by the DFS is 'traversed'. I think that's one canonical way to define a tree-traversal of an arbitrary graph. Some technical issues might arise, e.g., for directed trees you might be obliged to provide the root as a start vertex of the DFS. Alex