Linear Programming Introduction
Linear Programming Introduction
Linear Programming Introduction
Presentation: H. Sarper
1
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
Example
Giapetto’s, Inc., manufactures wooden
soldiers and trains.
Each soldier built:
• Sell for $27 and uses $19 worth of raw materials.
• Increase Giapetto’s variable labor/overhead costs by $14.
• Requires 2 hours of finishing labor.
• Requires 1 hour of carpentry labor.
Each train built:
• Sell for $21 and used $9 worth of raw materials.
• Increases Giapetto’s variable labor/overhead costs by $10.
• Requires 1 hour of finishing labor.
• Requires 1 hour of carpentry labor.
2
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
1
3.1 - What Is a Linear Programming Problem?
3
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
4
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
2
3.1 - What Is a Linear Programming Problem?
Weekly profit =
weekly revenue – weekly raw material costs – the weekly variable costs
Weekly profit =
(27x1 + 21x2) – (10x1 + 9x2) – (14x1 + 10x2 ) = 3x1 + 2x2
5
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
6
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
3
3.1 - What Is a Linear Programming Problem?
Constraint 1 Each week, no more than 100 hours of finishing time may be used.
Constraint 2 Each week, no more than 80 hours of carpentry time may be used.
Constraint 3 Because of limited demand, at most 40 soldiers should be produced.
Constraint 1: 2 x1 + x2 ≤ 100
Constraint 2: x1 + x2 ≤ 80
Constraint 3: x1 ≤ 40
7
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
8
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
4
3.1 - What Is a Linear Programming Problem?
9
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
For any linear function f(x1, x2, …, xn) and any number b, the
inequalities inequality f(x1, x2, …, xn) ≤ b and f(x1, x2, …, xn) ≥ b
are linear inequalities.
10
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
5
3.1 - What Is a Linear Programming Problem?
11
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
12
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
6
3.1 - What Is a Linear Programming Problem?
Divisibility Assumption
The divisibility assumption requires that each decision variable be
permitted to assume fractional values. For example, this
assumption implies it is acceptable to produce a fractional
number of trains. The Giapetto LP does not satisfy the
divisibility assumption since a fractional soldier or train cannot
be produced. Chapter 9 the use of integer programming
methods necessary to address the solution to this problem.
14
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
7
3.1 - What Is a Linear Programming Problem?
Feasible Region and Optimal Solution
15
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
Most LPs have only one optimal solution. However, some LPs have
no optimal solution, and some LPs have an infinite number of
solutions. Section 3.2 shows the optimal solution to the Giapetto LP
is x1 = 20 and x2 = 60. This solution yields an objective function
value of:
16
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
8
3.2 – Graphical Solution to a 2-Variable LP
graphically. We always
label the variables x1 and 3
Graphical Example:
The shaded area in the 1
2x1 + 3x2 ≤ 6 -1
17
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
Giapetto Constraints
2 x1 + x2 ≤ 100 (finishing constraint)
x1 + x2 ≤ 80 (carpentry constraint)
x1 ≤ 40 (demand constraint)
x1 ≥0 (sign restriction)
x2 ≥ 0 (sign restriction)
A graph of the constraints and feasible region is shown on the next slide.
18
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
9
3.2 – Graphical Solution to a 2-Variable LP
X2
From figure, we B
100
see that the set fin is h in g c o n s t r a in t F e a s ib le R e g io n
of points
satisfying the D
80
Giapetto LP is d e m a n d c o n s t r a in t
bounded by the
five sided
60
G
polygon
DGFEH. Any z = 100
point on or in 40 c a r p e n t r y c o n s t r a in t
the interior of
this polygon (the
20
F
shade area) is z = 180
in the feasible z = 60
region. H
E A C
10 20 40 50 60 80 X1
19
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
20
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
10
3.2 – Graphical Solution to a 2-Variable LP
X2
To find the optimal B
100
solution, graph a fin is h in g c o n s t r a in t F e a s ib le R e g io n
line on which the
D
points have the
80
same z-value. In a d e m a n d c o n s t r a in t
max problem, such
60
a line is called an G
F
isoprofit lines for z z = 180
21
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
intersecting fin is h in g c o n s t r a in t F e a s ib le R e g io n
(touching) the
D
feasible region
80
indicates the d e m a n d c o n s t r a in t
optimal solution
60
the Giapetto
problem, this z = 100
40
c a r p e n t r y c o n s t r a in t
occurs at point G
(x1 = 20, x2 = 60,
z = 180).
20
F
z = 180
z = 60
E A C
H
10 20 40 50 60 80 X1
22
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
11
3.2 – Graphical Solution to a 2-Variable LP
23
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
24
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
12
3.2 – Graphical Solution to a 2-Variable LP
Convex sets, Extreme Points, and LP
A set of points S is a convex set if the line segment jointing
any two pairs of points in S is wholly contained in S.
For any convex set S, a point p in S is an extreme point if
each line segment that lines completely in S and contains the
point P has P as an endpoint of the line segment.
Consider the figures (a) – (d) below:
A E B A B
A B
C D
(a) (b) (c) (d)
25
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
A B
C D
(a) (b) (c) (d)
26
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
13
3.2 – Graphical Solution to a 2-Variable LP
A E B A B
A B
C D
(a) (b) (c) (d)
27
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
28
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
14
3.2 – Graphical Solution to a 2-Variable LP
29
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
G
move isoprofit lines
in a northeast z = 100
direction, the largest
40
c a r p e n t r y c o n s t r a in t
z in the feasible
region occurs at
20
30
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
15
3.2 – Graphical Solution to a 2-Variable LP
X2
This means the B
100
optimal solution must
fin is h in g c o n s t r a in t F e a s ib le R e g io n
lie somewhere on
the boundary of the D
80
feasible region. The
d e m a n d c o n s t r a in t
LP must have an
extreme point that is
60
G
optimal, because for
any line segment on z = 100
the boundary of the 40 c a r p e n t r y c o n s t r a in t
31
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
32
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
16
3.2 – Graphical Solution to a 2-Variable LP
33
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
Problem Formulation
The decision variables are: x1 = number of 1-minute comedy ads
x2 = number of 1-minute football ads
34
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
17
3.2 – Graphical Solution to a 2-Variable LP
Like the Giapetto LP, X2
35
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
to minimize total 14 B
advertising costs, the
High-income women constraint
optimal solution to 12
36
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
18
3.2 – Graphical Solution to a 2-Variable LP
Because at point E, both X2
the high-income women
and high-income men 14 B
37
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
38
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
19
3.2 – Graphical Solution to a 2-Variable LP
The Giapetto and Dorian LPs each had a unique
optimal solution. Some types of LPs do not have
unique solutions.
39
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
Feasible Region
1 1
s.t. ⋅ x1 + ⋅ x2 ≤ 1
40 60 E
30
z = 100
1 1 z = 120
⋅ x1 + ⋅ x2 ≤ 1
20
50 50
x1 , x2 ≥ 0 z = 60
10
40
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
20
3.2 – Graphical Solution to a 2-Variable LP
Some LPs have no X2
60
solution. Consider the No Feasible Region
following formulation:
50
x1 >= 0
max z = 3x1 + 2x2
1 1
40
s.t. ⋅ x1 + ⋅ x2 ≤ 1
40 60
1 1 x2 >=0
30
⋅ x1 + ⋅ x2 ≤ 1
50 50
x 1 ≥ 30
20
x 2 ≥ 20
10
x1 , x2 ≥ 0
41
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
42
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
21
3.2 – Graphical Solution to a 2-Variable LP
43
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
22