of 218/218
Network Analysis Graphs as Matrices Michele Coscia & Luca Rossi ITU København
• date post

19-Aug-2020
• Category

## Documents

• view

9

0

Embed Size (px)

### Transcript of Network Analysis Graphs as Matrices - Michele Coscia · Graphs as Network Analysis Matrices Michele...

• Network Analysis

Graphs as Matrices

Michele Coscia & Luca RossiITU København

• Background:

• Background:

Looking at a problem from a different

perspective

• Sergey Brin & Larry Page

(1973-)

• 55 Million!

• 55 Million!

• PageRank

• PageRank● p of visiting v…

• PageRank● p of visiting v…● … = p of visiting a neighbor u of v *

p of going from u to v

• PageRank● p of visiting v…● … = p of visiting a neighbor u of v *

p of going from u to v● for v in V…

• PageRank● p of visiting v…● … = p of visiting a neighbor u of v *

p of going from u to v● for v in V…● 55 million times!

• PageRankG = (V, E)

• PageRankG = (V, E) A = 1 if uv in E

• PageRankG = (V, E) A = 1 if uv in E

• PageRankG = (V, E) A = 1 if uv in E

• PageRank

for v in V...

G = (V, E) A = 1 if uv in E

• PageRank

for v in V... R := AR

G = (V, E) A = 1 if uv in E

~

• PageRank

for v in V... R := AR

G = (V, E) A = 1 if uv in E

~

Row-normalized A

• PageRank

for v in V... R := AR

G = (V, E) A = 1 if uv in E

~

Row-normalized A

Eigenvectorof A

• Random Walks

• Basics

A B C D E FABCDEF

A B

• Basics

A B C D E FABCDEF

Do youknow each

other?

A B

• Basics

A B C D E FABCDEF

Do youknow each

other?

A B

Yes! Yes!

• Basics

A B C D E FABCDEF

Do youknow each

other?

A B

Yes! Yes!

XX

• Basics

• Basics1 2 3 4 5 6 7 8 9

• Basics1 2 3 4 5 6 7 8 9

123456789

• Basics1 2 3 4 5 6 7 8 9

123456789

• Basics1 2 3 4 5 6 7 8 9

123456789

• Basics1 2 3 4 5 6 7 8 9

123456789

• Basics1 2 3 4 5 6 7 8 9

123456789

• Basics1 2 3 4 5 6 7 8 9

123456789

3

3

3

2

1

A B C D E FABCDEF

AX X X

A B C D E FABCDEF

at random

AX X X

A B C D E FABCDEF

at random

A

Mmm…E!

X X X

• Stochastic Adjacency● p of going from

v to u

• Stochastic Adjacency● p of going from

v to u

● A / A.sum(axis = 1)

• Stochastic Adjacency● p of going from

v to u

● A / A.sum(axis = 1)

• Stochastic Adjacency● p of going from v

to u

● A / A.sum(axis = 1)

● Useful eigen-properties

• Walk Probabilities

• Walk Probabilities

• Walk Probabilities

• Walk Probabilities

• Walk Probabilities

• Walk probabilities

• Walk probabilities

• Walk probabilities

• Walk probabilities

• Walk probabilities

• Walk probabilities

• Walk probabilities

• Walk probabilities

• Walk probabilities

• Walk probabilities

p(1→2) in two steps?

• Walk probabilities

p(1→2) in two steps?(p(1→5) * p(5→2)) + (p(1→9) * p(9→2))

• Walk probabilities

p(1→2) in two steps?(p(1→5) * p(5→2)) + (p(1→9) * p(9→2))

p(u→v)?

• Powers of Stochastic

A

• Powers of Stochastic

A

• Powers of Stochastic

A

• Powers of Stochastic

A A2

• Powers of Stochastic

A A2

• Powers of Stochastic

A A2

• Powers of Stochastic

A A2

• Powers of Stochastic

A A2

• Powers of Stochastic

• Powers of Stochastic

• Powers of Stochastic

• Powers of Stochastic

• Powers of Stochastic

1

• Powers of Stochastic

• Powers of Stochastic

• Powers of Stochastic

• A2

• A2

