Top Banner
Hamilton Graphs Section 6.3
27

Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

Dec 21, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

Hamilton Graphs

Section 6.3

Page 2: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 2

East Granby

Suffield

7

8 10

5

12

8

Granby

Windsor Locks

Animations

Page 3: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 3

The “Traveling Salesman Problem” (TSP)

Hamilton Circuit – End where you started (Fed Ex)

Hamilton Path – End somewhere else (Printing Problem)

Page 4: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 4

You solve it(Start and end at

Boston)

1. 650 miles

2. 700 miles

3. 750 miles

4. 850 miles

5. None of the above

Boston

NYC

DC

Philadelphia

150

250

150

200

300

100

Page 5: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 5

How many routes must be checked to be sure to get the right answer?

1. 3

2. 4

3. 5

4. 6

Boston

NYC

DC

Philadelphia

150

250

150

200

300

100

Page 6: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 6

But suppose this were the problem?

92

94 80 7

7

100

9097

75100

6775

82 85

98

88

85

98

82

85

98

95

Page 7: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 7

Solution Method 1

“Brute Force”

• Calculate possible circuits (paths) that visit each location once and only once

• Then choose the circuit (path)

Page 8: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 8

Brute Force TreeStart and end at A

A B

D C

7

8

639

5

Page 9: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 9

Solution Method 2

“Nearest Neighbor”(Start and end at A)

A “ ” algorithm

A B

D C

7

8

639

5

Page 10: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 10

Pros and Cons of each method

• Brute Force

• Nearest Neighbor

Page 11: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 11

Use Brute ForceStart and end at A

(Draw a tree)

0% 0%0%

100%

B

22

A

C

14

9

8

5

3

D

1. 31

2. 34

3. 39

4. 49

Page 12: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 12

Use Nearest Neighbor

Start and end at A

1. 31

2. 34

3. 39

4. 49

B

22

A

C

14

9

8

5

3

D

Page 13: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 13

Nearest Neighbor

(Start and end at Granby)

42

mile

s

46

mile

s

51

mile

s

53

mile

s

None

of the

abo

ve

0% 0% 0%0%

100%

1. 42 miles

2. 46 miles

3. 51 miles

4. 53 miles

5. None of the above

Granby

Suffield

E. Granby

Windsor Locks

Bloomfield

8

10

12

4

129

6

14

14

10

Page 14: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 14

Brute Force (Start and end at

Granby)

Granby

Suffield

E. Granby

Windsor Locks

Bloomfield

8

10

12

4

129

6

14

14

10

Page 15: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 15

“Printing Jobs”

20

min

utes

22

min

utes

27

min

utes

29

min

utes

30

min

utes

0%

100%

0%0%0%

1. 20 minutes

2. 22 minutes

3. 27 minutes

4. 29 minutes

5. 30 minutes

Printing job A must be done first. The numbers are “down-times”. After doing job A it takes 7 minutes to set up job B, 8 minutes to set up C, and 10 minutes to set up D.

In what order should the jobs be scheduled so that the down-time is kept to a minimum?

A

B C

D

5

7 8

15

7 10

Page 16: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 16

Earth Simulator

Page 17: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 17

End of 6.3

Page 18: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 18

Windsor Locks

East Granby

Suffield

Granby

Page 19: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 19

East Granby

Suffield Windsor Locks

Granby

Page 20: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 20Granby East Granby

Suffield

0 miles

7

8 10

5

12

8

12 miles20 miles28 miles38 miles

Windsor Locks

Page 21: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 21East Granby

Suffield

0 miles

7

8 10

5

12

8

12 miles17 miles25 miles32 miles

Windsor Locks

Granby

Page 22: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 22Granby East Granby

Suffield

0 miles7 miles

7

8 10

5

12

8

15 miles20 miles30 miles

Windsor Locks

Page 23: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 23

William Rowan Hamilton1805-1865

Page 24: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 24

Earth Simulator

In 2004, the Japanese developed a super computer known as “Earth Simulator” to study long-range global warming.

The $350 million computer performs 35.6 trillion calculations a second, more computations than there are stars in our galaxy

Page 26: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 26

Vertices Paths Toshiba laptop Earth Simulator 10 million/second

35.6 trillion/second5 4! = 24 < 1 second < 1 second

10 9! = 181,440 < 1 second < 1 second

15 14! = 87.2 billion 2.4 hours 0.24 secondBill Gates’ net worth

16 15! = 1.3 trillion 36.3 hours 3.1 seconds

17 16! = 21 trillion 24.2 days 58.8 seconds3 times the national debt / 21 cubes 300 foot sides (football field)

filled with pennies18 17! = 3.55x1014 13.7 months 16.6 minutes

19 18! = 1.2x1015 20.3 years 5 hours

20 19! = 1.2x1017 385.7 years 4 days

21 20! = 2.4x1018 7,714 years 11.3 weeksGrains of sand on all beaches in world

22 21! = 5.1x1019 162,000 years 4.6 years

25 24! = 1.5x1025 19.7 billion years 55,264.9 yearsYankees Payroll

Page 27: Hamilton Graphs Section 6.3 6.3 Hamilton Graphs 2 East Granby Suffield 7 810 5 12 8 Granby Windsor Locks Animations.

6.3 Hamilton Graphs 27

Meta - Material