Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Distance Wagner method #163

Open
Boarders opened this issue Feb 27, 2020 · 5 comments
Open

Add Distance Wagner method #163

Boarders opened this issue Feb 27, 2020 · 5 comments

Comments

@Boarders
Copy link
Collaborator

Ward mentioned that we should add a new build method which uses the distance Wagner. This is described in detail on p. 165 of the Systematics text book. Roughly it works as follows: given an already constructed tree:

               [...]            [...]      
                 │      e_ij      │ 
                 v_i  ────────── v_j
                 │                │
               [...]            [...] 

If we wish to add vertex v_k to this tree then we compute the distance:

d(v_k, e_ij) = 1/2 (d(v_k, v_i) + d(v_k,v_j) - d(v_i,v_j)

If v_i and v_j are already internal nodes in the tree then these distances are computed in terms of computations involving only the distances between the leaves in the subtrees to which they are attached. One then adds a new internal vertex and attaches v_k to the edge with the minimal distance. One nice thing about this method is that we do not need to compute any medians or perform any traversals as it is based entirely on the distance matrix between the leaves. This means we do not need to construct intermediate trees but instead can use a smaller data structure for tracking the distance information.

Note: I think it is the case that if the metric is an ultrametric then this is exactly the distance but otherwise is an overestimate because of the triangle inequality. The textbook indicates that this method might cause problems for non-metric distances.

Ward noted that having this kind of distance information might also be useful when performing refinements as this can provide candidate edges along which to perform SPR-type moves.

@recursion-ninja
Copy link
Collaborator

I think that we might be doing this already with the old graph representation during the Wagner build command to speed up the process of selecting the minimal edge on which to add the next leaf.

If so, we can look at the old code as a potential starting point.

@wardwheeler
Copy link
Collaborator

wardwheeler commented Feb 27, 2020 via email

@Boarders
Copy link
Collaborator Author

I think currently it does look like we do at least do a decoration of of each intermediate tree in order to get the edgeSequence (this is looking at iterativeBuild in PCG.Command.Build.Evaluate). Both methods still use a fixed node order to save figuring out the next best node to add. But maybe you had something different in mind here?

This method wouldn't build any intermediate decorated tree, only keep track of various edge distances which are computed in terms of the distances between leaf nodes.

@wardwheeler
Copy link
Collaborator

wardwheeler commented Feb 27, 2020 via email

@recursion-ninja
Copy link
Collaborator

This is probably a good time to review our BUILD command and refine the types, options, and functionality associated with each.

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

No branches or pull requests

3 participants