题目
Figure 3 models a network of roads. The number on each edge gives the time taken, in minutes, to travel along the corresponding road.
(a) Use Dijkstra’s algorithm to find the shortest time needed to travel from A to J. State the quickest route.
Alan needs to travel along all the roads to check that they are in good repair. He wishes to complete his route as quickly as possible and will start at his home, H, and finish at his workplace, D.
(b) By considering the pairings of all relevant nodes, find the arcs that will need to be traversed twice in Alan’s inspection route from H to D. You must make your method and working clear.
For Alan’s inspection route from H to D
(c) (i) state the number of times vertex C will appear,
(ii) state the number of times vertex D will appear.
(d) Determine whether it would be quicker for Alan to start and finish his inspection route at H, instead of starting at H and finishing at D. You must explain your reasoning and show all your working.
(Total 15 marks)
题目中文翻译
图 3 表示一个道路网络。每条边上的数字表示沿对应道路行驶所需的时间,单位是分钟。
(a) 使用 Dijkstra 算法求从 A 到 J 所需的最短时间,并写出最快路线。
Alan 需要沿所有道路行驶,以检查道路是否状况良好。他希望尽快完成路线,并且会从他的家 H 出发,在他的工作地点 D 结束。
(b) 通过考虑所有相关节点的配对,找出 Alan 从 H 到 D 的巡检路线中需要重复经过的边。你必须清楚展示你的方法和计算过程。
对于 Alan 从 H 到 D 的巡检路线:
(c) (i) 写出顶点 C 将出现的次数;
(ii) 写出顶点 D 将出现的次数。
(d) 判断如果 Alan 从 H 出发并最终回到 H,而不是从 H 出发并在 D 结束,是否会更快。你必须解释你的理由并展示所有计算过程。
解答
(a)
解法一
思路
展开
从 A 赋永久标号 0,每次把当前最小的暂定标号固定,并用新固定节点更新相邻节点。依次固定 C、E、B、D、F、H、G、J;再从 J 沿产生最终标号的前驱反向追踪,即可得到最短路线。
答题过程
展开
Applying Dijkstra’s algorithm gives:
| Vertex | Working values | Final value | Order of labelling |
|---|---|---|---|
| A | 1 | ||
| C | 2 | ||
| E | 3 | ||
| B | 4 | ||
| D | 5 | ||
| F | 6 | ||
| H | 7 | ||
| G | 8 | ||
| J | 9 |
Therefore the shortest time is
along the route
(b)
解法一
思路
展开
原网络的奇点为 A、J。开放路线指定从 H 到 D,因此把原奇点与两个端点作对称差后,需要配对的节点是 A、D、H、J。列出三种不同配对并比较其最短路总权,选出总权最小的一组。
答题过程
展开
The relevant vertices are and . The three possible pairings are
For the minimum pairing, the shortest path from to is , while and are joined directly. Hence the arcs that must be traversed twice are
(c)(i)
解法一
思路
展开
加入重复边 AC、BC 后,C 的度数由 6 增至 8。C 不是路线端点,因此在欧拉迹中每次到达都要沿另一条边离开,出现次数为度数的一半。
答题过程
展开
After the repeated arcs are added,
Since is not an endpoint of the route, it appears
(c)(ii)
解法一
思路
展开
D 原有度数 4,重复 BD 后度数变为 5。由于 D 是开放路线的终点,最后一次到达后不再离开,所以出现次数比“成对使用边”的次数多一次,即为 3。
答题过程
展开
After is repeated,
As is the finishing vertex, it appears
(d)
解法一
思路
展开
若改为从 H 出发并回到 H,原图仅需把奇点 A、J 之间的最短路径重复一次,额外路程为 45。原来的 H 到 D 开放路线只需增加权值 40;比较两者的总时间即可。
答题过程
展开
For a closed route from to , the only odd vertices and must be paired, adding the shortest-path weight
Thus the closed route takes
The open route from to takes
Since , it is quicker to start at and finish at .