Você está na página 1de 30

Chapter 15

1
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Constrained Optimization
Chapter 15
LINEAR PROGRAMMING
An optimization approach that deals with
maximizing profit or minimizing cost in
presence of constraints such as limited
resources
Mathematical functions representing both the
objective and the constraints are linear.

2
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Standard Form/
Basic linear programming problem consists of two
major parts:
The objective function
A set of constraints

For maximization problem, the objective function is


generally expressed as
Maximize Z c1 x1 c2 x2 cn xn
cj= payoff of each unit of the jth activity
xj= magnitude of the jth activity
Z= total payoff due to the total number of activities
3
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

The constraints can be represented generally as

ai1 x1 ai 2 x2 ain xn bi
aij = amount of the ith resource that is consumed for
each unit of the jth activity
bi = amount of the ith resource that is available
The general second type of constraint specifies that
all activities must have a positive value, xi>0
Together, the objective function and the constraints
specify the linear programming problem.
4
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Graphical Solution: Constraints and


Feasible Design
Design
variable
2

Infeasible
Design

Constraint
Limits
Feasible Design

Design variable 1
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Search for a Better Design

Design
variable
2

Better Designs

Constraint
Limits

Design variable 1
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Profit Maximization Problem

A company makes two machines, A and B.


Either 28 A or 14 B machines can be made daily.
Either 14 A or 24 B machines can be sold daily.
No more than 16 machines can be shipped out daily.
There is a profit of $400 on each A machine and $600 on
each B machine.
How many A and B machines should be made daily to
maximize the profit?

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Problem Formulation
Design variables:
x1 = No. of A machines made daily
x2 = No. of B machines made daily
Criterion to be optimized:
P = 400 x1 + 600 x2
Manufacturing constraint:
Sales constraint:
Shipping constraint:

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Plot the Constraints

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Plot the Constraints - Combined

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Plot Objective Function Contours


Plot 400 * x_1 + 600 * x_2, 0 <= x_1 <= 18 and 0 <= x_2 <= 18

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Constraints 3 and 4 are non-binding


Increasing their capability does result in a higher optimum
Constraints 1 and 2 are binding
Increasing these constraints would result in a higher optimum

12
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Possible outcomes that can be generally obtained


in a linear programming problem/
1. Unique solution. The maximum objective
function intersects a single point.
2. Alternate solutions. Problem has an infinite
number of optima corresponding to a line
segment.
3. No feasible solution.
4. Unbounded problems. Problem is underconstrained and therefore open-ended.
13
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Figure 15.2

14
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

The Simplex Method/


Assumes that the optimal solution will be an
extreme point.
The approach must discern whether during
problem solution an extreme point occurs.
To do this, the constraint equations are
reformulated as equalities by introducing slack
variables.

15
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

A slack variable measures how much of a constrained resource


is available, e.g.,
7x1+ 11 x2 77
If we define a slack variable S1 as the amount of raw gas that
is not used for a particular production level (x1, x2) and add it
to the left side of the constraint, it makes the relationship
exact.
7x1+ 11 x2 + S1 = 77
If the slack variable is positive, it means that we have some
slack that is we have some surplus that is not being used.
If it is negative, it tells us that we have exceeded the
constraint.
If it is zero, we have exactly met the constraint. We have used
up all the allowable resource.
16
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Maximize
Z 150 x1 175 x2
7 x1 11x2 S1
10 x1 8 x2

77
80

S2
S3

x1
x2

S4

9
6

x1 , x 2 , S1 , S 2 , S 3 , S 4 0
17
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

We now have a system of linear algebraic equations.


For even moderately sized problems, the approach
can involve solving a great number of equations. For
m equations and n unknowns, the number of
simultaneous equations to be solved are:

n!
C
m!(n m)!
n
m

18
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Figure 15.3

19
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Simplex Method
Solving LP problem algebraically using an iterative
procedure (Gaussian elimination with pivoting)
Searching among the basic feasible solutions (corner
feasible solutions) to reduce the cost function
continuously until an optimum solution is reached.
The keys are
1) Find a search direction that would reduce the cost
2) Restrict the search to corner solutions that are
feasible.
3) This is achieved by pivoting in the Gaussian
elimination process.

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Simplex Method by Example


Maximize P = 10x + 12y subject to the
constraints:
x + y 40
(i)
x + 2y 75
(ii)
x 0, y 0.
Step 1: Introduce slack variables to convert
the non-trivial inequalities into equalities:
Equation (i): x + y + s = 40
s0
Equation (ii): x + 2y + t = 75 t 0
s, t are slack variables.
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Simplex Example
Step 2: Rewrite the profit function into a cost
function
P = 10x + 12y 10x 12y = f
So we have
-10x - 12y + 0s + 0t = 1f
1x + 1y + 1s + 0t = 40
1x + 2y + 0s + 1t = 75

Step 3: Write the cost function and the nontrivial constraints in tableau format:

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Tableau Format
-10x - 12y + 0s + 0t = 1f
1x + 1y + 1s + 0t = 40

We have 3 equations and 5 variables


2 of the variables must be set to 0
Start with x=y=0, i.e. starting at the origin

1x + 2y + 0s + 1t = 75

Goal: solve the equations by combining


rows together.
The solution is reached when all entries in
the first row (except possibly the value in
the last column) are non-negative.
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Last
column

The shaded
cells should be
non-negative

Find Pivotal Column


Pivotal column

s, t are basic variables; x, y are nonbasic variables.


We begin by identifying the most negative entry in the cost
function row, here -12 in the y column.

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Find the Pivotal Row


We then divide every entry in the b column by the
corresponding value in the highlighted pivotal column.
Pick the least positive of these. This is the pivotal row.
Pivotal column

pivot
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Gaussian Elimination: swap y and t

The goal is to convert y into a basic variable


and convert t into a nonbasic variable.
This means that the y-column must be [0 0 1] T
This is done using Gaussian elimination with 2
as the pivot (i.e. combining rows to eliminate
the variable y from the first two equations).
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Divide the pivotal row by the pivot value.


The aim is to now get 0 entries elsewhere in the pivotal
column.

x
-4

y
0
0
1

s
0
1
0

t
6
-

Equation

f+450 (4)=(1)+12(6)
2.5
(5) = (2) (6)
(6) = (3)/2
37.5

Ratio
2.5/0.5 = 5
37.5/0.5 = 75

Now repeat the process, first selecting the new pivotal


column, i.e. the one with the most negative value in the
cost function row.
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Having identified the pivot element, we now


divide every entry in the pivotal row by the pivot value.

The process is now finished as every coefficient of the


cost function is non-negative.
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Optimal Solution

The basic feasible solution is obtained by


setting s=t=0, i.e., x= 5, y = 35.
From the cost function row, we obtain:
8s+2t = f + 470 (s=t =0)
So finally, we obtain f = -470.
Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Compared to Graphical Solution

x + 2y = 75
x + y = 40

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Você também pode gostar