AVU - Linear Programming
AVU - Linear Programming
Linear Programming
Notice
This document is published under the conditions of the Creative Commons
http://en.wikipedia.org/wiki/Creative_Commons
Attribution
http://creativecommons.org/licenses/by/2.5/
License (abbreviated cc-by), Version 2.5.
Table of Contents
I.
Linear programming_________________________________________ 3
II.
III. Time_____________________________________________________ 3
IV. Materials__________________________________________________ 3
V.
VI. Content___________________________________________________ 5
Learning Activities__________________________________________ 16
I. Linear Programming
by David K J Mtetwa
III. Time
The recommended total time for this module is at least 120 study hours, with Unit
1 taking 40 hours [20 hours for each of the 2 Activities], and Unit 2 taking 80 hours
[20 hours for the first Activity, 34 hours for the second Activity, and 20 hours for the
third Activity], and the remaining 6 hours to be allocated for the pre-assessment (2
hours) and summative (4 hours) evaluation activities.
IV. Material
Students should have access to the core readings specified later. Also, they will need
a computer to gain full access to the core readings. Additionally, students should be
able to install the computer softwares wxMaxima and Graph and use them to practice
algebraic concepts. These should be regarded as learning materials to facilitate easier
accessing and processing of the core concepts and skills that constitute the course.
The following are materials necessary to engage with the module meaningfully and,
hopefully, complete it successsfully: The students edition of the module (print form);
a computer with effective internet connectivity and MicroSoft Office 2003 and above;
a scientific or programmable calculator; graph plotting materials; CDs with materials
downloaded from sites recommended in the module; CDs with mathematical software
such as MathType or WinShell, Graph, wxMaxima, and at least one linear programming software that is free-downloadable, recommended readings from texts identified
in the module. [The recommended readings can also be in print form].
V. Module Rationale
The importance of linear programming derives in part from its many applications and
in part from the existence of good general-purpose techniques for finding optimal
solutions. Linear programming is useful for guiding quantitative-related decision
making in business, industrial engineering enterprises, and to a lesser extent activities
within the social and life sciences. The linear programming skills will help teachers
in some aspects of their own personal life management activities and in their professional practice.
This module acts as a smooth and non-intimidating entry into the mathematical worlds
of dynamic linear programming, networks, and operations research for the learner
who will develop some interest in majoring those fields. Also it:
(a) is important in and of itself as a degree level mathematics course because
it introduces to the mathematics student new mathematical content with a
distinctive style of mathematical thinking;
(b) beautifully integrates theoretical concepts with their practical applications
both of a mathematical and everyday - life in nature;
(c) is necessary for the prospective teacher of science and mathematics because
modern day youth and school students are now pre-disposed to a range of
career interests, many of which would be facilitated by a preparation that
involves dealing with linear programming and optimisation that are covered
in this module.
VI. Content
6.1 Overview
Overview: Prose description
This module introduces the learner to a particular mathematical approach to analysing
real life activity that focuses on making specific decisions in constrained situations.
The approach, called linear programming, is presented here with an emphasis on
appreciation of the style of thinking and interpretation of mathematical statements
generated, rather than on computational competency per se, which is left to appropriate and readily available ICT software package routines.
The module begins with Unit One that consists of 2 main Activities. Activity 1, formulation of a linear programming problem, is on a mathematical description of the
problematic situation under consideration, and Activity 2, the geometrical approach
considers a visual description of a plausable solution to the problem situation. Unit
1 therefore should move the learner towards an appreciation of real-life activity
situations that can be modelled as linear programming problems.
With 3 main activities, Unit 2 considers computational algorithms for finding plausible
optimal solutions to the linear programming problem situations of the type formulated
in Unit 1. Activity 3 examines conditions for optimality of a solution, which is really
about recognising when one is moving towards and arrives at a candidate and best
solution. Activity 4 discusses the centre piece of computational algebraic methods
of attack, the famed Simplex algorithm. This module focuses on the logic of the
algorithm and the useful associated qualitative properties of duality, degeneracy, and
efficiency. The final Activity touches on the problem of stability of obtained optimal
solutions in relation to variations in specific input or output factors in the constraints
and objective functions. This so called post optimality or sensitivity analysis is presented here only at the level of appreciation of the analytic strategies employed.
Flow of Learning
Unit 1
Identifying, describing, understanding, and appreciating the general linear programming problem situation, and plausible solutions for it.
Unit 2
Computational strategies for seeking solutions of linear programming problems,
recognizing potential and best solutions, and efficiency considerations.
6.3
Graphic Organiser
ACTIVITY 1
Formulation of the
linear programming
LP problem
in Standard
General LP
problems
UNIT 1
2-var PL
ACTIVITY 2
Geometrical Solution
3-var PL
Boundedness
MODULE
ACTIVITY 3
Optimality Condition
Convergence
Degeneracy
Simplex Method
UNIT 2
ACTIVITY 4
Algebraic Approach
Efficiency
Big M-Method
Primal Simplex
Duality
Dual simplex
Parametric Analysis
ACTIVITY 5
Sensitivity Analysis
Marginal Analysis
Unit
Learning objective(s)
Problem Formulation
o
o
Problem Formulation
o
o
o
o
o
o
o
(d) acosx + by = c
(a) -5
4
(d) 8
-3
2 4 2 2 0
(a) 35
(b) 25
(c) 53
(d) 52
1
5. The matrix 0
1
(a) 0
4 2 2 0
1 6 4 9
0 0 0 0 has rank:
2 1 1 0
(b) 1 (c) 2
(d) 3
6. Consider the linear equation x + y 1. Which of the graphs satisfy this inequality?
a)
(b)
(c)
(d)
(b)
FALSE
8. Which of the following is not directly associated with the Gaussian elimination
method?
(a) Reducing n x n matrix to echelon form
(b) Detemining the consistency of a system
(c) Finding lower or upper triangular matrix
(d) Using elementary operations to reduce a system of equations
A = 1
2
(a) 2
4
1 3
0 2
-1 5
1 1 3
0 2 4 1 2 4 5 3
(b)
(a)
(c)
(d)
N.B. An object is convex if for every pair of points within the object, every point on
the straight line segment that joins them is also within the object.
11. The sequence {1/n} is bounded below by:
(a) 1
(b)
(c) 0
(b)y = 1/x
(c)y = 3
(d) y = e-x
(c) {1/n}
(d) {(n+1)/n}
1 2 3
(a) 11
(b) 24
(c) 21
(d) 18
(a) TRUE
(b) FALSE?
Answer Key
1. b ( a and c are parabolic functions, d has a periodic function cosx)
2. a (a has magnitude but no direction, c typically denotes a matrix or vector, b and
d are vectors )
3. a (the matrix has 3 rows and 5 columns and so its a 3 by 5 matrix)
4. c (a singular matrix is a matrix with determinant zero and so it non-invertable)
5. d (the rank of a matrix is the number of non-zero rows and here they are three)
6. a (the graph in d gives the equation x - y 1 , b has shaded the unwanted region
and c has shaded the whole x-y plane)
7. a (for equality to hold you add some positive number on the left hand side)
8. c (you use the leading entry in each row to eliminate the non-zero coefficients
below it, thus creating an upper triangular matrix)
9. b (for transpose the first column becomes first row, second column becomes
second row and third column becomes third row so answer is b)
10 . c (c is the only shape in which when two points in the region are joined by a line,
all the points on the line are also in the shape)
11. c (the sequence is a decreasing sequence which approaches zero)
12 c (the optimal point is the maximum or minimum point)
13. b (for b the function is continuous everywhere else except at zero hence discontinuous)
14. c (for a vector to be called a basis it should be linearly independent and should
span or generate the whole vector space)
15. b (a and c converge to zero, d converges to 1 )
16. b (a function is bounded if it is bounded above and below)
17. b (just multiply the terms in the diagonal) .
18. a ( if you minimize production costs then you will maximize profit)
19. c (a vector quantity has size and direction e.g. velocity, acceleration)
20. a (a subspace of a vector space is also a linear or vector space since it satisfies
the three main properties of a vector space` )
X. Learning Activities
[Note: all key concepts are defined in the glossary, which is given in section 11 below. Where a definition is encountered in the learning activities, reference is made
to the glossary for its articulation, while the Learning Activities concentrate on
developing the concept or skill that is carried by the definition. This is a device to
minimise repetition.]
resolve the linear programming problem geometrically. With specific examples you
are going to see how problems in business, physical, chemical and biological sciences,
engineering, architecture, economics, agriculture and management are formulated.
Learning will involve a number of activities such as reading about linear programming, optimization, operation research and the nature of the objective functions and
constraints. The learning activities could also involve extensive use of mathematical
software packages to solve the linear programming problems.
Learning activities
Reading
Read the following textbook section:
aij is the amount of ith raw material required to produce one unit of jth product, for
j=1,2,.,n
j is the unit market price for the jth product, for j=1,2,.,n
x j is the number of jth product produced
m
pa
i
ij
i =1
m
a
i
ij
= 1 a1 j + 2 a2 j + ... + m amj
i =1
c j = j - pi aij
i =1
cj xj
Discussion
In pairs narrate a situation in which Linear Programming is involved and then formulate that problem into a Linear Programming Problem.
Are you able to visualize the Formulation?
f (x1 , x2 ,...., xn ) = c1 x1 + c2 x2 + .. + cn xn
Where:
x is the decision variable
n is the number of decision variables in the objective function
cj is unit cost or unit profit of the jth decision variable
Such that:
Technological Constraints:
ai1 x1 + ai 2 x2 + L + ain xn = b
for i = 1,2,L , m
Where
a11
a12
a1n
ai1 = M , ai 2 = M , L , ain = M
am1
am2
amn
Sign Restrictions
xj 0
Further reading
Read the following link:
(1)
x1 + x2 125
2x2 + x2 150
3x1 + x2 180
and
x1 0, x2 0
(2)
Summary guidelines for linear programming problem formulation
a)
b)
c)
d)
e)
f)
Exercise 1
1. Formulate a mathematical model of the problems the production manager and
comptroller are suppose to solve.
2. Give examples of four other fields where optimization plays a pivotal role.
3. State the three conditions that are necessary for linear programming problem
to be linear.
4. Go the page 8 (of textbook) of Linear Programming: Foundations and Extensions by Robert J. Vanderbei and do questions 1.1 and 1.2
Answers to Exercise 1
Question 1
For the answer to this question check Managing a Production Facility from page
3 to 5 of Linear Programming: Foundations and Extensions
Question 2
Some of the major application areas to which linear programming can be applied
are:
Blending
Production planning
Oil refinery management
Distribution
Financial and economic planning
Manpower planning
Blast furnace burdening
Farm planning
Question 3
Conditions for a mathematical model to be a linear program (linear programming)
are:
all variables continuous (i.e. can take fractional values)
a single objective (minimise or maximise)
the objective and constraints are linear i.e. any term is either a constant or a
constant multiplied by an unknown.
Question 4
1.1
Let x and y be our variables for time given to produce bands and coils respectively
Time constraint
x + y 40
Tonnage constraints
200x 6000
140y 4000
Objective function
Learning Activities
Reading
Linear Programming: Foundations and Extensions by Robert J. Vanderbei page
22 section5.
www.princeton.edu/~rvdb/LPbook/onlinebook.pdf
Last visited: 15-02-07
Further reading
Read the following link on the Geometrical Approach
Linear Programming: A Geometric Approach page 171-176
http://www.wiley.com/college/sc/sullivan/CH03.pdf
Last visited: 16-02-07
This link will help you to understand how to graph inequalities and identify the wanted
regions which are called feasible regions in linear programming problems. The feasible
region contains all possible solutions and from these we find the optimal solution.
NOTE
When the number of variables in a linear programming problem is two or three the
feasible solutions can be determined graphically by drawing the graphs of inequalities of the constraints.
The following steps are essential when one is solving linear programming problems
geometrically.
Step 1: Graph the constraints
Step 2: Identify the feasible region
Step 3: Graph the objective function (twice)
Step 4: Find the cornerpoints to the region of feasible solutions
Step 5: Evaluate the objective function at all the feasible corner points by:
f (x, y) = 5x + 7 y
Maximize:
subject to:
x+ y-70
2x - 3y + 6 0
x 0, y 0
1. Is the problem amenable to Linear Programming?
Yes, if and only if: All variables have power of 1, and they are added or subtracted
(not divided or multiplied). The constraint must be of the following forms ( ,
, or =, that is, the linear programming-constraints are always closed), and the
objective must be either maximization or minimization.
Answer Yes
x+ y-70
2x - 3y + 6 0
x 0, y 0
After all the constraints are graphed, you should have a non-empty (convex)
feasible region, unless the problem is infeasible.
6. Create (at least) two iso-value lines from the objective function, by setting the
objective function to any two distinct numbers. Graph the resulting lines. By
moving these lines parallel, you will find the optimal corner (extreme point), if
it does exist.
In general, if the feasible region is within the first quadrant of the coordinate
system then, for the maximization problems you are moving the iso-value objective function parallel to itself far away from the origin point (0, 0), while having
at least a common point with the feasible region. However, for minimization
problems the opposite is true, that is, you are moving the iso-value objective
parallel to itself closer to the origin point, while having at least a common point
with the feasible region. The common point provides the optimal solution.
Exercise 2
Read Linear Programming: Foundations and Extension by Robert J. Vanderbei page
24 Work through numbers 2.1, 2.2, 2.3, 2.5 and 2.10.
Note: You are only required to construct the feasible regions
Further reading
Now go to the following links and read more on resolution by geometry:
Linear Programming: A Geometric Approach page 171-176
http://www.wiley.com/college/sc/sullivan/CH03.pdf
This is a maximizing problem in which the profit is being maximized.
Linear Programming: Geometric Approach
www.math.tamu.edu/~janice.epstein/141/notes/Ch3.pdf
Last visited: 16-02-07
Answers to Excercise 2
For answers to the given problems check on page 449 of your main book, Linear
Programming: Foundations and Extensions by Robert J. Vanderbei
gramming
be able to check optimality conditions for solving a Linear Programming
problem.
be able to carry out a sensitivity analysis for a given optimal solution.
http://mat.gsia.cmu.edu/QUANT/notes/node63.html#SECTION0083000000
0000000000
Learning Activities
Optimality Conditions
In simple terms, optimality conditions are certain conditions which should tell you
that you have reached the optimal solution. For the Maximization Problem if all
nonbasic variables have negative or zero coefficients in the objective function, an
optimal solution has been obtained. If you were to substitute one of the non- basic
variables with a non-negative value (since the variables are non-negative), then the
value of the final solution is reduced. Hence you are certain that the optimal solution
has been obtained. Similarly, for the Minimization Problem if all non-basic variables
have positive or zero coefficients in the objective function, an optimal solution has
been obtained.
Reading
For Conditions of Optimality for a Linear Programming Problem and the Fundamental Theorem of Linear Programming, read
Linear Programming: Foundations and Extensions by Robert J. Vanderbei
www.princeton.edu/~rvdb/LPbook/onlinebook.pdf
Last visited: 15-02-07
Further Reading
http://engr.smu.edu/~barr/ip/ch1/node7.html
http://www.maths.abdn.ac.uk/~igc/tch/mx3503/notes/node67.htm
Exercise 3
Look at the example from Linear Programming: Foundations and Extension by Robert
J. Vanderbei, page 13, whose solution is given on pages 15 and 16.
Now do this Exercise adapted from Wagner (1975)
Test for optimality conditions on the following linear programming probem
Maximize 4x1 + 5x2 + 9x3 + 11x4
Subject to
x1 + x2 + x3 + x4 15
7x1 + 5x2 + 3x3 + 2x4 120
3x1 + 5x2 + 10x3 + 15x4 100
x1 0, x2 0, x3 0, x4 0
Solution
Let x0 be the value of the objective function add the slack variables x5 , x6 , x7
to your constraints so that you have equality. Then write the system as
x0 =
695 3
11
13
5
- x2 - x4 - x5 - x7
7
7
7
7
7
Primal problem
Dual problem
Weak duality
Strong duality
Primal feasibility
Dual feasibility
Primal feasibility
Dual feasibility
Learning Activities
A woman, baby at the back, pondering over the easiest way of crossing a fast flowing
river.
Subject to:
x + y 300
2x + 3y 720
x 0, y 0
Step 1 Form the initial simplex tableau
Let us introduce two slack variables s1 0 and s2 0 then the first inqualities can
be written as equalities
x + y + s1 = 300
2x + 3y + s2 = 720
We can now have the system of equations
x + y + s1
= 300
2x + 3y + s2
= 720
-170x - 225y + f
=0
s1
-170
-225
s2
rhs
300
720
s1
-170
-225
s2
rhs
300
720
Pivot row
Pivot
Pivot column
s1
2/3
-225
-170
s2
1/3
rhs
300
240
Step 4 Adding -1 times the second to the first and 225 times the second row to the
third, we get
x
s1
1/3
2/3
-20
rhs
60
1/3
240
5400
s2
-1/3
75
New pivot
Step 5 The new pivot is 1/3; we divide the first row by 1/3 and then add -2/3 times
the resulting first row to the second and 20 times the first row to the third row.
x
s1
s2
rhs
-1
180
-2
120
60
55
57600
x + 3s1 - s2 = 180
y - 2s1 + s2 = 120
That is
x = 180 - 3s1 + s2
y = 120 + 2s1 - s2
f = 57600 - 60s1 - 95s2
Maximum value
f has maximum value of 57 600 when s1 = 0 and s2 = 0, and this yields x =180 and
y=120
Note
The values of f, x and y can be easily read from the terminal simplex, thus the optimal solution and the maximum value of the objective function can be read from
this terminal tableau.
Subject to
x1 + x2 = 10
x1 4
x1 0, x2 0
Then after adding a surplus variable x3 in the inequality above, you can write the
model as
x0 + 3x1 + 2x2 = 0
x1 + x2 = 10
x1 - x3 = 4
Next, introduce artificial variables y1 and y2 , and let M =10 as our large integer, for
instance, giving
x0 + 3x1 + 2x2 + 10 y1 + 10 y2 = 0
x1 + x2 + y1 = 10
x1 - x3 + y2 = 4
To initiate the algorithm, you have to subtract (M =10) times row 2 and (M =10)
times row 3 from row 1 to eliminate y1 and y2 :
x1 - x3 + y2 = 4
From here you can then proceed using the Simplex method.
You can verify that x1 = 4 and x2 = 6 are optimal.
Further reading
Follow this link.
The Simplex Method:
http://www-fp.mcs.anl.gov/otc/Guide/CaseStudies/simplex/feasible.html
Further Activity
The following link http://www-fp.mcs.anl.gov/otc/Guide/CaseStudies/simplex/feasible.html explains the simplex method in a user friendly way, go through the activities
in it and then answer the following questions:
1. State the nature of a standard maximising problem
2. What happens in the initial simplex tableau stage?
Exercise 4
The following tableaus tables were obtained in the course of solving linear program
nonnegative variables x1 and x2 and 2 inquality constraints, the objective function, z
is maximisation. Slack variables s1 and s2 were added. In each case, indicate whether
the linear program:
(i) is unbounded
(ii) has a unique optimum solution
(iii) has an alternate optimum solution
(iv) is degenerate (in this case, indicate whether any of the above holds).
z
x1
x2
s1
s2
rhs
20
-2
-1
-1
x1
x2
s1
s2
rhs
-1
20
-2
-2
c)
x1
x2
s1
s2
rhs
-2
-2
x1
x2
s1
s2
rhs
-1
-1
-1
a)
b)
d)
trousers
shirts
available
labour
50
raw material
60
net income
20
15
subject to:
3x1 + 2x2 50
labour constraint
4x1 + 3x2 60
material constraint
x1 0, x2 0
The insurance broker tries to minimize the total amount of $(50z1 +60z2) payable
to the tailor by the insurance company. However, the tailor will set the constraints
(conditions) by insisting that the insurance company cover all his loss (that is, his net
income) since he cannot make the products. Therefore the brokers problem is:
Minimize
f (z1 , z2 ) = 50z1 + 60z2
subject to:
3z1 + 4z2 20 Net income from a trouser
2z1 + 3z2 15 Net income from a shirt
z1 0, z2 0
If we work out the solutions of this problem you will see that the insurance companys
problem is closely related to the tailors problem.
Reading
Now read the following text:
Linear Programming: Foundations and Extensions by Robert J. Vanderbei, Chapter
5, pages 55 79. [www.princeton.edu/~rvdb/LPbook/onlinebook.pdf]
Last visited: 15-02-07
Dual Theorem
a) In the event that both primal and dual problems possess feasible solutions, then
the primal problem has an optimal solution x*j for j= 1, 2, ., n, the dual problem
has an optimal solution y*i , for i = 1, 2, .., m, and
n
j =1
i =1
c j xj = bi yi
b) If either the primal or dual problem posses a feasible solution with a finite optimal
objective-function value, then the other problem possesses a feasible solution
with the optimal objective-function value.
Note
The duality relationship can be summarised as follows:
Primal (Maximize)
Dual (Minimize)
Objective function
Right-hand side
jth column of coefficient
ith row of coefficients
jth variable nonnegative
jth variable unrestricted in sign
ith relation an inequality ( )
ith relation an equality
Right-hand side
Objective function
jth row of coefficient
ith column of coefficient
jth relation an inequality ( )
jth relation an equality
ith variable nonegative
Subject to:
x1 + x2 + x3 + x4 15
7x1 + 5x2 + 3x3 + 2x4 120
3x1 + 5x2 + 10x3 + 15x4 100
xj 0
For j =1, 2, 3, 4
The dual problem can easily be obtained using the duality relationships in the table
above as:
Minimize
Subject to
x1 + x2 + x3 + x4 15
7x1 + 5x2 + 3x3 + 2x4 120
3x1 + 5x2 + 10x3 + 15x4 100
xj 0
Exercise 5
1. In your own words explain what you understand by a dual problem in linear
programming.
2. State the dual theorem and then prove it.
3. Do questions 5.1 , 5.2 and 5.16 on page 79 of Linear Programming : Foundations and Extensions by Vanderbei.
Further Reading
You can read the following link for more examples of formulating a dual problem in
linear programming: http://www.maths.abdn.ac.uk/~igc/tch/mx3503/notes/node66.html
Duality in linear programming, Optimality Conditions
http://www-personal.umich.edu/~murty/310/310-2slides8.pdf Duality and OptimalityConditions
http://www.caam.rice.edu/~yzhang/caam378/Notes/chap5.pdf
Answers to Exercise 5
Question 1
Read the Tailors Problem or the Resource Allocation Problem and then explain them
in your words to your colleague.
Question 2
Weak and strong duality theorems combined together.
Question 3
For question 5.1 we are given the problem as follows
Maximize x1 - 2x2
Subject to
x1 + 2x2 - x3 + x4 0
4x1 + 3x2 + 4x3 - 2x4 3
-x1 - x2 + 2x3 + x4 = 1
x2 0, x3 0
Maximize x1 - 2x2
Subject to
-x1 - 2x2 + x3 - x4 0
4x1 + 3x2 + 4x3 - 2x4 3
-x1 - x2 + 2x3 + x4 1
x1 + x2 - 2x3 - x4 -1
The dual of this problem is therefore:
Minimize 3y2 + y3 - y4
Subject to
- y1 + 4 y2 - y3 + y4 1
2 y1 + 3y2 - y3 + y4 -2
y1 + 4 y2 + 2 y3 - 2 y4 0
- y1 - 2 y2 + y3 - y4 0
5.2 To solve this problem refer to theorem 5.2 on page 60 of Linear Programming:
Foundations and Extensions. Find the dual of the problem as illustrated in the
problem above.
Learning Activities
Consider the problem of the production manager that we discussed in Activity One.
Even under normal business situations, various factors influence the production, or,
eventually, profit levels. Suppose the manager has been advised by her planning
committee that has solved the associated linear progamming problem to maintain
purchase orders of some input materials and supplies to some warehouses at certain
specific levels. Those levels would be corresponding to the optimal solution (production or profits) under those circumstances. Now consider the case of an inflationary
environment in a country with a poorly performing economy. The influencing factors
will obviously vary in their impact to the production process depending on the availability and costs of the input materials and output distribution costs. The variations
are often non-uniform across factors and unpredicable in both time period and size.
Under those circumstances, the manager would be very interested in knowing how
much changes in individual or combinations of input factors impact on the current
optimum solution. This is where sensitivity analysis, which looks at that problem,
becomes useful. Technically, it analyses changes in the coefficients of the objective
function (the unit costs) or the right hand sides of the constraints (the requirements)
affect the optimal solution.
-170
s1
s2
RHS
300
720
-225
x1
x2
s1
s2
RHS
-1
180
-2
120
60
55
57600
Row 0
It has all non-negative values in Row 0 (which we will often refer to as the cost row),
all non-negative right-hand-side values, and a basis matrix embedded.
Sensitivity analysis starts at this point to determine the effects of small changes in the
optimal solution. We will try to determine how that change affects the final tableau,
and try to re-form the final tableau accordingly.
s1
s2
RHS
3+
300
720
-170
-225
Carry out the calculation and then confirm the statement above.
Right-hand-side changes
For these types of changes, we concentrate on maximization problems with all
constraints. Other cases are handled similarly.
Consider the following problem:
Maximize
f (x, y) = 4x + 5y
subject to:
2x + 3y 12
x+ y5
x, y 0
s1
s2
RHS
22
-2
-1
Now suppose we change the amount of the right-hand-side from 12 to (12+) in the
first constraint, the tableau changes to:
s1
s2
RHS
22 +
-2
2+
-1
3-
This represents an optimal tableau as long as the right hand side is all non-negative.
In other words, we need between -2 and 3 in order for the basis not to change. For
any in that range, the optimal objective will be (22+). For example, with equals
2, the new objective is 24 with y = 4 and x = 1.
Similarly, if we change the right-hand-side of the second constraint from 5 to (5+)
in the original formulation, we get an objective of (22+2) in the final tableau, as
long as 11
Basically sensitivity analysis tests what happens to the optimal solution if there are
changes in the supply of raw material or market values. It highlights changes in variables which affect the optimal solution and those which do not.
Exercise 6
Linear Programming: Foundations and Extensions by Robert J. Vanderbei Chapter
7 page 120 # 7.1 and 7.2. www.princeton.edu/~rvdb/LPbook/onlinebook.pdf
Last visited: 15-02-07
Further Activity
Optimization Methods Lecture 7 Sensitivity Analysis
http://ocw.mit.edu/NR/rdonlyres/Sloan-School-of-Management/15-093Fall2004/8842223F-9C8A-4B9E-83F8-DD28DE270140/0/lecture07.pdf
Management Science: Linear Programming Notes
http://www.strathcona.bham.ac.uk/Pdfs1%20management%20Course%20Y
ear%202/LINEAR%20PROGRAMM%20NOTES.PDF
Answers to Exercise 6
Page 449 of Foundations and Extensions by Robert J. Vanderbei
S convex X 1 , X 2 S 2 ,x (0,1) : (1 - x) X 1 + xX 2 S
Convex sets
Nonconvex
Convex
Cycling
is when a sequence of pivots goes through the same tableaux and repeats itself
indefinitely.
Degeneracy
occurs when some basic variable is at one of its bound values (canonically zero).
Without any given qualification, a (basic) solution is degenerate if one or more of
its basic values is zero (the canonical lower bound).
Dictionary
is the systems of equations of the objective function and the constraint equations
after introducing slack variables
Dual degenerate
is a solution where one of its non-basic variables has zero reduced cost. In general,
a solution is degenerate if it is not strictly complementary.
Duality
Weak duality is say, if x, p are feasible solutions to primal and dual problems
respectively, then b p cx .
Strong duality is when the primal problem has an optimal solution and the
Dual feasiblity means having a feasible solution of the dual linear programming problem
Feasible Solution
A solution vector, x, which satisfies the constraints.
a
X:aX>b
X:aX=b
X:aX<b
Half-planes
the feasible region of a linear inequality
a1 X1 + a2 X 2 + ... + an X n = b .**
T
X 0 = X 01 , X 02 ,..., X 0 n
and a point satisfying Equation(**) as equality, we can perceive the solution space
of
the equation:
a1 X 1 + a2 X 2 + ..... + an X n = b
Hyperplane
Is solution space of an n-var linear equation of the general form:
a1 X 1 + a2 X 2 + ..... + an X n = b
Isoprofit lines
are lines for the objective function that are drawn to locate the optimal value when
using the geometric approach.
Linear programming problem
is a set of (linear) inequalities (with a solution setS) and a (linear) function (often
cost or profit) whose value (within S) is to be maximized or minimized.
Marginal analysis
is concerned with the effects of small perturbations, maybe measurable by derivatives.
Nonbasic Variables
A variable not in the basic solution (value = 0).
Objective Function
The function that is either being minimized or maximized. For example, it may
represent the cost that you are trying to minimize.
Operation research
sometimes known as management science, refers to the constant scientific monitoring of an organisations ongoing activites, focussing on decision and control
problems that affect daily operations of the organisation. It involves the representation of real world situations by mathematical models, together with the use of
quantitative methods (algorithms) for solving such models with a view to optimizing.
Optimal Solution (vector)
A vector x which is both feasible (satisfying the constraints) and optimal (obtaining the largest or smallest objective value).
Optimal Solution
is the maximun or minimun feaseble solution which is obtained at final stage of the
simplex method algorithm process.
Parametric analysis
is concerned with larger changes in parameter values that affect the data in the
mathematical program, such as a cost coefficient or resource limit.
Phase I & Phase II
Phase I of a mathematical program is finding a feasible solution, and Phase II is
entered with a feasible solution to find an optimal solution.
Pivot. This is the algebra associated with an iteration of Gauss-Jordan elimination,
using the forward transformation. (refer to illustration below)
Pivot column
Pivot row
Pivot
Polytope
is solution space (feasible region) of an n-var linear programming is geometrically
defined by the intersection of a number of half-spaces and/or hyperplanes equal to
the linear programming constraints, including the sign restrictions.
Polyhedron
is a bounded polytope
Pricing
This is a tactic in the simplex method, by which each variable is evaluated for its
potential to improve the value of the objective function.
Primal degenerate
is a pivot where the associated basic solution (x) does not change (i.e., the nonbasic variable enters the basis, but its level remains at the same bound value, in
which case no basic variable changes level).
Sensitivity analysis
The concern with how the solution changes if some changes are made in either the
data or in some of the solution values (by fixing their value).
Simplex method
An algorithm invented to solve a linear program by progressing from one extreme
point of the feasible polyhedron to an adjacent one. The method is an algorithm
strategy, where some of the tactics include pricing and pivot selection.
Simplex
(pl. simplices). {x in R: Sum{xj} = 1}. For n=1, this is a point (x=1). For n=2, this
is a line segment, joining points (1,0) and (0,1). For n=3, this is a triangle, joining
the vertices (1,0,0), (0,1,0), and (0,0,1). This is sometimes called an n-simplex,
denoted by Sn (note its dimension is n-1). The open simplex excludes the axes: {x
in Sn: x > 0}.
Slack variable
In an inequality constraint of the form g(x) b, the slack is b-g(x), which is designated by the slack variable, s. Then, the original constraint is equivalent to the
defining equation, g(x) + s = b, plus s >= 0.
Slack Variable
A variable added to the problem to eliminate less-than constraints.
Standard Maximizing Problem
is a linear programming problem which satisfies all of the following 4 conditions:
1)
2)
3)
4)
[A Non-Standard Problem
is simply a problem which is not standard, and hence fails to satisfy at least one of
[1] through [4] above.]
Surplus Variable
A variable added to the problem to eliminate greater-than constraints.
Tableau
(pl. tableaux). A detached coefficient form of a system of equations, which can
change from x +Ay = b to x+Ay = b. The primes denote changes caused by
multiplying the first equation system by the basis inverse (a sequence of pivots in
the simplex method).
Unbounded Solution
For some linear programs it is possible to make the objective arbitrarily small (without bound). Such an linear programming is said to have an unbounded solution.
The following sites enable you to practice the Linear Programming pivoting
without having to do the arithmetic!
1.
2.
3.
4.
Question 1 tests the students understanding of a linear programming problem situation through the students ability to formulate the linear programming problem
properly (i.e. writing the problem in mathematical language).
Questions 2 and 3 test the students capability to write the problem in mathematical
language and solve it using the graphical (geometric) method. Graph paper is relevant
for accuracy of diagrams.
Question 4 tests the students capability to solve the linear programming problem
using the Simplex Method.
Questions 5 and 6 test the students capability to solve the linear programming problem using the Big- M Method followed by the Simplex Method. The student should
know when it is appropriate to use the Big- M method.
Question 7 checks if the student can identify the primal and dual forms in a linear
programming situation and formulate the dual of a given primary linear programming
problem.
Question 8 tests the students capability to investigate the feasibility and boundedness
characteristics of a linear programming problem.
Question 9 tests the students capability to solve the linear programming problem
using the Dual Simplex method.
Question 10 tests the students capability to solve a linear programming problem
using the Simplex Method and then carry out a sensitivity analysis on the solution
obtained.
Question 1
The Mufoya Bicycle Company produces two kind of bicycles by hand: Mountain
Bike and Street Racers. Mufoya wishes to find out the rate at which each type of
bicycle should be produced in order to maximize the profits on the sales of the bikes.
Mufoya assumes that the company can sell all the bicycles produced. The physical
data on the production process is available from the company engineer. A different
team produces each kind of bicycle, each team has a different maximum production
rate: 2 mountain bikes per day and 3 racers per day respectively. Producing a bicycle
of either type requires the same amount of time on the metal finishing machine (a
production bottle-neck), and this machine can process at most a total of 4 bicycles
per day, of either type. The company accountant esimates that mountain bikes are
currently generating a profit of $15 per bicycle and racers are giving a profit of about
$10 per bicycle. Formulate the Linear Programming Problem.
Questions 2 and 3
A manufacurer of electronic instruments produces two types of timers: a standard
and a precision model with net profits of $2 and $3 respectively. They are similar in
design, each taking about the same amount of time to assemble. Let us suppose that
the manufacturer wishes to maximize his net profit each day subject to the availability of resources and marketing considerations. Lets consider that his work force
can produce no more than 50 instruments per day. Furthermore, suppose there are
4 main components in short supply (a,b,c and d), and that they are used in different
quantities for the types of timers as shown below.
Component
Stock
220
160
370
10
300
Standard (x)
Precision (y)
That is to say each of the x standard timers uses 4 of component a, and each of the y
precision ones uses 2, and the factory cannot use more than what is in stock.
[A] Formulate the Linear Programming Problem.
[B] (i) Find the feasible region of the Linear Programming problem using the geometrical method.
Question 4
Use the Simplex method to solve the following linear programming problem
Subject to
x1 + x2 + x3 + x4 15
7x1 + 5x2 + 3x3 + 2x4 120
Question 5
(a) Explain fully when the Big M method is used.
(b) Maximize
3x1 + 4x2
Subject to
2x1 + x2 600
x1 + x 225
5x + 4x 1000
x + 2x 150
x,x 0
Question 6
Maximize
Subject to
-3x1 - 2x2
x1 + x2 = 10
x1 4
x1 0, x2 0
Question 7
(a) Explain what is meant by the primal and dual of a linear programming problem.
(b) Formulate the dual of the linear programming problem below
Maximize 4x1 + 5x2 + 9x3 + 11x4
Subject to
x1 + x2 + x3 + x4 15
x1 0 , x2 0 , x3 0
Question 8
Investigate the feasibility of the problem below
a) Maximize
5x1 + 4x2
subject to
x1 + x2 2
2x1 2x2 9
x1, x2 0.
b)
Maximize
subject to
x1 4x2
2x1 + x2 1
x1 2x2 2
x1, x2 0.
Question 9
Minimize 2x1 + x3
Subject to
x1+ x2 - x3 5
x1 - 2x2 + 4x3 8
x1 0, x2 0, x3 0
Question 10
Consider the Linear Programing problem below
Maximize z = 15x1 + 10x2
Subject to
x1 2
x2 3
x +x 4
1
2
The optimal solution is x1= 2, x2 = 2, z = 50
Suppose that the third constraint is changed to x1+x2 3. That is to say the new
problem becomes:
Maximize z =15x1+10x2
Subject to
x1 2
x2 3
x1+x2 3
Investigate whether or not the solution to the Linear Programming problem is sensitive
to the change in the constraint.
Answers to questions
Question 1
The first step is to identify the variables. These are the values you can set or otherwise control. The Mufoya variables are the production rates of the mountain bikes,
x1 and racers, x2 .
The objective function is as follows:
Maximize daily profit, i.e., maximize z = 15x1 + 10x2 (in $ per day)
The constraints are as follows:
Mountain bikes production limit x1 2 (bikes per day)
Racers production limit x2 3
2x + 3y
x + y 50
4x + 2 y 220
2x + 4 y 160
2x + 10 y 370
5x + 6 y 300
x, y 0
[B] Sketch:
After going through four iterations of the Simplex Method you get to a stage where
the non-basic variables x2 , x4 , x5 or x7 can only have value zero.
That is to say we have:
x0 =
695 3
11
13
5
- x2 - x4 - x5 - x7
7
7
7
7
7
Question 5
Standard form:
Maximize 3x + 4x
1
Subject to
2x + 3x + s = 600
x + x + s = 225
5x + 4x + s = 1000
x + 2x - s = 150
x ,x ,s ,s ,s ,s 0
Not in canonical form because there is no basic variable in the fourth equation. Therefore we add an artificial variable to that equation (r ) and give it a large negative
1
coefficient in the objective function, to penalize it:
Maximize 3x + 4x
1
Subject to
2x + x + s = 600
x + x + s = 225
5x + 4x +s = 1000
x + 2x - s + r = 150
x ,x ,s ,s ,s ,s ,r 0
1
1
x1
x2
s4
s1
s2
s3
r1
-3
-4
+M
s1
600
s2
225
s3
0 1000
r1
-1
150
Not in Canonical form because of +M entry on Z row for one basic variable (r ).
1
Pivot to replace +M on Z row by zero - Z row M*r row:
1
x1
x2
-150M
s1
600
s2
225
s3
1000
r1
-1
150
-1
-2
3/2
-3/2 375
- 150
-2
700
75
-1/3
4/3
M 800
s4
1/3
2/3
-1 250
s2
1/3
-1/3 1
25
s3
7/3
-4/3 0
200
x2
2/3
1/3
200
1
2
3
2
s4
s1
s2
s3
r1
800
M 825
s4
-1
-1 225
x1
-1
75
s3
-7
25
x2
-2
250
x * = 150
2
Z* = 825
Question 6
Then after adding a surplus variable x3 in the inequality above, you can write the
model as
x0 + 3x1 + 2x2 = 0
x1 + x2 = 10
x1 - x3 = 4
x0 + 3x1 + 2x2 + 10 y1 + 10 y2 = 0
x1 + x2 + y1 = 10
x1 - x3 + y2 = 4
To initiate the simplex algorithm, you have to subtract (M =10) times row 2 and (M =10) times row 3 from row 1 to eliminate y1 and y2 :
x1 - x3 + y2 = 4
Question 7
Minimize 15y1 + 120 y2 + 100 y3
Subject to.
y1 + 7 y2 + 3y3 4
y1 + 5y2 + 5y3 5
y1 + 3y2 + 10 y3 9
y1 + 2 y2 + 15y3 11
y1 , y2 , y3 0
Question 8
a) The second constraint implies that, x1 + x2 4.5, which contradicts the first
constraint. If a problem has no feasible solution, then the problem itself is called
infeasible.
b) Here, we could set x2 to zero and let x1 be arbitrarily large. As long as x1 is greater
than 2, the solution will be feasible, and as it gets large the objective function
does too. Hence, the problem is unbounded.
Question 9
Question 10
You can solve the problem geometrically to find the optimal solution is x1 = 2, x2 =
1, z = 40. Since z and x2 changed when an original coefficient was changed, then we
say that the L.P. is sensitive.
XVII. References
Vanderbei R. J. ( year). Linear Programming: Foundations and Extensions
www.princeton.edu/~rvdb/LPbook/onlinebook.pdf
All learners are required to read this book whenever he/she is starting a new
unit or activity. All other links are to help the learner to understand more about
Linear Programming problems
A gentle approach to linear programming
http://www.sce.carleton.ca/faculty/chinneck/po/Chapter1.pdf
J E Beasley , OR-Notes
http://people.brunel.ac.uk/~mastjjb/jeb/or/twomines
OR-NOTES provides a strong and easy to understand approach to the
formulation of the linear programming problems. The examples are well
explained. Students are encouraged to go through some of the worked
examples to strengthen their problem linear programming problem formulation
techniques.
Varaiya, P. Lecture notes on Optimization
http://robotics.eecs.berkeley.edu/~varaiya/papers_ps.dir/NOO.pdf
These notes go hand in hand with the main textbook
Management Science: Linear Programming Notes
http://www.strathcona.bham.ac.uk/Pdfs1%20management%20Course%20Ye
%202/LINEAR%20PROGRAMM%20NOTES.PDF
These notes outline the problem formulation, graphical solution of linear pr
gramming problems and the sensitivity analysis
Spyros,R. An Introduction to Linear Programming and the Simplex Algorithm
http://www2.isye.gatech.edu/~spyros/linear programming/linear programming.
html
McCarl, B. and Spreen, T. H., 2002. DUALITY IN LINEAR PROGRAMMING.
Baker, S. L. (2006) Linear Programming I: Maximization
Linear Programming: A Geometric Approach
http://www.wiley.com/college/sc/sullivan/CH03.pdf
Basic Solutions
http://engr.smu.edu/~barr/ip/ch1/node6.html
Arsham (2007)
http://home.ubalt.edu/ntsbarsh/opre640a/partVIII.htm)
Signature.
Activity
1
Coordinator.
PreAssessment
Signature
Gender
Lecturer.
Reg Number
Activity
2
Activity
3
Activity
4
Activity
5
Activity
Ave
Exam
102
Date
Date
Grade
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Name
University Name
Student Records