I have grid of dimensions H and W of boolean variables. The only constraint is that if a variable is false then at least one of the adjacent variables (top, right, left, bottom, diagonals don't count) must be true. The goal is to minimize the number of true values in the grid.
A high-level mathematical representation of this can be:
High-level model |
---|
min∑i,jxi,jxi,j=0⟹xi−1,j+xi+1,j+xi,j−1+xi,j+1≥1xi,j∈{0,1} |