Hi again!
I don't know how to write this constraints:
0 0 1 1 1 1 0 0 0 0
0 0 0 0 0 0 0 0 1 1
0 0 0 0 1 1 1 1 0 0
1 1 1 1 0 0 1 0 1 1
There must be at least two 0 between the last 1 of row 0 and the first 1 of row 1. It only applies to this rows.
It can't be no 1 in row 1 when row 0 hasn't any 1 yet. Think of this as a precedence, you must have "completed" row 0 before starting with row 1.
0 0 1 1 1 1 0 0 0 0
1 1 0 0 0 0 0 0 0 0 (this matrix combination is not possible)
0 0 0 0 1 1 1 1 0 0
1 1 1 1 0 0 1 0 1 1
For the first one I have thought the following:
for j in range(columns -2):
solver.Add(variable[0, j] + variable[1, j+1] + variable[1, j+2] <= 1)
Do you thinks is factible this constraint? Could be any errors while looping?
But for the other one, I can't come up with an idea!
Could you give a hand with this please?
Thank you all!