-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to specify root for do-dfs traversal? #24
Comments
Thanks for the report. I'm wondering if That being said, it still might be a good idea to add another argument for specifying a starting |
Yeah, I have a DAG representing a partial ordering, and need to be able to flatten it into a list consistent with that partial ordering, but only from the subgraph rooted at a particular node. Obviously one solution would just be to do a full |
As a concrete example, let's say I have the following relationships.
If I want to list the nodes in subgraph rooted at |
I'd like to implement a modified topological sort that only builds up the result list from a specified root element. Given that the existing
tsort
is based ondo-dfs
, that seems like the obvious route to go, but the documentation is pretty unclear as to how I could specify the starting point for a traversal, so as to exclude vertices which aren't descended from a particular node.The text was updated successfully, but these errors were encountered: