0% found this document useful (0 votes)
34 views

Mathematical Foundations of Computer Science Lecture Outline

1) A graph consists of vertices and edges that connect pairs of vertices. Properties like degree, minimum degree, and maximum degree are defined based on the number of edges incident to each vertex. 2) Two common examples are proved: the sum of degrees is twice the number of edges, and the number of vertices of odd degree is even. 3) Basic graph concepts like walks, paths, cycles, connectedness, and connected components are defined. 4) Two additional examples are proved by induction: every graph with n vertices and m edges has at least n - m connected components, and every connected graph with n vertices has at least n - 1 edges.

Uploaded by

Chenyang Fang
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Mathematical Foundations of Computer Science Lecture Outline

1) A graph consists of vertices and edges that connect pairs of vertices. Properties like degree, minimum degree, and maximum degree are defined based on the number of edges incident to each vertex. 2) Two common examples are proved: the sum of degrees is twice the number of edges, and the number of vertices of odd degree is even. 3) Basic graph concepts like walks, paths, cycles, connectedness, and connected components are defined. 4) Two additional examples are proved by induction: every graph with n vertices and m edges has at least n - m connected components, and every connected graph with n vertices has at least n - 1 edges.

Uploaded by

Chenyang Fang
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Mathematical Foundations of Computer Science

Lecture Outline
October 2, 2018

Graphs
A graph consists of two sets, a non-empty set, V , of vertices or nodes, and a possibly
empty set, E, of 2-element subsets of V . Such is graph is denoted by G = (V, E). Each
element of E is called an edge. We say that an edge {u, v} ∈ E connects vertices u and
v. Two nodes u and v are adjacent if {u, v} ∈ E. Nodes adjacent to a vertex u are called
neighbors of u. The number of neighbors of a vertex v is called the degree of v and is
denoted by deg(v). The value δ(G) = minv∈V {deg(v)} is the minimum degree of G, the
value ∆(G) = maxv∈V {deg(v)} is the maximum degree of G. An edge that connects a node
to itself is called a loop and multiple edges between the same pair of nodes are called parallel
edges. Graphs without loops and parallel edges are called simple graphs, otherwise they
are called multigraphs. Unless specified otherwise, we will only deal with simple graphs.

Example. Prove that the sum of degrees of all nodes in a graph is twice the number of
edges.

Solution. Since each edge is incident to exactly two vertices, each edge contributes two to
the sum of degrees of the vertices. The claim follows.

Example. In any graph there are an even number of vertices of odd degree.

Solution. Let Ve and Vo be the set of vertices with even degree and the set of vertices with
odd degree respectively in a graph G = (V, E). Then,
X X X
deg(v) = deg(v) + deg(v)
v∈V v∈Ve v∈Vo

The first term on R.H.S. is even since each vertex in Ve has an even degree. From the
previous example, we know that L.H.S. of the above equation is even. Thus the second
term on the R.H.S. must be even. Let |Vo | = `. We want to show that ` is even. Since each
vertex in Vo has odd degree, we have

(2k1 + 1) + (2k2 + 1) + · · · + (2k` + 1) is an even number


2(k1 + k2 + · · · + k` ) + ` is an even number
∴ ` is an even number

This proves the claim.


2 Lecture Outline October 2, 2018

A walk in G is a non-empty sequence v0 e0 v1 e1 . . . ek−1 vk of vertices and edges in G such


that ei = {vi , vi+1 } for all i < k. If the vertices in a walk are all distinct, we call it a path
in G. Thus, a path in G is a sequence of distinct vertices v0 , v1 , v2 , . . . vk such that for all i,
0 ≤ i < k, {vi , vi+1 } ∈ E. The length of the walk (path) is k, the number of edges in the
walk (resp. path). Note that the length of the walk (path) is one less than the number of
vertices in the walk (path) sequence. If vo = vk , the walk (path) is closed. A closed path is
called a cycle.
The graph H = (V 0 , E 0 ) is a subgraph of G = (V, E) if V 0 ⊆ V and E 0 ⊆ E. A graph
G is connected if there is a path in G between its every pair of vertices. A graph H is a
connected component(“island”) of G if (a) H is a subgraph of G, (b) H is connected, and
(c) H is maximal, i.e., H is not contained in any other connected subgraph of G. In short,
H is a connected component of G if H is a maximal subgraph of G that is connected.

We say that H is an induced subgraph of a graph G if the vertex set of H is a subset of the
vertex set of G, and if u and v are vertices in H, then (u, v) is an edge in H iff (u, v) is an
edge in G.

Example. Prove that every graph with n vertices and m edges has at least n − m con-
nected components.

Solution. We will prove this claim by doing induction on m.


Induction Hypothesis: Assume that for some k ≥ 0, every graph with n vertices and k edges
has at least n − k connected components.
Base Case: m = 0. A graph with n vertices and no edges has n connected components as
each vertex itself is a connected component. Hence the claim is true for m = 0.
Induction Step: We want to prove that a graph, G, with n vertices and k + 1 edges has at
least n − (k + 1) = n − k − 1 connected components. Consider a subgraph G0 of G obtained
by removing any arbitrary edge, say {u, v}, from G. The graph G0 has n vertices and k
edges. By induction hypothesis, G0 has at least n − k connected components. Now add
{u, v} to G0 to obtain the graph G. We consider the following two cases.
Case I: u and v belong to the same connected component of G0 . In this case, adding the
edge {u, v} to G0 is not going to change any connected components of G0 . Hence, in this
case the number of connected components of G is the same as the number of connected
components of G0 which is at least n − k > n − k − 1.
CaseII: u and v belong to different connected components of G0 . In this case, the two
connected components containing u and v become one connected component in G. All
other connected components in G0 remain unchanged. Thus, G has one less connected
component than G0 . Hence, G has at least n − k − 1 connected components.

Example. Prove that every connected graph with n vertices has at least n − 1 edges.

Solution. We will prove the contrapositive, i.e., a graph G with m ≤ n−2 edges is discon-
nected. From the result of the previous problem, we know that the number of components
of G is at least
n − m ≥ n − (n − 2) = 2
October 2, 2018 Lecture Outline 3

which means that G is disconnected. This proves the claim.

One could also have proved the above claim directly by observing that a connected graph
has exactly one connected component. Hence, 1 ≥ n − m. Rearranging the terms gives us
m ≥ n − 1.

You might also like