proof of euler's theorem part 2 :

11
An Euler Circuit is a cycle of an undirected graph, that traverses every edge of the graph exactly once, and ends at the same node from which it began. Euler's Theorem: A connected graph G possesses an Euler circuit if and only if G does not contain any nodes of odd degree. Proof of Euler's theorem: Assume that G has zero nodes of odd degree. It can then be shown that this is a necessary and a sufficient condition for an Euler circuit to exist. Part 1: It is necessary because any Euler circuit drawn on the graph must always enter a node through some edge and leave through another and all edges on the graph must be used exactly once. Thus, an even number of incident edges is

Upload: linus-jenkins

Post on 01-Jan-2016

19 views

Category:

Documents


3 download

DESCRIPTION

An Euler Circuit is a cycle of an undirected graph, that traverses every edge of the graph exactly once, and ends at the same node from which it began. Euler's Theorem : A connected graph G possesses an Euler circuit if and only if G does not contain any nodes of odd degree. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Proof of Euler's theorem Part 2 :

An Euler Circuit is a cycle of an undirected graph, that traverses every edge of the graph exactly once, and ends at the same node from which it began.

Euler's Theorem: A connected graph G possesses an Euler circuit if and only if G does not contain any nodes of odd degree.

Proof of Euler's theorem: Assume that G has zero nodes of odd degree. It can then be shown that this is a necessary and a sufficient condition for an Euler circuit to exist.

Part 1: It is necessary because any Euler circuit drawn on the graph must always enter a node through some edge and leave through another and all edges on the graph must be used exactly once. Thus, an even number of incident edges is required for every node on the graph.

Page 2: Proof of Euler's theorem Part 2 :

Proof of Euler's theorem Part 2:

Sufficiency, on the other hand, can be shown through the following tour construction argument. We begin at some initial node k0 and draw a circuit through G (thus eventually returning to k0). Let this circuit be denoted C0. If C0 happens to be an Euler circuit, this is fine; we stop. If C0 is not an Euler circuit, then if we remove from G all edges used by circuit C0, there must be some edges left over. Moreover, at least two of these edges must be incident on some node k1 through which circuit C0 has passed. This must be so since, by assumption, G is, first, connected and, second, all its nodes are of even degree (and C0 has only used up an even number of edges which are incident on k1). Thus, it is possible to draw another circuit C1 originating and terminating at k1, which uses only edges of G', the graph left after we eliminate the edges of C0 from G.

This procedure may now be continued until eventually, say after the nth step, there will be no edges left uncovered. At that time, an Euler circuit will also have been obtained which will be a combination of circuits C0, C1, C2, . . ., Cn.

Page 3: Proof of Euler's theorem Part 2 :

Euler's theorem is a proof by construction.

However, the algorithm could be O(E2) or O(E log E) where E is the number of edges in the graph.

Note: both of these are O(E2):

for i = 1 to n{ for k = 1 to n { }}

for i = 1 to n { }for i = 1 to n { }.. (linear function of n times)

.for i = 1 to n { }

Page 4: Proof of Euler's theorem Part 2 :

1. Pick any vertex to start.

2. From that vertex pick an edge to traverse, considering following rule: never cross a bridge of the reduced graph unless there is no other choice.

3. Darken that edge, as a reminder that you can't traverse it again.

4. Travel that edge, coming to the next vertex.

5. Repeat 2-4 until all edges have been traversed, and you are back at the starting vertex.

By reduced graph we mean the original graph minus the darkened (already used) edges.

A bridge of a graph G is an edge whose deletion increases the number of components of G.

Fleury's Algorithm: O(E)?

Page 5: Proof of Euler's theorem Part 2 :

Fleury's Algorithm in Action

Pick any vertex (e.g. F) Take F to C  (arbitrary)

Take C to D  (arbitrary) Take D to A  (arbitrary)

Take A to C.

Can't go to B: that edge is a bridge of the reduced graph, and there are two other choices.

How can we recognize a bridge efficiently?

In the original graph, AB was not a bridge.

Can we preprocess the graph in O(E) time identifying bridges and building a structure that can be updated in constant time with each reduction?

A bridge is not a local property (i.e. if edge EF existed then AB would not be a bridge).

Page 6: Proof of Euler's theorem Part 2 :

Scrub Tile Puzzle A Hamiltonian Cycle Puzzle Applet

Given 10 equally sized index cards each with one of the following words: HEN, HUT, WIT, SAW, CAR, CUB, MOB, DIM, RED, SON. Arrange the cards in a rectangular closed chain such that any two adjacent words must share a common letter.

The above may serve to demonstrate a possible arrangement. However, the words SON and RED, although adjacent, do not have a letter in common. Therefore, it's not a valid configuration.

Repeat the same problem with the cards SON and HUT replaced by SUN and HOT.

Page 7: Proof of Euler's theorem Part 2 :

Scrub Tile Puzzle

Of the two variants of the puzzle, the second is solvable, the first is not.

The two variants are represented by different graphs. A solution to the puzzle constitutes a Hamiltonian circuit on its graph. The first of the two is the famous Petersen graph that is known not to house any Hamiltonian circuits.

Page 8: Proof of Euler's theorem Part 2 :

Dodecahedral Graph Is it Hamiltonian? If so, find the Hamiltonian Cycle

A

B

CD

E N

O

F

G

H

P

JK

M

ZV

W

XY

L

Page 9: Proof of Euler's theorem Part 2 :

Knight's Tour Problem

The "Knight's Tour" is a sequence of moves done by a knight on a chessboard. The knight is placed on an empty chessboard and, following the rules of chess, must visit each square exactly once. There are several billion solutions to the problem, of which about 122,000,000 have the knight finishing on a square which is just a move away from the starting square. Such a tour is described as “closed”.

The Knight's Tour problem is an instance of the more general Hamiltonian path problem in graph theory. The problem of getting a closed Knight's Tour is similarly an instance of the Hamiltonian cycle problem.

Page 10: Proof of Euler's theorem Part 2 :

Find a Closed Knight's Tour

Page 11: Proof of Euler's theorem Part 2 :

State as Hamiltonian Path Problem

For a given n value, find an arrangement of the first n natural values such that, at the same time:

• The sum of every two adjacent numbers is a prime.

• The sum of every two adjacent squares is a prime.

Find such a sequence for n = 10.