sedumipy

sedumipy is a MATLAB/Octave-free port of SeDuMi, an interior-point solver for linear (LP), second-order cone (SOCP), and semidefinite (SDP) programs, to a standalone C library plus a Python (NumPy/SciPy) package. No MATLAB or GNU Octave runtime is required.

It solves conic programs over a symmetric cone \(K\), returning both sides of the primal-dual pair from one call:

\[\begin{split}\begin{aligned} \text{(P)} \quad \min_{x} \;\; & c^T x & \qquad \text{(D)} \quad \max_{y,\,s} \;\; & b^T y \\ \text{s.t.} \;\; & Ax = b, \;\; x \in K & \qquad \text{s.t.} \;\; & A^T y + s = c, \;\; s \in K^{*} \end{aligned}\end{split}\]

\(K\) is a product of blocks of five kinds – free, nonnegative orthant, second-order (Lorentz), rotated Lorentz, and positive semidefinite – so LP, SOCP, and SDP are the cases where every block is of one kind, and a single problem may mix them freely. See Usage for each cone’s definition and for a worked mixed-cone example.

To solve, say,

\[\begin{split}\min_x\ 7x_1 + 4x_2 + 10x_3 \quad \text{such that}\quad \begin{aligned} 3x_1 + x_2 + 2x_3 &= 9, \\ x_1 + 2x_2 + 4x_3 &= 8, \end{aligned} \quad x_1, x_2, x_3 \ge 0\end{split}\]

feed the objective coefficients as c, the constraint rows as A, their right-hand sides as b, and say that all three variables are nonnegative with K:

import numpy as np
import sedumipy

A = np.array([[3.0, 1.0, 2.0],      # one row per equality constraint
              [1.0, 2.0, 4.0]])
b = np.array([9.0, 8.0])            # their right-hand sides
c = np.array([7.0, 4.0, 10.0])      # objective coefficients
K = {"l": 3}                        # all 3 variables are >= 0

x, y, info = sedumipy.sedumi(A, b, c, K)
# x = [2., 3., 0.]   the optimum, costing c @ x = 26

This mirrors original SeDuMi’s own [x, y, info] = sedumi(A, b, c, K) call signature and semantics – see Usage for the problem format (the K cone-structure dict, and how to mix LP, second-order-cone, and PSD blocks in one problem) and API reference for the full public API.

Project status

LP (K.l), second-order cone (SOCP, K.q/K.r), and semidefinite (SDP, K.s) problems are all fully ported and verified against original Octave/SeDuMi output. See Project status for the current scope and Contributing for the full phase-by-phase project history.

A note on citation and attribution

sedumipy is an independent, unofficial re-implementation of SeDuMi, created without involvement from the original SeDuMi authors or maintainers. Although it aims to reproduce SeDuMi’s numerical behavior faithfully, it is a from-scratch port and may differ from the original in ways not yet identified – in short, it may not always behave identically to the original SeDuMi.

If you use this software in research, please cite the original SeDuMi paper to give credit where it is due:

Sturm, J.F. (1999). Using SeDuMi 1.02, a MATLAB toolbox for optimization over symmetric cones. Optimization Methods and Software, 11(1-4), 625-653.

At the same time, please make clear in your own work that results were produced using sedumipy, an unofficial Python port – not the original SeDuMi. Any discrepancy, bug, or unexpected numerical behavior you observe here is a property of this port, not of SeDuMi itself, and should not be attributed to the original project or its authors.

License

SeDuMi is licensed under the GNU General Public License v2 (see LICENSE); this port, being a derivative work, is licensed the same way.

Indices