Steps to Solve a Linear Programming Problem
Introduction to linear programming, features of linear programming, parts of linear programming, why we need linear programming.
It is an optimization method for a linear objective function and a system of linear inequalities or equations . The linear inequalities or equations are known as constraints . The quantity which needs to be maximized or minimized (optimized) is reflected by the objective function. The fundamental objective of the linear programming model is to look for the values of the variables that optimize (maximize or minimize) the objective function.
We know that in linear programming, we subject linear functions to multiple constraints. These constraints can be written in the form of linear inequality or linear equations. This method plays a fundamental role in finding optimal resource utilization. The word "linear" in linear programming depicts the relationship between different variables. It means that the variables have a linear relationship between them. The word "programming" in linear programming shows that the optimal solution is selected from different alternatives.
We assume the following things while solving the linear programming problems:
- The constraints are expressed in the quantitative values
- There is a linear relationship between the objective function and the constraints
- The objective function which is also a linear function needs optimization
The linear programming problem has the following five features:
These are the limitations set on the main objective function. These limitations must be represented in the mathematical form.
- Objective function
This function is expressed as a linear function and it describes the quantity that needs optimization.
There is a linear relationship between the variables of the function.
The value of the variable should be zero or non-negative.
The primary parts of a linear programming problem are given below:
- Decision variables
The applications of linear programming are widespread in many areas. It is especially used in mathematics, telecommunication, logistics, economics, business, and manufacturing fields. The main benefits of using linear programming are given below:
- It provides valuable insights to the business problems as it helps in finding the optimal solution for any situation.
- In engineering, it resolves design and manufacturing issues and facilitates in achieving optimization of shapes.
- In manufacturing, it helps to maximize profits.
- In the energy sector, it facilitates optimizing the electrical power system
- In the transportation and logistics industries, it helps in achieving time and cost efficiency.
In the next section, we will discuss the steps involved in solving linear programming problems.
We should follow the following steps while solving a linear programming problem graphically.
Step 1 - Identify the decision variables
The first step is to discern the decision variables which control the behavior of the objective function. Objective function is a function that requires optimization.
Step 2 - Write the objective function
The decision variables that you have just selected should be employed to jot down an algebraic expression that shows the quantity we are trying to optimize. In other words, we can say that the objective function is a linear equation that is comprised of decision variables.
Step 3 - Identify Set of Constraints
Constraints are the limitations in the form of equations or inequalities on the decision variables. Remember that all the decision variables are non-negative; i.e. they are either positive or zero.
Step 4 - Choose the method for solving the linear programming problem
Multiple techniques can be used to solve a linear programming problem. These techniques include:
- Simplex method
- Solving the problem using R
- Solving the problem by employing the graphical method
- Solving the problem using an open solver
In this article, we will specifically discuss how to solve linear programming problems using a graphical method.
Step 5 - Construct the graph
After you have selected the graphical method for solving the linear programming problem, you should construct the graph and plot the constraints lines.
Step 6 - Identify the feasible region
This region of the graph satisfies all the constraints in the problem. Selecting any point in the feasible region yields a valid solution for the objective function.
Step 7 - Find the optimum point
Any point in the feasible region that gives the maximum or minimum value of the objective function represents the optimal solution.
Now, that you know what are the steps involved in solving a linear programming problem, we will proceed to solve an example using the steps above.
A bakery manufacturers two kinds of cookies, chocolate chip, and caramel. The bakery forecasts the demand for at least 80 caramel and 120 chocolate chip cookies daily. Due to the limited ingredients and employees, the bakery can manufacture at most 120 caramel cookies and 140 chocolate chip cookies daily. To be profitable the bakery must sell at least 240 cookies daily.
Each chocolate chip cookie sold results in a profit of $0.75 and each caramel cookie produces $0.88 profit.
a) How many chocolate chip and caramel cookies should be made daily to maximize the profit?
b) Compute the maximum revenue that can be generated in a day?
Follow the following steps to solve the above problem.
Number of caramel cookies sold daily = x
Number of chocolate chip cookies sold daily = y
Step 2 - Write the Objective Function
Since each chocolate chip cookie yields the profit of $0.75 and each caramel cookie produces a profit of $0.88, therefore we will write the objective function as:
It is mentioned in the problem that the demand forecast of caramel cookies is at least 80 and the bakery cannot produce more than 120 caramel cookies. Therefore, we will write this constraint as:
It is also mentioned that the expected demand for the chocolate chip cookies is at least 120 and the bakery can produce no more than 140 cookies. Therefore, the second constraint is:
The green area of the graph is the feasibility region.
Step 7 - Find the Optimum point
Now, we will test the vertices of the feasibility region to determine the optimal solution. The vertices are:
(120, 120) , (100, 140), (120, 140)
(120, 120) P = 0.88 (120) + 0.75 (120) = $ 195.6
(100, 140) P = 0.88 (100) + 0.75 (140) = $ 193
(120, 140) P = 0.88 (120) + 0.75 (140) = $ 210.6
Hence, the bakery should manufacture 120 caramel cookies and 140 chocolate cookies daily to maximize the profit.
Now, we will proceed to solve the part b of the problem.
The answer to the part b is given in the previous section. The maximum profit that can be generated in a day is $210.6.
The platform that connects tutors and students
Did you like this article? Rate it!
I am passionate about travelling and currently live and work in Paris. I like to spend my time reading, gardening, running, learning languages and exploring new places.
Linear Programming Examples
Linear programming, linear programming problems and solutions, cancel reply.
Current [email protected] *
Leave this field empty
I like it is easier to understand it the way you break it down
This is awesome and simple to digest. It indeed is user friendly 😊🙇🏽♀️
How many of each should be made to maximize profit?
Can you kindly help me solve this question. ….A company proposes to invest in two divisible projects which are expected to generate the following cash flows.
1. The cost of capital applicable to both projects is 12%
2. Project A requires sh. 20,000 and Project B 10,000 initial investment.
3. The funds available are restricted as follows;
4. Funds not utilized one year will not be available in the subsequent years.
i. Formulate a linear programming model to solve the above problem.
ii. Solve the problem graphically and comment on the proportion of investing on the two projects.
please help me
A farmer has 500acres of land kept for grazing by some animals.The estimate that one cow requires five acres and one goat requires 4 acres.The farmer has the facilities for 40 cows and 100 goats.if the farmer makes 300 per cow and100 per goat.How many cow and goat should be varse for maximum profit.(linear programming)
have you got the answer for this problem sir
Please sir can you help me solve this
Graceland investment limited produces two types of soup Bimpex and Dolapus if the revenue generated from each Carton of Bimpex and Dolapus are 360 naira and 240 respectively. the total raw material available for production is 180 units and it will take 20 Units to produce a Carton of Dolapus and 18units for Bimpus the time available for production is 120 hours and it will take two hours to produce a cartoon of Bimpus and 15 hours to produce Dolapus how many Carton Should graceland produce in Other maximize sales revenue- formulate the problem as a linear programming problem and solve using graphical method.
- Class 6 Maths
- Class 6 Science
- Class 6 English
- Class 7 Maths
- Class 7 Science
- Class 7 English
- Class 8 Maths
- Class 8 Science
- Class 8 English
- Class 9 Maths
- Class 9 Science
- Class 9 English
- Class 10 Maths
- Class 10 Science
- Class 10 Social Science
- Class 10 English
- Class 11 Maths
- Class 11 Computer Science (Python)
- Class 11 English
- Class 12 Maths
- Class 12 English
- Class 12 Economics
- Class 12 Accountancy
- Class 12 Physics
- Class 12 Chemistry
- Class 12 Biology
- Class 12 Computer Science (Python)
- Class 12 Physical Education
- GST and Accounting Course
- Excel Course
- Tally Course
- Finance and CMA Data Course
- Payroll Course
- Learn English
- Learn Excel
- Learn Tally
- Learn GST (Goods and Services Tax)
- Learn Accounting and Finance
- GST Tax Invoice Format
- Accounts Tax Practical
- Tally Ledger List
- GSTR 2A - JSON to Excel
Are you in school ? Do you love Teachoo?
We would love to talk to you! Please fill this form so that we can contact you
- Case Based Questions (MCQ)
- NCERT Exemplar - MCQs
Ex 12.1, 1 - Chapter 12 Class 12 Linear Programming (Term 1)
Last updated at March 1, 2023 by Teachoo
This video is only available for Teachoo black users
Get live Maths 1-on-1 Classs - Class 6 to 12
Ex 12.1, 1 Solve the following Linear Programming Problems graphically: Maximize Z = 3x + 4y subject to the constraints : x + y ≤ 4, x ≥ 0, y ≥ 0. Maximize Z = 3x + 4y Subject to, x + y ≤ 4 x ≥ 0, y ≥ 0 x + y ≤ 4 Hence, Z is maximum at (0, 4) Maximum value is 16
Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 13 years. He provides courses for Maths, Science, Social Science, Physics, Chemistry, Computer Science at Teachoo.
Hi, it looks like you're using AdBlock :(
Please login to view more pages. it's free :), solve all your doubts with teachoo black.
What Is Linear Programming? Definition, Methods and Problems for Data Scientists
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 .
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 strategy for an e-tailer can be very complex. Millions of SKUs with different popularity in different regions 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.
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, common terminologies used in linear programming, solve linear programs by graphical method, solve linear program using r, solve linear program using opensolver, simplex method, northwest corner method and least cost method, applications of 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.
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 the 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, linear inequalities with subject to constraints.
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:
- Each unit of A requires 1 unit of Milk and 3 units of Choco
- Each unit of B requires 1 unit of Milk and 2 units of Choco
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
- Rs 6 per unit A sold
- Rs 5 per unit B sold.
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.
Profit: Max Z = 6X+5Y
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.
As per the above table, each unit of A and B requires 1 unit of Milk. The total amount of Milk available is 5 units. To represent this mathematically,
Also, each unit of A and B requires 3 units & 2 units of Choco respectively. The total amount of Choco available is 12 units. To represent this mathematically,
Also, the values for units of A can only be integers.
So we have two more constraints, X ≥ 0 & Y ≥ 0
For the company to make maximum profit, the above inequalities have to be satisfied.
This is called formulating a real-world problem into a mathematical model.
Let us define some terminologies used in Linear Programming using the above example.
- Decision Variables: The decision variables are the variables that will decide my output. They represent my ultimate solution. To solve any problem, we first need to identify the decision variables. For the above example, the total number of units for A and B denoted by X & Y respectively are my decision variables.
- Objective Function: It is defined as the objective of making decisions. In the above example, the company wishes to increase the total profit represented by Z. So, profit is my objective function.
- Constraints: The constraints are the restrictions or limitations on the decision variables. They usually limit the value of the decision variables. In the above example, the limit on the availability of resources Milk and Choco are my constraints.
- Non-negativity Restriction: For all linear programs, the decision variables should always take non-negative values. This means the values for decision variables should be greater than or equal to 0.
The Process of Formulating a Linear Programming Problem
Let us look at the steps of defining a Linear Programming problem generically:
- Identify the decision variables
- Write the objective function
- Mention the constraints
- Explicitly state the non-negativity restriction
For a problem to be a linear programming problem, the decision variables, objective function and constraints all have to be linear functions.
If all the three conditions are satisfied, it is called a Linear Programming Problem .
A linear program can be solved by multiple methods. In this section, we are going to look at the Graphical method for solving a linear program. This method is used to solve a two-variable linear program. If you have only two decision variables, you should use the graphical method to find the optimal solution.
A graphical method involves formulating a set of linear inequalities subject to the constraints. Then the inequalities are plotted on an X-Y plane. Once we have plotted all the inequalities on a graph the intersecting region gives us a feasible region. The feasible region explains what all values our model can take. And it also gives us the best solution.
Let’s understand this with the help of an example.
Example: A farmer has recently acquired a 110 hectares piece of land. He has decided to grow Wheat and barley on that land. Due to the quality of the sun and the region’s excellent climate, the entire production of Wheat and Barley can be sold. He wants to know how to plant each variety in the 110 hectares, given the costs, net profits and labor requirements according to the data shown below:
The farmer has a budget of US$10,000 and availability of 1,200 man-days during the planning horizon. Find the optimal solution and the optimal value.
Solution: To solve this problem, first we gonna formulate our linear program.
Formulation of a Linear Problem
Step 1: Identify the decision variables
The total area for growing Wheat = X (in hectares)
The total area for growing Barley = Y (in hectares)
X and Y are my decision variables.
Step 2: Write the objective function
Since the production from the entire land can be sold in the market. The farmer would want to maximize the profit for his total produce. We are given net profit for both Wheat and Barley. The farmer earns a net profit of US$50 for each hectare of Wheat and US$120 for each Barley.
Our objective function (given by Z) is, Max Z = 50X + 120Y Step 3: Writing the constraints
1. It is given that the farmer has a total budget of US$10,000. The cost of producing Wheat and Barley per hectare is also given to us. We have an upper cap on the total cost spent by the farmer. So our equation becomes:
100X + 200Y ≤ 10,000
2. The next constraint is the upper cap on the availability of the total number of man-days for the planning horizon. The total number of man-days available is 1200. As per the table, we are given the man-days per hectare for Wheat and Barley.
10X + 30Y ≤ 1200
3. The third constraint is the total area present for plantation. The total available area is 110 hectares. So the equation becomes,
X + Y ≤ 110 Step 4: The non-negativity restriction
The values of X and Y will be greater than or equal to 0. This goes without saying.
X ≥ 0, Y ≥ 0
We have formulated our linear program. It’s time to solve it.
Solving an LP Through the Graphical Method
Since we know that X, Y ≥ 0. We will consider only the first quadrant.
To plot for the graph for the above equations, first I will simplify all the equations.
100X + 200Y ≤ 10,000 can be simplified to X + 2Y ≤ 100 by dividing by 100.
10X + 30Y ≤ 1200 can be simplified to X + 3Y ≤ 120 by dividing by 10.
The third equation is in its simplified form, X + Y ≤ 110.
Plot the first 2 lines on a graph in the first quadrant (like shown below)
The optimal feasible solution is achieved at the point of intersection where the budget & man-days constraints are active. This means the point at which the equations X + 2Y ≤ 100 and X + 3Y ≤ 120 intersect gives us the optimal solution.
The values for X and Y which gives the optimal solution is at (60,20).
To maximize profit the farmer should produce Wheat and Barley in 60 hectares and 20 hectares of land respectively.
The maximum profit the company will gain is,
Max Z = 50 * (60) + 120 * (20)
R is an open-source tool that is very popular among the data scientists for essential data science tasks. Performing linear programming is very easy and we can attain an optimum solution in very few steps. Come let’s learn.
Example: A toy manufacturing organization manufactures two types of toys A and B. Both the toys are sold at Rs.25 and Rs.20 respectively. There are 2000 resource units available every day from which the toy A requires 20 units while toy B requires 12 units. Both of these toys require a production time of 5 minutes. Total working hours are 9 hours a day. What should be the manufacturing quantity for each of the pipes to maximize the profits?
The objective function is: Max.Z=25x+20y
where x are the units of pipe A
y are the units of pipe B
Let’s see the code part now:
Therefore from the output, we see that the organization should produce 88 units of toy A and 20 units of toy B and the maximum profit for the organization will be Rs.2600.
In reality, a linear program can contain 30 to 1000 variables and solving it either Graphically or Algebraically is next to impossible. Companies generally use OpenSolver to tackle these real-world problems. Here I am gonna take you through steps to solve a linear program using OpenSolver.
OpenSolver is an open-source linear and optimizer for Microsoft Excel. It is an advanced version of a built-in Excel Solver. You can download OpenSolver here and follow the installation manual .
I want you to get hands-on knowledge of using OpenSolver. So, for a clear understanding, I will explain it using an example.
Example: Below there is a diet chart that gives me calories, protein, carbohydrate and fat content for 4 food items. Sara wants a diet with minimum cost. The diet chart is as follows:
The chart gives the nutrient content as well as the per-unit cost of each food item. The diet has to be planned in such a way that it should contain at least 500 calories, 6 grams of protein, 10 grams of carbohydrates and 8 grams of fat.
Solution: First, I’m gonna formulate my linear program in a spreadsheet.
- Step 1: Identify the decision variables. Here my decision variables are the food items. Add the headers. For trial purposes, we are entering arbitrary values. Let’s say, Sara consumes 3 units of Food Item 1, 0 unit of Food Item 2, 1 unit of Food Item 3 and 0 unit of Food Item 4. These are called variable cells.
- Step 2: Now we will write our objective function. For the diet to be optimal we must have minimum cost along with required calories, protein, carbohydrate, and fat.
In cell B7:E7 we take the reference to the number of units. And in cell B8:E8 we put the per-unit cost of each food item.
In cell B10, we want the total cost of the diet. The total cost is given by the sumproduct of the number of units eaten and per-unit cost. Sumproduct is given by = B7*B8+C7*C8+D7*D8+E7*E8. Let’s see this in a spreadsheet.
- Step 3: Now, we will enter the constraints. Column F contains a total of calories, protein, carbohydrate, and fat. The total number of calorie intake in given by sumproduct the number of food items eaten and the calorie consumed per food item. For cell F13= Sumprodcut($B$7:$F$7, B13:F13). Similarly for others. Column G gives the inequality since the problem demands Calories, Protein, Carbohydrate and Fat to be at least 500, 6, 10 and 8 respectively. Column H gives the required nutrient content.
- Step 4: Now, we will enter the Linear program into the solver. Now, once you have installed OpenSolver. When you click on the Data tab, on the right you will see Model. Click on the model, then enter the values one by one. First, we will enter the objective function,$B10 i.e in the objective cell. Select minimize because we want to minimize the diet cost.
- Step 5: Now enter the decision variables in the variable cells.
- Step 6: Now, we will add the constraints. The first constraint is the F13 ≥ H13. Add all the constraints one by one.
- Step 7: Now, you have to enter one important constraint. The non-negativity restriction. All the decision variables will be greater than 0.
- Step 8: Now, click on Save Model to finish the modeling process. Once you save the model, it will look something like this.
- Step 9: Once the model is saved click on the Data tab then click solve. The optimal solution and values are displayed in the corresponding cells. The optimal minimum cost is US$0.90. Sara should consume 3 units of Food Item 2 and 1 unit of Food Item 3 for the required nutrient content at the minimum cost. This solves our linear program.
Simplex Method is one of the most powerful & popular methods for linear programming. The simplex method is an iterative procedure for getting the most feasible solution. In this method, we keep transforming the value of basic variables to get maximum value for the objective function.
. . . . . .
. . . . . .
. . . .
The above explanation gives the theoretical explanation of the simplex method. Now, I am gonna explain how to use the simplex method in real life using Excel.
Example: The advertising alternatives for a company include television, newspaper and radio advertisements. The cost for each medium with its audience coverage is given below.
The local newspaper limits the number of advertisements from a single company to ten. Moreover, in order to balance the advertising among the three types of media, no more than half of the total number of advertisements should occur on the radio. And at least 10% should occur on television. The weekly advertising budget is $18,200. How many advertisements should be run in each of the three types of media to maximize the total audience?
Solution: First I am going to formulate my problem for a clear understanding.
Step 1: Identify Decision Variables
Step 2: Objective Function
The objective of the company is to maximize the audience. The objective function is given by:
Now, I will mention each constraint one by one.
It is clearly given that we have a budget constraint. The total budget which can be allocated is $18,200. And the individual costs per television, newspaper and radio advertisement is $2000, $600 and $300 respectively. This can be represented by the equation,
The next constraint is the number of advertisements on television. The company wants at least 10% of the total advertisements to be on television. So, it can be represented as:
The last constraint is the number of advertisements on the radio cannot be more than half of the total number of advertisements. It can be represented as
Now, I have formulated my linear programming problem. We are using the simplex method to solve this. I will take you through the simplex method one by one.
To reiterate all the constraints are as follows. I have simplified the last two equations to bring them in standard form.
So our equations are as follows:
I hope now you are available to make sense of the entire advertising problem. All the above equations are only for your better understanding. Now if you solve these equations, you will get the values for X1= 4, X2= 10 and X3= 14.
On solving the objective function you will get the maximum weekly audience as 1,052,000. You can follow the tutorial here to solve the equation. To solve a linear program in excel, follow this tutorial .
Northwest Corner Method
The northwest corner method is a special type method used for transportation problems in linear programming. It is used to calculate the feasible solution for transporting commodities from one place to another. Whenever you are given a real-world problem, which involves supply and demand from one source of a different sources. The data model includes the following:
- The level of supply and demand at each source is given
- The unit transportation of a commodity from each source to each destination
The model assumes that there is only one commodity. The demand for which can come from different sources. The objective is to fulfill the total demand with minimum transportation cost. The model is based on the hypothesis that the total demand is equal to the total supply, i.e the model is balanced. Let’s understand this with the help of an example.
Example: Consider there are 3 silos which are required to satisfy the demand from 4 mills. (A silo is a storage area of the farm used to store grain and Mill is a grinding factory for grains).
Solution: Let’s understand what the above table explains.
The cost of transportation from Silo i to Mill j is given by the cost in each cell corresponding to the supply from each silo 1 and the demand at each Mill. For example, The cost of transporting from Silo 1 to Mill 1 is $10, from Silo 3 to Mill 5 is $18. It is also given the total demand & supply for mill and silos. The objective is to find the minimal transportation cost such that the demand for all the mills is satisfied.
As the name suggests Northwest corner method is a method of allocating the units starting from the top-left cell. The demand for Mill 1 is 5 and Silo 1 has a total supply of 15. So, 5 units can be allocated to Mill1 at a cost of $10 per unit. The demand for Mill1 is met. then we move to the top-left cell of Mill 2. The demand for Mill 2 is 15 units, which it can get 10 units from Silo 1 at a cost of $2 per unit and 5 units from Silo 2 at a cost of $7 per unit. Then we move onto Mill 3, the northwest cell is S2M3. The demand for Mill 3 is 15 units, which it can get from Silo 2 at a cost of $9 per unit. Moving on to the last Mill, Mill 4 has a demand of 15 units. It will get 5 units from a Silo 2 at a cost of $20 per unit and 10 units from Silo 3 at a cost of $18 per unit.
The total cost of transportation is = 5*10+(2*10+7*5)+9*15+(20*5+18*10) = $520
Least Cost Method
Least Cost method is another method to calculate the most feasible solution for a linear programming problem. This method derives more accurate results than Northwest corner method. It is used for transportation and manufacturing problems. To keep it simple I am explaining the above transportation problem.
According to the least cost method, you start from the cell containing the least unit cost for transportation. So, for the above problem, I supply 5 units from Silo 3 at a per-unit cost of $4. The demand for Mill1 is met. For Mill 2, we supply 15 units from Silo 1 at a per unit cost of $2. Then For Mill 3 we supply 15 units from Silo 2 at a per-unit cost of $9. Then for Mill 4 we supply 10 units from Silo 2 at a per unit cost of $20 and 5 units from Silo 3 an $18 per unit. The total transportation costs are $475.
Well, the above method explains we can optimize our costs further with the best method. Let’s check this using Excel Solver. Solver is an in-built add-on in Microsoft Excel. It’s an add-in plug available in Excel. Go to file->options->add-ins->select solver->click on manage->select solver->click Ok. Your solver is now added in excel. You can check it under the Data tab.
The first thing I am gonna do is enter my data in excel. After entering the data in excel, I have calculated the total of C3:F3. Similarly for others. This is done to take the total demand from Silo 1 and others.
After this, I am gonna break my model into two. The first table gives me the units supplied and the second table gives me the unit cost.
Now, I am calculating my total cost which will be given by Sumproduct of unit cost and units supplied.
Now I am gonna use Solver to compute my model. Similar to the above method. Add the objective function, variable cells, constraints.
Now your model is ready to be solved. Click on solve and you will get your optimal cost. The minimum transportation cost is $435.
Linear programming and Optimization are used in various industries. The manufacturing and service industry uses linear programming on a regular basis. In this section, we are going to look at the various applications of Linear programming.
- Manufacturing industries use linear programming for analyzing their supply chain operations . Their motive is to maximize efficiency with minimum operation cost. As per the recommendations from the linear programming model, the manufacturer can reconfigure their storage layout, adjust their workforce and reduce the bottlenecks. Here is a small Warehouse case study of Cequent a US-based company, watch this video for a more clear understanding.
- Linear programming is also used in organized retail for shelf space optimization . Since the number of products in the market has increased in leaps and bounds, it is important to understand what does the customer want. Optimization is aggressively used in stores like Walmart, Hypercity, Reliance, Big Bazaar, etc. The products in the store are placed strategically keeping in mind the customer shopping pattern. The objective is to make it easy for a customer to locate & select the right products. This is subject to constraints like limited shelf space, a variety of products, etc.
- Optimization is also used for optimizing Delivery Routes . This is an extension of the popular traveling salesman problem. The service industry uses optimization for finding the best route for multiple salesmen traveling to multiple cities. With the help of clustering and greedy algorithm, the delivery routes are decided by companies like FedEx, Amazon, etc. The objective is to minimize the operation cost and time.
- Optimizations are also used in Machine Learning . Supervised Learning works on the fundamental of linear programming. A system is trained to fit on a mathematical model of a function from the labeled input data that can predict values from an unknown test data.
Well, the applications of Linear programming don’t end here. There are many more applications of linear programming in real-world like applied by Shareholders, Sports, Stock Markets, etc. Go on and explore further.
I hope you enjoyed reading this article. I have tried to explain all the basic concepts under linear programming. If you have any doubts or questions feel free to post them in the comments section. For easy understanding, we have broken this long article into a shorter course format – Linear Programming for Data Science Professionals
I have explained each concept with a real-life example. I want you to try them at your end and get hands-on experience. Let me know what you think!
Frequently Asked Questions
Q1. what is linear programming and why is it important.
A. Linear programming is an optimization technique used to optimize a linear objective function, subject to linear constraints represented by linear equations or linear constraints. It’s a mathematical technique to help find the best possible solution to a problem that has multiple objectives and limited resources.
Q2. What is a linear programming problem in simple words?
A. Linear programming problem is an optimization problem where the goal is to find the maximum or the minimum value within a number of constraints(such as available resources or limitations) depending upon the type of problem we are solving.
Q3. What is an objective function in LPP (linear programming problem)?
A. An objective function is a linear equation that represents the relationship between the decision variables and the value that is to be optimized. Every optimizing technique such as Linear programming or integer programming has an objective function that needs to be minimized/maximized in order to produce the best results. In LPP, the objective function is used along with the constraints to determine the optimal solution to the problem.
Learn , compete, hack and get hired !
About the Author
Avcontentteam, our top authors.
Download Analytics Vidhya App for the Latest blog/Article
27 thoughts on " what is linear programming definition, methods and problems for data scientists ".
kumar says: February 28, 2017 at 5:43 am
Swati Kashyap says: February 28, 2017 at 5:50 am
Arun says: February 28, 2017 at 6:29 am
Swati kashyap says: february 28, 2017 at 6:33 am.
Dima says: February 28, 2017 at 7:40 am
Bipul says: February 28, 2017 at 8:21 am
JB says: February 28, 2017 at 11:21 am
Swati kashyap says: february 28, 2017 at 11:27 am, swati kashyap says: february 28, 2017 at 11:41 am.
Geeta Shah says: February 28, 2017 at 1:32 pm
Abhishek Kulkarni says: February 28, 2017 at 2:43 pm
Anil Muduli says: March 02, 2017 at 7:54 am
Abhinandan Nuli says: March 02, 2017 at 2:35 pm
Anantha Sreenivas says: March 03, 2017 at 11:08 am
Rahul Ravipati says: March 08, 2017 at 4:34 am
Amit says: March 10, 2017 at 3:46 am
Swati kashyap says: march 10, 2017 at 7:47 am, amit says: march 10, 2017 at 7:52 am, swati kashyap says: march 10, 2017 at 7:59 am.
Noor Mohamed M says: July 25, 2017 at 4:11 pm
Aviroop says: March 30, 2018 at 10:30 am
Satnam says: April 01, 2018 at 9:19 pm
SHUBHAM KSHIRSAGAR says: May 03, 2018 at 4:34 pm
Thrishul says: May 17, 2018 at 7:53 pm
Dai Software says: September 10, 2021 at 2:07 pm
Aman says: October 06, 2022 at 8:04 am
Neba Brenda Asoh says: October 13, 2022 at 4:10 pm
Leave a reply your email address will not be published. required fields are marked *.
Notify me of follow-up comments by email.
Notify me of new posts by email.
30 Best Data Science Books to Read in 2023
How to Read and Write With CSV Files in Python:..
Understand Random Forest Algorithms With Examples (Updated 2023)
Feature Selection Techniques in Machine Learning (Updated 2023)
Welcome to India's Largest Data Science Community
Back welcome back :), don't have an account yet register here, back start your journey here, already have an account login here.
A verification link has been sent to your email id
If you have not recieved the link please goto Sign Up page again
back Please enter the OTP that is sent to your registered email id
Back please enter the otp that is sent to your email id, back please enter your registered email id.
This email id is not registered with us. Please enter your registered email id.
back Please enter the OTP that is sent your registered email id
Please create the new password here, privacy overview.
We're sorry, this computer has been flagged for suspicious activity.
If you are a member, we ask that you confirm your identity by entering in your email.
You will then be sent a link via email to verify your account.
If you are not a member or are having any other problems, please contact customer support.
Thank you for your cooperation
Solve the following linear programming problem graphically. Minimize Z = 3x+5y Subject to the constraints x + 2 y ≥ 10 , x + y ≥ 6 , 3 x + y ≥ 8 , x ≥ 0 , y ≥ 0. T o m i n i m i z e : z = 3 x + 5 y S u b j e c t t o t h e c o n s t r a i n t s x + 2 y ≥ 10 , x + y ≥ 6 , 3 x + y ≥ 8 , x ≥ 0 , y ≥ 0
Critical points value of z a ( 10 , 0 ) 30 b ( 2 , 4 ) 26 ← min. value c ( 1 , 5 ) 28 d ( 0 , 8 ) 40 as the feasible region is unbounded; therefore 26 may or may not be the minimum value of z. in order to check, we plot the graph of inequality 3x+5y <26. it can be seen easily that the feasible region has no common point with 3x+5y< 26 therefore, the minimum value of z is 26..
Learn how to solve problems using linear programming. A linear programming problem involves finding the maximum or minimum value of an
Solve the following linear programming problem graphically: Maximize: Z=60x+40y subject to the constraints: x+2y≤12; 2x+y≤12 x+45y≥5;x≥0,y≥0. ; x+ ; 45y≥
Question: Problem B .1 Solve the following linear programming problem graphically: Maximize profit = 4X + 6Y Subject to: X + 2Y< 8 5X + 4Y< 20 X,Y> 0.
Steps to Solve a Linear Programming Problem · Step 1 - Identify the decision variables · Step 2 - Write the objective function · Step 3 - Identify Set of
Given that an optimal solution to a linear programming problem exists, it must occur at a vertex of the feasible set. • If the optimal solution occurs at two
Ex 12.1, 1 Solve the following Linear Programming Problems graphically: Maximize Z = 3x + 4y subject to the constraints : x + y ≤ 4
Linear programming is used for obtaining the most optimal solution for a problem with given constraints. In linear programming, we formulate
Solving Linear Programming Problems: ... The general case of a linear programming problem involves an objective function, decision variables and constraints. The
Solve the following linear programming problem graphically. Minimize Z = 3x+5y. Subject to the constraints x+2y≥10,x+y≥6,3x+y≥8,x≥0,y≥0.
The slope of the objective function is -9/8. Since the slope of the objective function is between the slopes of the two constraint lines, the minimum value of