girgit.org

Linear Programming

What is the best plan? Optimisation and linear programming

The big ideaMany real problems ask for the best plan, the most profit or the least cost, when money, space or time is limited; linear programming is a way to find that best plan when every rule in the problem is a straight-line (linear) rule.

In simple words

You have only so much money and only so much room. You want to get as much as you can out of them. There are lots of ways to spend the money, and some ways are better than others. This chapter shows how to find the very best way without trying every single one.

A furniture dealer with two limits

A furniture dealer in Jodhpur sells only two things: study desks and chairs. A desk costs him ₹4,500 to buy and he makes a profit of ₹600 when he sells it. A chair costs ₹1,500 and earns him ₹250. He has ₹90,000 to spend and his godown has room for at most 40 pieces. He can sell everything he buys. How many of each should he buy to make the most profit?

Let us try a few plans by hand.

  • Only desks. ₹90,000 ÷ ₹4,500 = 20 desks. They fit in the godown. Profit = 20 × ₹600 = ₹12,000.
  • Only chairs. The money would buy 60 chairs, but only 40 fit. Profit = 40 × ₹250 = ₹10,000.
  • 15 desks and 25 chairs. Cost = ₹67,500 + ₹37,500 = ₹1,05,000. Too much money: this plan is not allowed.

Guess first: should he fill up on desks?

A desk earns ₹600 and a chair only ₹250. Guess: is "only desks" (₹12,000) the best he can do?

Try it: answer in the widget, then hunt for a better plan yourself before you open the explanation.

See what happens

No. Try 10 desks and 30 chairs. Cost = ₹45,000 + ₹45,000 = ₹90,000, exactly his money. Pieces = 40, exactly his room. Profit = ₹6,000 + ₹7,500 = ₹13,500, more than either "only" plan.

Why? Desks earn more each, but they eat money fast: ₹4,500 of money for ₹600 of profit. Chairs earn more per rupee spent (₹250 on ₹1,500), but they eat room. The money limit pushes him towards chairs and the room limit pushes him towards desks. The best plan is a mix that uses up both limits at once. Concept 4 proves that ₹13,500 really is the best.

A second kind: the cheapest healthy diet

A hostel mess wants each student's evening snack to give at least 12 units of protein and at least 11 units of iron. A packet of roasted chana costs ₹20 and gives 3 units of protein and 1 unit of iron. A bowl of palak dal costs ₹30 and gives 2 units of protein and 3 units of iron. What is the cheapest mix that meets both needs?

This time we want the least cost, and the limits say "at least". It is the same kind of problem turned upside down. (Concept 5 finds the answer: ₹130.)

What these problems are called

A problem that asks for the greatest or least value of something, such as the most profit, the least cost or the smallest use of resources, is an optimisation problem (to optimise means to make the best of). The limits that every plan must obey, like "no more than ₹90,000", are called constraints.

When the quantity to be made best and every constraint are linear (only terms like 600x and 250y, no squares, no products like xy), the problem is a linear programming problem, or LPP. The two words mean:

  • Linear: every relation in the problem is a straight-line relation (first degree in the variables).
  • Programming: working out a programme, a plan of action. It has nothing to do with computer programming; the name is older than that meaning.

LPPs are a special, very important kind of optimisation problem, used widely in industry, commerce and management: factories plan what to make, transport companies plan routes, hostels plan meals.

There are many ways to solve an LPP. This chapter uses only the graphical method: draw the allowed plans on a graph and read off the best one. It works for two variables (two things to decide).

Where it came from

Linear programming came to the front in the Second World War, when armies had to plan supplies with as little waste as possible. The Russian mathematician L. Kantorovich and the American F. L. Hitchcock, working separately, set out early problems of this kind; Hitchcock's 1941 problem was about the cheapest way to transport goods (the transportation problem). In 1945 the economist George Stigler worked out a cheapest diet that met every nutrient need, the first famous diet problem. In 1947 G. B. Dantzig found the simplex method, a step-by-step method that solves any LPP in a finite number of steps. Kantorovich and T. C. Koopmans shared the 1975 Nobel Prize in Economics for their work on the best use of resources.

Not in the current textbook: older editions had a section listing types of LPP: manufacturing problems (how many of each product to make for the most profit, given machine hours and labour), diet problems (the cheapest mix of foods that gives at least the needed nutrients) and transportation problems (the cheapest way to send goods from factories to shops). The rationalised book dropped that section; its exercises give the LPP already in x and y. The dealer is a manufacturing-style problem and the snack a diet problem; Concept 2 turns both into maths.

Words to know

Optimisation problem
A problem that asks for the greatest or least value of something, such as profit or cost.
Constraint
A limit every allowed plan must obey, such as "spend at most ₹90,000".
Linear
Only first-degree terms like 600x and 250y: no squares, no xy.
Linear programming problem (LPP)
An optimisation problem in which the quantity to be optimised and all the constraints are linear.
Programming
Here, planning: choosing a programme of action.
Graphical method
Solving an LPP in two variables by drawing it on a graph.

Why did the dealer's mixed plan (10 desks, 30 chairs) beat "only desks", even though desks earn more each?

  1. Chairs earn more profit per piece
  2. The mix uses up both the money limit and the space limit
  3. The mixed plan was a lucky guess that only sometimes works

Which of these is a linear programming problem?

  1. Maximise 40x + 25y with 2x + y ≤ 30, x + 3y ≤ 45, x, y ≥ 0
  2. Maximise xy with x + y ≤ 10, x, y ≥ 0
  3. Minimise x + y with \( x^2 + y \ge 4 \), x, y ≥ 0

In "linear programming", the word "programming" means

  1. writing a computer program
  2. making a plan of action
  3. drawing graphs