igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] all eigenvector centrality


From: Tamás Nepusz
Subject: Re: [igraph] all eigenvector centrality
Date: Fri, 14 Dec 2012 22:41:52 +0100

> I used eigen() but It  did not work on large networks.  I got memory 
> allocation error.
This is because eigen() would calculate all the eigenvectors -- guess that 
takes a lot of memory ;)

> According to below links, "nev" parameter determines the number of required 
> eigenvectors and "which" parameter determines which nev eigenvectors should 
> be returned.
Well, actually, this only applies to the arpack() function, not to evcent(). 
evcent() uses ARPACK internally, but it explicitly sets "nev" to 1 (even if you 
set it to a different value). So, your only choice here is to use arpack() 
directly.

> I do not know how I should call arapack function to calculate eigenvectors of 
> network adjacency matrix.
arpack() expects a _function_ as its first argument, which takes a vector x and 
should return A*x, where A is the matrix whose eigenvalues and eigenvectors are 
to be calculated. E.g.:

A <- get.adjacency(graph)
f <- function(x, extra=NULL) { A %*% x }
result <- arpack(f, options=list(n=nrow(A), nev=10, ncv=11), sym=T)

result$values and result$vectors then gives you the calculated eigenvalues and 
eigenvectors. ncv should be at least one larger than nev, the desired number of 
eigenvectors. The "sym" argument must be T if the adjacency matrix is symmetric 
and F otherwise.

-- 
T.


reply via email to

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