0% found this document useful (0 votes)
263 views55 pages

Graph Theory: Connectivity, Coloring, Matching

This document provides an overview of graph theory concepts including graphs, graph types, subgraphs, connectivity, coloring, and matching. It begins with basic graph definitions and properties, then discusses graph connectivity concepts like paths, circuits, and Euler graphs. Finally, it introduces tree graphs and algorithms for determining graph properties.

Uploaded by

chutiya
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)
263 views55 pages

Graph Theory: Connectivity, Coloring, Matching

This document provides an overview of graph theory concepts including graphs, graph types, subgraphs, connectivity, coloring, and matching. It begins with basic graph definitions and properties, then discusses graph connectivity concepts like paths, circuits, and Euler graphs. Finally, it introduces tree graphs and algorithms for determining graph properties.

Uploaded by

chutiya
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/ 55

Graph Theory

Connectivity, Coloring, Matching

Arjun Suresh1

1 GATE Overflow

GO Classroom, August 2018


Thanks to Subarna/Sukanya Das for wonderful figures

Arjun, Suresh (GO) Graph Theory GATE 2019 1 / 55


Table of Contents

1 Graph

2 Graph Connectivity

3 Graph Coloring

4 Matching

Arjun, Suresh (GO) Graph Theory GATE 2019 2 / 55


Table of Contents

1 Graph

2 Graph Connectivity

3 Graph Coloring

4 Matching

Arjun, Suresh (GO) Graph Theory GATE 2019 3 / 55


Graph

Graph
G = (V , E ) is a graph and consists of a set of objects called vertices and
edges such that each edge ek is associated with an unordered pair of
vertices (vi , vj )

Figure: Graph

Arjun, Suresh (GO) Graph Theory GATE 2019 4 / 55


Graph Types

Directed Graph
A graph G = (V , E ) is a directed graph if each edge ek is associated with
an ORDERED pair of vertices (vi , vj )

Figure: Directed Graph

Arjun, Suresh (GO) Graph Theory GATE 2019 5 / 55


Graph Types

Simple Graph
A graph that has neither self loops nor parallel edges

Figure: Simple Graphs

Arjun, Suresh (GO) Graph Theory GATE 2019 6 / 55


Graph Types
Finite Graph
By default the number of edges or vertices in a graph can be infinite. A
graph with a finite number of vertices and edges is called a finite graph

Figure: Finite Graph

Arjun, Suresh (GO) Graph Theory GATE 2019 7 / 55


Graph Types

Null graph
A graph without any edges

Figure: Null Graph

Arjun, Suresh (GO) Graph Theory GATE 2019 8 / 55


Incidence and Degree
Incidence
If a vertex vi is an end vertex of an edge ek , we say vi and ek are incident
with each other

Figure: Here V1 and e1 are incident with each other

Arjun, Suresh (GO) Graph Theory GATE 2019 9 / 55


Incidence and Degree

Degree
The number of edges incident on a vertex vi with self loops counted twice
is called the degree of vertex vi

Figure: Degree of vertex V1 is 5

Arjun, Suresh (GO) Graph Theory GATE 2019 10 / 55


Incidence and Degree

Isolated vertex
A vertex having no incident edges (zero degree)

Figure: Isolated Vertex(Degree of V1 vertex is 0)

Arjun, Suresh (GO) Graph Theory GATE 2019 11 / 55


Incidence and Degree

Pendant vertex
A vertex of degree one

Figure: Pendant Vertex(Degree of vertex V1 is 1)

Arjun, Suresh (GO) Graph Theory GATE 2019 12 / 55


Subgraphs
Subgraphs
A graph H is said to be a subgraph of a graph G (H ⊂ G ) if all vertices
and edges of H are in G and all edges of H have the same end vertices in
H as in G

Every graph is its own subgraph


A single vertex in a graph is its subgraph
A single edge of a graph with the end vertices is its subgraph

Figure: Subgraph

Arjun, Suresh (GO) Graph Theory GATE 2019 13 / 55


