Skip to content

Use incremental cost in Tabu Search - #275

Open
abussy-pasqal wants to merge 1 commit into
prerelease/v1.0from
274-use-incremental-cost-in-tabu-search
Open

abussy-pasqal wants to merge 1 commit into
prerelease/v1.0from
274-use-incremental-cost-in-tabu-search

Conversation

@abussy-pasqal

Copy link
Copy Markdown
Member

Track tabu_search costs incrementally instead of recomputing every neighbor

Each iteration previously materialized a full (n_bitstrings, n, n) neighbor tensor and recomputed x^T Q x for every candidate flip via batched_quadratic_cost, O(n_bitstrings * n^2) per iteration. Maintain Qx incrementally instead and derive every candidate's delta from it via _flip_deltas (O(n_bitstrings * n)), with a periodic exact recompute (_REFRESH_EVERY) to bound rounding drift, mirroring simulated_annealing's approach. The final result now goes through Solution.deduplicate + _update instead of a bespoke torch.unique/batched_quadratic_cost block.

…ighbor

Each iteration previously materialized a full (n_bitstrings, n, n) neighbor
tensor and recomputed x^T Q x for every candidate flip via
batched_quadratic_cost, O(n_bitstrings * n^2) per iteration. Maintain Qx
incrementally instead and derive every candidate's delta from it via
_flip_deltas (O(n_bitstrings * n)), with a periodic exact recompute
(_REFRESH_EVERY) to bound rounding drift, mirroring simulated_annealing's
approach. The final result now goes through Solution.deduplicate + _update
instead of a bespoke torch.unique/batched_quadratic_cost block.
@abussy-pasqal abussy-pasqal added this to the v1.0.0-alpha milestone Sep 14, 2026
@abussy-pasqal abussy-pasqal self-assigned this Sep 14, 2026
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