0
$\begingroup$

In the Partition problem, there are $n$ positive integers, and the problem is to decide whether they can be partitioned into two subsets with an equal sum. If all integers are "small" (at most some polynomial in $n$), then the problem can be solved in time polynomial in $n$ using dynamic programming. But if the integers are large (exponential in $n$), then the problem is NP-hard.

What if we constrain the possible inputs to integers that are doubly-exponential in $n$, that is, we only care about instances in which the integers are at least $2^{2^n}$. In this case, the binary encoding length of the input is at least $2^n$. Therefore, the brute-force algorithm that checks all possible partitions is polynomial in the input size. Is it true to say, therefore, that the Partition problem when all integers are "very large" is in P? So the problem is NP-hard only in the middle range, where the inputs are large but not too large?

$\endgroup$

1 Answer 1

2
$\begingroup$

Yes.

I think it is easier to look at your constrain from the other way around.

Given the input in size $n$, you allow it to be legal only if there are at most $log(n)$ numbers.

For $log(n)$ numbers the brute-force is indeed fast enough to be in $P$.

BTW, on my constrain you can allow also small numbers as well, just not "too many" of them.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.