Choosing the best option
Optimization: Linear Programming, Pivoting and Complementarity

Optimization asks for the best value of some quantity, such as cost, profit or error, among the choices that satisfy a list of limits. The most thoroughly understood case is the linear one, where both the quantity and the limits are linear in the unknowns. This section starts there and moves outward to the problems that linear programming cannot express directly.
Linear programs and their corners
The feasible set of a linear program is a polytope, a solid with flat faces. Its best point is always at a corner, or tied along an edge or face that includes one. That single geometric fact is the basis of the simplex method: start at a corner, move along an edge that improves the objective, stop when no edge does. The lp_solve tutorial puts this on a two-variable model whose five corners can be listed on paper, then compares the hand result with what a solver reports.
Every linear program also has a twin, the dual, whose variables price the original limits. At the optimum the two objective values agree, so the dual values serve as both a certificate and a source of economic information. A reader who studies one worked example from end to end, including the dual, understands most of the theory.
When the objective disappears
Not every problem comes with something to minimize. Equilibrium problems ask only for a state in which each pair of quantities is complementary, meaning that one of them is zero. This is the linear complementarity problem, and the Lemke algorithm solves it with a modified pivoting rule and a short tableau example. It also handles convex quadratic programs, because their optimality conditions have exactly that shape.
How the three problem classes relate
The three topics are less separate than they look. A linear program is itself a complementarity problem: its optimality conditions, written out, say that each constraint is either tight or has a zero dual value, and each variable is either zero or has a zero reduced cost. Stack the primal and dual conditions into one system and the result is a linear complementarity problem with a particular structure. That is why a pivoting method built for complementarity can also solve linear programs, and why the simplex tableau and the Lemke tableau look so alike on paper.
The reverse is not true. A general complementarity problem has no objective to improve, so there is nothing to minimize and no guarantee that a solution exists. Integer programming sits on the other side: it adds a requirement on the unknowns rather than removing one, and each branch of the splitting search solves an ordinary linear program with tightened bounds. Fast, reliable linear solves are therefore the engine under all three.
Integers and applications
Requiring some unknowns to be whole numbers turns an easy problem into a hard one, and solvers answer it with systematic splitting and bounding. The model is the same, which is why a clear formulation matters more than the solver brand. Application areas, from scheduling to risk quantiles, are sketched in the overview of numerical methods in practice.
How to read this section
Start with the linear program, read the dual, then take complementarity. Always keep a checking habit: substitute the claimed optimum back into every constraint, count the binding ones, and confirm that dual and primal values match. A solver status such as infeasible or unbounded is information, and usually a prompt to look for a flipped inequality in the model.
Pivoting needs factorizations underneath, covered in linear algebra, and unfamiliar terms are defined in the glossary.
Questions about optimization
What is the difference between a feasible and an optimal solution?
A feasible solution satisfies every constraint of the model. An optimal solution is a feasible one with the best objective value among all feasible points. Many problems have countless feasible solutions but only one optimal objective value, which several different solutions may share. A solver status of infeasible means that no point satisfies all constraints.
What does a dual value or shadow price mean?
A dual value says how much the optimal objective changes if the right-hand side of one constraint grows by one unit, with the rest of the model held fixed. It holds only within a limited range before another constraint becomes tight. A dual value of zero marks a constraint with slack, which is not limiting the solution.
Why can integer programs be so much harder than linear programs?
Without the integer requirement the feasible set is a convex polytope with an optimum at a corner, found efficiently. Integrality removes the points between corners, and the solver must search combinations of choices, which can grow exponentially. Tight formulations and good bounds keep that search small, which is why model quality matters.
What does unbounded or infeasible mean in a solver report?
Infeasible means the constraints contradict each other, so no point satisfies all of them. Unbounded means the objective can be improved without limit while staying feasible. Both usually point to a modeling slip, such as a reversed inequality, a missing upper limit on a variable, or a sign error in the objective.
Lemke Algorithm for the Linear Complementarity Problem: Step by Step Example
How Lemke's pivoting method solves a linear complementarity problem, shown with a complete hand-worked example and the cases where it fails.
lp_solve Linear Programming Tutorial: Model, Solution and Worked Example
A tutorial on modeling and solving a linear program with lp_solve, with a two-variable example checked by hand at every vertex.
Numerical Methods in Practice: Signals, Schedules, Risk and Images
Four broad application areas for the methods in this reference: signal analysis, linear programming, risk with normal distributions, and imaging.