Sie sind auf Seite 1von 28

Chapter 8

Linear programming is used to allocate


resources, plan production, schedule
workers, plan investment portfolios and
formulate marketing (and military)
strategies. The versatility and economic
impact of linear programming in todays
industrial world is truly awesome.--Eugene
Lawler

Linear Programming
1

What is a Linear Program?


A linear program is a mathematical model
that indicates the goal and requirements of
an allocation problem.
It has two or more non-negative variables.
Its objective is expressed as a mathematical
function. The objective function plots as a
line on a two-dimensional graph.
There are constraints that affect possible
levels of the variables. In two dimensions
these plot as lines and ordinarily define
areas in which the solution must lie.
2

Redwood Furniture
Problem Formulation
Let XT and XC denote the number of tables and
chairs to be made. (Define variables)
Maximize P = 6XT + 8XC (Objective function)
Subject to: (Constraints)
30XT + 20XC < 300 (wood)
5XT + 10XC < 110 (labor)
where XT and XC > 0 (non-negativity conditions)
Letting XT represent the horizontal axis and XC the
vertical, the constraints and non-negativity
conditions define the feasible solution region.
3

Feasible Solution Region for


Redwood Furniture Problem

Graphing to Find Feasible


Solution Region
For an inequality constraint (with < or >),
first plot as a line: 30XT + 20XC = 300.
Get two points. Intercepts are easiest:
Set XC = 0, solve for XT for horizontal intercept:
30XT + 20(0) = 300 => XT = 300/30 = 10
Set XT = 0, solve for XC for vertical intercept:
30(0) + 20XC = 300 => XC = 300/20 = 15

Above gets wood line. Do same for labor.


Mark valid sides and shade feasible solution
region. Any point there satisfies all
5
constraints and non-negativity conditions.

Graphing to Find Feasible


Solution Region
To establish valid side, pick a test point
(usually the origin). If that point satisfies
the constraint, all points on same side are
valid. Otherwise, all points on other side
are instead valid.
Equality constraints have no valid side. The
solution must be on the line itself.
Some constraint lines are horizontal or
vertical. These involve only one variable
and one intercept.
6

Finding Most Attractive Corner


The optimal solution will always correspond to a
corner point of the feasible solution region.
Because there can be many corners, the most
attractive corner is easiest to find visually.
That is done by plotting two P lines for arbitrary
profit levels.
Since the P lines will be parallel, just hold your
pencil at the same angle and role it in from the
smaller Ps line toward the bigger ones That is
the direction of improvement.
Continue rolling until only one point lies beneath
the pencil. That is the most attractive corner.
(Problems can have two most attractive corners.)
7

Most Attractive Corner for


Redwood Furniture Problem

Finding the Optimal Solution


The coordinates of the most attractive
corner provide the optimal levels.
Because reading from graph may be
inaccurate, it is best to solve algebraically.
Simultaneously solving the wood and labor
equations, the optimal solution is:
XT = 4 tables
XC = 9 chairs
P = 6(4) + 8(9) = 96 dollars

Note: supply the computed level of the


objective in reporting the optimal solution.
9

Advice for Solving Linear


Programs
The most attractive corner need not be
where the two lines cross. Verify by
doubling the table profit. Then the P lines will
be steeper, and (XT = 10, XC = 0) would be best.
doubling instead the chair profit. The P lines
will be flatter, and (XT = 0, XC = 11) is best.

Problems can have more than 2 constraints.


The objective function can involve negative
coefficients.
10

Therefore, the better Ps may not lie to the right.


Use 2 lines to guarantee getting right direction.

Minimizing Cost:
Feed-Mix Problem
Let XB and XS denote pounds of buckwheat
and sunflower in mixture.
Minimize C=.18XB + .10XS
Subject to: .04XB + .06XS > 480 (fat)
.12XB + .10XS > 1,200 (prot.)
.10XB + .15XS < 1,500 (rough.)
where
XB, XS > 0
The optimal solution is:
11

XB = 3,750 pounds
XS = 7,500 pounds
C = .18(3,750) + .10(7,500) = 1,425 dollars

Minimizing Cost:
Feed-Mix Problem

12

Other Constraint Types


Resources: amount used < available level.
Requirements: quan. > minimum (< max.).
XT > 5 (demand)

XC < 5 (capacity)

Mixture: product > (or <) multiple of other.


XC > 4XT (at least 4 chairs per table made)
XB < .5XS (buckw. not exceed 1/2 wt of sunfl.)
Transform before plotting:
XC 4XT > 0

XB .5XS < 0

Equality: XT + XC = 10 (exactly 10 items)


13

Special Problem Types


Infeasible Problems: These arise from
contradictions among the constraints. No
solution possible until conflict is resolved.
Ties for optimal solution: Multiple optimal
solutions can exist. Any linear combination
of two optimal corners is also optimal.
Unbounded problems: Feasible solution
regions may be open-ended, and the
direction of improvement coincides.

14

Mathematically, any profit is possible.


