background: Sis a set consisting of the following 7-length sequences s: (1) each digit of s is a, b, or c; (2) s has and only has one digit that is c.
T is a set consisting of the following 7-length sequences t: (1) each digit of t is a, b, or c; (2) t has two digits that are c.
Is there a 3-partition S=A0⋃A1⋃A2, Aj∩Ai=∅ with the following property: for any Aj and any t ∈ T, there is a s ∈ Aj such that exsits a n∈{1,2,3,4,5,6,7}, sn≠tn, tn=c and sm=tm for any m≠n, where sn (or tn) is the n-th digit of s (or t).
For example, t=ccaabca and s=acaabca where n=1.
I used integer linear programming to solve the problem via lingo. I do not know how to solve the original problem directly, but I'd like to have the A0 as small as possible via lingo first. Here is the code:
MODEL:
SETS:
Y/1..448/:C,X;
Z/1..672/;
cooperation(Y,Z):A;
ENDSETS
DATA:
A=#the big incidence matrix#
C=#1,1,1,... 448 times 1#
ENDDATA;
MIN=@SUM(Y:C*X);
@FOR(Y:@BIN(X));
@for(Z(j):@sum(Y(i):X(i)*A(i,j))>1);
@for(Z(j):@sum(Y(i):X(i)*A(i,j))<2);
END
But the code run a long time without any answer. I appreciate any answers to original questions or suggestions for lingo code.
Seems like a coding theory problem, which tend to be very hard, especially with integer programming due to the symmetry (maybe you have access to a good solver with symmetry breaking, but I still tend to think that constraint programming will fare better). The smallest part of the partition must have at most ⌊448/3⌋ = 149 strings, yet a quick constraint solver setup (OR-Tools CP-SAT solver, below) couldn’t get there in the time that I ran it.