Skip to content

[Experimental work in progress] Add experimental heuristic search for Gecode 6.5 - #256

Draft
zayenz wants to merge 17 commits into
feature/open-cpfrom
feature/open-search
Draft

zayenz wants to merge 17 commits into
feature/open-cpfrom
feature/open-search

Conversation

@zayenz

@zayenz zayenz commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Adds experimental heuristic search for Gecode 6.5.0, stacked on #248.

A*, configurable best-first search, complete anytime beam search (CABS), and progressive column search operate on ordinary Space subclasses. Ranking, admissible bounds, and optional state dominance pruning are separate interfaces. The engines are sequential and accept incumbents using an exact scalar integer objective supplied by the user.

Includes conventional constraint programming and transition formulations of the travelling salesman problem with time windows (TSPTW), benchmark instances, an independent tour checker, and comparison scripts. The kernel exposes a preparation callback; the search layer owns completion trials and their stop/statistics accounting. Completion witnesses are invalidated after dependent decisions, cuts, or constraint posting, including posting through a cached Home.

The engines are disabled by default. Enable them with GECODE_ENABLE_EXPERIMENTAL=ON or --enable-experimental. Changelog entries accept Experimental: true or false (omission means false), with experimental changes listed separately. Preview APIs may change.

Validated on macOS:

  • Full checks passed with experimental features enabled (479/479) and disabled (475/475).
  • Current focused search checks passed for five iterations with experimental features enabled (14/14), disabled (10/10), and under ASan+UBSan (14/14). macOS leak detection is unavailable. Kernel-only compilation and linkage also passed.
  • Benchmark record checks passed (13/13), including optimality contradictions from checked tours in failed runs.
  • Tiny TSPTW cases matched exhaustive optima across BAB, A*, CABS, and Column with independent tour validation. Search examples and independent code review passed.

Ordinary Gecode 6.x search can miss an incumbent improvement when establishing it requires hidden completion search. The heuristic engines use scalar objective comparisons for admission. Linux and Windows have not been validated.

The committed .zdev research and task records are for development and will be removed before squash merge.

@zayenz zayenz changed the title Add experimental heuristic search for Gecode 6.5 [Experimental work in progress] Add experimental heuristic search for Gecode 6.5 Oct 13, 2026
zayenz added 17 commits October 14, 2026 06:50
Construct boards through an OpenIntVarList path transition and compare
with a bounded array model using the same slide and goal rules. Minimize
moves with BAB, and expose independent scramble, seed, and move-limit
options. Keep the default move limit at twelve for a short demonstration.

Register the example in CMake and Autoconf, including its generated
include dependencies, and document state-versus-move length accounting.

Validated both models in Debug and ASan/UBSan builds with the defaults,
an explicit scramble/limit/seed case, a solved start, and an insufficient
move bound. Replayed every printed path to verify legal slides and the
goal board. Independent Astra review passed.
Zdev-Change-Id: Z3a84f10967609b95b8d767472cd476f6d65d3b852ac05f06ffbd7ee533e2dff6
Zdev-Change-Id: Zf7164128cb1c60f3502e6dd904bfae78a1c067fc6b1e32fac4d8d76ab5c76bec
Zdev-Change-Id: Zc598681fcab190d75394270ba287657f523f67370c84776cda96117c3db3269a
Zdev-Change-Id: Z7b809ac2be0294a753b5f04da7261e3f03135f5864c0715cc88211329634cfea
…entries

Zdev-Change-Id: Z6c14976b91b4983c41b4d8aba39c65183b90baac364c11cd459868c3d515f7ac
Zdev-Change-Id: Z3b4a698a6fbd8abd10a3b7bdc565ae3f5b3308cd222245962cbcc7c6d8f503cf
Zdev-Change-Id: Z3b6d8222c576b70bbe9e85ec7b92b5365cefe2eaa836ed4adf89b501642550be
Invalidate completion witnesses after dependent decisions and incumbent cuts, propagate nested stop/statistics through ordinary search, and handle prepared terminal spaces. Compact CABS dominated candidates once.

Use the existing exact scalar guidance for native incumbent acceptance and remove the extracted Gecode 7 comparison API. Preserve ordinary Gecode 6.x model compatibility and document its existing hidden-completion admission limitation.

Independently verified experimental ON 479/479, OFF 475/475, focused and fresh ASan+UBSan 16/16, native examples, independent tiny TSPTW checks and CADDS witness.

Zdev-Change-Id: Z7ac9860f3c380e35cd3ad5e9e7581b300387e90413a48deae4c40e1d6614e440
Remove kernel dependencies on search types and use a preparation driver with kernel propagation statistics. Pack restriction notification into existing Space control state, and use persistent brancher lifecycle hooks.

Validated experimental ON/OFF checks, focused completion/search checks, ASan+UBSan, kernel-only linkage, source inventory and examples. Independent Astra high review passed.

Zdev-Change-Id: Zd9f8a980386fc4e0ee6d9c5087730288f4ace2dd62e3b52d7e837fe0311b69e8
Notify branchers through PostInfo when a cached Home posts a new restriction. Exercise the resulting false-solution case in the existing completion fixture.

Zdev-Change-Id: Z2b63a02c2beaea98e961b403daf9d21faa5b48bd9f2a48f055d02e2bf02d937e
Reject a contradicted optimum even when the cheaper checked tour comes from a failed run. Keep failed runs excluded from performance comparisons.

Zdev-Change-Id: Z177814b6014bcfe8af3cbd9f8be9308b0e620c4ae4485487ab77125935d2a342
Zdev-Change-Id: Z4d366a03b245f7a3abeb3df97fa01dd5a57aaab19774146e8029115ac9bacefc
Zdev-Change-Id: Z5e0354b9ca7c3acb8bafb8a35ba21177068604db5820513e8a0723839ae04a64
@zayenz
zayenz force-pushed the feature/open-search branch from 04c3c02 to 15af41e Compare October 14, 2026 05:08

This branch has not been deployed

No deployments
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.

1 participant