Skip to main content

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 running sample_model method in JijSolver class.
from jijzept import JijSolver, JijSolverParameters

solver = JijSolver(config="./config.toml")
parameters = JijSolverParameters(numiters=8, eachsamsecs=1000)

response = solver.sample_model(
problem=problem,
feed_dict=instance_data,
parameters=parameters,
max_wait_time=300,
)

Parameters

JijSolverParameters

nametypedefaultdescription
numitersint4The number of iterations (each iteration consists of local search and update of the weights).
eachsamsecsfloat2000Specifies the duration for each LS (in milliseconds).

JijSolver.sample_model

nametypedefaultdescription
parametersJijSolverParametersSee above tableParameters for JijSolver.
max_wait_timeOptional[Union[int, float]]NoneThe 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.
syncboolTrueIf True, synchronous mode is enabled.
queue_nameOptional[str]NoneQueue name.