Complete Graph
Complete Graph
A graph in which every vertex is connected to every other vertex is called a
complete graph

Also known as a clique


A complete graph of n vertices contain n(n − 1)/2 edges

Figure: Complete Graph

Arjun, Suresh (GO) Graph Theory GATE 2019 14 / 55


Walks, Paths and Circuits

Walk
An alternating sequence of vertices and edges beginning and ending with
vertices such that each edge is incident on the preceding and succeeding
vertices is called a walk. A vertex can repeat in a walk but not any edge.

Figure: Walk : V6 →V4 →V2 →V3 →V4 →V1


Length of the Walk : 5

Arjun, Suresh (GO) Graph Theory GATE 2019 15 / 55


Walks, Paths and Circuits
Open and Closed Walk
A walk with same start and end vertices is called an closed walk. A walk
that is not closed is open walk.

Figure: Open walk : Figure: Closed walk :


(V6 →V2 →V3 →V4 →V5 →V6 →V7 ) (V7 →V4 →V3 →V2 →V7 )

Arjun, Suresh (GO) Graph Theory GATE 2019 16 / 55


Walks, Paths and Circuits

Path
An open walk with no repeating vertices

Figure: Path : V1 →V2 →V3 →V4 →V5 →V6 →V7

Arjun, Suresh (GO) Graph Theory GATE 2019 17 / 55


Walks, Paths and Circuits

Circuit
A closed walk in which no vertex appears more than once

Figure: Circuit : V1 →V2 →V3 →V4 →V5 →V1

Arjun, Suresh (GO) Graph Theory GATE 2019 18 / 55


Euler Graph

Euler line and Euler Graph


A closed walk containing all edges of a graph is called an Euler line and a
graph containing an Euler line is called an Euler graph

Theorem
A given connected graph G is Euler if and only if all vertices of G are of
even degree. i.e.,

A given connected graph G is Euler if all its vertices are of even degree
If all vertices of a graph G are of even degree then G is an Euler graph

Arjun, Suresh (GO) Graph Theory GATE 2019 19 / 55


Euler Graph

Figure: Euler Line : V1 →V2 →V3 →V6 →V5 →V2 →V4 →V5 →V3 →V1
Euler Graph

Arjun, Suresh (GO) Graph Theory GATE 2019 20 / 55


Hamiltonian Paths and Circuits

Hamiltonian Circuit
A closed walk that traverses every vertex exactly once except the starting
and ending vertex. Or a circuit including every vertex of a graph. A
Hamiltonian circuit in a graph of n vertices is of length n.

Hamiltonian Path
A path obtained by removing any edge from a Hamiltonian circuit. The
length of a Hamiltonian path in a graph of n vertices is n − 1

A graph containing a Hamiltonian circuit always has a Hamiltonian


path but the reverse is not always true. i.e., some graphs have
Hamiltonian path but not any Hamiltonian circuit.
Unlike for Euler graph, there is no known necessary and sufficient
condition for a graph to have a Hamiltonian circuit

Arjun, Suresh (GO) Graph Theory GATE 2019 21 / 55


Hamiltonian Paths and Circuits

Figure: Hamiltonian Circuit : Figure: Hamiltonian Path :


(V1 →V8 →V5 →V2 →V3 (V1 →V8 →V5 →V2 →V3
→V6 →V7 →V4 →V1 ) →V6 →V7 →V4 )

Arjun, Suresh (GO) Graph Theory GATE 2019 22 / 55


Hamiltonian Circuits

Theorem
In a complete graph of n vertices (n is odd and n ≥ 3) there are (n − 1)/2
edge-disjoint Hamiltonian circuits

Theorem
A sufficient (not necessary) condition for a simple graph G with n vertices
to have a Hamiltonian circuit is that the degree of every vertex of G be at
least n/2

Arjun, Suresh (GO) Graph Theory GATE 2019 23 / 55


Table of Contents

1 Graph

2 Graph Connectivity

3 Graph Coloring

4 Matching

Arjun, Suresh (GO) Graph Theory GATE 2019 24 / 55


