0% found this document useful (0 votes)
4 views82 pages

Unit IV Graph Theory Slides Discrete Mathematics Sumangal

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 82

Discrete Mathematics

Sumangal Bhattacharya
Department of Mathematics
Shiv Nadar University Chennai
sumangal.82@gmail.com
+91 7384846857

November 12, 2024


Contents

1 Unit-I: Logic and Proofs

2 Unit-3: Lattices and Boolean Algebra

3 Unit-2: Combinatorics

4 Unit-4: Graphs

2/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Syllabus: Mid Term Exam

1 UNIT-I: LOGIC AND PROOFS


Propositional Logic - Propositional equivalences - Principal
Normal forms - Rules of inference - Proof Techniques - Proof
methods and strategy.

2 UNIT-III: LATTICES AND BOOLEAN ALGEBRA


Partial ordering - Posets - Lattices as Posets - Properties of
lattices - Lattices as algebraic systems - Sub lattices - Some
special lattices - Boolean algebra - Stone’s representation
Theorem.

3/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Syllabus: End Semester Exam

1 UNIT-II: COMBINATORICS
Mathematical induction - The Pigeonhole principle - Principal
of Inclusion and Exclusion - Recurrence relations - Solution of
linear recurrence relations - Generating functions.

2 UNIT-IV: GRAPHS
Graph terminology - special types of graphs - Subgraphs -
Operations on graphs - Connectivity - Cut points - Bridges -
Blocks - Eulerian and Hamilton graphs.

3 UNIT-V: GRAPH ALGORITHMS


Matrix representation of graphs - graph isomorphism - Trees -
Spanning trees - Dijkstra’s algorithm for shortest path -
Kruskal’s and Prims’s algorithm for minimum spanning tree.

4/82 Sumangal Bhattacharya Shiv Nadar University Chennai


.

Unit-4: Graphs

5/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Application of Graph Theory

Graph theory is a branch of Mathematics that studies the


properties of graphs, which are structures made up of
vertices (or nodes) connected by edges (or lines). It has a
wide range of applications across various fields.
• Computer Science: Graphs are fundamental in data
structures and algorithms, used in representing
networks, trees, and paths. Algorithms such as Dijkstra’s
and Kruskal’s are employed for shortest-path and
minimum-spanning tree problems.
• Networking: Graph theory is used to model computer
networks, optimize routes for data transformation, and
design robust network structures.
• Social Networks: Analyzing social networks to
determine influential individuals, community detection,
and the speed of information.

6/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Konigsberg Brifge Bright Problem

7/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Graph: Basic Definition

Definition
• A graph 𝐺 = (𝑉, 𝐸) consists of 𝑉, a non-empty set of
vertices (or nodes), and 𝐸, a set of edges, where each
edge has either one or two vertices associated with it,
called endpoints. An edge is used to connect its
endpoints.
• The pair of nodes that are connected by an edge are
called adjacent nodes.
• A node of a graph that is not adjacent to any other node
is called an isolated node.
• A graph containing only isolated nodes (i.e., no edges) is
called a null graph.
• If 𝑉 is infinite, or 𝐸 is infinite, then 𝐺 is called an infinite
graph. Otherwise, it is a finite graph.

8/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Graph: Basic Definition

Definition
• If in a graph 𝐺 = (𝑉, 𝐸), each edge 𝑒 ∈ 𝐸 is associated with
an ordered pair of vertices, i.e., 𝑒 = (𝑢, 𝑣), and it represents
a directed line from the initial point 𝑢 to the terminal
point 𝑣, then 𝐺 is called a directed graph or digraph.
Otherwise, it is called an undirected graph.
• An edge of a graph that joins a vertex to itself is called a
loop.
• In a graph, certain pairs of vertices are joined by more
than one edge, such edges are called parallel edges.

9/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Basic Definition

