Suppose a workshop makes products X and Y. Each X earns 3 units, each Y earns 2. It can make at most 4 products in total, at most 2 of X, and at most 3 of Y. Let x and y be the amounts made. We want to maximize 3x + 2y subject to x + y ≤ 4, x ≤ 2, y ≤ 3, and x, y ≥ 0.
Background for this page. You should be comfortable substituting numbers into equations and inequalities. A feasible point obeys every constraint. The objective is the quantity the model maximizes or minimizes. Related explanations: Matrix algorithms: Gaussian elimination and linear systems · Matrices: dimensions, products, and transposes.
This is a linear program: the objective and every constraint are linear in the decision variables. The set of allowed points is the feasible region. In this small example, x = 2, y = 2 is feasible and earns 10. If we allow fractional production, a linear-programming solver searches the whole feasible region, not only the few whole-number points we can list by hand. If products must be indivisible, that extra integer requirement changes the problem into an integer program; ordinary linear programming alone does not enforce it.
The geometry helps. Each inequality cuts away part of the plane. For a bounded feasible polygon, an optimum exists at a vertex, though more than one point may share the same optimum. In many dimensions we cannot draw the region, but the same linear structure remains. Algorithms for linear programming exploit that structure rather than trying every possible point.
Duality gives a second view of the same problem. Instead of choosing production amounts, the dual assigns values to limited resources. A feasible dual solution gives a bound on what any feasible production plan can earn. Under the usual conditions for a feasible optimum, strong duality says the best primal value equals the best dual value. This can certify that a candidate answer is optimal and can help explain which resource constraints matter most.
Formulating the problem is often harder than solving it. If profit is not really linear, if a machine has a fixed startup cost, or if a product must be made in whole units, the simple model leaves something out. A precise mathematical optimum for the wrong model is not a useful business answer.
Prove the workshop optimum with a bound
The workshop maximizes 3x+2y with x+y≤4 and x≤2, along with the other stated bounds. Rewrite the objective as 2(x+y)+x. Every feasible point therefore earns at most 2·4+2=10. The point (2,2) satisfies all constraints and earns ten. An upper bound and a feasible point reaching it prove optimality without inspecting every point.
This is also the intuition behind a dual certificate: combine resource limits to bound any production plan. A picture can suggest a promising corner, but the inequality supplies a checkable reason it is optimal.
Models can also be infeasible, meaning no point meets every constraint, or unbounded, meaning the objective improves without limit. A solver needs to distinguish those outcomes from a finite optimum.
Practice. Is x = 3, y = 1 allowed in the workshop model? What is the profit at x = 2, y = 2? What extra rule is needed if half a product cannot be made?
Answer. The first point violates x ≤ 2. The second earns 3·2 + 2·2 = 10. Indivisible products require x and y to be integers, which is an additional constraint beyond the linear program.
Try another case. If profit becomes 2x+2y under the same constraints, is (2,2) the only optimum?
Reasoning. No. Every feasible point on x+y=4 has profit eight, including (1,3). A linear program can have many optimal points.