igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] find weights along all paths between two vertices


From: Gábor Csárdi
Subject: Re: [igraph] find weights along all paths between two vertices
Date: Sat, 7 Dec 2013 19:47:41 -0500

Hi Sofia,

AFAIK, there is no news about this since your question:
http://lists.gnu.org/archive/html/igraph-help/2011-12/msg00014.html
https://github.com/igraph/igraph/issues/356

Best,
Gabor

On Sun, Dec 1, 2013 at 5:52 PM, Ana Sofia Morais
<address@hidden> wrote:
> 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.
>
>
>
> Example:
>
>
>
> mat=matrix(c(rep(0,6),3,0,2,rep(0,3),4,rep(0,2),2,rep(0,6),rep(1,2),rep(0,2),3,rep(0,9)),byrow=T,ncol=6)
>
> graph = graph.adjacency(mat, mode="directed", weighted=TRUE)#do graph
>
> plot.igraph(graph,edge.label=E(graph)$weight)
>
>
>
> 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,
>
>
>
> Sofia
>
>
>
>
> _______________________________________________
> 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]