The graphical method only works for 2 (or 3) decision variables. An algebraic method is needed beyond that, and it starts by rewriting the linear program in a fixed form.
Given an LP in variables and constraints, with , , , , standard form requires:
- Maximization
Replace by . - Equality constraints
Convert every inequality with a slack, surplus, or artificial variable, and scale each row so . - Non-negative variables
.
where counts the original variables plus the added ones.
Variable
Assume has full row rank with . Pick linearly independent columns forming an invertible basis matrix ; the remaining columns form . Partition accordingly.
Basic Variable
A component of . Setting gives . The solution is a basic feasible solution when .
Non-Basic Variable
A component of , fixed at while is solved for.
Slack Variable
For a constraint , add to get . Absorbs unused capacity.
Surplus Variable
For a constraint , subtract to get . Absorbs excess over the minimum.
Artificial Variable
A variable added to row with coefficient purely to supply a starting basic variable, with no meaning in the original problem.
When It Is Required
After the RHS of every constraint is made non-negative (multiply the row by if needed), each constraint must contribute one variable that appears with coefficient in that row and in all others (a unit column). That variable becomes basic in the starting solution.
- constraint
The slack variable is already such a unit column. No artificial variable. - constraint
The surplus variable has coefficient , not a unit column. Add an artificial variable. - constraint
No slack or surplus at all. Add an artificial variable.
So the number of artificial variables equals the number of constraints plus the number of constraints (after fixing signs).
Handling Them
A valid final solution must have every artificial variable equal to (non-basic, or basic at value ). If one stays positive, the original problem is infeasible. 2 methods drive them out:
- Big-M method
- Two-phase method
Worked Example
Minimize subject to
Solution Reveal Hide
Convert each requirement:
- Objective
Minimizing becomes maximizing . - Constraint is , so add slack .
- Constraint is , so subtract surplus , then add artificial .
- Constraint is , so add artificial .
Standard form:
With :
Starting basis = columns of = , so and .