Hi,

evcent is not very good with unconnected graphs, it is better to decompose
your graph into connected components.

Probably there should be a warning for this.

Gabor


On Thu, May 23, 2013 at 1:58 PM, Florian Umlauf <[email protected]>wrote:

>  Hi,
>
> I was wondering how the following result could happen. I am using
> igraph::evcent for the calculation for my own model statistics. So I make
> some experiments and repeat some statistics.
>
> > a <- igraph::graph.ring(10) + igraph::graph.ring(10)
> > igraph::evcent(a,scale=FALSE)$vector
>  [1] 0.2236051 0.2236051 0.2236051 0.2236051 0.2236051 0.2236051 0.2236051
>  [8] 0.2236051 0.2236051 0.2236051 0.2236084 0.2236084 0.2236084 0.2236084
> [15] 0.2236084 0.2236084 0.2236084 0.2236084 0.2236084 0.2236084
>
> > a <- igraph::graph.ring(10) + igraph::graph.ring(10)
> > igraph::evcent(a,scale=FALSE)$vector
>  [1] 0.2236066 0.2236066 0.2236066 0.2236066 0.2236066 0.2236066 0.2236066
>  [8] 0.2236066 0.2236066 0.2236066 0.2236070 0.2236070 0.2236070 0.2236070
> [15] 0.2236070 0.2236070 0.2236070 0.2236070 0.2236070 0.2236070
>
> > a <- igraph::graph.ring(10) + igraph::graph.ring(10)
> > igraph::evcent(a,scale=FALSE)$vector
> * [1] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
> 0.0000000**
> ** [8] 0.0000000 0.0000000 0.0000000* 0.2236073 0.2236073 0.2236073
> 0.2236073
> [15] 0.2236073 0.2236073 0.2236073 0.2236073 0.2236073 0.2236073
>
>
> As you can see I get in return different values (zeros) at the third try.
> There are some zero values How could that happen? It also happens with
> scale=TRUE.
>
> > a <- igraph::graph.ring(10) + igraph::graph.ring(10)
> > igraph::evcent(a)$vector
>  [1] 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1
>
> > a <- igraph::graph.ring(10) + igraph::graph.ring(10)
> > igraph::evcent(a)$vector
>  [1] 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1
>
> > a <- igraph::graph.ring(10) + igraph::graph.ring(10)
> > igraph::evcent(a)$vector
>  [1] 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
>
> > a <- igraph::graph.ring(10) + igraph::graph.ring(10)
> > igraph::evcent(a)$vector
>  [1] 0.9999876 0.9999876 0.9999876 0.9999876 0.9999876 0.9999876 0.9999876
>  [8] 0.9999876 0.9999876 0.9999876 1.0000000 1.0000000 1.0000000 1.0000000
> [15] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
>
> Thank you for answers.
>
> R version 3.0.1 (2013-05-16)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
>
> locale:
> [1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252
> [3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
> [5] LC_TIME=German_Germany.1252
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> loaded via a namespace (and not attached):
> [1] igraph_0.6.5-1
>
>
> _______________________________________________
> igraph-help mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>
>


-- 
Gabor Csardi <[email protected]>     MTA KFKI RMKI
_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to