You are on page 1of 13

Distribution/Logistics Examples On each example worksheet, read the comments at the bottom of the sheet, then click Tools

Solver... to examine the decision variables, constraints, and objective. To find the optimal solution, click the Solve button. An important group of Solver applications is based on distribution or network models. The amount of money that companies save each year by applying linear programming towards their distribution problems is enormous. In this series we will look at a simple transportation problem in worksheet Transport1, then extend it to a 2-level multi-product model in worksheets Transport2 and Transport3. We'll also examine a frequently encountered class of problems called 'knapsack' problems, in worksheet Knapsack. As an example we will look at a truck that has to transport different kinds of gas. In the Facility worksheet we will look at a facility location problem, where a company has to decide if it's profitable to close down one or more of their plants and save overall costs. Finally, in the Prodtran worksheet, we will examine a combination production and transportation model where the number of products made in plants depends on choices made in distribution. This kind of combination is often possible, but many users prefer to split these models up into smaller ones to simplify the problem.

139350574.xls.ms_office

Transportation Problem 1
Minimize the costs of shipping goods from factories to customers, while not exceeding the supply available from each factory and meeting the demand of each customer. Cost of shipping ($ per product) Destinations Customer 1 Factory 1 Factory 2 Customer 2 Customer 3 Customer 4 Customer 5

$1.75 $2.00

$2.25 $2.50

$1.50 $2.50

$2.00 $1.50

$1.50 $1.00

Number of products shipped Customer 1 Factory 1 Factory 2 Total Demand Customer 2 Customer 3 Customer 4 Customer 5 Total Capacity

0 0 0 30,000

0 0 0 23,000 $0

0 0 0 15,000

0 0 0 32,000

0 0 0 16,000

0 0

60,000 60,000

Total cost of shipping

Problem A company wants to minimize the cost of shipping a product from 2 different factories to 5 different customers. Each factory has a limited supply and each customer a certain demand. How should the company distribute the product? Solution 1) The variables are the number of products to ship from each factory to the customers. These are given the name Products_shipped in worksheet Transport1. 2) The logical constraint is Products_shipped >= 0 via the Assume Non-Negative option The other two constraints are Total_received >= Demand Total_shipped <= Capacity 3) The objective is to minimize cost. This is given the name Total_cost. Remarks This is a transportation problem in its simplest form. Still, this type of model is widely used to save many thousands of dollars each year. In worksheet Transport2 we will consider a 2-level transportation, and in worksheet Transport3 we expand this to a multi-product, 2-level transportation problem.

Page 2

139350574.xls.ms_office

Transportation Problem 2 (2-stage-transport)


Minimize the costs of shipping goods from factories to warehouses and customers, and warehouses to customers, while not exceeding the supply available from each factory or the capacity of each warehouse, and meeting the demand from each customer. Cost of shipping ($ per product) Destinations Warehouse 1 Factory 1 Factory 2 Warehouse 2 Warehouse 3 Warehouse 4

$0.50 $1.50
Customer 1

$0.50 $0.30
Customer 2

$1.00 $0.50
Customer 3

$0.20 $0.20
Customer 4 Customer 5

Factory 1 Factory 2

$1.75 $2.00
Customer 1

$2.50 $2.50
Customer 2

$1.50 $2.50
Customer 3

$2.00 $1.50
Customer 4

$1.50 $1.00
Customer 5

Warehouse 1 Warehouse 2 Warehouse 3 Warehouse 4

$1.50 $1.00 $1.00 $2.50


Warehouse 1

$1.50 $0.50 $1.50 $1.50


Warehouse 2

$0.50 $0.50 $2.00 $0.20


Warehouse 3

$1.50 $1.00 $2.00 $1.50


Warehouse 4

$3.00 $0.50 $0.50 $0.50


Total

Number of products shipped Factory 1 Factory 2 Total Capacity

0 45,000 45,000 45,000


Customer 1

20,000 0 20,000 20,000


Customer 2

0 11,000 11,000 30,000


Customer 3

15,000 0 15,000 15,000


Customer 4

35,000 56,000

Customer 5

Total

Factory 1 Factory 2

10,000 0

0 0

0 0

15,000 0

0 0

Total products shipped out of factory 1 Total products shipped out of factory 2 Customer 1 Warehouse 1 Warehouse 2 Warehouse 3 Warehouse 4 Total Demands Customer 2 Customer 3 Customer 4

