Curvingo · Made in India

Glossary

Select one of the keywords on the left…

Linear ProgrammingLinear Programming Problem and its Mathematical Formulation

Reading time: ~65 min

A furniture dealer deals in only two items, tables and chairs. He has ₹50,000 to invest and space to store at most 60 pieces. A table costs him ₹2500 and a chair ₹500. He expects a profit of ₹250 on each table and ₹75 on each chair, and he can sell everything he buys. How many tables and how many chairs should he buy, with the money he has, to make his total profit as large as possible?

Two things stand out. First, he can invest his money in many different ways — only tables, only chairs, or a mix — and each way earns a different profit. Second, there are overriding conditions, called constraints, that limit his choice: his investment can be at most ₹50,000, and his storeroom holds at most 60 pieces.

Before any algebra, play shopkeeper. Which of these plans can the dealer actually carry out?

20 tables and 20 chairs
100 chairs
10 tables and 50 chairs
15 tables and 50 chairs

Ten tables and fifty chairs use exactly ₹50,000 and exactly 60 places. Here are three plans worth comparing.

PlanCostPiecesProfit
tables only: 50000 ÷ 2500 = 20 tables₹50,0002020 × 250 = ₹5000
chairs only: he can afford 100, but can store only 60₹30,0006060 × 75 = ₹4500
10 tables and 50 chairs₹50,0006010 × 250 + 50 × 75 = ₹6250

There are many other plans, each with its own profit. So the real question is: how should he invest his money to get the maximum profit? To answer it, we first write the problem in the language of mathematics.

Mathematical formulation of the problem

Let the dealer buy x tables and y chairs.

Nobody can buy a negative number of tables or chairs, so x 0 and y \ge 0. These are the non-negative constraints (1) and (2).

Money. A table costs ₹2500 and a chair ₹500, so the plan costs rupees, and this can be at most 50,000. Dividing by 500, the investment constraint is … (3)

Space. The storeroom holds at most 60 pieces, so the storage constraint is … (4)

Profit. The dealer earns ₹250 per table and ₹75 per chair, so his profit is Z = … (5)

Every line of the story became one line of mathematics: each limit an inequality, the goal a single linear expression to be made as large as possible. The graph shows the two limits as the blue line and the green line — we will use it in a moment.

The dealer's problem, written mathematically

Maximise Z = 250x + 75y

subject to the constraints

5x + y \le 100

x + y \le 60

x \ge 0, \; y \ge 0

The Words of Linear Programming

So we have to maximise a linear function Z, subject to conditions given by linear inequalities whose variables are non-negative. Other problems ask us to minimise a linear function under such conditions. All of these are called linear programming problems. The word linear says that every relation in the problem is linear; programming refers to finding a programme, a plan of action.

  • A linear programming problem (LPP) asks for the optimal value — the maximum or the minimum — of a linear function of several variables, called the objective function, subject to the conditions that the variables are non-negative and satisfy a set of linear inequalities, called the linear constraints.
  • Objective function. A linear function Z = ax + by (a, b constants) that is to be maximised or minimised. For the dealer it is Z = 250x + 75y, and the variables x and y are the decision variables.
  • Constraints. The linear inequalities or equations, that is, the restrictions, on the variables of an LPP. The conditions x \ge 0, y \ge 0 are the non-negative restrictions. For the dealer, (1) to (4) are the constraints.
  • Optimisation problem. A problem that seeks to maximise or minimise a linear function subject to constraints given by linear inequalities. Linear programming problems are a special type of optimisation problem.

Which of these could be the objective function of a linear programming problem?

Z = 3xy
Z = x² + 4y
Z = 7x − 2y
Z = 5/x + y

Z = 7x - 2y has the form ax + by with a = 7, b = -2. The coefficients may be negative — a cost, or a loss — but the variables appear only to the first power, multiplied by constants and added.

Graphical method of solving linear programming problems

The dealer can choose from infinitely many plans. To see them all at once, we draw them. Take the investment constraint 5x + y \le 100. The line 5x + y = 100 cuts the plane into two half-planes: at every point on one side, 5x + y is less than 100, and at every point on the other side it is more. So one test point decides a whole side.

