1 / 10

Bin Packing

Bin Packing. The Problem The Algorithms. The Bin Packing Problem. Pack wts w 1 , w 2 , …, w n into bins. Each bin has fixed capacity. Use as few bins as possible. A scheduling problem in disguise! unlimited # of procs each with fixed capacity (Goal: minimize # procs ). Scheduling

Download Presentation

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. Bin Packing The Problem The Algorithms Mathematics in Management Science

  2. The Bin Packing Problem Pack wtsw1, w2, …,wninto bins. Each bin has fixed capacity. Use as few bins as possible. A scheduling problem in disguise! unlimited # of procs each with fixed capacity (Goal: minimize # procs)

  3. Scheduling task task time processor completion time completing a task # of processors Bin Packing item to pack weight of item bin bin size packing an item # of bins Dictionary

  4. Heuristic Algorithms NF – Next Fit FF – First Fit WF – Worst Fit In last 3, bins stay open until they are completely full. Decreasing Versions NFD – Next Fit D FFD – First Fit D WFD – Worst Fit D With these first sort wts into decreasing order, then pack. The Algorithms

  5. Next Fit Packing Algortihm Pack item in current bin. If item will not fit in current bin: close this bin & open a new bin. Continue until all items packed.

  6. Example using Next Fit Packing Wts6, 6, 5, 5, 5, 4, 4, 4, 4, 2, 2, 2, 2, 3, 3, 7, 7, 5, 5, 8, 8, 4, 4, 5

  7. Next Fit Packing Algortihm Advantages – Do not need to know all the weights in advance; only need to know the remaining space in the bin. Disadvantages – The bin packed early on may have had room for small items that come later in the list. Best method for assembly-line packing.

  8. First Fit & Worst Fit Packing Keep all bins open until full. Then close. To pack an item, look at open bins. FFPlace item in first bin in which it fits. WFPlace item in bin with the most space (and into which item fits) . Only open new bin if item will not fit in any of the already open bins.

  9. Bin Packing Methods Next Fit & First Fit & Worst Fit NFA new bin is opened if the weight to be packed next will not fit in the bin that is currently being filled; the current bin is then closed. FF The next weight to be packed is placed in the lowest-numbered bin already opened into which it will fit. If it does not fit in any open bins, a new bin is opened. WF The next weight to be packed is placed into the open bin with the largest amount of room remaining. If it does not fit in any bins, open a new bin. 9

  10. Bin Packing Methods Next Fit Decreasing (NFD) First Fit Decreasing(FFD) Worse Fit Decreasing(WFD) Decreasing-Time Heuristics NFD, FFD, WFD – Create the priority list by listing the weightsin order of decreasing size before applying selected bin-packing method. 10

More Related