CS 170

Efficient Algorithms and Intractable Problems

CS 170 at UC Berkeley with Prasad Raghavendra and Christian Borgs, Spring 2024

Lecture: TuTh 3:30 PM - 4:59 PM in Li Ka Shing 245

Textbook: Algorithms by S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani (DPV)

Please be informed that access to the majority of solutions on this website necessitates authentication through CalNet CAS. Should you require access to these restricted materials but do not possess a CalNet ID, kindly contact us for further assistance.

WeekDateLectureReadingSectionAssignments
1Tu 1/161: Introduction, Big-O Notation, Arithmetic [slides] [slides (6up)] [recording posted!]DPV §0 , §1.1  
1Th 1/182: Integer Multiplication, Recurrence Relations, Master Theorem [slides] [slides (6up)] [recording posted!]DPV §2.1 , §2.2  
2Tu 1/233: Matrix Muliplication, Median-Finding [slides] [slides (6up)] [recording posted!]DPV §2.3 , §2.4 , §2.5[Section 1,Solutions] [Section 1 walkthrough Asymptotic Complexity Comparisons / Asymptotics and Limits / Complex Numbers Review part 1 / Complex Numbers Review part 2 / Recurrence Relations ]HW 1 due 1/29
2Th 1/254: Fast Fourier Transform (Part I) [slides] [slides (6up)] [recording posted!]DPV §2.6  
3Tu 1/305: Fast Fourier Transform (Part II) [slides] [slides (handout)] [recording posted!]DPV §2.6[Section 2,Solutions] [Section 2 walkthrough Counting Inversions / Divide and Conquer / FFT Intro / Monotone Matrices ]HW 2
3Th 2/16: Depth First Search, Topological Sort [slides] [slides (handout)] [recording posted!]DPV §3  
4Tu 2/67: Strongly Connected Components [slides] [recording posted!]DPV §3[Section 3,Solutions] [Section 3 walkthrough Graph Traversal a / Graph Traversal b / Graph Traversal c / Not so Exciting Scheduling / Pattern Matching / Triple Sum ]HW 3 </br> HW 3 walkthrough Homework 3 Q2 / Homework 3 Q3 / Homework 3 Q4 / Homework 3 Q5
4Th 2/88: Paths in Graphs [slides] [recording posted!]DPV §4 [FFT Applications]  
5Tu 2/139: Greedy Algorithms, Huffman encoding [slides] [recording posted!]DPV §5 , §5.2[Section 4,Solutions] [Section 4 walkthrough Dijikstras algorithm fails on negative edges / Discussion 4 Q4 / Discussion 4 Q5 / Running Errands / Waypoint ]HW 4
5Th 2/1510: Minimum Spanning Trees [slides] [prim’s proof] [recording posted!]DPV §5.1  
6Tu 2/2011: Union Find, Horn Formulas [slides] [recording posted!]DPV §5.1.4 , §5.3[Section 5,Solutions]HW 5
6Th 2/2212: Dynamic Programming (Part I) [slides] [recording posted!]DPV §6.1 , §6.2 , §6.3  
7Tu 2/27Midterm 1 on 2/26 [Section 6,Solutions] [Section 6 walkthrough Change Making / Dynamic Programming Introduction Fibonacci Numbers / lanting Trees / Longest Common Subsequence ]HW 6
7Th 2/2913: Dynamic Programming (Part II) [slides] [recording posted!]DPV §6.3 , §6.4  
8Tu 3/514: Dynamic Programming (Part III) [slides] [recording posted!]DPV §6.6[Section 7,Solutions] [Section 7 walkthrough Balloon Popping Problem / Finding More Counterexamples / Optimal Set Covering / Tiring Resorts ]HW 7
8Th 3/715: Dynamic Programming (Part IV) [slides] [recording posted!]DPV §6.5 , §6.6 , §6.7  
9Tu 3/1216: Linear Programs, Simplex Algorithm [slides] [recording posted!]DPV §7.1[Section 8,Solutions] [Section 8 walkthrough Egg Drop Revisited / Huffman and LP / LP Basics / Simplex Practice ]HW 8
9Th 3/1417: Network Flow, Bipartite Matching [slides] [recording posted!]DPV §7.2 , §7.3  
10Tu 3/1918: Duality, Zero-Sum Games [slides] [recording posted!]DPV §7.4 , §7.5[Section 9,Solutions] [Section 9 walkthrough Advertising / Fun Duality / Max Flow Min Cut and Duality / Residual in graphs / ZeroSum Games Short Answer ]HW 9
10Th 3/2119: Review [slides] [recording posted!]   
11Tu 3/26Spring Recess   
11Th 3/28Spring Recess   
12Tu 4/2Midterm 2   
12Th 4/420: Reductions, NP-Completeness [slides] [recording posted!]DPV §7.3 , §8.1[Section 10,Solutions] [Section 10 walkthrough Bad Reductions / Graph Coloring Problem / Optimization versus Search / Set Cover vs LP ]HW 10
13Tu 4/921: Reductions [slides] [recording posted!]DPV §8.2, 8.3[Section 11,Solutions] [Section 11 walkthrough A Reduction Warmup / California Cycle / Cycle Cover / NP or not NP that is the question / Runtime of NP ]HW 11
13Th 4/1122: Coping with NP-completeness [slides] [recording posted!]DPV §9  
14Tu 4/1623: Coping with NP-completeness [slides] [recording posted!]DPV §9[Section 12,Solutions]HW 12 ,Coding
14Th 4/1824: Gradient Descent (Part I) [slides] [recording posted!]GD Notes (sections 1-3) – updated 4/29  
15Tu 4/2325: Gradient Descent (Part II) [slides] [recording posted!]GD Notes – updated 4/29Section 13HW 13
15Th 4/2526: Gradient Descent (Part III), Multiplicative WeightsGD Notes – updated 4/29