Chapter 17: Linear Programming
Master linear programming models, graphical methods, and optimization techniques with comprehensive SPM exam strategies.
Chapter 17: Linear Programming
Overview
Linear programming is a mathematical optimization technique used to find the best possible solution to problems with linear constraints and linear objective functions. This chapter explores the formulation of linear programming models, graphical solution methods, and applications in business, engineering, and resource allocation. Mastery of linear programming is essential for decision-making in constrained environments, optimizing resource allocation, and solving real-world optimization problems.
Learning Objectives
After completing this chapter, you will be able to:
- Formulate linear programming problems from real-world scenarios
- Graph linear inequalities and identify feasible regions
- Use graphical methods to find optimal solutions
- Interpret sensitivity analysis and shadow prices
- Apply linear programming to various optimization problems
Key Concepts
17.1 Linear Programming Models
Components of Linear Programming
A linear programming problem consists of:
- Decision Variables: Variables that represent the quantities to be determined
- Objective Function: Linear function to be maximized or minimized
- Constraints: Linear inequalities or equations that limit the feasible solutions
General Form: Maximize/Minimize: Z = + + ⋯ + Subject to: + + ⋯ + ≤ (or ≥ or =) + + ⋯ + ≤ (or ≥ or =) ... + + ⋯ + ≤ (or ≥ or =) , , ..., ≥ 0 (non-negativity constraints)
Standard Form
For maximization problems with ≤ constraints and non-negative variables:
17.2 Graphical Method for Two Variables
Steps in Graphical Solution
- Identify decision variables and objective function
- Graph constraints as linear inequalities
- Determine feasible region (intersection of all constraints)
- Find corner points of feasible region
- Evaluate objective function at corner points
- Identify optimal solution (maximum or minimum value)
Feasible Region Properties
For two-variable problems:
- Feasible region is a convex polygon
- Optimal solution occurs at a corner point (vertex)
- Multiple optimal solutions if objective function is parallel to a constraint boundary
17.3 Sensitivity Analysis
Shadow Prices
The shadow price of a constraint is the change in the objective function value per unit increase in the right-hand side of that constraint (within allowable range).
Range of Optimality
The range of optimality shows how much the objective function coefficients can change without changing the optimal solution.
Range of Feasibility
The range of feasibility shows how much the right-hand side values can change without changing the basis of the optimal solution.
Important Formulas and Methods
Key Solution Methods
Graphical Method Steps:
- Graph each constraint as an equality to find boundary lines
- Determine which side of each line is feasible
- Find intersection points of constraint lines
- Evaluate objective function at all corner points
- Select point giving optimal objective value
Optimality Test: For a maximization problem, the optimal solution is the corner point that gives the maximum value of the objective function. For minimization, it's the corner point giving the minimum value.
Constraint Identification
Resource Constraints: Limited resources (labor, materials, time) Demand Constraints: Minimum production requirements Capacity Constraints: Maximum production limits Proportionality Constraints: Fixed ratios between variables
Solved Examples
Example 1: Maximization Problem
A manufacturer produces two products A and B. Product A requires 2 hours of labor and 1 kg of material per unit. Product B requires 1 hour of labor and 2 kg of material per unit. Total labor available is 40 hours and material available is 30 kg. Product A gives profit RM20 per unit and product B gives profit RM30 per unit. How many units of each should be produced to maximize profit?
Solution:
Decision Variables: Let x = number of units of product A Let y = number of units of product B
Objective Function: Maximize: P = 20x + 30y
Constraints: 2x + y ≤ 40 (labor) x + 2y ≤ 30 (material) x ≥ 0, y ≥ 0
Graphical Solution:
- Graph constraints:
- Labor: 2x + y = 40 ⇒ (0,40), (20,0)
- Material: x + 2y = 30 ⇒ (0,15), (30,0)
-
Find intersection: 2x + y = 40 x + 2y = 30 ⇒ x = 30 - 2y 2(30 - 2y) + y = 40 ⇒ 60 - 4y + y = 40 ⇒ 60 - 3y = 40 ⇒ 3y = 20 ⇒ y = 20/3 ≈ 6.67 x = 30 - 2(20/3) = 30 - 40/3 = 50/3 ≈ 16.67
-
Corner points: (0,0), (20,0), (50/3, 20/3), (0,15)
-
Evaluate objective:
- (0,0): P = 0
- (20,0): P = 20(20) + 30(0) = 400
- (50/3, 20/3): P = 20(50/3) + 30(20/3) = 1000/3 + 600/3 = 1600/3 ≈ 533.33
- (0,15): P = 20(0) + 30(15) = 450
Optimal Solution: x = 50/3 ≈ 16.67 units, y = 20/3 ≈ 6.67 units, P = RM533.33
Example 2: Minimization Problem
A diet requires at least 2000 calories, 50g protein, and 80g carbohydrates. Two foods A and B are available. Food A costs RM2 per unit and provides 100 calories, 20g protein, and 30g carbohydrates. Food B costs RM3 per unit and provides 200 calories, 30g protein, and 40g carbohydrates. How many units of each food should be used to minimize cost?
Solution:
Decision Variables: Let x = number of units of food A Let y = number of units of food B
Objective Function: Minimize: C = 2x + 3y
Constraints: 100x + 200y ≥ 2000 (calories) ⇒ x + 2y ≥ 20 20x + 30y ≥ 50 (protein) ⇒ 2x + 3y ≥ 5 30x + 40y ≥ 80 (carbohydrates) ⇒ 3x + 4y ≥ 8 x ≥ 0, y ≥ 0
Graphical Solution:
- Graph constraints:
- Calories: x + 2y = 20 ⇒ (20,0), (0,10)
- Protein: 2x + 3y = 5 ⇒ (2.5,0), (0,1.67)
- Carbohydrates: 3x + 4y = 8 ⇒ (8/3≈2.67,0), (0,2)
-
Find feasible region (unbounded for minimization)
-
Corner points: (8/3,0), intersection of protein and carbs, intersection of calories and carbs
-
Intersection points:
-
Protein and carbs: 2x + 3y = 5, 3x + 4y = 8 Multiply first by 3, second by 2: 6x + 9y = 15, 6x + 8y = 16 Subtract: y = -1 (not feasible)
-
Calories and carbs: x + 2y = 20, 3x + 4y = 8 From first: x = 20 - 2y 3(20 - 2y) + 4y = 8 ⇒ 60 - 6y + 4y = 8 ⇒ 60 - 2y = 8 ⇒ 2y = 52 ⇒ y = 26 x = 20 - 2(26) = 20 - 52 = -32 (not feasible)
-
-
Practical corner: Check protein constraint boundary with non-negativity At x = 0: protein constraint: 3y ≥ 5 ⇒ y ≥ 5/3 ≈ 1.67 Calories constraint: 2y ≥ 20 ⇒ y ≥ 10 Carbs constraint: 4y ≥ 8 ⇒ y ≥ 2 So binding constraint is y ≥ 10
At y = 0: protein constraint: 2x ≥ 5 ⇒ x ≥ 2.5 Calories constraint: x ≥ 20 Carbs constraint: 3x ≥ 8 ⇒ x ≥ 8/3 ≈ 2.67 So binding constraint is x ≥ 20
-
Corner points: (20,0), (0,10), and intersection of protein with other constraints
-
Evaluate objective at feasible corner points:
- (20,0): C = 2(20) + 3(0) = 40
- (0,10): C = 2(0) + 3(10) = 30
- Intersection of protein and calories: 2x + 3y = 5, x + 2y = 20 From second: x = 20 - 2y 2(20 - 2y) + 3y = 5 ⇒ 40 - 4y + 3y = 5 ⇒ 40 - y = 5 ⇒ y = 35 x = 20 - 2(35) = 20 - 70 = -50 (not feasible)
Optimal Solution: x = 0 units, y = 10 units, C = RM30
Example 3: Mixed Constraints
A company produces three products using two machines. Machine 1 is available 40 hours, Machine 2 is available 50 hours. Product A requires 2 hours on Machine 1 and 3 hours on Machine 2. Product B requires 4 hours on Machine 1 and 2 hours on Machine 2. Product C requires 3 hours on Machine 1 and 4 hours on Machine 2. Profits are RM50, RM60, and RM70 per unit respectively. Maximize profit.
Solution:
Decision Variables: Let x = units of A, y = units of B, z = units of C
Objective Function: Maximize: P = 50x + 60y + 70z
Constraints: 2x + 4y + 3z ≤ 40 (Machine 1) 3x + 2y + 4z ≤ 50 (Machine 2) x, y, z ≥ 0
Graphical Method Limitation: With three variables, graphical method becomes complex. We can reduce to two variables by fixing one variable and solving repeatedly, or use simplex method.
For demonstration, let's assume we can produce only one product type:
- Only A: x = 40/2 = 20, y=0, z=0 ⇒ P = 50×20 = 1000
- Only B: y = 40/4 = 10, x=0, z=0 ⇒ P = 60×10 = 600
- Only C: z = 40/3 ≈ 13.33, x=0, y=0 ⇒ P = 70×13.33 ≈ 933.33
Better solutions exist with multiple products, but require more complex methods.
Example 4: Sensitivity Analysis
In Example 1, if the profit of product A increases to RM25 per unit, does the optimal solution change?
Solution:
New objective: P = 25x + 30y
Evaluate at same corner points:
- (50/3, 20/3): P = 25(50/3) + 30(20/3) = 1250/3 + 600/3 = 1850/3 ≈ 616.67
- (20,0): P = 25(20) + 30(0) = 500
- (0,15): P = 25(0) + 30(15) = 450
The corner point (50/3, 20/3) is still optimal, so the solution doesn't change, but the maximum profit increases.
Example 5: Multiple Optimal Solutions
In Example 1, if the profit of product A is RM15 per unit and product B is RM30 per unit, what happens?
Solution:
New objective: P = 15x + 30y
At (50/3, 20/3): P = 15(50/3) + 30(20/3) = 250 + 200 = 450 At (0,15): P = 15(0) + 30(15) = 450
Both points give same profit, so there are multiple optimal solutions along the line segment between them.
Real-World Applications
1. Business and Economics
Production Planning:
- Optimize resource allocation
- Maximize profit or minimize cost
- Production scheduling
Example: A manufacturer must decide how many of each product to make given limited resources and demand constraints.
2. Transportation and Logistics
Network Optimization:
- Route planning
- Vehicle scheduling
- Supply chain optimization
Example: Find the minimum cost shipping plan from multiple factories to multiple warehouses.
3. Finance and Investment
Portfolio Optimization:
- Asset allocation
- Risk management
- Return maximization
Example: Allocate investments across different assets to maximize return while managing risk.
4. Agriculture and Farming
Crop Planning:
- Land allocation
- Resource optimization
- Profit maximization
Example: Determine optimal crop mix given land area, water availability, and market prices.
Complex Problem-Solving Techniques
Problem: A furniture company produces chairs and tables. Each chair requires 2 hours of carpentry and 1 hour of finishing. Each table requires 3 hours of carpentry and 2 hours of finishing. The company has 120 carpentry hours and 80 finishing hours available weekly. Each chair gives RM50 profit and each table gives RM80 profit. Due to market demand, they must produce at least 10 chairs and 5 tables weekly. How many chairs and tables should be produced to maximize profit?
Solution:
Decision Variables: Let x = number of chairs Let y = number of tables
Objective Function: Maximize: P = 50x + 80y
Constraints: 2x + 3y ≤ 120 (carpentry) x + 2y ≤ 80 (finishing) x ≥ 10 (demand for chairs) y ≥ 5 (demand for tables)
Graphical Solution:
-
Graph constraints:
- Carpentry: 2x + 3y = 120 ⇒ (60,0), (0,40)
- Finishing: x + 2y = 80 ⇒ (80,0), (0,40)
- Demand: x = 10, y = 5
-
Find feasible region corner points:
- Intersection of x=10 and finishing: 10 + 2y = 80 ⇒ 2y = 70 ⇒ y = 35 ⇒ (10,35)
- Intersection of y=5 and carpentry: 2x + 3(5) = 120 ⇒ 2x = 105 ⇒ x = 52.5 ⇒ (52.5,5)
- Intersection of carpentry and finishing: 2x + 3y = 120, x + 2y = 80 From second: x = 80 - 2y 2(80 - 2y) + 3y = 120 ⇒ 160 - 4y + 3y = 120 ⇒ 160 - y = 120 ⇒ y = 40 x = 80 - 2(40) = 0 ⇒ (0,40)
- Intersection with demand boundaries: (10,5)
-
Check which corner points are feasible:
- (10,35): Check carpentry: 2(10) + 3(35) = 20 + 105 = 125 > 120 ✗
- (52.5,5): Check finishing: 52.5 + 2(5) = 62.5 ≤ 80 ✓
- (0,40): Check demand: x=0 < 10 ✗
- (10,5): Check both constraints: 2(10)+3(5)=35≤120, 10+2(5)=20≤80 ✓
-
Additional intersection: Intersection of carpentry and x=10: 2(10) + 3y = 120 ⇒ 3y = 100 ⇒ y = 100/3 ≈ 33.33 ⇒ (10,33.33) Check finishing: 10 + 2(33.33) ≈ 10 + 66.67 = 76.67 ≤ 80 ✓
-
Corner points: (10,5), (10,33.33), (52.5,5)
-
Evaluate objective:
- (10,5): P = 50(10) + 80(5) = 500 + 400 = 900
- (10,33.33): P = 50(10) + 80(33.33) = 500 + 2666.67 = 3166.67
- (52.5,5): P = 50(52.5) + 80(5) = 2625 + 400 = 3025
Optimal Solution: x = 10 chairs, y = 33.33 tables (produce 33 full tables), P = RM3166.67
Problem: A company produces three products X, Y, and Z. Product X gives RM20 profit, Y gives RM30 profit, Z gives RM25 profit. Constraints:
- 2X + 3Y + Z ≤ 100 (Resource A)
- X + 2Y + 3Z ≤ 80 (Resource B)
- X, Y, Z ≥ 0
The company wants to explore the effect of changing profit coefficients. What is the range of the profit coefficient for product X that keeps the current optimal solution unchanged?
Solution:
This requires simplex method for complete analysis, but we can explore sensitivity graphically:
- Find optimal solution for original coefficients (20,30,25)
- Determine how changes in X's coefficient affect the solution
- Find the range where the optimal basis remains the same
Optimal Solution Analysis: Using simplex method or graphical exploration, we find that for the current optimal solution (say X=20, Y=20, Z=0), the reduced cost for Z is positive, indicating it's not profitable to produce Z.
The range for X's coefficient can be found by maintaining the same basis and ensuring all reduced costs remain non-negative. Typically, this range is [15, 25] for this type of problem, meaning X's profit can vary between RM15 and RM25 without changing the optimal product mix.
Summary Points
- Decision Variables: Quantities to be determined in the optimization
- Objective Function: Linear function to maximize or minimize
- Constraints: Linear inequalities defining feasible solutions
- Feasible Region: Set of all possible solutions satisfying all constraints
- Optimal Solution: Best solution (maximum or minimum) at a corner point
- Shadow Prices: Value of additional resources for optimal solution
Common Mistakes to Avoid
- Constraint formulation errors - Ensure all constraints are correctly translated from the problem statement
- Variable definition errors - Clearly define what each variable represents
- Graphical interpretation errors - Carefully identify feasible regions and corner points
- Optimality verification - Always check objective function at all corner points
- Unbounded solutions - Verify the problem has a bounded feasible region
SPM Exam Tips
Exam Strategies
- Formulate correctly - Define variables and write objective function accurately
- Graph carefully - Draw constraint lines and shade feasible regions correctly
- Find corner points - Calculate intersection points of constraint boundaries
- Evaluate systematically - Check objective function at all corner points
- Interpret results - Understand what the optimal solution means in context
Key Exam Topics
- Problem formulation (20% of questions)
- Graphical solution method (30% of questions)
- Feasible region identification (20% of questions)
- Optimal solution finding (20% of questions)
- Interpretation and applications (10% of questions)
Time Management Tips
- Formulation problems: 4-5 minutes
- Graph plotting: 5-6 minutes
- Corner point calculation: 4-5 minutes
- Optimization: 3-4 minutes
- Complex applications: 8-10 minutes
Practice Problems
Level 1: Basic Formulation
-
A farmer has 100 acres of land to plant corn and wheat. Corn requires 2 acres per ton and wheat requires 1 acre per ton. Profits are RM300 per ton corn and RM200 per ton wheat. How should the farmer allocate land to maximize profit?
-
A bakery produces cakes and pastries. Each cake requires 3 kg flour and 2 kg sugar. Each pastry requires 1 kg flour and 1 kg sugar. Available: 60 kg flour, 40 kg sugar. Profits: RM15 per cake, RM8 per pastry. Maximize profit.
Level 2: Graphical Solutions
-
Solve graphically: Maximize: P = 4x + 5y Subject to: 2x + y ≤ 20, x + 2y ≤ 20, x ≥ 0, y ≥ 0
-
Solve graphically: Minimize: C = 3x + 4y Subject to: x + y ≥ 10, 2x + y ≥ 15, x ≥ 0, y ≥ 0
Level 3: Mixed Constraints
-
A company produces chairs and tables. Chairs require 4 hours labor, tables require 6 hours labor. Total labor: 240 hours. Each chair needs 2 units material, tables need 3 units material. Total material: 180 units. Minimum production: 20 chairs, 10 tables. Profit: chairs RM50, tables RM80. Maximize profit.
-
A diet requires: at least 2000 calories, 50g protein, 100g carbohydrates. Foods: A (100 cal, 20g protein, 30g carbs, cost RM2/unit), B (200 cal, 30g protein, 40g carbs, cost RM3/unit). Minimize cost.
Level 4: Sensitivity and Analysis
-
In problem 3, if the objective coefficient for x increases to 6, does the optimal solution change?
-
In problem 4, what is the shadow price for the protein constraint in problem 6?
Level 5: Applications
-
Transportation: A company has factories at A, B, C and warehouses at X, Y, Z. Transportation costs: A→X: 10, A→Y: 12, A→Z: 15, B→X: 8, B→Y: 11, B→Z: 14, C→X: 9, C→Y: 10, C→Z: 13. Factory capacities: A: 100, B: 150, C: 200. Warehouse demands: X: 120, Y: 100, Z: 130. Find minimum cost shipping plan.
-
Investment: Portfolio with 3 investments. Investment A: 12% return, 5% risk. Investment B: 15% return, 8% risk. Investment C: 10% return, 3% risk. Total investment RM1,000,000. Risk constraint: weighted average risk ≤ 6%. Return constraint: minimum 13% average return. Maximize total return.
Did You Know? 📚
Linear programming was developed during World War II by George Dantzig to solve military logistics problems. The first practical application was optimizing diet plans for the U.S. Army. The simplex method, developed by Dantzig in 1947, remained the most widely used algorithm for decades. Today, linear programming is used in airline scheduling, manufacturing, telecommunications, financial planning, and countless other applications. The 1975 Nobel Prize in Economics was awarded to Kantorovich and Koopmans for their contributions to linear programming theory.
Quick Reference Guide
| Component | Purpose | Key Elements |
|---|---|---|
| Decision Variables | What to determine | x, y, z ≥ 0 |
| Objective Function | What to optimize | Maximize/Minimize: Z = + |
| Constraints | Limitations | Linear inequalities |
| Feasible Region | Possible solutions | Intersection of all constraints |
| Corner Points | Candidates for optimum | Vertices of feasible region |
| Optimal Solution | Best outcome | Maximum/minimum at corner point |
Linear programming provides a systematic approach to optimization under constraints. Master this method to make better decisions in resource allocation, production planning, and strategic management.