SCIP¶
SCIP is a freely available solver for mixed integer programming (MIP) and mixed integer nonlinear programming (MINLP) developed by the Zuse Institut Berlin. Currently it is amongst the fastest non-commercial solvers available.
Note
SCIP may introduce auxiliary variables during the solving process, e.g., the variable quadobjvar
(see https://scipopt.org/doc/html/reader__lp_8c_source.php in line 1336).
These variables will be stored in the solution metadata under the key auxiliary_variables
.
Compatible Backends¶
The SCIP
algorithm supports the following backends:
By default, SCIP
uses the ZIB
backend.
Initialization¶
The following section outlines the default configurations of SCIP
. You can also specify other compatible backends for the algorithm. When backend=None
is specified, the default backend will be initialized automatically. In this case, if the backend requires a token, it will be taken from the environment variables.
from luna_quantum.solve.parameters.algorithms import SCIP
algorithm = SCIP(
backend=None
)
Parameter Details
For a complete overview of available parameters and their usage, see the SCIP API Reference.
Usage¶
from luna_quantum import LunaSolve
LunaSolve.authenticate("<YOUR_LUNA_API_KEY>")
# Define your model and algorithm
model = ...
algorithm = ...
solve_job = algorithm.run(model, name="my-solve-job")
API Reference¶
Bases: LunaAlgorithm[ZIB]
Parameters for the "Solve Constraint Integer Programming" (SCIP) solver.
backend
class-attribute
instance-attribute
¶
model_config
class-attribute
instance-attribute
¶
get_compatible_backends
classmethod
¶
get_compatible_backends() -> tuple[type[ZIB], ...]
Check at runtime if the used backend is compatible with the solver.
Returns:
Type | Description |
---|---|
tuple[type[IBackend], ...]
|
True if the backend is compatible with the solver, False otherwise. |
get_default_backend
classmethod
¶
get_default_backend() -> ZIB
Return the default backend implementation.
This property must be implemented by subclasses to provide the default backend instance to use when no specific backend is specified.
Returns:
Type | Description |
---|---|
BACKEND_TYPE
|
An instance of a class implementing the IBackend interface that serves as the default backend. |
run ¶
run(
model: Model | str,
name: str | None = None,
backend: BACKEND_TYPE | None = None,
client: LunaSolve | str | None = None,
*args: Any,
**kwargs: Any,
) -> SolveJob
Run the configured solver.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model
|
Model or str
|
The model to be optimized or solved. It could be an Model instance or a string identifier representing the model id. |
required |
name
|
str | None
|
If provided, the name of the job. Defaults to None. |
None
|
backend
|
BACKEND_TYPE | None
|
Backend to use for the solver. If not provided, the default backend is used. |
None
|
client
|
LunaSolve or str
|
The client interface used to interact with the backend services. If not provided, a default client will be used. |
None
|
*args
|
Any
|
Additional arguments that will be passed to the solver or client. |
()
|
**kwargs
|
Any
|
Additional keyword parameters for configuration or customization. |
{}
|
Returns:
Type | Description |
---|---|
SolveJob
|
The job object containing the information about the solve process. |