02 Tutorial Week3
02 Tutorial Week3
02 Tutorial Week3
Tutorial Week 3
Liang QU
School of ITEE
The University of Queensland
Outlines
• Quiz 1 Answers
• Lecture Knowledge Extension
• Coding Demo
• Implementation of Node Centrality Measures
• Q&A
Section 1: Quiz 1 Answers
d
Section 2: Lecture Knowledge Extension
Section 2:
1. In-class Quiz about three geometric centrality measures
2. What are eigenvectors and eigenvalues?
3. How to calculate eigenvectors and eigenvalues?
In-Class Quiz (5 mins)
• Consider an undirected graph with 5 nodes (A,B,C,D,E) with the
following edge list:
(A,B)
(A,C)
(B,C)
(B,D)
(C,E)
Please calculate the centrality of nodes A and E using Degree Centrality,
Closeness Centrality, and normalized Harmonic Centrality methods,
respectively.
In-class quizzes will NOT be included in the final grade.
In-Class Quiz
Consider an undirected graph with 5 nodes (A,B,C,D,E) with the
following edge list:
(A,B)
E A B D
(A,C)
(B,C)
(B,D) C
(C,E)
Please calculate the centrality of nodes A and E using
Degree Centrality (DC), Closeness Centrality (CC), and
normalized Harmonic Centrality (HC) methods,
respectively.
DC CC Normalized HC
Node A 2 1 1 1 1 1 1 1 3
= = 0.17 + + + = = 0.75
1+1+2+2 6 4 1 1 2 2 4
Node E 1 1 1 1 1 1 1 1 7
= = 0.125 + + + = = 0.58
2+2+1+3 8 4 2 2 1 3 12
Section 2: Spectral Graph
Ø We will begin with the very basic observation that graphs can be represented as matrices, and
then ask “what happens if we apply the linear algebraic tools to these matrices?”
Ø How to calculate the eigenvalues and eigenvectors of a matrix?
Here, an interesting fact is that we multiply a matrix by a vector and get the same result as when we multiply
a scalar (just a number) by that vector.
Section 2: Eigenvectors and Eigenvalues
Geometric interpretation of an eigenvector:
When we multiply matrix A by the eigenvector, the direction of
the eigenvector remains unchanged.
Section 2: Eigenvectors and Eigenvalues
Recall 𝐵 𝑥⃗ = 0 not
where 𝐵 = 𝐴 − 𝜆𝐼
Solution
Section 2: Eigenvectors and Eigenvalues
Problem
Solution
Section 2: Eigenvectors
In-class Quiz:
and Eigenvalues
Find 𝑥⃗ such that 𝐴𝑥⃗ = −1𝑥,
⃗ where
Problem
Solution
Section 2: Eigenvectors and Eigenvalues
Find 𝑥⃗ such that 𝐴𝑥⃗ = −1𝑥,
⃗ where
Problem
Solution
2 4 0 1 2 0
rref
2 4 0 0 0 0
Thus 𝑥! = −2𝑥"
𝑥! −2𝑥" −2
𝑥⃗ = 𝑥 = = 𝑥" 𝑥" could be any nonzero scalar
" 𝑥" 1
Q&A