You are on page 1of 36

Decision System and Analysis

Linear Programming: model and characteristics

A.A.B. Dinariyana
Linear programming
o A linear programming (LP) is a tool for solving
optimization problems.
o The founders of the subject are Leonid Kantorovich, a
Russian mathematician who developed linear
programming problems in 1939.
o George Dantzig (1947) developed an efficient method,
simplex algorithm for solving LP.
o Since the development of the simplex algorithm, LP
proven to be one of the most effective operations
research tools.
o LP has been used to solve optimization problems in the
following areas: military, industry, agriculture,
transportation, economics, health systems, and even
behavioral and social sciences.

2
Linear programming
A linear programming problem (LP) is an optimization problem for which we
do the following:
o We attempt to maximize (or minimize) a linear function (called the objective
function) of the decision variables.
o The values of the decision variables must satisfy a set of constraints. Each
constraint must be a linear equation or linear inequality.
o A sign restriction is associated with each variable. For any variable xi, the
sign restriction specifies that xi must be either nonnegative (xi ≥ 0) or
unrestricted in sign (URS).

3
Concept of linear function and linear inequality

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

Thus, 2x1 + 3x2 ≤ 3 and 2x1 + x2 ≥ 3 are linear inequalities, but x1x2 ≥ 3 is
not a linear inequality
4
Example: Giapetto’s Woodcarving
o Giapetto’s Woodcarving, Inc., manufactures two types of wooden toys: soldiers
and trains.
• Each soldier built:
• Sells for $27 and uses $10 worth of raw materials.
• Labor and overhead costs by $14.
• A soldier requires 2 hours of finishing labor and 1 hour of carpentry labor.
• Each train built:
• Sells for $21 and uses $9 worth of raw materials.
• Labor and overhead costs by $10.
• A train requires 1 hour of finishing labor and 1 hour of carpentry labor.

o Each week, Giapetto can obtain all the needed raw material but only 100 finishing hours
and 60 carpentry hours.
o Demand for trains is unlimited, but at most 40 soldiers are bought each week.
o Giapetto wants to maximize weekly profit (revenues - costs).

Formulate a mathematical model of Giapetto’s situation that can be used to


maximize Giapetto’s weekly profit.
5
Example: Giapetto’s Woodcarving
In developing the Giapetto model, we explore characteristics shared by all linear
programming problems.

Decision Variables Constraints:


x1 = number of soldiers produced each week o Each week, no more than 100 hours of finishing time
x2 = number of trains produced each week may be used.
2x1 + x2 ≤ 100
o Each week, no more than 60 hours of carpentry time
Objective Function may be used.
Giapetto’s weekly revenues and costs can be x1 + x2 ≤ 60
expressed in terms of the decision variables x1 o Because of limited demand, at most 40 soldiers should
and x2 be produced.
x1 ≤ 40
Giapetto’s objective function is:

Maximize z = 3x1 + 2 x2

6
Nonnegativity/URS
To complete the formulation of a linear Complete optimization model for
programming problem, the following Giapetto’s Woodcarving:
question must be answered for each
decision variable:
Maximize z = 3x1 + 2x2 (objective function)
Can the decision variable only assume
nonnegative values, or is the decision variable Subject to (s.t.)
allowed to assume both positive and negative
values? 2x1 + x2 ≤ 100 (finishing constraint)
o If a decision variable xi can only assume x1 + x2 ≤ 60 (carpentry constraint)
nonnegative values, then we add the sign
restriction xi ≥ 0. x1 ≤ 40 (constraint on demand for soldiers)
o If a variable xi can assume both positive and x1 , x2 ≥ 0 (sign restriction)
negative (or zero) values, then we say that xi
is unrestricted in sign (often abbreviated urs).

7
Assumptions
o Objective function for an LP must be a linear function of the decision variables has two
implications:
• 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 four
times the contribution of 1 soldier.
• 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.

o Each LP constraint must be a linear inequality or linear equation has two implications:
• 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.
• 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.
8
Example: Gemstone Tool Company
o Privately-held firm
o Consumer and industrial market for construction tools
o Headquartered in Seattle
o Manufacturing plants in the US, Canada, and Mexico.
o Simplifying assumptions, for purposes of illustration:
• Winnipeg, Canada plant
• Wrenches and pliers.
• Made from steel
• Injection molding machine
• Assembly machine

