stocnet / manynet

Many Ways to Make, Manipulate, and Map Myriad Networks
https://stocnet.github.io/manynet/
Other
12 stars 0 forks source link

The `scale` parameter of `igraph::eigen_centrality` is going away #98

Closed szhorvat closed 1 month ago

szhorvat commented 1 month ago

The scale parameter of igraph::eigen_centrality is going away, causing test failures with manynet:

https://github.com/igraph/rigraph/blob/86a713579fd338245978107a6e4844c8f3319488/revdep/problems.md#manynet

I am looking at the node_eigenvector() sources: https://github.com/stocnet/manynet/blob/be7c2bff089571fdd04ee9b92bbcf1ca616c8b3b/R/measure_centrality.R#L908C37-L908C47

They include if (normalized) out <- out / sqrt(1/2). I'm not quite sure what this is intended to do, but perhaps you are assuming that when using igraph::eigen_centrality(..., scale=FALSE), the result is normalized with the Euclidean norm. This was in fact never guaranteed. When it did happen, it was a consequence of ARPACK returning normalized results as a side effects of how it works (but ARPACK doesn't guarantee this either). In some edge cases, it did not happen at all.

The approach we are going forward with is to always behave as with scale=TRUE in the past, and leave it to the user to choose what kind of normalization they prefer to do, if they care about normalization.

Note that eigenvector centrality scores don't have a natural scale: the leading eigenvector is unique only up to multiplication by a constant factor.

krlmlr commented 1 month ago

Sorry about the short notice, James, and thanks for the quick fix! The igraph 2.1.1 package is about to be released. Are you ready to submit an update to CRAN within the next four weeks?

jhollway commented 1 month ago

Yes, probably early next week. Thanks Kirill.