4005-800-01: Homework, Quizzes, Reading and Slides
Week 1
- Slides for this week: 011-Intro.pdf
(ppt),
012-MergeHeap.pdf
(ppt)
-
Tuesday, March 10
- Practice homework: click here
- Covered in class: Course logistics, see the main course website
- Covered in class: Introduction to Algorithms and asymptotic analysis (slides have been updated, read Chapter 1 and Sections 2.1
and 2.2 in the book, see also solved exercises at the end of Chapter 2)
- A note for students with disabilities:
RIT is committed to providing reasonable accommodations to students with disabilities.
If you would like to request accommodations such as special seating, testing modifications,
or note taking services due to a disability, please contact the Disability Services Office.
It is located in the Eastman Building, Room 2342; the Web site is www.rit.edu/dso.
After you receive accommodation approval, it is imperative that you see me during office hours
so that we can work out whatever arrangement is necessary.
- A note about emerging problems with MyCourses submissions:
Typical mis-namings include source files named "factorial.java" or "Problem2_Smith.java"
where in the second case an upper-case 'P' was used instead of the specified lower-case 'p' (I know that according to
Java standards, class names start with upper-case letters - please make an exception in this course).
Finally, if you are working in a pair: suppose that your and your partner's names are Smith and Apple and you submit
a problem with the name "problem2_SmithApple.java". Then, for all your future submissions, please continue using the name
combination "SmithApple" (i.e. do not switch it to "AppleSmith") - this will help us with recognizing your submissions and
grading them properly.
Thursday, March 12
- Covered in class: big-Oh notation revisited
- Covered in class: Survey of common running times (Section 2.4)
- Covered in class: Some geometric algorithms: point inside a polygon,
area of a polygon (not in the book)
- Covered in class: Mergesort (Section 5.1)
Homework 1, due 3/18 11:59pm: click here
Week 2
- Slides for this week: we will continue with last week's slides; after that
022-SelectMasterThm.pdf
(ppt)
-
Tuesday, March 17
- Covered in class: Analyzing MERGESORT, our first recurrence (Section 5.1)
- Covered in class: A lower-bound on comparison-based sorting Omega(n log n) (not in the book)
- Covered in class: HeapSort (Section 2.5)
- I accidentally lost all my ink annotations. I did my best to reconstruct them, let me know if anything is missing
or unclear. (If anybody knows how to recover discarded annotations in PowerPoint, I'd be grateful to learn that;
undo did not work for me...)
- Recall: next class, quiz 1 on material covered in week 1. Study asymptotic notation (you should be able to say,
for two given functions f and g, if f=O(g), f=Omega(g) or f=Theta(g)), and the algorithms that were covered in the
first week (you should be able to trace them for a given input, read similar algorithms in pseudocode, or possibly
come up with a short pseudocode on your own).
-
Thursday, March 19
- In class: quiz 1.
- Covered in class: Median/Select (the worst-case O(n) is not in the book but the randomized version is in Section 13.5)
- Covered in class: Statement of the Master Theorem (not in the book)
- Covered in class: RadixSort (not in the book)
- Homework 2, due 3/25 11:59pm: click here
Week 3
- Slides for this week: 031-HuffmanKnapsack.pdf
(ppt)
-
Tuesday, March 23
- Covered in class: Huffman Coding, including the proof of correctness (Section 4.8) - introduction to greedy algorithms
- (Briefly) covered in class: solutions of hw1 and discussion of quiz 1
- Next class: quiz 2, study material from week 2 and hw 1.
-
Thursday, March 25
- In class: quiz 1.
- Covered in class: solutions of quiz 1 and more discussion about the Master Theorem.
- Covered in class: KNAPSACK, both the divisible and the indivisible version (Section 6.4) - introduction to dynamic programming
- Homework 3, due 4/1 11:59pm: click here (I typed this homework in a short time span - let me know if you find any typos and discrepancies.)
Week 4
- Slides for this week:
041-IntervalSchedulingLongestIncrSubseq.pdf
(ppt)
-
Tuesday, March 31
- Covered in class: variants of Interval Scheduling (Sections 4.1 and 6.1-2)
- Covered in class: brief discussion about the running time of randomized SELECT
- Covered in class: solution of the third problem of hw2
- Recall: next class quiz 3, on material from week 3 (Huffman, Knapsack) and Homework 2.
-
Thursday, April 2
- In class: quiz 2.
- Covered in class: finished Weighted Interval Scheduling
- Covered in class: Longest Increasing Subsequence (not in the book)
- Covered in class: solutions of Hw3
- Some of you asked for the test inputs for homeworks 1 and 2. You can find the tests for these homeworks
(as well as future homeworks) here.
- Homework 2 will be graded soon, check your mailfolders to find your graded submissions.
- I have to cancel office hours on Monday, April 6. I am really sorry about this inconvenience,
please send e-mails with questions or come on Tuesday.
- Homework 4, due 4/8 11:59pm: click here
Week 5
- Slides for this week: 051-LongestCommonSubseqMatrixMultiplication-pdf
(ppt)
-
Tuesday, April 7
- Covered in class: solutions of hw3 and hw2
- Covered in class: Longest Common Substring/subsequence (not in the book but a similar problem is discussed in Section 6.6)
- Covered in class: Matrix Chain Multiplication - introduction (not in the book, an example of a more challenging dynamic programming problem)
- Next class: quiz 4 on topics covered in week 4 (variants of Interval Scheduling, Longest Increasing Subsequence)
and in hw3.
-
Thursday, April 9
- In class: quiz 4.
- Covered in class: solutions of the quiz.
- Covered in class: Matrix Chain Multiplication (not in the book), including the reconstruction of the solution.
- Covered in class: solutions of Problem 1 from Hw4
- No homework due next week.
- Next week: midterm
Week 6
- Slides for this week: 061-GraphsBFSDFS.pdf
(ppt)
-
Tuesday, April 14
- Covered in class: solutions of hw4.
- Covered in class: introduction to graph algorithms, BFS, DFS (Chapter 3)
- Next class: midterm, in room 70-3435, 4:00-5:40pm.
-
Thursday, April 16
- In class: midterm.
- I have to cancel office hours on Monday, April 20. I am really sorry about this inconvenience,
please send e-mails with questions or come on Tuesday.
- Homework 5, due 4/22 11:59pm: click here
Week 7
- Slides for this week: 071-MinSpanTreeShortPath.pdf
(ppt)
-
Tuesday, April 21
- Covered in class: applications of DFS: topological sort, find strongly connected components (Chapter 3)
- Covered in class: discussion of problem 1 from the homework
- Covered in class: briefly introduction to spanning trees (Section 4.5)
- Next class: quiz 5, study topics covered in the last two weeks (Longest Common Substring,
Matrix Chain Multiplication, introduction to graphs, and BFS/DFS) and on hw4.
-
Thursday, April 23
- Covered in class: solutions of the midterm
- Almost in class: quiz 5. (Ok, we at least took a look at it :) )
- Covered in class: Minimum Spanning Trees, introduction to Union-Find (Sections 4.5 and 4.6)
- Homework 6, due 4/29 11:59pm: click here. As always, please let me know if there are any issues with the homework or the posted inputs/outputs.
Week 8
- Slides for this week: 081-NetworkFlowLinProg.pdf
(ppt)
-
Tuesday, May 5
- Covered in class: solutions of hw5
- Covered in class: Union-Find datastructure
- Covered in class: Prim's algorithm (Section 4.5)
- Covered in class: Dijkstra's algorithm (Section 4.4)
- Next class: quiz 6 on topics covered in week 7 (topological sort, strongly connected components,
and minimum spanning trees) and on hw5.
-
Thursday, May 7
- In class: quiz 6.
- Covered in class: proof of correctness of the Dijkstra's algorithm
- Covered in class: the Floyd-Warshall's algorithm (not in the book)
- Covered in class: the Bellman-Ford's algorithm (Sections 6.8-6.10)
- This is the end of week 8 - please keep in mind that the last chance to withdraw from the class is this Friday.
- Homework 7, due 5/6 11:59pm: click here
Week 9
- Slides for this week: 091-NP.pdf
(ppt)
-
Tuesday, May 5
- Covered in class: introduction to Flow Networks (Chapter 7)
- Covered in class: Ford-Fulkerson, Edmonds-Karp algorithms (Chapter 7)
- Next class: quiz 7 on topics covered in week 8 (shortest paths algorithms, minimum spanning trees, union-find).
-
Thursday, May 7
- In class: quiz 7.
- Covered in class: Applications of Flow Networks (multiple sources/sinks, finding a minimum cut,
maximum number of edge-disjoint s-t paths, maximum bipartite matching - see Chapter 7 for these and more applications)
- Covered in class: Introduction to polynomial-time reductions and the classes P and NP (Chapter 8)
- Covered in class: solution of Problem 1 on Hw7.
- Homework 8, due 5/13 11:59pm: click here
Week 10
- Slides for this week: 101-ApproximationAlgorithms.pdf
(ppt)
-
Tuesday, May 12
- Covered in class: P, NP, NP-complete and some more reductions, representative NP-complete problems (Chapter 8)
- Take-home points related to P, NP, NP-complete (and useful things to remember for the final):
- Definition of classes P, NP, and NP-complete.
- Looking at a problem, you should be able to recorgnize basic problems from P (like the decision versions of most of
the problems from class).
- You should be able to sketch the proof that a problem is in NP - state the solution you are looking for (for people
who have gone through the "theory" class, this is your nondeterministic guess), then describe how you verify
(in polynomial time) that the solution is indeed correct.
- You should be able to do reductions of about the same difficulty as the problem on the homework.
- Big open problem: P = NP (we do NOT know if P=NP).
- NP-complete problems are the "hardest" problems in NP.
- If somebody finds a polynomial-time algorithm for an NP-complete problem, then P=NP.
- If somebody shows that there does not exist a polynomial-time algorithm for an NP-complete problem, then P is not equal
to NP.
- If somebody finds an easy polynomial-time algorithm for an NP-complete problem,
then this algorithm probably does not work :)
- You should recognize basic NP-complete problems (discussed in class).
- Next class: quiz 8 on topics covered in week 9 (flow networks and their applications,
introduction to reductions and the class P).
- Website describing the final exam has been updated.
-
Thursday, May 14
- In class: quiz 8.
- Covered in class: the last couple of slides of NP-completeness
- Covered in class: solutions of Hw7, Hw8, and the bonus problem
- Covered in class: introduction to linear programming (Section 11.6)
- Take-home points related to linear programming
- Linear programming can be solved in polynomial time (quite fast, actually, and many solvers are available for free download).
- We can phrase a lot of problems as integer programs (where we restrict our variables to integer values).
- We expressed the Minimum Vertex Cover problem as an integer program. (If you are interested,
this is described very nicely in the book in Section 11.6 - and the section is quite short!)
Thus, INTEGER PROGRAMMING is NP-hard.
- Sometimes we are lucky and our linear programming solution has integer values and we are ok.
- Most of the time we are not this lucky but we can always try to round our solution to integer values.
For example, in the case of vertex cover, we would round x smaller than 0.5 to 0 and
x greater than or equal to 0.5 to 1.
- For some of these roundings we can prove that we actually get a meaningfull solution - for example in the case
of vertex cover, the solution we get is not bigger than twice the size of the minimum vertex cover. This is called
a 2-approximation (again, see Section 11.6).
- All the best with your finals.
- Bonus Homework 9, due 5/19 12:30pm: click here