paths and circuits

64
Paths and Circuits Lecture 52 Section 11.2 Wed, Apr 26, 2006

Upload: mackenzie-carrigy

Post on 30-Dec-2015

69 views

Category:

Documents


1 download

DESCRIPTION

Paths and Circuits. Lecture 52 Section 11.2 Wed, Apr 26, 2006. The Seven Bridges of K ö nigsberg. In the city of K ö nigsberg, two branches of the Pregel River came together, with an island at their junction. The Seven Bridges of K ö nigsberg. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Paths and Circuits

Paths and Circuits

Lecture 52

Section 11.2

Wed, Apr 26, 2006

Page 2: Paths and Circuits

The Seven Bridges of Königsberg

In the city of Königsberg, two branches of the Pregel River came together, with an island at their junction.

Page 3: Paths and Circuits

The Seven Bridges of Königsberg

There were seven bridges crossing the river at various places.

Page 4: Paths and Circuits

The Seven Bridges of Königsberg

The challenge was to start at one point, cross each bridge exactly once, and return to the starting point.

?

Page 5: Paths and Circuits

Euler’s Solution

Euler abstracted the bridges as a graph with four vertices and seven edges.

Page 6: Paths and Circuits

Euler’s Solution

Each vertex represents a land mass and each edge represents a bridge.

North Shore

South Shore

Island Peninsula

Page 7: Paths and Circuits

Walks and Paths

A walk from vertex v to vertex w is a finite alternating sequence of adjacent vertices and edges from v to w:

v0 e1 v1 e2 … en – 1 vn – 1 en vn,

where v0 = v and vn = w. A path from v to w is a walk that does not

repeat any edge.

Page 8: Paths and Circuits

Walks and Paths

A simple path is a path that does not repeat any vertices.

A closed walk is a walk that starts and ends at the same vertex.

A circuit is a closed path. A simple circuit is a circuit that does not

repeat any vertex.

Page 9: Paths and Circuits

Synopsis

walk = from A to B, no restrictions. path = walk, no repeated edge. closed = from A to A. circuit = closed walk. simple = no repeated vertex.

Page 10: Paths and Circuits

Euler Circuits

An Euler circuit is a circuit that contains every vertex and every edge of the graph.

The problem of the Seven Bridges of Königsberg is to find an Euler circuit.

Page 11: Paths and Circuits

Connected Graphs

A graph is connected if, for every pair of vertices v and w, there is a walk from v to w.

A connected component of a graph is a maximal connected subgraph.

Page 12: Paths and Circuits

Euler’s Solution

Theorem: A graph has an Euler circuit if and only if it is connected and every vertex has even degree.

Thus, an Euler circuit over the Seven Bridges of Königsberg does not exist.

Page 13: Paths and Circuits

The Two Bridges of Ashland

At Randolph-Macon College, they have been trying to solve the Two Bridges of Ashland problem for decades.

King’s Dominion

RMC

I-95

?

Page 14: Paths and Circuits

Proof

Proof ():Suppose a graph G has an Euler circuit.Let v V(G).Then as we travel the circuit, each time we

pass through v, we “use up” two of the edges incident to v.

When we finish the circuit, we have used all the edges incident to v.

Page 15: Paths and Circuits

Proof

Thus, v had an even number of edges.Obviously, G must be connected.

Page 16: Paths and Circuits

Proof

Proof ():Now suppose that G is connected and that

every vertex of G has even degree.Choose a vertex v at which to begin.deg(v) > 0 since G is connected, so follow

one of the edges incident to v.Let w be the next vertex.We used one of w’s edges to get there.

Page 17: Paths and Circuits

Proof

w has even degree, so there is at least one more edge available that we can follow.

This happens at every vertex that we visit.Thus, the circuit is forced to terminate only

when we return to the starting vertex v.This procedure alone does not necessarily

produce an Euler circuit.

Page 18: Paths and Circuits

Proof

Suppose there are edges that were not used.

Follow the original circuit until a vertex is reached that is incident to one of the unused edges.

Apply the original procedure to produce a circuit that starts and ends at this vertex.

“Splice” it into the original circuit.

Page 19: Paths and Circuits

Proof

Continue in this way, splicing circuits into the existing circuit, until there are no unused edges remaining.

The result is an Euler circuit.

Page 20: Paths and Circuits

Example

Page 21: Paths and Circuits

Example

Page 22: Paths and Circuits

Example

Page 23: Paths and Circuits

Example

Page 24: Paths and Circuits

Example

Page 25: Paths and Circuits

Example

Page 26: Paths and Circuits

Example

Page 27: Paths and Circuits

Example

Page 28: Paths and Circuits

Example

Page 29: Paths and Circuits

Example

Page 30: Paths and Circuits

Example

Page 31: Paths and Circuits

Example

Page 32: Paths and Circuits

Example

Page 33: Paths and Circuits

Example

Page 34: Paths and Circuits

Example

Page 35: Paths and Circuits

Example

Page 36: Paths and Circuits

Example

Page 37: Paths and Circuits

Example

Page 38: Paths and Circuits

Example

Page 39: Paths and Circuits

Example

Page 40: Paths and Circuits

Example

Page 41: Paths and Circuits

Example

Page 42: Paths and Circuits

Example

Page 43: Paths and Circuits

Example

Page 44: Paths and Circuits

Example

Page 45: Paths and Circuits

Example

Page 46: Paths and Circuits

Example

Page 47: Paths and Circuits

Example

Page 48: Paths and Circuits

Example

Page 49: Paths and Circuits

Example

Page 50: Paths and Circuits

Example

Page 51: Paths and Circuits

Example

Page 52: Paths and Circuits

Example

Page 53: Paths and Circuits

Example

Page 54: Paths and Circuits

Example

Page 55: Paths and Circuits

Example

Page 56: Paths and Circuits

Example

Page 57: Paths and Circuits

Example

Page 58: Paths and Circuits

Example

Page 59: Paths and Circuits

Example

Page 60: Paths and Circuits

Example

Page 61: Paths and Circuits

Euler Paths

Theorem: A graph G has an Euler path from v to w if G is connected, v and w have odd degree, and all other vertices have even degree.

Proof:Add an edge from v to w.Then the graph has an Euler circuit.Remove the new edge from the circuit.

Page 62: Paths and Circuits

Hamiltonian Circuits

A Hamiltonian circuit is a simple circuit that includes every vertex of the graph.

The Traveling Salesman Problem seeks a Hamiltonian circuit of minimal length.

Page 63: Paths and Circuits

Hamiltonian Circuits

Theorem: If a graph G has a nontrivial Hamiltonian circuit, then G has a subgraph H such thatV(H) = V(G).H is connected.|E(H)| = |V(G)|.deg(v) = 2 for all v V(H).

These conditions are necessary, but not sufficient.

Page 64: Paths and Circuits

Hamiltonian Circuits

The following graph does not have a Hamiltonian circuit.