0% found this document useful (0 votes)
9 views24 pages

Euler I An Graphs

The document discusses the Konigsberg Bridge Problem, which asks if it's possible to traverse all bridges in the city of Konigsberg exactly once and return to the starting point. Euler's solution established foundational concepts in graph theory, leading to the definition of Eulerian graphs and circuits. The document also outlines algorithms for finding Eulerian trails and applications in various fields, including DNA sequencing and circuit design.

Uploaded by

elavartha
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 views24 pages

Euler I An Graphs

The document discusses the Konigsberg Bridge Problem, which asks if it's possible to traverse all bridges in the city of Konigsberg exactly once and return to the starting point. Euler's solution established foundational concepts in graph theory, leading to the definition of Eulerian graphs and circuits. The document also outlines algorithms for finding Eulerian trails and applications in various fields, including DNA sequencing and circuit design.

Uploaded by

elavartha
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/ 24

Konigsberg Begs Problem

tape

The city
SERIE C
of Konigsburg exists as collection

of islands connected by bridges as shown in

figure
Is it
Q possible to start at some location

in the town travel across all the bridges


twice
once without crossing any bridge
and return to the starting Point

Euler solved this very first Problem in GraphTheory


the field has exploded becoming one of the most

important areas of Mathematics and computer science


Goal of this Lecture is to solve the above

Puzzle with a Proof

t
is
c

Def A walk in a graph is a sequence of vertices

01,02 Ok Such that Di Dit E E for it 112 K l

If the vertices in a walk are distinct then the walk

is called a Path If the edges in a walk are

distinct then the walk is called a trial

A cycle is a path Oi Uk together with the

edge Vice k 7,3

A Trial that begins and ends at the same vertex

is called a circuit a closed trail

E bd
yb Trial bac
c

circuit act d b a
Def A graph is Eulerian if it has a closed

trail containing all edges We call a closed trail

a circuit when we do not specify the first vertex

but keep the list in cyclic order

An Eulerian circuit or Eulerian trail in a graph

is a circuit or trail containing all the edges

Exae
KIEN

Ga Ga
G
G has an Euler Circuit a e c d e b a

Gi 63 has no Euler circuit


Gs has an Euler trail a c d e bid a b

Gg doesn't have Euler trail


BacktonthenkomingsbergBridgeproblein

Representing each island as a Veeter and each

bridge as an edge we can represent

Konigsberg bridges problem as

A
FEAT
BTI D

B
N
IF
Euler's approach Rough Idea

If you arrive at a landmass on one

bridge and are not at the end of your walk

then you must depart on another bridge


from that landmass

Thus if the Konigsberg bridges can be

traversed a continuous walk covering each


by
bridge exactly once all the land masses

except possibly two starting dending must


have an even number of incident bridges

From the above Fig we see that four

landmasses have an odd of incident bridges


Therefore it is impossible to find a path
crossing each bridge exactly once
Definition Recap

A graph is called an Eulerian graph if it contains

an Euler circuit
no
A graph is Eulerian if it has a closed trail containing

all edges

theorem Euler 1736 A connected graph G is Eulerian

iff every vertex has even degree

Ref G is Eulerian every vertex has even


degree

Let C Do er D er v2 Ott et Ut V0 is an

Euler circuit in G

If U is an internal vertex appearing k times

then deg 6 2k If Vo appear r times internally


then deglo 28 2

Every vertex is of even degree G is Eulerian

Proof
by induction on m Note In this
Proof G may not be simple
If m 2 then G looks like oneof the following

four graphs all graphs

C Every vertex has


even degree
G G G3 G4

clearly each Gi is Eulerian

Assume that the statement holds for all connected

graphs with at most m 1 edges


every vertex
Let G be a graph with m edges has evendegree
Let x be any vertex of G and NW 262
be two edges incident on se Wi we need not be

distinct

Let H be a graph obtained from G by


deleting sew Akwa and adding new edge e w w2

Clearly the H has m 1 edges and every vertex

has even degree


I b

cases
we get two based on the connectivity of H

Cased H is connected

By induction hypothesis A has a Euler circuit

C Voe V1 W ewa Vo

then
w2 Vo
C 00901 WiLlw
is an Euler Circuit in G

Casey H is disconnected

Let H He be the connected components of H


het REHI and e WiWz H2
Both Hi ditz have at most my edgesof every

vertex in both Hid Hz have even degree

so by induction hypothesis H R Ha have an

Euler circuits say C 44 respectively

G x e et in

Cz Ho fi n
Akwa No they

wa do
C Vo ti WCCC
is an Euler circuit in G

Alternate Proof for the reverse direction

Proof by induction on the number of edges m

Base case m 0 one vertex itself a closed trail


Induction step m 0

As every vertex of G has degree at least two

So G Contains a cycle C

let It be the graph Obtained from G by


deleting Edl
We can see that Each vertex in every
Component of H hes even degree

By induction hypothesis each Component of H

has an Eulerian circuit

To combine these into an Eulerian circuit of G

we traverse C but when a component of H

is entered for the first time we travel along

an Eulerian circuit of that Component This circuit

ends at the vertex where we began the detour

