Unit 5 Machine
Unit 5 Machine
JIATONG LI (LOGEN)
Contents
1. Introduction 1
2. Basic Definitions and Notations 2
3. Properties of Graph Networks 3
4. Random Graph Model 5
5. Small World Phenomenon 6
6. Application 8
6.1. Analyzing Degree Distribution of Random Graph Model 8
6.2. Analyzing Clustering Coefficient of Random Graph Model 8
6.3. Application of Graph Theory in Computer Science 8
7. Acknowledgements 9
References 9
1. Introduction
A graph is a structure which contains a set of objects - vertices and edges. A
basic example is when we connect two vertices with a line, we create a simple graph.
However, such a simple network can quickly become very complex to analyze as
the number of vertices and edges increases. To simulate what’s happening, we use
a random graph as a model in this paper. We will also explore some extensions of
random graph model such as small world phenomenon.
We begin with basic definitions and notations of graph theory. Section 3 will
introduce four important properties of graph networks: degree distribution, path
length, clustering coefficient, and connected component. Then we apply the knowl-
edge from Section 2 and Section 3 to analyze Erdos-Renyi random graph. Next, we
discuss the small world phenomenon - the principle that we are all connected by
our nearby neighbors. Finally, we zoom out and briefly mention the application of
graph theory in other subjects such as engineering.
1
A BRIEF OVERVIEW OF GRAPH THEORY
Figure 1
Definition 2.4. The degree of a vertex is the number of edges that are connected
to that vertex. When the degree of v is 5, we write as deg(v) = 5. The minimum
degree of G is symbolized by δ(G), and the maximum degree is symbolized by ∆(G).
Definition 2.5. The degree sequence of G is a list of degrees of all vertices. By
convention, we list them in a nonincreasing order.
Theorem 2.6. The sum of the degrees of all vertices is twice the size of the graph.
X
deg (vi ) = 2|E(G)|
Lemma2.12.
The maximum number of edges in a connected graph H equals to
N
Emax = .
2
A BRIEF OVERVIEW OF GRAPH THEORY
Figure 2
Proof. The proof is relatively intuitive. The maximum number equals to “N choose
2” (choose 2 vertices among N vertices).
Definition 2.13. A walk is a finite number of sequences in the form of v0 v1 , v1 v2 ,
· · · , vm−1 vm . One can also write v0 → v1 → v2 → · · · . By definition, v0 is called
the initial vertex, and vm is called the final vertex. The number of edges in the
walk is called length.
Definition 2.14. In Definition 2.13, if the vertices are distinct, then the walk can
be called a path. Moreover, when v0 = vm , the walk is a cycle.
Definition 2.15. An undirected graph means the edge is bidirectional. By con-
trast, if the edge of a graph points to a specific direction, it is called directed graph.
Figure 3
Definition 3.3. The distance between a pair of nodes is defined as the shortest
path connecting the nodes. If two nodes are not connected, the distance is defined
as infinite.
Example 3.4. In Figure 4, h12 = 2 and h13 = 3.
2ei
Definition 3.5. We define the clustering coefficient of a graph as Ci =
ki (ki − 1)
where ki is a degree of node i and ei is the number of edges among the adjacent
vertices of node i.
ki (ki − 1)
Remark 3.6. In Definition 3.5, we should notice that is the maximum
2
number of edges among the adjacent vertices of node i. Note that Ci ∈ [0, 1].
Figure 6
Example 3.7. In Figure 6, the vertex set of the graph G(V, E) is V (G) = {0, 1, 2, 3, 4, 5, 6, 7, 8}.
The graph G contains two subgraphs G1 and G2 where V (G1 ) = {0, 1, 2, 3, 4, 5} and
V (G2 ) = {6, 7, 8}. Since G2 contains more elements, it is the largest component of
graph G.
A BRIEF OVERVIEW OF GRAPH THEORY
Remark 3.8. In computer science, there is a special type of algorithm called Depth-
first search (DFS) which can calculate the number of connected components in a
given graph.
Algorithm 1: Finding the number of connected components using DFS
input : An undirected graph G(V, E)
output: An int value which indicates the number of connected components
count = 0;
for each vertex k ∈ V do
Visited[k] = false;
end
/* Initialize all nodes to status "unvisited" */
for each vertex k ∈ V do
Visited[k] = false;
if Visited[k]==false then
DF S(V, k);
count = count + 1;
end
end
Print count;
/* Recursively enumerate all nodes and count the number of connected component
*/
DF S(V, k) function: Visited[k] = true;
for each vertex q ∈ adjacent − neighbor − V [k] do
if Visited[q] == false then
DF S(V, q);
end
end
Proof. Let N (n, Nc ) denote the number of connected graph, which is equal to the
number of graphs of type A without isolated points.
n n−k
X n
N (n, Nc ) = (−1)k 2
k
k=0 Nc
A BRIEF OVERVIEW OF GRAPH THEORY
Thus we obtain
∞
X (−1)k e−2kc
N (n, Nc ) −2c
lim = = e−e
n→∞ n k!
k=0
2
Nc
Theorem 4.2. Define Pk (n, Nc ) as the probability that the greatest connected com-
ponent of Tn,N which contains exactly n − k effective points. Then we have
k −2c
e−2c e−e
lim Pk (n, Nc ) =
n→∞ k!
Proof. Suppose the graph has k isolated points and n − k effective points. It follows
that
n−k
n 2
Pk (n, Nc ) ∼ P0 (n − k, Nc ) .
k n
2
Nc
For a fixed value k, we have
Nc − 21 (n − k) log(n − k)
lim =c
n→∞ n−k
Combined with Theorem 1, the theorem is proved.
Theorem 4.3. Let Πk (n, Nc ) denote the probability of Tn,Nc consisting exactly
k + 1 connected components. Then
k 2c
e−2c e−e
lim Πk (n, Nc ) =
n→+∞ k!
Proof. The proof of the theorem is out of scope of this paper. Detailed proof of
Theorem 4.3 can be found in [1].
Xf ullsearch = X1 + X2 + · · · + Xlog n
1 1
Z ≤2 1+ +
2 3
Therefore, assuming n is even,
Z k !
1 1 1 1 1
Z ≤ 2 1 + + + + ··· + ≤2 1+ dx = 2 (1 + ln k)
2 3 4 n/2 1 x
6. Application
6.1. Analyzing Degree Distribution of Random Graph Model.
We already introduced the definition of degree distribution in Definition 3.1.
Now we can use it to analyze the degree distribution of a random graph. Let P (k)
represents the fraction of nodes with degree k. Then
n−1
P (k) = pk (1 − p)n−1−k
k
Notice the degree distribution is binomial. We can come up with the mean and
variance of a binomial distribution easily as follows.
k̄ = p(n − 1)
σ 2 = p(1 − p)(n − 1)
ki (ki − 1)
E[ei ] = p
2
Plug in ei into the equation in Definition 3.5, we have
p · ki (ki − 1)
E[Ci ] = =p
ki (ki − 1)
7. Acknowledgements
It is my great pleasure to thank my advisor Sehyun Ji for all the help during the
REU program. Sehyun is extremely helpful in helping me understand the weekly
challenge problems and graph theory. I also want to thank Peter May for organizing
the REU program.
References
[1] P. Erdos, A. Renyi, On Random Graphs I, Publ. Math. Debrecen, 1959.
[2] David Easley, Jon Kleinberg, Networks, Crowds, and Markets: Reasoning about a Highly
Connected World, Cambridge University Press, 2010.
[3] Robin J. Wilson, Introduction to Graph Theory, Prentice Hall, 1996.
[4] https://www.baeldung.com/cs/graph-connected-components
[5] snap.stanford.edu/class/cs224w-2019/