Skip to content

Use min-conflicts and tabu search (bb4-optimization) in Red puzzle and Tantrix; benchmark rows - #68

Merged
barrybecker4 merged 3 commits into
masterfrom
claude/new-strategies
Oct 25, 2026
Merged

barrybecker4 merged 3 commits into
masterfrom
claude/new-strategies

Conversation

@barrybecker4

Copy link
Copy Markdown
Member

Red puzzle: pieces report which of them have a loose edge (conflictedPositions) and understand a single swap, so MIN_CONFLICTS and TABU_SEARCH work. Both solved 12/12 runs in a 15 s limit (median 20 ms and 60 ms on this machine); genetic search solved 9/12, iterated local search 4/12, annealing 2/12.

Tantrix: a path cannot be changed by one swap, so only TABU_SEARCH is added (random neighbors, restarting every 50 stagnant steps so the walk does not drift off the board; without that it crashed on 12 tiles). It is slow there (solves 12 tiles, about 9 s).

Needed because bb4-optimization now has these strategies: the existing check that every applicable strategy is an algorithm requires the entries.

Benchmarks: docs/benchmarks.* has a new column 2.1-SNAPSHOT+strategies, made on a 2-CPU Linux machine with a 15 s limit and 3 repetitions (Tantrix 3 to 12 tiles), so it is not comparable with the Mac columns; re-run ./gradlew benchmark on the Mac to replace it. Existing tests pass apart from two Tantrix permuter suites (PathPivotPermuterSuite, SubPathMutatorBase) that I did not touch.


Generated by Claude Code

Red reports its loose pieces as conflicted positions and understands single swaps, so min-conflicts and tabu search work on it. A Tantrix path cannot be changed by a swap, so only tabu search (through random neighbors) is offered there.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0175jMLxrP7wZ3vfj6UfeDZx
… board

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0175jMLxrP7wZ3vfj6UfeDZx
Run on this machine (2 CPUs, Linux) with a 15 s limit and 3 repetitions, Tantrix sizes 3 to 12, so it is a separate column from the 2.0.0 and 2.1-SNAPSHOT runs made on a Mac.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0175jMLxrP7wZ3vfj6UfeDZx
@barrybecker4
barrybecker4 merged commit cd45b69 into master Oct 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants