OldGraphs.jl
OldGraphs.jl copied to clipboard
Correct way to extract a component identified by traverse_graph?
I have a directed graph that I want to traverse from a given vertex. If I use VertexListVisitor
I can get the list of vertices. What I want is the connected subgraph defined by these vertices (i.e. these vertices and the edges between them).
Is the correct thing to do to have a visitor that builds up this graph as I go? Or is there a more efficient way? Or is there some functionality I'm missing?
Speed of even a naive version isn't a problem for my problem, but I just want to do things "right"
I think using a visitor to build up the components is a natural idea. That's what the connected component algorithm does, which has already been provided in the package for undirected graphs.