Linear Programming • Topic 1 of 2

Formulating a Linear Programming Problem

Linear programming is a method for finding the best possible value — the maximum or minimum — of a linear quantity, subject to a collection of linear restrictions. It is the mathematics behind almost every resource-allocation decision: how a factory splits limited machine time between products to make the most profit, how a hospital meets nutrition targets at the least cost, how a transporter ships goods from warehouses to outlets as cheaply as possible. A problem that can be cast in this form is called a linear programming problem (LPP).

The word linear is doing real work. Every expression that appears — both the quantity being optimised and every restriction — must be of the first degree in the variables. There can be no $x^2$, no $xy$, no $\sqrt{x}$, no $\frac{1}{x}$. The moment a squared term or a product of variables appears, the problem leaves the world of linear programming.

The four ingredients of every LPP

  • Decision variables (usually $x$ and $y$): the quantities you are free to choose — the number of chairs to make, units of a food to buy, trucks to dispatch. Naming these clearly, with units, is the first and most important step.
  • Objective function $Z = ax + by$: the linear quantity you wish to optimise. State plainly whether you are maximising (profit, output) or minimising (cost, time, distance).
  • Constraints: the linear inequalities (occasionally equations) that capture every limited resource or requirement — available labour hours, machine capacity, minimum nutrient levels, demand to be met.
  • Non-negativity restrictions: $x \ge 0,\ y \ge 0$. You cannot make a negative number of tables or buy a negative quantity of food, so the decision variables are never negative. These are easy to forget but must always be written down.

Translating words into a model

Formulation is a disciplined reading exercise. Work through three questions in order:

  1. What are you deciding? → the decision variables. Define them precisely, e.g. "let $x$ = number of tables produced per day, $y$ = number of chairs produced per day".
  2. What are you trying to optimise? → the objective function. Multiply each variable by its per-unit profit or cost and add.
  3. What limits you? → the constraints. Take each resource one at a time and write the inequality.

The language of the problem fixes the direction of each inequality. Learn these signal phrases:

Phrase in the problemInequality
"at most", "not more than", "cannot exceed", "available"$\le$
"at least", "not less than", "minimum of", "must meet"$\ge$
"exactly", "the demand is"$=$

A line such as "each table needs $2$ hours of carpentry, each chair needs $1$ hour, and at most $40$ hours are available" becomes the single inequality $2x + y \le 40$.

Worked formulation — a manufacturing problem

A carpenter makes tables and chairs. A table needs $2$ h on the saw and $1$ h on the lathe; a chair needs $1$ h on the saw and $3$ h on the lathe. The saw is available for $40$ h and the lathe for $60$ h per week. Profit is ₹$70$ per table and ₹$30$ per chair. Set up the LPP.

Let $x$ = tables and $y$ = chairs made per week. Profit to be maximised is $Z = 70x + 30y$. Saw time: $2x + y \le 40$. Lathe time: $x + 3y \le 60$. Adding non-negativity:

$$\text{Maximise } Z = 70x + 30y \quad \text{subject to} \quad 2x + y \le 40,\; x + 3y \le 60,\; x \ge 0,\; y \ge 0.$$

The standard problem types

Manufacturing (product-mix) problems maximise profit from products that compete for shared resources (machine hours, raw material, labour). These almost always give "$\le$" constraints, because resources are capped.

Diet problems minimise the cost of a meal plan that must supply at least stated amounts of nutrients (protein, calcium, vitamins). These give "$\ge$" constraints, because the requirements are floors that must be cleared.

Transportation and allocation problems minimise total cost or distance of moving goods from sources (factories, warehouses) to destinations (shops, depots), where supply is limited and demand must be satisfied — a mix of "$\le$" (supply) and "$\ge$" (demand) constraints.

Feasible and infeasible

A point $(x, y)$ that satisfies all the constraints, including non-negativity, is a feasible solution. The collection of every such point is the feasible region. A point that violates even one constraint is infeasible and is no candidate at all — it lies outside the feasible region. If the constraints contradict one another so that no point can satisfy them together, the feasible region is empty and the LPP has no solution.

Deeper Insight — formulation is the whole battle. Once a word problem is correctly translated, the graphical solution that follows is almost mechanical. Nearly every mark lost in this chapter is lost at the formulation stage: forgetting the non-negativity restrictions, mixing up which variable carries which profit, or choosing $\le$ where the problem demands $\ge$. A reliable habit fixes most of this — write a one-line definition of each variable with its unit before anything else, then build a small table with one row per resource and one column per product. The numbers in that table become the coefficients of your constraints directly, and the structure leaves nothing to guesswork.

Schematic of a linear programming problem: decision variables feed an objective function, which is optimised subject to constraints and non-negativity restrictions Anatomy of a Linear Programming Problem 1. Decision variables x, y (what you choose, with units) 2. Objective function Z = ax + by (max or min) subject to 3. Constraints linear ≤ or ≥ (limited resources) 4. Non-negativity x ≥ 0, y ≥ 0 All four together define the feasible region — the points that satisfy every restriction.
1
Worked Example
A firm makes $x$ chairs and $y$ tables, with profit ₹$50$ and ₹$80$ each respectively. Write the objective function.
Solution
  1. Each chair contributes ₹$50$ of profit and each table ₹$80$.
  2. Total profit is the sum of the two contributions.

