Introduction

Optimization is the way of life. We all have finite
resources and time and we want to make the most of them. From using your time
productively to solving supply chain problems for your company – everything
uses optimization. It’s an especially interesting and relevant topic in data
science. menfashdesign
It is also a very interesting topic – it starts with simple
problems, but it can get very complex. For example, sharing a bar of chocolate
between siblings is a simple optimization problem. We don’t think in
mathematical terms while solving it. On the other hand, devising inventory and
warehousing strategies for an e-tailer can be very complex. Millions of SKUs
with different popularity in different regions are to be delivered in defined
time and resources – you see what I mean!
Linear programming (LP) is one of the simplest ways to
perform optimization. It helps you solve some very complex LP problems and
linear optimization problems by making a few simplifying assumptions. As an
analyst, you are bound to come across applications and problems to be solved by
Linear Programming solutions.
For some reason, LP doesn’t get as much attention as it
deserves while learning data science. So, I thought let me do justice to this
awesome technique. I decided to write an article that explains Linear
programming examples in simple English. I have kept the content as simple as
possible. The idea is to get you started and excited about Linear Programming. ethicmenvoguee
Note- If you want to learn this in a course format, we have
curated this free course for you- Linear Programming for Data Science
Professionals
Table of contents
What is Linear Programming?
Now, what is linear programming? Linear programming is a
simple technique where we depict complex relationships through linear functions
and then find the optimum points. The important word in the previous sentence
is depicted. The real relationships might be much more complex – but we can
simplify them to linear relationships.
Linear programming is a mathematical modeling technique that
involves maximizing or minimizing a linear function while taking into account
various constraints. This approach has proven useful in guiding quantitative
decisions across different fields such as business planning, industrial
engineering, and to some extent, in the social and physical sciences. Linear
programming, also known as linear optimization, is a method for achieving the
best possible outcome in a mathematical model where the requirements are
defined by linear relationships. businessdirectorypc
Moreover, it’s important to note that linear programming is
a special case of mathematical programming. It involves finding the optimal
solution to a problem that involves linear relationships between the decision
variables and the constraints. This method has applications in various
industries and fields, from production planning to logistics optimization, and
is a powerful tool in making data-driven decisions that can lead to improved
efficiency and cost savings.
Applications of linear programming are everywhere around you. You use linear programming at personal and professional fronts. You are using linear programming when you are driving from home to work and want to take the shortest route. Or when you have a project delivery you make strategies to make your team work efficiently for on-time delivery.
Example of a Linear Programming Problem (LPP)
Let’s say a FedEx delivery man has 6 packages to deliver in
a day. The warehouse is located at point A. The 6 delivery destinations are
given by U, V, W, X, Y, and Z. The numbers on the lines indicate the distance
between the cities. To save on fuel and time the delivery person wants to take
the shortest route.
So, the delivery person will calculate different routes for
going to all 6 destinations and then come up with the shortest route. This
technique of choosing the shortest route is called linear programming.
In this case, the objective of the delivery person is to
deliver the parcel on time at all 6 destinations. The process of choosing the
best route is called Operation Research. Operation research is an approach to
decision-making, which involves a set of methods to operate a system. In the above
example, my system was the Delivery model.
Linear programming is used for obtaining the most optimal
solution for a problem with given constraints. In linear programming, we
formulate our real-life problem into a mathematical model. It involves an objective
function, and linear inequalities with subject to constraints. allinternetbuziness
Is the linear representation of the 6 points above
representative of the real world? Yes and No. It is an oversimplification as
the real route would not be a straight line. It would likely have multiple
turns, U-turns, signals and traffic jams. But with a simple assumption, we have
reduced the complexity of the problem drastically and are creating a solution
that should work in most scenarios.
Formulating a Problem
Let’s manufacture some chocolates…Example: Consider a
chocolate manufacturing company that produces only two types of chocolate – A
and B. Both the chocolates require Milk and Choco only. To manufacture each unit of A and B, the
following quantities are required:
The company kitchen has a total of 5 units of Milk and 12
units of Choco. On each sale, the company makes a profit of
Now, the company wishes to maximize its profit. How many
units of A and B should it produce respectively
Solution: The first thing I’m gonna do is represent the
problem in a tabular form for better understanding.
Let the total number of units produced by A be = X
Let the total number of units produced by B be = Y
Now, the total profit is represented by Z
The total profit the company makes is given by the total
number of units of A and B produced multiplied by its per-unit profit of Rs 6
and Rs 5 respectively.
which means we have to maximize Z.
The company will try to produce as many units of A and B to
maximize the profit. But the resources Milk and Choco are available in a
limited amount.