Linear Programming (LP) is a mathematical technique used to determine the best possible solution (maximum profit or minimum cost) for a problem involving limited resources and linear constraints.
The term "linear" means that the objective function and constraints are represented by linear equations or inequalities.
The term "programming" refers to planning or determining the optimal course of action.
Linear Programming is used to optimize the use of limited resources.
The objective is to obtain the maximum or minimum value of a linear function while satisfying all given constraints.
Some of its applications are:
Components of Linear Programming
The basic components of a linear programming(LP) problem are:
Decision Variables: Variables you want to determine to achieve the optimal solution.
Objective Function: An arithmetic equation that represents the goal you want to achieve.
Constraints: Limitations or restrictions that your decision variables must follow.
Non-Negativity Restrictions: In somereal-world scenarios, decision variables cannot be negative.
Finiteness: The number of decision variables and constraints in an LP problem is finite.
Linearity: The objective function and all constraints must be linear functions of the decision variables. It means the degree of variables should be one.
Example: Suppose a deliveryman has to deliver 8 packets in a day to the different locations of a city. He has to pick all the packets from A and has to deliver them to points P, Q, R, S, T, U, V, and W. The distance between them is indicated using the lines as shown in the image below. The shortest path followed by the deliveryman is calculated using the concept of Linear Programming.
Linear Programming Formula
A linear programming problem consists of,
1) Decision variables are the variables x and y, which decide the output of the linear programming problem and represent the final solution.
2) The objective function, generally represented by Z, is the linear function that needs to be optimized according to the given condition to get the final solution.
3) The restrictions imposed on decision variables that limit their values are called constraints.
Now, the general formula of a linear programming problem is,
Objective Function: Z = ax + by
Constraints: cx + dy ≥ e, px + qy ≤ r
4) Non-Negative restrictions: x ≥ 0, y ≥ 0
In the above condition, x. and y are the decision variables.
Terminology Used in Linear Programming
Several important terms are frequently used in linear programming.
Feasible Region: The common region that satisfies all the given constraints is called the feasible region. Every point inside this region represents a possible solution to the problem.
Feasible Solution: Any point that satisfies all constraints and non-negativity conditions is called a feasible solution.
Optimal Solution: A feasible solution that gives the maximum or minimum value of the objective function is called the optimal solution.
Corner Point (Extreme Point): The vertices of the feasible region are called corner points or extreme points. In the graphical method, the optimal solution occurs at one or more corner points.
Bounded Solution: If the objective function attains a finite maximum or minimum value within the feasible region, the solution is called a bounded solution.
Unbounded Solution: If the value of the objective function can increase or decrease indefinitely without violating any constraints, the solution is called an unbounded solution.
Infeasible Solution: If no common region satisfies all the constraints simultaneously, the problem has no feasible solution and is called infeasible.
Redundant Constraint: A constraint that does not affect the feasible region is known as a redundant constraint.
Solving Linear Programming Problems
Before solving the linear programming problems, first we have to formulate the problems according to the standard parameters. The steps for solving linear programming problems are,
Step 1: Mark the decision variables in the problem. Let x = number of product A, y = number of product B.
Step 2: Build the objective function of the problem and check if the function needs to be minimized or maximized. Maximize Z = 5x + 7y
Step 3: Write down all the constraints of the linear problems. 2x + y ≤ 100 ((resource constraint)
Step 4: Ensure non-negative restrictions of the decision variables.
x, y ≥0(non-negativity)
Step 5: Now solve the linear programming problem using any method generally we use either the simplex or graphical method.
Linear Programming Methods
The two most common methods used are,
1. Graphical Method
The graphical method is used when a linear programming problem contains two decision variables. It involves plotting all constraints on a coordinate plane and identifying the feasible region.
Steps to solve
Convert each inequality into an equation.
Plot the corresponding lines on the coordinate plane.
Determine the feasible region satisfying all constraints.
Find the corner points of the feasible region.
Evaluate the objective function at each corner point.
Select the point that gives the maximum or minimum value of the objective function.
2. Simplex Method
The simplex method is an algebraic technique used for solving linear programming problems involving multiple variables and constraints. The method systematically moves from one feasible solution to another until the optimal solution is obtained.
Steps to solve
Formulate the linear programming problem.
Convert inequalities into equations using slack, surplus, or artificial variables.
Construct the initial simplex table.
Identify the pivot column and pivot row.
Perform row operations to obtain a new table.
Repeat the process until all entries in the objective row satisfy the optimality condition.
Read the optimal solution from the final simplex table.
Types of Linear Programming Problems
Manufacturing Problems are the problem that deals with the number of units that should be produced or sold to maximize profits when each product requires fixed manpower, machine hours, and raw materials.
Diet Problems is used to calculate the number of different kinds of constituents to be included in the diet to get the minimum cost, subject to the availability of food and their prices.
Transportation Problems is used to determine the transportation schedule to find the cheapest way of transporting a product from plants /factories situated at different locations to different markets.
Applications
Here are some modern applications:
Supply Chain Optimization: It's used for determining the most cost-effective transportation routes, warehouse operations, and inventory management strategies.
Telecommunications Network Design: It helps in allocating bandwidth, designing network layouts, and optimizing the flow of data to ensure high-speed communication at lower costs.
Financial Planning: Businesses and financial analysts use linear programming for portfolio optimization, risk management, and capital budgeting.
Healthcare Logistics: In healthcare, linear programming is applied to optimize the allocation of resources, such as hospital beds, medical staff, and equipment.
Airline Crew Scheduling: Airlines employ linear programming to schedule crews efficiently, ensuring that flights are staffed in compliance with regulations and minimizing operational costs.
Solved Question
Question 1: A company manufactures and sells two types of products, and the cost of production of each unit of a and b is rupees 200 and 150,, respectively. Each unit of product yields a profit of 20 rupees, and each unit of product b yields a profit of 15 rupees on selling. The company estimates the monthly demand of A and B to be at a maximum of the harvested unit in all the production budget for the month is set at rupees 50000. How many units should the company manufacture to earn maximum profit from its monthly sales from a and b?
Let x = number of units of type A y = Number of units of type B Maximize Z = 20 + 15y Subject to the constraints 200x + 150y ≤ 50000 Non-negativity: and x, y ≥ 0 Assuming no max demand constraints 200x + 150y = 50000 y = 50000 -200x /150 y = 333.33 - 1.33x x-intercept when y=0: 200x = 50000 x = 250 y-intercept when x=0: 150y = 50000 y = 333.33 Calculate profit at intercept points At (0,333.33): Z = 20(0) + 15(333.33) Z = 5000
At (250, 0): Z = 20(250) + 15(0) Z = 5000
So, maximum profit is Rs. 5,000,
Question 2: Maximize Z = 3x + 4y.
Subject to constraints , x + y ≤ 450, 2x + y ≤ 600 and x, y ≤ 0.
We have from the given
Constraints (1) X + Y = 450 Putting x = 0, ⇒ 0 + y = 450 ⇒ y = 450 Putting y = 0, ⇒ x + 0 = 450 ⇒ x = 450 From, Constraints (2) 2x + y = 600 Putting x = 0, ⇒ 0 + y = 600 ⇒ y = 600 Putting y = 0, ⇒ 2x + 0 = 600 ⇒ x = 300
Now, we have the points co-ordinate Z = 3x + 4y
Vertices
Z = 3x + 4y
(0, 0)
Z = 3 × 0 + 4 × 0 = 0
(300, 0)
Z = 3 × 300+ 4 × 0 = 900
(150, 300)
Z = 3 × 150 + 4 × 300 = 1650
(0, 450)
Z = 3 × 0 + 4 × 450 = 1800
Therefore, the optimal solution maximum Z = 1800 at co-ordinate x = 0 and y = 450. The graph is given below.
Question 3: Find the maximal and minimal value of z = 6x + 9y when the constraint conditions are,
2x + 3y ≤ 12
x and y ≥ 0
x + y ≤ 5
Step 1: First convert the inequations into normal equations. Hence the equations will be 2x + 3y = 12, x = 0, y = 0 and x + y = 5.
Step 2: Find the points at which 2x + 3y and x + y = 5 cut the x-axis and y-axis. To find the point of intersection of the x-axis put y = 0 in the respective equation and find the point. Similarly for y-axis intersection points put x = 0 in the respective equation.
From 2x + 3y = 12:
When x = 0, 3y = 12 → y = 4 (point (0, 4))
When y = 0, 2x = 12 → x = 6 (point (6, 0))
From x + y = 5:
When x = 0, y = 5 (point (0, 5))
When y = 0, x = 5 ( point (5, 0))
Step 3: Find the intersection of the two lines 2x + 3y = 12 and x + y = 5
From x + y = 5, y = 5 - x, substitute into 2x + 3y = 12
Draw the two lines cutting the x-axis and y-axis. We find that the two axes cut each other at (3, 2).
Step 4: For x ≥ 0 and y ≥ 0, we find that both inequations are followed. Hence the region will include an area region enclosed by two axes and both lines including the origin. The feasible region is a quadrilateral bounded by: (0, 0), (0, 4), (3, 2), and (5, 0).
Step 5: Find Z for each point and maxima and minima.
Coordinates
Z = 6x + 9y
(0, 0)
Z = 0
(0, 4)
Z = 36
(3, 2)
Z = 36
(5, 0)
Z = 30
Hence, we find that Z = 6x + 9y is:
Maximum(z = 36), at (0, 4) and (3, 2).
Minimum at (z = 0), at point (0, 0).
Practice Problem
Question 1: Maximize Z = 3x+4y subject to the constraints:
x+2\leq 8
3x+y\leq 9
x \geq 0
y \geq 0
Question 2: Minimize Z = 5x+2y subject to the constraints:
2x + y \geq 10
x + 3y \geq 15
x \geq 0
y \geq 0
Question 3: A factory produces two products, P1 and P2. The profit for P1 is $40, and for P2 is $30. Each product requires processing in two departments. The processing times in hours per unit for each department are given below:
Product
Department A
Department B
P1
2
1
P2
1
2
The available hours for Department A are 100, and for Department B are 80. Formulate the linear programming problem to maximize the profit.
Question 4: Minimize the cost of a diet containing at least 60 units of protein and 70 units of carbohydrates. Two food items, A and B, provide the following nutrients per unit:
Nutrient
Food A
Food B
Protein
3
4
Carbohydrates
4
2
The cost per unit of food A is $2, and food B is $3. Formulate the linear programming problem to minimize the cost.