VG441 Take-Home Midterm I solution


Original Work ?


5/5 - (6 votes)

Problem 1 (Forecasting)

The time series dataset is included in “demands.csv”. You are asked to generate 8 figures in Python.

(a) Scatter plot the demands against time (Figure 1).
(b) Run a simple regression and plot your results on top of scatter plot (Figure 2).
(c) Run gradient boosting method with different number of trees:
params = {’n_estimators’: 1, ’max_depth’: 1, ’learning_rate’: 1, ’loss’: ’ls’}
params = {’n_estimators’: 2, ’max_depth’: 1, ’learning_rate’: 1, ’loss’: ’ls’}
params = {’n_estimators’: 5, ’max_depth’: 1, ’learning_rate’: 1, ’loss’: ’ls’}
params = {’n_estimators’: 10, ’max_depth’: 1, ’learning_rate’: 1, ’loss’: ’ls’}
params = {’n_estimators’: 20, ’max_depth’: 1, ’learning_rate’: 1, ’loss’: ’ls’}
params = {’n_estimators’: 50, ’max_depth’: 1, ’learning_rate’: 1, ’loss’: ’ls’}
Plot each of these results on top of scatter plot (Figures 3-8).

Problem 2 (Quantity-Discount Model)

Zeus Lighting Fast sells peripherals, such as printers and scanners, with their new desktop and laptop
computers. Their supplier for printers charges a fixed cost $50 per order, and holding cost is $200 per unit
per year.

They sell 50 printers per month. The manufacturer has offered the following price schedule:
Order Quantity Price Per Unit
< 12 $520
12 to 64 $510
65 to 128 $495
> 128 $485

(a) What is the optimal ordering strategy?
(b) The supplier has offered to be a drop shipper, i.e., they will ship directly to the customer. In
exchange, they will increase the unit price to $520 per computer, but not charge the ordering costs
and all inventory will be held at the supplier. From a purely financial standpoint, should Zeus take
them up on the offer?

Problem 3 (Wagner-Whitin Model)

A snack bar at a certain theme park sees a deterministic but time-varying demand as shown in the
table below. Replenishment orders are placed to a central warehouse located within the theme park,
with negligible lead time, and it costs $1000 in labor costs to deliver an order to the snack bar from the

It costs $1.20 per case per day in refrigeration costs and other holding costs to hold cases of
food in inventory at the snack bar.
Day (#) Day (Name) Demand
1 Sunday 220
2 Monday 155
3 Tuesday 105
4 Wednesday 90
5 Thursday 170
6 Friday 210
7 Saturday 290
(a) Use dynamic programming to solve the problem (on paper by hands).
(b) Formulate as a shortest path problem and draw the corresponding diagram with nodes, edges, and
edge costs. Solve using Dijkstra’s algorithm (on paper by hands).
(c) Formulate the problem as a MILP on paper and solve it in Python.

Problem 4 (Linear Programming Duality)

(a) Please write down duality of the following linear programming problem.
max 6×1 + 14×2 + 13×3
s.t. 3×1 + 2×2 + x3 ≤ 24,
x1 + 2×2 + 4×3 ≥ 60,
x1 ≥ 0,
x2 ≤ 0,
x3 is free.

(b) Bipartite graph is a special graph. Its vertices are divided into two separate sets and edges only exist
between those two sets. The maximum cardinality matching problem of the bipartite graph can be
modeled as a linear programming problem below:
max P
s.t. P
xij ≤ 1 ∀ i ∈ I,
xij ≤ 1 ∀ j ∈ J,
xij ≥ 0 ∀ (i, j) ∈ E.
in which I, J stand for the left and right sets and E stands for set of the edges. Write down duality
of the above LP.