L01 Introduction
L01 Introduction
Algorithms
Lecture 1
Prof. Piotr Indyk
Course information
• Course web site: Canvas (+Piazza, Gradescope)
• Staff
• Prerequisites: intro to algorithms, discrete maths
– If not fulfilled, email [email protected]
• Lectures &Recitations
– Lectures Tu/Thu, Recitations Fri
• Problem sets
– Out on Thursdays, in on Wednesdays
– Warmups due in 1+1 days
– 3x2 late days for psets, otherwise need a request from S3
– Discount 2 lowest pset scores, same for warmups
• Describing algorithms
• Grading policy
– Psets 20%; Quiz 1 25%; Quiz 2 25%; Final 30%
• Collaboration policy
– collaboration good, copying bad
What is this class about ?
• 6.006: Algorithm literacy
• 6.046: The art/craft of algorithms
• Techniques:
• Divide and conquer
• Randomization
• Amortized Analysis
• Greedy Approach
• Incremental Improvement
• Linear Programming
• Dynamic Programming
• Continuous Optimization
• Reductions
• Approximation Algorithms
• Computing Models
• Online algorithms
• Streaming algorithms
• Sketching algorithms
• Parallel/Distributed algorithms
Today: three shades of interval
scheduling
• Three formalizations of class scheduling
• Unweighted interval scheduling
• Weighted interval scheduling
• Job interval scheduling
• A guided tour through many of the concepts
from the previous slides
6.003
Meta-algorithm:
• Use a “simple rule” to pick the next ri =[ai,bi]
• Add ri to the solution, discard all intervals that are
incompatible
• Repeat
Algorithm:
• Sort ri in the ascending order of bi O(n log n)
• Consider each interval ri in order, Or better via Radix Sort
6.003
• Ideas ?
• We will use dynamic programming
• Recurrence with few subproblems
Dynamic programming
L1.14
Job Interval Scheduling
Job Interval Scheduling