You are on page 1of 29

Linear Programming (LP)

LP Problem
The maximization or minimization of some
quantity is the objective in all linear
programming problems.
All LP problems have constraints that limit
the degree to which the objective can be
pursued.
A feasible solution satisfies all the problem's
constraints.

LP Problem
An optimal solution is a feasible solution that
results in the largest possible objective
function value when maximizing (or smallest
when minimizing).
A graphical solution method can be used to
solve a linear program with two variables.

LP Problem
If both the objective function and the
constraints are linear, the problem is
referred to as a linear programming
problem.
Linear functions are functions in which each
variable appears in a separate term raised
to the first power and is multiplied by a
constant (which could be 0).

LP Problem
Linear constraints are linear
functions that are restricted to be
"less than or equal to", "equal to",
or "greater than or equal to" a
constant.

Guidelines for Model Formulation


Understand the problem thoroughly.
Define the decision variables.
Write the objective in terms of the decision
variables.
Write the constraints in terms of the
decision variables.
Identify any upper or lower bounds on the
decision variables.

General form of a LP problem


MAX (or MIN): c1X1 + c2X2 + + cnXn
Subject to:

a11X1 + a12X2 + + a1nXn b1


:
ak1X1 + ak2X2 + + aknXn bk
:
am1X1 + am2X2 + + amnXn = bm

X1 0, X2 0, X3 0, . . . , Xn 0.

Problem: Cempaka Tours


Cempaka Tours has RM420,000 that
may be used to purchase new rental
boats for hire. The boats can be
purchased from two different
manufacturers.

Problem: Cempaka Tours


Cempaka Tours would like to purchase
at least 50 boats and would like to
purchase the same number from Gagah
Sdn Bhd as from Anggun Sdn Bhd to
maintain goodwill.

Problem: Cempaka Tours


At the same time, Cempaka Tours
wishes to have a total seating capacity
of at least 200.
Pertinent data concerning the boats
are summarized on the next slide.
Formulate this problem as a linear
program.

Problem: Cempaka Tours


Data
Boat
Profit

Builder

Speedhawk
Silverbird
Catman
Classy

Gagah
Gagah
Anggun
Anggun

Cost

RM6,000
RM7,000
RM5,000
RM9,000

Maximum
Seating

Expected
Daily

3
5
2
6

RM70
RM80
RM50
RM110

Problem: Cempaka Tours


Define the decision variables
x1 = number of Speedhawks ordered

x2 = number of Silverbirds ordered


x3 = number of Catmans ordered
x4 = number of Classys ordered
Define the objective function
Maximize total expected daily profit:
Max: (Expected daily profit per unit) x (Number of units)
Max: 70x1 + 80x2 + 50x3 + 110x4

Problem: Cempaka Tours


Define the constraints
(1) Spend no more than RM420,000:
6000x1 + 7000x2 + 5000x3 + 9000x4 < 420,000
(2) Purchase at least 50 boats:
x1 + x2 + x3 + x4 > 50
(3) Number of boats from Gagah equals number
of boats from Anggun:
x1 + x2 = x3 + x4 or x1 + x2 - x3 - x4 = 0

Problem: Cempaka Tours


Define the constraints (continued)
(4) Capacity at least 200:
3x1 + 5x2 + 2x3 + 6x4 > 200
Nonnegativity of variables:
xj > 0, for j = 1,2,3,4

Problem: Cempaka Tours


The Complete Model
Max 70x1 + 80x2 + 50x3 + 110x4
subject to
6000x1 + 7000x2 + 5000x3 + 9000x4 < 420,000

x1 + x2 + x3 + x4 > 50
x1 + x2 - x3 - x4 = 0
3x1 + 5x2 + 2x3 + 6x4 > 200
x1, x2, x3, x4 > 0

Problem: Cempaka Tours


Cempaka Tours problem can be solved by using

Simplex Method (Tablo)


