|
|
Part 11: Solving Linear Programming Problems
Linear programming (LP) is an application of linear algebra in which the central problem is to maximize or minimize a linear function (of perhaps many variables) on a domain defined by linear inequalities and equations. In this tutorial, we consider only LP problems in two variables. In this Part, we address such problems directly in terms of linear algebra. In Part 12, we explore Maple's commands for solving such problems by the Simplex Algorithm, the central tool of applied linear programming.
Our prototypical LP problem* is this:
Problem A. Find values of x and y that will maximize z = 120x + 100y subject to the restrictions
2x + 2y < 8 |
5x + 3y < 15 |
x > 0, y > 0. |
The function z(x,y) to be optimized is called the objective function. The inequalities that determine the domain are called constraints. Points (x,y) that satisfy all of the constraints are called feasible. Points that are not feasible are excluded. The variables x and y are called decision variables.
However, the default colors
are different from the ones we show here. The command that drew this picture
was actually
domainA:=inequal(constraintsA, x=0..5, y=0..5,
optionsclosed=(color=blue, thickness=3), optionsexcluded=(color=yellow)
):%;
You may experiment with plot options to find a combination you like. ("Closed"
refers to the bounding lines, and "excluded" refers to points
outside the domain.) How does the picture drawn by inequal
represent the feasible region?
Finding the point of intersection of two lines in the plane is not a difficult algebra problem. Indeed, all we have to do is solve the simultaneous equations
2x + 2y = 8 |
5x + 3y = 15 |
However, we choose deliberately to complicate the problem so that our means of solution relates to more general LP problems for which we will not be able to spot the answer by looking at a picture in the plane.
Because we are about to introduce
some new variables, we rename x and y
as x1 and x2, respectively. Now we introduce
x3 and x4 to represent the "slack" between
the right and left sides of the inequalities. That is, x3
is 8 - 2x1 - 2x2, and similarly for x4.
These new variables turn our inequalities into equations in nonnegative variables:
2x1 + 2x2 + x3 = 8 |
5x1 + 3x2 + x4 = 15 |
x1 > 0, x2 > 0, x3 > 0, x4 > 0. |
Note that these equations tell us immediately the values of x3 and x4 when x1 and x2 are both 0. But what we want to know is the values of x1 and x2 when x3 and x4 are both 0.
Problem B.* Find values of x and y that will minimize z = 20x + 25y subject to the restrictions
2x + 3y > 18 |
x + 3y > 12 |
4x + 3y > 24 |
x > 0, y > 0. |
Draw the domain, make a contour map of the objective function, and decide where the minimum value must be found. Introduce slack variables, and solve for x and y when the appropriate slack variables are 0.
* Problems A and B
are adapted from Section 1.1 of Elementary Linear Programming with Applications,
2nd ed., by B. Kolman and R. Beck, Academic Press, 1995. The suggested context
for Problem A is maximizing profit from a manufacturing product mix and for
Problem B minimizing the cost of a two-food meal that meets certain nutritional
constraints.
modules at math.duke.edu | Copyright CCP and the author(s), 1998-2000 |