Solution Techniques  Models   Thousands (or millions) of variables Thousands (or millions) of constraints  Complex models tend to be valid Is the model tractable?  Solution techniques  IE 312

Download Report

Transcript Solution Techniques  Models   Thousands (or millions) of variables Thousands (or millions) of constraints  Complex models tend to be valid Is the model tractable?  Solution techniques  IE 312

Solution Techniques

Models


Thousands (or millions) of variables
Thousands (or millions) of constraints

Complex models tend to be valid
Is the model tractable?

Solution techniques

IE 312
1
Definitions




Solution: a set of values for all variables
n decision variables: solution n-vector
Scalar is a single real number
Vector is an array of scalar components
IE 312
2
Some Vector Operations

Length (norm) of a vector x
x =
n
2
j
x
j =1
x1 + y1
M
x +y =
xn + yn

Sum of vectors

Dot product ofn vectors
x y=
j =1
xj y j
IE 312
3
Neighborhood/Local Search

Find an initial solution

Loop:

Look at “neighbors” of current solution

Select one of those neighbors

Decide if to move to selected solution

Check stopping criterion
IE 312
4
Example: DClub Location


Location of a discount department store
Three population centers





Center 1 has 60,000 people
Center 2 has 20,000 people
Center 3 has 30,000 people
Maximize business
Decision variables: coordinates of
location
IE 312
5
Constraints
Must avoid congested centers (within 1/2 mile):
x1  (1)
2
+ ( x2  3) 2 = (1 / 2) 2
( x1  1) 2 + ( x2  3) 2 = (1 / 2) 2
( x1  0) 2 + ( x2  (4))2 = (1 / 2) 2
IE 312
6
Objective Function
60
max p( x1 , x2 ) =
2
2
1 + ( x1 + 1) + ( x2  3)
20
+
2
2
1 + ( x1  1) + ( x2  3)
30
+
2
2
+
+
+
1 ( x1 ) ( x2 3)
IE 312
7
Objective Function
IE 312
8
Searching
5
4
3
2
1
0
-1
-2
-3
-4
-5
-5
-4
-3
-2
-1
0
IE 312
1
2
3
4
5
9
Improving Search





Begin at feasible solution
Advance along a search path
Ever-improving objective function value
Neighborhood: points within small
positive distance of current solution
Stopping criterion: no improvement
IE 312
10
Local Optima



Improving search finds a local optimum
May not be a global optimum
(heuristic solution)
Tractability: for some models there is only
one local optimum (which hence is global)
IE 312
11
Selecting Next Solution

Direction-step approach
x
( t +1)
= x(t ) + l x
Step size


Search direction
Improving direction: objective function better
(t )
(t )
+
l
x
for x
for all value of l that
x than
are sufficiently small
Feasible direction: not violate constraints
IE 312
12
Step Size


How far do we move along the selected
direction?
Usually:



Maintain feasibility
Improve objective function value
Sometimes:

Search for optimal value
IE 312
13
Detailed Algorithm
Initialize: choose initial solution x(0); t=0
If no improving direction x, stop.
Find improving feasible direction x (t+1)
Choose largest step size lt+1 that remains
feasible and improves performance
4 Update
0
1
2
3
x
( t +1)
= x + lt +1 x
(t )
( t +1)
Let t=t+1 and return to Step 1
IE 312
14
Stopping

Search terminates at local optimum



If improving direction exists cannot be a local
optimum
If no improving direction then local optimum
Potential problem with unboundedness

Can improve performance forever

Search does not terminate
IE 312
15
Local Optimum
5
4
3
2
1
0
-1
-2
-3
-4
-5
-5
-4
-3
-2
-1
0
IE 312
1
2
3
4
5
16
Improving Search

Still a bit abstract
‘Find improving feasible direction’

How?

IE 312
17
Smooth Functions



Assume objective function is smooth
What does this mean?
You can find the derivative
Smooth
Not Smooth
IE 312
18
Gradients


Function
f (x) = f ( x1 , x2 ,...,xn )
The gradient is found from the partial
derivatives
f (x) = ( f / x1 , f / x2 ,..., f / xn )

Note that the gradient is a vector
IE 312
19
Example
60
max p( x1 , x2 ) =
2
2
1 + ( x1 + 1) + ( x2  3)
20
+
2
2
1 + ( x1  1) + ( x2  3)
30
+
2
2
1 + ( x1 ) + ( x2 + 3)
IE 312
20
Partial Derivatives
p( x1 , x2 )
=
x1
60×
1 + ( x
1
+1) + ( x2 3)
2
2
x1
2
2 2
1 + ( x1 +1) + ( x2 3)
120×( x1 +1)
=
+...
2
2
2
+
+
+

1 ( x1 1) ( x2 3)
[
]
[

+...
]
IE 312
21
Plotting Gradients
5
4
3
2
1
0
-1
-2
-3
-4
-5
-5
-4
-3
-2
-1
0
IE 312
1
2
3
4
5
22
Direction of Gradients

Gradients are



perpendicular to contours of objective
function
direction most rapid objective value
increase
Using gradients as direction gives us
the steepest descent/ascent (greedy)
IE 312
23
Effect of Moving

When moving in direction x:
The objective function is increased if

(Improving direction for maximization)
The objective function is decreased if

f ( x)  x  0
f ( x)  x < 0
IE 312
24
Feasible Direction


Make sure the direction is feasible
Only have to worry about active
constraints (tight/binding constraints)
No active constrains
x2 <= 6
x1<= 9
x1
IE 312
One active constraint
Active if equality
sign holds!
25
Linear Constraints

Direction Dx is feasible if and only if
n
(iff)
a  x  0, if  a j Dx j  b
a  x  0, if
a  x = 0, if
j =1
n
 a Dx
j
b
 a Dx
j
=b
j =1
n
j =1
IE 312
j
j
26
Comments

The gradient gives us



A greedy improving direction
Building block for other improving
directions (later)
Conditions


Check if direction is improving (gradient)
Check if direction is feasible (linear)
IE 312
27
Validity versus Tractability



Which models are tractable for
improving search?
Stops when it encounters a local
optimum
This is guaranteed to be a global
optimum only if it is unique
IE 312
28
Unimodal Functions

Unimodal functions:

Straight line from a point to a better point
is always an improving direction
IE 312
29
Typical Unimodal Function
IE 312
30
Linear Objective

Linear objective functions
f ( x) =
n
j =1

cj xj = c x
Unimodal for both maximization and
minimization
IE 312
31
Check
First calculate
n
n
j =1
j =1
f (x (1) )  f (x ( 2 ) ) =  c j x (j 2)   c j x (j1)

n
= cj xj  x j
j =1
( 2)
(1)

= c  (x ( 2 )  x (1) )
= f (x (1) )  (x ( 2 )  x (1) )
Then apply our test to Dx = x
( 2)
 x (1)
IE 312
32
Optimality



Assume our objective function is unimodal
Then every unconstrained local optimum is an
unconstrained global optimum
Note that none of the constraints can be
active (tight)
IE 312
33
Convexity


Now lets turn to the feasible region
A feasible region is convex if any line
segment between two points in the
region is contained in the region
IE 312
34
Line Segments

Representing a line
(1)
x

+ lx
( 2)
x
(1)
, l
[0,1]
To prove convexity, we have to show
that for any points in the region, all
points that can be represented as above
are also in the region
IE 312
35
Linear Constraints


If all constraints are linear then the feasible
region is convex
Suppose wen have two feasible npoints:
(1)
a
x
 j j  b and
j =1

( 2)
a
x
 j j b
j =1
How about a point on the line between:


x = x(1) + l x( 2)  x(1) = (1  l )x(1) + lx( 2) ?
IE 312
36
Verify Constraints Hold
n


n
(1)
( 2)
(1)
( 2)
a
(
1

l
)
x
+
l
x
=
a
(
1

l
)
x
+
a
l
x
 j
 j
j
j
j
j
j
j =1
j =1
n
n
j =1
j =1
=  a j (1  l ) x (j1) +  a j lx (j2 )
n
n
j =1
j =1
(1  l ) a j x (j1) + l  a j x (j2 )
 (1  l )b + lb = b
IE 312
37
Example
x2
x2  6
x1  9
x1
IE 312
38
Tractability



(This is the reason we are defining all these
term!)
The most tractable models for improving search
are models with

unimodal objective function

convex feasible region
Here every local optimum is global
IE 312
39
Improving Search Algorithm
0 Initialize: choose initial solution x(0); t=0
1 If no improving direction Dx, stop.
2 Find improving feasible direction Dx (t+1)
3 Choose largest step size lt+1 that remains
feasible and improves performance
4 Update
x
(t +1)
= x + lt +1Dx
(t )
(t +1)
Let t=t+1 and return to Step 1
IE 312
40
Initial Feasible Solutions

