0% found this document useful (0 votes)
12 views46 pages

3 Centrality

Uploaded by

unikhuman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views46 pages

3 Centrality

Uploaded by

unikhuman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Node

Centrality

Pedro Ribeiro
(DCC/FCUP & CRACS/INESC-TEC)

(Heavily based on slides from Jure Leskovec and Lada Adamic @ Stanford University)
Star Wars IV Network
moviegalaxies.com

Are all nodes “equal”? How to measure their importance?


Pedro Ribeiro – Node Centrality
Star Wars IV Network

Size proportional to degree: is this the only way?


Pedro Ribeiro – Node Centrality
Star Wars IV Network

Size proportional to betweenness


Pedro Ribeiro – Node Centrality
Star Wars IV Network

Size proportional to closeness


Pedro Ribeiro – Node Centrality
Why degree is not enough

Pedro Ribeiro – Node Centrality


Why degree is not enough

Pedro Ribeiro – Node Centrality


Different notions of centrality

Node Centrality measures “importance”

Pedro Ribeiro – Node Centrality


Node Degree

Let’s put some numbers to it
Undirected degree:
e.g. nodes with more friends are more central.

Assumption: the connections that your friend has don't


matter, it is what they can do directly that does (e.g. go
have a beer with you, help you build a deck...)

Pedro Ribeiro – Node Centrality


Node Degree

Normalization:
divide degree by the max. possible, i.e. (N-1)

Pedro Ribeiro – Node Centrality


Node Degree
example financial trading networks

high in-centralization: low in-centralization:


one node buying from buying is more evenly
many others distributed

Pedro Ribeiro – Node Centrality


What does degree not capture?

In what ways does degree fail to capture
centrality in the following graphs?

Pedro Ribeiro – Node Centrality


Brokerage not captured by degree

Pedro Ribeiro – Node Centrality


Brokerage: Concept

Pedro Ribeiro – Node Centrality


Brokerage: Concept

Pedro Ribeiro – Node Centrality


Capturing Brokerage

Betweenness Centrality:

intuition: how many pairs of individuals would have to


go through you in order to reach one another in the
minimum number of hops?

Pedro Ribeiro – Node Centrality


Betweenness: Definition

g jk (i)
C B (i)=∑
j<k g jk
Where:
gjk = the number of shortest paths connecting nodes j and k
g jk(i) = the number that node i is on.

Usually normalized by:

' C B (i)
C (i)=
B
(n−1)(n−2)/2
number of pairs of vertices
excluding the vertex itself

Pedro Ribeiro – Node Centrality


Betweenness: Toy Networks

Non-normalized version:

Pedro Ribeiro – Node Centrality


Betweenness: Toy Networks

Non-normalized version:

– A lies between no two other vertices


– B lies between A and 3 other vertices: C, D, and E
– C lies between 4 pairs of vertices: (A,D),(A,E),(B,D),(B,E)

note that there are no alternate paths for these pairs
to take, so C gets full credit

Pedro Ribeiro – Node Centrality


Betweenness: Toy Networks

Non-normalized version:

Pedro Ribeiro – Node Centrality


Betweenness: Toy Networks

Non-normalized version:


why do C and D each have
betweenness 1?

They are both on shortest
paths for pairs (A,E), and (B,E),
and so must share credit:
- 1⁄2+1/2 = 1

Pedro Ribeiro – Node Centrality


Betweenness: Toy Networks

Non-normalized version:

What is the betweenness


of node E?

Pedro Ribeiro – Node Centrality


Betweenness: Real Example

Social Network (facebook)
nodes are sized by degree, and colored by betweenness

Pedro Ribeiro – Node Centrality


Betweenness: Question

Find a node that has high betweenness
but low degree

Pedro Ribeiro – Node Centrality


Betweenness: Question

Find a node that has low betweenness but
high degree

Pedro Ribeiro – Node Centrality


Closeness Centrality


What if it’s not so important to have
many direct friends?


Or be “between” others


But one still wants to be in the “middle”
of things, not too far from the center

Pedro Ribeiro – Node Centrality


Closeness Centrality

Need not be in brokerage position

Pedro Ribeiro – Node Centrality


Closeness: Definition

Closeness is based on the length of the
average shortest path between a node
and all other nodes in the network

Closeness Centrality:
1
C C (i)= N

