Pearls of Algorithms

Similar documents
Outline. Main Questions. What is the k-means method? What can we do when worst case analysis is too pessimistic?

Pareto Optimal Solutions for Smoothed Analysts

Linear Programming. Widget Factory Example. Linear Programming: Standard Form. Widget Factory Example: Continued.

Linear Programming. Readings: Read text section 11.6, and sections 1 and 2 of Tom Ferguson s notes (see course homepage).

Integral Geometry and the Polynomial Hirsch Conjecture

Approximation Algorithms

CS675: Convex and Combinatorial Optimization Spring 2018 The Simplex Algorithm. Instructor: Shaddin Dughmi

COT 6936: Topics in Algorithms! Giri Narasimhan. ECS 254A / EC 2443; Phone: x3748

(67686) Mathematical Foundations of AI July 30, Lecture 11

The Simplex Algorithm

Minimum-Cost Flow Network

CS 473: Algorithms. Ruta Mehta. Spring University of Illinois, Urbana-Champaign. Ruta (UIUC) CS473 1 Spring / 50

CS 580: Algorithm Design and Analysis. Jeremiah Blocki Purdue University Spring 2018

Linear Programming Duality and Algorithms

/ Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang

Linear Programming. them such that they

Lecture notes on the simplex method September We will present an algorithm to solve linear programs of the form. maximize.

COT 6936: Topics in Algorithms! Giri Narasimhan. ECS 254A / EC 2443; Phone: x3748

11. APPROXIMATION ALGORITHMS

Theorem 2.9: nearest addition algorithm

CS 473: Algorithms. Ruta Mehta. Spring University of Illinois, Urbana-Champaign. Ruta (UIUC) CS473 1 Spring / 29

THEORY OF LINEAR AND INTEGER PROGRAMMING

Approximation Algorithms

Greedy Algorithms 1 {K(S) K(S) C} For large values of d, brute force search is not feasible because there are 2 d {1,..., d}.

Linear Programming in Small Dimensions

Integer Programming Theory

Prove, where is known to be NP-complete. The following problems are NP-Complete:

Submodularity Reading Group. Matroid Polytopes, Polymatroid. M. Pawan Kumar

February 19, Integer programming. Outline. Problem formulation. Branch-andbound

Mathematical and Algorithmic Foundations Linear Programming and Matchings

Algorithmic Game Theory and Applications. Lecture 6: The Simplex Algorithm

Introduction to Linear Programming

11.1 Facility Location

Greedy Algorithms 1. For large values of d, brute force search is not feasible because there are 2 d

Convex Optimization CMU-10725

Algorithm Design and Analysis

16.410/413 Principles of Autonomy and Decision Making

11 Linear Programming

Discrete Optimization. Lecture Notes 2

CS 598CSC: Approximation Algorithms Lecture date: March 2, 2011 Instructor: Chandra Chekuri

CS599: Convex and Combinatorial Optimization Fall 2013 Lecture 1: Introduction to Optimization. Instructor: Shaddin Dughmi

Polyhedral Compilation Foundations

CMSC 451: Lecture 22 Approximation Algorithms: Vertex Cover and TSP Tuesday, Dec 5, 2017

A provably efficient simplex algorithm for classification

11. APPROXIMATION ALGORITHMS

11. APPROXIMATION ALGORITHMS

COMP 355 Advanced Algorithms Approximation Algorithms: VC and TSP Chapter 11 (KT) Section (CLRS)

Approximation Algorithms

1 The Traveling Salesperson Problem (TSP)

NP-Hard (A) (B) (C) (D) 3 n 2 n TSP-Min any Instance V, E Question: Hamiltonian Cycle TSP V, n 22 n E u, v V H

APPROXIMATION ALGORITHMS FOR GEOMETRIC PROBLEMS

Constrained Optimization COS 323

Range Searching II: Windowing Queries

DM545 Linear and Integer Programming. Lecture 2. The Simplex Method. Marco Chiarandini

Lecture 16 October 23, 2014

Chapter 15 Introduction to Linear Programming

LECTURE 6: INTERIOR POINT METHOD. 1. Motivation 2. Basic concepts 3. Primal affine scaling algorithm 4. Dual affine scaling algorithm

