igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] error finding shortest paths


From: Gábor Csárdi
Subject: Re: [igraph] error finding shortest paths
Date: Thu, 13 Feb 2014 20:45:10 -0500

This is not an error, it is a warning. You get it because some vertices are not reachable from the vertex you run the shortest path algorithm from. I.e. your graph is not connected, or strongly connected if you have directed graphs and consider edge directions.

Gabor


On Thu, Feb 13, 2014 at 8:24 PM, Ahmed Abdeen Hamed <address@hidden> wrote:
Hello,

I am getting this error when I am looking up some nodes from two "almost identical graphs". 

toy-network-mining.py:80: RuntimeWarning: Couldn't reach some vertices at ../../../src/structural_properties.c:706
  u = v1.get_shortest_paths(v2)

Here is my code:

for v1 in g_kk.vs:
for v2 in g_kk.vs:
if not v1["name"] == v2["name"]:
u = v1.get_shortest_paths(v2)
#if len(u[0]) > 2:
if not g_kk.are_connected(v1, v2):
#print v1["name"] + "," + v2["name"]
#g_kk.add_edge(v1,v2)
v1_kh = g_kh.vs.find(name=v1["name"])
v2_kh = g_kh.vs.find(name=v2["name"])
#print v1_kh["name"] + "," + v2_kh["name"]
if g_kh.are_connected(v1_kh, v2_kh):
print v1_kh["name"] + "," + v2_kh["name"]
kh_paths = g_kh.get_all_shortest_paths(v1_kh, v2_kh)
for path in kh_path:
print path

I am thinking this might be due the intensive computation but I might be wrong. I would appreciate some help, like I didn't get enough help from all of you :-)

-Ahmed



_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help



reply via email to

[Prev in Thread] Current Thread [Next in Thread]