sokoban solver using genetic algorithms
Go to file
mos b9949eff67 improve read_rle 2025-03-03 15:33:05 +01:00
map add microban maps 2024-12-17 21:10:41 +01:00
src improve read_rle 2025-03-03 15:33:05 +01:00
.gitignore initial commit 2024-10-10 13:43:15 +02:00
Cargo.lock rename 2025-03-02 17:01:06 +01:00
Cargo.toml rename 2025-03-02 17:01:06 +01:00
LICENSE initial commit 2024-10-10 13:43:15 +02:00
README.md rename 2025-03-02 17:01:06 +01:00

README.md

sobagen

Sokoban solver using genetic algorithms.

Description

sobagen is a sokoban solver that uses a genetic algorithm to calculate the most optimal solution for a given map. The heuristic approach covered by the tool is twofold and can be described as follows:

  1. Place the boxes in the given goals in as fewer steps as possible. While this is not guaranteed, it can be improved either through subsequent iterations or decreasing the search space (controllable via -d/--ds argument).
  2. If any box is placed in such a way that the agent can no longer move it, this is considered a losing condition and it is no longer evaluated. The evaluation is scored by calculating the individual box distances and the highest scoring agents end up as a parent to newly bred agents.

The approach described above is computationally suboptimal compared to others and has a tendency to "halt" with more complex problem spaces, therefore it is more suitable for smaller levels. To avoid early convergence one can tune the parameters according to the complexity of the layout.

Usage

sobagen --nt 4 -d 4096 -m 256 --ps 8192 < map

sobagen '8X|4.1@*gX|8X'

Maps

Some of the maps in the map directory were manually altered and are taken from here. Maps map8-9 are from microban.