Linear Programming Introduction

Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

Chapter 3

Introduction to Linear Programming


to accompany
Introduction to Mathematical Programming: Operations Research, Volume 1
4th edition, by Wayne L. Winston and Munirpallam Venkataramanan

Presentation: H. Sarper

1
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

3.1 - What Is a Linear Programming Problem?

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?

Each week Giapetto can obtain:


• All needed raw material.
• Only 100 finishing hours.
• Only 80 carpentry hours.
Also:
• Demand for the trains is unlimited.
• At most 40 soldiers are bought each week.

Giapetto wants to maximize weekly profit (revenues – expenses).


Formulate a mathematical model of Giapetto’s situation that can
be used maximize weekly profit.

3
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

3.1 - What Is a Linear Programming Problem?

The Giapetto solution model incorporates the characteristics


shared by all linear programming problems.

x1 = number of soldiers produced each week


Decision Variables
x2 = number of trains produced each week

Objective Function In any linear programming model, the


decision maker wants to maximize (usually revenue or profit) or
minimize (usually costs) some function of the decision variables.
This function to maximized or minimized is called the objective
function. For the Giapetto problem, fixed costs are do not depend
upon the the values of x1 or x2.

4
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

2
3.1 - What Is a Linear Programming Problem?

Giapetto’s weekly profit can be expressed in terms of the


decision variables x1 and x2:

Weekly profit =
weekly revenue – weekly raw material costs – the weekly variable costs

Weekly revenue = 27x1 + 21x2


Weekly raw material costs = 10x1 + 9x2
Weekly variable costs = 14x1 + 10x2

Weekly profit =
(27x1 + 21x2) – (10x1 + 9x2) – (14x1 + 10x2 ) = 3x1 + 2x2

5
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

3.1 - What Is a Linear Programming Problem?

Thus, Giapetto’s objective is to chose x1 and x2 to


maximize 3x1 + 2x2. We use the variable z to
denote the objective function value of any LP.
Giapetto’s objective function is:

Maximize z = 3x1 + 2x2

“Maximize” will be abbreviated by max and “minimize”


by min. The coefficient of an objective function
variable is called an objective function coefficient.

6
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

3
3.1 - What Is a Linear Programming Problem?

Constraints As x1 and x2 increase, Giapetto’s objective function


grows larger. For Giapetto, the values of x1 and x2 are limited by
the following three restrictions (often called constraints):

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.

These three constraints can be expressed mathematically by


the following equations:

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.

3.1 - What Is a Linear Programming Problem?

The coefficients of the constraints are often called the


technological coefficients. The number on the right-hand
side of the constraint is called the constraint’s right-hand
side (or rhs).

Sign Restrictions To complete the formulation of a linear


programming problem, the following question must be answered
for each decision variable: Can the decision variable only
assume nonnegative values, or is the decision variable allowed
to assume both positive and negative values?
If the decision variable can assume only nonnegative values,
the sign restriction xi ≥ 0 is added. If the variable can assume
both positive and negative values, the decision variable xi is
unrestricted in sign (often abbreviated urs).

8
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

4
3.1 - What Is a Linear Programming Problem?

For the Giapetto problem model, combining the sign restrictions


x1 ≥ 0 and x2 ≥ 0 with the objective function and constraints
yields the following optimization model:

Max z = 3x1 + 2x2 (objective function)


Subject to (s.t.)
2 x1 + x2 ≤ 100 (finishing constraint)
x1 + x2 ≤ 80 (carpentry constraint)
x1 ≤ 40 (constraint on demand for soldiers)
x1 ≥0 (sign restriction)
x2 ≥0 (sign restriction)

9
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

3.1 - What Is a Linear Programming Problem?

Concepts of linear function and linear inequality:

