Bin packing – First fit algorithm

Slides:



Advertisements
Similar presentations
1D Bin Packing (or “CP? Who cares?”)
Advertisements

Bubble Sort Example 9, 6, 2, 12, 11, 9, 3, 7 6, 9, 2, 12, 11, 9, 3, 7 Bubblesort compares the numbers in pairs from left to right exchanging.
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.
Click to edit Master title style. Click to edit Master subtitle style.
Bin Packing First fit decreasing algorithm
Bin Packing First fit algorithm
D1 Algorithms Sorting algorithms. Bubble sort- repeated passes through a list of numbers by comparing and switching adjacent numbers Try for 16, 9, 4,
CS223 Advanced Data Structures and Algorithms 1 Greedy Algorithms Neil Tang 4/8/2010.
Bubble Sort Algorithm It is so named because numbers (or letters) which are in the wrong place “bubble-up” to their correct positions (like fizzy lemonade)
Title Sub Head. Title ► First level information  Second level information Third level information +Fourth level information ◦Fifth level information.
Selection Sort
Kindergarten Math Fact Fluency Goal
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,
Spring 2015 Mathematics in Management Science Bin Packing The Problem The Algorithms.
Lesson Objective: Understand what an algorithm is and be able to use them to solve a simple problem.
Bubble Sort. Bubble Sort Example 9, 6, 2, 12, 11, 9, 3, 7 6, 9, 2, 12, 11, 9, 3, 7 6, 2, 9, 12, 11, 9, 3, 7 6, 2, 9, 11, 12, 9, 3, 7 6, 2, 9, 11, 9, 12,
Summary Algorithms Flow charts Bubble sort Quick sort Binary search Bin Packing.
How to Plant Lima Beans. Materials Needed Large Spoon Clear Plastic Cup Potting Soil Lima Bean Water.
Kindergarten, 1st Grade, and 2nd Grade
Bin packing First-fit algorithm A B C D E F 4 Each block will be fitted into the first bin that has room for it. Bin packing First-fit.
Selection Sort
Bubble Sort Example
Example 1 Writing Powers Write the product as a power and describe it in words. a. 44= to the second power, or 4 squared 9 to the third power,
In the first pass, the first two numbers are compared. The shuttle sort compares the numbers in pairs from left to right exchanging when necessary.
Math for Liberal Studies.  The knapsack problem is a variation of the bin packing problems we have been discussing  This time, there is just one bin.
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.
Fractions Part Two. How many halves are in a whole? 2 1/2.
1. Identify the group, period, and block in which the element that has the electron configuration [Xe]6s2 is located.
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.
Headline sample style Intro sample style Click to edit Master text styles –Second level Third level –Fourth level o Fifth level.
CS212: Data Structures and Algorithms
Bin Packing First fit decreasing algorithm
Bin Packing First fit algorithm
How to Plant Lima Beans.
Click to Add Title Click to Add Subtitle.
Click to Add Title Click to Add Subtitle.
Bubble Sort Bubble sort is one way to sort an array of numbers. Adjacent values are swapped until the array is completely sorted. This algorithm gets its.
Click to edit Master text styles
Shuttle Sort Example 1st pass Comparisons: 1
MidlandMills – Block C Unit 1-1 (Ground Floor) TYPE: 1 room
Click to Add Title Click to Add Subtitle.
Click to Add Title Click to Add Subtitle.
Author names here Author association names here
Click to edit Master text styles
Title Slide Alternative 1
Student #7 starts with Locker 7 and changes every seventh door
Bin Packing First fit decreasing algorithm
Lesson Action Guide COURSE LOGO Lesson Title This
Title Slide Alternative 1
Title Slide Alternative 1
Click to edit Master text styles
Bubble Sort Example 9, 6, 2, 12, 11, 9, 3, 7 6, 9, 2, 12, 11, 9, 3, 7 Bubblesort compares the numbers in pairs from left to right exchanging.
Slide Title Edit Master text styles Second level Third level
ОПШТЕСТВО ТЕМА: МЕСТОТО ВО КОЕ ЖИВЕАМ Скопје
Bin Packing First fit decreasing algorithm
Where …? Unit 2 Open Day.
Title Slide Alternative 1
Author names here Author associations here
Bin Packing First fit decreasing algorithm
Author names here Author associations here
Decision Maths Unit 7 Sorting Algorithms 3. Shell Sort.
Around the room Orders of operations.
Click to edit Master text styles
Lorem ipsum dolores Lorem ipsum dolores.
Presentation Title Presenter’s Name.
Bin Packing First fit algorithm
Author names here Author associations here
Shuttle Sort Example 1st pass Comparisons: 1
Click to edit Master text styles
Presentation transcript:

Bin packing – First fit algorithm A B C D E F Each block will be fitted into the first bin that has room for it. 6 5 4 3 3 3 2 2 1

Bin packing – First fit algorithm 4 A B C D E F The first block fits into the first bin 6 5 3 3 3 2 2 1

Bin packing – First fit algorithm 1 4 A B C D E F The second block fits in the first bin 6 5 3 3 3 2 2

Bin packing – First fit algorithm 2 1 4 A B C D E F The third block will not fit in the first bin 6 5 3 3 3 2

Bin packing – First fit algorithm 1 4 2 A B C D E F But there is room in the second bin 6 5 3 3 3 2

Bin packing – First fit algorithm 5 5 1 5 4 2 A B C D E F The third bin is the first one the 5 will fit in 6 3 3 3 2

Bin packing – First fit algorithm 3 1 3 5 4 2 A B C D E F The second bin has room for the 3 6 3 3 2

Bin packing – First fit algorithm 2 2 2 1 3 5 4 2 2 A B C D E F The fourth bin is the first one with room for the next one 6 3 3

Bin packing – First fit algorithm 3 3 3 1 3 5 3 4 2 2 A B C D E F The next one also fits in the fourth bin 6 3

Bin packing – First fit algorithm 6 6 6 6 6 1 3 5 3 4 2 2 A B C D E F No room until the fifth bin for the 6 3

Bin packing – First fit algorithm 3 3 3 3 3 6 1 3 5 3 4 3 2 2 A B C D E F The 3 has to start a new bin Total usage is 6 bins.

Bin packing – First fit decreasing algorithm A B C D E F With the first fit decreasing algorithm we sort the blocks into descending order first. 6 5 4 3 3 3 2 2 1

Bin packing – First fit decreasing algorithm A B C D E F 6 5 4 3 3 3 2 2 1

Bin packing – First fit decreasing algorithm 6 A B C D E F Now we use the first fit algorithm 5 4 3 3 3 2 2 1

Bin packing – First fit decreasing algorithm 5 6 5 A B C D E F 4 3 3 3 2 2 1

Bin packing – First fit decreasing algorithm 4 4 6 5 4 A B C D E F 3 3 3 2 2 1

Bin packing – First fit decreasing algorithm 3 3 3 6 5 4 3 A B C D E F 3 3 2 2 1

Bin packing – First fit decreasing algorithm 3 3 3 6 3 5 4 3 A B C D E F 3 2 2 1

Bin packing – First fit decreasing algorithm 3 3 3 3 6 3 5 4 3 3 A B C D E F 2 2 1

Bin packing – First fit decreasing algorithm 2 2 6 2 3 5 4 3 3 A B C D E F 2 1

Bin packing – First fit decreasing algorithm 2 2 2 2 6 2 3 5 2 4 3 3 A B C D E F 1

Bin packing – First fit decreasing algorithm 1 6 1 2 3 5 2 4 3 3 A B C D E F We have packed them into 5 bins.