Sie sind auf Seite 1von 48

Linear

Programming
Wan Jian Hau 1401100059
Ye Bing Quan 1401000035
Low Sze Hui 1001233038
What is Linear Programming?

Many management decisions involve trying to make
the most effective use of limited resources
Machinery, labor, money, time, warehouse space, raw
materials

The adjective linear means that all the mathematical
functions in this model are required to be linear
functions.

Linear programming (LP) is a widely used mathematical
modeling technique designed to help managers in
planning and decision making relative to resource
allocation

Requirements of LP
All LP problems have 4 properties in
common:
1. All problems seek to maximize or minimize some
quantity (the objective function)
2. The presence of restrictions or constraints that
limit the degree to which we can pursue our
objective
3. There must be alternative courses of action to
choose from
4. The objective and constraints in problems must
be expressed in terms of linear equations or
inequalities


Illustration:

Maximize: Z = 3x
1
+ 5x
2

Subject to restrictions:
x
1
< 4
2x
2
< 12
3x
1
+ 2x
2
< 18

Non negativity condition
x
1
> 0
x
2
> 0




Objective
Function
Functional
Constraints
Non-negativity
constraints
Assumption in LP
We assume conditions of certainty exist and
numbers in the objective and constraints are
known with certainty and do not change
during the period being studied
We assume proportionality exists in the
objective and constraints
We assume additivity in that the total of all
activities equals the sum of the individual
activities
We assume divisibility in that solutions need
not be whole numbers
All answers or variables are nonnegative


Ikea Furniture Company
The Ikea Furniture Company produces
inexpensive tables and chairs
Processes are similar in that both require a certain
amount of hours of carpentry work and in the
painting and varnishing department
Each table takes 4 hours of carpentry and 2 hours
of painting and varnishing
Each chair requires 3 of carpentry and 1 hour of
painting and varnishing
There are 240 hours of carpentry time available
and 100 hours of painting and varnishing
Each table yields a profit of $70 and each chair a
profit of $50

The company wants to determine the
best combination of tables and chairs to
produce to reach the maximum profit

The objective is to
Maximize profit
The constraints are
1. The hours of carpentry time used cannot
exceed 240 hours per week
2. The hours of painting and varnishing time
used cannot exceed 100 hours per week
The decision variables representing the
actual decisions we will make are
T = number of tables to be produced per
week
C = number of chairs to be produced per
week

We create the LP objective function in
terms of T and C
Maximize profit = $70T + $50C
Develop mathematical relationships for
the two constraints
For carpentry, total time used is
(4 hours per table)(Number of tables
produced)
+ (3 hours per chair)(Number of chairs
produced)
We know that
Carpentry time used Carpentry time
available
4T + 3C 240 (hours of carpentry time)

The values for T and C must be nonnegative
T 0 (number of tables produced is greater
than or equal to 0)
C 0 (number of chairs produced is greater
than or equal to 0)
The complete problem stated mathematically
Maximize profit = $70T + $50C
subject to
4T + 3C 240 (carpentry constraint)
2T + 1C 100 (painting and varnishing constraint)
T, C 0 (nonnegativity constraint)
100

80

60

40

20


C
| | | | | | | | | | | |
0 20 40 60 80 100
T
N
u
m
b
e
r

o
f

C
h
a
i
r
s

Number of Tables
This Axis Represents the Constraint T 0
This Axis Represents the
Constraint C 0
When Flair produces no tables, the
carpentry constraint is
4(0) + 3C = 240
3C = 240
C = 80
Similarly for no chairs
4T + 3(0) = 240
4T = 240
T = 60
This line is shown on the following graph

100

80

60

40

20


C
| | | | | | | | | | | |
0 20 40 60 80 100
T
N
u
m
b
e
r

o
f

C
h
a
i
r
s

Number of Tables
(T = 0, C = 80)
(T = 60, C = 0)
Graph of carpentry constraint equation
100

80

60

40

20


C
| | | | | | | | | | | |
0 20 40 60 80 100
T
N
u
m
b
e
r

o
f

C
h
a
i
r
s

Number of Tables
Any point on or below the constraint
plot will not violate the restriction
Any point above the plot will violate
the restriction
(30, 40)
(30, 20)
(70, 40)
100

80

60

40

20


C
| | | | | | | | | | | |
0 20 40 60 80 100
T
N
u
m
b
e
r

o
f

C
h
a
i
r
s

Number of Tables
(T = 0, C = 100)
(T = 50, C = 0)
Graph of painting and varnishing
constraint equation
100

