# Verhaard reimplementation

> A from-scratch reimplementation of Louis Verhaard's eii method, since his own binary ships no source and will not run here. Set-composition swap-annealing under the 2×2-tiling metric; on the real five-clue puzzle it reaches 438 of 480, single core.

- Canonical page (with interactive figures/demos): https://eternity2.dev/research/lab/experiments/louis-verhaard/verhaard-reimpl/
- Updated: 2026-07-21
- Topics: speed, local-search
- Reproduce: `just experiments single-core-benchmark`
- Source: Runnable engine + committed results + scripts (this experiment's backing directory) — https://github.com/raphael-anjou/eternity2/tree/main/research/experiments/single-core-benchmark
- Source: Louis Verhaard's eii solver details (the original, Win32 only) — https://www.shortestpath.se/eii/eii_details.html

---
> **Whose work this is**
>
> The **method** is [Louis Verhaard's](/research/lab/experiments/louis-verhaard/eii). The **code** here is a from-scratch reimplementation by [Raphaël Anjou](/research/people/raphael-anjou). It is filed here, in Verhaard's section beside the method it rebuilds, as a reconstruction: a reading of his method, not his program. The byline stays Raphaël's because the code is his; the section is Verhaard's because the idea is.

Verhaard's own eii is a source-less Windows binary that
[will not run here](/research/lab/experiments/louis-verhaard/eii). The only way
to run his approach is to rebuild it, and this is that rebuild: the same engine
that appears as `verhaard` on the
[grid](/research/lab/experiments/single-core-benchmark).

## What it reimplements

Verhaard's documented method: **set-composition swap-annealing** under the
2×2-tiling metric. Pick a roughly 180-piece interior subset, swap-anneal its
composition until the number of achievable 2×2 sub-tilings is locally maximised,
front-load the worst performers, then search the rest under that scaffold. The
engine's numeric constants were recovered byte-exact from the strings inside
`eii.exe`, because that binary is the only surviving record of them.

Calling this "running Verhaard" is a stretch worth naming: it is a reading of his
method, not his code. That it is the only way to run his approach at all is part
of the finding.

## What it does on the real five-clue puzzle

Single core, 120 seconds, all five official clues pinned:

- **438 / 480** matched edges, a **fully placed** board (256 of 256 pieces).
- All five clues respected (a strict clue solution), 42 broken edges, at roughly
  40 million nodes a second.

The run and its output board are committed in the engine's
[backing directory](https://github.com/raphael-anjou/eternity2/tree/main/research/experiments/single-core-benchmark),
and `just experiments single-core-benchmark` reruns it, so the 438 is checkable
rather than asserted. This is the five-clue instance, a harder puzzle than the
corner-pinned variants the [leaderboard](/research/lab/experiments/single-core-benchmark)
scores, where the same engine reaches a best of 451.

It found 438 within about twelve seconds and then plateaued for the rest of the
budget: a genuine local optimum for that seed and time. It is the only one of the
three community reimplementations here that solves the real, five-clue puzzle well
rather than an easier version of it, but the three are not measuring the same
thing, so the comparison needs care.
[Blackwood](/research/lab/experiments/joshua-blackwood/solver) is measured on the
same footing, matched edges with the clues pinned, and stalls near 45.
[McGavin](/research/lab/experiments/peter-mcgavin/backtracker) is not: its figure
is a placement *depth* (about 204 of 256 pieces reached), not a matched-edge score,
so it cannot be read on the same axis as the 438 here, and the two numbers are not
directly comparable. What the three share is only the verdict that the constrained
puzzle is far harder than the unconstrained one; the numbers behind that verdict
are on different scales.

## Related

- [Verhaard's eii: the solver that won the only prize](https://eternity2.dev/research/lab/experiments/louis-verhaard/eii) — The engine behind the 467, the only Eternity II score ever paid, read from Louis Verhaard's own mailing-list posts: forward pruning, comb-search fill orders, depth-gated edge slipping, a Markov-tuned slip schedule. And why his own source-less Win32 binary cannot be built or run on this machine at all.
- [Single-core benchmark](https://eternity2.dev/research/lab/experiments/single-core-benchmark) — Fifteen solvers, ours and our implementations of the community's two record backtrackers, each run once on ten corner-pinned variants of the official puzzle, single core, 60 seconds per run. The finding: node count is not score.
- [Local search and ALNS](https://eternity2.dev/research/build/local-search/local-search-alns) — Destroy part of a board, rebuild it better, and let the algorithm learn which demolitions pay. Adaptive large-neighborhood search is the most reliable polisher this project has, and the cleanest demonstration of the wall where polishing ends.
