Decisions & optimisation

Linear optimisation: allocate limited capacity

How should limited labour and material be shared between two products? A small production model shows how constraints shape feasible plans and why whole units can change the answer.

  • 4 min read
  • Updated on
  • smartlytics editorial team

The short answer

Linear optimisation maximises or minimises a linear objective subject to linear constraints. In this bounded production example, comparing feasible vertices finds a continuous optimum; whole units require an additional integer search.

Try the free interactive calculatorFree · in your browser · no sign-up

At a glance

  1. Constraints describe which production plans are actually feasible.
  2. The continuous maximum is an upper bound on the value of integer plans.
  3. Rounding can break resource limits or overlook a better integer solution.

Which products should we make?

A workshop produces two items. Product A contributes €40 per unit and product B contributes €30. A needs two units of labour and one unit of material; B needs one unit of labour and two units of material. How many should the workshop make when both resources are limited? This is a more precise question than “increase revenue”: we want the highest total contribution within two capacity limits.

Let the quantities be xx and yy, available labour LL and material MM. The model maximises 40x+30y40x+30y, subject to 2x+y≤L2x+y\le L, x+2y≤Mx+2y\le M and x,y≥0x,y\ge0. Every term has an interpretable unit. Resource use per item stays constant, as does the contribution from each additional unit. These assumptions make the problem linear. SciPy documents the same basic structure of an objective, equations, inequalities and variable bounds (SciPy developers 2026).

A plan with 41 labour units and 50 material units

With L=41L=41 and M=50M=50, the two resource boundaries intersect at x=10.67x=10.67 and y=19.67y=19.67. This continuous plan uses both resources fully and produces a contribution of approximately €1,016.67. “Continuous” means that fractional quantities are allowed. That can make sense for liquids, but usually not for finished pieces of equipment.

For whole units, the best plan is eleven units of A and nineteen of B. It requires 41 units of labour and 49 units of material and contributes €1,010. One material unit remains unused. Simply rounding both continuous quantities down would give ten A and nineteen B, worth only €970. A good integer solution therefore does not automatically result from rounding down a continuous one.

The €6.67 difference is the gap between the continuous and integer optima in this particular case. It is neither a fee nor a universal percentage. It follows from these capacities and the indivisibility of the products. With 40 labour units and 50 material units, ten A and twenty B are already optimal as whole units, so the gap disappears.

Change the feasible region yourself

Interactive

Linear optimisation – interactive calculator

Feasible plans satisfy 2x+y ≤ L and x+2y ≤ M. With L=41 and M=50, the continuous solution is approximately (10.67, 19.67), while the best integer solution is (11, 19).

First change labour alone. This moves one boundary of the polygon while the other stays fixed. Additional labour eventually stops helping when material prevents any further output. Then change material. Watch both the objective value and the product mix. A resource can be scarce without every small extra unit immediately creating value in the integer model.

The whole-units control displays the feasible grid points and makes their best solution the highlighted result. The continuous optimum remains visible for comparison. The results table explicitly identifies both plans, so readers do not have to infer precise quantities or distinguish the markers from the chart alone.

Why vertices suffice and rounding does not

The calculator constructs intersections of the resource boundaries and the coordinate axes. It then removes negative or otherwise infeasible points. This matters because a mathematical intersection is not necessarily a feasible production plan. The remaining points form the feasible polygon. Comparing its vertices finds a continuous optimum for this bounded example.

This geometric view and the move to discrete decisions are foundational topics in optimisation (Bertsimas, D. 2009). For the small integer problem, the application also checks every feasible combination of whole quantities. Enumeration is transparent and exact here, but its cost grows with the ranges involved. Large production models use specialised methods, such as branch-and-bound, instead of directly listing huge numbers of possible plans.

Which assumptions limit the decision?

The example contains no minimum batches, setup costs, scrap, deadlines or demand limits. It assumes that every unit produced can be sold at the stated contribution. An extra shift is no more expensive than an existing one, and the two products compete only for the two modelled resources. These simplifications are useful for learning and must be checked explicitly before applying a model to a real operation.

A practical implementation should therefore start with agreed units and constraints. Compare the model against a known production plan. If a plan that works in practice is excluded, the discrepancy needs a business explanation. If an obviously impossible plan is allowed, a constraint is missing. Only then is it useful to optimise the objective. The optimisation overview introduces other model types for more complex decisions.

Frequently asked questions

Why is an optimum at a vertex?

For this bounded linear model, an objective line can be shifted until it touches a vertex or an entire optimal edge. At least one vertex is optimal.

Can I simply round a fractional solution?

Not reliably. Rounding up can violate capacity and rounding down can waste value. This calculator compares every feasible integer plan in the small example.

Sources and further reading

  1. OnlineSciPy developers (2026): scipy.optimize.linprog.
  2. OnlineBertsimas, D. (2009): Optimization Methods: Lecture Notes.

Content last reviewed on 14 November 2026. Please let us know about any errors: impressum@nyxai.com.

From NyxAI

smartlytics is the learning hub of NyxAI GmbH.

Explore the methods we work with, explained openly, with sources and calculations you can reproduce.

Decision Core

NyxAI is developing a Decision Core for Decision Intelligence that combines optimisation, simulation, statistics and reinforcement learning: compare options, make uncertainty visible and learn from outcomes, with people in control.

DeepSquare

Explainable chess AI with human playing styles: NyxAI’s testing ground for understandable decisions under time pressure.