Maximise $Z = 50x + 80y$ (profit in rupees).

Answer: Maximise $Z = 50x + 80y$ (profit in rupees).

2
Worked Example
Each chair needs $1$ hour and each table $3$ hours of labour; at most $90$ hours are available. Write the constraint.
Solution
  1. Labour used $= 1\cdot x + 3\cdot y$ hours.
  2. "At most $90$ hours" means this cannot exceed $90$.

$x + 3y \le 90$, together with $x \ge 0,\ y \ge 0$.

Answer: $x + 3y \le 90$, together with $x \ge 0,\ y \ge 0$.

3
Worked Example
State the non-negativity restrictions and explain why they are needed.
Solution
  1. The variables count physical items produced.
  2. A negative count is meaningless, so each variable is bounded below by $0$.

$x \ge 0$ and $y \ge 0$, because the number of items produced cannot be negative.

Answer: $x \ge 0$ and $y \ge 0$, because the number of items produced cannot be negative.

4
Worked Example
Write the full LPP if profit is $40x + 30y$, with constraints $x + y \le 12$ and $2x + y \le 16$.
Solution
  1. The objective is to maximise the stated profit.
  2. Collect both resource limits and append non-negativity.

Maximise $Z = 40x + 30y$ subject to $x + y \le 12,\ 2x + y \le 16,\ x \ge 0,\ y \ge 0.$

Answer: Maximise $Z = 40x + 30y$ subject to $x + y \le 12,\ 2x + y \le 16,\ x \ge 0,\ y \ge 0.$

5
Worked Example
Diet problem. A patient's diet must contain at least $80$ units of vitamin A and at least $100$ units of vitamin C. Food F1 supplies $3$ units of A and $1$ unit of C per gram; food F2 supplies $1$ unit of A and $4$ units of C per gram. F1 costs ₹$5$/g and F2 costs ₹$4$/g. Formulate the LPP to minimise cost.
Solution
  1. Let $x$ = grams of F1 and $y$ = grams of F2.
  2. Cost to minimise: $Z = 5x + 4y$.
  3. Vitamin A (at least $80$): $3x + y \ge 80$.
  4. Vitamin C (at least $100$): $x + 4y \ge 100$.
  5. Add non-negativity.

Minimise $Z = 5x + 4y$ subject to $3x + y \ge 80,\ x + 4y \ge 100,\ x \ge 0,\ y \ge 0.$ Note the "$\ge$" constraints — the requirements are floors to be cleared.

Answer: Minimise $Z = 5x + 4y$ subject to $3x + y \ge 80,\ x + 4y \ge 100,\ x \ge 0,\ y \ge 0.$

6
Worked Example
Manufacturing problem. A company makes two types of toys, A and B. A toy of type A needs $5$ min of cutting and $10$ min of assembling; type B needs $8$ min of cutting and $8$ min of assembling. There are $3$ hours of cutting time and $4$ hours of assembling time available per day. Profit is ₹$50$ on A and ₹$60$ on B. Formulate the LPP.
Solution
  1. Let $x$ = toys of type A and $y$ = toys of type B per day.
  2. Convert hours to minutes: cutting $= 180$ min, assembling $= 240$ min.
  3. Cutting: $5x + 8y \le 180$.
  4. Assembling: $10x + 8y \le 240$, i.e. $5x + 4y \le 120$.
  5. Profit to maximise: $Z = 50x + 60y$.

Maximise $Z = 50x + 60y$ subject to $5x + 8y \le 180,\ 5x + 4y \le 120,\ x \ge 0,\ y \ge 0.$

Answer: Maximise $Z = 50x + 60y$ subject to $5x + 8y \le 180,\ 5x + 4y \le 120,\ x \ge 0,\ y \ge 0.$

7
Worked Example
Transportation/allocation problem. A dealer has two godowns, one with $80$ units and one with $70$ units of a product, to be sent to two shops needing $90$ and $60$ units. Let $x$ units go from godown 1 to shop 1 and $y$ units from godown 1 to shop 2. Write the supply constraint at godown 1 and explain the non-negativity here.
Solution
  1. Godown 1 can ship at most its stock of $80$ units in total.
  2. The amount it sends out is $x + y$.
  3. So $x + y \le 80$.
  4. Each shipment quantity is a physical amount, hence $\ge 0$.

Supply constraint: $x + y \le 80$, with $x \ge 0,\ y \ge 0$. (The remaining demand at each shop is then met from godown 2, giving further constraints in the full model.)

Answer: Supply constraint: $x + y \le 80$, with $x \ge 0,\ y \ge 0$.

