filmov
tv
Python Tutorial : Basics of optimization
![preview_player](https://i.ytimg.com/vi/Mma2LTkzVro/maxresdefault.jpg)
Показать описание
---
Welcome to this course on Supply Chain Analytics. In this first lesson, we will talk about the Basics of Optimization.
This course will focus on Supply Chain Optimization so, let us briefly define what a Supply Chain is. A Supply Chain consists of all the parties involved directly or indirectly, in fulfilling a customer's request. That includes external Suppliers, Manufacturing, Production Planning and more.
When fulfilling a customer's request, there are often multiple routes through the Supply Chain. Supply Chain optimization attempts to find the best path to achieve an objective based on constraints. For example, a production plan is limited by the production capacity available or a logistics plan might be limited by how much truck capacity is available.
Supply chain optimization attempts to use the different resources that are available to achieve an objective. That objective could be focused on delivering the lowest cost, or the highest service.
Okay, here is a crash course in Linear Programing, or LP. LP is a powerful tool for modeling decisions for optimization.
It is an optimization method using a mathematical model whose requirements are represented by linear relationships.
There are three basic components of LP modeling.
First are the decision variables, or the things that you can control.
Next, the objective function, which describes the goal as a mathematical expression. It is what we want to maximize or minimize, such as profit or costs.
Finally, because we live in the real world there are constraints that limit our possible solutions, for example, manufacturing capacity.
To provide more context let's start with an example. Imagine that you are deciding on an exercise routine. In this situation, you only have 10 minutes to exercise and you want to maximize the number of calories you will burn. For every push-up, it takes 0-point-2 minutes and burns 3 calories. For every mile ran it takes 10 minutes and burns 130 calories. Based on the chart what combination of push-ups and running should you do? Let's model this as a LP problem.
First, we decide on the decision variables. In this case it is the number of push-ups and miles ran.
Next, the objective function captures the number of calories burned for each push and mile ran. So, based on our chart, we add 3 times the number of push-ups to 130 times the number of miles. We want to chose the combination of decision variables that maximizes this function.
Finally, we need to express our constraints. The first constraint captures how many minutes it takes to perform the exercise which must be less than or equal to 10 minutes. We also want to ensure our decision variables are not negative.
The points in the blue area of the graph all satisfy the constraints. To find the overall point that maximizes the calories burned, you could randomly test the shaded area but that would take a long time. In our next lesson, we will explore how to solve similar problems in python. In this example, the optimal solution is 50 push-ups and 0 miles.
In our example, our decision variables were the number of push-ups and mile ran. We modeled them as continuous variables, meaning the optimal result could mean performing 0-point-5 push-ups or run 0-point-1 of a mile. The continuous nature of the decision variables makes this a linear programming problem. If push-ups and miles ran could only be in whole numbers then this becomes integer programing. If we combined the two it is mixed-integer programming.
In this lesson, we defined Supply Chain Optimization.
Through an example, we defined linear programing and its basic components.
Finally, we defined the meaning of LP, IP and MIP.
Let's practice!
#DataCamp #PythonTutorial #SupplyChainAnalyticsinPython
Комментарии