Is this problem NP-hard?
Hint: Consider a 3SAT problem with L clauses, each clause corresponding
to a bit position in 3 L-bit numbers. If you solved the above problem
with 3 such numbers, what would it tell you if you got 111 as the
result? What if you got something other than 111?
Alan
MAX-SAT is very similar to this problem, but MAX-SAT does not restrict
the number of true bool variables. In my case the number of ture
variables (how many e(i) is true, 1<= i <= N) must be M.
I am wondering whether I can get a reduction from MAX-SAT. I have been
working on this problem for weeks, I still get nothing now.
Am I on the right way? Maybe this problem is in P?
>Is this problem NP-hard?
Are you concerned with the complexity with respect to L or not?
>I am concerned with N and M. L can be a constant.
Surely in that case it's polynomial, since M is at most L.
Just examine the O(N^M) possible combinations of M numbers to
find a set whose OR has the maximal number of bits set.
I suspect there are much more efficient algorithms.
As I said, M is at most L, which is a constant, so it is polynomial.
Consider some solution: a set of numbers whose OR has at most L 1's.
Each number must contribute at least 1 distinct 1 bit, or it is
redundant and can be removed without affecting the maximality of
the solution. So M need never be greater than L.
Of course if you insist on exactly M numbers in a solution rather
than at most M numbers, and M > L, you can add any numbers you like
to a solution just to pad it out, but these can be chosen arbitrarily.
To find a solution you need consider only O(N^L) combinations.
My problem is in fact the same as MAXIMUM COVERAGE
PROBLEM(http://www.ensta.fr/~diam/ro/online/viggo_wwwcompendium/node146.html),
which is known to be NP-Hard. So I think the problem is NP-Hard.