All Projects → stephane-caron → lpsolvers

stephane-caron / lpsolvers

Licence: LGPL-3.0 license
Linear programming solvers in Python with a unified API

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to lpsolvers

osqp
The Operator Splitting QP Solver
Stars: ✭ 929 (+4545%)
Mutual labels:  solver, numerical-optimization
rust-lp-modeler
Lp modeler written in Rust
Stars: ✭ 75 (+275%)
Mutual labels:  solver, linear-programming
flipy
A Python linear programming interface library
Stars: ✭ 23 (+15%)
Mutual labels:  solver, linear-programming
rcbc
COIN-OR branch and cut (CBC) bindings for R
Stars: ✭ 16 (-20%)
Mutual labels:  solver, linear-programming
blt
Lattice-based integer linear programming solver
Stars: ✭ 60 (+200%)
Mutual labels:  solver, linear-programming
philsol
Simple python library for calculating the modes of electromagnetic waveguides using finite difference frequency domain method.
Stars: ✭ 21 (+5%)
Mutual labels:  solver
rmpk
Mixed Integer Linear and Quadratic Programming in R
Stars: ✭ 37 (+85%)
Mutual labels:  linear-programming
stlbfgs
C++ L-BFGS implementation using plain STL
Stars: ✭ 21 (+5%)
Mutual labels:  solver
optaplanner-quickstarts
OptaPlanner quick starts for AI optimization: many use cases shown in many different technologies.
Stars: ✭ 226 (+1030%)
Mutual labels:  solver
fdtd3d
fdtd3d is an open source 1D, 2D, 3D FDTD electromagnetics solver with MPI, OpenMP and CUDA support for x86, arm, arm64 architectures
Stars: ✭ 77 (+285%)
Mutual labels:  solver
ruzzle-solver
A python script that solves ruzzle boards
Stars: ✭ 46 (+130%)
Mutual labels:  solver
minilp
A pure Rust linear programming solver
Stars: ✭ 61 (+205%)
Mutual labels:  linear-programming
pdfo
Powell's Derivative-Free Optimization solvers
Stars: ✭ 56 (+180%)
Mutual labels:  numerical-optimization
slsqp
Modern Fortran Edition of the SLSQP Optimizer
Stars: ✭ 57 (+185%)
Mutual labels:  numerical-optimization
qdldl
A free LDL factorisation routine
Stars: ✭ 54 (+170%)
Mutual labels:  numerical-optimization
lava-optimization
Constraint Optimization with Lava
Stars: ✭ 23 (+15%)
Mutual labels:  solver
Hodoku
Hodoku is a solver/generator/trainer/analyzer for standard sudoku.
Stars: ✭ 49 (+145%)
Mutual labels:  solver
CapMonsterCloud
a C# wrapper for CapMonster Cloud API
Stars: ✭ 17 (-15%)
Mutual labels:  solver
pydata-london-2018
Slides and notebooks for my tutorial at PyData London 2018
Stars: ✭ 22 (+10%)
Mutual labels:  linear-programming
emhass
emhass: Energy Management for Home Assistant, is a Python module designed to optimize your home energy interfacing with Home Assistant.
Stars: ✭ 54 (+170%)
Mutual labels:  linear-programming

LP Solvers for Python

Build Coverage Documentation PyPI version Status

Wrapper around Linear Programming (LP) solvers in Python, with a unified interface.

Installation

The simplest way to install this module is:

sudo apt install libgmp-dev python3-dev
pip install lpsolvers

You can add the --user parameter for a user-only installation.

Usage

The function solve_lp is called with the solver keyword argument to select the backend solver. The linear program it solves is, in standard form:

$$ \begin{split} \begin{array}{ll} \mbox{minimize} & c^T x \\ \mbox{subject to} & G x \leq h \\ & A x = b \end{array} \end{split} $$

Vector inequalities are taken coordinate by coordinate.

Example

To solve a linear program, build the matrices that define it and call the solve_lp function:

from numpy import array
from lpsolvers import solve_lp

c = array([1., 2., 3.])
G = array([[1., 2., -1.], [2., 0., 1.], [1., 2., 1.], [-1., -1., -1.]])
h = array([4., 1., 3., 2.])

print "LP solution:", solve_lp(c, G, h)

This example outputs the solution [2.2, -0.8, -3.4].

Solvers

The list of supported solvers currently includes:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].