igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] alternate diameter paths


From: Alisa Coffin
Subject: Re: [igraph] alternate diameter paths
Date: Thu, 15 May 2008 13:28:55 -0400

Dear Tamas,

Thank you for your suggestion. I tried running the function you suggested, selecting the from node that was given for the diameter and going to all the vertices, then trying to go just from and to the two farthest nodes given in the farthest.nodes function. However, I seem to be running into a memory problem, even when I run the calculation for only the one pair of nodes. Here is the code I use and the error message returned:

> get.all.shortest.paths(g1975, 2028, to = V(g1975), mode = c("all"))
Error in get.all.shortest.paths(g1975, 2028, to = V(g1975), mode = c("all")) :
  At vector_ptr.c:169 : vector ptr reserve failed, Out of memory

> get.all.shortest.paths(g1975, 2028, 4334, mode = c("all"))
Error in get.all.shortest.paths(g1975, 2028, 4334, mode = c("all")) :
  At vector_ptr.c:169 : vector ptr reserve failed, Out of memory

I am running igraph 0.5 using R 2.6.2 on a 32-bit Windows XP SP2 OS, with 1GB system memory.  Am I running into a physical limitations of my machine? or am I making an error in the _expression_? Any help is greatly appreciated!

Thanks, Alisa.

On Thu, May 15, 2008 at 11:14 AM, Tamas Nepusz <address@hidden> wrote:
Dear Alisa,

If you can afford calculating all shortest paths in your network, then try get.all.shortest.paths:

get.all.shortest.paths(graph, from, to = V(graph), mode = c("all", "out", "in"))
For get.all.shortest.paths a list is returned, each list element contains a shortest path from from to a vertex in to. The shortest paths to the same vertex are collected into consecutive elements of the list.
get.all.shortest.paths applies only for a single vertex, but of course you can run it for all vertices in a for loop. Of course you'll have to filter the list returned from get.all.shortest.paths based on their length.

--
Tamas



_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help




--
Alisa Coffin, PhD. Candidate
Department of Geography
University of Florida
Gainesville, FL 32611
reply via email to

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