Binairo

Takuzu · binary logic
Solved this year
GitHub
MonWedFri
Streak
0 days
Solved
0
Solve time
—

Rules

PuzzleTeam defines the rules as:

Binairo is played on a rectangular grid with no standard size. Some cells start out filled with black or white circles. The rest of the cells are empty. The goal is to place circles in all cells in such a way that:

1.Each row and each column must contain an equal number of white and black circles.
2.More than two circles of the same color can't be adjacent.
3.Each row and column is unique.

Algorithm

How I actually solve one — the reasoning I run before any code does, written out in full. Read down the right column; the board on the left follows whichever step you are on.

Step 1 / 5
Step 1

Frame the board as constraints

A Binairo board of side (with even) must be filled with two symbols, ● and ○. Before touching a single cell I size up the space, because that is what tells me whether to reason or to search. Every row is a binary string of length carrying exactly of each symbol, so the count of balanced rows — ignoring the run rule for a moment — is the central binomial coefficient:

For a modest that is already 3432 legal rows, and a whole board draws one row from that set for each of lines. The naive space is therefore around — astronomically large, and completely the wrong thing to enumerate.

So I never enumerate. I treat each of the rows and columns as a live constraint and let forced cells cascade between them. Two structures carry almost the entire solve: runs (which forbid three-in-a-row) and counts (which force balance). The rest of the method is just applying those two ideas until the board stops changing.

Test

The robotic solver on real boards: the daily puzzle comes straight from the API, and the samples — 6×6 · Easy up to 30×40 · Special — replay recorded solver runs move by move.

Daily Puzzle
fetching the daily puzzle…
Solver trace
awaiting the solver service — the live trace and metrics land together with the API
Fills
—
Backtracks
—
Depth
—
Time
—