Normalization Method

I am interested in understanding the normalization method used in igraph, for degree, closeness, and betweeness. In more depth that what is written in the manual and function…

Thank You

Can you be specific about what is unclear?

Betweenness: Put simply, with normalization, the result is divided by the number of ordered or unordered vertex pairs in directed and undirected graphs, respectively.

Closeness: The result is divided by the number of “other vertices” that a distance is calculated to, i.e. one less than the total number of vertices.

Degree: The result is divided by the highest possible degree in a simple graph, i.e. one less than the number of vertices.

1 Like

Thank you for the explanation.
Can you point me in the direction, of where this is discussed at depth in the manual or manuscript? I was unable to find a detailed explanation and I would like to discuss this in the Methods section of my manuscript.

Thank You

It is discussed in the documentation pages of the respective functions,

yes, I am looking for something more detailed than what is written in the manual…

for example, when examining the function in R:

res <- .Call(C_R_igraph_degree, graph, v - 1, as.numeric(mode),
if (normalized) {
res <- res/(vcount(graph) - 1)

I see that C is being called here, and therefore it is difficult for me to understand how res is calculated

Frankly, I am not sure what you are looking for.

You do not need to read code to understand what the degree of a vertex is.

Above, I explained how normalization is done for degrees. You can verify this yourself by manually computing the result on a small graph and comparing it with what igraph returns (this is generally a good idea, no matter which package you are using).

The documentation also explains it quite clearly:

normalized Logical scalar, whether to normalize the degree. If TRUE then the result is divided by n-1 , where n is the number of vertices in the graph.

The code you are quoting also makes is very clear: res <- res/(vcount(graph) - 1)

If you are not yet comfortable with network science concepts such as vertex degrees, betweenness centrality, closeness centrality, I recommend looking at one of the popular textbooks, such as:

Yes, I read what you wrote above, as well as what is written in the manual in depth, thank you.

If any detail is unclear, feel free to ask. Feedback is always welcome. But it is important to put the question in context, and to be specific. Explain what exactly is unclear in the documentation. Which detail is missing?


“I read this and this part of the documentation, but it is still unclear to me if quantity X is computed in manner A or in manner B. Both ways would be consistent with the documentation.”


“I computed quantity X on this small graph. The result was 2. Based on this and this formula in the documentation, I expect 3. Why is the result 2?”

The best way to improve documentation is to react to user feedback. But we cannot improve it unless you point out what specifically was unclear.