1 / 10

0304 Bin Packing

0304 Bin Packing. Background: Suppose you plan to build a wall system for your books, records, and stereo set in your dorm room. The wall system requires 24 wooden shelves of various lengths: 6,6,5,5,5,4,4,4,4,2,2,2,2,3,3,7,7,5,5,8,8,4 and 5 feet

chico
Download Presentation

0304 Bin Packing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 0304 Bin Packing

  2. Background: Suppose you plan to build a wall system for your books, records, and stereo set in your dorm room. The wall system requires 24 wooden shelves of various lengths: 6,6,5,5,5,4,4,4,4,2,2,2,2,3,3,7,7,5,5,8,8,4 and 5 feet The lumberyard, however, sells wood only in boards of length 9 feet. If each board costs $8, what is the minimum cost to by sufficient wood for this wall system?

  3. Bin-packing problem: when we wish to find the minimum number of “bins” into which the weights of a problem can be “packed” or sorted There are 2 sets of 3 types of these problems that we will be talking about: Next-fit (NF), first-fit (FF), worst-fit (WF) Next-fit decreasing (NFD), first-fit decreasing (FFD), worst-fit decreasing (WFD)

  4. Next Fit Advantage – does not require knowing all the weights in advance & only the remaining space in the bin currently being packed must be remembered Disadvantage – a bin packed early on may have had room for small items that come later in the list How to: Put the weights into the first bin until the next weight won’t fit, and then start a new bin

  5. Next Fit Example: Weights: 6,6,5,5,5,4,4,4,4,2,2,2,2,3,3,7,7,5,5,8,8,4,4,5 Each bin is 9 feet long 4 2 3 4 4 2 7 7 2 8 8 6 6 5 5 5 5 5 5 4 4 4 3 2

  6. First Fit How to: Put the next weight into the first bin already opened that has room for this weight; if no such bin exists, start a new bin.

  7. First Fit Example: Weights: 6,6,5,5,5,4,4,4,4,2,2,2,2,3,3,7,7,5,5,8,8,4,4,5 Each bin is 9 feet long 4 4 4 4 2 2 4 2 2 3 7 7 8 8 6 6 5 5 5 5 5 5 4 3

  8. Worst Fit How to: Each item is packed into the bin with the most space, if the item doesn’t fit into any bins add another Example: Weights: 6,6,5,5,5,4,4,4,4,2,2,2,2,3,3,7,7,5,5,8,8,4,4,5 Each bin is 9 feet long You try…

  9. BUT these methods don’t account for large weights, that are more difficult to fit/pack, later in the list. Therefore, we should first sort the items to be packed in order of decreasing size. (That is, assuming we know these in advance.) This approach yields three new methods: Next-fit decreasing, First-fit decreasing, & Worst-fit decreasing

  10. Note: NONE of the six heuristic methods will necessarily find the optimal number of bins for an arbitrary problem. Homework- Pg 112: 40, 41, 42, 44 #44: “Best fit” is the opposite of the worst-fit method, where each item is packed into the bin that would leave the LEAST amount of available space in the bin

More Related