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.

Slides:



Advertisements
Similar presentations
Math for Liberal Studies. There is a list of numbers called weights These numbers represent objects that need to be packed into bins with a particular.
Advertisements

Bin Packing First fit decreasing algorithm
NP-Completeness.
 Review: The Greedy Method
D1 Algorithms Sorting algorithms. Bubble sort- repeated passes through a list of numbers by comparing and switching adjacent numbers Try for 16, 9, 4,
Chapter 3: Planning and Scheduling Lesson Plan
Understanding Operating Systems Fifth Edition
Tournament Trees CSE, POSTECH.
Winner trees. Loser Trees.
Chapter 3 Measuring Yield.
Scheduling Two people are camping out and wish to cook a simple supper consisting of soup and hamburgers. In order to prepare the supper, several tasks.
PTAS for Bin-Packing. Special Cases of Bin Packing 1. All item sizes smaller than Claim 1: Proof: If then So assume Therefore:
Polynomial time approximation scheme Lecture 17: Mar 13.
© J. Christopher Beck Lecture 18: Timetabling with Workforce Capacity.
D1: Bin Packing Algorithms. D1: Bin-Packing Algorithms Bin-packing algorithms can be used to find ways to complete a number of tasks in given time slots,
Types of Market Structure
Improved results for a memory allocation problem Rob van Stee University of Karlsruhe Germany Leah Epstein University of Haifa Israel WADS 2007 WAOA 2007.
Chapter 12 Coping with the Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
The Maths of Sorting Things Out John D Barrow DAMTPCambridge Gresham College.
ALGORITHM TYPES Divide and Conquer, Dynamic Programming, Backtracking, and Greedy. Note the general strategy from the examples. The classification is neither.
Bin Packing algorithms: theatre booking
Spring 2015 Mathematics in Management Science Bin Packing The Problem The Algorithms.
Chapter 3 Measuring Yield. Introduction  The yield on any investment is the rate that equates the PV of the investment’s cash flows to its price:  This.
Chapter 2 Memory Management: Early Systems Understanding Operating Systems, Fourth Edition.
Planning and Scheduling Chapter 3 Jennifer Holland February 2, 2010.
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
Chapter 2 Memory Management: Early Systems Understanding Operating Systems, Fourth Edition.
For Wednesday No reading No homework There will be homework for Friday, as well the program being due – plan ahead.
B-Trees. Motivation for B-Trees So far we have assumed that we can store an entire data structure in main memory What if we have so much data that it.
B-Trees. CSM B-Trees 2 Motivation for B-Trees So far we have assumed that we can store an entire data structure in main memory What if we have so.
Algorithms An algorithm is a set of instructions that enable you, step-by-step, to achieve a particular goal. Computers use algorithms to solve problems.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Computing Science 1P Large Group Tutorial: Lab Exam & Class Test Simon Gay Department of Computing Science University of Glasgow 2006/07.
1 Approximation Algorithm Updated at 2011/01/03. 2 Approximation Algorithm Up to now, the best algorithm for solving an NP-complete problem requires exponential.
1 Algorithms & Data Structures for Games Lecture 2A Minor Games Programming.
By Christos Giavroudis Dissertation submitted in partial fulfilment for the degree of Master of Science in Communication & Information Systems Department.
Simple Percent Problems To solve a simple percent problem, you change the percent to a decimal and multiply. Solve the following percent problems. Remember.
Algorithm Design Methods 황승원 Fall 2011 CSE, POSTECH.
The bin packing problem. For n objects with sizes s 1, …, s n where 0 < s i ≤1, find the smallest number of bins with capacity one, such that n objects.
1 Windows Scheduling as a Restricted Version of Bin-packing. Amotz Bar-Noy Brooklyn College Richard Ladner Tami Tamir University of Washington.
Pass the Buck Every good programmer is lazy, arrogant, and impatient. In the game “Pass the Buck” you try to do as little work as possible, by making your.
Nonstandard Units of Measure SOL 6.10 Royal Foot and Hand The Royal Foot and Hand.
Biologically Inspired Computing: Indirect Encodings, and Hyperheuristics This is DWC’s lecture 7 for `Biologically Inspired Computing’ Contents: direct.
CS 361 – Chapter 10 “Greedy algorithms” It’s a strategy of solving some problems –Need to make a series of choices –Each choice is made to maximize current.
Critical Paths and Scheduling Tasks Circuits, Paths, and Schedules.
Unit 3 Scheduling and Planning. Literacy Practice Please read PG Stop at ASSUMPTIONS AND GOALS on page 68.
Bookshelves have become one of the most basic pieces of furniture in many places, including family homes, offices, classrooms, and public libraries. Since.
Bin packing Teacher’s guide. Copper tubing is sold in 10m lengths. For a particular job, the following lengths are required: 2m, 2m, 4m, 4m, 5m, 5m, 8m.
BIN SORTING Problem Pack the following items in bins of size Firstly, find the lower bound by summing the numbers to be packed.
Chapter 3: Planning and Scheduling. Planning and Scheduling - Topics Resolving Conflict via Coloring Bin Packing Scheduling Tasks Critical-Path Schedules.
Bin Packing First fit decreasing algorithm
Bin Packing First fit algorithm
Algorithm Design Methods
Chart Packing Heuristic
Exam 2 LZW not on syllabus. 73% / 75%.
Bin Packing First fit decreasing algorithm
Bin packing – First fit algorithm
PTAS for Bin-Packing.
Bellringer 2 Oct Write the opposite and absolute value of each number
Bin Packing First fit decreasing algorithm
Bin Packing First fit decreasing algorithm
Algorithm Design Methods
ICS 353: Design and Analysis of Algorithms
Algorithm Design Methods
Bin Packing First fit algorithm
Chapter 3: Planning and Scheduling Lesson Plan
B-Trees.
Bin Packing and Binary Search
Algorithm Design Methods
Investigation 1 Building Smart Boxes Rectangular Prisms
Presentation transcript:

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: 1)Next-fit (NF), first-fit (FF), worst-fit (WF) 2)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

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

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…

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 9

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 10