Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf ·...

101
Discrete Mathematics and Its Applications Lecture 7: Graphs: Representing Graphs and Graph Isomorphism MING GAO DaSE@ECNU (for course related communications) [email protected] Dec. 23, 2019

Transcript of Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf ·...

Page 1: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Discrete Mathematics and Its ApplicationsLecture 7: Graphs: Representing Graphs and Graph Isomorphism

MING GAO

DaSE@ECNU(for course related communications)

[email protected]

Dec. 23, 2019

Page 2: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Outline

1 Representing GraphsAdjacency MatricesIncidence MatricesRandom Walk and Laplacian

2 Isomorphism of Graphs

3 ConnectivityPathsConnectedness in undirected graphsHow Connected is a Graph?Connectedness in Directed GraphsPaths and IsomorphismCounting Paths Between Vertices

4 Take-aways

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 2 / 41

Page 3: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Adjacency Matrices

Adjacency lists

Way i: One way to represent a graph without multiple edges is tolist all the edges of this graph.

Way ii: Another way to represent a graph with no multiple edges isto use adjacency lists, which specify the vertices that are adjacentto each vertex of the graph.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 3 / 41

Page 4: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Adjacency Matrices

Adjacency lists

Way i: One way to represent a graph without multiple edges is tolist all the edges of this graph.Way ii: Another way to represent a graph with no multiple edges isto use adjacency lists, which specify the vertices that are adjacentto each vertex of the graph.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 3 / 41

Page 5: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Adjacency Matrices

Adjacency lists

Way i: One way to represent a graph without multiple edges is tolist all the edges of this graph.Way ii: Another way to represent a graph with no multiple edges isto use adjacency lists, which specify the vertices that are adjacentto each vertex of the graph.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 3 / 41

Page 6: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Adjacency Matrices

Adjacency lists for directed graph

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 4 / 41

Page 7: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Adjacency Matrices

Adjacency matrices

Definition

Suppose that the vertices of G = (V ,E ) are listed arbitrarily asv1, v2, · · · , vn. The adjacency matrix A (or AG ) of G , w.r.t. thislisting of the vertices, is the n × n zero-one matrix with 1 as its(i , j)−th entry when vi and vj are adjacent, and 0 as its (i , j)−thentry when they are not adjacent, i.e., if its adjacency matrix isA = [aij ], then

aij =

