02-greedy

E the one with the earliest finish time then a k is an

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: h |B| > | A - {k}|, 56 Then B U {k} is compatible And |B U {k}| > |A|, which is a contradiction Back to Semester at Sea… Id Start End Len Activity 2 4 1 6 1 3 0 5 4 5 6 7 5 7 8 9 10 3 5 6 8 8 8 9 10 11 12 3 11 2 12 13 14 Solution: 2, 6, 9, 11 57 4 3 7 3 Tropical Drink Engineering with Prof. Bloomfield Applied ChemE: Suntan Oil or Lotion? Fractals, Recursion and Crayolas Hydrodynamics and Surfing Optimization, Greedy Algorithms, and the Buffet 6 Line 5 Computational Genetics and Infectious Diseases 5 Turing Award Speech Karaoke 4 Pool Tanning for Engineers 5 Mechanics, Dynamics and Shuffleboard Physics Managing Keyboard Fatigue with Swedish 12 Massage 3 Discrete Math Applications in Gambling Visualizing these Activities ID Start End 1 0 6 2 1 4 3 2 13 4 3 5 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 3 8 6 5 7 7 5 9 8 6 10 9 8 11 10 8 12 11 12 14 58 Visualizing these Activities ID Start End 1 0 6 2 1 4 3 2 13 4 3 5 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 3 8 6 5 7 7 5 9 8 6 10 9 8 11 10 8 12 11 12 14 59 Sorted, Then Showing Selection and Incompatibilities ID Start End 2 1 4 4 3 5 1 0 6 6 5 7 5 3 8 7 5 9 8 6 10 9 8 11 10 8 12 3 2 13 11 12 14 60 0123456789 11 12 13 Select solid-colored item, Eliminates activities X’d out of same color 14 10 Interval selection algorithm s is an array of the intervals’ start times f is an array of the intervals’ finish times greedy-interval (s, f) A is the array of the interv...
View Full Document

Ask a homework question - tutors are online