Representing a Tree in Python

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Wed May 13 08:19:58 EDT 2009


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



More information about the Python-list mailing list