Notes taken by Mea Wang. February 11, 2005

CMPSCI611: The Simplex Algorithm Lecture 24

3 INTEGER LINEAR PROGRAMMING

MA4254: Discrete Optimization. Defeng Sun. Department of Mathematics National University of Singapore Office: S Telephone:

Kurt Mehlhorn, MPI für Informatik. Curve and Surface Reconstruction p.1/25

CS 473: Algorithms. Ruta Mehta. Spring University of Illinois, Urbana-Champaign. Ruta (UIUC) CS473 1 Spring / 36

Copyright 2007 Pearson Addison-Wesley. All rights reserved. A. Levitin Introduction to the Design & Analysis of Algorithms, 2 nd ed., Ch.

CSE 417 Branch & Bound (pt 4) Branch & Bound

6 Randomized rounding of semidefinite programs

COMP Analysis of Algorithms & Data Structures

The Simplex Algorithm for LP, and an Open Problem

Introduction to Algorithms

David G. Luenberger Yinyu Ye. Linear and Nonlinear. Programming. Fourth Edition. ö Springer

Mathematics of Optimization Viewpoint of Applied Mathematics Logic of Optimization

Introduction to Linear Programming. Algorithmic and Geometric Foundations of Optimization

Lecture Notes 2: The Simplex Algorithm

! Linear programming"! Duality "! Smallest enclosing disk"

Vertex Cover Approximations

Linear Programming and its Applications

Combinatorial Optimization

Monotone Paths in Geometric Triangulations

arxiv: v1 [cs.cc] 30 Jun 2017

CS 372: Computational Geometry Lecture 10 Linear Programming in Fixed Dimension

val(y, I) α (9.0.2) α (9.0.3)

Stanford University CS359G: Graph Partitioning and Expanders Handout 1 Luca Trevisan January 4, 2011

Heuristic Optimization Today: Linear Programming. Tobias Friedrich Chair for Algorithm Engineering Hasso Plattner Institute, Potsdam

ACO Comprehensive Exam October 12 and 13, Computability, Complexity and Algorithms

The Touring Polygons Problem (TPP)

1 Linear Programming. 1.1 Optimizion problems and convex polytopes 1 LINEAR PROGRAMMING

NP-Hardness. We start by defining types of problem, and then move on to defining the polynomial-time reductions.

Linear and Integer Programming :Algorithms in the Real World. Related Optimization Problems. How important is optimization?

Applications of Linear Programming

Notes for Lecture 18

Computational Geometry

Approximation Algorithms

A PAC Approach to ApplicationSpecific Algorithm Selection. Rishi Gupta Tim Roughgarden Simons, Nov 16, 2016

Foundations of Computing

Clustering. Unsupervised Learning

GENERAL ASSIGNMENT PROBLEM via Branch and Price JOHN AND LEI

Mathematics of Optimization Viewpoint of applied mathematics Algorithm

CS 6783 (Applied Algorithms) Lecture 5

16.410/413 Principles of Autonomy and Decision Making

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs

Transcription:

Part 3: Randomized Algorithms and Probabilistic Analysis Prof. Dr. Institut für Informatik Winter 2013/14

Efficient Algorithms When is an algorithm considered efficient?

Efficient Algorithms When is an algorithm considered efficient? Engineer The algorithm must be efficient in practice, i.e., it must solve practical instances in an appropriate amount of time.

Efficient Algorithms When is an algorithm considered efficient? Engineer The algorithm must be efficient in practice, i.e., it must solve practical instances in an appropriate amount of time. Theoretician The algorithm must be efficient in the worst case, i.e., it must solve all instances in polynomial time.

The Knapsack Problem Knapsack problem (KP) Input set of items {1,..., n} profits p 1,..., p n weights w 1,..., w n capacity b

The Knapsack Problem Knapsack problem (KP) Input set of items {1,..., n} profits p 1,..., p n weights w 1,..., w n capacity b Goal Find a subset of items that fits into the knapsack and maximizes the profit.

