Formulating a linear programming problem
Most marks in an LP question come from formulating the problem correctly. The graphing and evaluation that follow are mechanical; the translation from words to math is where students stumble.
The three ingredients
Every LPP has three components.
Decision variables: the unknowns the problem is asking you to determine. Typically and represent quantities of something , units produced, kilograms of a food eaten, hours spent at an activity.
Objective function: the quantity to maximise or minimise. Always linear in the decision variables: .
Constraints: linear inequalities (or sometimes equalities) describing limits on the decision variables. Include the non-negativity constraints explicitly , quantities of things can't be negative.
The formulation algorithm
- Read carefully. Identify what is being chosen (decision variables) and what is being optimised (objective).
- Define each variable in plain words. Write "Let = number of units of A produced per day" , not just "".
- Write the objective. Express the quantity to be optimised as a linear function. State "maximise" or "minimise."
- Write each constraint as a linear inequality (or equality). One constraint per limit in the problem.
- Include .
Common patterns
Diet problem. A person needs at least so many units of nutrient A, so many of nutrient B, etc. Foods cost different amounts and contain different amounts of each nutrient. Minimise total cost. Variables: quantities of each food. Objective: cost. Constraints: nutrient requirements.
Manufacturing problem. A factory makes two products. Each unit of product I uses certain hours on machine A and machine B; same for product II. Available machine hours are limited. Profit per unit is given. Maximise total profit. Variables: units of each product. Objective: profit. Constraints: machine-hour limits.
Transportation problem. Goods sent from sources to destinations. Supplies, demands, and per-unit costs are given. Minimise total cost. Variables: amount sent from each source to each destination.
Resource allocation. Limited budget, multiple investment options with different returns and risks. Maximise total return (or minimise risk).
Reading practice
Problem A. "A confectioner makes two kinds of biscuits, Crunch and Munch. One packet of Crunch requires of flour and of sugar; one of Munch requires of flour and of sugar. He has of flour and of sugar. Profit on Crunch is ₹ per packet, on Munch ₹ per packet. How many packets of each should he make to maximise profit?"
Decision variables: let = packets of Crunch, = packets of Munch.
Objective: maximise .
Constraints (in grams):
- Flour: , i.e. .
- Sugar: , i.e. .
- Non-negativity: .
Problem B. "A diet needs at least units of vitamin A and units of vitamin B daily. Food contains units of A and unit of B per gram; food contains unit of A and units of B per gram. costs ₹/gram, costs ₹/gram. Minimise the cost."
Decision variables: grams of , grams of .
Objective: minimise .
Constraints:
- Vitamin A: .
- Vitamin B: .
- Non-negativity: .
Worked examples
Example 1. A factory produces two products P and Q. P needs hours on machine and hours on machine per unit; Q needs hours on and hour on . is available for hours, for hours daily. Profit per unit: ₹ for P, ₹ for Q. Maximise daily profit.
= units of P, = units of Q. . Constraints: , , .
Example 2. A farmer has acres of land for wheat and barley. Wheat earns ₹/acre with hours of labour; barley earns ₹/acre with hours. Total labour available: hours. Maximise revenue.
= acres of wheat, = acres of barley. . Constraints: (land), i.e. (labour), .
Example 3. A medical clinic wants to plan its supply of vitamin tablets. Tablet A costs ₹ and provides units of vit-C and unit of vit-E. Tablet B costs ₹ and provides unit of vit-C and unit of vit-E. Daily intake at least vit-C and vit-E. Minimise cost.
tablets of A, of B. . Constraints: , , .
Example 4. A toy company makes dolls and trains. Each doll uses units of plastic and minutes of machine time. Each train uses units of plastic and minutes of machine time. Daily plastic: units; daily machine: minutes. Profit ₹ per doll, ₹ per train. Maximise profit.
dolls, trains. . Constraints: , , .
Example 5. Two transporters charge ₹/km and ₹/km, respectively. They can carry and kg in one trip. A merchant has kg to send a distance of km. Transporter 1 has trucks; Transporter 2 has trucks. Minimise cost.
This is more complex , but formulate cleanly. = trips by Transporter 1, = trips by Transporter 2. Cost per trip: ₹ and ₹. Objective: minimise . Constraints: (capacity), , , .
Example 6. A student studies for two subjects, Maths and Physics, scoring marks proportional to study time. Each hour of Maths gives marks, each hour of Physics gives . Constraint: total time hours, Maths time at least hours, Physics time at least hours. Maximise score.
= Maths hours, = Physics hours. . Constraints: , , .
Try it yourself
For each problem, identify decision variables, objective, and constraints.
- A baker makes two cakes A and B. A uses kg flour, kg sugar, profit ₹. B uses kg flour, kg sugar, profit ₹. Available: kg flour, kg sugar.
- A pharmacy sells two pills. Pill X has vit-A, vit-B, cost ₹. Pill Y has vit-A, vit-B, cost ₹. Need at least vit-A and vit-B daily.
- A factory makes chairs and tables. Chair needs hours of work, kg wood. Table needs hours, kg wood. Available: hours, kg. Profit ₹/chair, ₹/table.
- A car rental company has cars, each rented for ₹/day or sold for ₹. At least cars must be rented. Maximise weekly revenue (assume rentals run all week).
- A student needs at least units of vitamin A and of B daily. Cereal P has A, B per scoop, ₹/scoop. Cereal Q has A, B, ₹/scoop. Minimise cost.
- A clothing manufacturer makes shirts and trousers. Shirt: m fabric, h labour, ₹ profit. Trouser: m fabric, h labour, ₹ profit. Available: m fabric, h labour.
- A confectioner has kg sugar, kg butter. Cake type A uses kg sugar, kg butter, profit ₹. Type B uses kg sugar, kg butter, profit ₹.
- A truck operator transports oranges and apples. Truck capacity: tonnes. Oranges: tonne, profit ₹. Apples: tonne, profit ₹. Demand: at least tonnes of each.
- A farmer has acres for sugarcane () and wheat (). Profit: ₹/acre sugarcane, ₹/acre wheat. Sugarcane needs hours/acre water, wheat needs hours/acre. Water available: hours.
- A diet plan: types of foods. Food 1 has calories, proteins per unit. Food 2: calories, proteins. Need at least calories and proteins. Cost: ₹/unit, ₹/unit. Minimise.
- A library buys two types of books. Type A: ₹/book, kg, profit ₹. Type B: ₹/book, kg, profit ₹. Budget ₹, shelf kg.
- An investor allocates ₹ lakh to two schemes. Scheme 1: return, low risk. Scheme 2: return, high risk. At most ₹ in scheme 2. Maximise return.
- A baker has kg flour, kg sugar. Bread: kg flour, kg sugar, profit ₹. Cake: kg flour, kg sugar, profit ₹.
- A factory packages two products in boxes. Type X: kg/box, m³/box, profit ₹. Type Y: kg, m³, profit ₹. Limits: kg, m³.
Pitfalls and tricks
- Define variables in words. Just "" isn't enough , say " = number of …".
- Match units. Don't mix kg and g; convert everything to a single unit.
- Include explicitly , easy to forget.
- One constraint per resource. Don't combine two constraints into one inequality; keep them separate.
- Re-read the problem after formulation to ensure each constraint corresponds to a real-world limit and the objective matches what's asked.