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:>
This is the way to find shortest path for weighted directed graph (DAG). So this what I figured out:
import igraph
from igraph import *
g = Graph(directed=True)
g.add_vertices(3)
g.vs["name"]=["GO:1234567","GO:6789056","GO:5674321"]
g.es["weight"]=1
g['GO:1234567','GO:6789056']=1
g['GO:6789056','GO:5674321']=5
weight=g.es["weight"]
print weight
print g.degree(mode="in")
print g.shortest_paths_dijkstra(source="GO:1234567", target="GO:5674321",
weights=weight, mode=OUT)