Skip to content

Conversation

@mmolari
Copy link

@mmolari mmolari commented Nov 10, 2025

Re-rooting can sometimes introduce trivial nodes, i.e. nodes with exactly one child and one parent, corresponding to the old root of the tree.
I added a function to remove such nodes. It should

  • check whether the old root is now a trivial node
  • if so, delete it and connect the parent-child nodes with a new edge, whose length is the sum of the two edges.

@ivan-aksamentov ivan-aksamentov force-pushed the feat/reroot-trivial-node-removal branch from f2b3814 to 1586d4d Compare November 13, 2025 15:31
@ivan-aksamentov ivan-aksamentov merged commit 1586d4d into rust Nov 13, 2025
@ivan-aksamentov ivan-aksamentov deleted the feat/reroot-trivial-node-removal branch November 13, 2025 15:31
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

Successfully merging this pull request may close these issues.

2 participants