lecture 18 cse 331 oct 12, 2012. hw 5 due today q1, q2 and q3 in different piles i will not take any...
DESCRIPTION
Other HW related stuff Graded HW4 starting Monday Solutions to HW 5 at the end of the lectureTRANSCRIPT
Lecture 18
CSE 331Oct 12, 2012
HW 5 due today
Q1, Q2 and Q3 in different piles
I will not take any HW after 1:15pm
Other HW related stuff
Graded HW4 starting Monday
Solutions to HW 5 at the end of the lecture
On Thursday, Oct 18hours-a-thon
Zihe: 3:00-5:00 (Davis 302)Jiun-Jie: 5:00-6:00 (Davis 302)
UnclaimedHWs and solutions
Review Session on Oct 19
Zihe’s recitation section from 9-9:50am in 114 Hoch
Mid term
Next Friday in class at 1pm
Unfortunately I won’t be there
Jiun-Jie with my student Jesse & another PhD student Dung will proctor the exam
On Mon and Wed
Jesse will present the lectures
If time permits, he will go over the sample mid term on Wed
HW 5 due today
Q1, Q2 and Q3 in different piles
I will not take any HW after 1:15pm
Main Steps in Algorithm DesignProblem Statement
Algorithm
Problem Definition
“Implementation”
Analysis
n!
Correctness+Runtime Analysis
Data Structures
Where do graphs fit in?Problem Statement
Algorithm
Problem Definition
“Implementation”
Analysis Correctness+Runtime Analysis
Data Structures
A tool to define problems
Rest of the courseProblem Statement
Algorithm
Problem Definition
“Implementation”
Analysis Correctness+Runtime Analysis
Data Structures
Three general techniques
Greedy algorithms
Build the final solution piece by piece
Being short sighted on each piece
Never undo a decision
Know when you see it
End of Semester blues
Monday Tuesday Wednesday Thursday Friday
Project
331 homework 331 HWExam study
Party!
Write up a term paper
Can only do one thing at any day: what is the maximum number of tasks that you can do?
Greedily solve your blues!
Monday Tuesday Wednesday Thursday Friday
Project
331 HWExam study
Party!
Write up a term paper
Arrange tasks in some order and iteratively pick non-overlapping tasks
Ordering is crucial
Monday Tuesday Wednesday Thursday Friday
Project
331 HWExam study
Party!
Write up a term paper
Order by starting time
Algo =1
Another attempt
Monday Tuesday Wednesday Thursday Friday
Order by duration
Algo =1
Ordering by least conflicts doesn’t
work
The final algorithm
Monday Tuesday Wednesday Thursday Friday
Project
331 HWExam study
Party!
Write up a term paper
Order tasks by their END time
Questions?
Today’s agenda
Prove the correctness of the algorithm
Formal Algorithm
R: set of requests
Set A to be the empty set
While R is not empty
Choose i in R with the earliest finish time
Add i to A
Remove all requests that conflict with i from R
Return A