8
Worked Example
A manufacturer of P and Q earns profit ₹$5$ on P and ₹$3$ on Q. Each P needs $3$ h on machine M and $1$ unit of material; each Q needs $2$ h on M and $2$ units of material. Machine M is available for $60$ h and material is limited to $40$ units. Formulate the LPP.
Solution
  1. Let $x$ = units of P, $y$ = units of Q.
  2. Machine: $3x + 2y \le 60$.
  3. Material: $x + 2y \le 40$.
  4. Profit: $Z = 5x + 3y$.

Maximise $Z = 5x + 3y$ subject to $3x + 2y \le 60,\ x + 2y \le 40,\ x \ge 0,\ y \ge 0.$

Answer: Maximise $Z = 5x + 3y$ subject to $3x + 2y \le 60,\ x + 2y \le 40,\ x \ge 0,\ y \ge 0.$

9
Worked Example
Identify whether the point $(4, 5)$ is a feasible solution of the constraints $x + y \le 12,\ 2x + y \le 16,\ x \ge 0,\ y \ge 0$.
Solution
  1. Check each constraint in turn.
  2. $x + y = 4 + 5 = 9 \le 12$ — satisfied.
  3. $2x + y = 8 + 5 = 13 \le 16$ — satisfied.
  4. $x = 4 \ge 0$ and $y = 5 \ge 0$ — satisfied.

All constraints hold, so $(4, 5)$ is a feasible solution.

Answer: $(4, 5)$ is a feasible solution.

10
Worked Example
Show that the point $(7, 4)$ is infeasible for $x + y \le 12,\ 2x + y \le 16,\ x \ge 0,\ y \ge 0$.
Solution
  1. $x + y = 7 + 4 = 11 \le 12$ — satisfied.
  2. $2x + y = 14 + 4 = 18$, which is not $\le 16$.
  3. One constraint fails, so the point is rejected.

Since $2x + y = 18 > 16$, the point $(7, 4)$ violates a constraint and is infeasible — it lies outside the feasible region.

Answer: $(7, 4)$ is infeasible (it violates $2x + y \le 16$).

11
Worked Example
A dietician wishes to mix two foods, X and Y, so that the mix contains at least $10$ units of vitamin A, at least $12$ units of vitamin B and at least $8$ units of vitamin C. Food X has $1,2,3$ units of A, B, C per kg; food Y has $2,1,1$ units per kg. X costs ₹$16$/kg, Y costs ₹$20$/kg. Formulate the LPP.
Solution
  1. Let $x$ = kg of X and $y$ = kg of Y.
  2. Vitamin A: $x + 2y \ge 10$.
  3. Vitamin B: $2x + y \ge 12$.
  4. Vitamin C: $3x + y \ge 8$.
  5. Cost to minimise: $Z = 16x + 20y$.

Minimise $Z = 16x + 20y$ subject to $x + 2y \ge 10,\ 2x + y \ge 12,\ 3x + y \ge 8,\ x \ge 0,\ y \ge 0.$

Answer: Minimise $Z = 16x + 20y$ subject to $x + 2y \ge 10,\ 2x + y \ge 12,\ 3x + y \ge 8,\ x \ge 0,\ y \ge 0.$

12
Worked Example
Translate the requirement "produce at least $5$ units of $x$ but no more than $20$ units of $y$" into constraints.
Solution
  1. "At least $5$ units of $x$" gives a lower bound: $x \ge 5$.
  2. "No more than $20$ units of $y$" gives an upper bound: $y \le 20$.

$x \ge 5$ and $y \le 20$ (alongside the usual $x \ge 0,\ y \ge 0$, though $x \ge 5$ already forces $x \ge 0$).

Answer: $x \ge 5$ and $y \le 20$ (with the usual $x \ge 0,\ y \ge 0$).

Key Points

  • An LPP optimises a linear objective $Z = ax + by$ subject to linear constraints; nothing may contain $x^2$, $xy$ or other non-linear terms.
  • The four ingredients are decision variables, the objective function, the constraints, and the non-negativity restrictions $x \ge 0,\ y \ge 0$.
  • Define each decision variable precisely (with its unit) before writing anything else — this is where most marks are won or lost.
  • Signal words fix the inequality: "at most/available" $\Rightarrow \le$; "at least/minimum" $\Rightarrow \ge$; "exactly" $\Rightarrow =$.
  • Manufacturing problems maximise profit with "$\le$" resource caps; diet problems minimise cost with "$\ge$" nutrient floors; transport problems mix supply ($\le$) and demand ($\ge$).
  • A feasible solution satisfies every constraint; the feasible region is the set of all feasible solutions. A point breaking even one constraint is infeasible.
  • Always append the non-negativity restrictions — they are part of the model, not an afterthought.
Tap an option to check your answer0 / 4
Q1.The function to be optimised in an LPP is the:
Explanation: $Z=ax+by$ is the objective.
Q2.Non-negativity restrictions are:
Explanation: Quantities cannot be negative.
Q3."At most 40 hours available" translates to:
Explanation: "At most" means $\le$.
Q4.Decision variables in an LPP represent:
Explanation: They are the unknown quantities to decide.