Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any...
-
Upload
tracy-cooper -
Category
Documents
-
view
218 -
download
0
description
Transcript of Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any...
![Page 1: Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.](https://reader035.fdocuments.net/reader035/viewer/2022062401/5a4d1b947f8b9ab0599c2bb8/html5/thumbnails/1.jpg)
Lecture 18
CSE 331Oct 12, 2012
![Page 2: Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.](https://reader035.fdocuments.net/reader035/viewer/2022062401/5a4d1b947f8b9ab0599c2bb8/html5/thumbnails/2.jpg)
HW 5 due today
Q1, Q2 and Q3 in different piles
I will not take any HW after 1:15pm
![Page 3: Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.](https://reader035.fdocuments.net/reader035/viewer/2022062401/5a4d1b947f8b9ab0599c2bb8/html5/thumbnails/3.jpg)
Other HW related stuff
Graded HW4 starting Monday
Solutions to HW 5 at the end of the lecture
![Page 4: Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.](https://reader035.fdocuments.net/reader035/viewer/2022062401/5a4d1b947f8b9ab0599c2bb8/html5/thumbnails/4.jpg)
On Thursday, Oct 18hours-a-thon
Zihe: 3:00-5:00 (Davis 302)Jiun-Jie: 5:00-6:00 (Davis 302)
UnclaimedHWs and solutions
![Page 5: Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.](https://reader035.fdocuments.net/reader035/viewer/2022062401/5a4d1b947f8b9ab0599c2bb8/html5/thumbnails/5.jpg)
Review Session on Oct 19
Zihe’s recitation section from 9-9:50am in 114 Hoch
![Page 6: Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.](https://reader035.fdocuments.net/reader035/viewer/2022062401/5a4d1b947f8b9ab0599c2bb8/html5/thumbnails/6.jpg)
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
![Page 7: Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.](https://reader035.fdocuments.net/reader035/viewer/2022062401/5a4d1b947f8b9ab0599c2bb8/html5/thumbnails/7.jpg)
On Mon and Wed
Jesse will present the lectures
If time permits, he will go over the sample mid term on Wed
![Page 8: Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.](https://reader035.fdocuments.net/reader035/viewer/2022062401/5a4d1b947f8b9ab0599c2bb8/html5/thumbnails/8.jpg)
HW 5 due today
Q1, Q2 and Q3 in different piles
I will not take any HW after 1:15pm
![Page 9: Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.](https://reader035.fdocuments.net/reader035/viewer/2022062401/5a4d1b947f8b9ab0599c2bb8/html5/thumbnails/9.jpg)
Main Steps in Algorithm DesignProblem Statement
Algorithm
Problem Definition
“Implementation”
Analysis
n!
Correctness+Runtime Analysis
Data Structures
![Page 10: Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.](https://reader035.fdocuments.net/reader035/viewer/2022062401/5a4d1b947f8b9ab0599c2bb8/html5/thumbnails/10.jpg)
Where do graphs fit in?Problem Statement
Algorithm
Problem Definition
“Implementation”
Analysis Correctness+Runtime Analysis
Data Structures
A tool to define problems
![Page 11: Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.](https://reader035.fdocuments.net/reader035/viewer/2022062401/5a4d1b947f8b9ab0599c2bb8/html5/thumbnails/11.jpg)
Rest of the courseProblem Statement
Algorithm
Problem Definition
“Implementation”
Analysis Correctness+Runtime Analysis
Data Structures
Three general techniques
![Page 12: Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.](https://reader035.fdocuments.net/reader035/viewer/2022062401/5a4d1b947f8b9ab0599c2bb8/html5/thumbnails/12.jpg)
Greedy algorithms
Build the final solution piece by piece
Being short sighted on each piece
Never undo a decision
Know when you see it
![Page 13: Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.](https://reader035.fdocuments.net/reader035/viewer/2022062401/5a4d1b947f8b9ab0599c2bb8/html5/thumbnails/13.jpg)
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?
![Page 14: Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.](https://reader035.fdocuments.net/reader035/viewer/2022062401/5a4d1b947f8b9ab0599c2bb8/html5/thumbnails/14.jpg)
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
![Page 15: Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.](https://reader035.fdocuments.net/reader035/viewer/2022062401/5a4d1b947f8b9ab0599c2bb8/html5/thumbnails/15.jpg)
Ordering is crucial
Monday Tuesday Wednesday Thursday Friday
Project
331 HWExam study
Party!
Write up a term paper
Order by starting time
Algo =1
![Page 16: Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.](https://reader035.fdocuments.net/reader035/viewer/2022062401/5a4d1b947f8b9ab0599c2bb8/html5/thumbnails/16.jpg)
Another attempt
Monday Tuesday Wednesday Thursday Friday
Order by duration
Algo =1
Ordering by least conflicts doesn’t
work
![Page 17: Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.](https://reader035.fdocuments.net/reader035/viewer/2022062401/5a4d1b947f8b9ab0599c2bb8/html5/thumbnails/17.jpg)
The final algorithm
Monday Tuesday Wednesday Thursday Friday
Project
331 HWExam study
Party!
Write up a term paper
Order tasks by their END time
![Page 18: Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.](https://reader035.fdocuments.net/reader035/viewer/2022062401/5a4d1b947f8b9ab0599c2bb8/html5/thumbnails/18.jpg)
Questions?
![Page 19: Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.](https://reader035.fdocuments.net/reader035/viewer/2022062401/5a4d1b947f8b9ab0599c2bb8/html5/thumbnails/19.jpg)
Today’s agenda
Prove the correctness of the algorithm
![Page 20: Lecture 18 CSE 331 Oct 12, 2012. HW 5 due today Q1, Q2 and Q3 in different piles I will not take any HW after 1:15pm.](https://reader035.fdocuments.net/reader035/viewer/2022062401/5a4d1b947f8b9ab0599c2bb8/html5/thumbnails/20.jpg)
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