igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Getting Shortest Paths with and without Edge Weights


From: serafim loukas
Subject: Re: [igraph] Getting Shortest Paths with and without Edge Weights
Date: Wed, 20 Mar 2019 22:52:12 +0000

Could you also add the actual graph weights and the full code so that we can reproduce this?

On 20 Mar 2019, at 23:42, Gokce Dilek <address@hidden> wrote:

Hello,

I would like to ask a question about the "get_shortest_paths" function in python-igraph. Could you explain what is the impact of adding edge weights when calculating path lengths? I had a very interesting occurrence that I couldn't explain why:
Case 1: edge weights are nonzero (an attribute of edges)
Result: [[], [0, 1], [0, 2], [0, 1, 3]]
Case 2: edge weights are None
Result: [[0], [0, 1], [0, 2], [0, 1, 3]]
why does the first entry change like this?=O
My code is here:
clust = g1.clusters()
for c in clust:
   print("subgraph:")
   gcomponent=g1.subgraph(c)
   u=next(iter(gcomponent.vs))
paths=gcomponent.get_shortest_paths(u,to=None,weights=None,mode=ig.ALL,output="vpath")
   print(paths)
in which only the weights=None part is changed between the cases.
I would appreciate if you could provide meaning to this!

Thank you very much!

_______________________________________________
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]