aim: how does a hamilton path and circuit differ from euler’s path and circuit?

15
Aim: Graph Theory – Hamilton Paths & Circuits Course: Math Literacy Do Now: Aim: How does a Hamilton path and circuit differ from Euler’s path and circuit? How does finding an efficient way to plow the streets of NY differ from finding an efficient way for UPS to deliver packages throughout the city?

Upload: melodie-clark

Post on 02-Jan-2016

21 views

Category:

Documents


0 download

DESCRIPTION

Aim: How does a Hamilton path and circuit differ from Euler’s path and circuit?. Do Now:. How does finding an efficient way to plow the streets of NY differ from finding an efficient way for UPS to deliver packages throughout the city?. Hamilton Paths & Circuits. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Aim:  How does a Hamilton path and circuit differ from Euler’s path and circuit?

Aim: Graph Theory – Hamilton Paths & Circuits

Course: Math Literacy

Do Now:

Aim: How does a Hamilton path and circuit differ from Euler’s path and circuit?

How does finding an efficient way to plow the streets of NY differ from finding an efficient way for UPS to deliver packages throughout the city?

Page 2: Aim:  How does a Hamilton path and circuit differ from Euler’s path and circuit?

Aim: Graph Theory – Hamilton Paths & Circuits

Course: Math Literacy

Hamilton Paths & Circuits

Hamilton path – a path that passes through each vertex of a graph exactly once.

Hamilton circuit – a path that passes through each vertex of a graph exactly once and begins and ends at the same vertex.

E

A B

CD

Find a Hamilton path.

A, B, C, D, E

Find a Hamilton circuit

A, B, C, D, E, AE

A B

CD

Page 3: Aim:  How does a Hamilton path and circuit differ from Euler’s path and circuit?

Aim: Graph Theory – Hamilton Paths & Circuits

Course: Math Literacy

Complete/Incomplete Graphs

E

A B

CD

Complete graph – a graph that has an edge between each pair of vertices.

Every complete graph with three or more vertices has a Hamilton circuit.

incomplete graph

missing

Page 4: Aim:  How does a Hamilton path and circuit differ from Euler’s path and circuit?

Aim: Graph Theory – Hamilton Paths & Circuits

Course: Math Literacy

Model Problem

Find a Hamilton path that begins at vertex E for the graph below.

F

A C

D

E

G

B

Find a Hamilton circuit that begins at vertex E for the graph below.

F

A C

D

E

G

B

Page 5: Aim:  How does a Hamilton path and circuit differ from Euler’s path and circuit?

Aim: Graph Theory – Hamilton Paths & Circuits

Course: Math Literacy

Number of Hamilton Circuits

A B

CD

Find as many Hamilton circuits as possible.

A, B, C, D, A

A B

CD

A, B, D, C, AA B

CD

A, C, B, D, A

A B

CD

A, C, D, B, AA B

CD

A, D, B, C, A

A B

CD

A B

CD

A, D, C, B, A

four vertices – 6 circuits

permutations

Page 6: Aim:  How does a Hamilton path and circuit differ from Euler’s path and circuit?

Aim: Graph Theory – Hamilton Paths & Circuits

Course: Math Literacy

Number of Hamilton Circuits

The number of Hamilton circuits in a complete graph with n vertices is (n – 1)!.

How many Hamilton circuits in a completegraph with

a) four vertices

b) five vertices

c) eight vertices

n = 4 (4 – 1)! = 6

n = 5 (5 – 1)! = 24

n = 8 (8 – 1)! = 5040

Page 7: Aim:  How does a Hamilton path and circuit differ from Euler’s path and circuit?

Aim: Graph Theory – Hamilton Paths & Circuits

Course: Math Literacy

The Traveling Saleperson

A sales director who lives in city A is required to travel to regional offices in cities B, C, and D. There are no restrictions on the order of the visits but cheaper is better and he/she must get back home.

A B C D

A * 190 124 157

B 190 * 126 155

C 124 126 * 179

D 157 155 179 *

155124

179

126

190

157

A B

CD

one-way fares

weighted graph

What is the cost if circuit A, B, D, C, A is traveled? 190 + 155 + 179 + 124 = $648

