/Linear-Programming-With-Python

Solving Linear Programming problems using Simplex Method with linprog from scipy.optimize, NumPy and PuLP libraries on Python.

Primary LanguageJupyter NotebookMIT LicenseMIT

Linear-Programming-With-Python

Solving Linear Programming problems using Simplex Method with linprog from scipy.optimize, NumPy and PuLP libraries on Python.

Linear Programming

Linear programming is used to solve optimization problems. In a LP problem must be defined an Objective Function and Constraints, and they must be Strictly Linears. Constraints may be equalities or inequalities.

Example:

Variables:

Objective Function:

Constraints:

Requirement

We are going to use SciPy, NumPy and PuLP libraries to solve LP problems. PuLP is not available on Anaconda, try with pip.

Install via pip:

pip install scipy numpy pulp

Install via conda:

conda install scipy numpy

Examples

Using linprog from SciPy

Using PuLP

Company X Problem

Solving Company X problem with Linprog

Solving Company X problem with PuLP