Search Algorithms
Tabu Search
- Short Name:
TS
- Algorithm Type:
Classical
- Category:
Classical
- Native Input Format:
BQM
Usage via LunaSolve
# Example of using TS using the Luna backend in LunaSolve
solution = ls.solution.create(
optimization_id=optimization.id,
solver_name="TS",
provider="dwave",
solver_parameters={
"num_reads": None,
"tenure": None,
"timeout": 100,
"initial_states_generator": "random",
"initial_states": None,
"seed": None,
"num_restarts": 1000000,
"energy_threshold": None,
"coefficient_z_first": None,
"coefficient_z_restart": None,
"lower_bound_z": None,
},
qpu_tokens=None,
)
Usage via LunaBench
# Example of adding TS using the Luna backend as an algorithm to LunaBench
algorithms = {
"TS": {
"location": "cloud",
"provider": "dwave",
},
}
Backends
This algorithm can be run on the following backends:
Luna
Parameters
- Name
num_reads
- Type
- int | None
- Description
Number of reads. Each read is generated by one run of the tabu algorithm. If
num_reads
is not explicitly given, it is selected to match the number of initial states given. If initial states are not provided, only one read is performed.
Default:None
- Name
tenure
- Type
- int | None
- Description
Tabu tenure, which is the length of the tabu list, or number of recently explored solutions kept in memory. Default is a quarter of the number of problem variables up to a maximum value of 20.
Default:None
- Name
timeout
- Type
- float
- Description
Maximum running time per read in milliseconds.
Default:100
- Name
initial_states_generator
- Type
- Literal["none", "tile", "random"]
- Description
Defines the expansion of
initial_states
if fewer thannum_reads
are specified: 'none': if the number of initial states specified is smaller thannum_reads
, raisesValueError
. 'tile': reuses the specified initial states if fewer thannum_reads
or truncates if greater. 'random': expands the specified initial states with randomly generated states if fewer thannum_reads
or truncates if greater.
Default:"random"
- Name
initial_states
- Type
- Any | None
- Description
One or more samples, each defining an initial state for all the problem variables. Initial states are given one per read, but if fewer than
num_reads
initial states are defined, additional values are generated as specified byinitial_states_generator
.
Default:None
- Name
seed
- Type
- int | None
- Description
32-bit unsigned integer seed to use for the PRNG. If the
timeout
parameter is not None, results from the same seed may not be identical between runs due to finite clock resolution.
Default:None
- Name
num_restarts
- Type
- int
- Description
Maximum number of tabu search restarts per read. Setting this value to zero results in a simple tabu search.
Default:1000000
- Name
energy_threshold
- Type
- float | None
- Description
Terminate when an energy lower than or equal to
energy_threshold
is found.
Default:None
- Name
coefficient_z_first
- Type
- int | None
- Description
max(bqm.num_variables*coefficient_z_first, lower_bound_z)
bounds the number of variable updates considered in the first simple tabu search (STS). Variable updates arising from the STS greedy-descent subroutine, invoked upon discovery of new global optima, are excluded from the count. The coefficient defaults to 10_000 for small problems (up to 500 variables) and 25_000 for larger problems.
Default:None
- Name
coefficient_z_restart
- Type
- int | None
- Description
Controls the number of variable updates on restarted simple tabu search stages, matching the description for
coefficient_z_first
. The coefficient defaults tocoefficient_z_first/4
Default:None
- Name
lower_bound_z
- Type
- int | None
- Description
Sets a minimum number of variable updates on all simple tabu searches, see
coefficient_z_first
. The bound defaults to 500_000.
Default:None
Dialectic Search
- Short Name:
DS
- Algorithm Type:
Classical
- Category:
Classical
- Native Input Format:
BQM
Usage via LunaSolve
# Example of using DS using the Luna backend in LunaSolve
solution = ls.solution.create(
optimization_id=optimization.id,
solver_name="DS",
provider="dwave",
solver_parameters={
"decomposer": {
"size": 10,
"min_gain": None,
"rolling": True,
"rolling_history": 1.0,
"silent_rewind": True,
"traversal": "energy",
},
"tabu_antithesis": {
"num_reads": None,
"tenure": None,
"timeout": 100,
"initial_states_generator": "random",
},
"tabu_synthesis": {
"num_reads": None,
"tenure": None,
"timeout": 100,
"initial_states_generator": "random",
},
"loop": {
"max_iter": 100,
"max_time": 5,
"convergence": 3,
"target": None,
"rtol": 1e-05,
"atol": 1e-08,
},
"max_tries": 100,
},
qpu_tokens=None,
)
Usage via LunaBench
# Example of adding DS using the Luna backend as an algorithm to LunaBench
algorithms = {
"DS": {
"location": "cloud",
"provider": "dwave",
},
}
Backends
This algorithm can be run on the following backends:
Luna
Parameters
- Name
decomposer
- Type
- Decomposer
- Description
Decomposer parameters.
Default:Decomposer(size=10, min_gain=None, rolling=True, rolling_history=1.0, silent_rewind=True, traversal='energy')
- Name
tabu_antithesis
- Type
- Tabu
- Description
Tabu parameters for the antithesis phase.
Default:Tabu(num_reads=None, tenure=None, timeout=100, initial_states_generator='random')
- Name
tabu_synthesis
- Type
- Tabu
- Description
Tabu parameters for the synthesis phase.
Default:Tabu(num_reads=None, tenure=None, timeout=100, initial_states_generator='random')
- Name
loop
- Type
- Loop
- Description
Parameters for the main loop of the algorithm.
Default:Loop(max_iter=100, max_time=5, convergence=3, target=None, rtol=1e-05, atol=1e-08)
- Name
max_tries
- Type
- int | None
- Description
Maximum number of times the synthesis phase is run for the same input state. On each improvement, the better state is used for the next input state, and the try/trial counter is reset.
Default:100
Decomposer
- Name
size
- Type
- int
- Description
Nominal number of variables in the subproblem. Actual subproblem can be smaller, depending on other parameters (e.g.
min_gain
).
Default:10
- Name
min_gain
- Type
- float | None
- Description
Minimum reduction required to BQM energy, given the current sample. A variable is included in the subproblem only if inverting its sample value reduces energy by at least this amount.
Default:None
- Name
rolling
- Type
- bool
- Description
If True, successive calls for the same problem (with possibly different samples) produce subproblems on different variables, selected by rolling down the list of all variables sorted by decreasing impact.
Default:True
- Name
rolling_history
- Type
- float
- Description
Fraction of the problem size, as a float in range 0.0 to 1.0, that should participate in the rolling selection. Once reached, subproblem unrolling is reset. Min: 0.0, Max: 1.0
Default:1.0
- Name
silent_rewind
- Type
- bool
- Description
If False, raises :exc:
EndOfStream
when resetting/rewinding the subproblem generator upon the reset condition for unrolling.
Default:True
- Name
traversal
- Type
- Literal["energy", "bfs", "pfs"]
- Description
Traversal algorithm used to pick a subproblem of
size
variables. Options are: energy: Use the nextsize
variables in the list of variables ordered by descending energy impact. bfs: Breadth-first traversal seeded by the next variable in the energy impact list. pfs: Priority-first traversal seeded by variables from the energy impact list, proceeding with the variable on the search boundary that has the highest energy impact.
Default:"energy"
Tabu
- Name
num_reads
- Type
- int | None
- Description
Number of reads. Each read is generated by one run of the tabu algorithm. If
num_reads
is not explicitly given, it is selected to match the number of initial states given. If initial states are not provided, only one read is performed.
Default:None
- Name
tenure
- Type
- int | None
- Description
Tabu tenure, which is the length of the tabu list, or number of recently explored solutions kept in memory. Default is a quarter of the number of problem variables up to a maximum value of 20.
Default:None
- Name
timeout
- Type
- float
- Description
Maximum running time per read in milliseconds.
Default:100
- Name
initial_states_generator
- Type
- Literal["none", "tile", "random"]
- Description
Defines the expansion of
initial_states
if fewer thannum_reads
are specified: 'none': if the number of initial states specified is smaller thannum_reads
, raisesValueError
. 'tile': reuses the specified initial states if fewer thannum_reads
or truncates if greater. 'random': expands the specified initial states with randomly generated states if fewer thannum_reads
or truncates if greater.
Default:"random"
Loop
- Name
max_iter
- Type
- int | None
- Description
Maximum number of iterations.
Default:100
- Name
max_time
- Type
- int
- Description
Time in seconds after which the algorithm will stop.
Default:5
- Name
convergence
- Type
- int
- Description
Number of iterations with unchanged output to terminate algorithm.
Default:3
- Name
target
- Type
- float | None
- Description
Energy level that the algorithm tries to reach.
Default:None
- Name
rtol
- Type
- float
- Description
Relative tolerance for convergence.
Default:1e-05
- Name
atol
- Type
- float
- Description
Absolute tolerance for convergence.
Default:1e-08
QBSolv Like Tabu Search
- Short Name:
QLTS
- Algorithm Type:
Classical
- Category:
Classical
- Native Input Format:
BQM
Usage via LunaSolve
# Example of using QLTS using the Luna backend in LunaSolve
solution = ls.solution.create(
optimization_id=optimization.id,
solver_name="QLTS",
provider="dwave",
solver_parameters={
"qbsolv_like": {
"decomposer_size": 50,
"rolling": True,
"rolling_history": 0.15,
"cpu_count_multiplier": 1,
"loop": {
"max_iter": 100,
"max_time": 5,
"convergence": 3,
"target": None,
"rtol": 1e-05,
"atol": 1e-08,
},
},
"tabu_search": {
"num_reads": None,
"tenure": None,
"timeout": 100,
"initial_states_generator": "random",
},
},
qpu_tokens=None,
)
Usage via LunaBench
# Example of adding QLTS using the Luna backend as an algorithm to LunaBench
algorithms = {
"QLTS": {
"location": "cloud",
"provider": "dwave",
},
}
Backends
This algorithm can be run on the following backends:
Luna
Parameters
- Name
qbsolv_like
- Type
- QBSOLVLike
- Description
Parameters for the QbSolveLike solver.
Default:QBSOLVLike(decomposer_size=50, rolling=True, rolling_history=0.15, cpu_count_multiplier=1, loop=Loop(max_iter=100, max_time=5, convergence=3, target=None, rtol=1e-05, atol=1e-08))
- Name
tabu_search
- Type
- Tabu
- Description
Parameters for the Tabu Search.
Default:Tabu(num_reads=None, tenure=None, timeout=100, initial_states_generator='random')
QBSOLVLike
- Name
decomposer_size
- Type
- int
- Description
Size for the decomposer.
Default:50
- Name
rolling
- Type
- bool
- Description
Whether to use rolling for the solver.
Default:True
- Name
rolling_history
- Type
- float
- Description
Rolling history for the solver.
Default:0.15
- Name
cpu_count_multiplier
- Type
- int
- Description
CPU count multiplier for the solver.
Default:1
- Name
loop
- Type
- Loop
- Description
Parameters for the main loop of the algorithm.
Default:Loop(max_iter=100, max_time=5, convergence=3, target=None, rtol=1e-05, atol=1e-08)
Tabu
- Name
num_reads
- Type
- int | None
- Description
Number of reads. Each read is generated by one run of the tabu algorithm. If
num_reads
is not explicitly given, it is selected to match the number of initial states given. If initial states are not provided, only one read is performed.
Default:None
- Name
tenure
- Type
- int | None
- Description
Tabu tenure, which is the length of the tabu list, or number of recently explored solutions kept in memory. Default is a quarter of the number of problem variables up to a maximum value of 20.
Default:None
- Name
timeout
- Type
- float
- Description
Maximum running time per read in milliseconds.
Default:100
- Name
initial_states_generator
- Type
- Literal["none", "tile", "random"]
- Description
Defines the expansion of
initial_states
if fewer thannum_reads
are specified: 'none': if the number of initial states specified is smaller thannum_reads
, raisesValueError
. 'tile': reuses the specified initial states if fewer thannum_reads
or truncates if greater. 'random': expands the specified initial states with randomly generated states if fewer thannum_reads
or truncates if greater.
Default:"random"
Loop
- Name
max_iter
- Type
- int | None
- Description
Maximum number of iterations.
Default:100
- Name
max_time
- Type
- int
- Description
Time in seconds after which the algorithm will stop.
Default:5
- Name
convergence
- Type
- int
- Description
Number of iterations with unchanged output to terminate algorithm.
Default:3
- Name
target
- Type
- float | None
- Description
Energy level that the algorithm tries to reach.
Default:None
- Name
rtol
- Type
- float
- Description
Relative tolerance for convergence.
Default:1e-05
- Name
atol
- Type
- float
- Description
Absolute tolerance for convergence.
Default:1e-08