题目
Figure 4 represents a network of roads. The number on each arc represents the length, in miles, of the corresponding road. Tamasi, who lives at A, needs to collect a caravan. Tamasi can collect a caravan from either J or K.
Tamasi decides to use Dijkstra’s algorithm once to find the shortest routes between A and J and between A and K.
(a) State, with a reason, which vertex should be chosen as the starting vertex for the algorithm.
(b) Use Dijkstra’s algorithm to find the shortest routes from A to J and from A to K. You should state the routes and their corresponding lengths.
Tamasi’s brother lives at F. He needs to visit Tamasi at A and then visit their mother who lives at H.
(c) Find a route of minimal length that goes from F to H via A.
题目中文翻译
图 4 表示一个道路网络。每条弧上的数字表示对应道路的长度(单位:英里)。住在 A 的 Tamasi 需要取一辆旅居车。Tamasi 可以从 J 或 K 取旅居车。
Tamasi 决定使用 Dijkstra 算法一次来找到 A 和 J 之间以及 A 和 K 之间的最短路线。
(a) 说明应选择哪个顶点作为算法的起始顶点,并给出理由。
(b) 使用 Dijkstra 算法找到从 A 到 J 和从 A 到 K 的最短路线。应写出路线及其对应的长度。
Tamasi 的兄弟住在 F。他需要去 A 拜访 Tamasi,然后去 H 拜访他们的母亲。
(c) 找到从 F 经 A 到 H 的最小长度路线。