Advanced Algorithms, a Graduate-Level Course Taught by Anupam Gupta at Carnegie Mellon University in Fall 2020
Total Page:16
File Type:pdf, Size:1020Kb
ADVANCEDALGORITHMS notes for cmu 15-850 (fall 2020) lecturer: anupam gupta About this document This document contains the course notes for 15-850:Advanced Algorithms, a graduate-level course taught by Anupam Gupta at Carnegie Mellon University in Fall 2020. Parts of these notes were written by the students of previous versions of the class (based on the lectures) and then edited by the professor. The names of the student scribes will appear soon, as will missing details and bug fixes, more chapters, exercises, and (better) figures. The notes have not been thoroughly checked for accuracy, espe- cially attributions of results. They are intended to serve as study resources and not as a substitute for professionally prepared publica- tions. We apologize for any inadvertent inaccuracies or misrepresen- tations. More information about the course, including problem sets and references, can be found on the course website: https://www.cs.cmu.edu/~15850/ The style files (as well as the text on this page!) are mildly adapted from the ones developed by Yufei Zhao (MIT), for his notes on Graph Theory and Additive Combinatorics. As some of you may guess, the LATEX template used for these notes is called tufte-book. Contents I Discrete Algorithms 9 1 Minimum Spanning Trees 11 1.1 Minimum Spanning Trees: History............. 11 1.2 The Classical Algorithms.................. 13 1.3 Fredman and Tarjan’s O(m log∗ n)-time Algorithm... 15 1.4 A Linear-Time Randomized Algorithm.......... 18 1.5 Optional: MST Verification................. 21 1.6 The Ackermann Function.................. 25 1.7 Matroids............................ 25 2 Arborescences: Directed Spanning Trees 27 2.1 Arborescences......................... 27 2.2 The Chu-Liu/Edmonds/Bock Algorithm......... 28 2.3 Linear Programming Methods............... 30 2.4 Matroid Intersection..................... 35 3 Dynamic Algorithms for Graph Connectivity 37 3.1 Dynamic Connectivity.................... 37 3.2 Frederickson’s algorithm................... 39 3.3 An Amortized, Deterministic Algorithm.......... 43 3.4 A Randomized Algorithm for Dynamic Graph Connectiv- ity................................ 45 4 Shortest Paths in Graphs 49 4.1 Single-Source Shortest Path Algorithms.......... 49 4.2 The All-Pairs Shortest Paths Problem (APSP)....... 52 4.3 Min-Sum Products and APSPs............... 55 4.4 Undirected APSP Using Fast Matrix Multiplication... 58 4.5 Optional: Fredman’s Decision-Tree Complexity Bound. 61 5 Low-Stretch Spanning Trees 63 5.1 Towards a Definition..................... 63 5.2 Low-Stretch Spanning Tree Construction......... 66 4 5.3 Bartal’s Construction..................... 67 5.4 Metric Embeddings: a.k.a. Simplifying Metrics...... 72 6 Graph Matchings I: Combinatorial Algorithms 75 6.1 Notation and Definitions................... 75 6.2 Bipartite Graphs........................ 77 6.3 General Graphs: The Tutte-Berge Theorem........ 80 6.4 The Blossom Algorithm................... 81 6.5 Subsequent Work....................... 86 7 Graph Matchings II: Weighted Matchings 87 7.1 Linear Programming..................... 87 7.2 Weighted Matchings in Bipartite Graphs......... 90 7.3 Another Perspective: Buyers and sellers.......... 94 7.4 A Third Algorithm: Shortest Augmenting Paths..... 99 7.5 Perfect Matchings in General Graphs........... 100 7.6 Integrality of Polyhedra................... 101 8 Graph Matchings III: Algebraic Algorithms 105 8.1 Preliminaries: roots of low degree polynomials...... 105 8.2 Detecting Perfect Matchings by Computing a Determinant107 8.3 From Detecting to Finding Perfect Matchings....... 110 8.4 Red-Blue Perfect Matchings................. 113 8.5 Matchings in Parallel, and the Isolation Lemma..... 114 8.6 A Matrix Scaling Approach................. 115 II The Curse of Dimensionality, and Dimension Reduction 117 9 Concentration of Measure 119 9.1 Asymptotic Analysis..................... 120 9.2 Non-Asymptotic Convergence Bounds........... 121 9.3 Chernoff bounds, and Hoeffding’s inequality....... 124 9.4 Other concentration bounds................. 127 9.5 Application: Oblivious Routing on the Hypercube.... 130 10 Dimension Reduction and the JL Lemma 135 10.1 The Johnson Lindenstrauss lemma............. 135 10.2 The Construction....................... 136 10.3 Intuition for the Distributional JL Lemma......... 137 10.4 The Direct Proof of Lemma 10.2 .............. 138 10.5 Subgaussian Random Variables............... 140 10.6 JL Matrices using Rademachers and Subgaussian-ness. 142 10.7 Optional: Compressive Sensing............... 143 10.8 Some Facts about Balls in High-Dimensional Spaces... 145 5 11 Streaming Algorithms 147 11.1 Streams as Vectors, and Additions/Deletions....... 148 11.2 Computing Moments..................... 149 11.3 A Matrix View of our Estimator............... 152 11.4 Application: Approximate Matrix Multiplication..... 153 11.5 Optional: Computing the Number of Distinct Elements. 154 12 Dimension Reduction: Singular Value Decompositions 159 12.1 Introduction.......................... 159 12.2 Best fit subspaces of dimension k and the SVD...... 160 12.3 Useful facts, and rank-k-approximation.......... 163 12.4 Applications.......................... 164 12.5 Symmetric Matrices...................... 166 III From Discrete to Continuous Algorithms 167 13 Online Learning: Experts and Bandits 169 13.1 The Mistake-Bound Model.................. 169 13.2 The Weighted Majority Algorithm............. 170 13.3 Randomized Weighted Majority.............. 172 13.4 The Hedge Algorithm, and a Change in Perspective... 174 13.5 Optional: The Bandit Setting................ 176 14 Solving Linear Programs using Experts 179 14.1 (Two-Player) Zero-Sum Games............... 179 14.2 Solving LPs Approximately................. 182 15 Approximate Max-Flows using Experts 187 15.1 The Maximum Flow Problem................ 187 15.2 A First Algorithm using the MW Framework....... 188 15.3 Finding Max-Flows using Electrical Flows........ 190 15.4 An O(m3/2)-time Algorithm................. 195 15.5 Optional: An O(m4/3)-time Algorithm........... 196 e 16 The Gradient Descente Framework 203 16.1 Convex Sets and Functions................. 203 16.2 Unconstrained Convex Minimization........... 205 16.3 Constrained Convex Minimization............. 209 16.4 Online Gradient Descent, and Relationship with MW.. 211 16.5 Stronger Assumptions.................... 212 16.6 Extensions and Loose Ends................. 215 17 Mirror Descent 217 17.1 Mirror Descent: the Proximal Point View......... 217 17.2 Mirror Descent: The Mirror Map View........... 220 6 17.3 The Analysis.......................... 223 17.4 Alternative Views of Mirror Descent............ 225 18 The Centroid and Ellipsoid Algorithms 227 18.1 The Centroid Algorithm................... 227 18.2 The Ellipsoid Algorithm................... 229 18.3 Ellipsoid for LP Feasibility.................. 230 18.4 Ellipsoid for Convex Optimization............. 232 18.5 Getting the New Ellipsoid.................. 233 18.6 Algorithms for Solving LPs................. 236 19 Interior-Point Methods 237 19.1 Barrier Functions....................... 238 19.2 The Update Step....................... 240 19.3 The Newton-Raphson Method............... 244 19.4 Self-Concordance....................... 246 IV Combating Intractability 247 20 Approximation Algorithms 249 20.1 A Rough Classification into Hardness Classes...... 249 20.2 The Surrogate......................... 251 20.3 The Set Cover Problem.................... 251 20.4 A Relax-and-Round Algorithm for Set Cover....... 252 20.5 The Bin Packing Problem.................. 254 20.6 The Linear Grouping Algorithm for Bin Packing..... 255 20.7 Subsequent Results and Open Problems.......... 257 21 Approximation Algorithms via SDPs 259 21.1 Positive Semidefinite Matrices................ 259 21.2 Semidefinite Programs.................... 260 21.3 SDPs in Approximation Algorithms............ 262 21.4 The MaxCut Problem and Hyperplane Rounding... 262 21.5 Coloring 3-Colorable Graphs................ 265 22 Online Algorithms 271 22.1 The Competitive Analysis Framework........... 271 22.2 The Ski Rental Problem: Rent or Buy?........... 273 22.3 The Paging Problem..................... 277 22.4 Generalizing Paging: The k-Server Problem........ 279 V Additional Topics 281 23 Smoothed Analysis of Algorithms 283 7 23.1 The Traveling Salesman Problem.............. 284 23.2 The Simplex Algorithm................... 286 23.3 The Knapsack Problem.................... 289 24 Prophets and Secretaries 295 24.1 The Prophet Problem..................... 295 24.2 Secretary Problems...................... 301 Part I Discrete Algorithms 1 Minimum Spanning Trees 1.1 Minimum Spanning Trees: History In minimum spanning tree problem, the input is an undirected con- nected graph G = (V, E) with n nodes and m edges, where the edges have weights w(e) R. The goal is to find a spanning tree 2 of the graph with the minimum total edge-weight. If the graph G A spanning tree/forest is defined to be is disconnected, we get a spanning forest As a classic (and important) an acyclic subgraph T that is inclusion- wise maximal, i.e., adding any edge in problem, it’s been tackled many times. Here’s a brief, not-quite- G T would create a cycle. n comprehensive history of its optimization, all without making any assumptions on the edge weights other that they can be compared in constant time: • Otakar Bor ˚uvka 1 gave the first known MST algorithm in 1926; 1 it was independently discovered by Gustave Choquet, Georges Sollin, and others. VojteˇchJarník 2 gave his algorithm