Not always trivial to find an initial solution


Initial analysis:



Thousands of constraints and variables
Does a feasible solution exist?
If yes, find a feasible solution
Two methods


Two-phase method
Big-M method
IE 312
41
Two-Phase Method


Phase I



Phase II

Choose a solution to model and construct a new
model by adding artificial variables for each
violated constraint
Assign values to artificial variables.
Perform improving search to minimize sum of
artificial variables
If terminate at zero then feasible model and
continue, otherwise stop
Delete artificial components to get feasible
solution
Start an improving search
IE 312
42
Crude Oil Refinery
min 20x1 + 15x2
s.t . 0.3 x1 + 0.4 x2  2.0 (gasoline)
0.4 x1 + 0.2 x2  1.5 (jet fuel)
0.2 x1 + 0.3 x2  0.5 (lubricants)
x1  9
x2  6
x1 , x2  0
IE 312
43
Artificial Variables


Select a convenient solution
x1 = 0, x2 = 0
Add artificial variables for violated constraints
0.3x1 + 0.4 x2 + x3  2.0
0.4 x1 + 0.2 x2 + x4  1.5
0.2 x1 + 0.3x2 + x5  0.5
x1  9
x2  6
x1 , x2 , x3 , x4 , x5  0
IE 312
44
Phase I Model
min f ( x1 , x2 , x3 ) = x1 + x2 + x3
s.t.
0.3x1 + 0.4 x2 + x3  2.0
0.4 x1 + 0.2 x2 + x4  1.5
0.2 x1 + 0.3x2 + x5  0.5
x1  9
x2  6
x1 , x2 , x3 , x4 , x5  0
IE 312
45
Phase I Initial Solutions

As before

To assure feasibility
x1(0) = 0, x2(0) = 0
x3(0) = 2, x3(0) = 1.5, x4(0) = 0.5

Thus, the initial solution is
x
( 0)
= (0,0,2,1.5,0.5)
IE 312
46
Phase I Outcomes


We cannot get negative numbers and
problem cannot be unbounded
Three possibilities

Terminate with f =0


Terminate at global optimum with f > 0


Start Phase II with final solution as initial solution
Problem is infeasible
Terminate at local optimum with f > 0

Cannot say anything
IE 312
47
Big-M Method


Artificial variables as before
Objective function
min20x1 + 15x2 + M ( x3 + x2 + x5 )


original objective

penaltyfor violating constraints
Combines Phase I and Phase II search
IE 312
48
Terminating Big-M



If terminates at local optimum with all
artificial variables = 0, then also local
optimum for original problem
If M is ‘big enough’ at terminates at global
optimum with some artificial variables >0,
then original problem infeasible
Cannot say anything in between
IE 312
49
Linear Programming

We know what leads to high tractability:



We know how to guarantee this



Unimodal objective function
Convex feasible region
Linear objective function
Much stronger!
Linear constraints
When are linear programs valid?
IE 312
50
Allocation Models

Scarce resource



Allocate resources to competing ‘jobs’
Decision variables:


Land, capital, time, fuel, etc.
How much to allocate to each job
Constraints:


Limitation on resources
Other dynamics
IE 312
51
Forest Service Allocation


Manage 191 acres of national forest
Jobs (Prescriptions):





Logging
Grazing
Wilderness preservation
7 analysis areas
This is a simplified version of an actual application
(fewer variables/constraints)
IE 312
52
Analysis Goals

Maximize the net present value (NPV) of the
land, such that

we produce at least 40 million board feet of timber,

we have at least 5 thousand animal unit months of
grazing, and

we keep wilderness index at least 70.
IE 312
53
Data
Area Acres Use NPV Timber Grazing Wild
si
t i,j
g i,j w i,j
j p i,j
1
75
2
90
3
140
4
60
5
212
6
98
7
113
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
503
140
203
675
100
45
630
105
40
330
40
295
105
460
120
490
55
180
705
60
400
310
50
0
198
46
0
210
57
0
112
30
0
40
32
0
105
25
0
213
40
0
0.01
0.04
0
0.03
0.06
0
0.04
0.07
0
0.01
0.02
0
0.05
0.08
0
0.02
0.03
0
0.02
0.04
0
IE 312
40
80
95
55
60
65
45
55
60
30
35
90
60
60
70
35
50
75
40
45
95
54
Objective: Maximize NPV
xi , j = thousandsof acresin area i managedby prescription j
7
3
max pi , j xi , j = 503x1,1 + 140x1, 2 +203x1,3 + ...
i =1 j =1
... + 705x7,1 + 60x7, 2 + 400x7,3
IE 312
55
Constraints

All acres in3 an area are allocated
x
j =1

i, j
= s j , i
Performance requirements are met
7
3
 t
i =1 j =1
7
3
 g
i =1 j =1
x  40,000 (timber)
i, j i, j
x  5 (grazing)
i, j i, j
1 7 3
wi , j xi , j  70 (wilderness)

788 i =1 j =1
IE 312
56
Blending Models


Best mix of ingredients
Applications





chemicals
animal feed
metals
diets
Example: Fagersta AB - Swedish Steel
Mill
IE 312
57
Steel Mill

Charging a furnish


Combine



1000 kilogram charge
Scrap in inventory
Pure blend
Blend with right % of chemical elements


Iron
Other: Carbon, Nickel, Chromium, Molybdenum
IE 312
58
Formulation

Decision variables

How much of each available ingredient to use
x j = kilogramsof ingredient j included in charge
j=1,2,…,7


Four supplies of scrap (1,2,3,4)
Three pure materials (5,6,7)
IE 312
59
Formulation (cont.)

Constraints

Correct amount

Composition constraints
x1 + x2 + x3 + x4 + x5 + x6 + x7 = 1000

Properties of the resulting blend

 fractionin   amountof jth   allowed fraction  blend
j  jth ingredient   ingredientused  or  in theblend    total

 

 

IE 312
60
Example Constraints
7
0.008x1 + 0.0070x2 + 0.0085x3 + 0.0040x4  0.0065 x j
j =1
7
0.008x1 + 0.0070x2 + 0.0085x3 + 0.0040x4  0.0075 x j
j =1
7
0.180x1 + 0.032x2 + 1.0 x5  0.0030 x j
j =1
7
0.180x1 + 0.032x2 + 1.0 x5  0.0035 x j
j =1
7
0.120x1 + 0.011x2 + 1.0 x6  0.010 x j
j =1
7
0.120x1 + 0.011x2 + 1.0 x6  0.012 x j
j =1
7
0.001x2 + 1.0 x7  0.011 x j
j =1
7
0.001x2 + 1.0 x7  0.013 x j
j =1
IE 312
61
Other Constraints

Availability
x1  75
x2  250

Positive Amounts
x j  0, j = 1,2,...,7
IE 312
62
Objective Function


Minimize Cost
min16x1 + 10x2 + 8x3 + 9x4 + 48x5 + 60x6 + 53x7
Note that the pure additives are very
expensive!
IE 312
63
Ration Constraints

Bound quotients of linear functions by a
constant
7
0.008x1 + 0.0070x2 + 0.0085x3 + 0.0040x4  0.0065 x j
j =1
0.008x1 + 0.0070x2 + 0.0085x3 + 0.0040x4
 0.0065
x1 + x2 + x3 + x4 + x5 + x6 + x7


Not linear!
Can often be converted to linear
constraints
IE 312
64
Linear Programming Models

Allocation

Blending

Operations Planning

Shift Scheduling
IE 312
65
Operations Planning

What to do and when to do it?

Tubular Products

Division of Babcock and Wilcox

New mill

Three existing mills

Optimal distribution of work?
IE 312
66
Problem Data
Product
Standard
1 .5" thick
2 .5" thin
3 1" thick
4 1" thin
5 2" thick
6 2" thin
7 8" thick
8 8" thin
Pressure
1 .5" thick
2 .5" thin
3 1" thick
4 1" thin
5 2" thick
6 2" thin
7 8" thick
8 8" thin
Mill 1
Mill 2
Mill 3
Mill 4
Weekly
Cost Hours Cost Hours Cost Hours Cost Hours Demand
90
80
104
98
123
113
-
0.8
0.8
0.8
0.8
0.8
0.8
-
75
70
85
79
101
94
160
142
0.7
0.7
0.7
0.7
0.7
0.7
0.9
0.9
70
65
83
80
110
100
156
150
0.5
0.5
0.5
0.5
0.5
0.5
0.5
0.5
63
60
77
74
99
84
140
130
0.6
0.6
0.6
0.6
0.6
0.6
0.6
0.6
100
630
500
980
720
240
75
22
140
124
160
143
202
190
-
1.5
1.5
1.5
1.5
1.5
1.5
-
110
96
133
127
150
141
190
175
0.9
0.9
0.9
0.9
0.9
0.9
1.0
1.0
-
-
122
101
138
133
160
140
220
200
1.2
1.2
1.2
1.2
1.2
1.2
1.5
1.5
50
22
353
55
125
35
100
10
IE 312
67
Formulation

Decision Variables
x p,m = amountof product p producedat mill m
(pounds/week)

Objective
cost of product p


16
4
min  c p ,m x p ,m
p =1 m =1
IE 312
68
Constraints

Demand is met
4
x
m =1

p ,m
Capacity is ok
16
x
p =1

 d p , p = 1,2,...,16
p ,m
 bm , m = 1,2,3,4
x p,m  0, p, m
Non-negativity
IE 312
69
Canadian Forest Products
purchase
logs
peel
logs
purchase
veneer
dry and
process
press
sheets
IE 312
sand and
trim
70
Study Objectives

Stages of Production - More Complex

Objective of OR analysis

How to operate production facilities

Maximize contributed margin



Sales - Wood cost
Fixed costs: labor, maintenance, etc.
Constraints: availability of wood, market for
products, capacity of plants
IE 312
71
Production Yield Data
Available per month
Cost per log ($ Canadian)
A 1/16" green veneer (ft 2)
B 1/16" green veneer (ft 2)
C 1/16" green veneer (ft 2)
A 1/8" green veneer (ft 2)
B 1/8" green veneer (ft 2)
C 1/8" green veneer (ft 2)
Veneer Yield (ft2)
Vendor 1 Vendor 2
Good Fair Good Fair
200 300
100 1000
340 190
490 140
400 200
400 200
700 500
700 500
900 1300
900 1300
200 100
200 100
350 250
350 250
450 650
450 650
IE 312
72
Availability and Costs
1/16" Green Veneer 1/8" Green Veneer
A
B
C
A
B
C
Available (ft 2/month) 5000 25000 40000 10000 40000 50000
Cost ($/ft 2)
1.00 0.30 0.10 2.20 0.60 0.20
IE 312
73
Composition of Products
1/4" Plywood Sheets
AB
AC
BC
1/16 A
1/16 B
1/16 B
1/2" Plywood Sheets
AB
AC
BC
Front veneer
1/16 A
1/16 B
1/16 B
1/8 C
1/8 C
1/8 C
Core veneer
1/8 C
1/8 C
1/8 C
1/8 B
1/8 B
1/8 B
1/8 C
1/8 C
1/8 C
Back veneer
1/16 B
1/16 C
1/16 C
1/16 B
1/16 C
1/16 C
Market/month
1000
4000
8000
1000
5000
8000
Price
$ 45.00 $ 40.00 $ 33.00 $ 75.00 $ 65.00 $ 50.00
Pressing time
0.25
0.25
0.25
0.40
0.40
0.40
IE 312
74
Decision Variables
wq , w,t = logs of quality q bought from vendorv and peeledinto thicknesst
xt , g = ft 2 of thicknesst , grade g veneerpurchaseddirectly
yt , g , g ' = sheetsof thicknesst used as grade g' afterprocessingfromgrade g
zt , g , g ' = sheetsof thicknesst , frontgrade g , back grade g', pressed and sold
IE 312
75
Continuous Variables



Treat all variables as continuous
Continuous models more tractable
Is it equally valid?



Does one unit back or forth really matter?
If no, then ok to use continuous
approximation
Example: Does $0.01 ever matter?
IE 312
76
Objective
max - (log cost)- (purchasedveneercost)+ (sales income)
IE 312
77
Constraints



Log availability
wG,1,1/16 + wG,1,1/ 8  200,...
Purchased veneer availability
x1/16, A  5000,...
Pressing capacity
z1/ 4, A, B  1000,...
IE 312
78
Balance Constraints


Must link log and veneer purchasing
Balance constraint

assures in-flows equal or exceed out-flows
for each stage of production
400wG ,1,1/16 + 200wF ,1,1/16 + 400wG , 2,1/16 + 200wF , 2,1/16 + x1/16, A
 35y1/16, A, A + 35y1/16, A, B
Etc.
IE 312
79
Assembly for Two Products
Assembly
1
Assembly
2
Part
3
Part
3
Part
4
Assembly
2
Part
3
Part
3
IE 312
Part
4
80
Balance Equations

Decision Variable
x j = number of j produced

Assembly 2 must be at least assembly 1

Must have enough parts
x2  x1
x3  2 x1 + 1x2
x4  1x1 + 2 x2
IE 312
81
Shift Scheduling

Work fixed

Plan resources to do work

Shift scheduling/staff planning models

How many types of workers/shifts
IE 312
82
Ohio National Bank



Check processing center
All checks must clear by 10 PM
Check arrivals:
Hour
Arrivals Hour Arrivals
11:00 AM
10
5:00 PM
32
12:00 PM
11
6:00 PM
50
1:00 PM
15
7:00 PM
30
2:00 PM
20
8:00 PM
20
3:00 PM
25
9:00 PM
8
4:00 PM
28
IE 312
83
Workers

Two types:

Full time (8 hour shift, 1 hour lunch)





$11 hour
+ $1 night
150% overtime
1000 checks/hour
Part time (4 hour shift)


$7 hour
800 check/hour
IE 312
84
All Possible Shifts
Full Time Shifts
11
12
13
11:00 AM R
12:00 PM R
R
1:00 PM
R
R
R
2:00 PM
R
R
R
3:00 PM
R
R
4:00 PM
R
R
5:00 PM
R
R
6:00 PM RN RN RN
7:00 PM RN RN RN
8:00 PM OT RN RN
9:00 PM
OT RN
Start
11
R
R
R
R
-
12
R
R
R
R
-
Part Time Shifts
13
14
15
16
R
R
R
R
R
R
R
R
R
R
R
R
R
RN
RN
-
IE 312
17
R
RN
RN
RN
-
18
RN
RN
RN
RN
85
Decision Variables
xh = full time workersst artingat h = 11,12,13
yh = full time workersw/overt ime st artingat h = 11,12
z h = part timeworkersst artingat h = 11,...,18
IE 312
86
Objective Function
min90x11 + 91x12 + 92x13 + 18y11 + 18y12 + 28z11 + 28z12
+ 28z13 + 28z14 + 29z15 + 30z16 + 31z17 + 32z18
IE 312
87
Constraints

No more than 35 operators on duty
x11 + z11  35 (11AM machines)
M

Overtime limits y11  1 x11
2
1
y12  x12
2
y11 + y12  20
IE 312
88
Covering Constraints

Shift provides enough workers
 (output/worker)(number on duty)  requirement
shifts
1x11 + 0.8 z11  10  w12
1x11 + 1x12 + 0.8 z11 + 0.8 z12  11+ w12  w13
M
IE 312
89


Example
Government agency
Clerical workers can work 4x 10-hour days/week
j = 1 Monday-Wednesday-Thursday-Friday
j = 2 Monday-Tuesday-Thursday-Friday
j = 3 Monday-Tuesday-Wednesday-Friday

Need:



Monday - 10 workers
Friday 9 workers, and
Tuesday - Thursday 7 workers
IE 312
90
Formulation

Decision variables

LP Model
x j = number of employeesworkingpatternj
min x1 + x2 + x3
s.t. x1 + x2 + x3  10 (cover Monday)
x2 + x3  7 (cover Tuesday)
x1 + x3  7 (cover Wednesday)
x1 + x2  7 (cover Thursday)
x1 + x2 + x3  9 (cover Friday)
x1 , x2 , x3  0
IE 312
91
Time-Phased Models


Static Models

One point in time

Planning or design stage decisions
Dynamic Models

Account for decision over time

Operational decisions
IE 312
92
Institutional Food Services
(IFS) Cash Flow


Supplies food to restaurants, schools,
etc.
Cash flow decisions
1
Projected Weekly Amount/Week
2
3
4
5
6
750 $ 1,200 $ 2,100 $ 2,250 $
180 $
Item
Cash sales s t
$
600 $
330 $
540
Accounts receivable r t
$
770 $ 1,260 $ 1,400 $ 1,750 $ 2,800 $ 4,900 $ 5,250 $
420
Accounts payable p t
$ 3,200 $ 5,600 $ 6,000 $
480 $
880 $ 1,440 $ 1,600 $ 2,000
Expenses e t
$
940 $
990 $
350 $
400 $
550 $
IE 312
350 $
7
8
350 $
410
93
System Dynamics