25,000 0 60,000 56,000

Factory Capacity

60,000 60,000

Customer 5 Total

0 20,000 0 0 30,000 30,000

23,000 0 0 0 23,000 23,000 $237,000

0 0 0 15,000 15,000 15,000

17,000 0 0 0 32,000 32,000

5,000 0 11,000 0 16,000 16,000

45,000 20,000 11,000 15,000

Total cost of shipping

Problem A company has 2 factories, 4 warehouses and 5 customers. It wants to minimize the cost of shipping its product from the factories to the warehouses, the factories to the customers, and the warehouses to the customers. The number of products received by a warehouse from the factory should be the same as the number of products leaving the warehouse to the customers. How should the company distribute the products? Solution

Page 3

139350574.xls.ms_office

1) The variables are the number of products to ship from the factories to the warehouses, the factories to the customers, and the warehouses to the customers. These are defined in worksheet Transport2 as Factory_to_warehouse, Factory_to_customer, Warehouse_customer. 2) The logical constraints are all defined via the Assume Non-Negative option: Factory_to_warehouse >= 0 Factory_to_customer >= 0 Warehouse_customer >= 0 The other constraints are Total_from_factory <= Factory_capacity Total_to_customer >= Demand Total_to_warehouse <= Warehouse_capacity Total_to_warehouse = Total_from_warehouse 3) The objective is to minimize cost, given by Total_cost. Remarks Please note that the last constraint must be an '=' , because otherwise products would start piling up at the warehouse. It would be possible to make this a multi-period model where storage at the warehouses would be possible and even desired, if transportation prices would fluctuate during the different time periods. In worksheet Transport3 we will look at a multi-product situation.

Page 4

139350574.xls.ms_office

Transportation Problem 3 (2-stage-transport, multi-commodity)


Minimize the costs of shipping 3 different goods from factories to warehouses and customers, and warehouses to customers, while not exceeding the supply available from each factory or the capacity of each warehouse, and meeting the demand from each customer. Cost of shipping ($ per product) Destinations Warehouse 1 Factory 1 Product 1 Product 2 Product 3 Factory 2 Product 1 Product 2 Product 3 Warehouse 2 Warehouse 3 Warehouse 4

$0.50 $1.00 $0.75 $1.50 $1.25 $1.40


Customer 1

$0.50 $0.75 $1.25 $0.30 $0.80 $0.90


Customer 2

$1.00 $1.25 $1.00 $0.50 $1.00 $0.95


Customer 3

$0.20 $1.25 $0.80 $0.20 $0.75 $1.10


Customer 4 Customer 5

Factory 1

Product 1 Product 2 Product 3

Factory 2

Product 1 Product 2 Product 3

$2.75 $2.50 $2.90 $3.00 $2.25 $2.45


Customer 1

$3.50 $3.00 $3.00 $3.50 $2.95 $2.75


Customer 2

$2.50 $2.00 $2.25 $3.50 $2.20 $2.35


Customer 3

$3.00 $2.75 $2.80 $2.50 $2.50 $2.85


Customer 4

$2.50 $2.60 $2.35 $2.00 $2.10 $2.45


Customer 5

Warehouse 1

Product 1 Product 2 Product 3

Warehouse 2

Product 1 Product 2 Product 3

Warehouse 3

Product 1 Product 2 Product 3

Warehouse 4

Product 1 Product 2 Product 3

$1.50 $1.00 $1.25 $1.00 $1.25 $1.10 $1.00 $0.90 $1.25 $2.50 $1.75 $1.50
Warehouse 1

$0.80 $0.90 $0.70 $0.50 $1.00 $1.10 $1.50 $1.35 $1.20 $1.50 $1.30 $1.10
Warehouse 2

$0.50 $1.20 $1.10 $0.50 $1.00 $0.90 $2.00 $1.45 $1.75 $0.60 $0.70 $1.50
Warehouse 3

$1.50 $1.30 $0.80 $1.00 $0.90 $1.40 $2.00 $1.80 $1.70 $1.50 $1.25 $1.10
Warehouse 4

$3.00 $2.10 $1.60 $0.50 $1.50 $1.75 $0.50 $1.00 $0.85 $0.50 $1.10 $0.90
Total

Number of products shipped Factory 1 Product 1 Product 2 Product 3 Factory 2 Product 1 Product 2 Product 3 Total Product 1 Product 2 Product 3 Capacity Product 1 Product 2 Product 3

