Shortest path example
Joe Cougar lives in New York City and plans to drive to Los Angeles to seek fame and fortune.
Joe's funds are limited, so he has decided to spend each night of his trip at a friend's house. He has friends
in Columbus, Nashville, Lousville, Kansas City, Omaha, Dallas, San Antonio and Denver. Joe knows that after one day's drive, he can reach Columbus, Nashville or Louisville. After two days of driving, he can reach Kansas City, Omaha or Dallas. After three days, he can reach San Antonio or Denver. Finally, after four days of driving, he can reach Los Angeles. What path should he take to minimize the total miles travelled. The mileage is given below.
| Col. | Nash | Lou | KC | Om | Da | De | SA | LA
| NY | 550 | 900 | 770 | | | | | | |
Col | | | | 680 | 580 | 1050 | | | |
Nash | | | | 580 | 760 | 660 | | | |
Lou | | | | 510 | 700 | 830 | | | |
KC | | | | | | | 610 | 790 | |
Om | | | | | | | 540 | 940 | |
DA | | | | | | | 790 | 270 | |
De | | | | | | | | | 1030 |
SA | | | | | | | | | 1390 |