![Page 1: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/1.jpg)
https://towardsdatascience.com/python-basics-for-data-science-6a6c987f2755
Optimization with Python
![Page 2: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/2.jpg)
https://towardsdatascience.com/python-basics-for-data-science-6a6c987f2755
Optimization with Python
![Page 3: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/3.jpg)
June 263 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
The making an impact stream
◼ Organized by the EWG Practice of OR
◼ https://www.euro-online.org/websites/or-in-practice/
◼ Please consider to https://www.euro-online.org/websites/or-in-
practice/register/
![Page 4: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/4.jpg)
June 264 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
There seem to be two major camps
https://www.kdnuggets.com/2017/08/python-overtakes-r-leader-analytics-data-science.html
![Page 5: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/5.jpg)
June 265 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
And python is winning
https://www.guru99.com/r-vs-python.html
![Page 6: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/6.jpg)
June 266 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
The Gartner four phases of analytics
![Page 7: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/7.jpg)
June 267 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
The Gartner four phases of analytics
![Page 8: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/8.jpg)
June 268 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Who is my target audience?
![Page 9: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/9.jpg)
June 269 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Two possibilities
◼ A data scientist who knows
python and is curious about
mathematical optimization.
◼ An optimization specialist who wants to move closer to the big data
community at large and his curious about the possibilities of python for
optimization.
![Page 10: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/10.jpg)
June 2610 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
![Page 11: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/11.jpg)
June 2611 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
![Page 12: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/12.jpg)
June 2612 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
![Page 13: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/13.jpg)
June 2613 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
https://www.kdnuggets.com/2018/05/poll-tools-analytics-data-
science-machine-learning-results.htmlPython, 65.6% (was 59.0% in 2017), 11% up
R, 48.5% (was 56.6%), 14% down
SQL, 39.6% (was 39.2%), 1% up
Java, 15.1% (was 15.5%), 3% down
Unix, shell/awk/gawk, 9.2% (was 10.8%), 15% down
Other programming and data languages, 6.9%, (was 7.6%), 9% down
C/C++, 6.8%, (was 7.1%), 3% down
Scala, 5.9%, (was 8.3%), 29% down
Perl, 1.0% (was 1.9%), 46% down
Julia, 0.7% (was 1.2%), 45% down
Lisp, 0.3% (was 0.4%), 25% down
Clojure, 0.2% (was 0.3%), 38% down
F, # 0.1% (was 0.5%), 73% down
![Page 14: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/14.jpg)
June 2614 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
https://www.macinchem.org/blog/files/category-jupyter.php
![Page 15: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/15.jpg)
June 2615 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
![Page 16: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/16.jpg)
June 2616 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Linear Optimization example
![Page 17: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/17.jpg)
17 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Betty’s Trophy Factory
• Betty owns a company that produces trophies for
• football• wood base, engraved plaque,
brass football on top• €12 profit and uses 4 dm of wood
• golf• wood base, engraved plaque,
golf ball on top• €9 profit and uses 2 dm of wood
• Betty’s current stock of raw materials• 1000 footballs• 1500 golf balls• 1750 plaques• 480 m (4800 dm) of wood
Betty wonders what the optimal production plan should be, in other words: howmany football and how many golf trophies should Betty produce to maximize his profit while respecting the availability of raw materials?
June 26
![Page 18: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/18.jpg)
18 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Leonid V. Kantorovich,
Russia 1912-1986• Invented linear optimization as a powerful modelinginstrument in 1939.
• This was kept secret at first but ended up awarding him the Nobel prize in economics in 1975.
June 26
![Page 19: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/19.jpg)
19 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Start by identifying and naming the decisions
Number of football trophies to produce:
𝑥1Number of golf trophies to produce:
𝑥2
June 26
![Page 20: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/20.jpg)
20 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Complete model of Betty’s production optimization
Also read this one out loud!
0,
480024
1750
1500
1000s.t.
912max
21
21
21
2
1
21
+
+
+
xx
xx
xx
x
x
xxFootballs
Golf balls
Plaques
Wood
June 26
![Page 21: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/21.jpg)
21 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Graphical Solution
2000
1500
1000
500
500 1000 1500 20001x
2x
June 26
![Page 22: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/22.jpg)
22 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Graphical Solution
2000
1500
1000
500
500 1000 1500 2000
01 x
2x
1x
June 26
![Page 23: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/23.jpg)
23 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Graphical Solution
2000
1500
1000
500
500 1000 1500 2000
01 x
02 x
2x
1x
June 26
![Page 24: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/24.jpg)
24 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Graphical Solution
2000
1500
1000
500
500 1000 1500 2000
10001 x
01 x
02 x
2x
1x
June 26
![Page 25: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/25.jpg)
25 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Graphical Solution
2000
1500
1000
500
500 1000 1500 2000
15002 x
10001 x
01 x
02 x
2x
1x
June 26
![Page 26: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/26.jpg)
26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Graphical Solution
2000
1500
1000
500
500 1000 1500 2000
15002 x
10001 x
175021 + xx
01 x
02 x
2x
1x
June 26
![Page 27: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/27.jpg)
27 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Graphical Solution
2000
1500
1000
500
500 1000 1500 2000
15002 x
10001 x
175021 + xx
480024 21 + xx
01 x
02 x
2x
1x
June 26
![Page 28: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/28.jpg)
28 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Graphical Solution
2000
1500
1000
500
500 1000 1500 2000
15002 x
10001 x
175021 + xx
480024 21 + xx
01 x
02 x
2x
1x
June 26
![Page 29: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/29.jpg)
29 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Graphical Solution
2000
1500
1000
500
500 1000 1500 2000
15002 x
10001 x
175021 + xx
480024 21 + xx
01 x
02 x
2x
1x
June 26
![Page 30: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/30.jpg)
30 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Graphical Solution
2000
1500
1000
500
500 1000 1500 2000
15002 x
10001 x
175021 + xx
480024 21 + xx
01 x
02 x
2x
1x
June 26
![Page 31: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/31.jpg)
31 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Graphical Solution
2000
1500
1000
500
500 1000 1500 2000
15002 x
10001 x
175021 + xx
480024 21 + xx
01 x
02 x
2x
1x
June 26
![Page 32: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/32.jpg)
32 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Graphical Solution
2000
1500
1000
500
500 1000 1500 2000
15002 x
10001 x
175021 + xx
480024 21 + xx
01 x
02 x
2x
1x
June 26
![Page 33: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/33.jpg)
33 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Graphical Solution
2000
1500
1000
500
500 1000 1500 2000
15002 x
10001 x
175021 + xx
480024 21 + xx
01 x
02 x
2x
1x
1g2g
g2
g1
x1
x2
f
-f
1g− 2g−
Feasible cone
June 26
![Page 34: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/34.jpg)
34 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Graphical Solution
2000
1500
1000
500
500 1000 1500 2000
15002 x
175021 + xx
480024 21 + xx
01 x
02 x
Optimal Solution1100,650 21 == xx
2x
1x
10001 x
June 26
![Page 35: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/35.jpg)
35 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
George Dantzig,
USA 1914-2005• Designed and
implemented the first practical algorithm to solve linear optimization problems: the simplex method.
• That did not award him anything like a Nobel prize…
• The moral of this story: technology is a commodity, the power is in the models!
June 26
![Page 36: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/36.jpg)
June 2636 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
How the simplex method works
2000
1500
1000
500
500 1000 1500 2000
![Page 37: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/37.jpg)
June 2637 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
How the simplex method works
2000
1500
1000
500
500 1000 1500 2000
![Page 38: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/38.jpg)
June 2638 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
How the simplex method works
2000
1500
1000
500
500 1000 1500 2000
![Page 39: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/39.jpg)
June 2639 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
How the simplex method works
2000
1500
1000
500
500 1000 1500 2000
![Page 40: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/40.jpg)
June 2640 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Solution
◼ Achieve the maximum attainable profit of € 17.700
◼ producing 650 football trophies
◼ and producing 1100 golf trophies
◼ while using all but 350 brass footballs,
◼ using all but 400 golf balls,
◼ using all the plaques,
◼ and using all of the wood.
![Page 41: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/41.jpg)
June 2641 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
How to solve it with python?
![Page 42: Optimization with Python · 9 June 26 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106 Two possibilities A data scientist who knows python and is curious about mathematical](https://reader033.vdocuments.mx/reader033/viewer/2022060800/6084a5659afd0d5b7a02fcbc/html5/thumbnails/42.jpg)
June 2642 WB-03: Tutorial: Optimizing with Python. 10:30-12:00 - Q106
Search for: conda pulp
https://anaconda.org/conda-forge/pulp