Generally nonsensical, possibly due to a
missing constraint. Fix and solve again.

Graphing Linear Programs


Using Spreadsheets
The Redwood Furniture Company
Maximize
P = 6XT + 8XC
Subject to
30XT + 20XC
5XT + 10XC
where
XT, XC

15

(objective)
< 300 (wood)
< 110 (labor)
>0

First Step
The Formulas
The first step is to solve the
objective function and each constraint
for one of the variables. In this case,
solving for XC gives

16

XC = (P - 6XT)/8

(objective)

XC = (300 - 30XT)/20

(wood)

XC = (110 - 5XT)/10

(labor)

These formulas are entered on the

Second Step
The Spreadsheet (Figure 8-18)
A

R e d w o o d F u rn it u r e C o m p a n y

1
2
3

P ro f it

48

W ood

300

Labor

110

6
7
8
9

C h a irs , X
T a b le s , X

W ood
15
1 3 .5

Labor
11
1 0 .5

W ood

Labor

P r o f it

T a b le s , X

= ($ B $ 4 -3 0 * A 9 ) /2 0

5 .2 5

10

= ($ B $ 4 -3 0 * A 1 0 ) /2 0 = ($ B $ 5 -5 * A 1 0 ) /1 0

= ($ B $ 3 -6 * A 1 0 ) /8

P ro f it
6

= ($ B $ 5 -5 * A 9 ) /1 0

= ( $ B $ 3 - 6 * A 9 ) /8

10

11

12

10

4 .5

11

= ($ B $ 4 -3 0 * A 1 1 ) /2 0 = ($ B $ 5 -5 * A 1 1 ) /1 0

= ($ B $ 3 -6 * A 1 1 ) /8

12

1 0 .5

9 .5

3 .7 5

12

= ($ B $ 4 -3 0 * A 1 2 ) /2 0 = ($ B $ 5 -5 * A 1 2 ) /1 0

= ($ B $ 3 -6 * A 1 2 ) /8

13

13

= ($ B $ 4 -3 0 * A 1 3 ) /2 0 = ($ B $ 5 -5 * A 1 3 ) /1 0

= ($ B $ 3 -6 * A 1 3 ) /8

14

7 .5

8 .5

2 .2 5

14

= ($ B $ 4 -3 0 * A 1 4 ) /2 0 = ($ B $ 5 -5 * A 1 4 ) /1 0

= ($ B $ 3 -6 * A 1 4 ) /8

15

1 .5

15

= ($ B $ 4 -3 0 * A 1 5 ) /2 0 = ($ B $ 5 -5 * A 1 5 ) /1 0

= ($ B $ 3 -6 * A 1 5 ) /8

16

4 .5

7 .5

0 .7 5

16

= ($ B $ 4 -3 0 * A 1 6 ) /2 0 = ($ B $ 5 -5 * A 1 6 ) /1 0

= ($ B $ 3 -6 * A 1 6 ) /8

17

17

= ($ B $ 4 -3 0 * A 1 7 ) /2 0 = ($ B $ 5 -5 * A 1 7 ) /1 0

= ($ B $ 3 -6 * A 1 7 ) /8

18

1 .5

6 .5

-0 .7 5

18

= ($ B $ 4 -3 0 * A 1 8 ) /2 0 = ($ B $ 5 -5 * A 1 8 ) /1 0

= ($ B $ 3 -6 * A 1 8 ) /8

19

10

-1 .5

19

10

= ($ B $ 4 -3 0 * A 1 9 ) /2 0 = ($ B $ 5 -5 * A 1 9 ) /1 0

= ($ B $ 3 -6 * A 1 9 ) /8

For example,
Cell B9: XC = ($B$4 - 30XT)/20 = ($B$4-30*A9)/20
Cell B10: XC = ($B$5 - 5XT)/10 = ($B$5-5*A9)/10
Cell B11: XC = ($B$3 - 30XT)/20 = ($B$3-30*A9)/20
17

Third Step
Graphing with the Chart Wizard
Highlight cells B8:D19 and click on the
chart icon.
Step 1 - Chart Type
Step 2 - Chart Source Data
Step 3 - Chart Options
Step 4 - Chart Location
18

Chart Wizard
Chart Type
Select
SelectLine
Line
as
asthe
theChart
Chart
type
typeand
andpick
pick
the
thefirst
first
Chart
Chartsubsubtype
type(Line)
(Line)
and
andclick
click
Next.
Next.

19

Chart Wizard
Sources of Data, Series Tab

20

Enter
Enterthe
the
horizontal
horizontalaxis
axis
values
valuesby
byclicking
clicking
on
onthe
theSeries
Seriestab
tab
and
andentering
enteringthe
the
range
rangeof
ofnumbers
numbers
to
tobe
beon
onthe
the
horizontal
horizontalaxis,
axis,
cells
cellsA:9:A19,
A:9:A19,in
in
the
theCategory
Category(X)
(X)
axis
axislabels
labelsline.
line.
Alternately,
Alternately,click
click
in
inthe
the Category
Category
(X)
(X)axis
axislabels
labelsline
line
and
andthen
thenhighlight
highlight
cells
cellsA9:A19.
A9:A19.
Click
ClickNext.
Next.