Page 8: Aim:  How does a Hamilton path and circuit differ from Euler’s path and circuit?

Aim: Graph Theory – Hamilton Paths & Circuits

Course: Math Literacy

Optimal Hamilton Circuit

Optimal Hamilton Circuit – in a complete weighted graph, where the sum of the weight of the edges is a minimum.

Option One – Brute Force Method

1. Model the problem with a complete, weighted graph.2. Make a list of all possible Hamilton

circuits.3. Determine the sum of the weights of the edges for each of these circuits.4. The Hamilton circuit with the minimum sum of weights is the optimal solution.

Page 9: Aim:  How does a Hamilton path and circuit differ from Euler’s path and circuit?

Aim: Graph Theory – Hamilton Paths & Circuits

Course: Math Literacy

Model Problem

Find the optimal solutions for our salesperson.

A B C D

A * 190 124 157

B 190 * 126 155

C 124 126 * 179

D 157 155 179 *

155124

179

126

190

157

A B

CD

one-way fares

weighted graph

Hamilton circuit sum of weights of edges = total cost

A,B,C,D,A 190+126+179+157 = $652

A,B,D,C,A 190+155+179+124 = $648

A,C,B,D,A 124+126+155+157 = $562

A,C,D,B,A 124+179+155+190 = $648

A.D.B.C.A 157+155+126+124 = $562

A,D,C,B,A 157+179+126+190 = $652

Page 10: Aim:  How does a Hamilton path and circuit differ from Euler’s path and circuit?

Aim: Graph Theory – Hamilton Paths & Circuits

Course: Math Literacy

Model Problem

Find the optimal solutions for the weighted graph below.

1050

30

15

2070

C B

A

D

Page 11: Aim:  How does a Hamilton path and circuit differ from Euler’s path and circuit?

Aim: Graph Theory – Hamilton Paths & Circuits

Course: Math Literacy

Optimal Solution – Option Two

When number of vertices (options) get large, brute force method is unmanageable.

Option Two – Nearest Neighbor Method

1. Model the problem with a complete, weighted graph.

2. Identify the vertex that serves as the starting point.

3. From the starting point, choose the edge with the smallest weigh. Move along this edge to the 2nd vertex.

4. From the 2nd vertex, choose the edge with the smallest weight that does not lead to a vertex already visited.

5. Continue building the circuit, one vertex at the time.

6. From the last vertex, return to the starting point.

This method approximates the lowest cost

Page 12: Aim:  How does a Hamilton path and circuit differ from Euler’s path and circuit?

Aim: Graph Theory – Hamilton Paths & Circuits

Course: Math Literacy

Model Problem

A sales director who lives in city A is required to fly to regional offices in cities B, C, D, and E. The weighted graph showing the one-way airfares is given below. Approximate the lowest cost.

145

147

115

195 114

128

194

169

116

180

E

A

B

CD

114115194145180

1. Model the problem with a complete, weighted graph.2. Identify the vertex that serves as the starting point.3. From the starting point, choose the edge with the smallest weigh. Move along

this edge to the 2nd vertex.4. From the 2nd vertex, choose the edge with the smallest weight that does not

lead to a vertex already visited.5. Continue building the circuit, one vertex at the time.6. From the last vertex, return to the starting point.

A, CC, EE, DD, BB, A

A, C, E, D, B, A $748

Page 13: Aim:  How does a Hamilton path and circuit differ from Euler’s path and circuit?

Aim: Graph Theory – Hamilton Paths & Circuits

Course: Math Literacy

Model Problem

Use the Nearest Neighbor Method to approximate the optimal solution for the complete, weighted graph below.

24

85

18

13100

154

12

5

1314

CD

E

A

B

Page 14: Aim:  How does a Hamilton path and circuit differ from Euler’s path and circuit?

Aim: Graph Theory – Hamilton Paths & Circuits

Course: Math Literacy

The Product Rule

Page 15: Aim:  How does a Hamilton path and circuit differ from Euler’s path and circuit?

Aim: Graph Theory – Hamilton Paths & Circuits

Course: Math Literacy

The Product Rule