Linear Programming
Linear Programming
Put very informally, LP is about trying to get the best outcome (e.g.
maximum profit, least effort, etc) given some list of constraints (e.g. only
working 30 hours a week, not doing anything illegal, etc), using a linear
mathematical model.
defined on this polytope, the goal is to find a point in the polytope where this
function has the smallest (or largest) value. Such points may not exist, but if
they do, searching through the polytope vertices is guaranteed to find at
least one of them.
Maximize
Subject to
Where
represents the vector of variables, while and are vectors of coefficients and
is a matrix of coefficients. The expression to be maximized or minimized is
called the objective function ( in this case). The equations are the constraints
which specify a convex polyhedron over which the objective function is to be
optimized.
Linear programming can be applied to various fields of study. Most
extensively it is used in business and economic situations, but can also be
utilized for some engineering problems. Some industries that use linear
programming models include transportation, energy, telecommunications,
and manufacturing. It has proved useful in modeling diverse types of
problems in planning, routing, scheduling, assignment, and design.
The founders of the subject are George B. Dantzig, who published the
simplex method in 1947, John von Neumann, who developed the theory of
the duality in the same year, and Leonid Kantorovich, a Russian
mathematician who used similar techniques in economics before Dantzig and
won the Nobel prize in 1975 in economics. The linear programming problem
was first shown to be solvable in polynomial time by Leonid Khachiyan in
1979, but a larger major theoretical and practical breakthrough in the field
came in 1984 when Narendra Karmarkar introduced a new interior point
method for solving linear programming problems.
Uses
The simplex method was the first method developed to solve linear
programs. In these pages we attempt to teach someone how the simplex
method works. The user is expected to know some of the basic ideas and
terms involved with linear programming and matrix algebra.
Step 3: Rewrite the profit function. Make sure all the variables are on one
side.
Step 4: Construct the simplex matrix using the constraint equations (step 2)
and the profit equation (step3).
The following steps are necessary to find the maximum solution to the
simplex matrix.
Standard form
Standard form is the usual and most intuitive form of describing a linear
programming problem. It consists of the following three parts:
A linear function to be maximized
e.g. maximize
Problem constraints of the following form
e.g.
Non-negative variables
e.g.
maximize
subject to
Example
maximize
subject to
Augmented form (slack form)
Maximize Z in:
where xs are the newly introduced slack variables, and Z is the variable to be
maximized.
Example
subject to:
Maximize Z in:
Duality
maximize
subject to
There are two ideas fundamental to duality theory. One is the fact that
the dual of a dual linear program is the original primal linear program.
Additionally, every feasible solution for a linear program gives a bound on
the optimal value of the objective function of its dual. The weak duality
theorem states that the objective function value of the dual at any feasible
solution is always greater than or equal to the objective function value of the
primal at any feasible solution. The strong duality theorem states that if the
primal has an optimal solution, x*, then the dual also has an optimal solution,
y*, such that cTx*=bTy*.
Example
minimize
subject to
Note that each variable in the primal problem (amount of wheat/barley
to grow) correspond to an inequality in the dual problem (revenue obtained
by wheat/barley), and each variable in the dual problem (revenue bound
provided by each resource) correspond to an inequality in the primal
problem (limit on each resource).
Complementary slackness
Suppose that x = (x1, x2, . . ., xn) is primal feasible and that y = (y1, y2, . . . ,
ym) is dual feasible. Let (w1, w2, . . ., wm) denote the corresponding primal
slack variables, and let (z1, z2, . . . , zn) denote the corresponding dual slack
variables. Then x and y are optimal for their respective problems if and only
if xjzj = 0, for j = 1, 2, . . . , n, w iyi = 0, for i = 1, 2, . . . , m.
So if the ith slack variable of the primal is not zero, then the ith variable of
the dual is equal zero. Likewise, if the jth slack variable of the dual is not
zero, then the jth variable of the primal is equal to zero.
Theory
There are two situations in which no optimal solution can be found. First, if
the constraints contradict each other (for instance, x ≥ 2 and x ≤ 1) then the
feasible region is empty and there can be no optimal solution, since there
are no solutions at all. In this case, the LP is said to be infeasible.
Algorithms
A series of linear constraints on two variables produces a region of
possible values for those variables. Solvable problems will have a feasible
region in the shape of a simple polygon.
This long standing issue was resolved by Leonid Khachiyan in 1979 with the
introduction of the ellipsoid method, the first worst-case polynomial-time
algorithm for linear programming. To solve a problem which has n variables
and can be encoded in L input bits, this algorithm uses O(n4L) arithmetic
operations on numbers with O(L) digits. It consists of a specialization of the
nonlinear optimization technique developed by Naum Shor, generalizing the
ellipsoid method for convex optimization proposed by Arkadi Nemirovski, a
2003 John von Neumann Theory Prize winner, and D. Yudin.
A cargo plane has three compartments for storing cargo: front, centre
and rear. These compartments have the following limits on both weight and
space:
The following four cargoes are available for shipment on the next flight:
Solution
Variables
We need to decide how much of each of the four cargoes to put in each
of the three compartments. Hence let:
xij be the number of tonnes of cargo i (i=1,2,3,4 for C1, C2, C3 and C4
respectively) that is put into compartment j (j=1 for Front, j=2 for Centre and
j=3 for Rear) where xij >=0 i=1,2,3,4; j=1,2,3
Note here that we are explicitly told we can split the cargoes into any
proportions (fractions) that we like.
Constraints
cannot pack more of each of the four cargoes than we have available
[x11 + x21 + x31 + x41]/10 = [x12 + x22 + x32 + x42]/16 = [x13 + x23 + x33 + x43]/8
Objective
Solution
Variables
The union agreement is such that any worker can only start their four
consecutive work days on one of the seven days (Mon to Sun) and in one of
the three eight-hour shifts (night, day, late).
Let:
Nij the number of workers starting their four consecutive work days on day i
(i=1,...,7) and shift j (j=1,...,3)
Note here that strictly these variables should be integer but, as we are
explicitly told to formulate the problem as a linear program in part (a) of the
question, we allow them to take fractional values.
Constraints
upper limit on the total number of workers of 60
since each worker can start his working week only once during the seven
day, three shift, week
lower limit on the total number of workers required for each day/shift
period
let Dij be the (known) number of workers required on day i (i=1,...,7) and
shift period j (j=1,...,3) e.g. D53=11 (Friday, Late)
The logic here is straightforward, for example for Wednesday (day 3) the
workers working shift j on day 3 either started on Wednesday (day 3, N 3j) or
on Tuesday (day 2, N2j) or on Monday (day 1, N1j) or on Sunday (day 7, N7j) -
so the sum of these variables is the total number of workers on duty on day
3 in shift j and this must be at least the minimum number required (D 3j).
Objective
where all variables Nij>=0 and continuous (i.e. can take fractional values).
There are three stages (A, B, C) in the manual assembly of each product and
the man-hours needed for each stage per unit of product are shown below:
Product
1 2 3 4
Stage A 2 2 1 1
B 2 4 1 2
C 3 6 1 5
The nominal time available in the next week for assembly at each stage (A,
B, C) is 160, 200 and 80 man-hours respectively.
Solution
Variables
Let
x1 <= 50
x2 <= 60
x3 <= 85
x4 <= 70
ratio
work-time
Objective
Note we neglect the fact that the xi variables should be integer because we
are told to formulate the problem as an LP.
Facts