D1 5.1 - Formulating linear programs
A useful linear program starts with precise variables and faithful translations of its conditions. You will formulate objectives and constraints, handle proportions and exact totals, and explain the roles of slack, surplus and artificial variables (D1 5.1).
Decide what the variables actually count
A workshop is told to make at least three products A for every product B, but also at most twice as many A as B. Can any positive production satisfy both instructions?
The words sound like ordinary production rules. Once translated, they will reveal a conflict that a clever optimisation algorithm cannot repair. First decide exactly what your symbols measure.
You already know
From A-level Mathematics, inequalities express bounds, and a solution must satisfy every simultaneous condition. Multiplying an inequality by a negative number reverses its direction. Keep units consistent before combining terms.
For example, “let be the number of A products made each day” identifies a count, a product and a time period. “Let be A” does not tell the reader whether it means items, kilograms or profit.
Linear program
A linear program maximises or minimises a linear objective subject to linear constraints and specified variable domains. The objective and every constraint have constant coefficients: terms such as are linear, whereas , and are not.
The three ingredients have different jobs:
| Ingredient | Example | Meaning |
|---|---|---|
| Decision variables | products per day | Quantities you can choose |
| Objective | Maximise | What makes one feasible choice better |
| Constraints and domain | , , integers | What choices are permitted |
Whole desks require integer variables. Kilograms of a divisible ingredient can usually be continuous. Do not add integer restrictions merely because the numerical data are integers, or omit them when the quantities must be whole objects.
Non-negativity means zero is allowed. It is a condition on the variables, not a substitute for the resource and relationship constraints. A fixed setup charge applying only when production is positive also needs more than an ordinary linear expression in the production quantity; do not pretend it is a constant unit cost.
Key idea
Define each variable with its meaning and unit, state whether the objective is maximised or minimised, then list every constraint and the variable domain. Formulating a model does not require solving it.
This check separates a valid linear model from expressions involving products or powers of the decisions.
Turn a resource table into a model
For a limited resource, multiply each unit's requirement by its production quantity and bound the total by what is available.
Suppose a workshop makes whole products A and B. Its daily data are:
| One A | One B | Available per day | |
|---|---|---|---|
| Cutting time, hours | |||
| Assembly time, hours | |||
| Profit, pounds |
The available hours constrain production; the profit row defines the objective. Check that all entries in one resource row use the same unit before writing its inequality.
Worked example 1: capacity is an upper bound
Question. Formulate a linear programming model for the workshop, defining your variables clearly. Do not solve it.
Plan. Define daily product counts, maximise total profit and use one inequality for each resource.
Let be the numbers of products A and B made each day. Then
Why this step? “Available” gives a maximum use, not a requirement to consume every hour. Writing equalities would exclude feasible plans that leave unused capacity.
Answer. The displayed objective, two constraints and integer domain form the required model.
Check. The plan uses cutting hours and assembly hours, so it is feasible and gives profit pounds. This check does not claim that the plan is optimal.
Worked example 2 changes only the cutting capacity, from to hours per day. Unit requirements and assembly capacity remain fixed.
Worked example 2: one resource becomes more plentiful
Question. Formulate the new model when cutting hours are available each day.
Plan. Change the cutting bound while retaining the same variables, objective and remaining conditions.
Why this step? The resource limit is the right-hand side. Changing the coefficients would incorrectly change how long each product takes to make.
Answer. Replace only the cutting constraint by .
Check. The plan uses cutting hours and assembly hours, giving profit pounds. It fits the new model but exceeds the old cutting capacity.
A lower production commitment would instead use , while an exact order would use . Each inequality's direction must come from its own wording, not from a belief that every linear program uses capacity constraints.
Watch out
Wrong: use just because hours are available, or swap the cutting and assembly coefficients. Right: read across one resource row at a time and preserve its units and upper-bound meaning.
Increase the same resource limit once more.
Model proportions without reversing their meaning
Write a statement about a proportion using the whole relevant total, then simplify to a linear inequality.
If at least a fraction of a two-ingredient blend is A, with quantities , the A amount must be at least times the total amount. The condition is not a comparison with B alone.
A minimum proportion of a total
For non-negative quantities and fixed ,
For a positive total this says that A is at least proportion of the blend. At total zero the linear inequality holds, but a percentage composition is undefined; a required positive batch size excludes that case.
Not in the formula booklet: learn it.
Similarly, “at most twice as much A as B” means . Multiplying the B quantity by two gives the largest permitted A quantity. Writing expresses a different relationship.
Worked example 3: an exact blend with a minimum share
Question. A blend must contain exactly kg of ingredients A and B. A costs pounds per kilogram and B costs pounds per kilogram. At least one quarter of the blend must be A, and there must be at most twice as much A as B. Formulate a model minimising cost.
Plan. Define continuous masses, use an equality for the total, and translate each composition statement separately.
Let be the kilograms of A and B. Then
Why this step? One quarter of the blend is , not . Using the exact total, the share condition is also equivalent to .
Answer. Minimise subject to , , and non-negativity.
Check. At , the total is , A exceeds the required kg and . The cost is pounds; feasibility alone does not establish minimum cost.
Continue this lesson.
You’re previewing NovaLearn without an account. Create a free account to read the rest.
Create free account