Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 Bin packing Teacher’s guide

2 Copper tubing is sold in 10m lengths. For a particular job, the following lengths are required: 2m, 2m, 4m, 4m, 5m, 5m, 8m How many lengths do you require for the job? How did you decide? What difference would it make if you needed hundreds of lengths? The Plumber’s dilemma 2

3 This is a logical approach to solving bin packing problems. In this method we simply look for ‘full bin’ combinations. In the Plumber’s dilemma, copper piping is sold in 10m lengths. The plumber needed lengths of 2m, 2m, 4m, 4m, 5m, 5m, 8m A simple approach is to try to ‘make 10’. In this case this leads to an optimal solution of 3 lengths needed. 2 + 8 = 10 5 + 5 = 10 2 + 4 + 4 =10 However, this approach doesn’t work when large numbers of lengths are required. Full bin combinations 3

4 This is a general approach to solving bin packing problems. In this method we fit each activity in turn into the first available bin. By first available we mean the one that has sufficient room for this activity, starting with bin 1 in each case. The plumber needed lengths of 2m, 2m, 4m, 4m, 5m, 5m, 8m In the first fit algorithm, he cuts 2m, 2m and 4m from the first pipe. He now moves on to pipe 2 and so on. In this case, this does not produce an optimum solution. First fit algorithm 4

5 This is a general approach to solving bin packing problems. In this method we re-order the items in decreasing order of size first and then fit each activity in turn into the first available bin. The plumber needed lengths of 8m, 5m, 5m, 4m, 4m, 2m, 2m (re-ordered in decreasing order). He now cuts 8m from the first pipe. He can’t cut 5m from pipe 1 and so he moves on to pipe 2 and so on. At each stage he asks the question: ‘Can I cut this from pipe 1?’ ‘Can I cut this from pipe 2?’ and so on. In this case this leads to an optimal solution. First fit decreasing algorithm 5

6 A small ferry that sails between Portsmouth and the Isle of Wight has three lanes, each 20m long, on its car deck. The vehicles waiting to be loaded are: Can all the vehicles be taken in one trip? How did you decide? What difference would it make for a much more complicated question? The Ferry Operator’s problem Petrol tanker 13mSmall van3mTruck7m Small truck6mCoach12mCar3m Car 4mLorry11m 6

7 The lengths of the vehicles waiting to be loaded are: 13m, 3m, 7m, 6m, 12m, 3m, 4m, 11m First, sort the vehicles by length, largest first. 13, 12, 11, 7, 6, 4, 3, 3 The Ferry Operator’s problem In this case, it is not possible to fit all of the vehicles in one trip even though the total length is less than 60m. 3m 7

8 A project has to be completed in 13 days. The activities involved in the project are independent and their durations in days are given in the table: How many workers are required? How did you decide? What difference would it make if you had a much more complicated problem? The Builder’s problem ABCDEFGHIJ 3875845444 8

9 Core Maths Support Programme 60 Queens Road Reading RG1 4BS E-mail cmsp@cfbt.com Call 0118 902 1243


Download ppt "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."

Similar presentations


Ads by Google