Professional Documents
Culture Documents
MTH 3107: Linear Programming: J. Kizito
MTH 3107: Linear Programming: J. Kizito
MTH 3107: Linear Programming: J. Kizito
J. Kizito
Makerere University
e-mail: john.kizito@mak.ac.ug
www: https://www.socnetsolutions.com/~jona
materials: https://www.socnetsolutions.com/~jona/materials/MTH3107
e-learning environment: http://muele.mak.ac.ug
office: block A, level 3, department of computer science
alt. office: institute of open, distance, and eLearning
1 Foundations of Optimization
2 The LP Structure
3 Examples
4 Algorithmic Solutions
5 Conclusion
Introduction
Optimization and Linear Programming
Introduction
Some Optimization Basics
Unconstrained: max f px q x
Easy: 8
x
Unconstrained: max f px q x p1 x q
x
Still easy: df px q
dx 1 2x 0, x 21
In general, what are we doing?
Set the derivative to zero and solve
Necessity Sufficiency
Maximum df px q
fx 0 d 2 f px q
dx 0
Minimum df px q
fx 0 d 2 f px q
dx ¡0
max f px, y , z q x p1 y q y p1 x q z p1 x yq
x,y ,z
Again, calculus works (use the Lagrangian) for small problems, but
needs automation for larger problems
The LP Structure
Solving LP Problems
Often, setting up LPs is the hardest part. This is because the actual
“solving” is usually done by computer
How do computers do it?
We will use a graphical technique to illustrate the intuition behind the
algorithmic methods used in optimization software packages
For any LP, there exists an infinite number of possible solutions
Problem spaces may be vast. Many models have tens of thousands of
variables and constraints
How can we search? How can we limit the number of possibilities we
have to try?
The LP Structure
Example 1
Problem
Fischbeck Electronics makes two models of television sets, A and B. Fischbeck
Electronics’ profit, ZA , on A is $300 per set and its profit on B, ZB , is $250 per
set. Fischbeck Electronics wishes to maximize her profits
The LP Structure
Example 1 – Formulation
Problem Variables
Decision Variables (What can we vary?):
Let xA be the number of model A television sets
Let xB be the number of model B television sets
xA and xB are the only variables we have direct control over
The Objective Function [What are we maximizing (minimizing)?]
Profit! (Cost!)
Z ZA xA ZB xB , but we know that ZA 300 and ZB 250
So, the objective function is Z 300xA 250xB
Example 1
Formulation
Entire LP
maximize Z 300xA 250xB
subject to
2xA xB ¤ 40
xA 3xB ¤ 45
xA ¤ 12
xA ¥ 0; xA ¥ 0
Graphical Method
Step 1: Graphing the Constraints
Graphical Method
Step 2: Identifying the Optimal Points
Graphical Method
Step 3: Choosing a Corner-Point
Graphical Method
Isoprofit (Isocost) Curves
xA and xB can take many values. To identify the optimal values, substitute
arbitrary values in as the objective function and then change them to push the
frontier out towards the boundary of the feasible set
Solving LP Problems
Algorithmic Solutions
Solving LP Problems
What about the Solver?
Graphical Method
Example 2 – Problem
A transport company has two types of trucks. Type A and Type B. Type A has a
refrigerated of 20m3 and a non-refrigerated capacity of 40m3 while Type B has the same
overall volume with equal sections for refrigerated and non-refrigerated stock. A grocer
needs to hire trucks for transpirtation of 3, 000m3 of refrigerated and 4, 000m3 of
non-refrigerated stock. The cost per kilometer of Type A is $30 and $40 for Type B.
How manu trucks of each type should the grocer rent to achieve minimum total cost?
Formulation
1 Let x be the number of Type A trucks, y the number of Type B trucks
2 minimize f px, y q 30x 40y
3 Constraints:
A B Total Inequality
Refrigerated 20 30 3, 000 20x 30y ¥ 3000
Non-refrigerated 40 30 4, 000 40x 30y ¥ 4000
x ¥ 0; y ¥ 0
Graphical Method
Example 2 – Problem
A transport company has two types of trucks. Type A and Type B. Type A has a
refrigerated of 20m3 and a non-refrigerated capacity of 40m3 while Type B has the same
overall volume with equal sections for refrigerated and non-refrigerated stock. A grocer
needs to hire trucks for transpirtation of 3, 000m3 of refrigerated and 4, 000m3 of
non-refrigerated stock. The cost per kilometer of Type A is $30 and $40 for Type B.
How manu trucks of each type should the grocer rent to achieve minimum total cost?
Formulation
1 Let x be the number of Type A trucks, y the number of Type B trucks
2 minimize f px, y q 30x 40y
3 Constraints:
A B Total Inequality
Refrigerated 20 30 3, 000 20x 30y ¥ 3000
Non-refrigerated 40 30 4, 000 40x 30y ¥ 4000
x ¥ 0; y ¥ 0
Graphical Method
Example 2 – Solution
1 f p0, 133q
30 0 40 133 5, 320
2 f p150, 0q
30 150 40 0 4, 500 4 The minimum cost is $4, 180,
3 f p50, 67q achieved with 50 trucks of Type
30 50 40 67 4, 180 A and 67 of Type B
Kizito (Makerere University) MTH 3107 Feb, 2022 21 / 23
Conclusion