G=Graph({1:{2:2,3:6,4:8},2:{3:3,4:7},3:{4:5},4:{5:20}}, sparse=True)
G.plot(edge_labels=True)
G.shortest_paths(1, by_weight=True)

Kreyszig-21.3-4-U (last edited 2010-12-18 11:47:46 by K.Swetha)