| Did you know ... | Search Documentation: |
| Pack logtalk -- logtalk-3.102.0/docs/apis/_sources/tabu_search_2.rst.txt |
.. index:: single: tabu_search(Problem,RandomAlgorithm)
.. _tabu_search/2:
.. rst-class:: right
object
tabu_search(Problem,RandomAlgorithm)Problem - Problem object implementing tabu_search_protocol.RandomAlgorithm - Random number generator algorithm for the fast_random library (e.g. xoshiro128pp, xoshiro256ss, well512a, ...).
Tabu search optimization algorithm. Parameterized by a problem object implementing the tabu_search_protocol protocol and by a random number generator algorithm for the fast_random library. The algorithm minimizes the energy (cost) function defined by the problem. Custom stop conditions, delta-energy neighbor generation, full neighborhood enumeration, progress reporting, and restarts can be defined by the problem object or configured via options; suitable defaults are used otherwise.
| Availability:
| logtalk_load(tabu_search(loader))
| Author: Paulo Moura | Version: 1:0:0 | Date: 2026-08-15
| Compilation flags:
| static, context_switching_calls
| Imports:
| public :ref:`options <options/0>`
| Uses:
| :ref:`fast_random(Algorithm) <fast_random/1>`
| :ref:`list <list/0>`
| :ref:`type <type/0>`
| Remarks:
tabu_tenure. With tabu_tenure_range(Min, Max) each accepted move is assigned a random tenure drawn uniformly from the inclusive range.candidates(N) neighbors using neighbor_state/2 (or neighbor_state/3 when defined). If the problem defines neighbors/2, that complete list is used instead (or a random sample of it when larger than the candidate limit).updates(N) option. A final report is always produced when the loop terminates.seed(S) option initializes the random number generator for reproducible runs.restarts(N) option runs N additional tabu search cycles after the first. Each restart begins from the best state found so far with a cleared tabu list, allowing the search to escape deep local minima. Statistics accumulate across all cycles.| Inherited public predicates: | Â :ref:`options_protocol/0::check_option/1` Â :ref:`options_protocol/0::check_options/1` Â :ref:`options_protocol/0::default_option/1` Â :ref:`options_protocol/0::default_options/1` Â :ref:`options_protocol/0::option/2` Â :ref:`options_protocol/0::option/3` Â :ref:`options_protocol/0::valid_option/1` Â :ref:`options_protocol/0::valid_options/1` Â
.. contents:: :local: :backlinks: top
.. index:: run/2 .. _tabu_search/2::run/2:
run/2 ^^^^^^^^^
Runs the tabu search algorithm using default options and returns the best state found and its energy.
| Compilation flags:
| static
| Template:
| run(BestState,BestEnergy)
| Mode and number of proofs:
| run(-nonvar,-number) - one
.. index:: run/3 .. _tabu_search/2::run/3:
run/3 ^^^^^^^^^
Runs the tabu search algorithm using the given options and returns the best state found and its energy.
| Compilation flags:
| static
| Template:
| run(BestState,BestEnergy,Options)
| Mode and number of proofs:
| run(-nonvar,-number,+list(compound)) - one
| Remarks:
max_steps(N) option: Maximum number of iterations per cycle (default: 10000).tabu_tenure(T) option: Fixed tabu tenure: maximum lifetime (in steps) of each tabu entry (default: 7). Ignored when tabu_tenure_range/2 is also present.tabu_tenure_range(Min, Max) option: Random tabu tenure: on each accepted move a tenure is drawn uniformly from the inclusive integer range Min..Max. Overrides tabu_tenure/1 when present.candidates(N) option: Number of candidate neighbors examined per iteration (default: 20).updates(N) option: Number of progress reports during the run. Set to 0 to disable. Progress is reported by calling progress/5 on the problem object (default: 0).seed(S) option: Positive integer seed for the random number generator, enabling reproducible runs (default: none).restarts(N) option: Number of additional tabu search cycles after the first. Each restart begins from the best state found so far with a cleared tabu list (default: 0)... index:: run/4 .. _tabu_search/2::run/4:
run/4 ^^^^^^^^^
Runs the tabu search algorithm using the given options, returns the best state found and its energy, and returns run statistics.
| Compilation flags:
| static
| Template:
| run(BestState,BestEnergy,Statistics,Options)
| Mode and number of proofs:
| run(-nonvar,-number,-list(compound),+list(compound)) - one
| Remarks:
Key(Value) pairs: steps(N) is the number of steps executed, acceptances(A) is the number of accepted moves, improvements(I) is the number of moves that improved the best energy, and final_tabu_size(S) is the number of non-expired tabu entries at termination.(no local declarations; see entity ancestors if any)
(no local declarations; see entity ancestors if any)
(none)
.. seealso::
:ref:`tabu_search(Problem) <tabu_search/1>`, :ref:`tabu_search_problem_protocol <tabu_search_problem_protocol/0>`