← 回題庫

卷別

資料結構與演算法

申論

國立臺灣大學 2024 · 考試 · 第 13 題

考科演算法

(30 points) A vertex cover of an undirected graph G=(V,E)G = (V, E) is a subset V′⊆VV' \subseteq V such that if (u,v)∈E(u, v) \in E, then either u∈V′u \in V' or v∈V′v \in V' (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 NP=P\text{NP} = \text{P}. 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 vv is put into the cover, all edges incident on vv are covered and removed.

  • Algorithm VC-Arbitrary picks an arbitrary uncovered edge (u,v)(u, v), puts both uu and vv into the cover, throws out all edges incident on either uu or vv, and repeats the process until there are no uncovered edges left.
  • Algorithm VC-Max-Degree picks a vertex vv that covers the most number of uncovered edges, puts vv into the cover, throws out all edges incident on vv, 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 G=(V,E)G = (V, E) and a weight w(v)w(v) for each vertex v∈Vv \in V, and the objective is to find a vertex cover (covering all edges in EE) of minimum total weight. In other words, the goal is to find a vertex cover CC of GG such that ∑v∈Cw(v)\sum_{v \in C} w(v) is minimized among all possible vertex covers of GG. You are required to formulate the weighted vertex cover problem as an integer linear program.

標準解析

AI 已複查