Calling the centralization() function available in R and C igraph from Python igraph?

I want to use the centralization function from the python igraph and it doesn’t appear to be available.

https://igraph.org/c/doc/igraph-Structural.html#centralization

https://igraph.org/r/doc/centralize.html

Is there a way of calling the C function from within the python API?

Or is there a way I can calculate the centralization myself?

Not at the moment.

The definition, which is included in the R and C docs, is straightforward to implement as a one-liner, assuming you don’t want normalization.

If you do want normalization, look up what the most centralized structure is for different centralities in in the C docs, igraph Reference Manual. Then compute the unnormalized centralization for that structure, and use the result as the normalization factor.

1 Like