280 likes | 390 Views
Hamilton Graphs. Section 6.3. Suffield. East Granby. Granby. 7. Windsor Locks. 12. 8. 10. 8. 5. Animations. The “Traveling Salesman Problem” (TSP). Hamilton Circuit – End where you started (Fed Ex) Hamilton Path – End somewhere else (Printing Problem). DC. 300.
E N D
Hamilton Graphs Section 6.3
Suffield East Granby Granby 7 Windsor Locks 12 8 10 8 5 Animations 6.3 Hamilton Graphs
The “Traveling Salesman Problem” (TSP) Hamilton Circuit – End where you started (Fed Ex) Hamilton Path – End somewhere else (Printing Problem) 6.3 Hamilton Graphs
DC 300 Boston 100 250 200 150 Philadelphia 150 NYC 0 of 30 You solve it(Start and end at Boston) • 650 miles • 700 miles • 750 miles • 850 miles • None of the above 6.3 Hamilton Graphs
DC 300 Boston 100 250 200 150 Philadelphia 150 NYC 0 of 30 How many routes must be checked to be sure to get the right answer? • 3 • 4 • 5 • 6 6.3 Hamilton Graphs
92 82 90 97 88 85 82 98 67 100 85 75 75 94 80 98 77 98 85 100 95 But suppose this were the problem? 6.3 Hamilton Graphs
Solution Method 1“Brute Force” • Calculate possible circuits (paths) that visit each location once and only once • Then choose the circuit (path) 6.3 Hamilton Graphs
Brute Force TreeStart and end at A B A 5 9 3 7 6 8 D C 6.3 Hamilton Graphs
Solution Method 2“Nearest Neighbor”(Start and end at A)A “ ” algorithm B A 5 9 3 7 6 8 D C 6.3 Hamilton Graphs
Pros and Cons of each method • Brute Force • Nearest Neighbor 6.3 Hamilton Graphs
1 of 30 Use Brute ForceStart and end at A(Draw a tree) B A 3 22 5 8 14 • 31 • 34 • 39 • 49 D C 9 6.3 Hamilton Graphs
0 of 30 Use Nearest NeighborStart and end at A B A 3 22 5 8 14 • 31 • 34 • 39 • 49 D C 9 6.3 Hamilton Graphs
10 Suffield Granby 4 6 14 E. Granby 8 12 12 14 9 Bloomfield Windsor Locks 10 1 of 30 Nearest Neighbor(Start and end at Granby) • 42 miles • 46 miles • 51 miles • 53 miles • None of the above 6.3 Hamilton Graphs
10 Suffield Granby 4 6 14 E. Granby 8 12 12 14 9 Bloomfield Windsor Locks 10 Brute Force(Start and end at Granby) 6.3 Hamilton Graphs
1 of 30 “Printing Jobs” 5 B C 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? 7 8 • 20 minutes • 22 minutes • 27 minutes • 29 minutes • 30 minutes A 7 15 10 D 6.3 Hamilton Graphs
Earth Simulator 6.3 Hamilton Graphs
End of 6.3 6.3 Hamilton Graphs
Suffield Windsor Locks Granby East Granby
Suffield Windsor Locks Granby East Granby
Route 1 0 miles 12 miles 20 miles 28 miles 38 miles Suffield Windsor Locks 7 12 8 10 8 5 Granby East Granby
Route 2 0 miles 12 miles 17 miles 25 miles 32 miles Suffield Windsor Locks 7 12 8 10 8 5 Granby East Granby
Route 3 0 miles 7 miles 15 miles 20 miles 30 miles Suffield Windsor Locks 7 12 8 10 8 5 Granby East Granby
William Rowan Hamilton1805-1865 6.3 Hamilton Graphs
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 6.3 Hamilton Graphs
Computational Complexity Computer 1 : A Toshiba laptop can check 10 Million paths each second Computer 2: “Earth Simulator” can check 35.6 Trillion paths each second 6.3 Hamilton Graphs
Vertices Paths Toshiba laptop Earth Simulator 10 million/second 35.6 trillion/second 5 4! = 24 < 1 second < 1 second 10 9! = 181,440 < 1 second < 1 second 15 14! = 87.2 billion 2.4 hours 0.24 second Bill Gates’ net worth 16 15! = 1.3 trillion 36.3 hours 3.1 seconds 17 16! = 21 trillion 24.2 days 58.8 seconds 3 times the national debt / 21 cubes 300 foot sides (football field) filled with pennies 18 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 weeks Grains 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 years Yankees Payroll 6.3 Hamilton Graphs
Meta - Material 6.3 Hamilton Graphs