The basic problem in linear programming (LP) is to minimize/maximize a
linear objective function
of
variables
under a set of
linear constraints:
(209) |
The LP problem can be more concisely represented in matrix form:
where(211) |
For example, the objective function could be the total profit,
the constraints could be some limited resources. Spicifically,
may represent the quantities of
different
types of products,
represent their unit prices,
and
represent the consumption of the ith resource by
the jth product, the goal is to maximize the profit
subject to the constraints imposed by
the limited resources
.
Here all variables are assumed to be non-negative. If there exists a variable that is not restricted, it can be eliminated. Specifically, we can solve one of the constraining equations for the variable and use the resulting expression of the variable to replace all its appearances in the problem. For example:
(212) |
(213) |
Given the primal LP problem above, we can further find its dual problem. We first construct the Lagrangian of primal problem:
(214) |
(215) |
(216) |
(217) |
(218) |
(219) |
If either the primal or the dual is feasible and bounded, so is
the other, and they form a strong duality, the solution of
the dual problem is the same as the solution
of the primal
problem. Also, as the primal and dual problems are completely
symmetric.
An inequality constrained LP problem can be converted to an equality constrained problem by introducing slack variables:
(220) |
(221) |
(222) |
(223) |
Now the LP problem can be expressed in the standard form (original form
on the left, with and
redefined on the right):
(224) |
An LP problem can be viewed geometrically. If normalize
so that
, then the objective function
becomes the projection of
onto
. Each of the
equality constraints in
represents a hyper-plane in the N-D
vector space perpendicular to its normal direction
:
(225) |
(226) |
The polytope enclosed by these hyper-planes is called the
feasible region, in which the optimal solution must lie. The
vertices of the polytopic feasible region are a subset
of the
intersections.
Fundamental theorem of linear programming
The optimal solution of a linear programming problem
formulated above is either a vertex of the polytopic feasible
region
, or lies on a hyper-surface of the polytope, on which
all points are optimal solutions.
Proof:
Assume the optimal solution
is interior to
the polytopic feasible region
, then there must exist some
such that the hyper-sphere of radius
centered at
is inside
. Evaluate the objective
function at a point on the hyper-sphere
(227) |
(228) |
Based on this theorem, the optimization of a linear programming problem
could be solved by exhaustively checking each of the intersections
formed by
of the
hyper-planes to find (a) whether it is feasible
(satisfying all
constraints), and, if so, (b) whether the objective
function
is maximized at the point. Specifically, we choose
of the
equations for the the constraints and solve this N-equation
and N-unknown linear system to get the intersection point of
corresponding
hyper-planes. This brute-force method is most straight forward, but the
computational complexity is high when
and
, and therefore
,
become large.
Example:
This problem has variables with the same number of non-negativity
constraints and
linear inequality constraints. The
straight
lines form
intersections, out of which 5 are the
vertices of the polygonal feasible region satisfying all constraints.
The value of the objective function
is proportional to the projection of the 2-D variable vector
onto the coefficient vector
.
The goal of this linear programming problem is to find a point
inside the polygonal feasible region with maximum
(the projection of
onto
vector
if
). Geometrically, this can be
understood as to push the hyper-plane
, here a
line in 2-D space, its normal direction
, away from the
origin along to eventually arrive at the vertex of the polytopic
feasible region farthest away from the origin.
This LP problem can be converted into the standard form:
Listed in the table below are the
intersections
, called basic solutions, together with the corresponding
slack variables
and the objective function value
(proportional to the projection of
onto
). We see that out of the ten basic solutions, five are
feasible (vertices of the polytopic feasible region) with all
variables taking non-negative values, while the remaining
five are not feasible, as some of the slack variables are negative,
and thereby violating the constraints. Out of the five feasible
solutions, the one at
is optimal with maximum
objective function value
.
This primal maximization problem can be converted into the dual minimization problem:
The five planes, from the constraining inequalities, and
for the non-negative constraints
,
, and
for the three variables, form
intersection points:
We see that at the feasible point
, the dual function
is minimized to be
, the same
as the maximum of the primal function
at
.
Homework:
Develop the code to find all intersections formed by
given hyper-planes in an N-D space in terms of their
equations
and
, identify which of them are vertices of
the polytope surrounded by these hype-planes, and find the vertex
corresponding to the optimal solution that maximizes
for a given
.