# Examples of network centralities

The examples show images only for undirected networks.

# Centrality degree

The minimum degree that a node can have is obviously zero, and that is the case for the node without connections in the image below. The numbers inside the nodes represent the degree.

The maximum value of the degree that a node can have is *n-1, *where *n *is the number of nodes in the network. This happens when that particular node is connected with all others. In the image below 2 two vertices are connected with all the others nodes.

# Centrality closeness

The maximum of farness (distance with all the other nodes), hence the minimum closeness, happens at the nodes at the extremes of a chain graph. This is because if we try to construct the highest farness for a node by adding nodes one at a time, we start by knowing that:

The maximum value that the summation can have in the process of adding nodes is when the distance keeps growing; this happens with the sum of *1+2+3+4+5+…+k, *and that means creating a chain graph.

So the closeness for the nodes at the extremes of a chain graph is *2/(n*(n-1)). *In the case of the image below, *n *is 5, so the closeness is 0.1.

The minimum farness and the highest value of closeness happens when a node is adjacent to all the others. In a complete graph, all the nodes have maximum closeness. In a star graph, like the one shown below, the central node has the highest value.

# Centrality Betweenness

The lowest value a node can have is zero, and that happens when there isn’t a shortest path going through the node. The highest value occurs when all the shortest paths of the network pass through a single central node.

Below there is the image of the Zachary graph, labeled with betweenness.

R code for the images

library(igraph)

library(ggraph)set_graph_style()#degree

D_min = graph_from_data_frame(d = data.frame(from =c(“1”, “3”, “3”, “4”),

to = c(“2”, “1”, “4”, “1”) ),

vertices = data.frame( name = c(“1”, “2”, “3”, “4”, “5”)),

directed = F)plot( D_min, vertex.label = degree(D_min) )D_max = make_graph( c(1,2, 2,3, 3,4, 4,1, 1,3), directed = F)

plot(D_max, vertex.label = degree(D_max))D_full = make_full_graph(6)

plot(D_full, vertex.label = degree(D_full))#closeness

C_chain = make_graph( c(1,2, 2,3, 3,4, 4,5), directed = F )

plot(C_chain, vertex.label = round(closeness(C_chain), digits = 2))C_star = make_star(6, mode = “undirected”)

plot(C_star, vertex.label = round(closeness(C_star), digits = 2))#betweenness

B = make_star(6, mode = “undirected”)

plot(B, vertex.label = round(betweenness(B), digits = 2))Z = make_graph("Zachary")

plot(Z, layout = layout_with_fr(Z),

vertex.label = round(betweenness(Z), digits = 1))