The Knapsack Problem Knapsack problem (KP) Input set of items {1,..., n} profits p 1,..., p n weights w 1,..., w n capacity b Goal Find a subset of items that fits into the knapsack and maximizes the profit. Formal description max p 1 x 1 + + p n x n subject to w 1 x 1 + + w n x n b and x i {0, 1}

Different Opinions Theorists say... KP is NP-hard. FPTAS exists. No efficient algorithm for KP, unless P = NP.

Different Opinions Theorists say... KP is NP-hard. FPTAS exists. No efficient algorithm for KP, unless P = NP. Engineers say... KP is easy to solve! Does not even require quadratic time. There are very good heuristics for practical instances of KP.

Reason for discrepancy Reason for discrepancy Worst-case complexity is too pessimistic! There are (artificial) worst-case instances for KP on which the heuristics are not efficient. These instances, however, do not occur in practice. This phenomenon occurs not only for KP, but also for many other problems.

Reason for discrepancy Reason for discrepancy Worst-case complexity is too pessimistic! There are (artificial) worst-case instances for KP on which the heuristics are not efficient. These instances, however, do not occur in practice. This phenomenon occurs not only for KP, but also for many other problems. How to make theory more consistent with practice? Find a more realistic performance measure.

Reason for discrepancy Reason for discrepancy Worst-case complexity is too pessimistic! There are (artificial) worst-case instances for KP on which the heuristics are not efficient. These instances, however, do not occur in practice. This phenomenon occurs not only for KP, but also for many other problems. How to make theory more consistent with practice? Find a more realistic performance measure. Average-case analysis Is it realistic to consider the average case behavior instead of the worst case behavior?

Random Inputs are not Typical Random inputs are not typical! If real-world data was random, watching TV would be very boring...

What is a typical instance? What is a typical instance? Profit Profit Weight Weight Profit Profit Weight Weight It depends very much on the concrete application. We cannot say in general what a typical instance for KP looks like.

Smoothed Analysis Profit Step 1: Adversary chooses input I. Profit Weight Profit Weight Profit Weight Weight

Smoothed Analysis Profit Profit Step 1: Adversary chooses input I. Profit Weight Step 2: Random perturbation. I per(i) Profit Weight Weight Weight Profit Profit Weight Weight Profit Profit Weight Weight

Smoothed Analysis Step 1: Adversary chooses input I. Step 2: Random perturbation. I per(i) Smoothed Complexity = worst expected running time the adversary can achieve Why do we consider this model? First step alone: worst case analysis. Second step models random influences, e.g., measurement errors, numerical imprecision, rounding,... So we have a combination of both: instances of any structure with some amount of random noise.

Perturbation Example Step 1: Adversary chooses all p i, w i [0, 1] arbitrarily. Profit Weight

Perturbation Example Step 1: Adversary chooses all p i, w i [0, 1] arbitrarily. Step 2: Add an independent Gaussian random variable to each profit and weight. Profit 1 sigma=0.5 sigma=1 sigma=2 0.5 0-5 -4-3 -2-1 0 1 2 3 4 5 Weight

Perturbation Example Step 1: Adversary chooses all p i, w i [0, 1] arbitrarily. Step 2: Add an independent Gaussian random variable to each profit and weight. Profit 1 sigma=0.5 sigma=1 sigma=2 0.5 σ 1 0-5 -4-3 -2-1 0 1 2 3 4 5 Weight

Perturbation Example Step 1: Adversary chooses all p i, w i [0, 1] arbitrarily. Step 2: Add an independent Gaussian random variable to each profit and weight. Profit 1 sigma=0.5 sigma=1 sigma=2 0.5 σ 1 > σ 2 0-5 -4-3 -2-1 0 1 2 3 4 5 Weight

Complexity Measures C A(I) Instances of length n. C A (I) = running time of algorithm A on input I X n = set of inputs of length n,

Complexity Measures C A(I) CA worst (n) Instances of length n. C A (I) = running time of algorithm A on input I X n = set of inputs of length n, CA worst (n) = max I Xn (C A (I))

Complexity Measures C A(I) CA worst (n) CA ave (n) Instances of length n. C A (I) = running time of algorithm A on input I X n = set of inputs of length n, µ n = prob. distribution on X n CA worst (n) = max I Xn (C A (I)) CA ave(n) = E I µn X n [C A (I)]

