Many Thanks.
but another question is why eigen does eigen return negative velue and  evcent 
positive in some cases?

> sw<-watts.strogatz.game(1,100,4,0.01)
> eigen(get.adjacency(sw))$vector[1:10,1]
 [1] -0.1131806 -0.1142056 -0.1124357 -0.1117224 -0.1096733 -0.1087088 
-0.1075337 -0.1064655 -0.1053954 -0.1044801
> evcent(sw,scale=F)$vector[1:10]
 [1] 0.1131806 0.1142056 0.1124357 0.1117224 0.1096733 0.1087088 0.1075337 
0.1064655 0.1053954 0.1044801





On Friday, November 22, 2013 7:01 PM, Gábor Csárdi <[email protected]> 
wrote:
 
For eigen, the eigenvalues are in the columns of 'vectors', not in the
rows, so you need m$vector[,1].

Gabor


On Fri, Nov 22, 2013 at 9:14 AM, Bita Shams <[email protected]> wrote:
> Hi
> I'm trying to calculate the eigenvector correspondent to largest eigenvalue
> of graph.
> The result obtained by "eigen" and "evcent" function were completely
> different although their eigenvalue  were equal.
> I wanna know how it it is explained and which one is more reliable?
> In the following, you can see  an example
> Best Regards
> B.S
>
>
>  sw<-watts.strogatz.game(1,20,2,0.01)
>  m<-eigen(get.adjacency(sw))
>  e=evcent(sw)
>  m$value[1]
> [1] 4
>  e$value
> [1] 4
>  m$vector[1,]
>  [1] -0.223606798  0.009051041 -0.316098210  0.316015499  0.011584659
> 0.048641352 -0.312464428  0.223606798  0.017765024  0.315728370
> [11]  0.024016675  0.000000000 -0.156667569  0.418184734 -0.211845338
> 0.234779796  0.139724510  0.283684792  0.004032193  0.316202058
>  e$vector
>  [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
>
>
> _______________________________________________
> igraph-help mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/igraph-help

>
_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to