JijSolver
In the current implementation, JijSolver runs a simple weighted local search algorithm where constraints are directly taken care of. In other words, problems are solved without been converted to QUBO.
Usage
Two classes are provided by jijzept:
JijSolver: a class to solve given problem by local search.JijSolverParameters: a class to set parameters for JijSolver. A solution is obtained by runningsample_modelmethod inJijSolverclass.
from jijzept import JijSolver, JijSolverParameters
solver = JijSolver(config="./config.toml")
parameters = JijSolverParameters(num_iters=8, count=5)
response = solver.sample_model(
model=problem,
feed_dict=instance_data,
parameters=parameters,
max_wait_time=300,
)
Parameters
JijSolverParameters
| name | type | default | description |
|---|---|---|---|
num_iters | int | 4 | The number of iterations (each iteration consists of local search and update of the weights). |
time_limit_msec | Optional[float] | None | Specifies the duration for each LS (in milliseconds). |
count | Optional[int] | None | The number of iterations during each SA (LS) part. |
ignored_constraints | Optiona;[list[str]] | None | The list of constraint names to be ignored. |
JijSolver.sample_model
| name | type | default | description |
|---|---|---|---|
fixed_variables | Optional[FixedVariables] | None | The dictionary of variables to be fixed. |
parameters | JijSolverParameters | See above table | Parameters for JijSolver. |
max_wait_time | Optional[Union[int, float]] | None | The number of timeout [sec] for post request. If None, 60 (one minute) will be set. Please note that this argument is for the jijzept timeout and not for configuring solver settings, such as solving time. |
sync | bool | True | If True, synchronous mode is enabled. |
queue_name | Optional[str] | None | Queue name. |