Representing a Tree in Python

CTO debatem1 at gmail.com
Wed May 13 15:27:53 EDT 2009


On May 13, 8:19 am, bearophileH... at lycos.com wrote:
> godshorse, you may use the "shortestPaths" method of this graph class
> of mine:http://sourceforge.net/projects/pynetwork/
>
> (It uses the same Dijkstra code by Eppstein).
> (Once you have all distances from a node to the other ones, it's not
> too much difficult to find the tree you talk about).
>
> Also see the Minimum spanning tree:http://en.wikipedia.org/wiki/Minimum_spanning_tree
>
> Bye,
> bearophile

Let me add a caution to what bearophile says here- a minimum spanning
tree minimizes
the weight of the *whole tree*, not the individual paths in that tree,
which seems
to be what you're going after. Those can be pretty different things.

Geremy Condra



More information about the Python-list mailing list