Project Overview
This project consists of a React frontend and a Python FastAPI backend that work together to visualize an AI solving Minesweeper puzzles in real-time.
Demonstration of the AI solving a Minesweeper puzzle
AI Algorithm
My minesweeper solver employs multiple sophisticated strategies to efficiently solve puzzles:
Set Operations
Uses set pair subtraction and division to find guaranteed solutions
Constraint Satisfaction
Applies forward checking and backtracking to find probabilities of tiles being safe or bombs
Bayesian Analysis
When no moves are guaranteed, uses a Bayesian tree algorithm to balance probability and information gain
Heuristic Optimization
For large frontiers, limits calculation time and makes predictions based on estimated probabilities
Features
- Generate Minesweeper puzzles with different difficulty levels and sizes
- Watch the AI solve the puzzles step by step
- Control playback speed and navigate through moves
- View the outcome of each puzzle (win/lose)
- Interactive visualization of the AI's decision-making process
Project Structure
- Frontend: Next.js React application with interactive visualization components
- Backend: FastAPI Python application that houses the Minesweeper solver algorithms
- Containerization: Docker setup for easy deployment and consistent environments
Technical Implementation
The project uses Docker for containerization, making it easy to set up and run on any system. The frontend communicates with the backend API to generate puzzles and receive solver moves. The AI makes decisions in real-time, with the frontend visually displaying each step of the solution process.