bin packing algorithms: theatre booking

12
BIN PACKING ALGORITHMS: THEATRE BOOKING

Upload: marlon

Post on 22-Feb-2016

97 views

Category:

Documents


1 download

DESCRIPTION

Bin Packing algorithms: theatre booking. Your Task. You are the manager of a local theatre, and have been put in charge of the seating arrangements for the audience for an upcoming event. Your task is to find the best way to organise the audience members that have already booked online or - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Bin Packing algorithms: theatre booking

BIN PACKING ALGORITHMS: THEATRE BOOKING

Page 2: Bin Packing algorithms: theatre booking

YOUR TASKYou are the manager of a local theatre, and have been put in charge of the seating arrangements for the audience for an upcoming event.

Your task is to find the best way to organise the audience members that have already booked online or over the phone, so that they take up the least amount of space possible.

Page 3: Bin Packing algorithms: theatre booking

THEATRE INFORMATIONTo complete this task, you need to know the following

information:

• The audience seating area in the theatre is arranged such that there are 12 rows, and each row consists of 10 seats.

• The people that have already booked to see the show must sit together in the groups they have booked in: they cannot be separated.

• The members of the public who have already booked to see the show are in the following groups:

2 2 3 5 6 2 1 3 1 4 4 5 8 10 3 5 6 4 4 2 • The audience members would like to sit as close to the front

of the theatre as possible.

Page 4: Bin Packing algorithms: theatre booking

THE FIRST FIT ALGORITHMThe algorithm is as follows:Note: You must consider each audience member/group size in

the order they are given.1. Take the first group size. Place it in the first row, starting

from the left hand side. 2. Take the next group size. Look to see if there is enough

room for it in the first row, immediately after the previous entry. If there is, place the group in this row, starting from the left hand side. If not, put it in the next row.

3. Continue the algorithm so that every person who has already booked has been allocated a seat. Remember: Always start from the left hand side of the rows and work from the first row, backwards.

Page 5: Bin Packing algorithms: theatre booking

Hence, the minimum amount of rows required for this algorithm is 9 rows.

Order of Group Sizes:2, 2, 3, 5, 6, 2, 1, 3, 1, 4, 4, 5, 8, 10, 3, 5, 6, 4, 4, 2

Page 6: Bin Packing algorithms: theatre booking

THE FIRST FIT DECREASING ALGORITHMThis is exactly the same as the first fit algorithm, except you

must put the given datain decreasing order first, before sorting the data into the

appropriate rows.

Your turn! Recall that the members of the public who have already booked

to see the show are in the following groups: 2 2 3 5 6 2 1 3 1 4 4 5 8 10 3 5 6 4 4 2

Apply the “First Fit Decreasing” algorithm to your data. What is the minimum amount

of rows you use?

Page 7: Bin Packing algorithms: theatre booking

Hence, the minimum amount of rows required for this algorithm is 8 rows.

Order of Group Sizes:10, 8, 6, 6, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2, 1, 1

Page 8: Bin Packing algorithms: theatre booking

YOUR TASKNow that you know how to apply the algorithm, it is now time to create your own!

Come up with an appropriate bin-packing scenario with at least 10 group sizes/amounts. You must also create a solution so that it can be tested and checked later on!

Swap your work with your partner and see if they can find the correct solution!

Good luck!

Page 9: Bin Packing algorithms: theatre booking

EVALUATION1.What are the benefits and cons of both

algorithms? 2.Which is the best algorithm for the

theatre to use?3.Which part of today’s lesson did you

feel most confident in?4.How do you think the difficulty of these

algorithms could be improved?

Page 10: Bin Packing algorithms: theatre booking

REAL LIFE EXAMPLESCan you think of any examples where algorithms are/could be used in real life?

Portsmouth Harbour (Google Maps Satellite View)

Page 11: Bin Packing algorithms: theatre booking

OPTIMISING LOGISITCS OPERATIONSA VIDEO INTERVIEW WITH BILL DOWSLAND

Page 12: Bin Packing algorithms: theatre booking

Please ensure that you have the following items in your bag

before you hand it back in:

· The 10x12 grid - 3 x ‘5’ rectangles· 2 x ‘1’ rectangles - 2 x ‘6’ rectangles· 4 x ‘2’ rectangles - 1 x ‘8’ rectangles· 3 x ‘3’ rectangles - 1 x ‘10’ rectangles· 4 x ‘4’ rectangles