80

60

40

20


C
| | | | | | | | | | | |
0 20 40 60 80 100
T
N
u
m
b
e
r

o
f

C
h
a
i
r
s

Number of Tables
Feasible solution region for Ikea Furniture
Painting/Varnishing Constraint
Carpentry Constraint
Feasible
Region
100

80

60

40

20


C
| | | | | | | | | | | |
0 20 40 60 80 100
T
N
u
m
b
e
r

o
f

C
h
a
i
r
s

Number of Tables
Four corner points of
the feasible region
1
2
3
4
3
1
2
4
Point : (T = 0, C = 0) Profit = $70(0) + $50(0) = $0
Point : (T = 0, C = 80) Profit = $70(0) + $50(80) = $4,000
Point : (T = 50, C = 0) Profit = $70(50) + $50(0) = $3,500
Point : (T = 30, C = 40) Profit = $70(30) + $50(40) = $4,100
Because Point returns the highest profit, this is
the optimal solution
To find the coordinates for Point accurately
we have to solve for the intersection of the two
constraint lines
3
3
Using the simultaneous equations method, we multiply the
painting equation by 2 and add it to the carpentry
equation
4T + 3C = 240 (carpentry line)
4T 2C = 200 (painting line)
C = 40
Substituting 40 for C in either of the original
equations allows us to determine the value of T
4T + (3)(40) = 240 (carpentry line)
4T + 120 = 240
T = 30
Four Special Cases in LP
Four special cases and difficulties
arise at times when using the
graphical approach to solving LP
problems
Infeasibility
Unboundedness
Redundancy
Alternate Optimal Solutions

A problem with infeasibility
8

6

4

2

0
X
2

| | | | | | | | | |
2 4 6 8
X
1

Region Satisfying First Two Constraints
Region Satisfying
Third Constraint
A solution region unbounded to the right
15
10
5
0
X
2

| | | | |
5 10 15
X
1

Feasible Region
X
1
5
X
2
10
X
1
+ 2X
2
15
A problem with
a redundant
constraint
30
25
20
15
10
5
0
X
2

| | | | | |
5 10 15 20 25 30
X
1

Redundant
Constraint
Feasible
Region
X
1
25
2X
1
+ X
2
30
X
1
+ X
2
20
Example of
alternate
optimal
solutions
8
7
6
5
4
3
2
1
0
X
2

| | | | | | | |
1 2 3 4 5 6 7 8
X
1

Feasible
Region
Isoprofit Line for $8
Optimal Solution Consists of All
Combinations of X
1
and X
2
Along
the AB Segment
Isoprofit Line for $12
Overlays Line Segment AB
B
A
Simplex Linear Programming
With only two decision variables it is possible to
use graphical methods to solve LP problems
But most real life LP problems are too complex
for simple graphical procedures
We need a more powerful procedure called
the simplex method
The simplex method examines the corner points
in a systematic fashion using basic algebraic
concepts
It does this in an iterative manner until an
optimal solution is found
Each iteration moves us closer to the optimal
solution

Lets look at the Ikea Furniture Company
This time well use the simplex method to solve
the problem
T = number of tables produced
C = number of chairs produced
Maximize profit = $70T + $50C (objective function)
subject to 2T + 1C 100 (painting hours constraint)
4T + 3C 240 (carpentry hours constraint)
T, C 0 (nonnegativity constraint)
and
The inequality constraints must be converted into
equations
Less-than-or-equal-to constraints () are
converted to equations by adding a slack
variable to each
Slack variables represent unused resources
For the Ikea Furniture problem, the slacks are
S
1
= slack variable representing unused hours
in the painting department
S
2
= slack variable representing unused hours
in the carpentry department
The constraints may now be written as
2T + 1C + S
1
= 100
4T + 3C + S
2
= 240
If the optimal solution uses less than the
available amount of a resource, the unused
resource is slack
For example, if Ikea produces T = 40 tables and
C = 10 chairs, the painting constraint will be

2T + 1C + S
1
= 100
2(40) +1(10) + S
1
= 100
S
1
= 10

There will be 10 hours of slack, or unused
painting capacity
Each slack variable must appear in every
constraint equation
Slack variables not actually needed for an
equation have a coefficient of 0
So
2T + 1C + 1S
1
+ 0S
2
= 100
4T + 3C + 0S
1
+ 1S
2
= 240
T, C, S
1
, S
2
0
The objective function becomes

