It shows an algorithm/solver for a particular kind of packing problems, speficially polyomino packing.
Note: The polyomino packing problem is NP-hard and this algorithm does not stricly speaking 'solve' it.
What it does do is it uses a heuristic process to compute 'some pretty good solution' extremely fast and its runtime complexity scales linearly with the problem size.
The solver itself is part of the incstd library.
This was inspired by Advent of Code 2025 Day 12 Advent of Code 2025 Day 12.
Note: It does not directly provide answers to the puzzle itself.
Note: The animation below shows slowed down recording of how the solver progresses.
Note: Typical runtime on modern hardware for a problem like the one below is measured in miliseconds.
Requires C++26, requires CMake.
As of August 2026 builds with GCC 16.1+, Clang 22+, Emscripten 6.0.1+.
As of August 2026 does NOT build with MSVC (MSVC STL lacks pack indexing feature of C++26)
Note: libc++ does not yet fully implement parallel algorithms and the solver is measurably slower as a result when using libc++ (ie. when compiling with Emscripten, Apple Clang, and in some other setups).
This code is free to use under the terms of the MIT license.