Download presentation
Presentation is loading. Please wait.
1
Lecture 3 – Classic LP Examples
Topics Employee scheduling problem Energy distribution problem Feed mix problem Cutting stock problem Regression analysis Model Transformations
2
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 Time FTEs 1 0-4 15 2 4-8 10 3 8-12 40 4 12-16 70 5 16-20 40 6 20-0 35
3
Formulate an LP to determine how to staff the hotline at minimum cost.
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 $ 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.
4
All shifts must be covered
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 min 121.6(x1 + • • • + x6) + 51.8(y1 + • • • + y6) s.t. 5 6 y1 15 y2 10 y3 40 y4 70 y5 y6 35 (8 15.20) (4 12.95) All shifts must be covered PT employee is 5/6 FT employee x x6 + x x2 + x x3 + x x4 + x x5 + x x6 +
5
At least 2/3 workers must be full time (x1 + x2 + y2) x1 + x2 . . .
More constraints: x1 + x6 2 (x6 + x1 + y1) 3 2 At least 2/3 workers must be full time (x1 + x2 + y2) x1 + x2 3 . . . x5 + x6 2 (x5 + x6 + y6) 3 xt ³ 0, yt ³ 0 t =1,2,…,6 Nonnegativity
6
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 1 4 MW 1 Demand sectors Plants 7 MW 2 2 3 6 MW The two plants (generators) have the following (nonlinear) efficiencies: Plant 1 [ 0, 6 MW] [ 6MW, 10MW] Unit cost ($/MW) $10 $25 Plant 2 [ 0, 5 MW] [5MW, 11MW] Unit cost ($/MW) $8 $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.
7
Problem Statement and Notation
Formulate an LP that, when solved, will yield optimal power generation and distribution levels. Decision Variables x = power generated at plant 1 at operating level 1 11 x 1 12 2 x 2 1 21 x 2 2 22 y = power sent from plant 1 to demand sector 1 11 y 1 ² ² ² 2 12 y 3 13 1 y 2 21 1 y 22 2 2 y 2 3 23
8
Formulation min 10x11 + 25x12 + 8x21 + 28x22 s.t. y y y = x11 + x12
13 Flow balance y + y + y = x x22 21 22 23 y y 11 + 21 = 4 y y 12 + Demand 22 = 7 y y 13 + 23 = 6 0 £ x11 £ 6, 0 £ x12 £ 4 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.
9
General Formulation of Power Distribution Problem
The above formulation can be generalized for any number of plants, demand sectors, and generation levels. Indices/Sets i Î I plants 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
10
General Network Formulation
å å cikxik min iÎI kÎK s.t. å å xik yij = " i Î I jÎJ kÎK å yij = dj " j Î J iÎI £ xik £ uik " i Î I, k Î K 0 £ yij " i Î I, j Î J
11
Let aik = quantity of nutrient k per kg of ingredient i
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: Nutrient, k Vitamins Protein Calcium Crude Fat Ingredient, i Corn 8 10 6 8 Limestone 6 5 10 6 Soybeans 10 12 6 6 Fish Meal 4 18 6 9 Let aik = quantity of nutrient k per kg of ingredient i
12
Constraints The mill has (firm) contracts for the following demands. Demand (kg) Cattle Sheep Chicken dj 10,000 6,000 8,000 There are limited availabilities of the raw ingredients. Supply (kg) Corn Limestone Soybeans Fish Meal si 6,000 10,000 4,0 00 5,000 The different feeds have “quality” bounds per kilogram. Vitamins Protein Calcium Crude fat min max min max min max min max Cattle Sheep Chicken The above values represent bounds: Ljk & Ujk
13
Costs and Notation Cost per kg of the raw ingredients is as follows:
Corn Limestone Soybeans Fish meal cost/kg, ci 20¢ 12¢ 24¢ 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 }
14
Data dj demand for product j (kg) si supply of ingredient i (kg) Ljk lower bound on number of nutrients of type k per kg of product j Ujk upper bound on number of nutrients of type k per kg of product j ci cost per kg of ingredient i aik number of nutrients k per kg of ingredient i Decision Variables xij amount (kg) of ingredient i used in producing product j
15
å å å å å å " j J " i I " j J, kK " j J, kK " i I, j J
LP Formulation å å cixij min iÎI jÎJ å xij = dj s.t. " j J iÎI å xij £ si " i I jÎJ å aikxij ³ Ljk dj iÎI " j J, kK å aikxij £ Ujkdj iÎI " j J, kK xij ³ 0 " i I, j J
16
Generalization of feed Mix Problem Gives
Blending Problems Blended commodities Raw Materials Qualities corn, limestone, protein, vitamins, feed soybeans, fish meal calcium, crude fat butane, catalytic octane, volatility, gasoline reformate, vapor pressure heavy naphtha pig iron, carbon, metals ferro-silicon, manganese, carbide, various chrome content alloys 2 raw ingredients 1 quality 1 commodity
17
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 Width Length 1 5 10,000¢ 2 7 30,000¢ 3 9 20,000¢ Assumption: Lengthwise strips can be taped together Goal: Throw away as little as possible
18
Problem: What is trim-loss?
20 10 5000' 5' 5 9' 7 Decision variables: xj = length of roll cut using pattern, j = 1, 2, … ?
19
Patterns possible ³ ³ ³ 10 ¢ roll 20 ¢ roll x1 x2 x3 x4 x5 x6 x7 x8 x9
5¢ 2 4 2 2 1 7¢ 1 1 2 1 9¢ 1 1 1 2 Trim loss 3 1 3 1 1 4 2 min z = 10(x +x +x ) + 20(x +x +x +x +x +x ) 1 2 3 4 5 6 7 8 9 s.t. 2x + 4x + 2x + 2x + x 10,000 1 4 5 6 7 x + x + 2x + x 30,000 2 5 7 8 x + x + x + 2x 20,000 3 6 8 9 xj ³ 0, j = 1, 2,…,9
20
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 – y2 = 30,000 x3 + x6 + x8 + 2x9 – y3 = 20,000 xj ³ 0, j = 1,…,9; yi ³ 0, i = 1, 2, 3 where yi is overproduction of width i
21
5. Constrained Regression
Data (x,y) = { (1,2) , (3,4) , (4,7) } y 7 6 5 4 3 2 1 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.
22
yi 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 Ù observed value Predicted 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 known to be positive b = y-intercept positive or nega tive b = b+ - b-, b+ 0, b- 0
23
Optimization model: 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
24
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 - y is equivalent to i i w ³ axi + b - yi and w ³ - axi – b + yi
25
so finally … min w s.t. a + b - b - w £ 2 - a - b + b - w £ - 2 3a + b
4 - - 3a - b + + b - w - 4 - 4a + b + - b - w 7 - - 4a - b + + b - w - 7 a, b+, b-, w ³ 0
26
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
27
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.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.