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

Alternative representations for Hierarchy #22

Open
aborgna-q opened this issue Mar 27, 2023 · 0 comments
Open

Alternative representations for Hierarchy #22

aborgna-q opened this issue Mar 27, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@aborgna-q
Copy link
Collaborator

This is a tracking issue for alternative Hierarchy representations


The current Hierarchy component implementation contains a parent pointer on each hierarchy::NodeData. This provides O(1) access to a node's parent, but requires accessing every children during a transplantation operation where we swap a parent for another node.

  • An alternative representation may only include the parent pointer on the first/last sibling, to invert the mentioned constant and linear costs.
  • A middle ground compromise could use a skip list, where most operations cost O(log n).
  • We could also explore replacing the intrusive linked lists by children node blocks on the parent. This would consume more memory but may end up being more efficient.
@aborgna-q aborgna-q added the enhancement New feature or request label Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant