# MCA 202: Discrete Mathematics under construction Instructor Neelima Gupta

## Presentation on theme: "MCA 202: Discrete Mathematics under construction Instructor Neelima Gupta"— Presentation transcript:

MCA 202: Discrete Mathematics under construction Instructor Neelima Gupta ngupta@cs.du.ac.in

Table of Contents Eulerain Path and Circuits Hamiltonian Path and Circuits Planar Graphs

Thanks: Shammi-37 and Shivangi-38 (MCA 202) Eulerian Paths & Circuits Given an undirected graph G, a path is called an eulerian path if it spans all the vertices and scan each edge exactly once. Also, in an undirected graph G, a circuit is called an eulerian circuit if it spans all the vertices and scan each edge exactly once.

Thanks: Shammi-37 and Shivangi-38 (MCA 202) Examples :

Thanks: Shammi-37 and Shivangi-38 (MCA 202) Theorem: An undirected graph possesses an eulerian path iff all the vertices are of even degree except possibly for two vertices. Claim: A graph has an euler path (or circuit) if the number of odd degree vertices in the graph is two (or zero).

Thanks: Shammi-37 and Shivangi-38 (MCA 202) Proving by Induction: If euler path have only 1 edge, |EP| = 1 Similarly, claim is true for (e - 1) edges, |EP| = e – 1 Now, consider a path: By removing an edge v p -v q, the claim holds for v 1 to v q path. V1V1 V2V2 V3V3 V4V4 V 5......... VqVq VpVp

Thanks: Shammi-37 and Shivangi-38 (MCA 202) Now adding that edge v p to the initial path, the claim still follows as v 1 and v p are vertices with odd degrees. Hence, proved.

Thanks: Shammi-37 and Shivangi-38 (MCA 202) Converse: If the number of odd degree vertices in the graph is two (or zero), the graph has an euler path (or circuit). Start with an odd degree vertex, and we will end with another odd vertex. Hence, it has an euler path. V1V1 V3V3 V2V2 V8V8 V4V4 V5V5 V6V6 V7V7 Vertices:Degrees V 1 : 1, Odd V 2 : 2, Even V 3 : 2, Even V 4 : 2, Even V 5 : 2, Even V 6 : 2, Even V 7 : 2, Even V 4 : 3, Odd V 4 : 4, Even V 8 : 2, Even V 2 : 3, Odd

Hamiltonian Path/ Circuit It is a path/circuit that passes through each of the vertices in graph exactly once. This is more constraint compare to Euler path. There is no polynomial time solution for Hamiltonian path. Thanks: Sonam 39 and Stuti 40 (MCA 202)

Hamiltonian path Thanks: Sonam 39 and Stuti 40 (MCA 202)

Theorem: If in a Graph G, the sum of the degrees for each pair of vertices in G is n-1 or larger, where n is the number of vertices in the graph, then there exists a Hamiltonian path in G. Thanks: Sonam 39 and Stuti 40 (MCA 202)

v1v1 v3v3 v2v2 v j-1 v j v p Figures for Proof :

Thanks: Sonam 39 and Stuti 40 (MCA 202) v1v1 v k-1 v2v2 v j-1 v j v p v k v x (a)

Thanks: Sonam 39 and Stuti 40 (MCA 202) v1v1 v k-1 v2v2 v j-1 v j v p v k v x (b)

Planar Graph Thanks: Sonam 39 and Stuti 40 (MCA 202)

PLANAR GRAPHS A graph is said to be planar graph if it can be drawn on a 2-D plane in such a way that no edges cross one other Example:- Thanks: Sonam 39 and Stuti 40 (MCA 202) A DC B

In a planar graph, edge is only a concept of connectivity. Edge from vertex A to vertex C can also be drawn as follow:- A AB D CD C B Thanks: Sonam 39 and Stuti 40 (MCA 202)

Not A Planar Graph A D C B ED E AC B There is no other way to connect edge AD and EC Thanks: Sonam 39 and Stuti 40 (MCA 202)

Region : Edges belonging to : Region 1 – AC,CB,AB Region 2 – CB,CD,AB Region 3 – AB,BD,DA Region 4 – CD,DA,AC A B C D 3 4 Thanks: Sonam 39 and Stuti 40 (MCA 202) 1 2

Theorem: For any connected planar graph, v - e + r = 2 where v, e and r are the number of vertices, edges, and regions of the graph, respectively Thanks: Sonam 39 and Stuti 40 (MCA 202)

Proof : By induction on number of edges. For e = 1, Number of vertices (v) = 2 Number of region(r) = 1 (outside) Putting in formula, v – e + r = 2 - 1+ 1 = 2 Hence, it holds for e=1. We’ll assume it holds for graph with n-1 edges. Thanks: Sonam 39 and Stuti 40 (MCA 202)

Suppose, we have connected graph G with e edges. We’ll remove one edge. CASE 1: If removing an edge leads to two disconnected graph G’’ G’ (e2, v2, r2) (e1, v1, r1) Removed edge Thanks: Sonam 39 and Stuti 40 (MCA 202)

Since, Both G' and G'' have e < n-1. Therefore, using induction hypothesis, v1 – e1 + r1 = 2 and v2 – e2+ r2 = 2 Adding above two equations,  v1 – e1 + r1 + v2 – e2 + r2 =2 + 2  (v1 + v2) - (e1 + e2)+ r1 + r2 = 4  v - (e -1) + r + 1 = 4(one extra region after removing one edge)  v – e + r + 2 = 4  v – e + r = 2 Hence, it holds for all graph with n edges. Thanks: Sonam 39 and Stuti 40 (MCA 202)

CASE 2: If removing an edge leads doesn’t lead to disconnected graph G’ Removed edge (e’, v’, r’) Thanks: Sonam 39 and Stuti 40 (MCA 202)

Since, G’ have e < n-1. Therefore, v'– e'+ r' = 2 For graph G', v' = v e' = e -1 r' = r – 1 (subtracting region created by removed edge)  v' + e' + r' =2  v – ( e – 1 ) + r – 1 = 2  v – e + r = 2 Hence, it holds for all graph with n edges. Thanks: Sonam 39 and Stuti 40 (MCA 202)

Download ppt "MCA 202: Discrete Mathematics under construction Instructor Neelima Gupta"

Similar presentations