Given the problem with a backpack with the following inputs: n values โโof elements v i , n weights w i and the value of capacitance K (represented by k bits), we have:
The input size in bits is N = 2n * 64 + k. Therefore, the
bit-bit complexity of the DP backpack solution is O (N) = O (n * 2
k ) (constant factor 64 is ignored)
In the above calculations, the following assumption is implied: each weight w i , and each value v i can be represented by a word with a maximum size of 8 bytes or 64 bits
Further clarify:
If the capacitance doubles (K '= 2K or k' = k + 1), the inputs still contain n values โโv
i , n weights w
i and the capacitance value K '(represented by k + 1 bits). Therefore, the input size in bits is N '= 2n * 64 + k + 1 = N + 1. In conclusion, the number of bit operations doubles when k increases by one => O (N) exponentially wrt k and the pseudo-polynomial wrt K
If the number of elements doubles (n '= 2n), the inputs now contain 2n elements v
i , 2n weights w
i and a capacitance value K. Therefore, the input size in bits is N' = 2 * 2n * 64 + k. In conclusion, the number of bit operations doubles when n doubles => O (N) is the polynomial wrt n
References to bit complexity and word complexity:
http://en.wikipedia.org/wiki/Context_of_computational_complexity Book: Companion Programmer for Algorithm Analysis - Section 2.2
Kristin
source share