# Case Study: The Brewery Logistics Problem

## Problem Description

A boutique brewery has two warehouses from which it distributes beer to five carefully chosen bars. At the start of every week, each bar sends an order to the brewery's head office for so many crates of beer, which is then dispatched from the appropriate warehouse to the bar. The brewery would like to have an interactive computer program which they can run week by week to tell them which warehouse should supply which bar so as to minimize the costs of the whole operation.

For example, suppose that at the start of a given week the brewery has 1000 cases at warehouse A, and 4000 cases at warehouse B, and that the bars require 500, 900, 1800, 200, and 700 cases respectively.

The transportation costs are given in Table 1.

Table 1 Transportation costs from warehouses to bars

##### Analysis of Data Parameters

The current solution is robust under changes to all the costs except for the following transportation costs:

______ to _____ which can only ______ to _____; and,

__________ to _____ which can only ______ to _____.

However, any change in the amount of supply at the warehouses or the demand at the bars will cause the solution to change with the following exception:

The ______ at ______ can ______ to ______ .

If this ______ occurs then the objective function value ______ by ______ per unit ______ .

#### Implementation and Ongoing Monitoring

As always, the first step towards Implementation is a good management summary. In this case, the sensitivity analysis shows that the solution is very sensitive to the supply and demand amounts. Since the demand is forecasted, any implementation of the solution would be very dependent on excellent demand forecasting.

Ongoing Monitoring may take the form of:

1. Updating your data files and resolving as the data changes (changing costs, supplies, demands);
2. Resolving our model for new nodes (e.g., new warehouses or bars);
3. Looking to see if cheaper transportation options are available along routes where the transportation cost affects the optimal solution (e.g., how much total savings can we get by reducing the transportation cost from Warehouse B to Bar 1).

## Extra for Experts

You can use AMPL as a scripting language to generalise your models. For example, you can solve The Beer Distribution Problem for differing supplies and demands using the {\tt balanced_transportation.mod} model file, an extra model file {\tt balance.mod} and a script file {\tt balance.run}. The {\tt balance.mod} file declares three new parameters:

\begin{verbatim} # The following parameters are needed to use balance.run param difference; # The difference between total supply and total demand

param dummyDemandCost {SUPPLY_NODES}; # The cost of sending supply to a dummy demand node param dummySupplyCost {DEMAND_NODES}; # The cost of getting supply from a dummy supply node \end{verbatim}

and the {\tt balance.run} file automatically balances the data:

\begin{verbatim} let difference := (sum {s in SUPPLY_NODES} Supply[s]) - (sum {d in DEMAND_NODES} Demand[d]);

if difference > 0 then { let DEMAND_NODES := DEMAND_NODES union {'Dummy'}; let Demand['Dummy'] := difference; let {s in SUPPLY_NODES} Cost[s, 'Dummy'] := dummyDemandCost[s]; } else if difference < 0 then { let SUPPLY_NODES := SUPPLY_NODES union {'Dummy'}; let Supply['Dummy'] := - difference; let {d in DEMAND_NODES} Cost['Dummy', d] := dummySupplyCost[d]; }; # else the problem is balanced \end{verbatim}

*Note* The {\tt ;} at the end of the file is necessary because the second {\tt if} statement ({\tt if difference < 0 then}) is the only statement within the {\tt else} part of the first {\tt if} statement.

Using these files and the {\tt reset data} command we can solve both of the balanced transportation examples with a single script file:

\begin{verbatim} reset;

model balanced_transportation.mod; data brewery.dat; # Unbalanced brewery model

# Define parameters to be used with balance.run model balance.mod;

let dummyDemandCost['A'] := 0.5; let dummyDemandCost['B'] := 1;

include balance.run;

option solver cplex; solve; option display_1col 5; display Flow;

reset data;

data brewery.dat; let Supply['B'] := Supply['B'] - 1000;

let {d in DEMAND_NODES} dummySupplyCost[d] := 5;

include balance.run;

solve; display Flow; \end{verbatim}

1. Solve The Beer Distribution Problem. Write a management summary of your solution.
*What to hand in* Hand in your management summary.