DAO Cheatsheeet
DAO Cheatsheeet
DAO1704 Cheatsheet
Sensitivity Analysis & Shadow Price Changes in constraint quantity (bi): Discrete Optimization Common uses of binary variables: Converting Linear expression:
Studies the effect of parameter change on Maximisation: objective – profit An optimization problem in which At most 1 event can occur – x1 + x2 ≤ 1 Conditional Range: if event y does not
optimal solution and objective value. ≥ b: high requirement à low profit some(or all) of the decision variables All or nothing – x1 = x2 occur (0), then x=0 ; if event y occurs
≤ b: high resources à high profit must be integer-valued. If 1 occurs, 2 must occur – x1 ≤ x2 (1), then 0 ≤ x ≤ My; y binary
Using example, measure how Minimization: objective – cost Integer programming: all decision If Y is not selected, X must be selected –
optimal solution changes with ≥ b: high requirement à high cost variables are integer valued X+Y≥1
respect to changes in aij, bi, cj
≤ b: high resources à low cost Binary optimization: all decision If X and Y occur, Z must occur – f(x) = 10y + 5x; 0 ≤ x ≤ My
Sensitivity range of an objective coefficient *changes in b changes feasible region variables being binary valued (yes/no) X+Y–1≤Z
*last point that isoquant hits feasible Mixed Interger Optimization: some of If X occurs, Y, Z or Y and Z must occur – Excel Functions
(ci): range that current optimal solution WILL COUNTIF(range, criteria) i.e. (A:A,South)
NOT CHANGE. Objective value WILL change region is the optimal solution. the decision variables being integer or X≤Y+Z
binary valued. If X is not chosen, Z cannot be chosen – COUNTIFS(criteria range 1, criteria 1,
according to change in c. Changing ci rotates
the isoquant and direction. Shadow Price: marginal change of the X≥Z criteria range 2, criteria 2,…)
objective value because of an General Framework for binary: At most 2/3 selected – X + Y + Z ≤ 2 SUM/MAX/MIN/AVERAGE(range)
Sensitivity range of a constraint quantity (bi): SUMPRODUCT(array 1, array 2…)
range of values that binding constraints will additional resource or requirement. Conditional: If logical statement 1 is If either X or Y or both occur, Z cannot
*only valid within sensitivity range true, then statement 2 must be true 𝑿+𝒀 AVERAGEIF(range, criteria, range of data
remain so. Optimal solution ALWAYS CHANGES occur – ≤1–Z
1 unit change in b will result in 1 LS 1 (condition) ≤ LS 2 (conclusion) 𝟐 to count average) i.e. ave sales in region
if changing constraint is binding but binding X only occurs if both Y and Z occur – AVERAGEIFS(ave. range, range 1, criteria
constraint WILL NOT change if in the range. shadow price unit change in objective. Cross validation must be done in
2X ≤ Y + Z 1, range 2, criteria 2…)
Changing aij rotates constraint: changes Allowable increase/decrease: order to make sure constraint is right.
If C is not selected, A or B or both has to IF(logical test, [value if true],[value if
sensitivity range that SP & set of Condition true à conclusion true
everything (binding constraint, optimal be selected – 1 – C ≤ A + B false]) i.e. =IF(F2=$K$1,J2,NA())
solution, objective value) binding constraints do not change. Condition false à conclusion may or
If 2 out of B, C, D are selected, A has to VAR.P(range) or VAR.S(range)
Changing bi shifts the corresponding may not be true 𝐁+𝐂+𝐃?𝟏
Questions: be selected – 𝐀 ≥ 𝟐
COVARIANCE.P(array 1, array 2)
constraint: optimal solution and objective *remember to specify r/s between x and y CORREL(array 1, array 2)
Check if new parameter is in sensitivity Cannot choose C and D at the same
value always changes. Shadow price will (conditional range) i.e. xi ≤ Myi STDEV.P(highlight numbers)
remain the same – use to estimate impact on range à if yes, optimal solution no *Logical upper limit = M*y (binary) time unless both A and B are chosen:
𝐀+𝐁 *S = sample, P = population
objective value. change à use SP to calculate objective - constraint/smallest unit 𝐂+𝐃≤ 𝟐 +𝟏
Cloth example Shopping Mall Call Scheduling
i – type of product; Ri – rental cost of machine 1 if j number of type i store is chosen i – working hours in a day; j – shifts (j=1,2,3
X ƒ„ = m
for product I; Hi – unit labor hours per product i; 0 if otherwise full time shift respectively)
Ai – sq yard of cloth per unit of product i, Pi – Xij binary (i – type of store, j – number of stores) 1 if shift j works in hour i
𝐚𝐢𝐣 = m
unit profit of product i; Xi: quantity to produce Fi – square footage of store type i 0 if otherwise
1 if product i is produced Rij – rental income per store for j number of type i stores Di – the no. of calls arriving in hour i (where I
𝑌𝑖 = m = 1,…11); Pf – full time pay and Pp – part
0 otherwise (Rij = 0.05Pij)
Max ∑|6_D 𝑃𝑖𝑋𝑖 – ∑|6_D 𝑅𝑖𝑌𝑖 1. Max rental income – max ∑6(∑•‹_D 𝑗𝑃𝑖𝑗𝑋𝑖𝑗 ) time pay; W – total no. of workstations avail;
∑ | ∑ |
s.t. 6_D 𝐻𝑖𝑋𝑖 ≤ 4000, 6_D 𝐴𝑖𝑋𝑖 ≤ 4500 2. Mutually exclusive – Xi1+Xi2+Xi3 = 1, where i = R – no. of calls an operator can process per
0 ≤ Xi ≤ MYi, for i = 1,2,3,4,5. Yi binary. M is J,S,D,C; XB1+XB2+XB3 ≤ 1 (0-3) hour; Xj – the no. of operators to hire for
logical upper limit (constraint/smallest unit) 3. Total square footage – ∑6(𝑓𝑖 ∑•‹_D 𝑗𝑋𝑖𝑗𝑃𝑖𝑗 ) ≤ 10000 shift j (where j = 1…5); Ai – no. of operators
TV Show avail in hour i; Yi – no. of operators working
Linda choose course in hour i; Zi – the no. of calls to be processed
1 if j is selected at sem i 1 if show i is chosen
X ƒ„ = m Xƒ = m
0 otherwise 0 if otherwise in hour i; Bi – no. of calls to be processed in
EVSI: -13.9-(-14)+1=1.1, EVPI: -13-(-14)+1=2. If want to find If 2 or more shows in comedy chosen, then must
1 if j is offerred at sem i hour i; Vi – no. of calls unanswered in hour i
best value of p to maximise EVPI/SI, separate p into bins, aij = m schedule at least one in drama – (X1+X5+X8-1)/2 ≤
0 otherwise
place EVSI value beside the header, highlight the table, Xij, Aij binary. X1+X2+X3+X4+X7 Min Pf ∑•‹_D 𝑋𝑗 + Pp ∑|‹_• 𝑋𝑗
what-if analysis, column input cell is p’s cell. If more than 3 violence chosen,
Max interest level – max ∑A6_D ∑AŒ ‹_D 𝐼‹ 𝑋6,‹ 𝑎6,‹ Ai = ∑|‹_D 𝑎𝑖𝑗𝑋𝑗 for i = 1…11 (avail. Operators)
will be penalized and lose 4 mil.
EVPI: Assume outcome of survey 1. Take at most 5 courses each sem – ∑AŒ ‹_D 𝑋𝑖𝑗 ≤ 5, i = 1,2 1 if penalised
Yi ≤ Ai (working cannot exceed avail)
perfectly accurate – after “conduct 2. Can only take course if completed/taking prerequisites - Yƒ = m Bi = Di + Vi-1
0 if otherwise
survey” node, branch into X2,10 ≤ (X1,1 + X1,8 + X2,1 + X2,8)/2 [need to take 1&8 to take (X2+X3+X4+X6–3) / M ≤ y Zi ≤ Bi
outcomes (no positive & negative) 10] Objective: max ∑˜6_D 𝑋𝑖𝑃𝑖 − 4𝑦 Zi ≤ RYi (processed cannot exceed what the
If neither X nor Y is selected, Z X2,14 ≤ X1,4 + X2,4 [need to take 4 to take 14] Sudoku operators call process)
must be selected – 1 – X – Y ≤ Z 3. Take at least 3 courses from 5 – 1 if number k is used in cell (i, j) Vi = Bi – Zi
X ƒ„™ = m
If either X or Y is selected, Z cannot XD,D + XD,• + XD,• + XD,| + XD,‘ ≥ 3 0 if otherwise Vo = 0 (no carried forward calls for 1st hour)
be selected – X + Y ≤ 2( 1 – Z) Only 1 number in each cell - ∑˜›_D 𝑋6‹› = 1 V11 = 0
4. Take 18 or 20 – X1,18 + X2,18 + X2,20 ≤ 1
All numbers in each row must be different - Xj ≥ 0, integer; Yi ≥ 0, integer; Zi ≥ 0, integer
𝐀+𝐁
Cannot choose C or D unless both A and B are chosen – 𝐂 ≤ 𝟐 𝐚𝐧𝐝 𝐃 ≤ 𝟐
𝐀+𝐁 5. 𝑥6,‹ ≤ 𝑎6,‹ (Course can only be taken in Sem i if it is
∑˜‹_D 𝑋6‹› = 1 where k = 1…9, i = 1…9
offered)
Must choose at least C or D if both A & B are chosen – C + D ≥ A + B – 1 6. ∑A6_D 𝑋6‹ ≤ 1(Course is only taken once even if it is Every number cannot be repeated in each
Yi Chien ([email protected]) box ∑‹_D ∑6_D 𝑋6‹› = 1, for k = 1…9
𝐀+𝐁 • •
Must choose at least C or D if either A or B or both are chosen – 𝐂 + 𝐃 ≥ 𝟐 Downloaded by Lui
offered in both semesters)