Definition
• Adjacent Vertices: Vertices 𝑢 and 𝑣 are said to be
adjacent if there is an edge 𝑒 = (𝑢, 𝑣).
• Incident: Edge 𝑒 is said to be incident on each of its
endpoints 𝑢 and 𝑣.
• Adjacent Edges: Two edges are said to be adjacent if
they are incident on a common vertex.
• Degree of a Vertex: The number of edges incident to
the vertex. A loop at the vertex contributes twice to the
degree. Vertex with degree 0 is isolated vertex, and degree 1 is
called pendant vertex.
• Neighborhood: The neighborhood of a vertex 𝑣 in a graph 𝐺 is
the set of all vertices adjacent to 𝑣, denoted by 𝑁 (𝑣).
• Weighted Graph: a graph where each edge is assigned a
numerical label or weight
10/82 Sumangal Bhattacharya Shiv Nadar University Chennai
Example

Example
Let 𝑣 = {𝑣 1 , 𝑣 2 , 𝑣 3 , 𝑣 4 , 𝑣 5 }, 𝐸 = {𝑒 1 , 𝑒 2 , 𝑒 3 , 𝑒 4 , 𝑒 5 , 𝑒 6 }

11/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Types of Graph

• Simple Graph: a graph in which each edge connects two


different vertices and where no two edges connect the
same pair of vertices is called simple graph.
• MultiGraph: Graphs that may have multiple edges
connecting the same pair of vertices are called
multigraphs.
• PseudoGraph: Graphs that may include loops and
possibly multiple edges connecting the same pair of
vertices or a vertex to itself are sometimes called
pseudographs.
• Directed Graphs: A directed graph (or digraph) (𝑉, 𝐸)
consists of a nonempty set of vertices 𝑉 and a set of
directed edges 𝐸 .
• MixedGraph: A graph with both directed and undirected
edges is called a mixed graph.
Note: The graph represents an undirected graph; if it is a directed graph, it
will be specified as such.
12/82 Sumangal Bhattacharya Shiv Nadar University Chennai
Summary: Types of Graph

Multiple
Graph Type Edge Category Loops
Edges
Simple Graph Undirected No No
Multigraph Undirected Yes No
Pseudograph Undirected Yes Yes
Simple Directed
Directed No No
Graph
Directed Multi-
Directed Yes No
graph
Both Directed
Mixed Graph Yes Yes
and Undirected

13/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Examples:

14/82 Sumangal Bhattacharya Shiv Nadar University Chennai


In-degree and Out-degree
In a directed graph, the in-degree of a vertex 𝑣, denoted by
𝑑𝑒𝑔 − (𝑣), is the number of edges with 𝑣 as a terminal vertex.
The out-degree of 𝑣, denoted by 𝑑𝑒𝑔 + (𝑣), is the number of
edges with 𝑣 as their initial vertex.
Theorem
Let 𝐺 = (𝑉, 𝐸) be a directed graph. Then,
Õ Õ
𝑑𝑒𝑔 − (𝑣) = 𝑑𝑒𝑔 + (𝑣) = |𝐸 |
𝑣 ∈𝑉 𝑣 ∈𝑉

15/82 Sumangal Bhattacharya Shiv Nadar University Chennai


The Handshaking Theorem

Theorem
Let 𝐺 = (𝑉, 𝐸) be an undirected graph with 𝑚 edges. Then
Õ
deg(𝑣) = 2𝑚
𝑣 ∈𝑉

Theorem
Prove that the maximum number of edges in a simple
𝑛(𝑛 − 1)
graph with 𝑛 vertices is 𝑛 𝐶2 =
2

16/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Problems

Problem 1: We have a graph that has 21 edges, 3 vertices of


degree 4, and all other vertices of degree 2. Find the total
number of vertices in the graph.
Problem 2: Is it possible to have a 2021 vertex graph in which
every vertex has degree 3?
Problem 3: An undirected graph has an even number of
vertices of odd degree.
Problem 4: Verify the Handshaking Theorem for the
following graphs:

17/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Some special types of Graphs

• Regular Graph

• Complete Graph (𝐾𝑛 )

• Walk

• Trail

• Circuit

• Path (𝑃𝑛 )

