CS252 Algorithms Friday, 14 October 2022 + Misc - PS 3 grading nearly done, will be done by Monday - Test grading underway, will be done by Wednesday - Second test (10/28) will be in class - Third test will be takehome, due 11/11 - Final will be a (team) project about an algorithm of your choice + Recap (Jeff's brain-dump) - LaTeX - Writing proofs - Definitions of O, Ω, Θ - Stable matching, Gale-Shapley - Why this problem? Easy to describe the general problem Non-trivial to define the right concepts to actually solve the problem Enormously rich in follow-up questions Foreshadowing of proof techniques etc. - Graphs intro - definitions; lots of definitions - implementation strategies - traversal: BFS and DFS the act of visiting + spanning trees connectivity & conected components - topological sort - Greedy algorithms - in general - interval scheduling, round 1 (optimize # of non-overlapping intervals) - greedy sometimes works - greedy sometimes doesn't work - proof technique #1: show optimal solution & actual solution have the same value of the objective function (here, |𝒪| = |A|) [Current work] - all shortest paths from start node in directed graphs (Dijkstra) - minimum spanning tree in weighted undirected graphs (Kruskal, Prim, "reverse-delete") + What's next? - More algorithmic paradigms dynamic programming, divide-and-conquer, network flows - More algorithms: practice, practice, practice - One big theorem - Some cool applications (e.g., internet routing / packet switching) - A fun final project: pick an algorithm, make us a movie about it + Recap of O and Ω proofs - the document I posted yesterday - key ideas - proofs that flow from assumptions towards conclusions (how does this idea apply to proof by contradiction?) + Your questions about homework + #reading8 - d(v') = min_{e=(u,v)...}... - negative edges - 3 greedy approaches for 1 problem! (is this common?) - how does Kruskal work? how do you detect cycles? - Prim vs. Kruskal (Prim special case of Kruskal?) (no) - exchange argument round 2: MSTs - how do they come up with this stuff?? - can we use these complexity results later? (yes!) - weights: time instead of distance? + Meeting a new algorithm: what do you do? - Read the problem we're trying to solve what are the inputs? what is the hoped-for output, and its properties? - Look for examples that fail ("set it up for failure") - Do a really simple example by hand - implement it 0 +