-
Notifications
You must be signed in to change notification settings - Fork 5
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
Rename vec-tree to vec-digraph? #1
Comments
There is a cycle because a parent needs a reference to a child and a child a reference to the parent. The index is copy, because we may want to store multiple copies of the index in our usage of this lib. |
@ArnaudValensi Are you sure you need parent pointers? If so, please keep them separate so the main parent -> children tree is easy to verify. Cycle detection is non-trivial and far from a cheap check in the general case. For trees the optimal solution is to use non-copy handles. For a DAG, enforce topological insertion order. |
By definition trees contain zero cycles. The
Index
implementsCopy
, and the documentation mentions "cycles". This crate implements a directed graph.If you'd like to restrict
vec-tree
to trees, make theIndex
non-Copy.The text was updated successfully, but these errors were encountered: