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

LectureNote_MA221_24Oct

Discrete Maths notes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

LectureNote_MA221_24Oct

Discrete Maths notes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Discrete Mathematics

Lecture 28: Graph Theory Basics

Partha Sarathi Mandal


IIT Guwahati
Outlines
• Basic terminologies
• Different types of graphs
• Euler’s theorem
Graph
• A graph consists of a nonempty set V of
vertices and a set E of edges, where each
edge in E connects two (may be the
same) vertices in V.
a
b

• Represented as 𝐺 = 𝑉, 𝐸 c
d
• V: non-empty set of vertices/nodes
• E: set of edges 𝑉𝑖 , 𝑉𝑗 -- could be
empty 𝑉𝑖 , 𝑉𝑗  𝐸 and 𝑉𝑖 , 𝑉𝑗  V
Graph
a
b

• Directed graph c
d
• Edges are ordered pairs
• Undirected graph
• Edges are unordered pairs a
b
• Simple graph (directed/undirected)
• No self-loops c
d
• At most one edge between any two nodes

a
b

c
d
Undirected Graph: Terminologies
• Let 𝐺 = 𝑉, 𝐸 be an undirected graph
• Vertices u,v are called adjacent/neighbours if (u,v)E
• An edge e E is said to be incident with nodes u, v if e = (u,v)
• Degree of vertex v V
• Number of edges incident with v
• Self-loop (if any) contributing two to the degree of v

a
b

c
d
Undirected Graph: Handshaking Theorem
• Let 𝐺 = 𝑉, 𝐸 be an undirected graph, where |E| = m
σ𝑣𝜖𝑉 deg 𝑣 = 2𝑚

• Consider an edge e = 𝑢, 𝑣 𝜖 𝐸
• What will be the contribution of e to σ𝑣𝜖𝑉 deg 𝑣 ?
• 2: One to deg 𝑢 and deg 𝑣
Undirected Graph: Euler’s Theorem
• Let 𝐺 = 𝑉, 𝐸 be an undirected graph, where |E| = m
Theorem: σ𝑣𝜖𝑉 deg 𝑣 = 2𝑚

Corollary: Any undirected graph has even number of vertices of odd


degree
• Let 𝑉𝑜𝑑𝑑 ∪ 𝑉𝑒𝑣𝑒𝑛 = 𝑉 and 𝑉1 ∩ 𝑉2 = ∅
• σ𝑣𝜖𝑉 deg 𝑣 = σ𝑣𝜖𝑉𝑜𝑑𝑑 deg 𝑣 + σ𝑣𝜖𝑉𝑒𝑣𝑒𝑛 deg 𝑣

Even Even
Problems
• Suppose we have a simple graph G with n vertices
• What is the maximum number of edges G can contain, if
(i) G is an undirected graph ?
(ii) G is a directed graph ?
Problems
• What are the degrees and neighbors of each vertex in the following
graph
Directed Graph: Terminologies
• Let e be an edge that connects vertices from u to v
• We say
(i) u = initial vertex, v = terminal vertex ;
(ii) u is adjacent to v;
(iii) v is adjacent from u;
(iv) if u = v, the edge e is called a loop
• The in-degree of a vertex v, denoted by deg–(v), is the number of
edges with v as terminal vertex
• The out-degree of a vertex u, denoted by deg+(u), is the number of
edges with u as initial vertex
Problems
• What are the in- and out-degrees of each vertex in the following
graph ?
Directed Graph: Handshaking Theorem
• Let G = (V, E) be directed graph with m edges

Theorem: σ vϵV deg−(v) = σ uϵV deg+(u) = m

• Proof : Each edge e contributes exactly once to the in-degree and


once to the out-degree
Special Simple Undirected Graphs
• Complete graph

• Exactly one edge between each pair of distinct vertices


• Denoted as Kn, where n is the number of nodes
Special Simple Undirected Graphs
• Cycle (Cn)

• Vertex set V = {v1, v2, …, vn} n  3


• Edge set E = {(v1, v2), (v2, v3),…, (vn-1, vn), (vn, v1)}
Special Simple Undirected Graphs
• Wheel (Wn)

• Additional central vertex vn added to Cn-1 n  3


• Vertex vn connected to the vertices v1, v2, v3,…, vn-1
Special Simple Undirected Graphs
• N-cube/hypercube (Qn)

• 2n nodes: Each node representing an n-bit string


• Edge between vi, vj if the bit strings represented by vi, vj differ in exactly
one bit position
Bipartite Graphs
• Simple graph 𝐺 = 𝑉, 𝐸 is bipartite if there exists subsets V1 and V2
such that 𝑉1 ∪ 𝑉2 = 𝑉 and 𝑉1 ∩ 𝑉2 = ∅ 𝑉1 , 𝑉1 forms a partition of 𝑉
• ∀𝑒: 𝑒 = 𝑣𝑖 , 𝑣𝑗  𝑣𝑖  𝑉1 , 𝑣𝑗  𝑉2 that is for each edge, one of its
end-points should be in 𝑉1 and other in 𝑉2
Complete Bipartite Graphs
• Simple graph 𝐺 = 𝑉, 𝐸 is complete bipartite if there exists subsets V1 and
V2 such that 𝑉1 ∪ 𝑉2 = 𝑉 and 𝑉1 ∩ 𝑉2 = ∅ 𝑉1 , 𝑉1 forms a partition of 𝑉.
• ∀𝑒: 𝑒 = 𝑣𝑖 , 𝑣𝑗  𝑣𝑖  𝑉1 , 𝑣𝑗  𝑉2
• An edge between two vertices iff, one of its end-points should is in 𝑉1 and
other in 𝑉2

𝐾𝑚,𝑛 : if |𝑉1 |= m
and |𝑉2 |= n
Check if a Graph is Bipartite
• The following is a very useful theorem :
• Theorem: A simple graph is bipartite if and only if it is possible to
assign one of two different colors to each vertex, so that no two
adjacent vertices are assigned the same color
• Proof :
• If there is a way to color the vertices, the same way shows a possible partition
of vertices.
• Conversely, if there is a way to partition the vertices, the same way gives a
possible coloring.

You might also like