In Tiger Electronic's handheld electronic solitaire game Lights Out, the player strives to turn out all 25 lights that make up a $5 \times 5$ grid of cells. On each turn the player is allowed to clock on any one cell. Clicking on a cell activates a switch that causes the states of the cell and its neighbors to change from on to off or from off to on. Corner cells are considered to have two neighbors, edge cells to have three, and interior cells to have four. The diagram demonstrates what happens when the player clocks on cell (1,1) and (1,2).
Formulate an integer program for finding a way to turn out all the lights in as few turns as possible. Hints: (1) The order in which the cells are clicked doesn't matter. (2) A cell shouldn't be clicked more than once.

To formulate a MIP model, you can keep track of the number times a light has been switched on or off. We then say the final state should be even ($0,2,4,..$ means off and $1,3,5,...$ means on). So the main equation becomes:
$$ 2 y(i,j) = 1 + s_{i,j} + \sum_{(i',j') \in N(i,j)} s_{i',j'} $$
We have:
To find the minimum number of lights we switch, we minimize $\sum_{i,j} s_{i,j}$. The optimal objective is 15.