Skip to content

fix: PhyloDistance bugs - #83

Open
ahl27 wants to merge 3 commits into
npcooley:develfrom
ahl27:phylodistance-fix
Open

fix: PhyloDistance bugs#83
ahl27 wants to merge 3 commits into
npcooley:develfrom
ahl27:phylodistance-fix

Conversation

@ahl27

@ahl27 ahl27 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor
  • Trees with no labels in common would silently return a result. This now throws a warning.
  • Method="CI" now defaults to using a Hungarian algorithm for partition matching instead of greedy matching. This resolves issues where comparing a tree to itself would return nonzero distance.
  • New Exact argument (default TRUE) to enable the Hungarian algorithm. Setting Exact=FALSE uses the old greedy matching schema for backwards compatibility.
  • Some small math fixes to use existing functions to resolve floating point inaccuracy

This was due to the greedy matching scheme originally implemented, which
can cause suboptimal partitions to be paired and return a nonzero distance.
Instead, we'll just revert to using the original Hungarian algorithm here
for globally optimal pairing (at the expense of computational efficiency).

Also updates some math to correct for floating point precision issues.

Original greedy matching is maintained via new `Exact` argument.
@ahl27 ahl27 changed the title Phylodistance fixes PhyloDistance fixes Sep 1, 2026
@ahl27 ahl27 changed the title PhyloDistance fixes fix: PhyloDistance bugs Sep 1, 2026
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.

1 participant