Quantinuum / Quantinuum/portgraph
Alternative representations for `Hierarchy`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 17
- Forks
- 6
- Avg merge
- 19m
- Merged PRs (30d)
- 3
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Hierarchy component and hierarchy::NodeData implementation, then inspect the transplantation operation and its child traversal. Compare the current parent-pointer representation with the proposed sibling-pointer, skip-list, and children-block alternatives. Done means selecting and implementing a representation based on measured operation and memory trade-offs, with corresponding validation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100