9
Data and mathematical formulation for the GTC Problem
Step 1: Determine Decision Variables
Item Wrench Pliers Available W = number of wrenches manufactured
es P = number of pliers manufactured
Steel 1.5 1.0 15,000 lbs
Step 2: Determine Objective Function
Molding machine 1.0 1.0 12,000 hrs
Maximize Profit = 0.4 W + 0.3 P
Assembly machine 0.4 0.5 5,000 hrs Step 3: Determine Constraints

Demand limit 8,000 10,000 Steel: 1.5 W + P £ 15,000


Molding: W + P £ 12,000
Contribution ($ per $ 0.40 $ 0.30
Assembly: 0.4 W + 0.5 P £ 5,000
item)
Wrench Demand: 0 £ W £ 8,000
We want to determine the number of wrenches Plier Demand: 0 £ P £ 10,000
and pliers to produce given the available raw
materials, machine hours and demand.

10
Solution GTC using LINGO

11
Solution GTC using Excel Solver

12
Solution GTC using Excel Solver

13
Dealing with very large versions of the problem
n = number of items that are
manufactured
o Suppose that there are 10,000 products and
100 raw materials and processes that lead to e.g., in the previous example, n = 2;
constraints. m = number of resource constraints
o Technique used: write an “algebraic version e.g., m = 2, {molding, and assembly}
of the model”
Represent data in the previous example, using
letters that stand for the data. In practice, the
data is drawn from a table, and the letters refer
to the table, and the subscripts indicate the
position in the table.

o pj = unit profit from item j, e.g., p1 = .3;


o dj = maximum demand for item j;
o xj = number of units of item j manufactured

o bi = amount of resource i available


o aij = amount of resource i used in making item j

14
The graphical solution to a two-variable LP problem
o Any LP with only two Complete optimization model for
variables can be solved Giapetto’s Woodcarving:
graphically.
The variables are always labeled x1 Maximize z = 3x1 + 2x2 (objective function)
and x2 and the coordinate axes
the x1 and x2 axes. Subject to (s.t.)
o Since the Giapetto LP has two 2x1 + x2 ≤ 100 (finishing constraint)
variables, it may be solved
graphically. x1 + x2 ≤ 60 (carpentry constraint)
o The feasible region is the set x2 ≤ 40 (constraint on demand
of all points satisfying the
for trains)
constraints.
x1, x2 ≥ 0 (sign restriction)

15
Graphical solution: Giapetto’s Woodcarving
Nonnegativity constraints: x1,x2 ≥ 0 x2≤ 40 (demand for trains)
X1, X2 ≥ 0 X2
X2
100

80
X2 > 0 X1, X2 > 0
60
X1= 0; X2 = 40
X1 40
0
20
X2 ≤ 40 and X2 ≥ 0
X1 > 0
X1
0 20 40 60 80 100

16
Graphical solution: Giapetto’s Woodcarving
2 x1 + x2 ≤ 100 (finishing constraint) x1+x2 ≤ 60 (carpentry constraint)
X2 X2

100 100
X1= 0; X2 = 100

80 80

60 60 X1= 0; X2 = 60

40 40

20 20

X1= 50; X2 = 0 X1 X1= 60; X2 = 0 X1


0 20 40 60 80 100 0 20 40 60 80 100
17
Graphical solution: Giapetto’s Woodcarving
All constraint Feasible region
X2 X2
100 X = 0; X = 100 100
1 2

80 80
2X1+ X2 ≤ 100
X1+ X2 ≤ 60
60 X = 0; X = 60 60
1 2

X1= 0; X2 = 40 X1= 20; X2 = 40


40 40 X1= 20; X2 = 40
X1= 0; X2 = 40
X1= 40; X2 = 20
20 20
Feasible X1= 40; X2 = 20

