Register  
 
About Us | Help | Sign in
 
   

Revision:Packing Algorithms

From The Student Room

TSR Wiki > Study Help > Subjects and Revision > Revision Notes > Mathematics > Packing Algorithms



Contents

First Fit

Work along the list, putting items in the first place where they fit. Remember you can go back and fill previous gaps if later pieces fit.

First Fit Decreasing

Start by sorting the items into decreasing order. Then proceed to work along the (newly ordered) list as with First Fit.

Example

Tapes last 45 minutes. The songs to be recorded on the tapes have the following durations, in minutes.

8 4 5 3 6 9 4 10 7 12 5 8 4 5

The total duration is exactly 90 minutes. Can the songs be fitted onto 2 tapes?

Using First Fit

3 tapes are needed.

Image:Packing example 1.jpg

Using First Fit decreasing

2 tapes are needed.

12 10 9 8 8 7 6 5 5 5 4 4 4 3

Image:Packing example 2.jpg


Also See

See the other D1 notes:

  1. Algorithms
  2. Sorting algorithms
  3. Packing algorithms
  4. Graphs and networks
  5. Minimum connector problems
  6. The shortest path
  7. Route inspection
  8. The travelling salesman problem
  9. Linear programming
  10. The simplex algorithm

Comments

collapse
Recent Threads
 
collapse I really like this car, BUT..
started by: foxycaradoc
forum: Motoring
replies: 12
last post: 1 Minute Ago
collapse Are you at a private, state, grammer school??
started by: Kathryn91919
replies: 64
last post: 1 Minute Ago
collapse Favourite Word...
started by: ADREAM
replies: 33
last post: 1 Minute Ago
collapse WWIII - what would you do? (Poll)
started by: AWZC
replies: 23
last post: 1 Minute Ago
collapse Medicine
started by: goats
replies: 2
last post: 1 Minute Ago