### np-complete

#### Effect of number base when proving NP completeness of numerical problems

I am reading about NP completeness from the algorithm design book of tardos, In the section of proving subset sum is NP complete, it is written that - The algorithm developed for subset sum has running time of O(nW). If an instance of 100 numbers is given, each of which is 100 bits long then the input is only 100 * 100 = 10000 digits, but W is roughly 2^100. I dont understand this claim, why is W 2^100 ? what is the effect of base on this problem, I mean if we change it to some other base x, would W be x^100 ? what if we change it into unary base ? thanks.

To understand this you need to think about how the running time of the algorithm changes as the size of the numbers in the problem set grows. I'm assuming that your textbook describes the usual dynamic programming attack on subset sum. That algorithm's run time grows linearly with the width of the problem set. (The problem set width is the sum of the positive numbers in the set minus the sum of the negative numbers.) This width grows exponentially as you increase the size of the numbers in the set. For example, if you use 101 bit numbers instead of 100 bit numbers, the width of the problem set doubles. Move to 102 bit numbers and the problem set width doubles again. And since the algorithm's run time grows linearly with the problem set width, that run time doubles each time as well. This doubling is exponential growth in run time as the input size grows linearly, so this is not a polynomial-time algorithm. If the numbers were written in a different base > 1, then yes, you would see exponential growth of the problem width in that base. For example, in base 10 adding another digit makes the problem width ten times larger. If you switch to unary, you lose the exponential growth in the problem set size, but instead the input size for any given problem is exponentially larger than it would be in bases > 1, so you gain nothing.

### Related Links

Is vertex coloring of hypergraph with no uniformity restriction NP-hard?

Grid dominating set is NP-complete

Given a graph with n vertices and m edges, does it contain a simple cycle of length ⌈n/2⌉?

NP-complete or NP-hard?

Why using linear integer programming (ILP) though it is NP-Complete?

Prove NP-Completeness of generating 2 shortest routes over given edge grouping constraints?

Reduction to Clique prob

Approximation Algorithm between two NP compete problems

Is it possible to find the probability to a solution of NP-complete problems?

Knapsack for each weight having multiple values - Is it possible to solve?

Reduction from Maximum independent set to Dominating set to prove the Dominating set is NP-complete

How I can prove that 2-CNF is not NP-complete?

When NP complete becomes NP hard

Can it be proven no polynomial algorithm exists for an NP-Complete prob.?

Effect of number base when proving NP completeness of numerical problems

How to reduce 3COLOR to 3SAT?