All games
💣

Imperfect Information

Minesweeper

CSP solver with frontier enumeration.

1 player2 solversHeuristic
SAT SolverHeuristicImport stateBest moveProbabilities
Your board
Click cells to set their state. Pick a paint mode below first — click the same value again on a cell to clear it.
Paint:

Tip: paint a number to record a revealed cell. Flags mark known mines. Unknown cells are coloured by the solver from green (safe) to red (mine) after analysing.

Suggestion
Constraint-propagation + frontier enumeration. Reports the lowest mine probability and any cells provably safe or mined.
9×9 · 10 mines · 10 unflagged

Tap Analyse to compute the safest cell.

Deep dive

How BoardSolve plays Minesweeper

Minesweeper is a constraint-satisfaction problem: each revealed number is a linear constraint on the boolean 'is-a-mine' variables of its unrevealed neighbours. BoardSolve enumerates every assignment consistent with the frontier and turns the model count into exact per-cell probabilities.

Frontier enumeration

The frontier is the set of unrevealed cells adjacent to at least one number. It typically has a few dozen cells even on Expert (16×30), small enough to enumerate exhaustively by backtracking with constraint propagation.

For each consistent assignment the solver records how many mines are placed on the frontier; combined with the binomial distribution of mines on the interior 'sea', this gives an exact marginal probability for every cell on the board.

What gets surfaced

Cells with probability 0 are flagged as provably safe; cells with probability 1 are provably mines. Among ambiguous cells, the lowest-probability click is recommended — and, when that probability ties with the sea baseline, the recommendation that maximises expected information gain wins.

References & further reading

  1. Kaye, R. (2000) . Mathematical Intelligencer 22(2), 9–15Foundational complexity result motivating the CSP framing.
  2. Studholme, C. (2000) . Unpublished manuscript, University of TorontoThe frontier-enumeration recipe BoardSolve implements.
  3. Buffet, O., Lee, C.-S., Lin, W.-T. & Teytaud, O. (2017) . International Computer Symposium
  4. Couëtoux, A., Milone, M. & Teytaud, O. (2011) . TAAI 2011