题目
Pupils from ten schools are visiting a museum on the same day. The museum needs to allocate each school to a tour group. The maximum size of each tour group is 42 pupils. A group may include pupils from more than one school. Pupils from each school must be kept in the same tour group. The numbers of pupils visiting from each school are given below.
8, 17, 9, 14, 18, 12, 22, 10, 15, 7
(a) Calculate a lower bound for the number of tour groups required. You must make your method clear.
(b) Using the above list, apply the first-fit bin packing algorithm to allocate the pupils visiting from each school to tour groups.
The above list of numbers is to be sorted into descending order.
(c) Perform a quick sort to obtain the sorted list. You should show the result of each pass and identify your pivots clearly.
(d) Using your sorted list from (c), apply the first-fit decreasing bin packing algorithm to obtain a second allocation of pupils to tour groups.
Figure 4 shows the corridors in the museum. The number on each arc is the length, in metres, of the corresponding corridor. Sally is a tour guide in the museum and she must travel along each corridor at least once during each tour. Sally wishes to minimise the length of her route. She must start and finish at the museum’s entrance at A.
(e) Use an appropriate algorithm to find the corridors that Sally will need to traverse twice. You should make your method and working clear.
(f) Write down a possible shortest route, giving its length.
Sally is now allowed to start at H and finish her route at a different vertex. A route of minimum length that includes each corridor at least once needs to be found.
(g) State the finishing vertex of Sally’s new route and calculate the difference in length between this new route and the route found in (f).
(Total 18 marks)
题目中文翻译
来自十所学校的学生将在同一天参观博物馆。博物馆需要将每所学校分配到一个导览团。每个导览团的最大人数为 42 人。一个团可以包含来自多所学校的学生。来自同一所学校的学生必须分配在同一个导览团中。来自每所学校的学生人数如下。
8、17、9、14、18、12、22、10、15、7
(a) 计算所需导览团数量的下界。你必须清楚说明你的方法。
(b) 使用上面的列表,应用首次适应装箱算法将来自每所学校的学生分配到导览团。
上面的数字列表需要按降序排列。
(c) 执行快速排序以获得排序后的列表。你应该显示每趟的结果并清楚地标出你的基准元素。
(d) 使用你从 (c) 得到的有序列表,应用首次适应递减装箱算法获得学生的第二次分配方案。
图 4 显示了博物馆内的走廊。每条弧上的数字是相应走廊的长度(单位:m)。Sally 是博物馆的导览员,她必须在每次导览中至少经过每条走廊一次。Sally 希望最小化她的路线长度。她必须从博物馆入口 A 出发并回到 A。
(e) 使用适当的算法找到 Sally 需要经过两次的走廊。你应该清楚说明你的方法和计算过程。
(f) 写出一条可能的最短路线,并给出其长度。
Sally 现在被允许从 H 出发并在不同的顶点结束她的路线。需要找到一条包含每条走廊至少一次的最短路线。
(g) 说明 Sally 新路线的结束顶点,并计算这条新路线与 (f) 中找到的路线之间的长度差。