Skip to content
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

Clarify order of Descendants, Traverse, and ReverseTraverse #55

Closed
clbarnes opened this issue Apr 21, 2020 · 2 comments
Closed

Clarify order of Descendants, Traverse, and ReverseTraverse #55

clbarnes opened this issue Apr 21, 2020 · 2 comments

Comments

@clbarnes
Copy link
Contributor

I've had a look around and it doesn't seem like "tree order" has any meaning when it comes to graph traversal - rather, it relates to the number of children each node can have. The language in common use for tree traversal seems to be "depth first" and "breadth first", in "pre order", "post order", or "level order".

@saschagrunert
Copy link
Owner

Hey, this sounds like a good documentation enhancement to me. Do you mind spinning up a PR to fix it? :)

@clbarnes
Copy link
Contributor Author

Seems like they're all a pre-order depth first search, the only distinction being that descendants yields NodeIds (not &Nodes as the current docs imply); traverse yields NodeEdges containing NodeIds (again, not &Nodes) in depth-first order, addressing the children in insertion order; reverse_traverse addresses children in reverse insertion order. traverse and reverse_traverse visit each node twice (once before its children, once after).

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

No branches or pull requests

2 participants