Notes of this continuation: hypothesis, indexing challenge, indexes, selection, calibration.
This page describes version 2026-11-28b, the program on the indexed-search page. The program published on 27 November 2026 is 2026-11-28a. It draws the whole most-negative dH page and keeps the last 20 movements.
One draw
Each iteration calls rand() once, with no srand. The eligible moves of the chosen page are counted in vertex-then-color order, and the draw takes the move at that index. The linked list is not the order of the draw. A frontier update inserts at the tail, and that order used to change which tied move was taken.
The current color of a vertex is unlinked. It is not on a page.
There is no iteration cap. iter counts takes. It starts at 0. SIGTERM, SIGHUP, and SIGINT let the current iteration finish, and the coloring where the search stopped is printed. best starts at the score after start() and falls only when the score truly falls. The solver stores that integer. It does not store the coloring that achieved it.
Tabu belongs to the movement
A movement is one vertex and one color. Another color of the same vertex is a different movement. The color just left is a different movement, and taking the new color does not make the old color tabu. A movement's tabu does not hold the vertex.
Growing tabu adds 1 iteration of tabu on every take. The first take lasts 1 iteration, the second 2, the third 3. A movement stores the iteration of its last take and how many times it has been taken. It is forbidden while
iter < last + times
A repeat is allowed when iter >= last + times. A movement never taken has times 0 and is free. The first moves of a run are free.
The four gates
The scan reads linked candidates only.
- Aspiration. If any linked move has
score + dHstrictly belowbest, the page is the most negative such dH. Tabu is included. Every move on that page has the same dH, so every move on it beatsbest. Becausebestis the minimum score seen, this page has dH < 0. Onerand()draws it. - Descent. Otherwise, if any non-tabu linked move has dH < 0, the page is the most negative such dH. A page whose every move is tabu is skipped, and the next more positive dH that still has a free move is the page. The scan stops before dH = 0. One
rand()draws that page. Positive dH is not walked here. - Opportunity. Otherwise every non-tabu move has dH ≥ 0. A move with dH < 0 may still exist and be tabu. It stays out of this draw unless gate 1 already took it. The rank is
dH − quitar + poner, which isdH + put − cut. The pool is every non-tabu move, flats and climbs together. The page is the smallest rank that has a free move. A rank whose every move is tabu is skipped, and the next larger rank is the page. Onerand()draws that exact rank. dH is inside the rank. A climb wins only whenquitarexceedsponerby enough to cover the extra conflicts. - No free move. If every candidate is tabu and none beats
best, onerand()draws the most negative dH page, tabu included, so the search does not stand still. This is the only return to a dH page after the opportunity walk has found no free move.
Gate 3 is where the search moves by opportunity. An opportunity page that is entirely tabu does not send the search back to dH. The next opportunity page is tried, and the next, until a non-tabu opportunity move is drawn, or until gate 4 is the only page left.