AI Minesweeper project
Asked Answered
M

1

8

I need to implement Minesweeper solver. I have started to implement rule based agent. I have implemented certain rules. I have a heuristic function for choosing best matching rule for current cell (with info about surrounding cells) being treated. So for each chosen cell it can decide for 8 surroundings cells to open them, to mark them or to do nothing. I mean. at the moment, the agent gets as an input some revealed cell and decides what to do with surrounding cells (at the moment, the agent do not know, how to decide which cell to treat).

My question is, what algorithm to implement for deciding which cell to treat?

Suppose, for, the first move, the agent will reveal a corner cell (or some other, according to some rule for the first move). What to do after that?

I understand that I need to implement some kind of search. I know many search algorithms (BFS, DFS, A-STAR and others), that is not the problem, I just do not understand how can I use here these searches.

I need to implement it in a principles of Artificial Intelligence: A modern approach.

Marasco answered 6/7, 2012 at 20:37 Comment(0)
H
8

BFS, DFS, and A* are probably not appropriate here. Those algorithms are good if you are trying to plan out a course of action when you have complete knowledge of the world. In Minesweeper, you don't have such knowledge.

Instead, I would suggest trying to use some of the logical inference techniques from Section III of the book, particularly using SAT or the techniques from Chapter 10. This will let you draw conclusions about where the mines are using facts like "one of the following eight squares is a mine, and exactly two of the following eight squares is a mine." Doing this at each step will help you identify where the mines are, or realize that you must guess before continuing.

Hope this helps!

Humperdinck answered 6/7, 2012 at 21:9 Comment(1)
I have implemented some of these techniques in rules, I have implemented certain method: treatCell(i_CellToTreat), it matches the best rule and executes it. I just do not know in which order to treat revealed cells, and which next of them to choose to treat, at the moment it just iterates throughout the collection of revealed cells and treats them. It works pretty well on a small board, but I need to implement some better algorithm.Marasco

© 2022 - 2024 — McMap. All rights reserved.