Complexity Measures C A(I) CA worst (n) C smooth A (n, σ 2) σ 2 < σ 1 C smooth A (n, σ 1) CA ave (n) I Instances of length n. C A (I) = running time of algorithm A on input I X n = set of inputs of length n, µ n = prob. distribution on X n CA worst (n) = max I Xn (C A (I)) CA ave(n) = E I µn X n [C A (I)] C smooth A (n, σ) = max I Xn E[C A (per σ (I))]

Complexity Measures C A(I) CA worst (n) C smooth A (n, σ 2) σ 2 < σ 1 C smooth A (n, σ 1) CA ave (n) I Instances of length n. C A (I) = running time of algorithm A on input I X n = set of inputs of length n, µ n = prob. distribution on X n CA worst (n) = max I Xn (C A (I)) CA ave(n) = E I µn X n [C A (I)] CA smooth (n, σ) = max I Xn E[C A (per σ (I))] smoothed complexity low bad instances are isolated peaks

Linear Programming Linear Programs (LPs) variables: x 1,..., x n R linear objective function: max c T x = c 1 x 1 +... + c n x n m linear constraints: a 1,1 x 1 +... + a 1,n x n b 1. a m,1 x 1 +... + a m,n x n b m x c

Linear Programming Linear Programs (LPs) variables: x 1,..., x n R linear objective function: max c T x = c 1 x 1 +... + c n x n m linear constraints: a 1,1 x 1 +... + a 1,n x n b 1. a m,1 x 1 +... + a m,n x n b m x c Complexity of LPs LPs can be solved in polynomial time by the ellipsoid method [Khachiyan 1979] and the interior point method [Karmarkar 1984].

Simplex Algorithm c Simplex Algorithm Start at some vertex of the polytope.

Simplex Algorithm c Simplex Algorithm Start at some vertex of the polytope.

Simplex Algorithm c Simplex Algorithm Start at some vertex of the polytope. Walk along the edges of the polytope in the direction of the objective function c T x.

Simplex Algorithm c Simplex Algorithm Start at some vertex of the polytope. Walk along the edges of the polytope in the direction of the objective function c T x. local optimum = global optimum

Simplex Algorithm c Simplex Algorithm Start at some vertex of the polytope. Walk along the edges of the polytope in the direction of the objective function c T x. local optimum = global optimum c Pivot Rules Which vertex is chosen if there are multiple options? Different pivot rules suggested: random, steepest descent, shadow vertex pivot rule,...

Simplex Algorithm Shadow Vertex Pivot Rule Shadow Vertex Pivot Rule Let x 0 be some vertex of the polytope. Compute u R d such that x 0 maximizes u T x. x 0 x u c

Simplex Algorithm Shadow Vertex Pivot Rule Shadow Vertex Pivot Rule Let x 0 be some vertex of the polytope. Compute u R d such that x 0 maximizes u T x. Project the polytope onto the plane spanned by c and u. x 0 x u c

Simplex Algorithm Shadow Vertex Pivot Rule Shadow Vertex Pivot Rule Let x 0 be some vertex of the polytope. Compute u R d such that x 0 maximizes u T x. Project the polytope onto the plane spanned by c and u. x 0 x u c The shadow is a polygon.

Simplex Algorithm Shadow Vertex Pivot Rule Shadow Vertex Pivot Rule Let x 0 be some vertex of the polytope. Compute u R d such that x 0 maximizes u T x. Project the polytope onto the plane spanned by c and u. x 0 x 0 x x u c The shadow is a polygon. x 0 is a vertex of the shadow. x is a vertex of the shadow.

Simplex Algorithm Shadow Vertex Pivot Rule Shadow Vertex Pivot Rule Let x 0 be some vertex of the polytope. Compute u R d such that x 0 maximizes u T x. Project the polytope onto the plane spanned by c and u. x 0 x 0 x x u c The shadow is a polygon. x 0 is a vertex of the shadow. x is a vertex of the shadow. Edges of the shadow correspond to edges of the polytope.