Havel-Hakimi Algorithm

Tells us if a given sequence of integers can form the degree sequence of a


graph.
Theorem
Let S = (d1 , . . . , dn ) be a finite list of nonnegative integers that is
nonincreasing. List S is graphic if and only if the finite list
S 0 = (d2 − 1, d3 − 1, . . . , dd1 +1 − 1, dd1 +2 , . . . , dn ) has non-negative
integers and is graphic.

Arjun, Suresh (GO) Graph Theory GATE 2019 25 / 55


Havel-Hakimi Algorithm

S = h5, 5, 5, 3, 2, 2, 1i
S = h5, 5, 4, 3, 2, 2, 1i
Subtract 1 from the next 5
Subtract 1 from the next 5
numbers after removing the leading
numbers after removing the leading
5
5
S 0 = h4, 4, 2, 1, 1, 1i
S 0 = h4, 3, 2, 1, 1, 1i
(already in non decreasing order)
(already in non decreasing order)
Remove 4
Remove 4
S 0 = h3, 1, 0, 0, 1i
S 0 = h2, 1, 0, 0, 1i
Rearrange in non decreasing order
Rearrange in non decreasing order
S 0 = h3, 1, 1, 0, 0i
S 0 = h2, 1, 1, 0, 0i
Remove 3
Remove 2
S 0 = h0, 0, −1, 0i
S 0 = h0, 0, 0, 0i
Negative number came, hence, not
Hence, graphic.
graphic.
Arjun, Suresh (GO) Graph Theory GATE 2019 26 / 55
Connected Component

Cut-Set
Every connected subgraph of a disconnected graph G is a component of G

Arjun, Suresh (GO) Graph Theory GATE 2019 27 / 55


Tree
A tree is
A connected graph without a circuit
A connected graph of n vertices and n − 1 edges
A graph in which there is a unique path between any two vertices
A minimally connected graph (minimally connected - removal of any
one edge disconnects the graph)
A circuit-less graph with n − 1 edges

Figure: Tree

Arjun, Suresh (GO) Graph Theory GATE 2019 28 / 55


Distance and Centers

The distance between two vertices vi and vj in a connected graph is


the length of the shortest path between them
Eccentricity of a vertex E (v ) is the distance of v with the vertex
farthest from it
A vertex with the minimal eccentricity in a graph G is called a center
of G - there can be multiple centers for a graph
A tree has either one or two centers

Arjun, Suresh (GO) Graph Theory GATE 2019 29 / 55


Counting Trees

Number of labeled trees with n vertices (n ≥ 2) is nn−2

Arjun, Suresh (GO) Graph Theory GATE 2019 30 / 55


Spanning Trees

Spanning Tree
A tree T is said to be a spanning tree of a connected graph G if T is a
subgraph of G and contains all vertices of G

An edge in a spanning tree T is called a branch of T


An edge of a graph which is not in a given spanning tree T is called a
chord of T
A circuit formed by adding a chord to any spanning tree is called a
fundamental circuit

Arjun, Suresh (GO) Graph Theory GATE 2019 31 / 55


Spanning Trees

Figure: Connected Graph

Figure: Spanning Tree

Arjun, Suresh (GO) Graph Theory GATE 2019 32 / 55


Spanning Trees

Spanning Tree
With respect to any spanning tree, a connected graph of n vertices and e
edges has n − 1 tree branches and e − n + 1 chords

Rank of a graph G is the number of branches in any spanning tree of


G
Nullity of a graph G (also referred to as cyclomatic number) is the
number of chords with respect to any spanning tree in G
Rank + Nullity = Number of edges

Arjun, Suresh (GO) Graph Theory GATE 2019 33 / 55


Spanning Trees

Distance between two Spanning Tree


The distance between two spanning trees T1 and T2 of a graph G ,
d(T1 , T2 ) is the number of edges present in one but not in the other

We can generate a spanning tree T2 from another spanning tree T1


