The bin packing problem is where you have an infinite number of containers that hold up to N1 units (usually each container holds the same amount of stuff, but the problem can be extended to include multiple types of containers), and you've got a whole bunch of crap that's got different sizes N1[0], N1[1], N1[2], ... and you want to minimize the number of containers needed to hold the crap. (The problem is trivial if you're able to cut up your crap into smaller pieces of crap, but if you can't cut the crap then the problem is an NP Hard optimization problem meaning that it probably doesn't have a precise polynomial time solution which means that it's a difficult problem.)
A few years ago I worked at a logistics company that had an algorithm for estimating the number of boxes needed to ship a bunch of packages, so instead of a one-dimensional bin packing problem it was a three-dimensional bin packing problem. The one-dimensional bin packing problem has a nice heuristic called the best-fit-decreasing heuristic, where you sort your crap in order of largest piece of crap to smallest piece of crap and then you pack your crap in order, and you always put the next piece of crap in the container with the smallest difference between available space and size of crap. This is fast and gives a reliable approximate solution. The doofus who wrote our three-dimensional bin packing algorithm used this heuristic, using he box and package volume as the input. This doesn't work. Let's say I have a 12x12x12 box, volume 1728, and three 8x8x8 packages, total volume 1536; this guy's ****ty algorithm would say that you could put all three packages in the box, even though this is impossible (unless you crush or cut up the packages, which you probably don't want to do). Anyway, there are a couple ways to account for package dimensions in a three-dimensional bin packing algorithm, and because we just wanted a rough estimate I went with a fast but imprecise technique called the guillotine cut: when you put an 8x8x8 package in a 12x12x12 box then you slice the box into a 12x8x4 box, a 12x8x4 box, and an 8x8x4 box, none of which can hold another 8x8x8 package. (The source of imprecision is that in reality a 12x12x12 box could hold four 12x8x4 packages, but the guillotine cut heuristic would split up the remainder boxes such that you could only put in three 12x8x4 boxes.)
My next challenge is that the doofuses in QA didn't like my algorithm because according to their ****ty metrics the old algorithm gave better results, where "better" just means "put the packages in a smaller volume of boxes," not taking into account whether the estimate could actually be accomplished in reality (for example the old algorithm would say that you could put three 8x8x8 packages in a 12x12x12 box whereas my algorithm would say that you'd need three 12x12x12 boxes, so the old algorithm gave a "better" estimate that was also completely wrong). After a week of this crap the head of software development intervened and told QA to pull their heads out of their asses.
And thus ends the worlds best and worst copycat thread.
A few years ago I worked at a logistics company that had an algorithm for estimating the number of boxes needed to ship a bunch of packages, so instead of a one-dimensional bin packing problem it was a three-dimensional bin packing problem. The one-dimensional bin packing problem has a nice heuristic called the best-fit-decreasing heuristic, where you sort your crap in order of largest piece of crap to smallest piece of crap and then you pack your crap in order, and you always put the next piece of crap in the container with the smallest difference between available space and size of crap. This is fast and gives a reliable approximate solution. The doofus who wrote our three-dimensional bin packing algorithm used this heuristic, using he box and package volume as the input. This doesn't work. Let's say I have a 12x12x12 box, volume 1728, and three 8x8x8 packages, total volume 1536; this guy's ****ty algorithm would say that you could put all three packages in the box, even though this is impossible (unless you crush or cut up the packages, which you probably don't want to do). Anyway, there are a couple ways to account for package dimensions in a three-dimensional bin packing algorithm, and because we just wanted a rough estimate I went with a fast but imprecise technique called the guillotine cut: when you put an 8x8x8 package in a 12x12x12 box then you slice the box into a 12x8x4 box, a 12x8x4 box, and an 8x8x4 box, none of which can hold another 8x8x8 package. (The source of imprecision is that in reality a 12x12x12 box could hold four 12x8x4 packages, but the guillotine cut heuristic would split up the remainder boxes such that you could only put in three 12x8x4 boxes.)
My next challenge is that the doofuses in QA didn't like my algorithm because according to their ****ty metrics the old algorithm gave better results, where "better" just means "put the packages in a smaller volume of boxes," not taking into account whether the estimate could actually be accomplished in reality (for example the old algorithm would say that you could put three 8x8x8 packages in a 12x12x12 box whereas my algorithm would say that you'd need three 12x12x12 boxes, so the old algorithm gave a "better" estimate that was also completely wrong). After a week of this crap the head of software development intervened and told QA to pull their heads out of their asses.
And thus ends the worlds best and worst copycat thread.
Comment