Linear Programming Formulation: From Intuition to Precision
Imagine you run a small factory that makes two products: chairs and tables. Each chair gives you ₹200 profit, each table gives you ₹300 profit. You have limited wood (240 units) and limited labour hours (100 hours). A chair needs 2 units of wood and 1 hour of labour; a table needs 4 units of wood and 3 hours of labour. You can't make negative chairs or tables. How many of each should you produce to maximise your profit?
This is the kind of problem Linear Programming (LP) is built to solve. The word "programming" here doesn't mean computer programming — it's an old term for "planning". So linear programming is about planning with linear relationships.
The Core Intuition
Every LP problem has three ingredients:
- Decision variables — the quantities you control (how many chairs, how many tables)
- An objective — what you want to maximise (profit) or minimise (cost)
- Constraints — the limits you must respect (wood, labour, non-negativity)
The "linear" part means everything — the profit, the resource usage — adds up in straight-line proportions. Double the chairs, double the wood needed. No fancy curves, no discounts for bulk.
The Precise Statement
A Linear Programming problem is an optimisation problem of the following form:
Maximise (or Minimise) Z=c1x1+c2x2+⋯+cnxn
subject to:
a11x1+a12x2+⋯+a1nxn≤b1
a21x1+a22x2+⋯+a2nxn≤b2
⋮
am1x1+am2x2+⋯+amnxn≤bm
x1,x2,…,xn≥0
Let's decode this piece by piece.
Decision Variables
x1,x2,…,xn are the variables you control. In our factory: let x1 = number of chairs, x2 = number of tables.
Objective Function
Z=c1x1+c2x2+⋯+cnxn is what you want to optimise. The cj are coefficients — profit per unit or cost per unit. For our factory: Z=200x1+300x2 (profit to maximise).
Constraints
Each constraint is a linear inequality (or equality) that limits the variables. The aij are the resource usage per unit of product j for resource i. The bi are the available amounts of each resource.
For our factory:
- Wood: 2x1+4x2≤240
- Labour: 1x1+3x2≤100
Non-negativity
xj≥0 for all j. You can't produce negative chairs. This is almost always present in real problems.
A common mistake is forgetting the non-negativity constraints. Without them, the solver might "produce" negative quantities — which is nonsense in the real world.
The Complete Formulation for Our Example
Maximise Z=200x1+300x2
subject to:
2x1+4x2≤240
x1+3x2≤100
x1,x2≥0
That's it. This is a complete LP formulation. Every LP problem, no matter how complex, follows this same skeleton.
Why "Linear"?
The objective and every constraint are linear functions — they involve only first powers of variables, no x2, no sinx, no x1x2. This linearity is what makes LP problems solvable efficiently (using the Simplex method or interior-point methods). If you have products of variables or powers, it's not linear programming anymore — it becomes nonlinear programming, which is much harder. …