No Slide Title

Download Report

Transcript No Slide Title

Lecture 3 – Classic LP
Examples
Topics
• Employee scheduling problem
• Energy distribution problem
• Feed mix problem
• Cutting stock problem
• Regression analysis
• Model Transformations
Examples of LP Formulations
1. Employee Scheduling
Macrosoft has a 24-hour-a-day, 7-days-a-week toll
free hotline that is being set up to answer questions
regarding a new product. The following table
summarizes the number of full-time equivalent
employees (FTEs) that must be on duty in each time
block.
Interval
1
2
3
4
5
6
Time
0-4
4-8
8-12
12-16
16-20
20-0
FTEs
15
10
40
70
40
35
Constraints for Employee Scheduling
• Macrosoft may hire both full-time and part-time
employees. The former work 8-hour shifts and the
latter work 4-hour shifts; their respective hourly
wages are $15.20 and $12.95. Employees may start
work only at the beginning of 1 of the 6 intervals.
• Part-time employees can only answer 5 calls in the
time a full-time employee can answer 6 calls. (i.e., a
part-time employee is only 5/6 of a full-time
employee.)
• At least two-thirds of the employees working at any
one time must be full-time employees.
Formulate an LP to determine how to staff
the hotline at minimum cost.
Decision Variables
xt = # of full-time employees that begin the day at the
start of interval t and work for 8 hours
yt = # of part-time employees that are assigned interval t
(4  12.95)
(8  15.20)
min
s.t.
121.6(x1 +
•••
+ x6) + 51.8(y1 +
x1
+
x6 +
x1
+
x2 +
x2
+
x3 +
x3
+
x4 +
x4
+
x5 +
x5
+
x6 +
5
6
5
6
5
6
5
6
5
6
5
6
•••
+ y6)
y1

15
y2

10
y3

40
y4

70
y5

40
y6

35
All shifts must
be covered
PT employee is 5/6 FT employee
More constraints:
x1 + x6
 2 (x6 + x1 + y1)
x1 + x2 
..
.
x5 + x6 
3
2 (x + x + y )
1
2
2
3
2
(x + x6 + y6)
3 5
xt yt t =1,2,…,6
At least 2/3
workers must
be full time
Nonnegativity
2. Energy Generation Problem (with piecewise linear objective)
Austin Municipal Power and Light (AMPL) would like to determine optimal
operating levels for their electric generators and associated distribution patterns
that will satisfy customer demand. Consider the following prototype system
Demand requirements
4 MW
1
1
Plants
2
Demand
sectors
7 MW
2
3
6 MW
The two plants (generators) have the following (nonlinear) efficiencies:
Plant 1
Unit cost ($/MW)
[ 0, 6 MW]
$10
[ 6MW, 10MW]
$25
Plant 2
Unit cost ($/MW)
[ 0, 5 MW]
$8
[5MW, 11MW]
$28
For plant #1, e.g., if you generate at a rate of 8MW (per sec), then the cost
($) is = ($10/MW)(6MW) + ($25/MW)(2MW) = $110.
Problem Statement and Notation
Formulate an LP that, when solved, will yield optimal power
generation and distribution levels.
Decision Variables
x 11
x 12
x 21
x 22
= power generated at plant 1 at operating level 1

1






2
2
1








2





2

y 11
y 12
y 13
y 21
y 22
y 23
= power sent from plant 1 to demand sector 1
2
1 








3
1 






1
2 






2
2 






3
2 




Formulation
min
s.t.
10x11 + 25x12 + 8x21 + 28x22
y 11
y 21
y 11
y 12
y 13
+
+
+
y 12
y 22
y 21
y 22
y 23
+
+
y 13
y 23
= 4
+
= 7
+
= 6
0  x11 6, 0  x12  4
= x11 + x12
= x21 + x22
Flow
balance
Demand
0  x21 5, 0  x22  6
y11, y12, y13, y21, y22, y32  0
Note that we can model the nonlinear operating costs as an LP only because
the efficiencies have the right kind of structure. In particular, the plant is
less efficient (more costly) at higher operating levels. Thus the LP solution
will automatically select level 1 first.
General Formulation of Power
Distribution Problem
The above formulation can be generalized for any
number of plants, demand sectors, and generation
levels.
Indices/Sets
plants
i I
j J
demand sectors
k K generation levels
Data
Cik = unit generation cost ($/MW) for plant i at level k
uik = upper bound (MW) for plant i at level k
dj = demand (MW) in sector j
Decision Variables
xik = power (MW) generated at plant i at level k
yij = ower (MW) sent from plant i to sector j
General Network Formulation
min
s.t.
  cikxik
iI kK
 yij =  xik
jJ
kK
 yij = dj
" i I
" j J
iI
  xik uik " i I, k K
 yij " i I, j J