Tip

The origin test. At O(0, 0), 5 \times 0 + 0 = 0 \le 100 is true, so the half-plane of 5x + y \le 100 is the side of the line that contains O. If a line passes through the origin, test any other point, such as (1, 0) or (0, 1).

Fig 12.1 is live. Tap the side of the blue line where 5x + y \le 100 holds, then the side of the green line where x + y \le 60 holds. The constraints x \ge 0 and y \ge 0 already keep us in the first quadrant.

Each point of the purple region OABC satisfies all four constraints (1) to (4), so it stands for a feasible choice open to the dealer.

  • Feasible region. The common region determined by all the constraints, including the non-negative constraints x \ge 0, y \ge 0, of a linear programming problem is called its feasible region (or solution region). For the dealer it is the region OABC. The region other than the feasible region is called the infeasible region.
  • Feasible solutions. The points within and on the boundary of the feasible region are feasible solutions of the constraints: for example (10, 50), (0, 60) and (20, 0).
  • Infeasible solutions. Any point outside the feasible region is an infeasible solution.

Check the plan of 25 tables and 40 chairs: 5 \times 25 + 40 = , which is more than 100, so (25, 40) is an solution — the dealer cannot afford it.

Hunting the Corners

Every point of the region OABC is a feasible plan, and there are infinitely many of them. We cannot try them all. So where should we look for the plan that makes Z = 250x + 75y as large as possible? Gupta-ji's sweet shop gave us a clue: at a corner.

Drag the amber dot to each corner of the feasible region, or tap near a corner. The table records Z = 250x + 75y at every corner you visit. Then tap the row with the largest profit.

The largest value is ₹6250, at B(10, 50): the dealer should buy 10 tables and 50 chairs. A point of the feasible region that gives the optimal value (maximum or minimum) of the objective function is called an optimal (feasible) solution. But why should the best point be a corner, and not somewhere in the middle of the region? The answer is a pair of theorems that are fundamental to the whole subject. Their proofs are beyond the scope of the book, but the next step shows why they are true.

Theorem 1 Let R be the feasible region (a convex polygon) of a linear programming problem, and let Z = ax + by be the objective function. If Z has an optimal value (maximum or minimum), where the variables x, y are subject to constraints described by linear inequalities, then this optimal value must occur at a corner point (vertex) of the feasible region.

Theorem 2 Let R be the feasible region of a linear programming problem, and let Z = ax + by be the objective function. If R is bounded, then Z has both a maximum and a minimum value on R, and each of them occurs at a corner point (vertex) of R.

Note

A corner point of a feasible region is a point of the region where two boundary lines meet. A feasible region is bounded if some circle can enclose it; otherwise it is unbounded, which means that it extends without end in some direction.

Remark: if R is unbounded, a maximum or a minimum value of the objective function may not exist. But if it does exist, it must occur at a corner point of R (by Theorem 1).

Why the Corners Win

All the plans that earn exactly ₹2000 lie on one straight line, 250x + 75y = 2000. Change the target to ₹3000 and you get 250x + 75y = 3000: a line with the same slope, simply moved further from O. Raising the profit target slides this iso-profit line across the plane without turning it.

Slide the profit target. The amber line is every plan that earns exactly that much, and its thick part is the plans the dealer can actually carry out. Push the target as high as it can go while the line still touches the region.

Profit target: Z = ₹${c}

As the target rises, the thick part of the line shrinks, until at ₹6250 only one point is left: the corner B. Any higher, and no feasible plan earns that much. A straight line sliding across a polygon always leaves it at a corner — or along a whole edge, if the line runs parallel to that edge. That is the idea behind Theorem 1.

The Corner Point Method

What you have just done has a name: the Corner Point Method. Before reading its steps, put the moves you made into order.

Work out Z at every corner point
Draw every constraint and shade the feasible region
Pick the largest or the smallest value — checking an open half-plane if the region is unbounded
Find the coordinates of each corner point

