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,

Slides:



Advertisements
Similar presentations
CATHERINE AND ANNIE Python: Part 3. Intro to Loops Do you remember in Alice when you could use a loop to make a character perform an action multiple times?
Advertisements

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.
Bin Packing First fit decreasing algorithm
 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
CS223 Advanced Data Structures and Algorithms 1 Greedy Algorithms Neil Tang 4/8/2010.
Greed is good. (Some of the time)
8.1 Advanced Operating Systems Defeating The Thrashing The RAM is limited. Sometimes, too many processes need large memory allocations and the sum of these.
Section 7.4: Closures of Relations Let R be a relation on a set A. We have talked about 6 properties that a relation on a set may or may not possess: reflexive,
Quick Sort, Shell Sort, Counting Sort, Radix Sort AND Bucket Sort
D1: Quick Sort. The quick sort is an algorithm that sorts data into a specified order. For a quick sort, select the data item in the middle of the list.
CMPS1371 Introduction to Computing for Engineers SORTING.
CPSC 171 Introduction to Computer Science More Efficiency of Algorithms.
Spreadsheets in Finance and Forecasting Presentation 8 Buttons, Boxes and Bars.
MAE 552 – Heuristic Optimization Lecture 27 April 3, 2002
CPSC 411, Fall 2008: Set 4 1 CPSC 411 Design and Analysis of Algorithms Set 4: Greedy Algorithms Prof. Jennifer Welch Fall 2008.
© 5/7/2002 V.S. Subrahmanian1 Knapsack Problem Notes V.S. Subrahmanian University of Maryland.
1 Class Constrained Packing We need to pack items into bins. All the bins have the same capacity. Each bin can accommodate items from a bounded number.
Quicksort.
CS 106 Introduction to Computer Science I 02 / 28 / 2007 Instructor: Michael Eckmann.
© J. Christopher Beck Lecture 18: Timetabling with Workforce Capacity.
Mr Barton’s Maths Notes
Finding a free maximum Derivatives and extreme points Using second derivatives to identify a maximum/minimum.
CS 106 Introduction to Computer Science I 10 / 15 / 2007 Instructor: Michael Eckmann.
CPSC 411, Fall 2008: Set 4 1 CPSC 411 Design and Analysis of Algorithms Set 4: Greedy Algorithms Prof. Jennifer Welch Fall 2008.
CS 106 Introduction to Computer Science I 10 / 16 / 2006 Instructor: Michael Eckmann.
Dave Risch. Project Specifications There is a “knapsack” that you want to fill with the most valuable items that are available to you. Each item has a.
Solving Algebraic Equations
2.3 Solving Word Problems. Goals SWBAT solve linear inequalities SWBAT solve linear inequalities SWBAT solve compound inequalities SWBAT solve compound.
Improved results for a memory allocation problem Rob van Stee University of Karlsruhe Germany Leah Epstein University of Haifa Israel WADS 2007 WAOA 2007.
Lesson 2. Starter Look at the hand out you have been given. Can you sort the numbers into ascending order. What mental or physical methods did you use.
Approximation schemes Bin packing problem. Bin Packing problem Given n items with sizes a 1,…,a n  (0,1]. Find a packing in unit-sized bins that minimizes.
Bin Packing algorithms: theatre booking
Spring 2015 Mathematics in Management Science Bin Packing The Problem The Algorithms.
1 Chapter 3: Efficiency of Algorithms Quality attributes for algorithms Correctness: It should do things right No flaws in design of the algorithm Maintainability.
计算机科学概述 Introduction to Computer Science 陆嘉恒 中国人民大学 信息学院
Planning and Scheduling Chapter 3 Jennifer Holland February 2, 2010.
Test 2 Review The test will consist of 3 sections. Section 1 is vocabulary matching. Section 2 is a Rate Per 100 problem. Section 3 is a Unit Rate Problem.
Lesson Objective: Understand what an algorithm is and be able to use them to solve a simple problem.
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.
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.
Using Substitution – Solve the system of linear equations. 1.
Instructor Neelima Gupta Table of Contents Factor 2 algorithm for Bin Packing Factor 2 algorithm for Minimum Makespan Scheduling Reference:
How would you divide 3,180 ÷ 15?. In this lesson you will learn how to divide by using an area model.
Algorithm Design Methods 황승원 Fall 2011 CSE, POSTECH.
Chapter 5 Linked List by Before you learn Linked List 3 rd level of Data Structures Intermediate Level of Understanding for C++ Please.
1 Windows Scheduling as a Restricted Version of Bin-packing. Amotz Bar-Noy Brooklyn College Richard Ladner Tami Tamir University of Washington.
Exponential Growth and Decay. Exponential Growth When you have exponential growth, the numbers are getting large very quickly. The “b” in your exponential.
Welcome Back to Math January 25, 2016 Today you will need:a pencil and eraser, your notebook, your tablet Math Message: Write an expression using letters.
TYPES OF INFORMATION SYSTEMS 2 ND. AUGUST 2005 TUESDAY LOWER SIXTH COMPUTING LESSON Prepared by: T.Fina Next.
Core Focus on Decimals & Fractions Lesson 2.4. Warm-Up ÷ 6 = ÷ 4 = 3. Karina made 293 cookies for a sale. She put 8 cookies on each plate.
What is density? How do objects float? How do substances float? What is Density? How do objects float? How do substances float?
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.
Aims: To learn about some simple sorting algorithms. To develop understanding of the importance of efficient algorithms. Objectives: All:Understand how.
BIN SORTING Problem Pack the following items in bins of size Firstly, find the lower bound by summing the numbers to be packed.
Bin Packing First fit decreasing algorithm
Unit B2 Day 5 This unit lasts for 3 weeks.
Bin Packing Optimization
10 Real Numbers, Equations, and Inequalities.
Bin Packing First fit decreasing algorithm
Bin packing – First fit algorithm
07/12/2018 Starter L.O. To be able to Solve a quadratic by factorising
Section 2: Multiple choice
Welcome to Excel An Excellent Tool.
Bin Packing First fit decreasing algorithm
Bin Packing First fit decreasing algorithm
Algorithm Design Methods
Length 4.5m = 9cm on the scale drawing Scale 1cm to 0.5m
Unit 2: Computational Thinking, Algorithms & Programming
Presentation transcript:

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, provided the tasks can be done in any order. Say that you are a journalist. There are 5 days until deadline day (so there are 5 bins). Each day contains 7 working hours (so each bin has a capacity of 7 hours). You then have a number of articles to write, each of which take a certain number of hours and must all be completed for deadline day. A bin-packing algorithm can help you to find a good order in which to do the tasks! Nothing to do with actual bins, you may be pleased to know!