Region X1 X1
X1= 60; X2 = 0
0 20 40 60 80 100 20 40 60 80 100
X1= 5; X2 = 0 X1= 50; X2 = 0
18
Giapetto LP
60 Max z = 3x1 + 2x2
o Having identified the feasible region
for the “Giapetto” LP, a search can Gradient vector:
3
begin for the optimal solution which 2
will be the point in the feasible 40 80 140
region with the largest z value.
o To find the optimal solution, graph a
line on which the points have the
same z-value. In a max problem, such 20
a line is called an isoprofit line while 160 à x1 = 40,
in a min problem, this is called the 50 x2 = 20
isocost line. The next figure shows 0
the isoprofit lines for z = 0, z = 50,
z=80, z=140, z=150 and z = 160.
20 40 150 60
19
Different objectives
60 Min z = -3x1 - 2x2 60 Max z = 3x1 + 3x2
-3 Gradient vector:
3
Gradient vector:
-2 3
40 80 140
40
120 180 à (x1 = 20, x2 = 40)

20 20
160 180 à (x1 = 40,
50
x2 = 20)
0
120
150

0
(x1 = 0, x2 = 0)
20 40 150 60 20 40 60
20
Binding and nonbinding constraints

o In the Giapetto LP, the finishing and carpentry constraints are binding.
o We leave no unused resource of this type. That means there is no slack for
these constraints. These constraints become scarce .

o In the Giapetto LP, the demand constraint for wooden trains is nonbinding
since at the optimal solution (x2 = 20), x2 < 40.
21
Dorian Auto the graphical solution of minimization problems
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 will purchase 1-minute commercial spots on two type of programs:
comedy shows and football games.
o Each comedy commercial is seen by 7 million high income women and 2 million
high-income men and costs $50,000.
o Each football game is seen by 2 million high-income women and 12 million high-
income men and costs $100,000.
o Dorian Auto would like for commercials to be seen by at least 28 million high-
income women and 24 million high income men.
Use linear programming to determine how Dorian Auto can meet its
advertising requirements at minimum cost.
22
Dorian Auto
o Dorian must decide how many comedy o Dorian faces the following
and football ads should be purchased, so constraints:
the decision variables are Constraint 1: Commercials must reach at
x1 = number of 1-minute comedy ads
purchased least 28 million high-income women.
x2 = number of 1-minute football ads 7x1 + 2x2 ≥ 28
purchased Constraint 2: Commercials must reach at
least 24 million high-income men.
o Dorian wants to minimize total 2x1 + 12x2 ≥ 24
advertising cost. The sign restrictions x1 ≥ 0 and x2 ≥ 0 are
Total advertising cost = cost of comedy ads necessary
+ cost of football ads

o Thus, Dorian’s objective functions is


min z = 50 x1 + 100x2

23
Dorian Auto
Feasible Region
Complete LP Models for Dorian Auto:
min z = 50 x1 + 100x2
Subject to:
7x1 + 2x2 ≥ 28 (high income women) 7x1 + 2x2 ≥ 28

2x1 + 12x2 ≥ 24. (high income men)


x1, x2 ≥ 0
o This problem is typical of a wide range of LP

x2
00
applications in which a decision maker

+1
wants to minimize the cost of meeting a

x1
50
certain set of requirements.
2x1 + 12x2 ≥ 24
o To solve this LP graphically, we begin by
graphing the feasible region
24
Dorian Auto
o The feasible region for the Dorian
problem, however, contains points
for which the value of at least one
unbounded
variable can assume arbitrarily
large values. feasible region
o Such a feasible region is called an
unbounded feasible region.

25
Dorian Auto
o Since Dorian wants to minimize total
advertising costs, the optimal solution
to the problem is the point in the
feasible region with the smallest z
value.
o An isocost line with the smallest z
value passes through point E and is
the optimal solution at: z = 50(3.6) 100(1.4)
= 320 = $320,000.
x1 = 3.6 and x2 = 1.4
o Both the high-income women and
high-income men constraints are
satisfied, both constraints are
binding.
26
Special cases
o The Giapetto and Dorian problems each had a unique optimal solution.
o Some types of LPs do not have unique optimal solutions.
• Some LPs have an infinite number of optimal 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 max problem) z-values.

27
Auto Company: Alternative or multiple
optimal solutions
o An auto company manufactures cars and trucks.
o Each vehicle must be processed in the paint shop and body assembly shop.
o If the paint shop were only painting trucks, then 40 per day could be painted.
o If the paint shop were only painting cars, then 60 per day could be painted.
o If the body shop were only producing cars, then it could process 50 per day.
o If the body shop were only producing trucks, then it could process 50 per day.
o Each truck contributes $300 to profit, and each car contributes $200 to profit.

