Skip to content

Kuhner-Felsenstein distance metric #3

@pierrebarbera

Description

@pierrebarbera
Collaborator

Related to #1, there could be a function for calculating the Kuhner-Felsenstein distance between two trees, as described in Kuhner and Felsenstein, 94, Equation (1).

auto distance = 0.0;
for(auto bipartition : bipartition_map_a) {
  auto other = find(bipartition_map_b, bipartition);
  auto other_length = other ? other.edge_length : 0.0;
  distance += pow(bipartition.edge_length - other_length, 2);
}

Maybe this could be written in such a way that the actual distance can be easily exchanged? As in, the body of the for sans the find could be passed as a functional.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @lczech@pierrebarbera

        Issue actions

          Kuhner-Felsenstein distance metric · Issue #3 · lczech/genesis