Docsity

Euler Graphs and Digraphs - Applied Graph Theory - Lecture Slides, Slides of Computer Science

Partial preview of the text

Download Euler Graphs and Digraphs - Applied Graph Theory - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

Euler

Euler Graphs and Digraphs

Graphs and Digraphs

Euler

Euler Circuit

Circuit

We use the term

We use the term

circuit

circuit

as another name for

as another name for

closed trail

closed trail

  • A circuit containing every edge of G is an

A circuit containing every edge of G is an

Eulerian

Eulerian circuit.

circuit.

  • A graph whose edges comprise a single closed

A graph whose edges comprise a single closed

trail is

trail is

Eulerian

Eulerian.

Fleury’s

Fleury’s Algorithm

Algorithm

Input:

Input: A graph G with one non

A graph G with one non-

-trivial component and

trivial component and

at most two odd vertices.

at most two odd vertices.

Initialization:

Initialization: Start at a vertex that has odd degree

Start at a vertex that has odd degree

unless G is even, in which case start at any vertex.

unless G is even, in which case start at any vertex.

Iteration:

Iteration: From the current vertex, traverse any

From the current vertex, traverse any

remaining edge whose deletion from the graph

remaining edge whose deletion from the graph

does not leave a graph with two non

does not leave a graph with two non-

-trivial

trivial

components. Stop when all edges have been

components. Stop when all edges have been

traversed.

traversed.

Euler

Euler Trails in Directed Graphs

Trails in Directed Graphs

Input: Input: A digraph G that is an orientation of a connected graph

A digraph G that is an orientation of a connected graph

and has d and has d

++

(u) = d (u) = d

−−

(u) for all (u) for all

uu

V(G)V(G)

Step1: Step1: Choose a vertex

Choose a vertex

v v

V(G)
V(G)

. Let G . Let G

be the digraphbe the digraph

obtained from G by reversing direction on each edge. obtained from G by reversing direction on each edge.

Search G Search G

to construct Tto construct T

consisting of paths from consisting of paths from

v v

to allto all

other vertices. other vertices.

Step2: Step2: Let T be the reversal of T

Let T be the reversal of T

. T contains a . T contains a

u,v u,v-

path in G for path in G for

each each

u u

V(G)
V(G)

. Specify an arbitrary ordering of the edges . Specify an arbitrary ordering of the edges

that leave each vertex that leave each vertex

u, u,

except that forexcept that for

u u

v, v,

the edge the edge

leaving leaving

uu

in T must come last. in T must come last.

Step3: Step3: Construct an

Construct an Eulerian

Eulerian circuit from

circuit from

v v

as follows. as follows.

Whenever Whenever

u u

is the current vertex, exit along the next is the current vertex, exit along the next

unused edge in the ordering specified for edges leaving unused edge in the ordering specified for edges leaving

u.u.

Docsity.com