# Normalization Method

**URL:** <https://igraph.discourse.group/t/normalization-method/220>\
**Category:** Usage\
**Tags:** R\
**Created:** [13 May 2020 14:31 UTC](https://igraph.discourse.group/t/normalization-method/220 "2020-05-13T14:31:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbenel](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rbenel](https://igraph.discourse.group/u/rbenel)\
**Post date:** [13 May 2020 14:31 UTC](https://igraph.discourse.group/t/normalization-method/220/1 "2020-05-13T14:31:03Z")

</div>

Hi,  
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

---

<div class="post-metadata">

**Author:** ![szhorvat](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/szhorvat/32/3_2.png) [@szhorvat](https://igraph.discourse.group/u/szhorvat)\
**Post date:** [13 May 2020 19:16 UTC](https://igraph.discourse.group/t/normalization-method/220/2 "2020-05-13T19:16:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rbenel](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rbenel](https://igraph.discourse.group/u/rbenel)\
**Post date:** [14 May 2020 08:08 UTC](https://igraph.discourse.group/t/normalization-method/220/3 "2020-05-14T08:08:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![szhorvat](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/szhorvat/32/3_2.png) [@szhorvat](https://igraph.discourse.group/u/szhorvat)\
**Post date:** [14 May 2020 08:41 UTC](https://igraph.discourse.group/t/normalization-method/220/4 "2020-05-14T08:41:07Z")

</div>

It is discussed in the documentation pages of the respective functions, [https://igraph.org/r/doc/](https://igraph.org/r/doc/)

---

<div class="post-metadata">

**Author:** ![rbenel](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rbenel](https://igraph.discourse.group/u/rbenel)\
**Post date:** [14 May 2020 08:47 UTC](https://igraph.discourse.group/t/normalization-method/220/5 "2020-05-14T08:47:53Z")

</div>

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),  
> as.logical(loops))  
> 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

---

<div class="post-metadata">

**Author:** ![szhorvat](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/szhorvat/32/3_2.png) [@szhorvat](https://igraph.discourse.group/u/szhorvat)\
**Post date:** [14 May 2020 08:54 UTC](https://igraph.discourse.group/t/normalization-method/220/6 "2020-05-14T08:54:23Z")

</div>

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:

[https://igraph.org/r/doc/degree.html](https://igraph.org/r/doc/degree.html)

> `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:

[https://global.oup.com/academic/product/networks-9780198805090?cc=de&lang=en&](https://global.oup.com/academic/product/networks-9780198805090?cc=de&lang=en&)

---

<div class="post-metadata">

**Author:** ![rbenel](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rbenel](https://igraph.discourse.group/u/rbenel)\
**Post date:** [14 May 2020 09:11 UTC](https://igraph.discourse.group/t/normalization-method/220/7 "2020-05-14T09:11:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![szhorvat](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/szhorvat/32/3_2.png) [@szhorvat](https://igraph.discourse.group/u/szhorvat)\
**Post date:** [14 May 2020 09:27 UTC](https://igraph.discourse.group/t/normalization-method/220/8 "2020-05-14T09:27:31Z")

</div>

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?

E.g.,

“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.”

Or,

“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.