Chart Wizard
Chart Options
In
Inthe
theChart
Charttitle
titleline
linetype
typeRedwood
RedwoodFurniture
Furniture
Company,
Company,in
inthe
theCategory
Category(X)
(X)axis
axisput
putTables,
Tables,T,
T,and
andin
in
the
theValue
Value(Y)
(Y)axis
axisline
linewrite
writeChairs,
Chairs,C.
C. Click
ClickNext.
Next.

21

Chart Wizard
Chart Location
Click
Clickon
onFinish
Finishand
andthe
theChart
Chartshown
shownnext
nextappears.
appears.

22

Step Four
The Final Graph (Figure 8-19)
R

i t u

,
s

i r
a

- 2

- 4

l e

X
T

23

h
C

The
Thefinal
final
graph
graph
(after
(after
making
making
formatting
formatting
changes).
changes).

r o

f i t

The Graph with P = 96


(Figure 8-20)

i t

X
T

24

Increasing
Increasing
the
thenumber
number
in
incell
cellB3
B3
moves
movesthe
the
objective
objective
function
functionline
line
up
upand
andto
tothe
the
right.
right. This
This
graph
graphshow
show
the
theobjective
objective
function
functionfor
for
PP==96.
96.

r o

f i t

The Graph with P = 96 and 80 Hours


of Labor (Figure 8-21)

25

i t u

l a

i r

( P

To
Tosee
seewhat
what
happens
happenswhen
whenthe
the
amount
amountof
ofwood
woodor
or
labor
laborvary,
vary,change
change
the
thenumbers
numbersin
in
cells
cellsB4
B4(for
(forwood)
wood)
or
orB5
B5(for
(forlabor)
labor)
and
andthe
the
corresponding
correspondingline
line
will
willmove.
move. This
This
graph
graphshow
showthe
the
result
resultwhen
when80
80is
is
entered
enteredin
incell
cellB5
B5
(and
(andPP==96).
96).

l e

X
T

r o

f i t

Drawing Horizontal
and Vertical Lines
Drawing two types of lines with
Excel require special attention:
horizontal and vertical lines. The
constraint Y = 3 is a horizontal line
and the constraint X = 7 is a vertical
line. Figure 9-21 shows what an
Excel spreadsheet looks like for these
two constraints.
26

Spreadsheet for
Horizontal and Vertical Lines (Figure 8-22)
The
Thevertical
vertical
line
lineequation
equation
has
hasan
anYYintercept
interceptof
of
100,000
100,000and
and
aaslope
slopeof
of-(100,000/7).
(100,000/7).
Thus,
Thus,ititis
is
not
notexactly
exactly
vertical
verticalbut
butitit
is
issufficiently
sufficiently
close
closeto
to
vertical
verticalfor
for
our
our
purposes.
purposes.
27

G r a p h in g H o riz o n ta l a n d V e r tic a l L in e s

1
2
3

Y = 3

X = 7

100000

= 1 0 0 0 0 0 - (1 0 0 0 0 0 /7 ) * A 4

85714

= 1 0 0 0 0 0 - (1 0 0 0 0 0 /7 ) * A 5

71429

= 1 0 0 0 0 0 - (1 0 0 0 0 0 /7 ) * A 6

57143

= 1 0 0 0 0 0 - (1 0 0 0 0 0 /7 ) * A 7

42857

= 1 0 0 0 0 0 - (1 0 0 0 0 0 /7 ) * A 8

28571

= 1 0 0 0 0 0 - (1 0 0 0 0 0 /7 ) * A 9

10

14286

1 0

= 1 0 0 0 0 0 - ( 1 0 0 0 0 0 /7 ) * A 1 0

11

1 1

= 1 0 0 0 0 0 - ( 1 0 0 0 0 0 /7 ) * A 1 1

12

-1 4 2 8 6

1 2

= 1 0 0 0 0 0 - ( 1 0 0 0 0 0 /7 ) * A 1 2

13

-2 8 5 7 1

1 3

= 1 0 0 0 0 0 - ( 1 0 0 0 0 0 /7 ) * A 1 3

14

10

-4 2 8 5 7

1 4

= 1 0 0 0 0 0 - ( 1 0 0 0 0 0 /7 ) * A 1 4

15

Vertical Line Equation: Y = 100,000 (100,000/7)X

Graphing Horizonal
and Vertical Lines (Figure 8-23)
To
Tochange
changethe
the
position
positionof
ofthe
the
vertical
verticalline,
line,
change
changethe
the77in
in
the
the
denominator
denominatorof
of
all
allthe
the
formulas
formulasin
in
column
columnCCto
to
the
thedesired
desired
number.
number.

Plotting Horizontal and


Vertical Lines
10
8
Y

Y=3
X=7

4
2
0
0

6
X

28

10

Das könnte Ihnen auch gefallen