[Top][All Lists]

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

[igraph] find weights along all paths between two vertices

From: Ana Sofia Morais
Subject: [igraph] find weights along all paths between two vertices
Date: Sun, 1 Dec 2013 23:52:14 +0100

Dear all,


I need to calculate the sum of the weights along all paths from each of n-1vertices to a target vertex in a graph.





graph = graph.adjacency(mat, mode="directed", weighted=TRUE)#do graph



Assuming that vertex 1 is the target, the sum of the weights (sw) along the paths from every other vertex in the graph should be:


swV2 = 3+2+4

swV3 = 4

swV4 = 1+3+4

swV5 = 3+4

swV6 = 0


Note that, in identifying all paths from a vertex to the target, only paths have been considered in which a vertex is traversed only once along the same path. This applies to vertex 5, for instance, where the sum of weights disregards the weights present in the cycle with vertices 3 and 4.


I would appreciate any advice about how this could be achieved. Thanks in advance,




reply via email to

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