by adding a chord and removing an appropriate branch - cyclic
interchange
The minimum number of cyclic interchanges required to get a
spanning tree T2 from another spanning tree T1 is given by d(T1 , T2 )
max d(T1 , T2 ) ≤ min(µ, r ), µ − nullity, r − rank

Arjun, Suresh (GO) Graph Theory GATE 2019 34 / 55


Spanning Trees

Central Tree
A spanning tree with the minimal distance with any other spanning tree is
called a central tree
i.e., for a central tree Tc ,

max d(Tc , Ti ) ≤ max d(T , Tj ), ∀ tree T of G


i j

Arjun, Suresh (GO) Graph Theory GATE 2019 35 / 55


Cut-Sets and Cut-Vertices

Cut-Set
A cut-set is a set of edges in a connected graph G whose removal from G
leaves the graph disconnected, provided removal of no proper subset of
these edges disconnects G

Figure: Cut set :(By removal of e3 , e4 , e5 edges this graph will be disconnected)

Arjun, Suresh (GO) Graph Theory GATE 2019 36 / 55


Cut-Sets and Cut-Vertices

Theorem 1
Every cut-set in a connected graph G must contain at least one branch
from EVERY spanning tree of G

Theorem 2 - Converse of Theorem 1


In a connected graph G every minimal set of edges containing at least one
branch of EVERY spanning tree is a cut-set

Theorem 3
Every cut-set has an even number of edges in common with every circuit

Arjun, Suresh (GO) Graph Theory GATE 2019 37 / 55


Edge and Vertex Connectivity

Edge Connectivity
The number of edges in the smallest cut-set

Vertex Connectivity
The minimum number of vertices whose removal leaves the remaining
graph disconnected

The edge and vertex connectivity of a tree is one

Separable Graph
A connected graph is said to be separable if its vertex connectivity is one

Arjun, Suresh (GO) Graph Theory GATE 2019 38 / 55


Edge and Vertex Connectivity

The edge connectivity of a graph G cannot exceed the degree of the


vertex of G with the smallest degree
The vertex connectivity of a graph G cannot exceed its edge
connectivity
The maximum vertex connectivity
  one can achieve with a graph of n
2e
vertices and e edges is
n

Arjun, Suresh (GO) Graph Theory GATE 2019 39 / 55


Table of Contents

1 Graph

2 Graph Connectivity

3 Graph Coloring

4 Matching

Arjun, Suresh (GO) Graph Theory GATE 2019 40 / 55


Graph Coloring
Proper Coloring
Coloring all the vertices of a graph such that no adjacent vertices are of
same color is called proper coloring of a graph

A graph that requires minimum k different colors for proper coloring


is called k − chromatic graph
Minimum number of colors required for proper coloring of a graph is
called the chromatic number of the graph

Figure: Colouring of a Graph

Arjun, Suresh (GO) Graph Theory GATE 2019 41 / 55


Chromatic Number

A graph consisting of only isolated vertices is 1−chromatic


