CaseStudyForm  

Title  The Brewery (Logistics) Problem 
DateSubmitted  2 Apr 2008 
CaseStudyType  TeachingCaseStudy 
OperationsResearchTopics  LinearProgramming, IntegerProgramming, NetworkOptimisation, TransportationProblem 
ApplicationAreas  Logistics 
ProblemDescription 
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  Cost ($/crate)  Warehouse A  Warehouse B   Bar 1  2  3   Bar 2  4  1   Bar 3  5  3   Bar 4  2  2   Bar 5  1  3  Given this data, the brewery management want to know which warehouse should supply which bar. 
ProblemFormulation 
Since crates of beer are being shipped from the warehouses to the bars, this problem is a bipartite network and can be modelled as a transportation problem.
The supply nodes are the warehouses, the demand nodes are the bars. The total supply is 1,000 + 4,000 = 5,000 and the total demand is 500 + 900 + 1,800 + 200 + 700 = 4,100, so the problem is unbalanced. We can either alter the balanced formulation to incorporate this or add a dummy demand node to receive the extra supply.

ComputationalModel 
Since this is a transportation problem we can use the AMPL model file for transportation problems.
The data file will have the supply nodes as the warehouses: set SUPPLY_NODES := A B ;and the demand nodes as the bars: set DEMAND_NODES := 1 2 3 4 5 ; The supply and demand is given and can be specified: param Supply := A 1000 B 4000 ; param Demand := 1 500 2 900 3 1800 4 200 5 700 ; Finally, the transportation costs are easier to specify using a transposed table: param Cost (tr) : A B := 1 2 3 2 4 1 3 5 3 4 2 2 5 1 3 ;
Note that since the problem is not balanced, the AMPL script file
The AMPL model file

Results 
By inserting
data brewery.dat;into transportation.run (see Transportation Problems in AMPL for details) we can solve the Brewery Problem. Figure 1 shows the AMPL output with the solution.
Figure 1 AMPL output for the Brewery Problem
This shows that the optimal solution is to make the shipments shown in Table 1. Table 1 Optimal shipments for the Brewery Problem  Shipment (crates)  Warehouse A  Warehouse B   Bar 1  300  200   Bar 2    900   Bar 3    1800   Bar 4    200   Bar 5  700    There are 900 crates left at Warehouse B. Notice that CPLEX did not need to use any branchandbound nodes, i.e., no integer programming was required. This confirms that a transportation problem has naturally integer solutions. By specifying the supply, demand and bound parameters be integer we guarantee that only linear programming needs to be used.

Conclusions 
There are many ways to present the solution to the Brewery Problem: as a list of shipments, in a table, etc. You can use AMPL's display, print and printf commands to create formatted output that can be easily used in your management summary.
For example, brewery.out (shown below) was produced by an AMPL script file: TRANSPORTATION SOLUTION  Nonzero shipments TotalCost = $8600 Ship 300 crates of beer from warehouse A to pub 1 Ship 700 crates of beer from warehouse A to pub 5 Ship 200 crates of beer from warehouse B to pub 1 Ship 900 crates of beer from warehouse B to pub 2 Ship 1800 crates of beer from warehouse B to pub 3 Ship 200 crates of beer from warehouse B to pub 4 Also, showing the solution as a graphical output can be informative.

ExtraForExperts 

StudentTasks 

I  Attachment  History  Action  Size  Date  Who  Comment 

out  brewery.out  r1  manage  0.4 K  20080402  10:16  MichaelOSullivan 