Maximize profit = $70T + $50C + $0S
1
+ $0S
2
Constraint equations
It simplifies handling the LP equations if we put
them in tabular form
These are the constraint equations for the Flair
Furniture problem
SOLUTION MIX T C S
1
S
2

QUANTITY
(RIGHT-HAND SIDE)
S
1
2 1 1 0 100
S
2
4 3 0 1 240
Five Steps of the Simplex Method for
Maximization Problems
1. Determine the variable to enter the solution mix
next. One way of doing this is by identifying the
column, and hence the variable, with the largest
positive number in the C
j
- Z
j
row of the preceding
tableau. The column identified in this step is called
the pivot column.
2. Determine which variable to replace. This is
accomplished by dividing the quantity column by
the corresponding number in the column selected
in step 1. The row with the smallest nonnegative
number calculated in this fashion will be replaced
in the next tableau. This row is often referred to as
the pivot row. The number at the intersection of the
pivot row and pivot column is the pivot number.
Five Steps of the Simplex Method for
Maximization Problems
3. Compute new values for the pivot row. To do this, we
simply divide every number in the row by the pivot
column.
4. Compute the new values for each remaining row. All
remaining rows are calculated as follows:

(New row numbers) = (Numbers in old row)
Number
above or
below
pivot number
Corresponding number in
the new row, that is, the
row replaced in step 3
x
The first tableau is is called a simplex tableau
C
j

SOLUTION
MIX
$70
T
$50
C
$0
S
1

$0
S
2

QUANTITY
$0 S
1
2 1 1 0 100
$0 S
2
4 3 0 1 240
Z
j
$0 $0 $0 $0 $0
C
j
- Z
j
$70 $50 $0 $0 $0
Profit per
unit row
Constraint
equation rows
Gross
profit row
Net profit row
We can now apply these steps to the Ikea Furniture
problem
Step 1. Select the variable with the largest positive C
j
-
Z
j
value to enter the solution next. In this case, variable
T with a contribution value of $70.
C
j
$70 $50 $0 $0
SOLUTION
MIX
T C S
1
S
2

QUANTITY
(RHS)
$0 S
1
2 1 1 0 100
$0 S
2
4 3 0 1 240
Z
j
$0 $0 $0 $0 $0
C
j
- Z
j
$70 $50 $0 $0
Pivot column
total profit
Step 2. Select the variable to be replaced. Either S
1

