NP-完全问题证明题:
8.16 We are feeling experimental and want to create a new dish. There are various ingredients we can choose from and we'd like to use as many of them as possible, but some ingredients don't go well with others. If there are n possible ingredients(numbered 1 to n), we write down an n x n matrix giving the discord between any pair of ingredients. This discord is a real number between 0.0 and 1.0, where 0.0 means "they go together perfectly" and 1.0 means "they really don't go together." Here's an example matrix when there are five possible ingredients.
In this case, ingredients 2 and 3 go together pretty well whereas 1 and 5 clash badly. Notice that this matrix is necessarily symmetric; and that the diagonal entries are always 0.0. Any set of ingredients incurs a penalty which is the sum of all discord values between pairs of ingredients. For instance, the set of ingredients { 1, 3, 5} incurs a penalty of 0.2+1.0+0.5=1.7. We want this penalty to be small.
Experimental Cuisine
Input: n, the number of ingredients tochoose from; D, the n x n "discord" matrix; some number p≥0
Output: The maximum number of ingredientswe can choose with penalty≤p.
Show that if Experimental Cuisine issolvable in polynomial time, then so is 3 SAT.
解题思路:
给定的包含n个材料的实验A,负面影响不超过0的最大材料数集合S,可以将其高效地恢复成实例(G, g)的一个独立集。对于任意的节点i,集合S不会选择与节点i相连的那些节点,因为它们与节点i的不和谐度都是1,只要选择了就会超过p值(p值为0)。因此,如果S选了某节点,则与该节点连接的其他节点就不会包含在S中,但可以选择不相邻的节点;如果再选择一个节点,同理也不能选择与它相邻的节点,以此类推,最后得到一个集合。因为实验A中包含n个材料,每个材料代表了一个顶点,所以选出来的最大材料集合可以直接作为图G的独立集。