The corner point method

  1. Find the feasible region of the linear programming problem and its corner points (vertices) — either by inspection, or by solving the equations of the two lines that meet at that point.
  2. Evaluate the objective function Z = ax + by at each corner point. Let M and m be the largest and the smallest of these values.
  3. If the feasible region is bounded, M and m are the maximum and the minimum values of Z.
  4. If the feasible region is unbounded: (a) M is the maximum value of Z if the open half-plane ax + by > M has no point in common with the feasible region; otherwise Z has no maximum value. (b) Similarly, m is the minimum value of Z if the open half-plane ax + by < m has no point in common with the feasible region; otherwise Z has no minimum value.

Let us see these steps at work in five examples. Each one has its own lab: the lab is the figure from the book, made live.

Example 1: Two Limits, One Maximum

Example 1 : Solve the following linear programming problem graphically:

Maximise Z = 4x + y … (1)

subject to the constraints:

x + y \le 50 … (2)

3x + y \le 90 … (3)

x \ge 0, \; y \ge 0 … (4)

Fig 12.2 is live. Shade both constraints, visit every corner, then pick the maximum.

Now write the same solution the way you would in an exam.

Solution : The shaded region in Fig 12.2 is the feasible region determined by the constraints (2) to (4). It is the region OABC, and it is , so the corner point method gives the maximum directly.

The corner B is where x + y = 50 meets 3x + y = 90. Subtracting the first equation from the second, 2x = 40, so x = and y = .

So the corner points O, A, B and C are (0, 0), (30, 0), (20, 30) and (0, 50). Evaluating Z at each of them:

Corner pointZ = 4x + y
O(0, 0)0
A(30, 0)120
B(20, 30)110
C(0, 50)50

Hence the maximum value of Z is at the point .

Example 2: Shading Away from the Origin

Example 2 : Solve the following linear programming problem graphically:

Minimise Z = 200x + 500y … (1)

subject to the constraints:

x + 2y \ge 10 … (2)

3x + 4y \le 24 … (3)

x \ge 0, \; y \ge 0 … (4)

This time constraint (2) is a "≥". The origin test gives 0 + 0 \ge 10, which is false, so its half-plane is the side away from O.

Fig 12.3 is live. Shade both constraints, visit every corner, then pick the minimum.

Solution : The shaded region in Fig 12.3 is the feasible region ABC determined by the constraints (2) to (4). It is bounded.

The corner B is where x + 2y = 10 meets 3x + 4y = 24. Doubling the first gives 2x + 4y = 20; subtracting it from the second, x = , and then y = .

So the corner points A, B and C are (0, 5), (4, 3) and (0, 6). Evaluating Z = 200x + 500y there gives Z(A) = , Z(B) = and Z(C) = 3000.

Hence the minimum value of Z is 2300, attained at the point (4, 3).

Example 3: A Tie at the Top

Example 3 : Solve the following problem graphically:

Minimise and Maximise Z = 3x + 9y … (1)

subject to the constraints:

x + 3y \le 60 … (2)

x + y \ge 10 … (3)

x \le y … (4)

x \ge 0, \; y \ge 0 … (5)

Tip

The line x = y of constraint (4) passes through O, so the origin test cannot decide its side. Test (0, 1) instead: 0 \le 1 is true, so the half-plane of x \le y is the side above the line, containing the y-axis.

Fig 12.4 is live. Shade all three constraints, visit the corners, then pick the minimum and the maximum.

Solution : First, graph the feasible region of the inequalities (2) to (5). It is the region ABCD in Fig 12.4, and it is bounded.

A is where x + y = 10 meets the y-axis: (0, 10). B is where x + y = 10 meets y = x: 2x = 10, so B = . C is where x + 3y = 60 meets y = x: 4x = 60, so C = (15, 15). D is where x + 3y = 60 meets the y-axis: (0, 20).

Corner pointZ = 3x + 9y
A(0, 10)90
B(5, 5)60
C(15, 15)180
D(0, 20)180

From the table, the minimum value of Z is at the point B(5, 5). The maximum value of Z on the feasible region is , and it occurs at two corner points, C(15, 15) and D(0, 20).