Cash sales and accounts receivable result in
immediate income to checking account
Accounts payable are due in 3 weeks but get
2% discount if paid immediately
Bank





$4 million line of credit
0.2% interest/week
Must have 20% of borrowed amount in checking
Short-term money market with 0.1%/week
$20,000 safety balance in checking
IE 312
94
Decision Variables

Decision Variables
g t = amountborrowedin week t
ht = amountof debt paid in week t
wt = accountspayabledelayed until week t + 3

xt = amountinvestedin moneymarketin week t
Define for convenience
yt = cumulativeline of credit debt in week t
zt = cash on hand during week t
IE 312
95
Balance Constraints

General time-phased models
 starting  impactof   starting 

 
 

 levelin  +  periodt  =  levelin 
 periodt   decisions  periodt + 1

 
 


Cash flow models
 cash in   net gain in   cash in 

 + 
 = 

 periodt   periodt   periodt + 1
IE 312
96
Net Gain in Each Period

Note that we carry both cash and debt
Cost Increments
Funds borrowed in week t
Investment principal from week t-1
Interest on investment in week t-1
Cash sales from week t
Accounts receivable for week t
Cash Decrements
Borrowing paid off in week t
Investment in week t
Interest on debt in week t-1
Expenses paid in week t
Accounts payable paid with discount for week t
Accounts payable paid without discount for week t-3
IE 312
97
Balance Constraints

Cash balance
zt = zt 1 + gt  ht + xt 1  xt + 0.001xt 1  0.002yt 1
+ st  et + rt  0.98( pt  wt )  wt 3

Debt balance
yt = yt 1 + gt  ht
IE 312
98
Linear Programming Model
8
8
8
t =1
t =1
t =1
min 0.002 yt + 0.02 wt  0.001 xt
s.t .
zt = zt 1 + g t  ht + xt 1  xt + 0.001xt 1  0.002yt 1
+ st  et + rt  0.98( pt  wt )  wt 3
yt = yt 1 + g t
yt  4000
zt  0.20 yt
wt  pt
zt  20
0  g t , ht , wt , xt , yt , zt
IE 312
99
Optimal Solution
Decision Variable
Borrowing
Debt payment
Payables delayed
Short-term investments
Cumulative debt
Cumulative cash
1
$ 100.0
$
$ 2,077.6
$
$ 100.0
$ 20.0
2
$ 505.7
$
$ 3,544.5
$
$ 605.7
$ 121.1
Optimal Weekly Amount for Weeks
3
4
5
6
$ 3,394.3 $
$ 442.6 $
$
$ 442.5 $
$ 2,715.3
$ 1,138.5 $
$
$
$
$
$
$
$ 4,000.0 $ 3,557.4 $ 4,000.0 $ 1,284.7
$ 800.0 $ 711.5 $ 800.0 $ 256.9
IE 312
7
8
$
$ 1,284.7
$
$ 2,611.7
$
$ 20.0
$
$
$
$ 1,204.3
$
$ 20.0
100
Time Horizons

Fixed time horizon





usual case
problems with boundaries
start with ‘typical’ numbers
condition to assure ends ‘reasonably’
Infinite time horizon


wrap around
(output of last stage input to the first stage)
IE 312
101
Example: Balance Constraints

Decision variables
xq = thousandsof snow shovelsproducedin quarter q
iq = thousandsof snow shovelsheld in inventory

Demand: 11000, 48000, 64000, 15000
 beginning
 ending 

 + production = demand + 

 inventory
 inventory
0 + x1 = 11+ i1
i1 + x2 = 48 + i2
i2 + x3 = 64 + i3
i3 + x4 = 15 + i4
IE 312
102
“Typical” Initial Inventory
 beginning
 ending 

 + production = demand + 

 inventory
 inventory
9 + x1 = 11+ i1
i1 + x2 = 48 + i2
i2 + x3 = 64 + i3
i3 + x4 = 15 + i4
IE 312
103
Wrapper (Infinite Horizon)
 beginning
 ending 

 + production = demand + 

 inventory
 inventory
i4 + x1 = 11+ i1
i1 + x2 = 48 + i2
i2 + x3 = 64 + i3
i3 + x4 = 15 + i4
IE 312
104