第八次作业
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Assignment8
3 PTAS technique
Consider an optimization version of the Hitting Set Problem defined asfollows. We are given a set A=a1,a2,…,a n and a collection B1,B2,…,B m or subsets of A. Also, each element a i∈A has a weight w i≥0. The problemis to find a hitting set H⊆A such that the total weight of the elements inH, that is, w i
a i∈H, is as small as possible. (H is a hitting set if H∩B i isnot empty for each i.) Let b=max i B i denote the maximum size of any ofthe sets B1,B2,…,B m. Give a polynomial-time approximation algorithmfor this problem that finds a hitting set whose total weight is at most
b timesthe minimum possible.
Answer: The hitting set problem is equivalent to the set cover problem: An instance of set cover can be viewed as an arbitrary bipartite graph, with sets represented by vertices on the left, elements of the universe represented by vertices on the right, and edges representing the inclusion of elements in sets. The task is then to find a minimum cardinality subset of left-vertices which covers all using a minimum subset of the right vertices. Converting from one problem to the other is therefore achieved by interchanging the two sets of vertices.
Since we have given a 2-approximate algorithm to solve the set cover problem, we get
a 2-approximate algorithm for the hitting set problem.
4 Approximation Algorithm
Consider the following maximization version of the 3-Dimensional MatchingProblem. Given disjoint sets X, Y , Z, and given a set T⊆X × Y × Zof ordered triples, a subset M⊆T is a 3-dimensional matching if eachelement of X∪Y∪Z is contained in at most one of these triples. TheMaximum 3-Dimensional MatchingProblem is to find a
3-dimensionalmatching M of maximum size. (You may assume |X| = |Y | = |Z| if youwant.)
Give a polynomial-time algorithm that finds a 3-dimensional matching ofsize at least
1
times the maximum possible size.
3
Answer: The trivial algorithm below approximates the optimal solution within 1/3. (For any triple in the found matching, consider it and all its neighbor triples. At most three of these triples can be in the optimal matching.)
T=M; M=∅;
While T≠∅do
t=any element in T;
M=M∪t;
T=T {t and all its neighbors in T};
End while;