Use linear programming to determine a daily production schedule that


will maximize the company’s profits.

28
Auto Company
o The company must decide how many o The company’s two constraints are
cars and trucks should be produced the following:
daily. This leads us to define the
following decision variables: • Constraint 1: The fraction of the day
x1 = number of trucks produced daily during which the paint shop is busy is
less than or equal to 1.
x2 = number of cars produced daily
(1/40)x1 + (1/60)x2 ≤ 1
o The company’s daily profit (in • Constraint 2: The fraction of the day
hundreds of dollars) is 3x1 + 2x2, so during which the body shop is busy is
the company’s objective function may less than or equal to 1.
be written as: (1/50)x1 + (1/50)x2 ≤ 1
max z = 3x1 + 2x2
• x1 ≥ 0 and x2 ≥ 0 must hold.
29
Auto company
o The auto company’s LP has an
infinite number of optimal solutions,
or multiple or alternative optimal
solutions. (1/40)x1 + (1/60)x2 ≤ 1

o This is indicated by the fact that as


an isoprofit line leaves the feasible
region, it will intersect an entire line
segment corresponding to the (1/50)x1 + (1/50)x2 ≤ 1
binding constraint (in this case, AE).
x2
+2
Goal Programming can be used to 3x 1 Multiple solutions laid
at entire line
solve the multiple optimal solution

30
Infeasible LP
Example on infeasible LP: Auto Dealer
o It is possible for an LP’s o Suppose that auto dealers require that the auto company
feasible region to be empty, in previous example produce at least 30 trucks and 20
resulting in an infeasible LP.
cars. Find the optimal solution to the new LP.
o Because the optimal
o After adding the constraints x1 ≥ 30 and x2 ≥ 20 to the LP
solution to an LP is the best
point in the feasible region, of Example 3, we obtain the following LP
an infeasible LP has no max z 3x1 + 2x2
optimal solution. Subject to:
(1/40)x1 + (1/60)x2 ≤ 1(Paint shop constraint)
(1/50)x1 + (1/50)x2 ≤ 1(Body shop constraint)
x1 ≥ 30
x2 ≥ 20
x1, x2 ≥ 0
31
Graphical solution of Auto Dealer LP
(1/40)x1 + (1/60)x2 ≤ 1
o From Figure it is clear that no point
satisfies all of constraints. x1 ≥ 30
o This means that this example has an
empty feasible region and is an
infeasible LP.
(1/50)x1 + (1/50)x2 ≤ 1
o The LP is infeasible because producing
30 trucks and 20 cars requires more
paint shop time than is available.
x2 ≥ 20

32
Unbounded LP
o For a max problem, an unbounded LP occurs if it is Graphical Solution
possible to find points in the feasible region with
arbitrarily large z-values. à decision maker
earning arbitrarily large revenues or profits. 2x1 – x2
o For a minimization problem, an LP is unbounded if
there are points in the feasible region with
arbitrarily small z-values. à decision maker
suffering arbitrarily large costs. 2x1 + x2 ≥ 6

Example:
x1 – x2 ≤ 1
max z = 2x1 – x2
Subject to:
x1 – x2 ≤ 1
2x1 + x2 ≥ 6
x1 , x2 ≥ 0
There are points in the feasible region that have
arbitrarily large z-values since any isoprofit line is
steeper than x1 – x2 = 1
33
Summary
Every LP with two variables must fall into one of the following four cases.
o The LP has a unique optimal solution.
o The LP has alternative or multiple optimal solutions: Two or more extreme
points are optimal, and the LP will have an infinite number of optimal
solutions.
o The LP is infeasible: The feasible region contains no points.
o The LP unbounded: There are points in the feasible region with arbitrarily
large z-values (max problem) or arbitrarily small z-values (min problem).

34
References
o Operations Research: Applications and Algorithms, Wayne L. Winston
o Introduction to Operations Research, Hillier & Lieberman, McGraw-Hill Int.
o Operations Research – An Introduction, Hamdy A. Taha, Maxwell Macmillan Int.
Edition.

35
36

You might also like