OMMX adapter for SCIP
This package provides an adapter for the SCIP from OMMX
Usage
ommx-pyscipopt-adapter can be installed from PyPI as follows:
pip install ommx-pyscipopt-adapter
SCIP can be used through ommx-pyscipopt-adapter by using the following:
from ommx_pyscipopt_adapter import OMMXPySCIPOptAdapter
from ommx.v1 import Instance, DecisionVariable
x1 = DecisionVariable.integer(1, lower=0, upper=5)
ommx_instance = Instance.from_components(
decision_variables=[x1],
objective=x1,
constraints=[],
sense=Instance.MINIMIZE,
)
# Create `ommx.v1.Solution` from the `pyscipot.Model`
ommx_solution = OMMXPySCIPOptAdapter.solve(ommx_instance)
print(ommx_solution)
Initial solution by variable name
Pass values grouped by variable name and tuple subscripts to initial_state.
The adapter resolves them against the instance being solved, so the same
values can be reused when variable IDs change.
from ommx import DecisionVariable, Instance, NamedState
from ommx_pyscipopt_adapter import OMMXPySCIPOptAdapter
x = DecisionVariable.integer(31, lower=0, upper=5, name="x", subscripts=[0])
y = DecisionVariable.integer(107, lower=0, upper=5, name="x", subscripts=[1])
instance = Instance.from_components(
decision_variables=[x, y], objective=2 * x + y,
constraints=[x + y <= 5], sense=Instance.MAXIMIZE,
)
initial_values: NamedState = {"x": {(0,): 1.0, (1,): 4.0}}
solution = OMMXPySCIPOptAdapter.solve(instance, initial_state=initial_values)
assert solution.state.entries == {x.id: 5.0, y.id: 0.0}
# Explicit conversion is also available when you need a State.
state = instance.state_from_named_values(initial_values)
Use () for scalar variables. Unknown keys raise KeyError; ambiguous
name/subscript pairs raise ValueError.
SOS1 hints
use_sos1="auto" (the default) uses native SCIP SOS1 constraints when the
hint's ordinary formulation can be safely replaced. The adapter checks the
cardinality and link equations, variable bounds, and that auxiliary selectors
are not used by the objective or other active constraints. If a hint cannot be
validated, its ordinary constraints are kept.
Use use_sos1="forced" to require valid SOS1 hints; missing or unsupported hints
raise OMMXPySCIPOptAdapterError with the reason. use_sos1="disabled" solves
the ordinary formulation without consuming hints.
When a formulation is replaced, link-implied bounds are preserved in SCIP and
auxiliary selector values are restored by both decode_to_state() and
decode(). The original OMMX instance is unchanged, and the returned solution
is evaluated against its original constraints. Binary members used as their
own selectors remain solver variables.
If SCIP's numerical feasibility tolerance permits a state that cannot satisfy
the original rows after restoration, decoding raises
OMMXPySCIPOptAdapterError. Tighten SCIP's feasibility tolerance or use
use_sos1="disabled" to retain the original rows in the solver.
Reference
TBW
Metadata
Release files for ommx-pyscipopt-adapter 2.9.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ommx_pyscipopt_adapter-2.9.3.tar.gz | 19.4 kB | With provenance | Details |
Release files / ommx_pyscipopt_adapter-2.9.3.tar.gz
| Download URL | ommx_pyscipopt_adapter-2.9.3.tar.gz |
|---|---|
| Size | 19.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
77ad8b598ca96860627bdaa39ed3ae9aa39c1caad37320c7bb3b442a02406655
|
|
BLAKE2b-256 checksum How to use checksums |
1dbc5fdd4223346030586bcc47db2070c0ec90f716a00c07ee28d79f27a67794
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logSecurity for ommx-pyscipopt-adapter 2.9.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 1 file in this release has been uploaded with provenance metadata.
Attestation for ommx_pyscipopt_adapter-2.9.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.