I am a programmer and have the following requirement.


We are trying to figure out the optimal way to ship widgets. Below is the scenario:


* We need to ship 1,000,000 widgets
* We have two different size boxes. A 300 widget size box and a 200 widget size box.
* The widgets are shipped to 2,000 individual distributors, in multiple boxes.
* Each of those 2000 distributors service on average 10 locations
* There are 20,000 individual locations
* Each location calls for random number of widgets
	+ Location 1 requires 25 widgets
	+ Location 2 requires 75 widgets
	+ .
	+ .
	+ Location 20,000 requires 12 widgets
* The widgets are put into a bag; a bag is for one location. There can be multiple bags in a box. The box is shipped to the distributor.
* We cannot have more than 100 widgets in a bag.


What would be the most efficient way to ship as few boxes as possible?



Model for shipping widgets in an optimal way
Is the routing from factory to distributor to location fixed, or are you considering optimizing this too? In particular, are there costs associated with using a distributor? If the answers to one or both of these questions are yes, then you should take at the literature on "uncapacitated facility location problems."


If the routing is fixed, then the only decision you have to make is how to pack the bags into boxes. For each route from factory to distributer you have a collection of bags, and you want to pack them optimally into boxes. This is what is known as a "bin packing problem", with "multiple bin sizes." It's NP-hard, but since your individual instances are tiny (an average of 10 locations per distrbuter), it shouldn't be hard to solve each instance exactly. 