DS For Windows
TORA
Excel Solver
Graphs? (4 dimensions! Possible?)
Etc.

Problem: Cempaka Tours


The Model Output
OBJECTIVE FUNCTION VALUE = 5040.000
Variable
Value
x1
28.000
x2
0.000
x3
0.000
x4
28.000
Constraint
1
2
3
4

Slack/Surplus
0.000
6.000
0.000
52.000

Reduced Cost
0.000
2.000
12.000
0.000
Dual Price
0.012
0.000
-2.000
0.000

Problem: Cempaka Tours


Solution Summary
Purchase 28 Speedhawks from Gagah.
Purchase 28 Classys from Anggun.
Total expected daily profit is RM5,040.00.
The minimum number of boats was exceeded
by 6 (surplus for constraint 2).
The minimum seating capacity was exceeded
by 52 (surplus for constraint 4).

LP Problem
Choose an example of LP problem.
Find out how to solve the problem by using tablo (simplex method).
Ill pick someone and ask him/her to explain his/her example to the class.

In the next class we will discuss how to solve LP by


many different ways.

Blending Problem
Peto Sdn Bhd receives four raw
grains from which it blends its dry
pet food. The pet food advertises
that each 500g can meets the
minimum daily requirements for
vitamin C, protein and iron.

Blending Problem
Peto is interested in producing the
500g mixture at minimum cost while
meeting the minimum daily
requirements of 6 units of vitamin
C, 5 units of protein, and 5 units of
iron.

Blending Problem
The cost of each raw grain as well
as the vitamin C, protein, and iron
units per kg of each grain are
summarized on the next slide.

Blending Problem
Grain

Vitamin C
Units/kg

1
2
3
4

9
16
8
10

Protein
Units/kg
12
10
10
8

Iron
Units/kg
0
14
15
7

Cost/kg
.75
.90
.80
.70

Blending Problem
Define the decision variables

xj = the weight (kg) of grain j (j = 1, 2, 3, 4)


used in the 500g mixture
Define the objective function
Minimize the total cost for a 500g mixture:
MIN

0.75x1 + 0.90x2 + 0.80x3 + 0.70x4

Blending Problem
Define the constraints
Total weight of the mix is 500g (0.5kg):
(1) x1 + x2 + x3 + x4 = 0.5
Total amount of Vitamin C in the mix is at least 6 units:
(2) 9x1 + 16x2 + 8x3 + 10x4 > 6
Total amount of protein in the mix is at least 5 units:
(3) 12x1 + 10x2 + 10x3 + 8x4 > 5
Total amount of iron in the mix is at least 5 units:
(4) 14x2 + 15x3 + 7x4 > 5
Nonnegativity of variables: xj > 0 for all j

The complete model


MIN

0.75x1 + 0.90x2 + 0.80x3 + 0.70x4

subject to
x1 + x2 + x3 + x4 = 0.5
9x1 + 16x2 + 8x3 + 10x4 > 6
12x1 + 10x2 + 10x3 + 8x4 > 5
14x2 + 15x3 + 7x4 > 5
x1 >, x2, x3, x4 > 0

Blending Problem
The Model Output
OBJECTIVE FUNCTION VALUE =
VARIABLE
X1
X2
X3
X4

VALUE
0.099
0.213
0.088
0.099

0.406

REDUCED COSTS
0.000
0.000
0.000
0.000

Thus, the optimal blend is about 0.10 kg of grain 1, 0.21 kg of


grain 2, 0.09 kg of grain 3, and 0.10 kg of grain 4. The mixture
costs Peto 40.6 cents.

Blending Problem
Solution Summary
Thus, the optimal blend is about
0.10kg of grain 1,
0.21kg of grain 2,
0.09kg of grain 3, and
0.10kg of grain 4.
The mixture costs Peto 40.6 cents.

Food of thought
Go down deep enough into anything and
you will find mathematics.

You might also like