\ Here the variable x12c2 is 1 or 0 according to \ whether or not the row 1, col 2 square has \ colour number 2 \ The objective is unimportant, since we are interested in feasibility Maximize x11c1 Subject To \ Values specified by the puzzle x21c2 = 1 \ Square 11 has one of the two colours x11c1 + x11c2 = 1 \ Similarly for all other squares: x12c1 + x12c2 = 1 x21c1 + x21c2 = 1 x22c1 + x22c2 = 1 \ Row 1: all colours occur once: x11c1 + x12c1 = 1 x11c2 + x12c2 = 1 \ Same for row 2 x21c1 + x22c1 = 1 x21c2 + x22c2 = 1 \ Same for the columns x11c1 + x21c1 = 1 x11c2 + x21c2 = 1 \ x12c1 + x22c1 = 1 x12c2 + x22c2 = 1 Binary x11c1 x11c2 x12c1 x12c2 x21c1 x21c2 x22c1 x22c2 End