Introduction to Linear Programming in Python

Click for: original source

A guide to mathematical optimization with Google OR-Tools. Linear programming is a technique to optimize any problem with multiple variables and constraints. It’s a simple but powerful tool every data scientist should master. By Maxime Labonne.

Fortunately for us, there is a method that can solve our problem in an optimal way: linear programming (or linear optimization), which is part of the field of operations research (OR). In this article, we’ll use it to find the best numbers of swordsmen, bowmen, and horsemen to build the army with the highest power possible.

You can run the code from this tutorial with the following Google Colab notebook.

The article then describes:

  • Solvers
  • Variables
  • Constraints
  • Objective
  • Optimize!

In Python, there are different libraries for linear programming such as the multi-purposed SciPy, the beginner-friendly PuLP, the exhaustive Pyomo, and many others. Excellent read!

[Read More]

Tags python app-development programming open-source