Quantinuum / Quantinuum/portgraph

Alternative representations for `Hierarchy`

Open
#22 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.