Linear Function: A function f(x1, x2, …, xn of x1, x2, …, xn is a


linear function if and only if for some set of constants, c1, c2, …,
cn, f(x1, x2, …, xn) = c1x1 + c2x2 + … + cnxn.

For example, f(x1,x2) = 2x1 + x2 is a linear function of x1 and x2,


but f(x1,x2) = (x1)2x2 is not a linear function of x1 and x2.

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?

A linear programming problem (LP) is an optimization


problem for which we do the following:

1. Attempt to maximize (or minimize) a linear function (called


the objective function) of the decision variables.

2. The values of the decision variables must satisfy a set of


constraints. Each constraint must be a linear equation or
inequality.

3. A sign restriction is associated with each variable. For each


variable xi, the sign restriction specifies either that xi must be
nonnegative (xi ≥ 0) or that xi may be unrestricted in sign.

11
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

3.1 - What Is a Linear Programming Problem?


Proportionality and Additive Assumptions
The fact that the objective function for an LP must be a linear
function of the decision variables has two implications:

1. The contribution of the objective function from each


decision variable is proportional to the value of the decision
variable. For example, the contribution to the objective
function for 4 soldiers is exactly fours times the contribution
of 1 soldier.
2. The contribution to the objective function for any variable
is independent of the other decision variables. For example,
no matter what the value of x2, the manufacture of x1 soldiers
will always contribute 3x1 dollars to the objective function.

12
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

6
3.1 - What Is a Linear Programming Problem?

Analogously, the fact that each LP constraint must be a


linear inequality or linear equation has two implications:

1. The contribution of each variable to the left-hand


side of each constraint is proportional to the value of
the variable. For example, it takes exactly 3 times as
many finishing hours to manufacture 3 soldiers as it
does 1 soldier.
2. The contribution of a variable to the left-hand side of
each constraint is independent of the values of the
variable. For example, no matter what the value of x1,
the manufacture of x2 trains uses x2 finishing hours and
x2 carpentry hours
13
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

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.

The Certainty Assumption


The certainty assumption is that each parameter (objective function
coefficients, right-hand side, and technological coefficients) are
known with certainty.

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

The feasible region of an LP is the set of all points satisfying all


the LP’s constraints and sign restrictions.

x1 = 40 and x2 = 20 are in the Giapetto Constraints


feasible region since they satisfy 2 x1 + x2 ≤ 100 (finishing constraint)
all the Giapetto constraints. x1 + x2 ≤ 80 (carpentry constraint)
On the other hand, x1 = 15, x2 = x1 ≤ 40 (demand constraint)
70 is not in the feasible region x1 ≥0 (sign restriction)
because this point does not x2 ≥ 0 (sign restriction)
satisfy the carpentry constraint
[15 + 70 is > 80].

15
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

3.1 - What Is a Linear Programming Problem?


For a maximization problem, an optimal solution to an LP is a point
in the feasible region with the largest objective function value.
Similarly, for a minimization problem, an optimal solution is a point
in the feasible region with the smallest objective function value.

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:

z = 3x1 + 2x2 = 3(20) + 2(60) = $180

When we say x1 = 20 and x2 = 60 is the optimal solution, we are


saying that no point in the feasible region has an objective function
value (profit) exceeding 180.

16
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

8
3.2 – Graphical Solution to a 2-Variable LP

Any LP with only two X2

variables can be solved 4

graphically. We always
label the variables x1 and 3

x2 and the coordinate 2x1 + 3x2 ≤ 6


axes the x1 and x2 axes.
2

Graphical Example:
The shaded area in the 1

graph are the set of


X1
points satisfying the
equation: -1 1 2 3 4

2x1 + 3x2 ≤ 6 -1

17
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

3.2 – Graphical Solution to a 2-Variable LP

Finding the Feasible Solution

Since the Giapetto LP has two variables, it may be solved graphically.


The feasible region is the set of all points satisfying the constraints:

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.

3.2 – Graphical Solution to a 2-Variable LP

Having identified the feasible region for


the Giapetto LP, a search can begin for
the optimal solution which will be the
point in the feasible region with the
largest z-value.

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

isoprofit line while


in a min problem, z = 100
40 c a r p e n t r y c o n s t r a in t
this is called the
isocost line. The
figure shows the
20

F
isoprofit lines for z z = 180

= 60, z = 100, and z = 60


E A C
z = 180 H
10 20 X1
40 50 60 80

21
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

3.2 – Graphical Solution to a 2-Variable LP


X2
The last isoprofit B
100

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

for the LP. For G

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

Binding and Nonbinding constraints


Once the optimal solution to an LP is found, it is
useful to classify each constraint as being a
binding or nonbinding constraint.

A constraint is binding if the left-hand and right-


hand side of the constraint are equal when the
optimal values of the decision variables are
substituted into the constraint. In the Giapetto
LP, the finishing and carpentry constraints are
binding.

23
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

3.2 – Graphical Solution to a 2-Variable LP

A constraint is nonbinding if the left-


hand side and the right-hand side of the
constraint are unequal when the optimal
values of the decision variables are
substituted into the constraint. In the
Giapetto LP, the demand constraint for
wooden soldiers is nonbinding since at
the optimal solution (x1 = 20), x1 < 40.

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.

3.2 – Graphical Solution to a 2-Variable LP


For example, in figures (a) and (b) below, each
line segment joining points in S contains only
points in S. Thus is convex for (a) and (b). In
both figures (c) and (d), there are points in the
line segment AB that are not in S. S in not
convex for (c) and (d).
A E B A B

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

In figure (a), each point on the circumference of


the circle is an extreme point of the circle. In
figure (b), A, B, C, and D are extreme points of
S. Point E is not an extreme point since E is not
an end point of the line segment AB.

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.

3.2 – Graphical Solution to a 2-Variable LP

Extreme points are sometimes called


corner points, because if the set S is a
polygon, the extreme points will be the
vertices, or corners, of the polygon.
The feasible region for the Giapetto LP
will be a convex set.

28
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

14
3.2 – Graphical Solution to a 2-Variable LP

It can be shown that:

• The feasible region for any LP will be a


convex set.

• The feasible region for any LP has only


a finite number of extreme points.

1. Any LP that has an optimal solution


has an extreme point that is optimal.

29
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

3.2 – Graphical Solution to a 2-Variable LP


X2
For the Giapetto B
100

problem, the optimal


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
solution (Point G)
must be any extreme D
80

point of the feasible


d e m a n d c o n s t r a in t
region. Since z
increases as we
60

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

some point P that F


z = 180
has no points in the z = 60
feasible region E A C
H
northeast of P. 10 20 40 50 60 80 X1

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

feasible area, the


largest z value on
20

that line segment F


z = 180
must be assumed at z = 60
be at one endpoints E A C
H
of the line segment. 10 20 40 50 60 80 X1

31
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

3.2 – Graphical Solution to a 2-Variable LP

A Graphical Solution to a Minimization Problem

Dorian Auto manufactures


luxury cars and trucks. The
company believes that its most
likely customers are high-
income women and men.

To reach these groups, Dorian Auto has embarked on


an ambitious TV advertising campaign and has decide to
purchase 1-mimute commercial spots on two type of
programs: comedy shoes and football games.

32
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

16
3.2 – Graphical Solution to a 2-Variable LP

• Each comedy commercial is seen by 7 million high


income women and 2 million high-income men.
• Each football game is seen by 2 million high-income
women and 12 million high-income men.
• A 1-minute comedy ad costs $50,000 and a 1-minute
football ad costs $100,000.
Dorian Auto would like for commercials to be seen by
at least 28 million high-income women and 24 million
high-income men.
Use LP to determine hoe Dorian Auto can meet its
advertising requirements at minimum cost.

33
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

3.2 – Graphical Solution to a 2-Variable LP

Problem Formulation
The decision variables are: x1 = number of 1-minute comedy ads
x2 = number of 1-minute football ads

Min z = 50 x1 + 100x2 (objective function in $1,000)


s.t. 7x1 + 2x2 ≥ 28 (high-income women)
2x1 + 12x2 ≥ 24 (high-income men)
x1, x2 ≥ 0 (non-negativity constraints)

A graph of the feasible area is show on the next slide.

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

The Dorian LP has a 14 B


convex feasible
High-income women constraint
region. The feasible 12

region for the Dorian


10
problem, however, Feasible
Region
contains points for 8
(unbounded)
which the value of at 6
least one variable can z = 600

assume arbitrarily 4 z = 320


High-income men constraint
large values. Such a
2 E
feasible region is D
A C
called an unbounded 2 4 6 8 10 12 14 X1
feasible region.

35
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

3.2 – Graphical Solution to a 2-Variable LP


Since Dorian wants X2

to minimize total 14 B
advertising costs, the
High-income women constraint
optimal solution to 12

the problem is the


10
point in the feasible Feasible
Region
region with the 8
(unbounded)
smallest z value. An 6
isocost line with the z = 600

smallest z value 4 z = 320


High-income men constraint
passes through point
2 E
E and is the optimal D
A C
solution at x1 = 3.4 2 4 6 8 10 12 14 X1
and x2 = 1.4.

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

constraints are satisfied, High-income women constraint


both constraints are 12
binding.
10
The Additivity Feasible
Assumption was used in 8
Region
(unbounded)
writing: total viewers =
comedy viewer ads + 6
football ad viewers. z = 600
Since many of the same 4 z = 320
people might view both High-income men constraint
ads, double-counting of 2
D
E
such people would occur A C
thereby violating the 2 4 6 8 10 12 14 X1
Additivity Assumption.

37
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

3.2 – Graphical Solution to a 2-Variable LP


If only 1-minute commercials are available, it is
unreasonable to say 3.6 comedy and 1.4 football
commercials should be purchased. So, the Divisibility
Assumption has been violated, and the Dorian LP
should, in reality, be considered as an integer
programming problem (Chapter 9).
Since there is no may of knowing with certainty of
knowing how many viewers are added with each type
of commercial, the Certainty Assumption is also
violated.

Despite these violations, analysts have used


similar models to help companies determine their
optimal media mix.

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.

• Some LPs have an infinite number of solutions


(alternative or multiple optimal solutions).

• Some LPs have no feasible solutions (infeasible


LPs).

• Some LPs are unbounded: There are points in the


feasible region with arbitrarily large (in a
maximization problem) z-values.

39
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

3.2 – Graphical Solution to a 2-Variable LP


Some LPs have an infinite X2
number of solutions. B
60

Consider the following


formulation: D
50

Feasible Region

max z = 3x1 + 2x2


40

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

Any point (solution) falling on A C


F
line segment AE will yield an 10 20 30 40 50 X1

optimal solution of z =120.

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

No feasible region exists 10 20 30 40 50 X1

41
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

3.2 – Graphical Solution to a 2-Variable LP

Some LPs are unbounded. For a


max problem, an unbounded LP
occurs if it is possible to find
points in the feasible region with
arbitrarily large z-values. This
corresponds to arbitrarily large max z = 2x1 – x2
profits or revenue.
s.t. x1 – x2 ≤ 1

For a minimization problem, an LP is 2x1 +x2 ≥ 6


unbounded if there are points in x1, x2 ≥ 0
the feasible region producing
arbitrarily small z-values.
Consider the formulation shown to
the right and the graph on the
next slide.

42
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

21
3.2 – Graphical Solution to a 2-Variable LP

The constraints are satisfied X2


Feasible Region
by all points bounded by the 6 D
x2 axis and on or above AB
and CD. The isoprofit lines 5 B
z=4
for z = 4 and z = 6 are
4
shown. Any isoprofit line
drawn will intersect the 3
feasible region because the
isoprofit line is steeper than 2
the line x1 – x2 = 1. Thus
z=6
there are points in the 1
feasible region which will
A C
produce arbitrarily large z-
1 2 3 4 5 6 X1
values (unbounded LP).

43
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.

22

You might also like