OldGraphs.jl icon indicating copy to clipboard operation
OldGraphs.jl copied to clipboard

Correct way to extract a component identified by traverse_graph?

Open IainNZ opened this issue 10 years ago • 1 comments

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"

IainNZ avatar Aug 29 '14 04:08 IainNZ

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.

lindahua avatar Oct 28 '14 10:10 lindahua