This project implements a highly optimized recursive backtracking algorithm to solve the Pentomino tiling problem. The program efficiently determines whether a given set of 12 unique pentomino pieces can fully cover a specified grid size, optimizing placement by eliminating duplicates, avoiding disconnected spaces, and reducing unnecessary computations.
- Java β Primary language for implementation
- Java Swing β Graphical user interface for visualization
- Recursive Backtracking β Algorithm for exploring valid tile placements
- Pentomino Database β Precomputed transformations for efficient piece placement
- Clone the repository
git clone https://github.com/MKBasaran/pentomino-backtracking.git cd pentomino-solver - Compile and run the program
javac Search.java java Search
- β Optimized Recursive Search: Uses pruning and connectivity checks to drastically reduce computation time.
- β
Dynamic Grid Resizing: Users can modify the board size by adjusting
horizontalGridSize
andverticalGridSize
. - β Automatic Solution Display: The solver runs automatically and fills the board within milliseconds for most cases.
- β Multiple Solutions: Running the solver multiple times may result in different valid placements.
Originally, a brute-force approach required 16 minutes to compute solutions. By implementing:
- CheckConnectivity() β Prevents invalid placements, reducing unnecessary attempts.
- Backtracking with Memoization β Stores previous configurations, cutting runtime to milliseconds.
- Kaan BaΕaran
- Nikita Souslau
- Vasil Raychev
- Luca Nichifor
- ThΓ©o Massignan
- Matteo Cannata
- Kennedy Fernandes
- πΉ Parallelization with Multi-threading β To further speed up large grid computations.
- πΉ More Efficient Heuristic Search β Evaluating piece placement strategies for faster convergence.
- πΉ Extended Grid Support β Implementing non-rectangular grids and variable constraints.