{1, if (vi , vj) is an edge of G ;0, otherwise.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 5 / 41

Page 8: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Adjacency Matrices

Adjacency matrices

Definition

Suppose that the vertices of G = (V ,E ) are listed arbitrarily asv1, v2, · · · , vn. The adjacency matrix A (or AG ) of G , w.r.t. thislisting of the vertices, is the n × n zero-one matrix with 1 as its(i , j)−th entry when vi and vj are adjacent, and 0 as its (i , j)−thentry when they are not adjacent, i.e., if its adjacency matrix isA = [aij ], then

aij =

{1, if (vi , vj) is an edge of G ;0, otherwise.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 5 / 41

Page 9: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Adjacency Matrices

Adjacency matrices for pseudograph

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 6 / 41

Page 10: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Adjacency Matrices

Adjacency list VS. adjacency matrix

Trade-offs between adjacency lists and adjacency matrix:

When a graph is sparse, it is usually preferable to use adjacencylists rather than an adjacency matrix to represent the graph.

The adjacency matrix of a sparse graph is a sparse matrix, thatis, a matrix with few nonzero entries, and there are specialtechniques for representing, and computing with, sparsematrices.

Suppose that a simple graph is dense, we compare thecomplexity of determining whether the possible edge (vi , vj) ispresent.

For case of adjacency matrix, we only need to examine the(i , j)−th entry in the matrix;For case of adjacency list, we need to search the list of verticesadjacent to either vi or vj in O(|V |).

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 7 / 41

Page 11: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Adjacency Matrices

Adjacency list VS. adjacency matrix

Trade-offs between adjacency lists and adjacency matrix:

When a graph is sparse, it is usually preferable to use adjacencylists rather than an adjacency matrix to represent the graph.

The adjacency matrix of a sparse graph is a sparse matrix, thatis, a matrix with few nonzero entries, and there are specialtechniques for representing, and computing with, sparsematrices.

Suppose that a simple graph is dense, we compare thecomplexity of determining whether the possible edge (vi , vj) ispresent.

For case of adjacency matrix, we only need to examine the(i , j)−th entry in the matrix;For case of adjacency list, we need to search the list of verticesadjacent to either vi or vj in O(|V |).

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 7 / 41

Page 12: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Adjacency Matrices

Adjacency list VS. adjacency matrix

Trade-offs between adjacency lists and adjacency matrix:

When a graph is sparse, it is usually preferable to use adjacencylists rather than an adjacency matrix to represent the graph.

The adjacency matrix of a sparse graph is a sparse matrix, thatis, a matrix with few nonzero entries, and there are specialtechniques for representing, and computing with, sparsematrices.

Suppose that a simple graph is dense, we compare thecomplexity of determining whether the possible edge (vi , vj) ispresent.

For case of adjacency matrix, we only need to examine the(i , j)−th entry in the matrix;For case of adjacency list, we need to search the list of verticesadjacent to either vi or vj in O(|V |).

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 7 / 41

Page 13: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Adjacency Matrices

Adjacency list VS. adjacency matrix

Trade-offs between adjacency lists and adjacency matrix:

When a graph is sparse, it is usually preferable to use adjacencylists rather than an adjacency matrix to represent the graph.

The adjacency matrix of a sparse graph is a sparse matrix, thatis, a matrix with few nonzero entries, and there are specialtechniques for representing, and computing with, sparsematrices.

Suppose that a simple graph is dense, we compare thecomplexity of determining whether the possible edge (vi , vj) ispresent.

For case of adjacency matrix, we only need to examine the(i , j)−th entry in the matrix;For case of adjacency list, we need to search the list of verticesadjacent to either vi or vj in O(|V |).

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 7 / 41

Page 14: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Adjacency Matrices

Adjacency list VS. adjacency matrix

Trade-offs between adjacency lists and adjacency matrix:

When a graph is sparse, it is usually preferable to use adjacencylists rather than an adjacency matrix to represent the graph.

The adjacency matrix of a sparse graph is a sparse matrix, thatis, a matrix with few nonzero entries, and there are specialtechniques for representing, and computing with, sparsematrices.

Suppose that a simple graph is dense, we compare thecomplexity of determining whether the possible edge (vi , vj) ispresent.

For case of adjacency matrix, we only need to examine the(i , j)−th entry in the matrix;

For case of adjacency list, we need to search the list of verticesadjacent to either vi or vj in O(|V |).

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 7 / 41

Page 15: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Adjacency Matrices

Adjacency list VS. adjacency matrix

Trade-offs between adjacency lists and adjacency matrix:

When a graph is sparse, it is usually preferable to use adjacencylists rather than an adjacency matrix to represent the graph.

The adjacency matrix of a sparse graph is a sparse matrix, thatis, a matrix with few nonzero entries, and there are specialtechniques for representing, and computing with, sparsematrices.

Suppose that a simple graph is dense, we compare thecomplexity of determining whether the possible edge (vi , vj) ispresent.

For case of adjacency matrix, we only need to examine the(i , j)−th entry in the matrix;For case of adjacency list, we need to search the list of verticesadjacent to either vi or vj in O(|V |).

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 7 / 41

Page 16: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Incidence Matrices

Incidence matrices

Definition

Let G = (V ,E ) be an undirected graph. Suppose that v1, v2, · · · , vnare the vertices and e1, e2, · · · , em are the edges of G . Then theincidence matrix with respect to this ordering of V and E is then ×m matrix M = [mij ], where

mij =

{1, when edge ej is incident with vi ;0, otherwise.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 8 / 41

Page 17: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Incidence Matrices

Incidence matrices

Definition

Let G = (V ,E ) be an undirected graph. Suppose that v1, v2, · · · , vnare the vertices and e1, e2, · · · , em are the edges of G . Then theincidence matrix with respect to this ordering of V and E is then ×m matrix M = [mij ], where

mij =

{1, when edge ej is incident with vi ;0, otherwise.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 8 / 41

Page 18: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Incidence Matrices

Incidence matrices for pseudograph

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 9 / 41

Page 19: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Random Walk and Laplacian

Random walk of a graph

Suppose that G = (V ,E ) is a graph. Let N(x) = {y |(x , y) ∈ E}, and thedegree of vertex x denote as d(x) = |N(x)|.

Markov Chain

For each x ∈ V , the transition probability matrix P(y |x) is 1d(x) if

y ∈ N(x), and P(y |x) = 0 otherwise. The discrete-time Markovchain X is a random walk on G .Let D = diag(d1, d2, · · · , dn) be a diagonal matrix, and P = D−1A,which is the transition probability matrix.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 10 / 41

Page 20: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Random Walk and Laplacian

Random walk of a graph

Suppose that G = (V ,E ) is a graph. Let N(x) = {y |(x , y) ∈ E}, and thedegree of vertex x denote as d(x) = |N(x)|.

Markov Chain

For each x ∈ V , the transition probability matrix P(y |x) is 1d(x) if

y ∈ N(x), and P(y |x) = 0 otherwise. The discrete-time Markovchain X is a random walk on G .

Let D = diag(d1, d2, · · · , dn) be a diagonal matrix, and P = D−1A,which is the transition probability matrix.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 10 / 41

Page 21: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Random Walk and Laplacian

Random walk of a graph

Suppose that G = (V ,E ) is a graph. Let N(x) = {y |(x , y) ∈ E}, and thedegree of vertex x denote as d(x) = |N(x)|.

Markov Chain

For each x ∈ V , the transition probability matrix P(y |x) is 1d(x) if

y ∈ N(x), and P(y |x) = 0 otherwise. The discrete-time Markovchain X is a random walk on G .Let D = diag(d1, d2, · · · , dn) be a diagonal matrix, and P = D−1A,which is the transition probability matrix.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 10 / 41

Page 22: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Random Walk and Laplacian

Combinatorial Laplacian of graph

Definition

Given a graph G , (Combinatorial) Laplacian of G : L = D − A, i.e.,

L(u, v) =

dv , if u = v ;−1, if u and v are adjacent ;0, otherwise.

If G is an undirected graph G, and its Laplacian matrix L with eigen-values λ0 ≤ λ1 ≤ · · · ≤ λn−1, then

L is singular and symmetric(existing λi = 0).

Since row sum and column sum of L is zero, λ0 = 0 andv0 = (1, 1, · · · , 1).

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 11 / 41

Page 23: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Random Walk and Laplacian

Combinatorial Laplacian of graph

Definition

Given a graph G , (Combinatorial) Laplacian of G : L = D − A, i.e.,

L(u, v) =

dv , if u = v ;−1, if u and v are adjacent ;0, otherwise.

If G is an undirected graph G, and its Laplacian matrix L with eigen-values λ0 ≤ λ1 ≤ · · · ≤ λn−1, then

L is singular and symmetric(existing λi = 0).

Since row sum and column sum of L is zero, λ0 = 0 andv0 = (1, 1, · · · , 1).

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 11 / 41

Page 24: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Random Walk and Laplacian

Combinatorial Laplacian of graph

Definition

Given a graph G , (Combinatorial) Laplacian of G : L = D − A, i.e.,

L(u, v) =

dv , if u = v ;−1, if u and v are adjacent ;0, otherwise.

If G is an undirected graph G, and its Laplacian matrix L with eigen-values λ0 ≤ λ1 ≤ · · · ≤ λn−1, then

L is singular and symmetric(existing λi = 0).

Since row sum and column sum of L is zero, λ0 = 0 andv0 = (1, 1, · · · , 1).

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 11 / 41

Page 25: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Random Walk and Laplacian

Normalized Laplacian of graph

Definition

Given a graph G , normailized Laplacian of G : L = D−1/2LD−1/2,

i.e., L(u, v) =

1, if u = v ;− 1√

dudv, if u and v are adjacent ;

0, otherwise.

L = I − D−1/2AD−1/2 = D1/2(I − P)D−1/2. Thus, L ispositive semidefinite and 0 ≤ λ(L) ≤ 2.

L is singular and symmetric, and λ0 = 0 corresponding toeigenvector D1/2vT0 = D1/2(1, 1, · · · , 1)T .

P has an eigenvalue 1− λi , where λi is an eigenvalue of L.

The regularization of graph G :

FTLF = 12

∑ni=1

∑nj=1

(fi√dii− fj√

djj

)2.

For weighted graph G , Laplacian and normalized Laplacian canbe defined in a same manner.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 12 / 41

Page 26: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Random Walk and Laplacian

Normalized Laplacian of graph

Definition

Given a graph G , normailized Laplacian of G : L = D−1/2LD−1/2,

i.e., L(u, v) =

1, if u = v ;− 1√

dudv, if u and v are adjacent ;

0, otherwise.

L = I − D−1/2AD−1/2 = D1/2(I − P)D−1/2. Thus, L ispositive semidefinite and 0 ≤ λ(L) ≤ 2.

L is singular and symmetric, and λ0 = 0 corresponding toeigenvector D1/2vT0 = D1/2(1, 1, · · · , 1)T .

P has an eigenvalue 1− λi , where λi is an eigenvalue of L.

The regularization of graph G :

FTLF = 12

∑ni=1

∑nj=1

(fi√dii− fj√

djj

)2.

For weighted graph G , Laplacian and normalized Laplacian canbe defined in a same manner.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 12 / 41

Page 27: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Random Walk and Laplacian

Normalized Laplacian of graph

Definition

Given a graph G , normailized Laplacian of G : L = D−1/2LD−1/2,

i.e., L(u, v) =

1, if u = v ;− 1√

dudv, if u and v are adjacent ;

0, otherwise.

L = I − D−1/2AD−1/2 = D1/2(I − P)D−1/2. Thus, L ispositive semidefinite and 0 ≤ λ(L) ≤ 2.

L is singular and symmetric, and λ0 = 0 corresponding toeigenvector D1/2vT0 = D1/2(1, 1, · · · , 1)T .

P has an eigenvalue 1− λi , where λi is an eigenvalue of L.

The regularization of graph G :

FTLF = 12

∑ni=1

∑nj=1

(fi√dii− fj√

djj

)2.

For weighted graph G , Laplacian and normalized Laplacian canbe defined in a same manner.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 12 / 41

Page 28: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Random Walk and Laplacian

Normalized Laplacian of graph

Definition

Given a graph G , normailized Laplacian of G : L = D−1/2LD−1/2,

i.e., L(u, v) =

1, if u = v ;− 1√

dudv, if u and v are adjacent ;

0, otherwise.

L = I − D−1/2AD−1/2 = D1/2(I − P)D−1/2. Thus, L ispositive semidefinite and 0 ≤ λ(L) ≤ 2.

L is singular and symmetric, and λ0 = 0 corresponding toeigenvector D1/2vT0 = D1/2(1, 1, · · · , 1)T .

P has an eigenvalue 1− λi , where λi is an eigenvalue of L.

The regularization of graph G :

FTLF = 12

∑ni=1

∑nj=1

(fi√dii− fj√

djj

)2.

For weighted graph G , Laplacian and normalized Laplacian canbe defined in a same manner.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 12 / 41

Page 29: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Random Walk and Laplacian

Normalized Laplacian of graph

Definition

Given a graph G , normailized Laplacian of G : L = D−1/2LD−1/2,

i.e., L(u, v) =

1, if u = v ;− 1√

dudv, if u and v are adjacent ;

0, otherwise.

L = I − D−1/2AD−1/2 = D1/2(I − P)D−1/2. Thus, L ispositive semidefinite and 0 ≤ λ(L) ≤ 2.

L is singular and symmetric, and λ0 = 0 corresponding toeigenvector D1/2vT0 = D1/2(1, 1, · · · , 1)T .

P has an eigenvalue 1− λi , where λi is an eigenvalue of L.

The regularization of graph G :

FTLF = 12

∑ni=1

∑nj=1

(fi√dii− fj√

djj

)2.

For weighted graph G , Laplacian and normalized Laplacian canbe defined in a same manner.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 12 / 41

Page 30: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Representing Graphs Random Walk and Laplacian

Normalized Laplacian of graph

Definition

Given a graph G , normailized Laplacian of G : L = D−1/2LD−1/2,

i.e., L(u, v) =

1, if u = v ;− 1√

dudv, if u and v are adjacent ;

0, otherwise.

L = I − D−1/2AD−1/2 = D1/2(I − P)D−1/2. Thus, L ispositive semidefinite and 0 ≤ λ(L) ≤ 2.

L is singular and symmetric, and λ0 = 0 corresponding toeigenvector D1/2vT0 = D1/2(1, 1, · · · , 1)T .

P has an eigenvalue 1− λi , where λi is an eigenvalue of L.

The regularization of graph G :

FTLF = 12

∑ni=1

∑nj=1

(fi√dii− fj√

djj

)2.

For weighted graph G , Laplacian and normalized Laplacian canbe defined in a same manner.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 12 / 41

Page 31: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Isomorphism of Graphs

Isomorphism of graphs

Definition

The simple graphs G1 = (V1,E1) and G2 = (V2,E2) are isomorphicif there exists a one to- one and onto function f from V1 to V2 withthe property that a and b are adjacent in G1 if and only if f (a) andf (b) are adjacent in G2, for all a and b in V1. Such a function f iscalled an isomorphism.

When two simple graphs are isomorphic, there is a one-to-onecorrespondence between vertices of the two graphs thatpreserves the adjacency relationship.

Isomorphism of simple graphs is an equivalence relation.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 13 / 41

Page 32: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Isomorphism of Graphs

Isomorphism of graphs

Definition

The simple graphs G1 = (V1,E1) and G2 = (V2,E2) are isomorphicif there exists a one to- one and onto function f from V1 to V2 withthe property that a and b are adjacent in G1 if and only if f (a) andf (b) are adjacent in G2, for all a and b in V1. Such a function f iscalled an isomorphism.

When two simple graphs are isomorphic, there is a one-to-onecorrespondence between vertices of the two graphs thatpreserves the adjacency relationship.

Isomorphism of simple graphs is an equivalence relation.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 13 / 41

Page 33: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Isomorphism of Graphs

Isomorphism of graphs

Definition

The simple graphs G1 = (V1,E1) and G2 = (V2,E2) are isomorphicif there exists a one to- one and onto function f from V1 to V2 withthe property that a and b are adjacent in G1 if and only if f (a) andf (b) are adjacent in G2, for all a and b in V1. Such a function f iscalled an isomorphism.

When two simple graphs are isomorphic, there is a one-to-onecorrespondence between vertices of the two graphs thatpreserves the adjacency relationship.

Isomorphism of simple graphs is an equivalence relation.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 13 / 41

Page 34: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Isomorphism of Graphs

Example

Show that the graphs G = (V ,E )and H = (W ,F ), displayed in thefigure, are isomorphic.

u1 → v1

u2 → v4

u3 → v3

u4 → v2

It is often difficult to determine whether two simple graphs are iso-morphic. There are n! possible one-to-one correspondences betweenthe vertex sets of two simple graphs with n vertices.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 14 / 41

Page 35: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Isomorphism of Graphs

Example

Show that the graphs G = (V ,E )and H = (W ,F ), displayed in thefigure, are isomorphic.

u1 → v1

u2 → v4

u3 → v3

u4 → v2

It is often difficult to determine whether two simple graphs are iso-morphic. There are n! possible one-to-one correspondences betweenthe vertex sets of two simple graphs with n vertices.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 14 / 41

Page 36: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Isomorphism of Graphs

How to determine?

A property preserved by isomorphism of graphs is called a graphinvariant.

The same number of vertices;

The same number of edges;

The same degree for the same vertex.

Determine whether the graphsdisplayed in the figure are isomorphicor not.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 15 / 41

Page 37: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Isomorphism of Graphs

How to determine? Cont’d

Question: Determine whetherthe graphs displayed in the figureare isomorphic or not.

Solution: Note that becausedeg(a) = 2 in G , a mustcorrespond to either t, u, x , or yin H, because these are thevertices of degree two in H.However, each of these fourvertices in H is adjacent toanother vertex of degree two inH, which is not true for a in G .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 16 / 41

Page 38: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Isomorphism of Graphs

How to determine? Cont’d

Question: Determine whetherthe graphs displayed in the figureare isomorphic or not.Solution: Note that becausedeg(a) = 2 in G , a mustcorrespond to either t, u, x , or yin H, because these are thevertices of degree two in H.

However, each of these fourvertices in H is adjacent toanother vertex of degree two inH, which is not true for a in G .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 16 / 41

Page 39: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Isomorphism of Graphs

How to determine? Cont’d

Question: Determine whetherthe graphs displayed in the figureare isomorphic or not.Solution: Note that becausedeg(a) = 2 in G , a mustcorrespond to either t, u, x , or yin H, because these are thevertices of degree two in H.However, each of these fourvertices in H is adjacent toanother vertex of degree two inH, which is not true for a in G .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 16 / 41

Page 40: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Isomorphism of Graphs

How to determine? Cont’d

Question: Determine whetherthe graphs displayed in the figureare isomorphic or not.Solution: Note that becausedeg(a) = 2 in G , a mustcorrespond to either t, u, x , or yin H, because these are thevertices of degree two in H.However, each of these fourvertices in H is adjacent toanother vertex of degree two inH, which is not true for a in G .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 16 / 41

Page 41: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Isomorphism of Graphs

Find an efficient way to determine

Question: Determine whether the graphs displayed in the figure areisomorphic or not.

Solution:

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 17 / 41

Page 42: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Isomorphism of Graphs

Find an efficient way to determine

Question: Determine whether the graphs displayed in the figure areisomorphic or not.Solution:

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 17 / 41

Page 43: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Paths

Paths in undirected graphs

Definition

Let n be a nonnegative integer and G a directed graph. A path oflength n from u to v in G is a sequence of n edges e1, · · · , en of Gsuch that ei is associated with (xi−1, xi ) for i = 1, 2, · · · , n, wherex0 = u and xn = v .

When there are no multiple edges in the directed graph, this path isdenoted by its vertex sequence x0, x1, x2, · · · , xn. A path of lengthgreater than zero that begins and ends at the same vertex is calleda circuit or cycle.A path or circuit is called simple if it does not contain the same edgemore than once.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 18 / 41

Page 44: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Paths

Paths in undirected graphs

Definition

Let n be a nonnegative integer and G a directed graph. A path oflength n from u to v in G is a sequence of n edges e1, · · · , en of Gsuch that ei is associated with (xi−1, xi ) for i = 1, 2, · · · , n, wherex0 = u and xn = v .When there are no multiple edges in the directed graph, this path isdenoted by its vertex sequence x0, x1, x2, · · · , xn. A path of lengthgreater than zero that begins and ends at the same vertex is calleda circuit or cycle.

A path or circuit is called simple if it does not contain the same edgemore than once.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 18 / 41

Page 45: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Paths

Paths in undirected graphs

Definition

Let n be a nonnegative integer and G a directed graph. A path oflength n from u to v in G is a sequence of n edges e1, · · · , en of Gsuch that ei is associated with (xi−1, xi ) for i = 1, 2, · · · , n, wherex0 = u and xn = v .When there are no multiple edges in the directed graph, this path isdenoted by its vertex sequence x0, x1, x2, · · · , xn. A path of lengthgreater than zero that begins and ends at the same vertex is calleda circuit or cycle.A path or circuit is called simple if it does not contain the same edgemore than once.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 18 / 41

Page 46: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Paths

Example

In the simple graph, a, d , c , f , e is asimple path of length 4, because{a, d}, {d , c}, {c , f }, and {f , e} areall edges.

However, d , e, c , a is not a path,because {e, c} is not an edge.Note that b, c , f , e, b is a circuit oflength 4 because {b, c}, {c , f },{f , e}, and {e, b} are edges, and thispath begins and ends at b.The path a, b, e, d , a, b, which is oflength 5, is not simple because itcontains the edge {a, b} twice.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 19 / 41

Page 47: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Paths

Example

In the simple graph, a, d , c , f , e is asimple path of length 4, because{a, d}, {d , c}, {c , f }, and {f , e} areall edges.However, d , e, c , a is not a path,because {e, c} is not an edge.

Note that b, c , f , e, b is a circuit oflength 4 because {b, c}, {c , f },{f , e}, and {e, b} are edges, and thispath begins and ends at b.The path a, b, e, d , a, b, which is oflength 5, is not simple because itcontains the edge {a, b} twice.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 19 / 41

Page 48: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Paths

Example

In the simple graph, a, d , c , f , e is asimple path of length 4, because{a, d}, {d , c}, {c , f }, and {f , e} areall edges.However, d , e, c , a is not a path,because {e, c} is not an edge.Note that b, c , f , e, b is a circuit oflength 4 because {b, c}, {c , f },{f , e}, and {e, b} are edges, and thispath begins and ends at b.

The path a, b, e, d , a, b, which is oflength 5, is not simple because itcontains the edge {a, b} twice.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 19 / 41

Page 49: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Paths

Example

In the simple graph, a, d , c , f , e is asimple path of length 4, because{a, d}, {d , c}, {c , f }, and {f , e} areall edges.However, d , e, c , a is not a path,because {e, c} is not an edge.Note that b, c , f , e, b is a circuit oflength 4 because {b, c}, {c , f },{f , e}, and {e, b} are edges, and thispath begins and ends at b.The path a, b, e, d , a, b, which is oflength 5, is not simple because itcontains the edge {a, b} twice.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 19 / 41

Page 50: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Paths

Paths in directed graphs

Definition

Let n be a nonnegative integer and G an undirected graph. A pathof length n from u to v in G is a sequence of n edges e1, · · · , en ofG for which there exists a sequence x0 = u, x1, · · · , xn−1, xn = v ofvertices such that ei has, for i = 1, · · · , n, the endpoints xi−1 and xi .When the graph is simple, we denote this path by its vertex sequencex0, x1, · · · , xn (because listing these vertices uniquely determines thepath).

The path is a circuit if it begins and ends at the same vertex, thatis, if u = v , and has length greater than zero. The path or circuitis said to pass through the vertices x1, x2, · · · , xn−1 or traverse theedges e1, · · · , en.A path or circuit is simple if it does not contain the same edge morethan once.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 20 / 41

Page 51: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Paths

Paths in directed graphs

Definition

Let n be a nonnegative integer and G an undirected graph. A pathof length n from u to v in G is a sequence of n edges e1, · · · , en ofG for which there exists a sequence x0 = u, x1, · · · , xn−1, xn = v ofvertices such that ei has, for i = 1, · · · , n, the endpoints xi−1 and xi .When the graph is simple, we denote this path by its vertex sequencex0, x1, · · · , xn (because listing these vertices uniquely determines thepath).The path is a circuit if it begins and ends at the same vertex, thatis, if u = v , and has length greater than zero. The path or circuitis said to pass through the vertices x1, x2, · · · , xn−1 or traverse theedges e1, · · · , en.

A path or circuit is simple if it does not contain the same edge morethan once.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 20 / 41

Page 52: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Paths

Paths in directed graphs

Definition

Let n be a nonnegative integer and G an undirected graph. A pathof length n from u to v in G is a sequence of n edges e1, · · · , en ofG for which there exists a sequence x0 = u, x1, · · · , xn−1, xn = v ofvertices such that ei has, for i = 1, · · · , n, the endpoints xi−1 and xi .When the graph is simple, we denote this path by its vertex sequencex0, x1, · · · , xn (because listing these vertices uniquely determines thepath).The path is a circuit if it begins and ends at the same vertex, thatis, if u = v , and has length greater than zero. The path or circuitis said to pass through the vertices x1, x2, · · · , xn−1 or traverse theedges e1, · · · , en.A path or circuit is simple if it does not contain the same edge morethan once.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 20 / 41

Page 53: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Paths

Example

Paths in acquaintanceship graphs

In an acquaintanceship graph there is a path between two peopleif there is a chain of people linking these people, where two peopleadjacent in the chain know one another.

Paths in collaboration graphs

In a collaboration graph, two people a and b are connected by a pathwhen there is a sequence of people starting with a and ending withb such that the endpoints of each edge in the path are people whohave collaborated.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 21 / 41

Page 54: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Paths

Example

Paths in acquaintanceship graphs

In an acquaintanceship graph there is a path between two peopleif there is a chain of people linking these people, where two peopleadjacent in the chain know one another.

Paths in collaboration graphs

In a collaboration graph, two people a and b are connected by a pathwhen there is a sequence of people starting with a and ending withb such that the endpoints of each edge in the path are people whohave collaborated.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 21 / 41

Page 55: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in undirected graphs

Connectedness in undirected graphs

Definition

An undirected graph is called connected if there is a path betweenevery pair of distinct vertices of the graph.

An undirected graph that is not connected is called disconnected.

The first graph is connected,because for every pair of distinctvertices there is a path betweenthem.However, the second graph is notconnected. For instance, there isno path in the graph betweenvertices a and d .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 22 / 41

Page 56: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in undirected graphs

Connectedness in undirected graphs

Definition

An undirected graph is called connected if there is a path betweenevery pair of distinct vertices of the graph.An undirected graph that is not connected is called disconnected.

The first graph is connected,because for every pair of distinctvertices there is a path betweenthem.However, the second graph is notconnected. For instance, there isno path in the graph betweenvertices a and d .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 22 / 41

Page 57: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in undirected graphs

Connectedness in undirected graphs

Definition

An undirected graph is called connected if there is a path betweenevery pair of distinct vertices of the graph.An undirected graph that is not connected is called disconnected.

The first graph is connected,because for every pair of distinctvertices there is a path betweenthem.However, the second graph is notconnected. For instance, there isno path in the graph betweenvertices a and d .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 22 / 41

Page 58: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in undirected graphs

Connectedness in undirected graphs

Definition

An undirected graph is called connected if there is a path betweenevery pair of distinct vertices of the graph.An undirected graph that is not connected is called disconnected.

The first graph is connected,because for every pair of distinctvertices there is a path betweenthem.

However, the second graph is notconnected. For instance, there isno path in the graph betweenvertices a and d .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 22 / 41

Page 59: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in undirected graphs

Connectedness in undirected graphs

Definition

An undirected graph is called connected if there is a path betweenevery pair of distinct vertices of the graph.An undirected graph that is not connected is called disconnected.

The first graph is connected,because for every pair of distinctvertices there is a path betweenthem.However, the second graph is notconnected. For instance, there isno path in the graph betweenvertices a and d .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 22 / 41

Page 60: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in undirected graphs

Property

Theorem

There is a simple path between every pair of distinct vertices of aconnected undirected graph.

Proof.

Let u and v be two distinct vertices of the connected undirectedgraph G = (V ,E ).Because G is connected, there is at least one path between u and v .Let x0, x1, · · · , xn, where x0 = u and xn = v , be the vertex sequenceof a path of least length. This path of least length is simple.To see this, suppose it is not simple. Then xi = xj for some i and jwith 0 ≤ i < j . This means that there is a path from u to v ofshorter length with vertex sequence x0, x1, · · · , xi−1, xj , · · · , xnobtained by deleting the edges corresponding to the vertex sequencexi , · · · , xj−1.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 23 / 41

Page 61: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in undirected graphs

Property

Theorem

There is a simple path between every pair of distinct vertices of aconnected undirected graph.

Proof.

Let u and v be two distinct vertices of the connected undirectedgraph G = (V ,E ).Because G is connected, there is at least one path between u and v .Let x0, x1, · · · , xn, where x0 = u and xn = v , be the vertex sequenceof a path of least length. This path of least length is simple.

To see this, suppose it is not simple. Then xi = xj for some i and jwith 0 ≤ i < j . This means that there is a path from u to v ofshorter length with vertex sequence x0, x1, · · · , xi−1, xj , · · · , xnobtained by deleting the edges corresponding to the vertex sequencexi , · · · , xj−1.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 23 / 41

Page 62: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in undirected graphs

Property

Theorem

There is a simple path between every pair of distinct vertices of aconnected undirected graph.

Proof.

Let u and v be two distinct vertices of the connected undirectedgraph G = (V ,E ).Because G is connected, there is at least one path between u and v .Let x0, x1, · · · , xn, where x0 = u and xn = v , be the vertex sequenceof a path of least length. This path of least length is simple.To see this, suppose it is not simple. Then xi = xj for some i and jwith 0 ≤ i < j . This means that there is a path from u to v ofshorter length with vertex sequence x0, x1, · · · , xi−1, xj , · · · , xnobtained by deleting the edges corresponding to the vertex sequencexi , · · · , xj−1.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 23 / 41

Page 63: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in undirected graphs

Connected component

Definition

A connected component of a graph G is a connected subgraph ofG that is not a proper subgraph of another connected subgraph ofG .That is, a connected component of a graph G is a maximal connectedsubgraph of G .

The graph H is theunion of three disjointconnected subgraphsH1,H2, and H3. Thesethree subgraphs are theconnected componentsof H.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 24 / 41

Page 64: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in undirected graphs

Connected component

Definition

A connected component of a graph G is a connected subgraph ofG that is not a proper subgraph of another connected subgraph ofG .That is, a connected component of a graph G is a maximal connectedsubgraph of G .

The graph H is theunion of three disjointconnected subgraphsH1,H2, and H3. Thesethree subgraphs are theconnected componentsof H.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 24 / 41

Page 65: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in undirected graphs

Connected component

Definition

A connected component of a graph G is a connected subgraph ofG that is not a proper subgraph of another connected subgraph ofG .That is, a connected component of a graph G is a maximal connectedsubgraph of G .

The graph H is theunion of three disjointconnected subgraphsH1,H2, and H3. Thesethree subgraphs are theconnected componentsof H.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 24 / 41

Page 66: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in undirected graphs

Connected components of call graphs

Two vertices x and y are in the same component of a telephone callgraph when there is a sequence of telephone calls beginning at x andending at y .

When a call graph for telephone calls made during a particular dayin the AT&T network was analyzed, this graph was found to have

53,767,087 vertices, and more than 170 million edges;

More than 3.7 million connected components. Most of thesecomponents were small; approximately three-fourths consistedof two vertices representing pairs of telephone numbers thatcalled only each other.

This graph has one huge connected component with 44,989,297 ver-tices comprising more than 80% of the total (giant component).Furthermore, every vertex in this component can be linked to anyother vertex by a chain of no more than 20 calls.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 25 / 41

Page 67: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in undirected graphs

Connected components of call graphs

Two vertices x and y are in the same component of a telephone callgraph when there is a sequence of telephone calls beginning at x andending at y .When a call graph for telephone calls made during a particular dayin the AT&T network was analyzed, this graph was found to have

53,767,087 vertices, and more than 170 million edges;

More than 3.7 million connected components. Most of thesecomponents were small; approximately three-fourths consistedof two vertices representing pairs of telephone numbers thatcalled only each other.

This graph has one huge connected component with 44,989,297 ver-tices comprising more than 80% of the total (giant component).Furthermore, every vertex in this component can be linked to anyother vertex by a chain of no more than 20 calls.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 25 / 41

Page 68: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in undirected graphs

Connected components of call graphs

Two vertices x and y are in the same component of a telephone callgraph when there is a sequence of telephone calls beginning at x andending at y .When a call graph for telephone calls made during a particular dayin the AT&T network was analyzed, this graph was found to have

53,767,087 vertices, and more than 170 million edges;

More than 3.7 million connected components. Most of thesecomponents were small; approximately three-fourths consistedof two vertices representing pairs of telephone numbers thatcalled only each other.

This graph has one huge connected component with 44,989,297 ver-tices comprising more than 80% of the total (giant component).Furthermore, every vertex in this component can be linked to anyother vertex by a chain of no more than 20 calls.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 25 / 41

Page 69: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity How Connected is a Graph?

Network robustness

Motivations

In a phone call network, dense and frequent calls among usersin the network reduce the likelihood of churn.

In IP networks, service providers therefore aim to monitor,manage and optimize their networks to keep their networksrobust.

In social platforms, some external or internal events may bedetected from the burst of user interaction networks.

Existing measurements

Node connectivity and edge connectivity

Cheeger ratio, vertex expansion, and edge expansion

Algebraic connectivity and R-energy

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 26 / 41

Page 70: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity How Connected is a Graph?

Cut and bridge

Definition

Sometimes the removal from a graph of a vertex and all incident edgesproduces a subgraph with more connected components. Such verticesare called cut vertices (or articulation points). Analogously, an edgewhose removal produces a graph with more connected componentsthan in the original graph is called a cut edge or bridge.Note that not all graphs have cut vertices, e.g., Kn for n ≥ 3.

Question:Find the cut vertices and cut edgesin the left graph G .Solution:The cut vertices of G are b, c , and e.The cut edges are {a, b} and {c , e}.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 27 / 41

Page 71: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity How Connected is a Graph?

Cut and bridge

Definition

Sometimes the removal from a graph of a vertex and all incident edgesproduces a subgraph with more connected components. Such verticesare called cut vertices (or articulation points). Analogously, an edgewhose removal produces a graph with more connected componentsthan in the original graph is called a cut edge or bridge.Note that not all graphs have cut vertices, e.g., Kn for n ≥ 3.

Question:Find the cut vertices and cut edgesin the left graph G .Solution:The cut vertices of G are b, c , and e.The cut edges are {a, b} and {c , e}.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 27 / 41

Page 72: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity How Connected is a Graph?

Connectivity

Vertex connectivity or edge connectivity

Node connectivity (edge connectivity) v(G ) (ε(G )) of a network G isdefined by the minimum number of nodes (edges) that are removedto break the networks into multiple connected components.

The larger v(G ) or ε(G ) are, the moreconnected we consider G to be;

Disconnected graphs and K1 havev(G ) = ε(G ) = 0;

We say that a graph is k-connected (ork-vertex-connected), if v(G ) ≥ k;

v(G ) ≤ ε(G ) ≤ minv∈V deg(v).

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 28 / 41

Page 73: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity How Connected is a Graph?

Connectivity

Vertex connectivity or edge connectivity

Node connectivity (edge connectivity) v(G ) (ε(G )) of a network G isdefined by the minimum number of nodes (edges) that are removedto break the networks into multiple connected components.

The larger v(G ) or ε(G ) are, the moreconnected we consider G to be;

Disconnected graphs and K1 havev(G ) = ε(G ) = 0;

We say that a graph is k-connected (ork-vertex-connected), if v(G ) ≥ k;

v(G ) ≤ ε(G ) ≤ minv∈V deg(v).

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 28 / 41

Page 74: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity How Connected is a Graph?

Expander robustness

Definitions

Let G = (V ,E ) be a connected and undirected network.

∂(S) is the edge boundary of S (i.e., the set of edges withexactly one endpoint in S).

∂out(S) is the outer vertex boundary of S (i.e., the set ofvertices in V \S with at least one neighbor in S).

vol(S) is the total degree of all vertices in S .

Cheeger ratio: h(G ) = minS⊂V

|∂(S)|min{vol(S), vol(S)}

Vertex expansion: hv (G ) = minS⊂V ,0<|S |<|V |/2

|∂out(S)||S |

Edge expansion: he(G ) = minS⊂V ,0<|S|<|V |/2

|∂(S)||S |

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 29 / 41

Page 75: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity How Connected is a Graph?

Expander robustness

Definitions

Let G = (V ,E ) be a connected and undirected network.

∂(S) is the edge boundary of S (i.e., the set of edges withexactly one endpoint in S).

∂out(S) is the outer vertex boundary of S (i.e., the set ofvertices in V \S with at least one neighbor in S).

vol(S) is the total degree of all vertices in S .

Cheeger ratio: h(G ) = minS⊂V

|∂(S)|min{vol(S), vol(S)}

Vertex expansion: hv (G ) = minS⊂V ,0<|S |<|V |/2

|∂out(S)||S |

Edge expansion: he(G ) = minS⊂V ,0<|S|<|V |/2

|∂(S)||S |

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 29 / 41

Page 76: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity How Connected is a Graph?

Laplacian robustness

Algebraic connectivity

Algebraic connectivity λ(G ) is defined by the second smallest eigen-value of the Laplacian matrix of network G .

λ(G ) ≤ v(G ) ≤ ε(G ).

λ(G ) = 0 if G is disconnected.

R-energy

The robustness energy (R-energy) of G is defined as E (G ) =1

n−1∑n

i=2(λi−λ)2, where λi are eigenvalues of normalized Laplacian

of network G , and λ = 1n−1

∑ni=2 λi .

E (G ) = 1n−1

∑ni=1

∑nj 6=i

Aij

d(vi )d(vj )− n

(n−1)2 (smaller is better).

E (G ) is reasonable robustness metric to evaluate adisconnected network.

E (G ) can be efficiently computed in O(|V |+ |E |).MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 30 / 41

Page 77: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity How Connected is a Graph?

Example of network robustness metrics

Analysis

The table illustrates that they are unreasonable to evaluate therobustness of networks.

The R-energies of networks shown in Figures (a) and (b) are0.222 and 0.074, respectively. Thus, R-energy is morereasonable.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 31 / 41

Page 78: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity How Connected is a Graph?

R-energy: application I

Analysis

Networks become less robust sooner when vertices of thehighest degrees are removed.

Networks remain robust or become slightly more robust whenvertices of the smallest degrees are removed.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 32 / 41

Page 79: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity How Connected is a Graph?

R-energy: application II

Analysis

On June 28, the top three words from retweets with highestfrequency difference are “tax”, “Obamacar” and “scotu”.Actually, the Obamacare healthcare law was upheld by theSupreme Court of United States, and there were concernsabout tax increase as its outcome.

Twitter goes down in worst crash in 8 months on July 20.MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 33 / 41

Page 80: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in Directed Graphs

Strongly and weakly connected

Definition

A directed graph is strongly connected if there is a path from a tob and from b to a whenever a and b are vertices in the graph.

A directed graph is weakly connected if there is a path betweenevery two vertices in the underlying undirected graph.

Are the directed graphs G and H shown infigure strongly connected? Are they weaklyconnected?

The maximal strongly connected subgraphs,are called the strongly connected componentsor strong components of G .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 34 / 41

Page 81: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in Directed Graphs

Strongly and weakly connected

Definition

A directed graph is strongly connected if there is a path from a tob and from b to a whenever a and b are vertices in the graph.A directed graph is weakly connected if there is a path betweenevery two vertices in the underlying undirected graph.

Are the directed graphs G and H shown infigure strongly connected? Are they weaklyconnected?

The maximal strongly connected subgraphs,are called the strongly connected componentsor strong components of G .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 34 / 41

Page 82: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in Directed Graphs

Strongly and weakly connected

Definition

A directed graph is strongly connected if there is a path from a tob and from b to a whenever a and b are vertices in the graph.A directed graph is weakly connected if there is a path betweenevery two vertices in the underlying undirected graph.

Are the directed graphs G and H shown infigure strongly connected? Are they weaklyconnected?

The maximal strongly connected subgraphs,are called the strongly connected componentsor strong components of G .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 34 / 41

Page 83: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in Directed Graphs

Giant component

Giant component

A connected component that contains asignificant fraction of all the nodes.

When a network (e.g., friendshipnetwork) contains a giant component,it almost always contains only one.

The other connected components arevery small by comparison.

The largest connected componentwould break apart into three distinctcomponents if this node were removed[related to robustness of network].

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 35 / 41

Page 84: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in Directed Graphs

Giant component

Giant component

A connected component that contains asignificant fraction of all the nodes.

When a network (e.g., friendshipnetwork) contains a giant component,it almost always contains only one.

The other connected components arevery small by comparison.

The largest connected componentwould break apart into three distinctcomponents if this node were removed[related to robustness of network].

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 35 / 41

Page 85: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in Directed Graphs

Giant component

Giant component

A connected component that contains asignificant fraction of all the nodes.

When a network (e.g., friendshipnetwork) contains a giant component,it almost always contains only one.

The other connected components arevery small by comparison.

The largest connected componentwould break apart into three distinctcomponents if this node were removed[related to robustness of network].

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 35 / 41

Page 86: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in Directed Graphs

Giant component

Giant component

A connected component that contains asignificant fraction of all the nodes.

When a network (e.g., friendshipnetwork) contains a giant component,it almost always contains only one.

The other connected components arevery small by comparison.

The largest connected componentwould break apart into three distinctcomponents if this node were removed[related to robustness of network].

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 35 / 41

Page 87: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in Directed Graphs

Giant component

Giant component

A connected component that contains asignificant fraction of all the nodes.

When a network (e.g., friendshipnetwork) contains a giant component,it almost always contains only one.

The other connected components arevery small by comparison.

The largest connected componentwould break apart into three distinctcomponents if this node were removed[related to robustness of network].

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 35 / 41

Page 88: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in Directed Graphs

Web giant component

Web graph

Web contains a giant stronglyconnected component (containinghome pages of many of the majorcommercial, governmental, andnonprofit organizations)

IN: nodes that can reach thegiant SCC but cannot bereached from it, i.e., nodes thatare “upstream” of it.

OUT: nodes that can bereached from the giant SCC butcannot reach it, i.e., nodes are“downstream” of it.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 36 / 41

Page 89: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Connectedness in Directed Graphs

Web giant component

Web graph

Web contains a giant stronglyconnected component (containinghome pages of many of the majorcommercial, governmental, andnonprofit organizations)

IN: nodes that can reach thegiant SCC but cannot bereached from it, i.e., nodes thatare “upstream” of it.

OUT: nodes that can bereached from the giant SCC butcannot reach it, i.e., nodes are“downstream” of it.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 36 / 41

Page 90: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Paths and Isomorphism

Paths and isomorphis

Paths and circuits can determine whether two graphs are isomorphic.

The existence of a simple circuit of a particularlength is a useful invariant;

Paths can be used to construct mappings that maybe isomorphisms;

The paths u1, u4, u3, u2, u5 in G and v3, v2, v1, v5,v4 in H both go through every vertex in the graph;

f (u1) = v3

f (u4) = v2

f (u3) = v1

f (u2) = v5

f (u5) = v4.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 37 / 41

Page 91: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Paths and Isomorphism

Paths and isomorphis

Paths and circuits can determine whether two graphs are isomorphic.

The existence of a simple circuit of a particularlength is a useful invariant;

Paths can be used to construct mappings that maybe isomorphisms;

The paths u1, u4, u3, u2, u5 in G and v3, v2, v1, v5,v4 in H both go through every vertex in the graph;

f (u1) = v3

f (u4) = v2

f (u3) = v1

f (u2) = v5

f (u5) = v4.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 37 / 41

Page 92: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Counting Paths Between Vertices

Counting paths between vertices

Theorem

Let G be a graph with adjacency matrix A with respect to the or-dering v1, v2, · · · , vn of the vertices of the graph (with directed orundirected edges, with multiple edges and loops allowed). The num-ber of different paths of length r from vi to vj equals the (i , j)−thentry of Ar for r ∈ Z+.

Proof.

Basic step:Let G be a graph with adjacency matrix A. The number of pathsfrom vi to vj of length 1 is the (i , j)−th entry of A, because thisentry is the number of edges from vi to vj .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 38 / 41

Page 93: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Counting Paths Between Vertices

Counting paths between vertices

Theorem

Let G be a graph with adjacency matrix A with respect to the or-dering v1, v2, · · · , vn of the vertices of the graph (with directed orundirected edges, with multiple edges and loops allowed). The num-ber of different paths of length r from vi to vj equals the (i , j)−thentry of Ar for r ∈ Z+.

Proof.

Basic step:Let G be a graph with adjacency matrix A. The number of pathsfrom vi to vj of length 1 is the (i , j)−th entry of A, because thisentry is the number of edges from vi to vj .

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 38 / 41

Page 94: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Counting Paths Between Vertices

Proof Cont’d

Inductive step:Assume that the (i , j)−th entry of Ar is the number of different pathsof length r from vi to vj . This is the inductive hypothesis. BecauseAr+1 = Ar · A, the (i , j)−th entry of Ar+1 equals

bi1a1j + bi2a2j + · · ·+ binanj ,

where bik is the (i , k)−th entry of Ar . By the inductive hypothesis,bik is the number of paths of length r from vi to vk .

A path of length r + 1 from vi to vj is made up of a path of length rfrom vi to some intermediate vertex vk , and an edge from vk to vj .By the product rule for counting, the number of such paths is theproduct of the number of paths of length r from vi to vk , namely,bik , and the number of edges from vk to vj , namely, akj . Whenthese products are added for all possible intermediate vertices vk ,the desired result follows by the sum rule for counting.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 39 / 41

Page 95: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Counting Paths Between Vertices

Proof Cont’d

Inductive step:Assume that the (i , j)−th entry of Ar is the number of different pathsof length r from vi to vj . This is the inductive hypothesis. BecauseAr+1 = Ar · A, the (i , j)−th entry of Ar+1 equals

bi1a1j + bi2a2j + · · ·+ binanj ,

where bik is the (i , k)−th entry of Ar . By the inductive hypothesis,bik is the number of paths of length r from vi to vk .A path of length r + 1 from vi to vj is made up of a path of length rfrom vi to some intermediate vertex vk , and an edge from vk to vj .

By the product rule for counting, the number of such paths is theproduct of the number of paths of length r from vi to vk , namely,bik , and the number of edges from vk to vj , namely, akj . Whenthese products are added for all possible intermediate vertices vk ,the desired result follows by the sum rule for counting.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 39 / 41

Page 96: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Counting Paths Between Vertices

Proof Cont’d

Inductive step:Assume that the (i , j)−th entry of Ar is the number of different pathsof length r from vi to vj . This is the inductive hypothesis. BecauseAr+1 = Ar · A, the (i , j)−th entry of Ar+1 equals

bi1a1j + bi2a2j + · · ·+ binanj ,

where bik is the (i , k)−th entry of Ar . By the inductive hypothesis,bik is the number of paths of length r from vi to vk .A path of length r + 1 from vi to vj is made up of a path of length rfrom vi to some intermediate vertex vk , and an edge from vk to vj .By the product rule for counting, the number of such paths is theproduct of the number of paths of length r from vi to vk , namely,bik , and the number of edges from vk to vj , namely, akj .

Whenthese products are added for all possible intermediate vertices vk ,the desired result follows by the sum rule for counting.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 39 / 41

Page 97: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Counting Paths Between Vertices

Proof Cont’d

Inductive step:Assume that the (i , j)−th entry of Ar is the number of different pathsof length r from vi to vj . This is the inductive hypothesis. BecauseAr+1 = Ar · A, the (i , j)−th entry of Ar+1 equals

bi1a1j + bi2a2j + · · ·+ binanj ,

where bik is the (i , k)−th entry of Ar . By the inductive hypothesis,bik is the number of paths of length r from vi to vk .A path of length r + 1 from vi to vj is made up of a path of length rfrom vi to some intermediate vertex vk , and an edge from vk to vj .By the product rule for counting, the number of such paths is theproduct of the number of paths of length r from vi to vk , namely,bik , and the number of edges from vk to vj , namely, akj . Whenthese products are added for all possible intermediate vertices vk ,the desired result follows by the sum rule for counting.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 39 / 41

Page 98: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Counting Paths Between Vertices

Example

How many paths of length four are there from a to d in the simplegraph G in following figure?

The adjacency matrix of G (ordering the verticesas a, b, c, d) is

A =

0 1 1 01 0 0 11 0 0 10 1 1 0

,A4 =

8 0 0 80 8 8 00 8 8 08 0 0 8

.

Hence, the number of paths of length four from ato d is the (1, 4)−th entry of A4.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 40 / 41

Page 99: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Counting Paths Between Vertices

Example

How many paths of length four are there from a to d in the simplegraph G in following figure?

The adjacency matrix of G (ordering the verticesas a, b, c, d) is

A =

0 1 1 01 0 0 11 0 0 10 1 1 0

,A4 =

8 0 0 80 8 8 00 8 8 08 0 0 8

.

Hence, the number of paths of length four from ato d is the (1, 4)−th entry of A4.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 40 / 41

Page 100: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Connectivity Counting Paths Between Vertices

Example

How many paths of length four are there from a to d in the simplegraph G in following figure?

The adjacency matrix of G (ordering the verticesas a, b, c, d) is

A =

0 1 1 01 0 0 11 0 0 10 1 1 0

,A4 =

8 0 0 80 8 8 00 8 8 08 0 0 8

.

Hence, the number of paths of length four from ato d is the (1, 4)−th entry of A4.

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 40 / 41

Page 101: Discrete Mathematics and Its Applicationsdase.ecnu.edu.cn/.../DM_2019_Fall/slides/7_graph_72.pdf · 2019-12-03 · Outline 1 Representing Graphs Adjacency Matrices Incidence Matrices

Take-aways

Take-aways

Conclusions

Representing Graphs

Adjacency MatricesIncidence MatricesRandom walk and Laplacian

isomorphism of Graphs

Connectivity

Vertex ConnectivityEdge Connectivity

Connectivity

PathsConnectedness in undirected graphsHow Connected is a Graph?Connectedness in Directed GraphsPaths and IsomorphismCounting Paths Between Vertices

MING GAO (DaSE@ECNU) Discrete Mathematics and Its Applications Dec. 23, 2019 41 / 41