2. You need to take a trip by car to another town that you have never visited before. Therefore, you are studying a map to determine the route you need to choose. There are five other towns (call them A, B, C, D, E) that you might pass through on the way. The map shows the distance (in miles) along each road that directly connect two towns without any intervening towns. These numbers are summarized in the following table, where a dash indicates that there is no road directly connecting these two towns without going through any other towns.
Miles between Adjacent Towns
Town A B C D E Destination
Origin 60 40 50 - - -
A 10 - 68 - -
B 20 57 40 -
C - 50 -
D 10 54
E 80
(a) (points: 3) Formulate this problem as a shortest-path problem by drawing a network where nodes represent towns, links represent roads, and weights on the links indicate the length of each link in miles.
(b) (points: 5) Use Dijkstra's algorithm to solve the problem. Use the tabular form. Specify the optimal solution and its cost.