There are three sorts of bin-packing algorithm. The first is the first-fit algorithm. Example 1:Jayme is a journalist. The articles she has left to write before deadline day will take hours. Each working day lasts 7 hours. Apply the first-fit bin-packing algorithm to the list to determine the number of days it will take Jayme to write the articles. D1: Bin-Packing Algorithms

The first-fit bin-packing algorithm means that you put each item in the first bin that has the free capacity to take it. Let’s see how this works. Working Bin Bin Bin 3 5 Bin Using the first-fit algorithm, Jayme will need 4 working days to write her articles. D1: Bin-Packing Algorithms

The second sort of bin-packing algorithm is the first-fit decreasing algorithm. Example 2:Sandrine is a joiner. She needs the following lengths of wood, in metres, for a project The wood she needs is sold in 4 metre lengths. a) Carry out a quick sort to produce a list of the lengths needed in descending order. Identify your pivots clearly. b) Apply the first-fit decreasing bin-packing algorithm to your ordered list to determine the total number of 4m lengths needed. D1: Bin-Packing Algorithms

This algorithm works by using a sorting algorithm on the data to get it into decreasing order, and then using the first-fit idea with the sorted list. WorkingThe correctly ordered list is Bin 1 3 Bin Bin 3 2 Using the first-fit decreasing algorithm, Sandrine will only need 3 of the 4m lengths of wood to complete her project D1: Bin-Packing Algorithms

What would have happened if you had used the first-fit algorithm? Example 2A:Sandrine is a joiner. She needs the following lengths of wood, in metres, for a project The wood she needs is sold in 4 metre lengths. Apply the first-fit bin-packing algorithm to the data to determine the total number of 4m lengths needed. D1: Bin-Packing Algorithms

D1: Bin-Packing There is another way to pack bins… use your own judgement! This is the full bin algorithm. The signal that tells you to do this is when a question begins with “Use the full bin algorithm to…” If that is the case, check through the list and make as many full bins as possible out of the numbers that you have (see Q3 of D1 January 2010 for an example of this).

There is another calculation related to bin-packing that you can be asked to perform: the lower bound. Example 2B:Sandrine is a joiner. She needs the following lengths of wood, in metres, for a project The wood she needs is sold in 4 metre lengths. Calculate a lower bound for the total number of 4 metre lengths that Sandrine will need. Add together all the values in the list, divide the total by the size of the bin (4, here) and round up (ALWAYS up!) ÷ 4 = bins minimum D1: Bin-Packing Algorithms

Notes The first-fit decreasing bin-packing algorithm is generally more efficient than the first-fit bin-packing algorithm. However, neither of these algorithms is guaranteed to give the best solution! There is no true algorithm that will always produce the best solution to bin-packing problems. Whenever an algorithm is not guaranteed to give the best solution possible, it is called a heuristic algorithm. D1: Bin-Packing Algorithms