in reply to Graphs and Shortest Distance Between Nodes
To calculate distances, have a look at all-pairs shortest path algorithms.
-- The hell with paco, vote for Erudil! :wq