8.9 In the HITTING SET problem, we are given a family of sets {S1, S2, ..., Sn} and a budget b, and we wish to find a set H of size <= b which intersects every Si, if such an H exists. In other words, we wants H ∩ Si ≠ ∅ for all i.
Show that HITTING SET is NP-complete.
证明:
(1)首先证明HITTING SET是NP问题,要验证H是否符合题意要求,只需判断H的大小是否小于等于b以及H与每个子集Si是否相交,所需的时间复杂度为O(nHS),其中H代表集合H的大小,S代表子集Si大小的最大值。因此,该问题可以在多项式时间内验证,即HITTING SET是NP问题。
(2)证明HITTING SET为NP完全问题,