∑ d (i , j)
j=1

Normalized Closeness Centrality:


'
C (i)=C C (i)×(n−1)
C
When graphs are big, the
-1 can be discarded and
we multiply by n
Pedro Ribeiro – Node Centrality
Closeness: Toy Networks

Pedro Ribeiro – Node Centrality


Closeness: Toy Networks

Pedro Ribeiro – Node Centrality


Closeness: Question

Find a node which has relatively high degree
but low closeness

Pedro Ribeiro – Node Centrality


Closeness: Question

Find a node which has low degree but
high closeness

Pedro Ribeiro – Node Centrality


Closeness: unconnected graph

What if the graph is not connected?

1
C C (i)= N

∑ d (i , j)
j=1

instead of null, we could also interpret


it as 0 if infinity is the distance
between unconnected nodes

Pedro Ribeiro – Node Centrality


Harmonic: Definition

Replace the average distance with the harmonic
mean of all distances

Harmonic Centrality:
1 1
C H (i)=∑ = ∑
j≠i d (i , j) d(i , j)<∞ , j≠i d (i , j)
– Strongly correlated to closeness centrality
– Naturally also accounts for nodes j that cannot reach i
– Can be applied to graphs that are not connected

Normalized Harmonic Centrality:


'
C (i)=C H (i)/(n−1)
H
Pedro Ribeiro – Node Centrality
Harmonic: Toy Networks

Non-normalized version:

Pedro Ribeiro – Node Centrality


Closeness vs Harmonic

Closeness Centrality Harmonic Centrality


1 1
C C (i)= N C H (i)=∑
∑ d (i , j) j≠i d (i , j)
j=1

Pedro Ribeiro – Node Centrality


Eigenvector Centrality

How “central” you are depends on how “central”
your neighbors are

Pedro Ribeiro – Node Centrality


Eigenvector Centrality
Eigenvector Centrality:
n
1
C E (i)= ∑ A ji ×C E ( j)
λ j=1
where λ is a constant and
Aij the adjacency matrix (1 if (i,j) are connected, 0 otherwise)

(with a small rearrangement) this can we rewritten


in vector notation as in the eigenvector equation
Ax= λ x
where x is the eigenvector, and its i-th component is the centrality of node i

In general, there will be many different eigenvalues λ for which a non-zero eigenvector solution exists. However,
the additional requirement that all the entries in the eigenvector be non-negative implies (by the Perron–Frobenius
theorem) that only the greatest eigenvalue results in the desired centrality measure

Pedro Ribeiro – Node Centrality


Bonacich eigenvector centrality
also known as Bonacich Power Centrality

Pedro Ribeiro – Node Centrality


Bonacich eigenvector centrality
also known as Bonacich Power Centrality

Pedro Ribeiro – Node Centrality


Eigenvector Variants

There are other variants of eigenvector
centrality, such as:

– PageRank

(normalized eigen vector + random jumps)
[we will talk in detail about that later]

– Katz Centrality

(connections with distant neighbors are penalized)

Pedro Ribeiro – Node Centrality


Centrality in Directed Networks

Degree:
– in and out centrality

Betweenness:
g jk (i)
– Consider only directed paths: C B (i)=∑
j≠k g jk
– When normalizing take care of ordered pairs
' C B (i)
C (i)=
B number of ordered pairs is
(n−1)(n−2) 2x the number of unordered

Closeness
– Consider only directed paths

Eigenvector (already prepared)
Pedro Ribeiro – Node Centrality
Centrality in Weighted Networks


Degree:
– Sum weights (non-weighted equals weight=1 for all edges)


Betweenness and Closeness:
– Consider weighted distance


Eigenvector
– Consider weighted adjacency matrix

Pedro Ribeiro – Node Centrality


Node Centralities: Conclusion

There are other node centrality metrics,
but these are the “quintessential”


Which one to use depends on what you want to
achieve or measure
– Worry about understanding the concepts
– They enlarge your graph vocabulary
Pedro Ribeiro – Node Centrality
Node Centralities: Conclusion

Betweenness Closeness Eigenvector

Degree Harmonic Katz

Pedro Ribeiro – Node Centrality


Node Centralities: Conclusion

All (major) network analysis packages provide them:


Also all (major) network analysis and visualization platforms:

Pedro Ribeiro – Node Centrality

You might also like