Skip to content
This repository has been archived by the owner on Oct 21, 2021. It is now read-only.

Correct way to extract a component identified by traverse_graph? #117

Open
IainNZ opened this issue Aug 29, 2014 · 1 comment
Open

Correct way to extract a component identified by traverse_graph? #117

IainNZ opened this issue Aug 29, 2014 · 1 comment

Comments

@IainNZ
Copy link
Contributor

IainNZ commented Aug 29, 2014

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"

@lindahua
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants