Title: Quantitative Analysis
1Quantitative Analysis
2Themes
- These lectures will deal with linear programming.
- We seek ways to find the maximum (or minimum)
value of a linear function subject to a set of
linear constraints. - For example, we might seek to maximise a profit
function subject to a set of resource constraints
concerning capacity, materials and labour to name
a few possibilities. - We will examine the consequences of relaxing
constraints. - For example, how much extra profit could be
generated by obtaining an additional unit of a
scarce resources. - I.e. determining shadow prices.
- In the next session, we will look at some
programming problems that are superficially
similar to linear programming. - Integer programming.
- Binary programming.
3Reference
- Refer to Lapin
- The Linear Programming chapters.
- Almost any intermediate operations research text
will have an equivalent chapter or chapters or
sections that would be useful.
4Concepts
- Object
- Our object is to seek solutions to maximization
and minimization problems in business and other
applications. - Lapin commences with a simple but useful example
relating to production output decision making. - Let us here begin with the underlying mathematics
that makes it possible to find solutions. - Note that real problems are generally too hard to
solve without a computer program. - Too many variables.
- Too many constraints.
5Concepts (cont.)
- Objective function
- A linear function?
- Some examples
- P 5 X1 9 X2 2 X3
- P 4 X1 2 X2 - 5 X3 X4
- I.e. an equation with two or more variables (the
Xs), coefficients (the multipliers or numbers)
and plus and/or minus signs. - If the objective function is non-linear, we need
a different optimization technique.
6Concepts (cont.)
- Constraints
- The constraints for an LP problem must form a
convex set. - A set is convex if the line joining any two
points in the set is always inside the set.
7Concepts (cont.)
- Convex sets
- A half plane is a convex set.
- E.g. Think of half a sheet of flat paper.
- Any line joining two points remains in the half
sheet. - The intersection of any pair convex sets is also
a convex set.
8Concepts (cont.)
- Theorems
- All linear functions defined on a convex set have
their maximum (or minimum) values at an extreme
point of the set. - I.e. We do not have to consider the interior
points in a convex set, only the edges and
corners. - And usually only the corners.
- Any local maximum (or minimum) is the global
maximum (or minimum). - I.e. If we check the values of a linear function
f(.) in a maximization problem as we move around
neighboring corner points X, Y and Z and find
that f(X) lt f(Y) gt f(Z), then f(Y) is the global
maximum value of f(.). - We do not have to check out f(.) at any other
corner
9X2
B (2, 8)
A (0, 8)
C (7, 6)
D (10, 4)
E (10, 0)
X1
O
OABCDE is obviously convex.
10X2
B (2, 8) f 22
A (0, 8) f 16
C (7, 6) f 33 (less)
D (10, 4) f 38 (more)
E (10, 0) f 30 (more)
10
X1
O f 0 (start)
Consider max f 3 X1 2 X2
11A (4, ?)
X2
B (4, 8)
C (7, 5)
D (10, 3)
E (?, 3)
X1
O
ABCDE is obviously convex.
12A (4, ?) f ? (start)
X2
B (4, 8) f 28 (less)
C (7, 5) f 31 (more)
D (10, 3) f 36
E (?, 3) f ?
X1
O
Consider min f 3 X1 2 X2.
13Approach
- Steps
- Define the decision variables.
- I.e. What decisions have to be made to maximize
profit (or minimize cost). - Is it how many of each type of product to
produce? - Is it how many units of particular inputs to use?
- Whatever they are, they will relate to some set
of choices available to the decision maker. - Construct the objective function.
- I.e. A profit (or cost) function.
- It must be linear (otherwise we would need a
different optimization technique). - If must be a function of the decision variables.
14Approach (cont.)
- Steps
- Identify the constraints that limit profits (or
costs). - They must be linear (otherwise we would need a
different optimization technique). - Resource constraints.
- I.e. Decisions must not require the use of more
resources than are available to the decision
maker. - Capacity?
- Time?
- Materials?
- Labour?
- Commitment constraints.
- I.e. The decision maker may have made commits to
supply, or be limited in particular activities by
agreement or by laws or regulations. - Meeting existing orders?
- Complying with emission regulations?
- Honoring workplace agreements with employees?
15Approach (cont.)
- Steps
- Find the optimal values of the decision
variables. - Most problems confronting decision makers in the
real world are too complex to solve manually. - We need computer software that will handle the
task. - As users, we need to supply the program with
- The linear objective function and whether we are
maximizing or minimizing. - The linear constraints that are mainly
inequalities but sometimes equalities. - And we need to be able to interpret the program
output.
16Example 1
- Problem
- Lapin 8.14.
- The marketing manager of Hops Brewery must
determine how many TV spots and magazine
advertisements to purchase within an advertising
budget of 100,000. Each spot is expected to
increase sales by 30,000 cans, whereas each
magazine ad will account for 100,000 cans in
sales. Hops gross profit on sales is 0.10 per
can. One TV spot costs 2,000 each magazine ad
requires an expenditure of 5,000. To have a
balanced marketing program, the advertising
budget must involve no more than 70,000 in
magazines and no more than 50,000 in TV spots. - Determine the net increase in profit for each TV
spot and magazine ad. - Formulate this as a profit maximization problem.
- Solve it graphically.
17Example 1 (cont)
- Decision variables
- The manager must decide how to allocate the
budget between the two modes of promotion. - Let XTV number to TV spots used.
- Let XAD number of magazine ads used.
- Objective function
- Profit P.
- Each TV spot generates 0.10 30,000 - 2,000
1 K. - I.e. Net revenue from sales less cost of the
spot. - Each magazine ad generates 0.10 100,000 -
5,000 5 K. - I.e. Net revenue from sales less cost of the ad.
- P XTV 5 XAD ( K)
18Example 1 (cont)
- Constraints
- The manager must not exceed the budget.
- 2,000 XTV 5,000 XAD ? 100,000.
- I.e. 2 XTV 5 XAD ? 100 ( K).
- The expenditure should be balanced.
- 2,000 XTV ? 50,000.
- I.e. 2 XTV ? 50 ( K) or XTV ? 25.
- 5,000 XAD ? 70,000.
- I.e. 5 XAD ? 70 ( K) or XAD ? 14.
- Non-negativity.
- The manager cannot choose negative levels of
promotion which is a meaningless concept. - XTV ? 0.
- XAD ? 0.
19XAD
A (0, 14)
C (25, 10)
B (15, 14)
D (25, 0)
XTV
O
20Solution XTV 15, XAD 14 and Pmax 85 ( K)
XAD
20
A (0, 14) P 70 (more)
B (15, 14) P 85 (more)
C (25, 10) P 75 (less)
D (25, 0) P 25
50
XTV
O P 0 (start)
21Dimensions
- The problem
- This looks easy for simple problems.
- More constraints simply means that there are more
corners to identify. - More than two decision variables means that we
cannot use a graph. - We normally have problems defined in
multi-dimensional spaces. - We need a mathematical algorithm that lets us do
what we can do in two-dimensional space with a
graph in multi-dimensional space. - SIMPLEX is such a method but we still need a
computer program when we have many dimensions and
many constraints. - Our arithmetic will almost certainly fail us in
large problems.
22Introduction to SIMPLEX
- Problem 2
- A furniture company makes tables and chairs that
yield unit profits of 8 and 6 respectively.
Each table takes 4 square meters of wood and 2
hours of machine time where as each chair takes 2
square meters of wood and 4hours of machine time.
Wood is restricted to 60 square meters, and
machine time to 48 hours per week. How many
tables and chairs should be made to maximize
total profits. - Let XT the number of tables made.
- Let XC the number of chairs made.
- Objective Function Max 8 XT 6 XC ()
- Constraints
- 4 XT 2 XC ? 60 (Wood)
- 2 XT 4 XC ? 48 (Machine Time)
- As XT and XC cannot be negative, there are also
non-negativity constraints - XT, XC ? 0
23Introduction to SIMPLEX
- Problem 2 (cont.)
- Standard form.
- Add slack variables so that the constraints
become equalities. - ST unused time.
- SW unused wood.
- Naturally unused resources make no contribution
to profit. - Objective function
- Max 8 XT 6 XC 0 ST 0 SW ()
- Constraints
- 4 XT 2 XC SW 60 (Wood)
- 2 XT 4 XC ST 48 (Machine Time)
- XT, XC ? 0
- SIMPLEX begins with a possible solution XT and XC
0, SW 60, ST 48 and P 0. - It then moves to the adjacent corner that
offers the greatest increase in P. - It repeats this process until it finds a corner
where all adjacent corners yield small values
of the objective function. - When it has, it has found the optimal solution.
24Using Excel Solver
- Problem 2
- Objective Function Max 8 XT 6 XC ()
- Constraints
- 4 XT 2 XC ? 60 (Wood)
- 2 XT 4 XC ? 48 (Machine Time)
- XT, XC ? 0
- We set this up in an Excel spreadsheet.
- Check the next side.
25B9 contains the value of XT which is initially
set at XT 0.
B10 contains the value of XC which is initially
set at XC 0.
26In B5, write the profit function expressed in
terms of B9 (XT) and B10 (XC). Use 8B9
6B10.
The value is presently zero because B9 and B10
are both initially set at zero.
27In C14, write the right hand side value of the
wood constraint. In C15, write the right hand
side value of the machine time constraint.
28In B14, write the left hand side value of the
wood constraint in terns of B9 and B10. Use
4B9 2B10. In B15, write the left hand side
value of the wood constraint in terns of B9 and
B10. Use 2B9 4B10.
Both values are presently zero because B9 and B10
are both initially set at zero.
29Now we are ready to use Solver which is in the
Tools menu.
If it is not there, look for it in Tools/Add-Ins.
If it is not in Add-Ins, reinstall Excel and
include all of the Add-Ins.
30The Solver window appears as shown. The areas
might have values from a previous run, but they
can be deleted.
31Write the cell address for the objective (profit)
function here.
32Write the constraints here. Use Add, Change and
Delete. Click anywhere in the area then click Add.
33Write the cell address of the left hand side of
the first constraint here.
Write the cell address of the right hand side of
the first constraint here.
Choose the the relationship between the left hand
side and the right hand side here.
34It should look like this, but we are not ready
just yet. We need to click Options first.
35Click this one.
36After clicking Solve, the Results window
appears. Choose whatever seems appropriate
(usually everything in here.
37The Excel page changes to show the maximum
profit and the optimal values of the decision
variables.
The details are here.
38The maximum profit and the optimal values of the
decision variables.
39Slack variables
- Unused resources.
- If a resource is full used in the optimal
solution, the associated slack variable is zero. - If not, it will have a positive value showing how
much is unused.
40Both slack variables are zero meaning That both
resources are fully utilized.
41Surplus variables
- More than the minimum.
- If there are a minimum constraints in a problem,
there are surplus variables. - Such a variable would show the amount by which
the minimum was exceeded. - Suppose in the problem we add the additional
constraint that we have to produce at least 3
tables. - The spreadsheet would appear as follows and the
solver window adjusted accordingly. - Check the output.
- Note that Excel calls the surplus variables
slack.
42Note extra constraint. In B16 write the left hand
side XT (cell Address B9) and in C16 the
right hand side minimum.
43(No Transcript)
44In the optimal solution, we produce 12
tables. This is 9 more than the minimum.
45Sensitivity
- Key question
- What is the value of extra resources or
relaxing other constraints? - E.g. Obtaining greater capacity.
- These are called the shadow prices.
- If a resource is not fully utilized, extra units
would be worthless and the shadow price would be
zero.
46The shadow prices. An extra unit of wood would
increase profit by 1.67. An extra unit of
machine time would increase profit by 0.67.