Splitting conic solver
Actively maintained. Last release 2 weeks ago, commits in 19 of the last 26 weeks. A safe choice.
pip install scsscs-python
Python interface for SCS 3.0.0 and higher. The full documentation is available here.
Installation
pip install scs
On x86-64 Linux the manylinux (glibc) wheels include the MKL Pardiso direct linear solver
(MKL linked statically into _scs_mkl, single-threaded) and use it
automatically: it is faster than the built-in QDLDL solver for most problems,
often dramatically so on larger ones, and nothing extra needs to be
installed. Intel's license notice ships in the wheel as
LICENSE-INTEL-MKL.txt. Every other wheel falls back to QDLDL.
To install from source:
git clone --recursive https://github.com/bodono/scs-python.git
cd scs-python
pip install .
Linear solver backends
SCS supports several linear solver backends. The default is AUTO, which
selects the best available solver for the platform:
- macOS: QDLDL (Apple Accelerate is available via
LinearSolver.ACCELERATE) - Linux / Windows: MKL Pardiso if available, otherwise QDLDL
import numpy as np
import scipy.sparse as sp
import scs
# A minimal LP: maximize x subject to 0 <= x <= 1
data = {
"A": sp.csc_matrix(np.array([[1.0], [-1.0]])),
"b": np.array([1.0, 0.0]),
"c": np.array([-1.0]),
}
cone = {"l": 2}
# Auto-detect best backend (default)
solver = scs.SCS(data, cone)
# Explicitly select a solver
solver = scs.SCS(data, cone, linear_solver=scs.LinearSolver.QDLDL)