8.12 The k-SPANNING TREE problem is the following.
Input: An undirected graph G = (V,E)
Output: Aspanningtreeof G in which each node has degree≤ k, if such a tree exists.
Show that fo rany k ≥2:
(a) k-SPANNING TREE is a search problem.
(b) k-SPANNING TREE is NP-complete. (Hint: Start with k = 2 and consider the relation between this problem and RUDRATA PATH.)
(a) 明显可知,给定一个图,用一般的DFS或者BFS就可以验证其是否为一个k生成树,所以这是一个NP问题
(b) hint说了将k=2来证。当k<=2时,说明这棵树上的结点要么没有其他点与其相连(k = 0),要么其父节点与其相连(k = 1),要么连着一个父节点与一个子节点或连着两个子节点(k = 2),明显这是一个 RUDRATA PATH问题,那么反之亦然。因为RUDRATA PATH是一个NP-complete问题,所以k-SPANNING TREE也是一个NP-complete问题。