Tetris Solver: GA & Simulated Annealing

Tetris Solver: GA & Simulated Annealing

external-link

Sep 2025

Finished

This project implements a modern version of Tetris in Unity alongside two metaheuristic algorithms to autonomously solve piece placement: a Genetic Algorithm (GA) and Simulated Annealing (SA). The objective is finding the best arrangement for a sequence of pieces that minimizes the occupied board space. Each candidate solution encodes a sequence of piece movements. A custom fitness function evaluates the final board state. Both algorithms run extensive iteration-based experiments with configurable hyperparameters. A solution visualizer replays the best found placements in real-time during computation. The companion Python analysis module parses execution logs to generate detailed performance plots comparing GA vs SA across different configurations. A full research paper documents all implementation details, experiments, and decisions made.

Technologies
ai

AI

c-sharp

C Sharp

jupyter

Jupyter

latex

LaTeX

matplot

Matplot

pandas

Pandas

plotly

Plotly

python

Python

unity

Unity

https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/Long.gif
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/short.gif
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/Long.gif
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/short.gif
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/Long.gif
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/short.gif
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/Long.gif
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/short.gif