0 0 0 0 0 0 0 0 0 35,000 30,000 20,000

0 0 0 0 0 0 0 0 0 20,000 25,000 20,000

0 0 0 0 0 0 0 0 0 30,000 15,000 25,000

0 0 0 0 0 0 0 0 0 15,000 24,000 20,000

0 0 0 0 0 0

Page 5

139350574.xls.ms_office

Customer 1 Factory 1 Product 1 Product 2 Product 3 Factory 2 Product 1 Product 2 Product 3

Customer 2

Customer 3

Customer 4

Customer 5

Total

0 0 0 0 0 0

0 0 0 0 0 0

0 0 0 0 0 0

0 0 0 0 0 0

0 0 0 0 0 0

0 0 0 0 0 0
Capacity

Total products shipped out of factory 1

Product 1 Product 2 Product 3

Total products shipped out of factory 2

Product 1 Product 2 Product 3

0 0 0 0 0 0

90,000 100,000 80,000 75,000 65,000 90,000

Customer 1 Warehouse 1 Product 1 Product 2 Product 3 Warehouse 2 Product 1 Product 2 Product 3 Warehouse 3 Product 1 Product 2 Product 3 Warehouse 4 Product 1 Product 2 Product 3 Total Product 1 Product 2 Product 3 Demands Product 1 Product 2 Product 3

Customer 2

Customer 3

Customer 4

Customer 5

Total

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 30,000 20,000 25,000 $0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 23,000 15,000 22,000

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15,000 22,000 16,000

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 32,000 12,000 20,000

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 16,000 18,000 25,000

0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0

Total cost of shipping

Problem This model builds on model Transport2. Again, a company wants to minimize cost of shipping, but this time there are 3 products to distribute. How should the company distribute the products? Solution The solution to the problem is identical to the one in Transport2. Notice that we have used the 'Insert Name Define' command to extend the model to a multiproduct problem. This way the variables and constraints are still the same as in Transport2. Remarks Notice that this model delivers the same result as three separate models for the three products. There will be

Page 6

139350574.xls.ms_office

times however, that there are constraints that apply to more than one product. In that case it would not be desirable to have three different models and maybe even impossible. For an extension of this model, where the number of products made in the factories depends on the demand and distribution rather than being constant, see the worksheet Prodtran in this workbook.

Page 7

139350574.xls.ms_office

Partial Loading (Knapsack Problem)


A fuel truck with 4 compartments needs to supply 3 different types of gas to a customer. When demand is not filled, the company loses $0.25 per gallon that is not delivered. How should the truck be loaded to minimize loss? Truck Specifications Comp. 1 Size (gallons) 1200 Comp. 1 Gas 1 Gas 2 Gas 3 Total Amount (gallons) Comp. 1 Gas 1 Gas 2 Gas 3 Comp. 2 Comp. 3 Comp. 4 Total Demand Loss Comp. 2 800 Comp. 2 Comp. 3 1300 Comp. 3 Comp. 4 700 Comp. 4

Loading of Compartments (1=yes, 0=no)

0 0 0 0

0 0 0 0

0 0 0 0

0 0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

0 0 0

$450.00 $375.00 $250.00 Total Loss ########

1800 1500 1000

Maximum Amount (gallons) Comp. 1 Gas 1 Gas 2 Gas 3 Comp. 2 Comp. 3 Comp. 4

0 0 0

0 0 0

0 0 0

0 0 0

Problem A fuel truck needs to supply 3 different kinds of gas to a customer. When demand is not filled the company loses $0.25 per gallon that is not delivered. The truck has 4 separate compartments of different size. How should the truck be loaded to minimize loss? Solution 1) The variables are the decisions to fill the compartments for each type of gas, and the amounts to be put in if the compartment is filled. In worksheet Knapsack, these are given the name Gallons_loaded and Loading_decisions. 2) The logical constraints are Gallons_loaded >= 0 via the Assume Non-Negative option Loading_decisions = binary Since there can only be one kind of gas in any compartment we have Total_decisions <= 1 The size limitations of the truck give Gallons_loaded <= Maximum_gallons We don't want to load more than needed. This gives Total_gallons <= Demand 3) The objective is to minimize the loss. This is given the name Total_loss. Remarks It is often possible to have different objectives in these types of problems. We might, for instance, want to minimize the wasted space in the truck in this example. Knapsack problems are characterized by a series of 0-1 integer variables with a single capacity constraint. If someone goes camping and his backpack can hold

