I\'m using igraph
to generate a matrix of shortest path distances between pairs of vertices but I can\'t figure out how to return the vertices. So far I have:>
I do this
from igraph import *
g = Graph([(0,1), (0,2), (2,3), (3,4), (4,2), (2,5), (5,0), (6,3), (5,6)])
g.vs["name"] = ["Alice", "Bob", "Claire", "Dennis", "Esther", "Frank", "George"]
#You could create Vertexes like g.add_vertex(name="Bill")
path=g.get_shortest_paths("Alice",to="Frank",mode=OUT,output='vpath')
for n in path[0]:
print("{}".format(g.vs[n]['name']))
Hope this helps