• A2 A3

• A2 A30

• Stationary Distribution

• Stationary Distribution● A∞ = π

• Stationary Distribution● A∞ = π

• Stationary Distribution● A∞ = π

● πA = π

• Stationary Distribution● A∞ = π

● πA = π

● ~ PageRank

• Disconnected Mazes

• Disconnected Mazes

• Disconnected Mazes

• Disconnected Mazes

?

• Disconnected Mazes

?

• Multiple Components

A

• Multiple Components

A30

• Multiple Components

A30

• Multiple Components

A30

• Multiple Components

A30

• Multiple Components

A30

Beamme up,Scotty!

A

A

A+ε

• Stationary Distribution vs Degree

• Stationary Distribution vs Degree

• Stationary Distribution vs Degree

Corr = 1

• Stationary Distribution vs Degree

Corr = 1π = k / k.sum()

• Stationary Distribution vs PageRank

• Stationary Distribution vs PageRank

• Stationary Distribution vs PageRank

• Stationary Distribution vs PageRank

• Stationary Distribution vs PageRank

• Graph Spectrum

• A Recap on Eigenvectors

v(x, y)

• A Recap on Eigenvectors

v

w = Av

(x’, y’)

(x, y)

• A Recap on Eigenvectors

v

w = Av

(x’, y’)(λx, λy)

(x, y)

• A Recap on Eigenvectors

v

w = Av

(x’, y’)

w = Av = λv

(λx, λy)

(x, y)

• A Recap on Eigenvectors

v

w = Av

(x’, y’)

w = Av = λv

(λx, λy)

Eigenvector

(x, y)

• A Recap on Eigenvectors

v

w = Av

(x’, y’)

w = Av = λv

(λx, λy)

Eigenvector

Eigenvalue

(x, y)

• Right & Left

Av = λv

• Right & Left

Av = λv Right Eigenvector

• Right & Left

Av = λv Right Eigenvector

• Right & Left

Av = λv

vA = vλ

Right Eigenvector

• Right & Left

Av = λv

vA = vλ

Right Eigenvector

Left Eigenvector

• Right & Left

Av = λv

vA = vλ

Right Eigenvector

Left Eigenvector

• Right & Left

Av = λv

vA = vλ

Right Eigenvector

Left Eigenvector

• Right & Left

Av = λv

vA = vλ

Right Eigenvector

Left Eigenvector

• Eigenvalues

λ1 ≥ λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λn

• Eigenvalues

λ1 ≥ λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λn

1

• Eigenvalues

λ1 ≥ λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λn

1

• Eigenvalues & Components

• Eigenvalues & Components

• Eigenvalues & Components

• Eigenvalues & Components

• Eigenvalues & Components

• Eigenvalues & Components

• Eigenvalues & Components

• Eigenvalues & Components

λ1 ≥ λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λn

• Eigenvalues & Components

λ1 ≥ λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λnIf both equal to 1

• Eigenvalues & Components

λ1 ≥ λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λnIf both equal to 1

Graph has two components

• Eigenvalues & Components

λ1 ≥ λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λnIf both equal to 1

Graph has two components

• Eigenvalues & Components

λ1 ≥ λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λnIf both equal to 1

Graph has two components

λ1

• Eigenvalues & Components

λ1 ≥ λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λnIf both equal to 1

Graph has two components

λ1λ2

• Eigenvalues & Components

λ1 > λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λn

• Eigenvalues & Components

λ1 > λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λn

• Eigenvalues & Components

λ1 > λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λn

• Eigenvectors

λ1 ≥ λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λn

• Eigenvectors

λ1 ≥ λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λn

v1 v2 v3 … vn-2 vn-1 vn

• Eigenvectors

λ1 ≥ λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λn

v1 v2 v3 … vn-2 vn-1 vn“Largest” Eigenvector

• Eigenvectors

vi

abcdefghil

mno

• Eigenvectors

vi

abcdefghil

mno

• Eigenvectors

vi

abcdefghil

mno

• Eigenvectors

vi

abcdefghil

mno

• Eigenvectors

vi

abcdefghil

mno

• Eigenvectors & Components