Page 8

139350574.xls.ms_office

only a certain amount of weight, what items should the camper bring? He should try to optimize the value of the items while not exceeding the weight allowed by the backpack. There is a wide set of problems that fall into this category.

Page 9

139350574.xls.ms_office

Facility Location
A company currently ships its product from 5 plants to 4 warehouses. It is considering closing one or more plants to reduce cost. What plant(s) should the company close, in order to minimize transportation and fixed costs? Transportation Costs (per 1000 products) Plant 1 Warehouse 1 Warehouse 2 Warehouse 3 Warehouse 4 Plant 2 Plant 3 Plant 4 Plant 5

$4,000 $2,500 $1,200 $2,200


Plant 1

$2,000 $2,600 $1,800 $2,600


Plant 2

$3,000 $3,400 $2,600 $3,100


Plant 3

$2,500 $3,000 $4,100 $3,700


Plant 4

$4,500 $4,000 $3,000 $3,200


Plant 5

Open/close decision variables Decision

0
Plant 1

0
Plant 2

0
Plant 3

0
Plant 4

0
Plant 5 Total Demand

Number of products to ship (per 1000) Warehouse 1 Warehouse 2 Warehouse 3 Warehouse 4 Total Capacity Distr. Cost Fixed Cost Total Cost

0 0 0 0 0 0 $0 $0 $0

0 0 0 0 0 0 $0 $0 $0

0 0 0 0 0 0 $0 $0 $0

0 0 0 0 0 0 $0 $0 $0

0 0 0 0 0 0 $0 $0 $0

0 0 0 0

15 18 14 20

$0

Problem A company currently ships products from 5 plants to 4 warehouses. The company is considering the option of closing down one or more plants. This would increase distribution cost but perhaps lower overall cost. What plants, if any, should the company close? Solution 1) The variables are the decisions to open or close the plants, and the number of products that should be shipped from the plants that are open to the warehouses. In worksheet Facility these are given the names Open_or_close and Products_shipped. 2) The logical constraints are Products_shipped >= 0 via the Assume Non-Negative option Open_or_close = binary The products made can not exceed the capacity of the plants and the number shipped should meet the demand. This gives Products_made <= Capacity Total_shipped >= Demand 3) The objective is to minimize cost. This is given the name Total_cost on the worksheet. Remarks It is often possible to increase the capacity of a plant. This could be worked into the model with additional 0-1 or binary integer variables. The Solver would find out if it would be profitable to extend the capacity of a plant. It could also be interesting to see if it would be profitable to open another warehouse. An example of this can be found, in somewhat modified form, in the capacity planning model in the Finance Examples workbook.

Page 10

139350574.xls.ms_office

Production Transportation Problem (2-stage-transport, multi-commodity)


Minimize the costs of producing 3 different goods, and shipping them from factories to warehouses and customers, and warehouses to customers, while not exceeding the supply available from each factory or the capacity of each warehouse, and meeting the demand from each customer. Cost to make products Product 1 Factory 1 Factory 2 $4 $2 Product 1 Factory 1 Factory 2 0 0 Product 2 $5 $8 Product 2 0 0 Product 3 $3 $6 Product 3 0 0 Total Cost Cost of shipping ($ per product) Destinations Warehouse 1 Factory 1 Product 1 Product 2 Product 3 Factory 2 Product 1 Product 2 Product 3 $0.50 $1.00 $0.75 $1.50 $1.25 $1.40 Customer 1 Factory 1 Product 1 Product 2 Product 3 Factory 2 Product 1 Product 2 Product 3 $2.75 $2.50 $2.90 $3.00 $2.25 $2.45 Customer 1 Warehouse 1 Product 1 Product 2 Product 3 Warehouse 2 Product 1 Product 2 Product 3 Warehouse 3 Product 1 Product 2 Product 3 Warehouse 4 Product 1 Product 2 Product 3 Number of products shipped Warehouse 1 Factory 1 Product 1 Product 2 Product 3 Factory 2 Product 1 Product 2 0 0 0 0 0 Warehouse 2 0 0 0 0 0 Warehouse 3 0 0 0 0 0 Warehouse 4 0 0 0 0 0 Total 0 0 0 0 0 $1.50 $1.00 $1.25 $1.00 $1.25 $1.10 $1.00 $0.90 $1.25 $2.50 $1.75 $1.50 Warehouse 2 $0.50 $0.75 $1.25 $0.30 $0.80 $0.90 Customer 2 $3.50 $3.00 $3.00 $3.50 $2.95 $2.75 Customer 2 $0.80 $0.90 $0.70 $0.50 $1.00 $1.10 $1.50 $1.35 $1.20 $1.50 $1.30 $1.10 Warehouse 3 $1.00 $1.25 $1.00 $0.50 $1.00 $0.95 Customer 3 $2.50 $2.00 $2.25 $3.50 $2.20 $2.35 Customer 3 $0.50 $1.20 $1.10 $0.50 $1.00 $0.90 $2.00 $1.45 $1.75 $0.60 $0.70 $1.50 Warehouse 4 $0.20 $1.25 $0.80 $0.20 $0.75 $1.10 Customer 4 $3.00 $2.75 $2.80 $2.50 $2.50 $2.85 Customer 4 $1.50 $1.30 $0.80 $1.00 $0.90 $1.40 $2.00 $1.80 $1.70 $1.50 $1.25 $1.10 Customer 5 $2.50 $2.60 $2.35 $2.00 $2.10 $2.45 Customer 5 $3.00 $2.10 $1.60 $0.50 $1.50 $1.75 $0.50 $1.00 $0.85 $0.50 $1.10 $0.90 Cost $0 $0 $0

