[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: [igraph] A silly question

**From**: |
Tamás Nepusz |

**Subject**: |
Re: [igraph] A silly question |

**Date**: |
Wed, 11 Apr 2012 10:16:43 +0200 |

>* I get one list of vertices on the path for each target vertex,*
>* is there a way find the cost of path too (sum of the edge weights in*
>* the path)?*
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.:
T.