or S
2
will have to leave to make room for T in the
basis. The following ratios need to be calculated.
tables 50
table) per required 2(hours
available) time painting of 100(hours

For the S
1
row

tables 60
table) per required 4(hours
available) time carpentry of 240(hours

For the S
2
row

We choose the smaller ratio (50) and this
determines the S
1
variable is to be replaced. This
corresponds to point D on the graph in Figure 9.2.
C
j
$70 $50 $0 $0
SOLUTION
MIX
T C S
1
S
2

QUANTITY
(RHS)
$0 S
1
2 1 1 0 100
$0 S
2
4 3 0 1 240
Z
j
$0 $0 $0 $0 $0
C
j
- Z
j
$70 $50 $0 $0
Pivot column
Pivot row
Pivot number
Step 3. We can now begin to develop the second,
improved simplex tableau. We have to compute a
replacement for the pivot row. This is done by
dividing every number in the pivot row by the pivot
number. The new version of the pivot row is below.
1
2
2
5 0
2
1
.
5 0
2
1
.
*

0
2
0
50
2
100

C
j
SOLUTION MIX T C S
1
S
2
QUANTITY
$70 T 1 0.5 0.5 0 50
Step 4. Completing the rest of the tableau, the S
2

row, is slightly more complicated. The right of the
following expression is used to find the left side.
Number in
New S
2
Row
=
Number in
Old S
2
Row

Number Below
Pivot Number

Corresponding Number
in the New T Row
0 = 4 (4) (1)
1 = 3 (4) (0.5)
2 = 0 (4) (0.5)
1 = 1 (4) (0)
40 = 240 (4) (50)
C
j
SOLUTION MIX T C S
1
S
2
QUANTITY
$70 T 1 0.5 0.5 0 50
$0 S
2
0 1 2 1 40
Step 5. The final step of the second iteration is to
introduce the effect of the objective function. This
involves computing the C
j
- Z
j
rows. The Z
j
for the
quantity row gives us the gross profit and the other
Z
j
represent the gross profit given up by adding one
unit of each variable into the solution.
Z
j
(for T column) = ($70)(1) + ($0)(0) = $70
Z
j
(for C column) = ($70)(0.5) + ($0)(1) = $35
Z
j
(for S
1
column) = ($70)(0.5) + ($0)(2) = $35
Z
j
(for S
2
column) = ($70)(0) + ($0)(1) = $0
Z
j
(for total profit) = ($70)(50) + ($0)(40) = $3,500
Completed second simplex tableau
C
j
$70 $50 $0 $0
SOLUTION
MIX T C S
1
S
2

QUANTITY
(RHS)
$70 T 1 0.5 0.5 0 50
$0 S
2
0 1 2 1 40
Z
j
$70 $35 $35 $0 $3,500
C
j
- Z
j
$0 $15 $35 $0
COLUMN
T C S
1
S
2
C
j
for column $70 $50 $0 $0
Z
j
for column $70 $35 $35 $0
C
j
Z
j
for column $0 $15 $35 $0
Since the previous tableau is not optimal, we
repeat the five simplex steps
Step 1. Variable C will enter the solution as its C
j
- Z
j
value of 15
is the largest positive value. The C column is the new pivot
column.
Step 2. Identify the pivot row by dividing the number in the
quantity column by its corresponding substitution rate in the C
column.
chairs 100
5 0
50
row the For
.
: T
chairs 40
1
40
row the For
2
: S
These ratios correspond to the values of C at points F and C. The
S
2
row has the smallest ratio so S
2
will leave the basis and will be
replaced by C.
C
j
$70 $50 $0 $0
SOLUTION
MIX
T C S
1
S
2
QUANTITY
$70 T 1 0.5 0.5 0 50
$0 S
2
0 1 2 1 40
Z
j
$70 $35 $35 $0 $3,500
C
j
- Z
j
$0 $15 $35 $0
Pivot column
Pivot row
Pivot number
Step 3. The pivot row is replaced by dividing every number in it by the
pivot point number
0
1
0
1
1
1
2
1
2

1
1
1
40
1
40

The new C row is


C
j
SOLUTION MIX T C S
1
S
2
QUANTITY
$50 C 0 1 2 1 40
Step 4. The new values for the T row may now be computed
Number in
new T row
=
Number in
old T row

Number above
pivot number

Corresponding number
in new C row
1 = 1 (0.5) (0)
0 = 0.5 (0.5) (1)
1.5 = 0.5 (0.5) (2)
0.5 = 0 (0.5) (1)
30 = 50 (0.5) (40)
C
j
SOLUTION MIX T C S
1
S
2
QUANTITY
$70 T 1 0 1.5 0.5 30
$50 C 0 1 2 1 40
Step 5. The Z
j
and C
j
- Z
j
rows can now be calculated
Z
j
(for T column) = ($70)(1) + ($50)(0) = $70
Z
j
(for C column) = ($70)(0) + ($50)(1) = $50
Z
j
(for S
1
column) = ($70)(1.5) + ($50)(2) = $5
Z
j
(for S
2
column) = ($70)(0.5) + ($50)(1) = $15
Z
j
(for total profit) = ($70)(30) + ($50)(40) = $4,100
And the net profit per unit row is now
COLUMN
T C S
1
S
2
C
j
for column $70 $50 $0 $0
Z
j
for column $70 $50 $5 $15
C
j
Z
j
for column $0 $0 $5 $15
Note that every number in the C
j
- Z
j
row is 0 or
negative indicating an optimal solution has been
reached
The optimal solution is
T = 30 tables
C = 40 chairs
S
1
= 0 slack hours in the painting department
S
2
= 0 slack hours in the carpentry department
profit = $4,100 for the optimal solution
Surplus and Artificial Variables
Greater-than-or-equal-to () constraints are
just as common in real problems as less-than-
or-equal-to () constraints and equalities
To use the simplex method with these
constraints, they must be converted to a
special form similar to that made for the less-
than-or-equal-to () constraints
If they are not, the simplex technique is
unable to set up an initial solution in the first
tableau
Consider the following two constraints
Constraint 1: 5X
1
+ 10X
2
+ 8X
3
210
Constraint 2: 25X
1
+ 30X
2
= 900

Surplus and Artificial Variables
To resolve this we add in another variable called an
artificial variable
210 8 10 5 completed 1 Constraint
1 1 3 2 1
A S X X X :
Now X
1
, X
2
, X
3
, and S
1
can all be 0 in the initial solution and
A
1
will equal 210
The same situation applies in equality constraint equations
as well
900 30 25 rewritten 2 Constraint
2 2 1
A X X :

Das könnte Ihnen auch gefallen