igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] A silly question


From: Ish Rattan
Subject: Re: [igraph] A silly question
Date: Wed, 11 Apr 2012 12:45:38 -0400 (EDT)



On Wed, 11 Apr 2012, Tam??s Nepusz wrote:

Just run shortest.paths as well, this gives you the distance matrix.
If your graph is very large and the distance matrix does not fit into memory, you should iterate over the paths, get the weights of the edges in the path with E(g, path=list.of.vertices)$weight and then sum them up using sum(). E.g.:

 I tried:

 g <- erad.graph("file", format="ncol", directed=TRUE, weight=TRUE)
 l <- get.shortest.paths(g, 0, to=V(g), mode=c("out"))
 E(g, path=l[2])$weight
    (list) object can't be coerced to type 'double'          # the error

-ishwar

reply via email to

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