# Mathematical model for solving minesweeper situations

Suppose there's a minesweeper board like the following:

1 1 1
A B C


Where A, B, C is an unrevealed square which could contain a mine.

This can be represented with:

A + B = 1
A + B + C = 1
B + C = 1


Which can be easily solved to show that B = 1

Now, I hope I'm in the right stackexchange for this as I'm relatively amateur with maths, but is there such thing as an algorithm that can solve these types of equation relatively quickly and simply?

-
You may find this useful: math.stackexchange.com/questions/42494/… – Beni Bogosel Sep 9 '11 at 15:26

Minesweeper belongs to the category of NP-complete problems (a type of ubiquitous but intractable combinatorial problem), and for general positions there is no known or suspected solution method that is fundamentally better than brute force search. The linear equations that encode a position have non-negative integer variables, or boolean 0-1 variables; they define instances of Integer Programming and Satisfiability respectively. Those too are well known NP-complete problems. So there is no real traction to be gained by encoding the problem this way, except for small cases where one can feed the position to SAT or integer program solvers.

http://for.mat.bham.ac.uk/R.W.Kaye/minesw/ordmsw.htm

http://www.claymath.org/Popular_Lectures/Minesweeper/

How is Minesweeper even computable with scenarios like 1 1 A B (assuming this is an island)? – Raphael Sep 9 '11 at 7:53