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 |

Which warehouse should supply which bar?

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.

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 ;

The results...

In conclusion...

Topic revision: r2 - 2008-04-02 - MichaelOSullivan

Copyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

Ideas, requests, problems regarding TWiki? Send feedback

Ideas, requests, problems regarding TWiki? Send feedback