Objective Function and Constraints Explained Simply
Every optimisation problem has two mathematical ingredients: a goal and the rules that limit it. The objective function is the goal as a formula, e.g. profit Z = 60x + 30y for two products x and y. The constraints are the rules, written as inequalities like 2x + y ≤ 100 (machine hours) or x ≥ 0 (no negative production). Together they form a linear programming problem.
These two ingredients make linear programming work in the real world. Writing the objective defines success in numbers; listing every constraint captures the true limits. The feasible region holds the answer, and the best answer always sits at one of its corner points.
Key Concepts
- Objective function: Z = c₁x + c₂y, to be maximised or minimised; c₁ and c₂ are per-unit profit or cost rates.
- Decision variables: x and y, the quantities being chosen.
- Constraints: linear inequalities or equations that the variables must satisfy, such as 3x + 4y ≤ 120.
- Feasible region: the set of all (x, y) points satisfying every constraint simultaneously; only these points are allowed.
- Binding constraint: a constraint exactly met (equality holds) at the optimum; others have slack left over.
How It Works
- Step 1 — Build the objective: multiply each variable by its per-unit rate and add: Z = (profit per table)x + (profit per chair)y.
- Step 2 — State the direction: write "maximise Z" for profit or output, "minimise Z" for cost or time.
- Step 3 — Convert each limit: resource caps become ≤, minimum requirements become ≥, exact balances become equations.
- Step 4 — Add x ≥ 0, y ≥ 0: negative production is meaningless in almost every real problem.
- Step 5 — Verify consistency: units must match across each inequality (hours with hours, rupees with rupees).
Worked Example
A bakery sells cakes (x) and pastries (y). Each cake gives ₹40 profit and needs 3 units of flour; each pastry gives ₹55 profit and needs 4 units of flour. Only 120 units of flour are available. Write the objective function and constraints, then check whether making 20 cakes and 15 pastries is feasible.
- Objective function: maximise Z = 40x + 55y (total profit in rupees).
- Flour constraint: 3x + 4y ≤ 120.
- Non-negativity: x ≥ 0, y ≥ 0.
- Test (20, 15): flour used = 3(20) + 4(15) = 60 + 60 = 120 ≤ 120, and both variables are non-negative, so the plan is feasible — it exactly uses up the flour.
- Profit: Z = 40(20) + 55(15) = ₹1625. Testing (30, 10) gives flour = 130 > 120 — infeasible, proving constraints genuinely restrict choices.
Common Misconceptions
- Treating the objective function as a constraint: it is the goal to optimise, not a limit; it never restricts the feasible region.
- Ignoring the direction of optimisation: maximising cost or minimising profit are classic sign errors.
- Assuming every constraint binds: some constraints have slack (unused resource) at the optimum; only binding ones shape the answer.
Real-World Applications
- Manufacturing: maximising profit under material, labour and machine limits.
- Logistics: minimising transport cost subject to supply and demand constraints.
- Agriculture: maximising crop yield under land, water and fertiliser limits.
- Finance: maximising portfolio return under budget and risk constraints.
The objective function says what you want; the constraints say what is allowed. Write both in the same variables, keep units consistent, add non-negativity, and every plan can be tested by substitution.
Related blogs
- Linear Inequalities in Two Variables: Complete Review
- Formulation of Linear Programming Problems: Notes and FAQs
- Feasible and Infeasible Regions: Explained with Examples
- Graphical Method of Solution: Explained with Examples
- Corner Point Method: Concepts, Formulas and Examples
- Bounded and Unbounded Solutions: Explained with Examples