Generate Random Takuzu - Binary Puzzle
First generate a Puzzle Solution, by solving an empty grid.
Next use random labeling, pick the first solution.
Then optimize redundancy in the Puzzle using a 'simple' solver, pick the first solution.
The 'simple' solver here is an implementation of a selection of the rules, which tries to solve the puzzle row by row.
Attachment:
takuzu_generate.pl