When we complete the traversal of C we get

an Eater circuit of G
Corollary If a connected graph G contains exactly
two vertices of odd degree Ady then

it contains a Ny Euler trail

Bot G Guz E Ev 22,42

degle even HOEG so above theorem


by
G has an Euler conceit C 2,623,2 4,923,2
then C a y is an Xy Euler trail in G
Fleury's auto Linda Eulerian Trat
III G V E Every vertex of G has EVEN degree

of Euler trail Euler Circuit C

Sept select a vertex Vo arbitrarily and


define Co Do

Stef After selecting a trial say Ck 00,991 4.4


Construct a graph Gk Gk i Ck

ie Gk G Lei Ek where Go G

Stef
1 If there is no edge incident with UK in Gk

then STOP Declare CK as Euler Circuit

1 If there is an edge incident with Uk in Gk


Select an edge say Ck Uk Dicta giving
Reference to a non cut edge of Gk

V0 i Ck Ok Eka Uka Goto Step2withCist


Define Kt
EI a

03 04

a
G G Vole
it
Ca 004,40
a Go G Ooh V24

is toy
Here 3 edges incident with V1 To Proceed

further We Cannot Select Villo We can select

either Dils or 0,04 Lets select bills


Uo
Cz L Volk Vidi HUG
ie G EG www.oies3

Uz 64

and So on you can repeat above process

finally we Euler circuit C as

C Vo NoU2 U2 0201 Vi Vhf Uz 0364 04

Uy01,61 Quo Vo

Next we will see the Correctness of the


Algorithm

Running time of Fleury's algorithm


for each edge e we have to
m2
check whether it is a cutedge
or not to
Tarjan'S Algo
takes 0cm time
theorem Every Trail Constructed by Fleury's algorithm

is a closed Eulerian trail


thot Let Cp vole epiup be a trail
generated by the Algorithm

Claim 1 Cp is a closed trail circuit

clearly there are no edges incident with Vp


otherwise algorithm would not have terminated

Suppose Uo f Up then deg Op 2kt I

ther k is of times up appears internally


in Cp Which is contradiction to the fact that

every voter has EVEN degree

Claim 2 Cp contains all the edges of G


Proof by contradiction

het Gp G E Cp and E Gp 1 0
ie There are vertices of Positive degree in Gp
Every Veeted of Gp has EVEN degree

because Gp is obtained from G by deleting edges

of a closed trail

S VE V Gp degco o
Gp
H GTS Graph induced by vertices of S
then Up EV S because deggplup 0

Uk Ext f
S V s

Let 0k be the last vertex in Cp seen that

Uk ES Then 0kt E V S and E KH e 6kV Kt

is the only edge joining S V S in Gk


Therefore Eka is a cat edge of Gk
Next every Velten of H has EVEN degree.in Gp

there exists an edge e incident with UK in H

It is not a cut edge of It since every water

in It has even degree

E is not a cut edge of GK as H E Gk


While executing the KH iteration we have

Preferred to select EKH rather than e

Hence Ekta is not a cut edge of GK


820 contradict each other

Hence claim 2 is TRUE and Cp is a

closed Eulerian trail


Hierholzer's Algorithm

Choose
any starting vertex U and follow a

trail of edges from that Veeter Until returning

to U It is not possible to stuck at any vertex

other than U why can you see it The tour formed

in this way is a closed tour but may not

cover all the vertices and edges of the


initial graph

As long as there exists a vertex u that

belongs to the current tour but that has adjacent

edges not poet of the tour Start another trail

from U following unused edges until returning to U

and join the tour formed in this way to the

previous tour

Runnytime 0cm
o
Uo
Example

Us
K 4

starting from arbitrary


Find veeten U
Step any tour
Saya
VO Vo Uz V VO
C
o A on

Us
K 4

Pick from which has


Steps any water Uav ua

adjacent edges not belongs to the current tour 9 Start

another trail we Pick say V only choice


VO

ol A q
Cl UoUz VIVO

LD Musume
ca

64 Merging C 4cL we get Volk40340,00


CPP Mei ku Kuan 1962
the Postman Problems

Given an undirected graph we want to find the shortest


closed walk that visit all the edges at least once

If all vertices are of EVEN degree then using


Fleury's algorithm we can find closed Eulerian Walk

If G is Non Eulerian then we use the following

Algorithm

Algorithm
List all odd degree vertices say v1 Ual
List all Possible pairings of odd degree vertices

For each pair Vine find shortest Path


a
Pij
of minimum weight Nij btw them
Construct a complete graph G on vertices

21,22 221 by joining Zizi with weight


Wij
Find a matching of minimum weight in G
In G duplicate the edges of Pij joining
Ui and Uj if Zi g EM to obtain an

Eulerian graph GIG


Apply Fleury's algorithm to Gt The resultant

closed Eulerian trail is an optimal closed walk

of G

Time Complexity Oln then local


i I 5

Odddegree vertices x Y Wiz

minimum weight Nw 923


Matching of
it
Other Applications

To Reconstruct the DNA Sequence from its

fragments

In CMO circuit design to find an optimal logic

gate ordering

You might also like