[Phylobase-devl] path between two tips

Hilmar Lapp hlapp at duke.edu
Thu Nov 20 19:54:33 CET 2008

Yep pretty much what I would have said. If there isn't already, why  
not just have a shortestPath method that takes any two nodes?

BTW another thought, as trees are graphs, it's also a possibility to  
have an easy conversion to a graph data structure and then have all  
the methods at hand supported on that data structure. For example,  
there is the graph package on CRAN:


and a whole variety of algorithms on that data structure in the RBGL  


including several for shortest path.


On Nov 20, 2008, at 1:34 PM, Brian O'Meara wrote:

> Two thoughts:
> Why not make it a little more general and return the nodes on the
> shortest path between any two nodes? ("nodes" in the general tree
> sense of nodes, both internal nodes and tips, not as a synonym for
> internal nodes). I would guess that this wouldn't add much complexity
> if you're doing something like finding the MRCA for two nodes and
> recording the nodes between the MRCA and each of the chosen
> descendants (reversing the order of the nodes returned for one
> descendant, and including the MRCA).
> I'd avoid the path2tips name as there are a lot of functions (in
> other packages) that use a2b to refer to converting an object of type
> "a" to an object of type "b".
> I don't know for certain that such a function isn't in phylobase
> already, btw.
> Best,
> Brian
> On Nov 20, 2008, at 1:21 PM, Thibaut Jombart wrote:
>> Hi again,
>> here is another proposition of function. In fact, I would just make
>> sure
>> that it does not already exist somewhere before commiting. I wrote a
>> function finding all the nodes on the shortest path from one tip to
>> another. It could be part of the treewalk stuff.
>> My deepest problem now is with the function's name (advice welcome):
>> - path2tips
>> - tipsPath
>> - pathTips
>> - shortestPathBetweenTwoTips
>> - ...
>> Cheers,
>> Thibaut.
>> _______________________________________________
>> Phylobase-devl mailing list
>> Phylobase-devl at lists.r-forge.r-project.org
>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/
>> phylobase-devl
> ________________________________
> Brian O'Meara
> NESCent
> Durham, NC
> http://www.brianomeara.info
> ________________________________
> _______________________________________________
> Phylobase-devl mailing list
> Phylobase-devl at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/phylobase-devl

: Hilmar Lapp  -:-  Durham, NC  -:- hlapp at duke dot edu :

More information about the Phylobase-devl mailing list