bin packing algorithms: theatre booking. your task you are the manager of a local theatre, and have...

12
BIN PACKING ALGORITHMS: THEATRE BOOKING

Upload: allen-small

Post on 29-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 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

BIN PACKING ALGORITHMS: THEATRE BOOKING

Page 2: 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

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 over the phone, so that they take up the least amount of space possible.

Page 3: 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

THEATRE INFORMATION

To 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. YOUR TASK You are the manager of a local theatre, and have been put in charge of the seating arrangements for

THE FIRST FIT ALGORITHM

The 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. YOUR TASK You are the manager of a local theatre, and have been put in charge of the seating arrangements for

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. YOUR TASK You are the manager of a local theatre, and have been put in charge of the seating arrangements for

THE FIRST FIT DECREASING ALGORITHM

This is exactly the same as the first fit algorithm, except you must put the given data

in 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. YOUR TASK You are the manager of a local theatre, and have been put in charge of the seating arrangements for

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 TASK You are the manager of a local theatre, and have been put in charge of the seating arrangements for

YOUR TASK

Now 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. YOUR TASK You are the manager of a local theatre, and have been put in charge of the seating arrangements for

EVALUATION

1.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. YOUR TASK You are the manager of a local theatre, and have been put in charge of the seating arrangements for

REAL LIFE EXAMPLES

Can 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. YOUR TASK You are the manager of a local theatre, and have been put in charge of the seating arrangements for

OPTIMISING LOGISITCS OPERATIONSA VIDEO INTERVIEW WITH BILL DOWSLAND

Page 12: 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

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