Simplex Algorithm Shadow Vertex Pivot Rule Shadow Vertex Pivot Rule Let x 0 be some vertex of the polytope. Compute u R d such that x 0 maximizes u T x. Project the polytope onto the plane spanned by c and u. Start at x 0 and follow the edges of the shadow. x 0 x 0 u c x x The shadow is a polygon. x 0 is a vertex of the shadow. x is a vertex of the shadow. Edges of the shadow correspond to edges of the polytope.

Simplex Algorithm Shadow Vertex Pivot Rule Shadow Vertex Pivot Rule Let x 0 be some vertex of the polytope. Compute u R d such that x 0 maximizes u T x. Project the polytope onto the plane spanned by c and u. Start at x 0 and follow the edges of the shadow. x 0 x 0 u c x x The shadow is a polygon. x 0 is a vertex of the shadow. x is a vertex of the shadow. Edges of the shadow correspond to edges of the polytope.

Simplex Algorithm Shadow Vertex Pivot Rule Shadow Vertex Pivot Rule Let x 0 be some vertex of the polytope. Compute u R d such that x 0 maximizes u T x. Project the polytope onto the plane spanned by c and u. Start at x 0 and follow the edges of the shadow. x 0 x 0 u c x x The shadow is a polygon. x 0 is a vertex of the shadow. x is a vertex of the shadow. Edges of the shadow correspond to edges of the polytope.

Simplex Algorithm Shadow Vertex Pivot Rule Shadow Vertex Pivot Rule Let x 0 be some vertex of the polytope. Compute u R d such that x 0 maximizes u T x. Project the polytope onto the plane spanned by c and u. Start at x 0 and follow the edges of the shadow. x 0 x 0 u c x x The shadow is a polygon. x 0 is a vertex of the shadow. x is a vertex of the shadow. Edges of the shadow correspond to edges of the polytope.

Simplex Algorithm Shadow Vertex Pivot Rule Shadow Vertex Pivot Rule Let x 0 be some vertex of the polytope. Compute u R d such that x 0 maximizes u T x. Project the polytope onto the plane spanned by c and u. Start at x 0 and follow the edges of the shadow. x 0 x 0 u c x x The shadow is a polygon. x 0 is a vertex of the shadow. x is a vertex of the shadow. Edges of the shadow correspond to edges of the polytope.

Simplex Algorithm Shadow Vertex Pivot Rule Shadow Vertex Pivot Rule Let x 0 be some vertex of the polytope. Compute u R d such that x 0 maximizes u T x. Project the polytope onto the plane spanned by c and u. Start at x 0 and follow the edges of the shadow. x 0 x 0 u c x x The shadow is a polygon. x 0 is a vertex of the shadow. x is a vertex of the shadow. Edges of the shadow correspond to edges of the polytope.

Simplex Algorithm Running Time Theoreticians say... shadow vertex pivot rule requires exponential number of steps no pivot rule with sub-exponential number of steps known ellipsoid and interior point methods are efficient

Simplex Algorithm Running Time Theoreticians say... shadow vertex pivot rule requires exponential number of steps no pivot rule with sub-exponential number of steps known ellipsoid and interior point methods are efficient Engineers say... simplex method usually fastest algorithm in practice requires usually only Θ(m) steps clearly outperforms ellipsoid method

Smoothed Analysis Observation: In worst-case analysis, the adversary is too powerful. Idea: Let s weaken him!

Smoothed Analysis Observation: In worst-case analysis, the adversary is too powerful. Idea: Let s weaken him! Perturbed LPs Step 1: Adversary specifies arbitrary LP: max c T x subject to a T 1 x b 1... a T n x b n. W. l. o. g. (a i, b i ) = 1.

Smoothed Analysis Observation: In worst-case analysis, the adversary is too powerful. Idea: Let s weaken him! Perturbed LPs Step 1: Adversary specifies arbitrary LP: max c T x subject to a T 1 x b 1... a T n x b n. W. l. o. g. (a i, b i ) = 1. Step 2: Add Gaussian random variable with standard deviation σ to each coefficient in the constraints.

