I have N binary sequences of length L, where N and L are possibly very large, and these sequences can be very sparse, say, have much more 0s and then 1s.
I want to select from them M sequences, namely b_1, b_2, b_3 ... so that
b_1 | b_2 | b_3 ... | b_M = 1111...11 (L 1s)
Is there an algorithm to achieve it?
My idea:
STEP1: for a position from 1 to L, count the total number of sequences that have 1 in that position. Call it Owner Number
STEP 2: Consider a position that has a minimum quantity, and select a sequence that has a maximum number of 1s from its own sequence of that position.
STEP3: ignore the selected sequence, update the owner number and return to STEP2.
I believe that my method cannot give a better answer.
Anyone have a better idea?
source share