[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] igraph memory error
From: |
Tamás Nepusz |
Subject: |
Re: [igraph] igraph memory error |
Date: |
Fri, 18 Jan 2013 16:33:31 +0100 |
> I have a graph with 23379 edges and 23295 vertices. It is a simple,
> unconnected graph with 917 distinct clusters and a density of 4.26x10^-5.
> I am able to load the graph without a problem. However, I need to calculate
> shortest paths using R so that I can run a series of simulations and I am
> getting memory errors
The result of the shortest path matrix calculation would be a matrix of 23295 x
23295, and obviously R cannot handle matrices of such a size. However, I
strongly suspect that you won't need the whole matrix at once, in which case
you can simply call shortest.paths(g1, v=1), which will calculate the shortest
path lengths originating from vertex 1 to all the other vertices. You can do it
for multiple vertices at once (just supply a vector for v), the point is that
you shouldn't do it for all the vertices at once. If you need the actual
shortest paths instead of their lengths, use get.shortest.paths in a similar
manner.
--
T.