题目
Figure 4 models a network of roads. The number on each edge gives the time, in minutes, to travel along the corresponding road. The vertices, A, B, C, D, E, F, G, H and J represent nine towns. Ezra wishes to travel from A to H as fast as possible. The time taken to travel between towns G and J is unknown and is denoted by minutes.
[The total weight of the network is ]
Dijkstra’s algorithm is to be used to find the fastest time to travel from A to H. On Diagram 1 in the answer book the “Order of labelling” and “Final value” at A and J, and the “Working values” at J, have already been completed.
(a) Use Dijkstra’s algorithm to find the fastest time to travel from A to H. State the quickest route.
Ezra needs to travel along each road to check it is in good repair. He wishes to minimise the total time required to traverse the network. Ezra plans to start and finish his inspection route at A. It is given that his route will take at least 440 minutes.
(b) Use the route inspection algorithm and the completed Diagram 1 to find the range of possible values of .
(c) Write down a possible route for Ezra.
A new direct road from D to H is under construction and will take 25 minutes to travel along. Ezra will include this new road in a minimum length inspection route starting and finishing at A. It is given that this inspection route takes exactly 488 minutes.
(d) Determine the value of . You must give reasons for your answer.
题目中文翻译
图 4 模拟了一个道路网络。每条边上的数字表示沿对应道路行驶所需的时间(单位:分钟)。顶点 A、B、C、D、E、F、G、H 和 J 代表九个城镇。Ezra 希望尽快从 A 到 H。城镇 G 和 J 之间的行驶时间未知,用 分钟表示。
[网络总权重为 ]
将使用 Dijkstra 算法找到从 A 到 H 的最快时间。答案本中图 1 上 A 和 J 处的”标注顺序”和”最终值”以及 J 处的”工作值”已完成。
(a) 使用 Dijkstra 算法找到从 A 到 H 的最快时间。写出最快路线。
Ezra 需要沿每条道路行驶以检查其是否状况良好。他希望最小化遍历网络所需的总时间。Ezra 计划从 A 开始并结束检查路线。已知他的路线至少需要 440 分钟。
(b) 使用路线检查算法和完成的图 1 找到 的可能取值范围。
(c) 写出 Ezra 的一条可能路线。
一条从 D 到 H 的新直接道路正在建设中,行驶需要 25 分钟。Ezra 将在这条新道路中包含在从 A 开始并结束的最小长度检查路线中。已知此检查路线恰好需要 488 分钟。
(d) 确定 的值。必须给出理由。
解答
(a)
解法一
思路
展开
从 A 的暂定距离 0 开始,每次永久标记当前暂定距离最小的顶点,并按永久标记顺序更新相邻顶点。被更小数值替代的 working values 仍按产生顺序保留;最后从 H 反向追踪产生最终值的顶点。
答题过程
展开
Dijkstra’s algorithm gives:
| Vertex | Order of labelling | Final value | Working values |
|---|---|---|---|
| A | 1 | 0 | - |
| D | 2 | 12 | 12 |
| C | 3 | 23 | 24, 23 |
| B | 4 | 31 | 34, 31 |
| F | 5 | 39 | 43, 39 |
| E | 6 | 52 | 58, 52 |
| G | 7 | 61 | 66, 61 |
| H | 8 | 71 | 74, 73, 71 |
| J | 9 | 91, |
For example, the working values at arise in the order
The completed labelling diagram is:
Tracing back from gives the route
Its time is
(b)
解法一
思路
展开
网络的奇点为 A、D、E、H。闭合检查路线必须把它们两两配对并重复相应最短路径,因此要比较全部三种配对。最小新增量给出检查路线长度;再结合“至少 440 分钟”和 J 已填的 working values,可分别得到 的下界与上界。
答题过程
展开
The odd vertices are , , and . The possible pairings are:
| Pairing | Shortest connecting paths | Added time |
|---|---|---|
| and | and | |
| and | and | |
| and | and |
The minimum added time is 33 minutes. Hence the minimum inspection time is
Since the inspection route takes at least 440 minutes,
so
At , the working value is replaced by . Therefore
which gives . Combining the two restrictions,
(c)
解法一
思路
展开
采用 (b) 的最优配对,需要把 AD 和 EH 各重复一次。写出一条从 A 出发回到 A 的闭合路线,并逐项检查每条原有道路至少出现一次、重复边恰为 AD 和 EH。
答题过程
展开
One possible inspection route is
This route starts and finishes at , traverses every edge, and repeats and .
(d)
解法一
思路
展开
原网络的奇点是 A、D、E、H。加入新边 DH 后,D 与 H 的次数各增加 1,因而变为偶点,只剩 A、E 为奇点。要得到闭合检查路线,必须重复 A 到 E 的最短路径,其长度由 (a) 的标号可得为 52。
答题过程
展开
After adding the new edge , the only odd vertices are and . The shortest path from to has length 52, so the minimum inspection time is
It is given that this equals 488, hence
and therefore
This also satisfies the range found in (b).