卷別
資料結構與演算法
申論國立臺灣大學 2024 · 考試 · 第 13 題
(30 points) A vertex cover of an undirected graph is a subset such that if , then either or (or both). The size of a vertex cover is defined as the number of vertices in it. The vertex-cover problem is to find a vertex cover of minimum size in a given undirected graph. It has been shown to be NP-hard, thus we cannot find a polynomial-time algorithm for solving it exactly unless . Fortunately, some polynomial-time approximation algorithms have been proposed for solving the vertex-cover problem.
The following two approximation algorithms take as input an undirected graph and compute a vertex cover for it. Initially, all edges in the graph are uncovered for both Algorithm VC-Arbitrary and Algorithm VC-Max-Degree. Once a vertex is put into the cover, all edges incident on are covered and removed.
- Algorithm VC-Arbitrary picks an arbitrary uncovered edge , puts both and into the cover, throws out all edges incident on either or , and repeats the process until there are no uncovered edges left.
- Algorithm VC-Max-Degree picks a vertex that covers the most number of uncovered edges, puts into the cover, throws out all edges incident on , and repeats the process until there are no uncovered edges left.
(a) (10 points) Give an example for which Algorithm VC-Arbitrary yields a solution that is at least double the size of a minimum-size vertex cover. Give another example for which Algorithm VC-Max-Degree will definitely yield a solution with the size more than that of a minimum-size vertex cover no matter how it breaks the tie. Each example should contain no more than ten vertices. You have to justify your solution by showing the vertex cover found by the algorithm and its corresponding minimum-size vertex cover.
(b) (10 points) Prove or disprove that Algorithm VC-Arbitrary has a smaller ratio bound than Algorithm VC-Max-Degree. The ratio bounds in your proof or disproof should be as tight as possible.
(c) (10 points) In the weighted vertex-cover problem, you are given an undirected graph and a weight for each vertex , and the objective is to find a vertex cover (covering all edges in ) of minimum total weight. In other words, the goal is to find a vertex cover of such that is minimized among all possible vertex covers of . You are required to formulate the weighted vertex cover problem as an integer linear program.