λ1 ≥ λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λnIf both equal to 1

Graph has two components

λ1λ2

• Eigenvectors & Components

λ1 ≥ λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λnIf both equal to 1

Graph has two components

λ1λ2

v1 v2

• Eigenvectors & Components

λ1 ≥ λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λnIf both equal to 1

Graph has two components

λ1λ2

v1 v2

aaaaaa000

000000bbb

• Eigenvectors & Components

λ1 > λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λn

• Eigenvectors & Components

λ1 > λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λn

v1

• Eigenvectors & Components

λ1 > λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λn

v1

λ1

• Eigenvectors & Components

λ1 > λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λn

v1

aaaaaaaaa

λ1

• Left Largest Eigenvector

• Left Largest Eigenvector

• Left Largest Eigenvector

• Left Largest Eigenvector

vL1 = π

• Left Largest Eigenvector

vL1 = π

πA = π

• Left Largest Eigenvector

vL1 = π

πA = ππA = π1

• Left Largest Eigenvector

vL1 = π

πA = ππA = π1

λ1

• Left Largest Eigenvector

vL1 = π

πA = ππA = π1

λ1

• Left & Right

• Left & RightvL1

• Left & RightvL1

• Left & RightvL1

v1

aaaaaaaaa

• Left & RightvL1

vR1v1

aaaaaaaaa

• Left & RightvL1

vR1 A

• Left & RightvL1

vR1 AT

• Left & RightvL1

vR1 ATA / A.sum(axis = 0)

• Left & Right

ATA / A.sum(axis = 0)

• Left & Right

ATA / A.sum(axis = 0)

vL1

vR1

• Graph Laplacian

• Degree Matrix

• Degree MatrixZeros everywhere

• Degree MatrixZeros everywhere

i-th diagonal element...

• Degree MatrixZeros everywhere

i-th diagonal element... … is the degree of node i

• Degree MatrixZeros everywhere

i-th diagonal element... … is the degree of node i

D

• Laplacian Matrix

D A

• Laplacian Matrix

D AL = -

• Laplacian Matrix

L = D - A

• Laplacian Matrix

L = D - A

• Laplacian Matrix

L = D - A

• Laplacian Matrix

L = D - A

0

• Eigenvalues

λ1 ≥ λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λn

1

A

L

• Eigenvalues

λ1 ≥ λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λn

1

A

L λ1 ≤ λ2 ≤ λ3 ≤ … ≤ λn-2 ≤ λn-1 ≤ λn

• Eigenvalues

λ1 ≥ λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λn

1

A

L λ1 ≤ λ2 ≤ λ3 ≤ … ≤ λn-2 ≤ λn-1 ≤ λn0

• Eigenvalues

λ1 ≥ λ2 ≥ λ3 ≥ … ≥ λn-2 ≥ λn-1 ≥ λn

1

A

L λ1 ≤ λ2 ≤ λ3 ≤ … ≤ λn-2 ≤ λn-1 ≤ λn0

# of 0s = # of components

• Eigenvectors

• Eigenvectors

v1

• Eigenvectors

v1

aaaaaaaaa

• Eigenvectors

v1

aaaaaaaaa

v2

• Eigenvectors

v1

aaaaaaaaa

v2

.37

.37

.28

.28

.12-.23-.38-.38-.43

• Eigenvectors

v1

aaaaaaaaa

v2

.37

.37

.28

.28

.12-.23-.38-.38-.43

• Eigenvectors

v1

aaaaaaaaa

v2

.37

.37

.28

.28

.12-.23-.38-.38-.43

• Eigenvectors

v1

aaaaaaaaa

v2

.37

.37

.28

.28

.12-.23-.38-.38-.43

• Eigenvectors

v1

aaaaaaaaa

v2

.37

.37

.28

.28

.12-.23-.38-.38-.43

• Eigenvectors

• Eigenvectors

+

• Eigenvectors

+ -

• Eigenvectors

• Eigenvectors

2nd Eigenvector

• Eigenvectors

2nd Eigenvector

3rd Eigenvector

• Eigenvectors

• Eigenvectors

• Eigenvectors