3. Feed Mix Problem
• An agricultural mill produces a different feed for cattle,
sheep, and chickens by mixing the following raw
ingredients: corn, limestone, soybeans, and fish meal.
• These ingredients contain the following nutrients: vitamins,
protein, calcium, and crude fat in the following quantities:
Ingredient, i
Corn
Limestone
Soybeans
Fish Meal
Vitamins
8
6
10
4
Nutrient, k
Protein
Calcium Crude Fat
10
5
12
18
6
10
6
6
8
6
6
9
Let aik = quantity of nutrient k per kg of ingredient i
Constraints
• The mill has (firm) contracts for the following demands.
Demand (kg)
dj
Cattle
10,000
Sheep
6,000
Chicken
8,000
• There are limited availabilities of the raw ingredients.
Supply (kg) Corn
6,000
si
Limestone
10,000
Soybeans
4,000
Fish Meal
5,000
• The different feeds have “quality” bounds per kilogram.
Cattle
Sheep
Chicken
Vitamins
Protein
Calcium Crude fat
min max min max min max min max
6
-6
-7
-4
8
6
-6
-6
-4
8
6
-4
6
6
-4
8
The above values represent bounds: Ljk & Ujk
Costs and Notation
• Cost per kg of the raw ingredients is as follows:
Corn Limestone Soybeans
cost/kg, ci 20¢
24¢
12¢
Fish meal
12¢
Formulate problem as a linear program whose solution
yields desired feed production levels at minimum cost.
Indices/sets
i  I ingredients { corn, limestone, soybeans, fish meal }
j  J products { cattle, sheep, chicken feeds }
k  K nutrients { vitamins, protein, calcium, crude fat }
Data
dj
si
Ljk
Ujk
ci
aik
demand for product j (kg)
supply of ingredient i (kg)
lower bound on number of nutrients of type k
per kg of product j
upper bound on number of nutrients of type k
per kg of product j
cost per kg of ingredient i
number of nutrients k per kg of ingredient i
Decision Variables
xij
amount (kg) of ingredient i used in producing
product j
LP Formulation
min
s.t.
 
iI jJ

cixij
xij = dj
"jJ

xij si
"iI

aikxij Ljk dj
" j  J, kK
aikxij Ujkdj
" j  J, kK
iI
jJ
iI

iI
xij 
" i  I, j  J
Generalization of feed Mix Problem Gives
Blending Problems
Blended
commodities
feed
Raw Materials
Qualities
corn, limestone,
soybeans, fish meal
protein, vitamins,
calcium, crude fat
butane, catalytic
reformate,
heavy naphtha
octane, volatility,
vapor pressure
gasoline
pig iron,
ferro-silicon,
carbide, various
alloys
carbon,
manganese,
chrome content
metals
 2 raw ingredients
 1 quality
 1 commodity
4. Trim-Loss or Cutting Stock problem
• Three special orders for rolls of paper have been placed
at a paper mill. The orders are to be cut from standard
rolls of 10 and 20 widths.
Order
1
2
3
Width
5
7
9
Length
10,000
30,000
20,000
• Assumption: Lengthwise strips can be taped together
• Goal: Throw away as little as possible
Problem: What is trim-loss?
20 
10 
5'
9'
5
5000'
7
Decision variables: xj = length of roll cut using
pattern, j = 1, 2, … ?
Patterns possible
10  roll
5
7
9
Trim loss
20  roll
x1
x2
x3
x4
x5
x6
x7
x8
x9
2
0
0
0
1
0
0
0
1
4
0
0
2
1
0
2
0
1
1
2
0
0
1
1
0
0
2
0
3
1
0
3
1
1
4
2
min z = 10(x 1+x 2+x 3) + 20(x 4 +x 5+x 6+x 7+x 8+x9 )
s.t.
2x 1 + 4x 4 + 2x 5 + 2x 6 + x 7 
10,000
x 2 + x 5 + 2x 7 + x 8

30,000
x3 + x6 + x8 + 2x 9

20,000
xj 0, j = 1, 2,…,9
Alternative Formulation
min z = 3x2 + x3 + 3x5 + x6 + x7 + 4x8 + 2x9
+ 5y1 + 7y2 + 9y3
s.t.
2x1 + 4 x4 + 2x5 + 2x6 + x7 – y1
= 10,000
x2 + x5 + 2x7 + x8
= 30,000
x3 + x6 + x8 + 2x9
– y2
– y3 = 20,000
xj 0, j = 1,…,9; yi  0, i = 1, 2, 3
where yi is overproduction of width i
5. Constrained Regression
Data (x,y) = { (1,2) , (3,4) , (4,7) }
y
7
6
5
4
3
2
1



1 2 3 4 5
x
We want to “fit” a linear function y = ax + b to these data
points; i.e., we have to choose optimal values for a and b.
Objective: Find parameters a and b that minimize the
maximum absolute deviation between the data yi and the

fitted line yi = axi + b.

yi
and

yi
Predicted
value
observed
value
In addition, we’re going to impose a priori knowledge that the
slope of the line must be positive. (We don’t know about the
intercept.)
Decision variables
a = slope of line
b = y-intercept
-
known to be positive
positive or negative
-
b = b+ - b , b+  0, b  0
Objective function:

min max { |yi - yi| : i = 1, 2, 3 }

where yi = axi + b

Let w = max { |yi - yi| : i = 1, 2, 3 }
Optimization model:
min w
s.t.

w  |yi - yi|, i = 1, 2, 3
Nonlinear constraints:
w 

y1 - y1
=  1a + b – 2 
w 

y2- y2
=  3a + b – 4 
w 

y3- y3
=  4a + b – 7 
Convert absolute value terms to linear terms:
Note: 2 |x| iff 2  x and 2 -x
Thus w 

y i - yi
is equivalent to
w  axi + b - yi and w - axi – b + yi
so finally …
min w
s.t. a + b+ - b- - w
+
-a - b + b - w
+
3a + b - b - w
+
- 3a - b + b - w
+
4a + b - b - w
+
- 4a - b + b - w
a, b+, b-, w  0






2
-2
4
-4
7
-7
Model Transformations
• Direction of optimization:
Minimize {c1x1 + c2x2 + … + cnxn}
 Maximize {–c1x1 – c2x2 – … – cnxn}
• Constant term in objective function  ignore
• Nonzero lower bounds on variables:
xj > lj  replace with xj = yj + lj where yj  0
• Nonpositive variable:
xj ≤ 0  replace with xj = –yj where yj  0
• Unrestricted variables:
xj = y1j – y2j where y1j  0, y2j  0
What You Should Know
About LP Problems
• How to formulate various types of
problems.
• Difference between continuous and
integer variables.
• How to find solutions.
• How to transform variables and
functions into the standard form.