Spring 2022 — 30540 Computer Science 2
This course introduces the beautiful
and powerful techniques of theoretical
computer science for the design of algorithms,
the analysis of algorithms,
and the study of the computational complexity of problems.
General information
Instructors: Luca Trevisan, Fabrizio Iozzi
Teaching assistants: NiccolĂ˛ Anceschi, Caicai Chen
Lectures:
 Tuesdays 14:0016:30
 Thursdays 8:3010:00
 Fridays 14:0016:30
Office hours:
 Fabrizio Iozzi: TBA
 Luca Trevisan: TBA
 NiccolĂ˛ Anceschi: TBA
 Caicai Chen: TBA
Textbooks and other readings
 S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani. Algorithms
It is easy to find online a pdf of the Dasgupta et al. book. As far as we know, these pdf copies are circulating with the blessing of the authors.
Additional lecture notes will be distributed when the content of the lectures deviates from the book.
Lecture plan
 No class on 20220203

20220204: Introduction
Contents: What this course is about. Review of the topics and goals of the course. Preview of some highlights. Mathematical preliminaries: proving things by induction, bounding summations, bigOh and littleoh notations, basics of probability
Readings: Chapter 0
Instructor: Iozzi
Suggested Exercises:

20220208: Divideandconquer I
Contents: Integer multiplication in O(n^{log_2 3}) time, analysis of mergesort
Readings: Sections 2.1 and 2.3
Instructor: Iozzi
Suggested Exercises:

20220210: Divideandconquer II
Contents: Median in linear time, Master Theorem
Readings: Sections 2.2 and 2.4
Instructor: Iozzi
Suggested Exercises:

20220211: Graph Decomposition I
Contents: Graphs, representations of graphs, directed and undirected graphs, paths, connected components, DFS for connected components in undirected graphs
Readings: Sections 3.1 and 3.2
Instructor: Iozzi
Suggested Exercises:

20220215: Graph Decomposition II
Contents: Directed acyclic graphs, linearization, DFS finds linearization
Readings: Section 3.3 and Notes on topological sort
Instructor: Iozzi
Suggested Exercises:

20220217: LAB 1
Contents: Covers all material up to DFS
Readings: Notes
Instructor: Iozzi
Suggested Exercises:

20220218: Shortest Paths I
Contents: BFS and shortest paths in unweighted graphs
Readings: Sections 4.1 and 4.2
Instructor: Trevisan
Suggested Exercises:

20220222: Shortest Paths II
Contents: Dijkstra's algorithm
Readings: Sections 4.3 and 4.4, notes
Instructor: Trevisan
Suggested Exercises:

20220224: Shortest Paths III
Contents: Continuation of Dijkstra's algorithm, priority queue implementation as sorted lists and as heaps
Readings: Section 4.5
Instructor: Trevisan
Suggested Exercises:

20220225: Greedy Algorithms I
Contents: Minimum spanning tree problem, Kruskal and Prim's algorithm, proofs of correctness
Readings: Section 5.1
Instructor: Trevisan
Suggested Exercises:

20220301: Greedy Algorithms II
Contents: Correctness of Kruskal and Prim's algorithm, continued. Unionfind data structure
Readings: Section 5.1
Instructor: Trevisan
Suggested Exercises:

20220303: LAB 2
Contents: Covers all material up to MST
Readings: Notes
Instructor: Anceschi
Suggested Exercises:

20220304: Greedy Algorithms III
Contents: Prefix codes, Huffman coding
Readings: Section 5.2, notes
Instructor: Trevisan
Suggested Exercises:

20220308: Greedy Algorithms IV
Contents: More on data compression, entropy; set cover
Readings: Section 5.2, 5.4notes
Instructor: Trevisan
Suggested Exercises:

20220310: Dynamic Programming I
Contents: Shortest paths in DAGs, shortest paths with negative weights
Readings: Section 6.1
Instructor: Trevisan
Suggested Exercises:

20220311: Lab 3
Contents: Final review before Midterm
Readings: Notes
Instructor: Anceschi
Suggested Exercises:
 No class on 20220324

20220325: Dynamic Programming II
Contents: Shortest paths with negative weights. Allpairs shortest paths. Rethinking Dijkstra's algorithm
Readings: Sections 6.1, 6.6
Instructor: Trevisan
Suggested Exercises:

20220329: Dynamic Programming III
Contents: Edit distance, knapsack
Readings: Section 6.3, 6.4
Instructor: Trevisan
Suggested Exercises:
 No class on 20220331

20220401: Flows I
Contents: Flows in networks, residual network, FordFulkerson, Max flow min cut theorem, analysis of EdmondsKarp
Readings: Section 7.2, notes
Instructor: Trevisan
Suggested Exercises:

20220405: Flows II
Contents: Reduction to other problems, Karger's min cut algorithms
Readings: Notes, Section 7.3
Instructor: Trevisan
Suggested Exercises:
20220407: Lab 4
Contents: Flows, cuts and matchings
Readings: Notes
Instructor: Anceschi
Suggested Exercises:

20220408: Linear Programming I
Contents: Introduction, geometry of solutions, weak duality
Readings: Sections 7.1 and 7.4
Instructor: Iozzi
Suggested Exercises:

20220411: Linear Programming II
Contents: The simplex algorithm
Readings: Section 7.6
Instructor: Iozzi
Suggested Exercises:

20220412: Linear Progamming III
Contents: Problems modelled by linear programming: flows, zerosum games
Readings: Sections 7.2 and 7.5
Instructor: Iozzi
Suggested Exercises:

20220413: Lab 5
Contents: Linear programmings
Readings: Notes
Instructor: Iozzi
Suggested Exercises:

20220426: NPcompleteness I
Contents: Combinatorial explosion, search problems, P, NP, reductions, NPcompleteness
Readings: Section 8.1, notes
Instructor: Trevisan
Suggested Exercises:

20220428: NPcompleteness II
Contents: NPcompleteness of Independent Set, Clique, Set Cover, Subset Sum
Readings: Sections 8.2 and 8.3, notes
Instructor: Trevisan
Suggested Exercises:

20220429: NPcompleteness III
Contents: NPcompleteness of Partition, Bin Packing, Scheduling, Hamiltonian Circuit, TSP
Readings: Section 8.3 and notes
Instructor: Trevisan
Suggested Exercises:
20220503: NPcompleteness IV
Contents: Boolean circuits, and NPcompleteness of Circuits SAT and 3SAT
Readings: notes
Instructor: Trevisan
Suggested Exercises:

20220505: Lab 6
Contents: Computational complexity
Readings: Notes
Instructor: Chen
Suggested Exercises:

20220506: Final review
Contents: Whole syllabus review, all questions answered
Readings: Notes
Instructor: Trevisan
Suggested Exercises: