An LP with two variables can be solved by drawing. The picture also shows clearly why the optimum lies at a corner.
The Graphical Method
- Draw each constraint as a line by treating it as an equation, finding its intercepts on the two axes. 2. Shade the side of each line that satisfies the inequality, using a test point such as (0, 0). 3. The region that satisfies all the constraints and non-negativity together is the feasible region. 4. Find the corner points (vertices) of the region, by solving the equations of the lines that meet there. 5. Evaluate Z at each corner point. The largest value gives the maximum, and the smallest the minimum. This works because of the corner point theorem: if an LP has an optimal solution, at least one corner point of the feasible region is optimal. Another way is to draw the iso-profit line Z = k and slide it parallel until it last touches the region.
Definition: Feasible region. The set of all points that satisfy every constraint and the non-negativity conditions of a linear programming problem.
Special Cases
Multiple optimal solutions arise when the objective line is parallel to a constraint line that forms an edge of the region. Then every point on that edge is optimal. Unbounded solution: in a maximisation problem the feasible region extends without limit in a direction in which Z grows, so Z can be made as large as we like. This usually means that a constraint is missing. Infeasible problem: the constraints conflict, such as x1 + x2 ≤ 2 and x1 + x2 ≥ 5, so there is no feasible region at all. Redundant constraint: a constraint that does not affect the region, because others are stricter. It can be dropped.
Table 4.2: Special cases of LP
| Case | Sign on the graph | Meaning |
|---|---|---|
| Multiple optima | Objective parallel to an edge | Many best plans |
| Unbounded | Region open in the improving direction | Model missing a limit |
| Infeasible | No common region | Constraints conflict |
| Redundant | Constraint does not touch the region | Can be removed |
Example 4.2: Graphical solution
Problem: Solve the chair and table problem: maximise Z = 50x1 + 60x2 subject to 2x1 + 3x2 ≤ 120, 4x1 + 2x2 ≤ 160, x1, x2 ≥ 0.
Solution:
- Line 1 meets the axes at (60, 0) and (0, 40). Line 2 meets them at (40, 0) and (0, 80).
- Corner points: (0, 0), (40, 0), (0, 40), and the intersection of the two lines.
- Solving 2x1 + 3x2 = 120 and 4x1 + 2x2 = 160 gives x1 = 30, x2 = 20.
- Z at the corners: 0, 2000, 2400, and 50(30) + 60(20) = 2700.
Result: The maximum profit is Rs 2700, making 30 chairs and 20 tables.
pts = [(0, 0), (40, 0), (0, 40), (30, 20)]
for x1, x2 in pts:
print((x1, x2), 50 * x1 + 60 * x2)
Output
(0, 0) 0
(40, 0) 2000
(0, 40) 2400
(30, 20) 2700
Common mistakes
- Shading the wrong side of a constraint line.
- Checking only some corner points.
- Reporting an unbounded problem as having an optimum.
Key takeaways
- The feasible region satisfies all constraints together.
- If an optimum exists, it is at a corner point.
- Special cases: multiple optima, unbounded, infeasible, redundant.
- The graphical method works only for two variables.
Practice questions
- What is the corner point theorem?
- What is an infeasible LP?
- When do multiple optimal solutions arise?
Answers to the practice questions
- If an LP has an optimum, at least one corner point of the feasible region is optimal.
- One whose constraints have no common solution, so there is no feasible region.
- When the objective line is parallel to an edge of the feasible region.
Sources
- Official BCA syllabus Mathematics Foundations to Computer Science II, course code 25BCA402DS01, Unit IV
