g=Graph()
g = Graph({1:{2:'2',3:'8',4:'5'}, 2:{1:'2',3:'3',4:'4'},3:{1:'8',2:'3',4:'6'},4:{1:'5',2:'4',3:'6'}});// graph with weighted edges
g.plot(edge_label=True)
g.min_spanning_tree()
[(1, 2, '2'), (1, 3, '8'), (1, 4, '5')] //output

s=Graph()
s = Graph({1:{2:'2',3:'8',4:'5'}, 2:{1:'2'},3:{1:'8'},4:{1:'5'}});
s.plot(edge_label=True) //output

Kreyszig-21.8-24-U (last edited 2010-12-18 10:52:28 by koumudi)