题目
Figure 1 shows the possible allocations of six workers, A, B, C, D, E and F, to six tasks, 1, 2, 3, 4, 5 and 6. Each task must be assigned to exactly one worker and each worker must be assigned to exactly one task.
(a) Write down the technical name given to the type of graph shown in Figure 1.
Figure 2 shows an initial matching.
(b) Starting from the given initial matching, use the maximum matching algorithm to find an alternating path from C to 1. Hence find an improved matching. You should list the alternating path you use, and state your improved matching.
(c) Explain why it is not possible to find a complete matching.
After training, task 5 is added to worker C’s possible allocation.
(d) Starting from the improved matching found in (b) use the maximum matching algorithm to find a complete matching. You should list the alternating path you use, and state your complete matching.
(Total 8 marks)
题目中文翻译
图 1 显示了六名工人 A、B、C、D、E 和 F 分配到六个任务 1、2、3、4、5 和 6 的可能分配方案。每个任务必须恰好分配给一名工人,每名工人必须恰好分配给一个任务。
(a) 写出图 1 所示图类型的技术名称。
图 2 显示了一个初始匹配。
(b) 从给定的初始匹配开始,使用最大匹配算法找到从 C 到 1 的交替路径。由此找到一个改进的匹配。你应该列出你使用的交替路径,并说明你的改进匹配。
(c) 解释为什么不可能找到完全匹配。
培训后,任务 5 被添加到工人 C 的可能分配中。
(d) 从 (b) 中找到的改进匹配开始,使用最大匹配算法找到完全匹配。你应该列出你使用的交替路径,并说明你的完全匹配。
(总分 8 分)
解答
(a)
解法一
思路
展开
图中的顶点分为“工人”与“工作”两组,所有边都只连接不同组的顶点,因此这类图称为二分图。
答题过程
展开
It is a bipartite graph.
(b)
解法一
思路
展开
从尚未配对的工人 出发,寻找通往尚未分配工作 的交替路径。沿路交替经过未配对边与已配对边,再把路径上所有边的配对状态互换,便可使配对数增加一个。
答题过程
展开
An alternating path from to task is
where represents an edge in the current matching. Changing the status of the edges along this path gives
Hence an improved matching is
with unmatched.
(c)
解法一
思路
展开
检查工人 可执行的工作集合。这三名工人合起来只能执行工作 和 ,因此三人无法同时获得不同工作;这违反了完全匹配所需的条件。
答题过程
展开
Workers , and can collectively perform only tasks and . Thus three workers have only two possible tasks between them, so a complete matching is impossible.
解法二
思路
展开
也可以从任务一侧检查:任务 只能由工人 完成。四个任务只有三名可用工人,每人又只能承担一个任务,因此至少一个任务无法分配。
答题过程
展开
Only workers , and can perform tasks , , and . These three workers cannot cover four tasks when each worker is assigned to exactly one task. Hence a complete matching is impossible.
(d)
解法一
思路
展开
新增边后,从未配对的工人 出发,经由新增的 到工作 的边建立增广路径,再沿 到未分配的工作 。互换路径上的配对状态,即可得到完全匹配。
答题过程
展开
An alternating path is
Changing the status of its edges gives
Together with the unchanged assignments, a complete matching is
解法二
思路
展开
同样从 出发,经 到工作 ,再通过 、工作 和 到达工作 。这条增广路径更长,但仍交替经过未配对边与已配对边,互换状态后也能得到完全匹配。
答题过程
展开
Alternatively, use the alternating path
Changing the status of its edges gives
This gives the complete matching