GARETH GRANTTECHNOLOGY · DATA · INNOVATION
Explore

46 / Operations & risk

Product mix with resource and demand constraints

Product-mix optimisation is operations research rather than a statistical significance test. It translates a business objective and resource limits into an explicit model, then searches for the best feasible plan within those assumptions.

IntermediateLive exploration + Python

The business question

Which feasible product quantities produce the greatest contribution in the planning period?

  • Allocate scarce machine and labour time across products with different contribution and processing requirements.
  • Compare a capacity, demand or margin scenario before committing to a production plan.

How the method works

The objective sums the contribution from the selected quantities. Contribution is selling revenue less variable cost, before fixed costs; it is not net profit. Each resource adds a constraint linking resource use per unit or batch to available capacity. Demand limits prevent the model from creating an apparently profitable plan for quantities the business cannot sell.

A linear programme permits fractional decision variables. That may be appropriate for divisible material but is often wrong for whole batches. Integer restrictions change the feasible set and can change the best plan. The small illustration can be solved exactly by checking every feasible pair; larger models require a suitable integer-programming solver and attention to its feasibility and optimality diagnostics.

The answer is only as useful as the model boundary. Available hours should account for expected downtime and other commitments. Setup times, sequencing, minimum orders, working capital and uncertain demand can matter. Changing one input to find a new optimum is scenario analysis, not evidence that the assumed input will occur. Recheck the plan against real scheduling constraints before release.

The calculation

Maximise margin_A A + margin_B B subject to 2A+B ≤ machine_hours, A+2B ≤ labour_hours, 0 ≤ A ≤ demand_A, 0 ≤ B ≤ demand_B, with integer A and B.
Read the symbols
SymbolMeaning
A, BWhole batches of the two products in the same planning period.
margin_A, margin_BContribution per batch after variable costs, before fixed costs.
Resource coefficientsMachine and labour hours used per batch; different resources have separate constraints.

A worked business example

ILLUSTRATIVE SCENARIO

Illustrative workshop: two products compete for the same available machine and labour budgets.

Inputs

  • Product A: R300 contribution, 2 machine hours and 1 labour hour per batch; maximum demand 40.
  • Product B: R250 contribution, 1 machine hour and 2 labour hours per batch; maximum demand 50.
  • Available machine and labour budgets: 100 hours each.

Work through the numbers

  1. A fractional intersection solves 2A+B = 100 and A+2B = 100, giving A = B = 33.333333.
  2. The fractional contribution is R18,333.33, but thirds of a batch are not permitted.
  3. Checking whole-number feasible plans gives A = 34 and B = 32.
  4. Resource use is 2 × 34 + 32 = 100 machine hours and 34 + 2 × 32 = 98 labour hours.
  5. Contribution is 34 × R300 + 32 × R250 = R18,200. The best single-product plan contributes max(40 × R300, 50 × R250) = R12,500.
An optimal integer plan is 34 A batches and 32 B batches, contributing R18,200 before fixed costs.

The R5,700 improvement over the best single-product plan is a model comparison. Its delivery depends on the specified times, margins, demand and omitted operational details.

Explore the decision

Choose exact whole-batch quantities. The live explorer has its own example inputs; it is separate from the worked calculation above.

Enable JavaScript to use this calculator. The worked example and executable Python remain available.

Apply it at work

  1. Define the planning horizon, objective and whether quantities are divisible, integer or subject to minimum batches.
  2. Measure contributions, resource requirements, available capacity and credible sellable-demand limits.
  3. Solve the model, inspect feasibility and compare it with a transparent baseline and sensitivity scenarios.
  4. Translate the candidate into an executable schedule and verify quality, working capital, delivery and actual contribution.

Check these assumptions

  • Resource use and contribution per batch are constant over the illustrated planning range.
  • Available machine and labour hours are separate, accurate budgets for the same period.
  • Every selected batch can be sold within the stated demand limits.
  • The example excludes setups, sequencing, uncertain processing times, overtime and working-capital constraints.

Common mistakes and how to avoid them

  • Rounding a fractional solution independently can make a plan infeasible or miss a better integer plan.
  • Optimising revenue instead of contribution can favour products with large variable costs.
  • Ignoring demand ceilings or already committed capacity creates an optimum that the business cannot actually execute.

How this can help the business

  • Explicit constraints make product-selection trade-offs visible and allow reviewers to challenge the assumed bottleneck.
  • An exact small example teaches why a high margin alone does not determine the best use of several scarce resources.
A decision rule to adapt

Choose a feasible plan that meets all material operating constraints and improves the stated objective over the baseline; verify its executable schedule and sensitivity before committing.

When to use another approach

Use mixed-integer programming for setups and minimum quantities, robust or stochastic optimisation for uncertainty, and scheduling models for sequence-dependent operations.

Reproduce the worked example in Python

The code is self-contained for this example. Dependencies and run instructions are included with the downloadable notebook.

Show executable code and recorded output
best_contribution = -1
best_a, best_b = 0, 0
for a in range(41):
    for b in range(51):
        if 2*a+b <= 100 and a+2*b <= 100:
            contribution = 300*a+250*b
            if contribution > best_contribution:
                best_contribution = contribution
                best_a, best_b = a, b
print("Optimal whole batches A and B:",best_a,best_b)
print("Machine hours:",2*best_a+best_b)
print("Labour hours:",best_a+2*best_b)
print("Contribution: R",best_contribution)
print("Improvement over best single product: R",best_contribution-12500)

Recorded output

Optimal whole batches A and B: 34 32
Machine hours: 100
Labour hours: 98
Contribution: R 18200
Improvement over best single product: R 5700
Download all worked examples

Sources and further reading

Concepts are linked to primary teaching or technical sources. The business examples are illustrative applications, not reported client results.