I'm looking for an algorithm to solve, or at least a proper name for the following problem:
I have a set B of bitstrings. The algorithm should find a minimal (defined as "having fewest bits set") bitstring S such that:
For all b in B, there exists a shift N (in ℤ) such that
(S << N) & b == b
.
If it helps, each b fits in a machine word, and |B| is on the order of a couple hundred.
I think we can assume (without loss of generality) that the LSB of S and each b is 1.
This looks to me like some kind of multiple sequence-alignment problem.
If we can find each Ni for each bi in B (i = 1 .. |B|), it looks like S is just the bitwise-or across all (bi >> Ni).
My intuition is, the first step is to remove every b from B for which there exists another bitstring c in B and some shift M such that b & (c << M) == b
. What's next?