Smoothed Analysis Observation: In worst-case analysis, the adversary is too powerful. Idea: Let s weaken him! Perturbed LPs Step 1: Adversary specifies arbitrary LP: max c T x subject to a T 1 x b 1... a T n x b n. W. l. o. g. (a i, b i ) = 1. Step 2: Add Gaussian random variable with standard deviation σ to each coefficient in the constraints. Smoothed Running Time = worst expected running time the adversary can achieve

Smoothed Analysis Step 1: Adversary chooses input I Step 2: Random perturbation I per σ (I) Formal Definition: LP(n, m) = set of LPs with n variables and m constraints T (I) = number of steps of simplex method on LP I

Smoothed Analysis Step 1: Adversary chooses input I Step 2: Random perturbation I per σ (I) Formal Definition: LP(n, m) = set of LPs with n variables and m constraints T (I) = number of steps of simplex method on LP I smoothed run time T smooth (n, m, σ) = max I LP(n,m) E[T (per σ (I))]

Smoothed Analysis Step 1: Adversary chooses input I Step 2: Random perturbation I per σ (I) Formal Definition: LP(n, m) = set of LPs with n variables and m constraints T (I) = number of steps of simplex method on LP I smoothed run time T smooth (n, m, σ) = max I LP(n,m) E[T (per σ (I))] Why do we consider this model? First step models unknown structure of the input. Second step models random influences, e.g., measurement errors, numerical imprecision, rounding,... smoothed running time low bad instances are unlikely to occur σ determines the amount of randomness

Smoothed Analysis of the Simplex Algorithm Lemma [Spielman and Teng (STOC 2001)] For every fixed plane and every LP the adversary can choose, after the perturbation, the expected number of edges on the shadow is O ( poly ( n, m, σ 1)). x 0 u c x

Smoothed Analysis of the Simplex Algorithm Lemma [Spielman and Teng (STOC 2001)] For every fixed plane and every LP the adversary can choose, after the perturbation, the expected number of edges on the shadow is O ( poly ( n, m, σ 1)). x 0 u c x Theorem [Spielman and Teng (STOC 2001)] The smoothed running time of the simplex algorithm with shadow vertex pivot rule is O ( poly ( n, m, σ 1)). Already for small perturbations exponential running time is unlikely.

Smoothed Analysis of the Simplex Algorithm Lemma [Spielman and Teng (STOC 2001)] For every fixed plane and every LP the adversary can choose, after the perturbation, the expected number of edges on the shadow is O ( poly ( n, m, σ 1)). x 0 u c x Theorem [Spielman and Teng (STOC 2001)] The smoothed running time of the simplex algorithm with shadow vertex pivot rule is O ( poly ( n, m, σ 1)). Already for small perturbations exponential running time is unlikely. Main Difficulties in Proof of Theorem: x 0 is found in phase I no Gaussian distribution of coefficients In phase II, the plane onto which the polytope is projected is not independent of the perturbations.

Improved Analysis Theorem [Vershynin (FOCS 2006)] The smoothed number of steps of the simplex algorithm with shadow vertex pivot rule is O ( poly ( n, log m, σ 1)). only polylogarithmic in the number of constraints m

Improved Analysis Theorem [Vershynin (FOCS 2006)] The smoothed number of steps of the simplex algorithm with shadow vertex pivot rule is O ( poly ( n, log m, σ 1)). only polylogarithmic in the number of constraints m x 0 x Phase I: add vertex x 0 in random direction. With constant prob. this does not change optimal solution. The plane is not correlated with the perturbed polytope. u c

Improved Analysis Theorem [Vershynin (FOCS 2006)] The smoothed number of steps of the simplex algorithm with shadow vertex pivot rule is O ( poly ( n, log m, σ 1)). only polylogarithmic in the number of constraints m x 0 x 0 u c x x Phase I: add vertex x 0 in random direction. With constant prob. this does not change optimal solution. The plane is not correlated with the perturbed polytope. With high prob. no angle between consecutive vertices is too small.

Overview of the coming Lectures Smoothed Analysis 2-Opt heuristic for the traveling salesperson problem Nemhauser/Ullmann algorithm for the knapsack problem