Computer Science and Engineering, Department of

 

Date of this Version

2006

Comments

Bayer, Snyder & Choueiry in Proceedings of the National Conference on Artificial Intelligence (AAAI 2006, Boston, Massachussets). Pages 1,933-1,934. Copyright 2006, AAAI. Used by permission.

Abstract

We present a Java applet that uses Constraint Processing (CP) to assist a human in playing the popular game Minesweeper. Our goal is to illustrate the power of CP techniques to model and solve combinatorial problems in a context accessible to the general public.

Minesweeper is a video game that has been included with Microsoft Windows since 1989. In this game, the player is presented with a grid of squares. Each of these squares may conceal a mine. When the player clicks on a square, it is revealed. If the square is a mine, the game is over. If the square is not a mine, it is replaced by a number indicating how many of the adjacent squares are mines. The goal of the game is to reveal all squares that are not mines. These simple rules yield a complex problem: Kaye proved that the minesweeper-consistency problem is NP-complete (2000). The minesweeper-consistency problem is to determine if, given a board with some known squares, there exists a layout of mines in the unknown squares that is consistent with the numbers displayed.

A few programs have been written to solve Minesweeper. One notable such program was developed by Collet (2004), and uses the Oz language to model and solve Minesweeper as a set of Boolean linear constraints. In his implementation, Collet defines constraints intensionally and generates dual variables to achieve higher-level consistency. This model artificially and unnecessarily increases the number of variables (thus increasing the cost in terms of time and space), and obscures the concept of ‘consistency level,’ which is central to Constraint Processing.

Like (Collet 2004), our program assists the player in solving Minesweeper puzzles by modeling them as Constraint Satisfaction Problems (CSPs). Although our model is similar to that of Collet, it was developed independently. Also, our constraints are defined in extension, and, importantly, our implementation uses text- book propagation-algorithms to determine the locations of mines, thus better serving our pedagogical goals.

We briefly discuss our motivations, then describe our model, interface and implementation.

Share

COinS