A graph with one or more edges is at least 2−chromatic
A complete graph of n vertices is n−chromatic
( graph consisting of simply one circuit with n ≥ 3 is
A
2-chromatic if n is even
3-chromatic if n is odd

Arjun, Suresh (GO) Graph Theory GATE 2019 42 / 55


Chromatic Number

Finding chromatic number of a graph is NP-hard - no polynomial


time algorithm known so far
Chromatic number of some specific types of graphs can be found
easily
Every tree with 2 or more vertices is 2− chromatic (every 2−
chromatic graph is not a tree)
A graph of at least one edge is 2− chromatic if and only if does not
have any circuit of odd length

Arjun, Suresh (GO) Graph Theory GATE 2019 43 / 55


Chromatic Number

Figure: Chromatic Number: χ(G ) = 1

Figure: Chromatic Number: χ(G ) = 2

Arjun, Suresh (GO) Graph Theory GATE 2019 44 / 55


Chromatic Number

Figure: Chromatic Number: χ(G ) = 6

Figure: Chromatic Number: χ(G ) = 2

Arjun, Suresh (GO) Graph Theory GATE 2019 45 / 55


Chromatic Number

Figure: Chromatic Number: χ(C6 ) = 2

Figure: Chromatic Number: χ(C5 ) = 3


Arjun, Suresh (GO) Graph Theory GATE 2019 46 / 55
Chromatic Partitioning
A proper coloring of a graph induces a partitioning of its vertices into
disjoint subsets
No two vertices in any of these partitions are adjacent

Figure: Set A = {V1 , V4 , V6 }


Set B = {V2 }
Set C = {V3 }
Set D = {V5 }
Chromatic Number: χ(G ) = 4

Arjun, Suresh (GO) Graph Theory GATE 2019 47 / 55


Bipartite Graph

Bipartite Graph
A graph G is called a bipartite graph if the vertex set of G can be
decomposed into two disjoint subsets V1 and V2 such that every edge in G
joins a vertex in V1 with a vertex in V2 .

Every 2−chromatic graph is bipartite


Every bipartite graph except one with two or more isolated vertices
and no edges, is 2− chromatic

Arjun, Suresh (GO) Graph Theory GATE 2019 48 / 55


Bipartite Graph

Figure: Set A = {V1 , V3 , V5 } Figure: Set A = {V1 , V2 , V3 }


Set B = {V2 , V4 } Set B = {V4 , V5 , V6 }

Figure: Set A = {V1 , V6 , V8 , V4 } Figure: Set A = {V1 , V4 }


Set B = {V2 , V3 , V5 , V7 } Set B = {V2 , V3 }

Arjun, Suresh (GO) Graph Theory GATE 2019 49 / 55


Independent Set

Independent Set
A set of vertices in a graph is said to be independent set if no two vertices
in the set are adjacent

A maximal independent set is an independent set to which no vertex


can be added without losing the independence property
The number of vertices in the largest independent set of a graph is
called its independence number β(G ). If n is the number of vertices
and k the chromatic number
n
β(G ) ≥
k
The minimum number of maximal independent sets which collectively
include all the vertices of a graph, gives its chromatic number

Arjun, Suresh (GO) Graph Theory GATE 2019 50 / 55


Table of Contents

1 Graph

2 Graph Connectivity

3 Graph Coloring

4 Matching

Arjun, Suresh (GO) Graph Theory GATE 2019 51 / 55


Matching

Matching
A matching in a graph is a subset of its edges such that no two edges are
adjacent

A maximal matching is a matching to which no more edges can be


added
In a complete graph of 3 vertices each edge is a maximal matching
A maximal matching with the largest number of edges is called a
largest maximal matching
The number of edges in the largest maximal matching of a graph is
called its matching number

Arjun, Suresh (GO) Graph Theory GATE 2019 52 / 55


Complete Matching

Complete Matching
A matching in a bipartite graph with vertex partition V1 and V2 is a
complete matching of vertices in V1 into those in V2 if there is an edge
incident on each vertex of V1

A complete matching if it exists is a largest maximal matching


A largest maximal matching need not be complete

Theorem
A complete matching of V1 into V2 in a bipartite graph exists if and only if
every subset of r vertices in V1 is collectively adjacent to r or more
vertices in V2 for all possible values of r .

Arjun, Suresh (GO) Graph Theory GATE 2019 53 / 55


Complete Matching

Complete Matching
A matching in a bipartite graph with vertex partition V1 and V2 is a
complete matching of vertices in V1 into those in V2 if there is an edge
incident on each vertex of V1

A complete matching if it exists is a largest maximal matching


A largest maximal matching need not be complete

Theorem
A complete matching of V1 into V2 in a bipartite graph exists if and only if
every subset of r vertices in V1 is collectively adjacent to r or more
vertices in V2 for all possible values of r

Arjun, Suresh (GO) Graph Theory GATE 2019 54 / 55


Complete Matching

Theorem
In a bipartite graph a complete matching of V1 into V2 exists if there is a
positive integer m such that

degree of every vertex in V1 ≥ m ≥ degree of every vertex in V2

Arjun, Suresh (GO) Graph Theory GATE 2019 55 / 55

You might also like