Slide 1

Slide 1 text

Integer Linear Programming & The Google Optimization Toolset By Selma Ardelean

Slide 2

Slide 2 text

> whoami ● Junior Software Developer @ NewVoiceMedia ● Interested in machine learning, artificial intelligence and optimization techniques @matah @s_ardelean [email protected]

Slide 3

Slide 3 text

Lınear Optımızatıon or lınear programıng is the name given to computing the best solution to a problem modeled as a set of linear relationships.

Slide 4

Slide 4 text

A bit of history ● Developed during World War 2 ● Released to the public in 1947 ● Active work going on ● Still quite a few open problems George Bernard Dantzig Leonid Kantorovich John von Neumann

Slide 5

Slide 5 text

Ok..ok.. but how does it look like?

Slide 6

Slide 6 text

Canonical Form Constants Variables

Slide 7

Slide 7 text

Variables: x, y Objective function: 3*x + 4*y Constraints: x + 2*y <= 14 3*x - y >= 0 x - y <= 2 Basic Example

Slide 8

Slide 8 text

Simplex Algorithm Let’s just call it magic ● Proposed by George Bernard Dantzig in 1947 ● average case polynomial complexity ● worst case exponential complexity ● used widely in practice

Slide 9

Slide 9 text

Procedure 1. Simplify constraints 2. Represent constraints geometrically 3. Get coordinates of all vertices and replace into the objective function

Slide 10

Slide 10 text

Applications ● Transportation problem ● Minimization of production costs ● Maximization of profit ● Telecommunications networks ● Cellular networks ● Scheduling ● Travelling Salesman

Slide 11

Slide 11 text

Let’s get real

Slide 12

Slide 12 text

Google Optimization Toolset ● Open Source under the Apache License ○ https://github.com/google/or-tools ● Written in C++ ● Used internally at Google ● Provides an APIs for various languages: C++, Java, Python and C# ● Can be used with other solvers ● Does provide its own open source linear solver: GLOP ● Actively being developed ● Documentation has come a long way

Slide 13

Slide 13 text

NumVar - define the limits of our variables Setup the constraints

Slide 14

Slide 14 text

Print out your results and enjoy!

Slide 15

Slide 15 text

A bit more real

Slide 16

Slide 16 text

The Problem: Stigler diet, named for economics Nobel laureate George Stigler, who computed an inexpensive way to fulfill basic nutritional needs given a set of foods The Constraints: The Variables: The Objective: minimize cost

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

Resources ● Discrete Optimization Course ○ https://class.coursera.org/optimization-003 ● https://en.wikipedia.org/wiki/Integer_programming ● Scheduling problem ○ https://github.com/evilqubit/lpSolve ● lp_solve API reference ○ http://lpsolve.sourceforge.net/5.5/ ● Online example of simplex algorithm ○ http://www.zweigmedia.com/RealWorld/simplex.html ● Gurobi solver reference ○ http://www.gurobi.com/

Slide 20

Slide 20 text

Conclusion I am by no means an expert in anything Linear programming is applicable to a variety of problems The Google Optimization toolset is easy to use and understand And provides much more than just a linear solver Math is fun!

Slide 21

Slide 21 text

Thanks for listening! Questions?