2.8 Linear Programming
Detailed Theory: Linear Programming
1. Introduction to Linear Programming
1.1 What is Linear Programming?
Linear Programming (LP) is a mathematical method to achieve the best outcome (such as maximum profit or lowest cost) in a mathematical model whose requirements are represented by linear relationships.
1.2 Key Components of LP
Every linear programming problem consists of:
Objective Function: The function to be maximized or minimized
Example: Maximize Z=3x+4y
Decision Variables: The variables we can control
Example: x and y
Constraints: Restrictions or limitations on the variables
Example: 2x+y≤10, x+3y≤15
Non-negativity Conditions: Variables must be non-negative
Example: x≥0, y≥0
1.3 Standard Form of LP Problem
A linear programming problem is in standard form if:
It is a maximization problem
All constraints are equations (not inequalities)
All variables are non-negative
All right-hand side constants are non-negative
Standard Form: Maximize Z=c1x1+c2x2+⋯+cnxn
Subject to:
⋮
2. Formulation of Linear Programming Problems
2.1 Steps in Formulation
Identify decision variables
Formulate objective function
Formulate constraints
Add non-negativity conditions
2.2 Example: Production Problem
Problem: A company produces two products, A and B. Each unit of A gives profit of Rs. 40, each unit of B gives profit of Rs. 30. Machine time: A needs 2 hours, B needs 3 hours. Total machine time available: 60 hours. Labor: A needs 1 hour, B needs 2 hours. Total labor available: 40 hours. Find optimal production mix.
Formulation:
Step 1: Decision variables: Let x1 = number of units of A produced Let x2 = number of units of B produced
Step 2: Objective function (maximize profit): Maximize Z=40x1+30x2
Step 3: Constraints: Machine time: 2x1+3x2≤60 Labor time: x1+2x2≤40
Step 4: Non-negativity: x1≥0, x2≥0
Complete LP: Maximize Z=40x1+30x2
Subject to:
3. Graphical Method
3.1 When to Use Graphical Method
The graphical method can be used only when there are two decision variables.
3.2 Steps in Graphical Method
Plot constraints as straight lines
Identify feasible region (area satisfying all constraints)
Find corner points of feasible region
Evaluate objective function at each corner point
Select optimal solution
3.3 Example Using Graphical Method
Solve: Maximize Z=3x+4y
Subject to:
Step 1: Plot constraints
Constraint 1: x+y≤5
Line: x+y=5
Intercepts: (5,0) and (0,5)
Shade below line (since ≤)
Constraint 2: 2x+y≤8
Line: 2x+y=8
Intercepts: (4,0) and (0,8)
Shade below line
Non-negativity: x≥0, y≥0 (first quadrant only)
Step 2: Identify feasible region Feasible region is the intersection of all shaded areas.
Step 3: Find corner points
Origin: (0,0)
X-intercept of constraint 1: (5,0)
Y-intercept of constraint 1: (0,5)
Intersection of constraints: Solve x+y=5 and 2x+y=8
Subtract first from second: x=3 Then 3+y=5⇒y=2 Intersection: (3,2)
Check if (0,5) satisfies constraint 2: 2(0)+5=5≤8 ✓
Check if (4,0) satisfies constraint 1: 4+0=4≤5 ✓
So corner points: (0,0), (5,0), (0,5), (3,2)
Step 4: Evaluate objective function
At (0,0): Z=3(0)+4(0)=0
At (5,0): Z=3(5)+4(0)=15
At (0,5): Z=3(0)+4(5)=20
At (3,2): Z=3(3)+4(2)=9+8=17
Step 5: Select optimal solution Maximum Z=20 at (0,5)
So optimal solution: x=0, y=5, Z=20
3.4 Special Cases in Graphical Method
a) Multiple Optimal Solutions
When objective function line is parallel to a constraint line forming one side of feasible region.
Example: Maximize Z=2x+2y with same constraints as above.
Then at (0,5): Z=10, at (3,2): Z=10
All points on line segment between (0,5) and (3,2) give same Z=10
b) Unbounded Solution
When feasible region extends infinitely in direction of increasing/decreasing objective function.
Example: Maximize Z=x+y with constraints x≥0, y≥0 only.
c) Infeasible Problem
When no point satisfies all constraints simultaneously (feasible region is empty).
Example: x+y≤2 and x+y≥3 with x,y≥0
4. Simplex Method
4.1 Introduction to Simplex Method
The simplex method is an iterative algorithm for solving linear programming problems with any number of variables.
4.2 Converting to Standard Form
To use simplex method, we need to convert inequalities to equations by adding slack, surplus, and artificial variables.
a) Slack Variables (for ≤ constraints)
Add slack variable to convert inequality to equation.
Example: 2x+3y≤10 becomes 2x+3y+s=10 with s≥0
b) Surplus and Artificial Variables (for ≥ constraints)
Subtract surplus variable to convert to equation
Add artificial variable to get initial basic feasible solution
Example: x+y≥5 becomes x+y−s+a=5 with s≥0, a≥0
c) Artificial Variables (for = constraints)
Add artificial variable directly.
Example: x+2y=8 becomes x+2y+a=8
4.3 Simplex Algorithm Steps
Step 1: Convert to standard form
Step 2: Set up initial simplex tableau
Step 3: Identify entering variable (most negative coefficient in objective row for maximization)
Step 4: Identify leaving variable using minimum ratio test
Step 5: Perform pivot operation
Step 6: Repeat until all coefficients in objective row are non-negative
4.4 Example Using Simplex Method
Maximize Z=3x+4y
Subject to:
Step 1: Convert to standard form Add slack variables s1 and s2:
Maximize Z=3x+4y+0s1+0s2
Subject to:
Step 2: Initial simplex tableau
s₁
1
1
1
0
5
s₂
2
1
0
1
8
Z
-3
-4
0
0
0
Step 3: Entering variable Most negative in Z-row: -4 (column y)
Step 4: Leaving variable Minimum ratio test: For s₁ row: 5/1 = 5 For s₂ row: 8/1 = 8 Minimum is 5, so s₁ leaves
Step 5: Pivot operation Pivot on element at intersection of y-column and s₁-row (value = 1)
New tableau after making pivot element = 1 and other elements in column = 0:
y
1
1
1
0
5
s₂
1
0
-1
1
3
Z
1
0
4
0
20
Step 6: Check optimality All coefficients in Z-row are non-negative (1, 0, 4, 0 ≥ 0), so optimal.
Optimal solution: y=5, s2=3, x=0, Z=20
This matches graphical solution.
5. Duality in Linear Programming
5.1 Primal and Dual Problems
Every linear programming problem (called primal) has a corresponding dual problem.
Primal (Maximization): Maximize Z=cTx
Subject to: Ax≤b, x≥0
Dual (Minimization): Minimize W=bTy
Subject to: ATy≥c, y≥0
5.2 Rules for Forming Dual
n variables
n constraints
m constraints
m variables
Coefficients cⱼ
RHS bᵢ
RHS bᵢ
Coefficients cⱼ
Constraint i: ≤
Variable yᵢ ≥ 0
Constraint i: ≥
Variable yᵢ ≤ 0
Constraint i: =
Variable yᵢ unrestricted
Variable xⱼ ≥ 0
Constraint j: ≥
Variable xⱼ ≤ 0
Constraint j: ≤
Variable xⱼ unrestricted
Constraint j: =
5.3 Example: Primal to Dual
Primal: Maximize Z=40x1+30x2
Subject to:
Dual: Let y1, y2 be dual variables
Minimize W=60y1+40y2
Subject to:
5.4 Duality Theorems
a) Weak Duality Theorem
If x is feasible for primal and y is feasible for dual, then:
b) Strong Duality Theorem
If either primal or dual has an optimal solution, then so does the other, and:
c) Complementary Slackness
At optimality:
If primal constraint is not binding (slack > 0), then corresponding dual variable = 0
If dual constraint is not binding (surplus > 0), then corresponding primal variable = 0
6. Sensitivity Analysis
6.1 What is Sensitivity Analysis?
Study of how changes in parameters affect optimal solution.
6.2 Types of Changes Analyzed
Changes in objective function coefficients
Changes in right-hand side constants
Addition of new variables
Addition of new constraints
6.3 Range of Optimality
For objective function coefficient cj, the range of optimality is the range of values for which current optimal solution remains optimal.
Example: For Z=3x+4y with optimal solution (0,5):
Current coefficient of x: 3
Range of optimality for cx: cx≤4 (If cx>4, then (0,5) is no longer optimal)
6.4 Shadow Price
Shadow price of a resource is the increase in optimal value per unit increase in availability of that resource.
Mathematically: Shadow price = optimal value of corresponding dual variable.
Example: For constraint x+y≤5 with RHS = 5, if we increase to 6:
New optimal: (0,6) gives Z=24
Increase: 24 - 20 = 4
Shadow price = 4
7. Transportation Problem
7.1 Introduction
Transportation problem deals with distributing goods from multiple sources to multiple destinations at minimum cost.
7.2 Mathematical Formulation
Let:
m sources with supplies a1,a2,…,am
n destinations with demands b1,b2,…,bn
cij = cost to transport one unit from source i to destination j
xij = amount transported from source i to destination j
Minimize total cost:
Subject to: Supply constraints:
Demand constraints:
Non-negativity:
7.3 Balanced Transportation Problem
When total supply = total demand:
If unbalanced, add dummy source or destination.
7.4 Solution Methods
North-West Corner Method
Least Cost Method
Vogel's Approximation Method (VAM)
MODI Method (Modified Distribution) for optimality test
7.5 Example: Transportation Problem
Problem: Sources: S1 (supply 30), S2 (supply 50) Destinations: D1 (demand 20), D2 (demand 30), D3 (demand 30)
Cost matrix:
S1
2
3
4
S2
5
1
2
Using North-West Corner Method:
Step 1: Start at NW corner (S1-D1) Allocate min(30,20) = 20 to S1-D1 S1 supply left: 10, D1 satisfied
Step 2: Move right to S1-D2 Allocate min(10,30) = 10 to S1-D2 S1 exhausted, D2 demand left: 20
Step 3: Move down to S2-D2 Allocate min(50,20) = 20 to S2-D2 D2 satisfied, S2 supply left: 30
Step 4: Move right to S2-D3 Allocate min(30,30) = 30 to S2-D3
All allocations done.
Total cost = 20×2+10×3+20×1+30×2=40+30+20+60=150
8. Assignment Problem
8.1 Introduction
Special case of transportation problem where:
Number of sources = number of destinations
Each source supplies exactly 1 unit
Each destination demands exactly 1 unit
8.2 Mathematical Formulation
Minimize
Subject to:
8.3 Hungarian Method
Algorithm for solving assignment problems:
Step 1: Row reduction - subtract smallest element in each row from all elements in that row
Step 2: Column reduction - subtract smallest element in each column from all elements in that column
Step 3: Cover all zeros with minimum number of lines
Step 4: If number of lines = n, optimal solution found. Otherwise, adjust matrix and repeat.
8.4 Example: Assignment Problem
Assign 4 jobs to 4 workers with cost matrix:
W1
9
2
7
8
W2
6
4
3
7
W3
5
8
1
8
W4
7
6
9
4
Solution using Hungarian method:
Row reduction:
Row 1: Subtract 2: [7, 0, 5, 6]
Row 2: Subtract 3: [3, 1, 0, 4]
Row 3: Subtract 1: [4, 7, 0, 7]
Row 4: Subtract 4: [3, 2, 5, 0]
Column reduction:
Col 1: Subtract 3: [4, 0, 1, 0]
Col 2: Subtract 0: [0, 1, 7, 2]
Col 3: Subtract 0: [5, 0, 0, 5]
Col 4: Subtract 0: [6, 4, 7, 0]
Cover zeros with minimum lines (need 4 lines for optimal).
Optimal assignment: W1 → J2, W2 → J3, W3 → J1, W4 → J4 Total cost = 2 + 3 + 5 + 4 = 14
9. Integer Programming
9.1 Introduction
Linear programming with additional requirement that some or all variables must take integer values.
9.2 Types
Pure Integer Programming: All variables integer
Mixed Integer Programming: Some variables integer
Binary Integer Programming: Variables 0 or 1
9.3 Solution Methods
Branch and Bound Method
Cutting Plane Method
Gomory's Cutting Plane Method
9.4 Example: Integer Programming
Maximize Z=3x+2y
Subject to:
LP relaxation solution (without integer constraint): x=34, y=310, Z=332
Branch and Bound:
Branch on x: x≤1 and x≥2
Solve each subproblem
Continue until integer solutions found
Optimal integer solution: x=2, y=2, Z=10
10. Applications of Linear Programming
10.1 Business and Economics
Production planning: Optimal product mix
Inventory management: When and how much to order
Portfolio selection: Maximize return, minimize risk
Blending problems: Optimal mix of ingredients
10.2 Engineering
Structural design: Minimum weight structures
Network flows: Maximum flow, shortest path
Scheduling: Optimal timetables
10.3 Agriculture
Crop planning: Land allocation to maximize profit
Feed mix: Minimum cost animal feed
10.4 Healthcare
Resource allocation: Hospital staff scheduling
Diet planning: Minimum cost nutritious diet
11. Important Theorems and Concepts
11.1 Fundamental Theorem of Linear Programming
If an LP problem has an optimal solution, then it has an optimal solution at a corner point (extreme point) of the feasible region.
11.2 Extreme Point Theorem
The feasible region of an LP problem is a convex polyhedron, and the optimal solution occurs at an extreme point.
11.3 Complementary Slackness Theorem
At optimality of primal and dual:
If a primal variable is positive, corresponding dual constraint is tight
If a dual variable is positive, corresponding primal constraint is tight
11.4 Farkas' Lemma
Either Ax=b, x≥0 has a solution, or ATy≥0, bTy<0 has a solution, but not both.
12. Practice Problems
Problem 1: Graphical Method
Maximize Z=5x+3y
Subject to:
Solution: Corner points: (0,0), (2,0), (0,3), intersection point
Solve:
Multiply first by 2: 6x+10y=30 Multiply second by 5: 25x+10y=50 Subtract: 19x=20⇒x=1920 Then 3(1920)+5y=15⇒5y=15−1960=19225⇒y=1945
Evaluate:
(0,0): Z = 0
(2,0): Z = 10
(0,3): Z = 9
(1920,1945): Z = 5×1920+3×1945=19100+19135=19235≈12.37
Optimal: x=1920, y=1945, Z=19235
Problem 2: Simplex Method
Maximize Z=2x1+3x2
Subject to:
Solution: Add slack variables s1,s2:
Maximize Z=2x1+3x2+0s1+0s2
Subject to:
Initial tableau:
s₁
1
1
1
0
4
s₂
1
-1
0
1
2
Z
-2
-3
0
0
0
Entering: x₂ (most negative -3) Leaving: s₁ (min ratio: 4/1 = 4 vs 2/(-1) invalid)
Pivot on (1,2):
New tableau:
x₂
1
1
1
0
4
s₂
2
0
1
1
6
Z
1
0
3
0
12
Optimal (all coefficients ≥ 0)
Solution: x1=0, x2=4, Z=12
13. Exam Tips and Common Mistakes
13.1 Common Mistakes
Forgetting non-negativity constraints
Incorrect conversion of inequalities to equations
Wrong direction of inequality when forming dual
Incorrect pivot element selection in simplex
Not checking for multiple or unbounded solutions
13.2 Problem-Solving Strategy
Understand the problem: Identify objective, variables, constraints
Choose appropriate method: Graphical (2 variables), Simplex (more variables)
Solve systematically: Show all steps
Interpret solution: What do the numbers mean in context?
Check feasibility: Does solution satisfy all constraints?
13.3 Quick Checks
Feasible region: Should be convex polygon
Optimal solution: At corner point for LP
Shadow prices: Non-negative for maximization
Dual variables: Non-negative for ≤ constraints in primal maximization
This comprehensive theory covers all aspects of linear programming with detailed explanations and examples, providing complete preparation for the entrance examination.
Last updated