Revision:Packing Algorithms - The Student Room
The Student Room

Revision:Packing Algorithms

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

However neither method always gives the optimal solution.

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

Discussions Toggle
Capacitance Question - Stonebridge HELP !
started by: Ari Ben Canaan
forum: Physics
replies: 2
last post: 1 Minute Ago
Why do people feel such animosity towards Margaret Thatcher
started by: quattro94
forum: UK Politics
replies: 132
last post: 2 Minutes Ago
What is wrong with these people? [Egyptian violence]
started by: GunnerBill
forum: International
replies: 23
last post: 6 Minutes Ago
Why do the majority of the public prefer 'old' architecture?
started by: Chucklefiend
forum: Architecture and the Built Environment
replies: 44
last post: 8 Minutes Ago
Stupid Snow
started by: cgvince
forum: Travel
replies: 1
last post: 8 Minutes Ago
your top 5 favorite bands/singers of all time
started by: hbk4894
forum: Music
replies: 117
last post: 9 Minutes Ago
Test your English
started by: MarcD
forum: Books, Literature & Poetry
replies: 3
last post: 12 Minutes Ago
losing/gaining religion - educating yourself
started by: chickenonsteroids
forum: Religion
replies: 2
last post: 14 Minutes Ago
Girls: What do you think of this t-shirt?
started by: Jsee
forum: Clothes and Accessories
replies: 34
last post: 15 Minutes Ago
ccea geography
started by: aqagcse2011
forum: Geography and Geology
replies: 1
last post: 17 Minutes Ago
London Olympics orientation training in feb 2012... who's going?
started by: Lottie04
forum: London 2012 Olympic and Paralympic Games
replies: 34
last post: 22 Minutes Ago
Feminism is rubbish?
started by: Mushrooms
forum: Society
replies: 230
last post: 24 Minutes Ago
Are you happy with your life?
started by: Ree69
forum: Mental Health
replies: 29
last post: 26 Minutes Ago
Journalism Applicants 2012
started by: Fruitcake_OX
forum: Media, Film and Journalism
replies: 53
last post: 26 Minutes Ago
Durham Applicants Thread 2012
started by: student1234567891
forum: Durham University
replies: 2240
last post: 26 Minutes Ago
Anyone received any offers for a BA Journalism course?
started by: aztecg0ld
forum: Media, Film and Journalism
replies: 39
last post: 27 Minutes Ago
Depression Society MKVI
started by: Idle
forum: Mental Health
replies: 982
last post: 28 Minutes Ago
SEO London IB Summer Internships 2011
started by: Miyavi
forum: Investment Banking Internships and Work Experience
replies: 497
last post: 34 Minutes Ago
Cambridge Postgraduate applicants 2012
started by: HippyVann
forum: Postgraduate
replies: 1866
last post: 34 Minutes Ago
The Horoscope And Zodiac Signs
started by: jaenvin
forum: Religion
replies: 7
last post: 38 Minutes Ago
Article Updates Toggle
Contact Us | Site Rules | Staying Safe on TSR | Advertising | Staff Blog | Essays & Coursework | Terms & Conditions | Top
Customise your TSR | Life Advice | Hobbies and Interests | Debate and Current Affairs | Study Help | University and University courses
Universities and HE Colleges | Careers, Employment and Gap Years | General Discussion

Customise your TSR