This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CS 341: Foundations of Computer Science II Prof. Marvin Nakayama Homework 13 Solutions 1. The Set Partition Problem takes as input a set S of numbers. The question is whether the numbers can be partitioned into two sets A and A = S A such that summationdisplay x A x = summationdisplay x A x. Show that SETPARTITION is NPComplete. (Hint: Reduce SUBSETSUM .) Answer: To show that any problem A is NPComplete, we need to show four things: (1) there is a nondeterministic polynomialtime algorithm that solves A , (2) any NPComplete problem B can be reduced to A , (3) the reduction of B to A works in polynomial time, (4) the original problem A has a solution if and only if B has a solution. We now show that SETPARTITION is NPComplete. (1) SETPARTITION NP: Guess the two partitions and verify that the two have equal sums. (2) Reduction of SUBSETSUM to SETPARTITION : Recall SUBSETSUM is defined as follows: Given a set X of integers and a target number t , find a subset Y X such that the members of Y add up to exactly t . Let s be the sum of...
View
Full
Document
This note was uploaded on 01/22/2011 for the course CIS 341 taught by Professor Nakayama during the Fall '10 term at NJIT.
 Fall '10
 Nakayama

Click to edit the document details