mca 202: discrete mathematics under construction instructor neelima gupta ngupta@cs.du.ac.in

Post on 14-Dec-2015

214 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

MCA 202: Discrete Mathematicsunder construction

InstructorNeelima 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| = 1Similarly, claim is true for (e - 1) edges,|EP| = e – 1Now, consider a path:

By removing an edge vp-vq , the claim holds for v1 to vq path.

V1 V2 V3 V4 V5 . . . . . . . . . Vq Vp

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

Now adding that edge vp to the initial path, the claim still follows as v1 and vp 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.

V1

V3V2

V8

V4

V5

V6

V7

Vertices:DegreesV1 : 1, OddV2 : 2, EvenV3 : 2, EvenV4 : 2, EvenV5 : 2, EvenV6 : 2, Even

V7 : 2, Even

V4 : 3, OddV4 : 4, Even

V8 : 2, EvenV2 : 3, Odd

Thanks: Sonam 39 and Stuti 40 (MCA 202)

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)

v1 v3v2 vj-1 v j v p

Figures for Proof :

Thanks: Sonam 39 and Stuti 40 (MCA 202)

v1 vk-1v2 vj-1 v j v pv k

v x

(a)

Thanks: Sonam 39 and Stuti 40 (MCA 202)

v1 vk-1v2 vj-1 v j v pv k

v x

(b)

Thanks: Sonam 39 and Stuti 40 (MCA 202)

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:- A

D C

B

Thanks: Sonam 39 and Stuti 40 (MCA 202)

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 A B

D CDC

B

Thanks: Sonam 39 and Stuti 40 (MCA 202)

Not A Planar Graph

A

D

C

B

E D E

A C

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,ABRegion 2 – CB,CD,ABRegion 3 – AB,BD,DARegion 4 – CD,DA,AC

A B

CD

34

1

2

Thanks: Sonam 39 and Stuti 40 (MCA 202)

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) = 2Number 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' = ve' = e -1r' = 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.

top related