Page 11

139350574.xls.ms_office

Product 3 Total Product 1 Product 2 Product 3 Capacity Product 1 Product 2 Product 3

0 0 0 0 35,000 30,000 20,000 Customer 1

0 0 0 0 20,000 25,000 20,000 Customer 2 0 0 0 0 0 0

0 0 0 0 30,000 15,000 25,000 Customer 3 0 0 0 0 0 0

0 0 0 0 15,000 24,000 20,000 Customer 4 0 0 0 0 0 0

Customer 5 0 0 0 0 0 0

Total 0 0 0 0 0 0 Capacity

Factory 1

Product 1 Product 2 Product 3

0 0 0 0 0 0

Factory 2

Product 1 Product 2 Product 3

Total products shipped out of factory 1

Product 1 Product 2 Product 3

0 0 0 0 0 0 Customer 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 16,000 18,000 25,000

0 0 0 0 0 0 Total 0 0 0 0 0 0 0 0 0 0 0 0

Total products shipped out of factory 2

Product 1 Product 2 Product 3

Customer 1 Warehouse 1 Product 1 Product 2 Product 3 Warehouse 2 Product 1 Product 2 Product 3 Warehouse 3 Product 1 Product 2 Product 3 Warehouse 4 Product 1 Product 2 Product 3 Total Product 1 Product 2 Product 3 Demands Product 1 Product 2 Product 3 Total cost of shipping Total cost of production Total Cost 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 30,000 20,000 25,000 $0 $0 $0

Customer 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 23,000 15,000 22,000

Customer 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15,000 22,000 16,000

Customer 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 32,000 12,000 20,000

Problem A company wants to minimize the cost of shipping three different products from factories to warehouses and customers and from warehouses to customers. The production of each product at each plant depends on the distribution. How many products should each factory produce and how should the products be distributed in order to minimize total cost while meeting demand?

Page 12

139350574.xls.ms_office

Solution Notice that this is an extension of the transportation model as seen in the Transport3 worksheet. This time the factories do not produce a fixed amount. The amounts produced are now variables. 1) The variables are the number of products to make in the factories, the number of products to ship from factories to warehouses, factories to customers, and warehouses to customers. In worksheet Prodtran these are given the names Products_made, Factory_to_warehouse, Factory_to_customer, and Warehouse_to_customer. 2) The logical constraints are all defined via the Assume Non-Negative option: Products_made >= 0 Factory_to_warehouse >= 0 Factory_to_customer >= 0 Warehouse_to_customer >= 0 The other constraints are Total_from_factory <= Factory_capacity Total_to_customer >= Demand Total_to_warehouse <= Warehouse_capacity Total_to_warehouse = Total_from_warehouse 3) The objective is to minimize cost. This is defined in the worksheet as Total_cost. Remarks This is one of the more complex models in this series of examples. If the number of products, factories and warehouses becomes large, the number of variables in a model like this one becomes very large. Also bear in mind the degree of coordination between business units that may be needed in order to implement the optimal solution. For these reasons, some users prefer to split problems like this one into a set of smaller, simpler models.

Page 13

You might also like