• Cycle (𝐶𝑛 )

• Wheel (𝑊𝑛 )

• Bipartite Graph

• Complete bipartite graph (𝐾𝑚,𝑛 )

18/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Regular and Complete Graph

19/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Walk

20/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Trail

21/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Circuit

22/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Path (𝑃𝑛 ), Cycle (𝐶𝑛 ) and Wheel (𝑊𝑛 )

Path (𝑃𝑛 ): A path graph consists of 𝑛 vertices that can be


arranged in a line so that vertices 𝑖 and 𝑖 + 1 are connected by
an edge for 𝑖 = 1, 2, 3 . . . , 𝑛 − 1.
Note: No vertex appears more than once in the path. The total
number of edges in the path is called the length of a path.
Cycle (𝐶𝑛 ): The cycle 𝐶𝑛 , 𝑛 ≥ 3 consists of 𝑛 vertices 1, 2, 3, . . . , 𝑛 and
edges 𝑒 1 = (1, 2), 𝑒 2 = (2, 3), . . . , 𝑒 𝑛−1 = (𝑛 − 1, 𝑛), 𝑒 𝑛 = (𝑛, 1).
Note: A closed path is cycle.
Wheel (𝑊𝑛 ): The wheel 𝑊𝑛 is obtained by adding an additional
vertex to the cycle 𝐶𝑛 , 𝑛 ≥ 3; and connect this new vertex 𝑥 to each
of the 𝑛-vertices in 𝐶𝑛 by new edges.

23/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Bipartite and Com. Bipartite Graph

24/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Problems: Bipartite Graph

(4)
25/82 Sumangal Bhattacharya Shiv Nadar University Chennai
Problems:

1 Prove that an undirected graph is bipartite if and only if


it contains no odd cycle.
2 Show that the complete graph 𝐾3 is not bipartite.
3 Show that the cyclic graph 𝐶6 is bipartite.
4 A complete graph with 𝑛 vertices is (𝑛 − 1) regular graph.
5 For a 𝑘 regular graph, if 𝑘 is odd, then the number of
vertices of the graph must be even.
6 Cycle 𝐶𝑛 is always a 2-regular graph.
7 Number of edges of a 𝑘 regular graph with 𝑛 vertices is
𝑛𝑘
.
2
8 For any simple bipartite graph 𝐺 with 𝑒 edges and 𝑣
𝑣2
vertices, prove that 𝑒 ≤ .
4
26/82 Sumangal Bhattacharya Shiv Nadar University Chennai
Subgraphs

27/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Different kinds of Subgraphs

0 0
• A graph 𝐻 = (𝑉 , 𝐸 ) is called a sub-graph of 𝐺 = (𝑉, 𝐸), if
0 0
𝑉 ⊆ 𝑉 and 𝐸 ⊆ 𝐸 .
0 0
• A graph 𝐻 = (𝑉 , 𝐸 ) is called a proper sub-graph of
0 0
𝐺 = (𝑉, 𝐸), if 𝑉 ⊂ 𝑉 and 𝐸 ⊂ 𝐸 . [Proper subsets]
0 0
• A graph 𝐻 = (𝑉 , 𝐸 ) is called a spanning sub-graph of
0
𝐺 = (𝑉, 𝐸), if 𝑉 = 𝑉. A spanning subgraph of 𝐺 need not
contain all its edges.
• If we delete a subset 𝑈 of 𝑉 and all the edges incident on
the elements of 𝑈 from a graph 𝐺 = (𝑉, 𝐸), then the
subgraph 𝐺 − 𝑈 is called a vertex deleted subgraph of 𝐺.
• If we delete a subset 𝐹 of 𝐸 from a graph 𝐺 (𝑉, 𝐸), then the
subgraph 𝐺 − 𝐹 is called an edge deleted subgraph of 𝐺.
0 0 0 0
• A subgraph 𝐻 = (𝑉 , 𝐸 ) of 𝐺 = (𝑉, 𝐸), where 𝑉 ⊆ 𝑉 and 𝐸
consists of only those edges that are incident on the
0
elements of 𝑉 , is called an induced subgraph of 𝐺.

