LOGIC AND TRUTH TABLES

advertisement
1
9.3 Hamilton Circuits – visit every vertex, rather than every edge
Ex a Suppose you wish to plan a Nebraskan trip, starting in Lincoln, visiting Blair, Fremont,
Hastings, and Lexington in any order, returning to Lincoln. Find a route that approximates
the shortest distance.
Blair (B)
Fremont
Hastings
Lexington
Fremont (F)
24
Hastings (H)
159
137
Lexington (X)
211
190
89
Lincoln (L)
66
53
101
166
Brute force method – precise, takes a long time
Nearest Neighbor algorithm – from your starting position, choose the shortest distances
Cheapest Link – find the shortest distance possible and use it
1. Draw a graph with the 5 cities at the vertices.
Label each edge with the distance between.
2. How many different trips (circuits) are there
starting & finishing in Lincoln?
3. Use the nearest neighbor & cheapest link algorithms to find Hamiltonian circuits.
Total Dist
Total Dist
Total Dist
Total Dist
Total Dist
Total Dist
2
Try: Starting in Newman, traveling to Modesto, Turlock, Sonora, and Livermore find a circuit
with an approximately minimal distance.
Newman
Turlock
Sonora
Livermore
Turlock
21
Sonora
75
54
Livermore
58
64
91
Modesto
24
14
51
48
Two-way Hamilton Circuits (e.g. airfares) – opposite trips have different values
Ex c Starting in Chicago, you want to visit NY, LA, and Miami. Approximate a minimal
price.
From
CHI
NYC
LAX
MIA
CHI
194
299
74
To:
NYC
243
199
79
LAX
299
119
124
MIA
74
79
124
Homework for Nov. 17, 2015 - Submit your project!
For In-Class Presentations
1. Give your oral presentation in class on Nov. 17, 2015.
2. Submit a sheet with your name, the title of your presentation, and your bibliography in
class on Nov. 17, 2015. The bibliography is worth 10 pts.
3. If you miss for documented reasons (illness, car trouble), you must e-mail me by 11:55
pm. on Nov. 17. The “make-up” date for oral presentations is Nov. 24, 2015.
Unexcused make-ups will receive a 15% penalty. No presentations will be allowed
after Nov. 24.
For Written Presentations
1. Bring ONE paper copy of your presentation to class to submit.
2. e-mail me (peterseny@mjc.edu) a copy of the report (.pdf, .doc or .docx) by 6:00 pm
Nov. 17, 2015.
3. If either the paper copy OR the e-mail copy are missing at the time due, a 5% penalty
will be given. If both are missing at the time due, a 15% late penalty will be given.
The last date for late paper collection is Nov. 24 (in class or 11:55 pm for e-mail
submission). No late projects will be accepted after that time.
For Web-based Presentations
1. e-mail me a link to your presentation, or an attachment containing the media
presentation by 6:00 pm, Nov. 17, 2015.
2. Submit a sheet with your name, the title of your presentation, and your bibliography in
class on Nov. 17, 2015. The bibliography is worth 10 pts.
3. If the e-mail is missing at the time due, a 15% late penalty will be given. The last date
for e-mail submission is Nov. 24, 11:55 pm. No late projects will be accepted after that
time.
Download