问题
In algorithms presented in Bringmann16 article a Boolean convolution is suggested to use to get sumset for two sets of positive integers.
In above work both sets are represented as bitmasks - indicator vectors. If represent them as polynomials in form 1 + bit(0) * x + bit(1) * x^2 + ... + bit(i) * x^(i + 1) + ... + bit(n - 1) * x^n
, then indeed their product contains only those monomials, whose power is number either in first set, or in second set or in sumset. The coefficients of product does not matter for subset sum problem. Their values just indicate how many ways to get the number (degree of corresponding monomial) as a sum of elements from first and second set or maybe 0. Value of any coefficient limited by greater size of both sets (s
).
To convert the problem of polynomials multiplication to problem of big integers (indicator vectors) multiplication there is need to append log(s)
zero bits after each bit of indicator vector. If bits (log(s) + 1) * i ... (log(s) + 1) * (i + 1) - 1
are not all clear in product bitset, then corresponding sum=i
is realizable.
For big int multiplication algorithms (Karatsuba-like or FFT-based) it gives extra logarithmic factor to problem size. I want to eliminate logarithmic padding.
I think it feasible if I use simple textbook ijk
algorithm to multiply two integers. I just need to use logical OR instead of ADD for summation. But this algorithm has quadratic runtime complexity.
Is it possible to replace summation with ORing in case of FFT-based algorithms, like Schönhage–Strassen algorithm?
回答1:
Unfortunately no. FFT- or NTT-based multiplication is based on the convolution theorem (https://en.wikipedia.org/wiki/Convolution_theorem)
The convolution theorem only works because the FFT/NTT expresses your input vector of length N as the sum of N linearly independent exponential sequences.
To make N distinct linearly independent exponential sequences, you need at least N different elements to use as bases, and that means that the size of your elements must be at least log N bits.
The type of elements and the operations used for + and * must also form a ring (https://en.wikipedia.org/wiki/Ring_(mathematics)), which OR does not satisfy.
来源:https://stackoverflow.com/questions/49051732/boolean-convolution-using-integer-multiplication