Remark

This problem has multiple optimal solutions: the corner points C and D give the same maximum value, 180. In such a case every point of the line segment CD joining them also gives the maximum value. The same is true when two corner points give the same minimum value.

Why a Whole Edge Can Win

Why should every point between C and D give 180? Write Z = 3x + 9y = 3(x + 3y). The objective function is a multiple of the left-hand side of constraint (2), so its iso-lines are parallel to the edge CD.

Slide Z up. Find the largest value at which the amber line still touches the region, and watch what it touches.

Z = ${c}

At Z = 180 the line does not leave the region at a single corner: it lies along the whole edge CD, and every point of that edge — (3, 19), (6, 18), (12, 16) and all the rest — gives Z = 180. Notice too that at Z = 60 the line touches the region only at B: the minimum is unique.

Example 4: An Unbounded Region

Example 4 : Determine graphically the minimum value of the objective function

Z = -50x + 20y … (1)

subject to the constraints:

2x - y \ge -5 … (2)

3x + y \ge 3 … (3)

2x - 3y \le 12 … (4)

x \ge 0, \; y \ge 0 … (5)

The feasible region of these constraints is shaded in Fig 12.5. It is unbounded: it runs off towards the top right without end. So Theorem 2 does not apply, and the smallest corner value may not be the minimum.

Fig 12.5 is live. Visit the four corners and pick the smallest value of Z. Then use step 4 of the corner point method: test the open half-plane.

Solution : The feasible region (Fig 12.5) is unbounded. Evaluating Z at its corner points:

Corner pointZ = −50x + 20y
A(1, 0)−50
B(0, 3)60
C(0, 5)100
D(6, 0)−300

From this table, −300 is the smallest value of Z, at the corner point (6, 0). Can we say that the minimum value of Z is −300? If the region were bounded, yes, by Theorem 2. But the region is unbounded, so −300 may or may not be the minimum. To decide, we graph the inequality

-50x + 20y < -300, i.e. -5x + 2y < -30

and check whether this open half-plane has points in common with the feasible region. If it does, −300 is not the minimum value of Z; if it does not, −300 is the minimum.

As the lab shows, it does: the point (9, 2) is feasible and gives Z = -450 + 40 = , which is less than −300. Therefore Z = -50x + 20y subject to the given constraints.

Can Z have a maximum here? The largest corner value is 100, at (0, 5). Check the open half-plane -50x + 20y > 100, i.e. -5x + 2y > 10. Every feasible point satisfies constraint (2), y \le 2x + 5, so -5x + 2y \le -5x + 4x + 10 = 10 - x \le 10. The half-plane has no point in common with the region, so Z .

Example 5: No Feasible Region

Example 5 : Minimise Z = 3x + 2y

subject to the constraints:

x + y \ge 8 … (1)

3x + 5y \le 15 … (2)

x \ge 0, \; y \ge 0 … (3)

Fig 12.6 is live. Shade both constraints and see what is left. Is there any feasible region?

Solution : From Fig 12.6 you can see that there is no point satisfying all the constraints simultaneously. The problem has no feasible region, and hence no feasible solution. (Look at the numbers: on the line 3x + 5y = 15 the largest value of x + y is 5, at (5, 0), nowhere near 8.)

Remarks

From the examples so far, we notice some general features of linear programming problems:

(i) The feasible region is always a convex region: the line segment joining any two of its points lies completely inside it.

(ii) The maximum (or minimum) of the objective function occurs at a vertex (corner) of the feasible region. If two corner points give the same maximum (or minimum) value of the objective function, then every point on the line segment joining them gives the same maximum (or minimum) value.

Speed Round: Read the Region

Shade it in your head. The lines are drawn for you; decide whether the feasible region is bounded, unbounded, or not there at all. After each answer, the region fills in.

Get five right to move on.

Speed Round: Does the Optimum Exist?

Work out Z at each corner in your head. If the region is bounded, the answer is in your list. If it is unbounded, ask one more question first: can Z keep growing (or falling) along the open side?

Get five right to move on.

Sina