Professional Documents
Culture Documents
Test 2
Test 2
Lecture 8 - Graphs
Nurlan Ismailov
nurlan.ismailov@astanait.edu.kz
Astana IT University
Last topic in our course which we will study in next three lectures is graphs.
Many concrete, practical problems can be simplified and solved by looking at
them from different of view. Sometimes the process of abstraction is simple.
For example, we use a logic to design a computer circuits. Another example -
scheduling final exams. For successful scheduling we have to take into account
associations between courses, students and rooms. Such set of connections
between items is modeled by graphs.
The basic idea of graphs were introduced in 18th century by the great Swiss
mathematician Leonhard Euler. He used graphs to solve the famous Königs-
berg bridge problem (Königsberg was the capital of East Prussia, that is now
Kaliningrad, Russia).
The houses and the utilities are represented by vertices and the pipes are the
lines drawn between the vertices. When we discuss planar graphs in next
lectures (Chapter 13, Lecture 10).
v4 v5 v6
For instance, v1 and v4 are incident with the edge v1 v4 . v1 and v4 are
adjacent. The edges v1 v4 and v4 v5 are adjacent.
deg v1 = 2, deg v2 = 1, deg v3 = 0, deg v4 = 2, deg v5 = 3, deg v6 = 2.
An edge
that is incident with only
one vertex is called a loop.
A pseudograph is like
a graph, but it may contain
loops and/or multiple edges.
Definition
A graph G1 is a subgraph of another graph G if and only if the vertex and edge
sets of G1 are, respectively, subsets of vertex and edge sets of G.
Example
The graphs G1 , G2 , G3 are subgraphs of G
v1
v2 v3 v2
v7
v1 v7
v1 v2
v7 v5
v1 v4 v3 v2 v3
v5 v6 v4 v6 v6 v4 v5 v7
G G1 G2 G3
Nurlan Ismailov nurlan.ismailov@astanait.edu.kz
Discrete Mathematics
(Astana IT University)
Lecture 8 - Graphs 11 / 29
2. Complete and Bipartite graphs
Definition
For any positive integer n, the complete graph on n vertices, denoted Kn , is
that graph with n vertices every two of which are adjacent.
K1 K2 K3 K4 K5
The first five complete graphs
Definition
A bipartite graph is one whose vertices can be partitioned into two
(disjoint) sets V1 and V2 , called bipartition sets, in such a way that every
edge joins a vertex in V1 and a vertex in V2 . (In particular, there are no
edges within V1 nor within V2 .)
A complete bipartite graph is a bipartite graph in which every vertex in V1
is joined to every vertex in V2 . The complete bipartite graph on
bipartition sets of m vertices and n vertices, respectively, is denoted Km,n .
K2,3 K3,3
v1
v4
v8 v5
v7 v6 v2 v4 v6 v8
The same graph is drawn in two different ways. So the graph on the left is a
bipartite graph.
Proposition (Euler)
The sum of the degrees of the vertices of a pseudograph is an even number
equal to twice the number of edges. In symbols, if G = (V, E) is a
pseudograph, then
P
v∈V deg v = 2|E|.
Proof.
Adding the degrees of all the vertices involves counting one for each edge incident
with each vertex. How many times does an edge get counted? If it is not a
loop, it is incident with two different vertices and so gets counted twice, once
at each vertex. On the other hand, a loop at a vertex is also counted twice, by
convention, in the degree of that vertex. □
v1
v4
v8 v5
v7 v6
Proof.
P
By the previous Proposition, v∈V deg v = 2|E| is an even number. Since
P P P
v∈V deg v = v∈V,v is even deg v + v∈V,v is odd deg v
and the first sum on the right, being a sum of even numbers, is even, so also the
second sum must be even. Since the sum of an odd number of odd numbers is
odd, the number of terms in the sum here, that is, the number of odd vertices,
must be even. □
1. The complete bipartite graph K3,6 has six odd vertices (each of degree 3).
Definition
Suppose that d1 , d2 , . . . , dn are the degrees of the vertices of a graph (or
pseudograph) G, ordered so that d1 ≥ d2 ≥ · · · ≥ dn . Then d1 , d2 , . . . , dn is
called the degree sequence of G.
For instance,
It is important to know when two graphs are essentially the same and when
they are essentially different. When we say graphs are “essentially the same”,
we mean that they differ only in the way they are labeled or drawn.
v1
v4
v8 v5
v7 v6 v2 v4 v6 v8
2. G1 = G2 = G3 =
3.
B C C B
Definition
Given graphs G1 = (V1 , E1 ) and G2 = (V2 , E2 ), we say that G1 is isomorphic to
G2 and write G1 ∼
= G2 if there is a one-to-one function φ from V1 onto V2 such
that
if vw is an edge in E1 , then φ(v)φ(w) is an edge in E2 , and
every edge in E2 has the form φ(v)φ(w) for some edge vw ∈ E1 .
We call φ an isomorphism from G1 to G2 and, abusing notation, say that
φ : G1 → G2 is an isomorphism.
A D u w
B C v x
G1 G2
It is easy to write down the isomorphism G2 → G1 explicitly:
φ(u) = A, φ(v) = C, φ(w) = D, φ(x) = B.
Proposition
The isomorphism relation in a set of graphs is an equivalence relation.
Proposition
If G1 and G2 are isomorphic graphs, then G1 and G2 have the
same number of vertices,
same number of edges and
same degree sequences.