Optimization hw1
Optimization hw1
Problem 1
Decision Variables:
• Y: Number of year-round workers.
• S: Number of summer workers.
Objective Function
′ ′ ′
min Z = 4c1 Y + c2 S + c3 W + 2c4 H + 2c4 H + c5 ∗ max(Y + S, Y + H + H )
Constraints
′
• Y + W + H + h ≥ d1
• Y + S ≥ d2
• Y + S ≥ d3
′
• Y + H + H ≥ d4
• H ≤ u1
• Y ≥ 0.5 ∗ d1
• Y ≥ 0.5 ∗ d4
′
• Y, S, W, H, H ≥ 0
Problem 2
(a)
Index Sets
• k ∈ {1, 2, 3, 4, 5} sample points
Data
• distancek the predicted distance of k-th sample
• pk the power of k-th sample
1
Figure 1: The network diagram
Decision Variables
• m slope of the line
Constraints
• m≥0
• b≥0
Formulation
X
min |distancek − (m ∗ pk − b)|
m,b
k∈K
s.t. m ≥ 0, b ≥ 0
(b)
By using Python and COPT, we can get the best fit of the model is that m = 3.57 and b = 26.43. The
value of m means when the power increases by 1 unit, the distance will increase 3.57 units on average
and the value of b means that when the power is zero, the average distance is 26.43 units. The reason
why we used the word average is that the output is just an estimation of the real formulation. So
there will always be an error between our estimation and the true value.
Problem 3
(a)
The diagram is shown in Figure 1.
(b)
Decision Variables
• ti denote the start time of task t, where i ∈ {A, B . . . , K}
2
Figure 2: The network diagram
Objective Function
min tK + 9
Constraints
• tB ≥ tA + 2
• tC ≥ tB + 3
• tD ≥ tB + 3
• tE ≥ tB + 3
• tF ≥ tD + 7
• tG ≥ tE + 3
• tH ≥ tE + 3
• tI ≥ max(tC + 5, tF + 4)
• tJ ≥ max(tF + 4, tG + 2, tH + 6)
• tK ≥ max(tI + 8, tJ + 6)
• ti ≥ 0 for i ∈ {A, B, . . . , K}
Problem 4
(a)
The soft demands’ diagram is shown in Figure 2.
3
(b)
Define parameters
• i: represents the sales outlet, i ∈{A,B,C}
• t: represents the period, t ∈{1,2,3}
• ci : the unit shipping cost from the manufacturing plant to sales outlet i
Objective function
3 X
X 2
X
min ci xit + syt
t=1 i t=1
Constraints
•
P
i xit + yt−1 ≤ prod capt
• xi,t , yt ≤ 0
(c)
The minimum cost is 1030.
4
Problem 5
Define parameters
• i: represents the plant, i ∈ {A, B}
Objective function
2 X
X B X
III
max (stj xtij − cij xtij − pti yit − mzit )
t=1 i=A j=1
Constraints
P[
• j=1 III]xtij ≥ yit
PB P2
• i=A t=1 xtij ≥ dtj
P[
• zit = zit−1 + yit − j=1 III]xtij
• zi1 = 0
• zit ≤ li