28/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Examples

29/82
Figure: Caption Shiv Nadar University Chennai
Sumangal Bhattacharya
Properties of Subgraphs

30/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Problem: Subgraphs

31/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Operations on graphs

The operation on a graph means modifying the given graph


to get a new graph by adding or deleting vertices or edges
or by combining multiple graphs using Boolean operations.
Some of the graph operations are

1 Deletion of edges

2 Deletion of vertices

3 Addition of edges

4 Graph complement

5 Union of graphs

6 Intersection of graphs

32/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Deletion of Edges

33/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Deletion of Vertices

34/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Addition of Edges

35/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Graph Complement

36/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Union of Graph

37/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Union of Graph: Example

38/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Intersection of Graphs

39/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Intersection of Graphs: Example 1

40/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Intersection of Graphs: Example 2

41/82 Sumangal Bhattacharya Shiv Nadar University Chennai


.

Connectivity, Cut, Bridges, Blocks

42/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Connectivity

43/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Cut Points

44/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Cut Points: Example

45/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Cut Points: Example

46/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Bridge

47/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Bridge: Example

48/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Bridge: Example

49/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Bridge: Problem

50/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Cut Set

51/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Vertex and Edge Connectivity

• Vertex Connectivity: The connectivity (or vertex


connectivity) of vertices whose removal makes 𝐺
disconnected or reduces to a trivial graph. It is denoted
by 𝐾 (𝐺).
• 𝐾 (𝐺) = 0, if the graph is disconnected.
• 𝐾 (𝐺) = 1, if 𝐺 has a cut vertex.
• 𝐾 (𝐾 𝑝 ) = 𝑝 − 1, for the complete graph 𝐾 𝑝 with 𝑝 vertices.
Any complete graph can never be disconnected by the
removal of vertices. But it results in a trivial graph (a graph
that has only one vertex and no edges) by removing ( 𝑝 − 1)
vertices.
• Edge Connectivity: The edge connectivity of a
connected graph 𝐺 is the minimum number of edges
whose removal makes 𝐺 a disconnected or trivial graph.
It is denoted by 𝜆(𝐺).
• In other words, the number of edges in the smallest cut
set of 𝐺 is called the edge connectivity of 𝐺.
• If 𝐺 has a cut edge, then 𝜆(𝐺) is 1. (edge connectivity of 𝐺.)
• 𝜆(𝐾1 ) = 0, as 𝐾1 is trivial graph.
52/82 Sumangal Bhattacharya Shiv Nadar University Chennai
Blocks

53/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Blocks: Example

54/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Blocks: Problem

55/82 Sumangal Bhattacharya Shiv Nadar University Chennai


.

Eulerian Graphs and Hamiltonian graphs

56/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Euler Graph

57/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Euler Graph

58/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Example: Euler Graph

59/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Example: Euler Path

60/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Euler Graph

61/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Example: Euler Circuit

62/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Euler’s Theorem

63/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Euler’s Graph

64/82 Sumangal Bhattacharya Shiv Nadar University Chennai


The Konigsberg Bridge Problem

65/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Example: Euler’s Graph

66/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Problems: Euler’s Graph

67/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Solutions: Euler’s Graph

68/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Hamiltonian Graphs

69/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Hamiltonian Path

70/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Hamiltonian Graphs

71/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Hamiltonian Circuit

72/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Example: Hamiltonian Graphs

73/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Example: Hamiltonian Graphs

74/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Problem: Hamiltonian Graphs

75/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Solution: Hamiltonian Graphs

76/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Dirac’s Theorems

77/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Hamiltonian Vs. Eulerian

78/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Problem: Path

79/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Problem: Eulerian Path

80/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Problem: Eulerian Path

81/82 Sumangal Bhattacharya Shiv Nadar University Chennai


Problem: Hamiltonian Path

82/82 Sumangal Bhattacharya Shiv Nadar University Chennai

You might also like