- Problem 18-3, page 376.

- Exercise 20.2-10 page 417.

- The business plan for the startup company SingleToy.com calls for the
company to sell a single toy each week. (This greatly simplifies the
design of their website!) Customers place their orders Monday through
Friday and all the orders are shipped out on Saturday from two warehouses
owned by the company. These toys are very popular and sell out each week.
In fact, most customers place orders for many units. You've been hired to
optimize their shipping costs.
Let r

_{1}and r_{2}denote the inventory at warehouses W_{1}and W_{2}respectively and let n = r_{1}+r_{2}. (I.e., W_{1}has r_{1}units of the toy of the week and W_{2}has r_{2}units for a total of n.) Suppose that m customers placed orders this week. Let x_{j}denote the number of units ordered by customer j. Since the toys were sold out,n = r

Let c_{1}+ r_{2}= x_{1}+ ... + x_{m}._{ij}denote the cost*per unit*for shipping the toy from warehouse W_{i}to customer j. For each customer j, you have the option of shipping y_{j}units, 0 <= y_{j}<= x_{j}, from W_{1}and z_{j}units, 0 <= z_{j}<= x_{j}, from W2 as long as y_{j}+ z_{j}= x_{j}. Your job is to minimize the total shipping cost, which is given by:c

_{11}y_{1}+ ...+c_{1m}y_{m}+ c_{21}z_{1}+ ...+c_{2m}z_{m}- Your predecessor at SingleToy.com used the following strategy: sort
the c
_{ij}'s then starting with the smallest c_{ij}, ship as many units from W_{i}to customer j as possible and then go on with the next smallest c_{ij}. Give a concrete example with 2 customers and show that in your example, your predecessor's strategy does not give the minimum shipping cost. - Devise an efficient algorithm that finds the values of y
_{j}and z_{j}that gives the minimum shipping costs. Briefly justify that your algorithm is correct. Analyze the running time of your algorithm.

- Your predecessor at SingleToy.com used the following strategy: sort
the c

Last Modified: 29 Jan 2001 13:00:53 EST by

Richard Chang

Back up to Spring 2001 CMSC 641 Homepage