[Top][All Lists]

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

Re: [igraph] arpack implementation in igraph is slow?

From: Tamás Nepusz
Subject: Re: [igraph] arpack implementation in igraph is slow?
Date: Thu, 23 Feb 2012 23:48:22 +0100

there are two reasons for this being slow. One is that ARPACK needs a
lot of iterations to converge, around a thousand. The other is that
your callback function itself takes a long time to compute. I measured
and more than 50% of the computation is spent in the callback.
How about replacing the callback with sparse matrix multiplications from a sparse matrix package (I don't know how it is called in R)? Basically, you could construct the Laplacian manually from the adjacency matrix (which igraph can return in sparse matrix format), and then just use sparse matrix multiplications within the callback. Presumably a decent sparse matrix package should implement these in C, so it is likely to be faster than a for loop.


reply via email to

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