9th Max-Planck Advanced Course on the Foundations of Computer Science (ADFOCS) Primal-Dual Algorithms for Online Optimization: Lecture 1



Similar documents
The Online Set Cover Problem

14.1 Rent-or-buy problem

On the effect of forwarding table size on SDN network utilization

Online Learning and Competitive Analysis: a Unified Approach

Dynamic TCP Acknowledgement: Penalizing Long Delays

Online Primal-Dual Algorithms for Maximizing Ad-Auctions Revenue

Approximation Algorithms

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. #-approximation algorithm.

4.6 Linear Programming duality

How To Solve The Online Advertising Problem

Offline sorting buffers on Line

Analysis of Approximation Algorithms for k-set Cover using Factor-Revealing Linear Programs

ONLINE DEGREE-BOUNDED STEINER NETWORK DESIGN. Sina Dehghani Saeed Seddighin Ali Shafahi Fall 2015

An Introduction to Competitive Analysis for Online Optimization. Maurice Queyranne University of British Columbia, and IMA Visitor (Fall 2002)

Class constrained bin covering

Frequency Capping in Online Advertising

Chapter Load Balancing. Approximation Algorithms. Load Balancing. Load Balancing on 2 Machines. Load Balancing: Greedy Scheduling

1. (First passage/hitting times/gambler s ruin problem:) Suppose that X has a discrete state space and let i be a fixed state. Let

Weighted Sum Coloring in Batch Scheduling of Conflicting Jobs

Weighted Sum Coloring in Batch Scheduling of Conflicting Jobs

How To Find An Optimal Search Protocol For An Oblivious Cell

Algorithm Design and Analysis

Ph.D. Thesis. Judit Nagy-György. Supervisor: Péter Hajnal Associate Professor

Topic: Greedy Approximations: Set Cover and Min Makespan Date: 1/30/06

A Near-linear Time Constant Factor Algorithm for Unsplittable Flow Problem on Line with Bag Constraints

Follow the Perturbed Leader

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. !-approximation algorithm.

CSC2420 Fall 2012: Algorithm Design, Analysis and Theory

A Branch and Bound Algorithm for Solving the Binary Bi-level Linear Programming Problem

Notes from Week 1: Algorithms for sequential prediction

The Relative Worst Order Ratio for On-Line Algorithms

Applied Algorithm Design Lecture 5

Online Adwords Allocation

Efficient and Robust Allocation Algorithms in Clouds under Memory Constraints

Online Scheduling with Bounded Migration

Adaptive Online Gradient Descent

Fairness in Routing and Load Balancing

Energy Efficient Monitoring in Sensor Networks

Proximal mapping via network optimization

1 Approximating Set Cover

The Goldberg Rao Algorithm for the Maximum Flow Problem

IEOR 4404 Homework #2 Intro OR: Deterministic Models February 14, 2011 Prof. Jay Sethuraman Page 1 of 5. Homework #2

Stiffie's On Line Scheduling Algorithm

THE SCHEDULING OF MAINTENANCE SERVICE

A simpler and better derandomization of an approximation algorithm for Single Source Rent-or-Buy

Mathematical finance and linear programming (optimization)

1 Introduction. Linear Programming. Questions. A general optimization problem is of the form: choose x to. max f(x) subject to x S. where.

Efficiency of algorithms. Algorithms. Efficiency of algorithms. Binary search and linear search. Best, worst and average case.

Arithmetic Coding: Introduction

Duplicating and its Applications in Batch Scheduling

Discrete Optimization

Definition Given a graph G on n vertices, we define the following quantities:

1 Introduction. 2 Prediction with Expert Advice. Online Learning Lecture 09

Distributed Network Monitoring and Multicommodity Flows: A Primal-Dual Approach

Establishing a Mobile Conference Call Under Delay and Bandwidth Constraints

GENERATING LOW-DEGREE 2-SPANNERS

Introduction to Markov Chain Monte Carlo

Chapter 3. if 2 a i then location: = i. Page 40

24. The Branch and Bound Method

THE DIMENSION OF A VECTOR SPACE

Distributed Computing over Communication Networks: Maximal Independent Set

Scheduling to Minimize Power Consumption using Submodular Functions

CSC2420 Spring 2015: Lecture 3

A Robust Formulation of the Uncertain Set Covering Problem

Probability Generating Functions

CSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis. Linda Shapiro Winter 2015

Online Optimization with Uncertain Information

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, Notes on Algebra

Steiner Tree Approximation via IRR. Randomized Rounding

2.1 Complexity Classes

Duality of linear conic problems

Load balancing of temporary tasks in the l p norm

Discrete Math in Computer Science Homework 7 Solutions (Max Points: 80)

Scheduling Shop Scheduling. Tim Nieberg

Factoring & Primality

Adaptive Linear Programming Decoding

Minimal Cost Reconfiguration of Data Placement in a Storage Area Network

8.1 Min Degree Spanning Tree

GENERALIZED INTEGER PROGRAMMING

MapReduce and Distributed Data Analysis. Sergei Vassilvitskii Google Research

LECTURE 5: DUALITY AND SENSITIVITY ANALYSIS. 1. Dual linear program 2. Duality theory 3. Sensitivity analysis 4. Dual simplex method

Binary search algorithm

Distributionally robust workforce scheduling in call centers with uncertain arrival rates

Classification - Examples

Practical Guide to the Simplex Method of Linear Programming

AdWords and Generalized On-line Matching

Randomized Approximation and Online Algorithms for Assignment Problems

An Approximation Algorithm for Bounded Degree Deletion

Primal-Dual Schema for Capacitated Covering Problems

Truthful Mechanisms for Value-Based Scheduling in Cloud Computing

Online Algorithms: Learning & Optimization with No Regret.

Single machine models: Maximum Lateness -12- Approximation ratio for EDD for problem 1 r j,d j < 0 L max. structure of a schedule Q...

Online and Offline Selling in Limit Order Markets

The Multiplicative Weights Update method

(67902) Topics in Theory and Complexity Nov 2, Lecture 7

Optimal Online-list Batch Scheduling

Near Optimal Solutions

1 Formulating The Low Degree Testing Problem

Bicolored Shortest Paths in Graphs with Applications to Network Overlay Design

Transcription:

9th Max-Planck Advanced Course on the Foundations of Computer Science (ADFOCS) Primal-Dual Algorithms for Online Optimization: Lecture 1 Seffi Naor Computer Science Dept. Technion Haifa, Israel

Introduction Online algorithms and competitive analysis Deterministic Randomized Review of important techniques Randomized rounding Dual fitting

What is an Online Algorithm? Input is given in pieces over time, each piece is called a request Request sequence: { ¾ = ¾ 1 ; ¾ 2 ; : : : ; ¾ n ; : : : } Upon arrival of request ¾ i : Online algorithm has to serve the request Previous decisions for requests ¾ 1,, ¾ i-1 cannot be changed

Performance Evaluation: Competitive Factor How to evaluate performance of online algorithm A? For every request sequence ¾ = ¾ 1,, ¾ n : compare cost of A to the cost of an optimal offline algorithm that knows the request sequence in advance Competitive factor of online algorithm A is if For every request sequence ¾ = ¾ 1,, ¾ n :

Example 1:The Ski Rental Problem Buying costs $B Renting costs $1 per day Problem: Number of ski days is not known in advance each ski day is a request served by buying or renting Goal: Minimize the total cost.

Ski Rental: Analysis Online Algorithm: rent for m days and then buy What is the optimal choice of m? m=b If # of ski days B, cost(online) = OPT If # of ski days > B, cost(online) 2OPT ) Competitive ratio = 2

Example 2:The Paging Problem Universe of of n pages Cache of size k n Request sequence of pages: 1, 6, 4, 1, 4, 7, 6, 1, 3, If requested page is in cache: no penalty. Else, cache miss! load requested page into cache, evicting some other page. Goal: minimize number of cache misses. Question: which page to evict in case of a cache miss?

Paging: Analysis Online Algorithm LRU (Least Recently Used): Upon cache miss, evict the page whose last access was earliest (least recently used page). Theorem 1: The competitive factor of LRU is k. Theorem 2: The competitive factor of any (deterministic) paging algorithm k.

Proof of Theorem 1 Phase 1 Phase 2 time In each phase: LRU has precisely k misses (OPT and LRU start from the same initial configuration) Claim: Each phase has requests to k different pages Proof: If the first miss in a phase is due to page x, then all k-1 remaining pages in the cache will be evicted before x, since x has a higher priority.

Proof of Theorem 1 (contd.) x page that caused first miss in phase S pages that caused rest of cache misses in phase + page that caused first miss in next phase By claim, S {x} k Since page x 2 OPT s cache, OPT has a cache miss p number of full phases cost of OPT p cost of LRU k(p+1)

Randomization Online algorithm A uses random bits r=r 1, r 2, Expected cost of A on ¾: Exp r [A(¾,r)] A is -competitive if, ¾: Oblivious adversary: knows online algorithm A, request sequence ¾, but not the outcome of the random bits r

Example: Randomized Paging Algorithm Marking Algorithm: Each requested page is marked Page miss: evict one of the unmarked pages, chosen uniformly at random When all pages are marked, unmark them Theorem 1: The competitive factor of the Marking Algorithm is 2H k Theorem 2: The competitive factor of any randomized paging algorithm is H k =(logk)

Set Cover Elements: U ={1,2,,n} Sets: S 1,,S m (each S i µ {1,2,,n}) Each set S i has cost c i Goal: find a min cost collection of sets that cover U set cover can be formulated as integer/linear program: x i - indicator variable for choosing set S i mx minimize c i x i i=1 for every element j: x i 2 f0; 1g X ijj2s i x i 1 Relaxation: 0 x i 1 LP can be solved in poly time LP provides a lower bound on optimal integral solution!!!

Rounding a Fractional Solution (1) For each S i : 0 x i 1 For each element j: i x i 1 (summed over x i, j 2 S i ) Randomized Rounding: For each set S i : pick it to the cover with probability x i Analysis: Exp[cost of cover] = i c i x i = LP cost Pr[element j is not covered] = Conclusion: probability of covering element j is at least a constant!

Rounding a Fractional Solution (2) Amplify probability of success: Repeat experiment clogn times so that Pr[element j is not covered] Analysis: Pr[some element is not covered] Exp[cost of cover] = O(logn) i c i x i = O(logn)(LP cost) Conclusion: approximation factor is O(logn)

Set Cover: Greedy Algorithm Initially: C is empty While there is an uncovered element: Add to C the set S i minimizing c i /(# new elements covered) Analysis: via dual fitting Primal: covering Dual: packing

Dual Fitting (1) Primal solution is feasible Dual solution: if element j is covered by set S i then y j = c i /(# new elements covered by S i ) In the iteration in which S i is picked: primal = dual = c i since cost of S i is shared between the new elements Thus, cost of primal solution = cost of dual solution Is the dual solution feasible? Almost, but not quite

Dual Fitting (2) For set S: suppose the order in which elements in S are covered is e 1,, e k When element e i is covered, Thus, Dividing dual variables by H(n) ¼ logn yields a feasible solution Greedy algorithm is an O(logn)-approximation: primal dual H(n)

The Online Primal-Dual Framework Introduction: covering The ski problem The online set cover problem

Buying costs $B Renting costs $1 per day Back to Ski Rental Problem: Number of ski days is not known in advance Goal: Minimize the total cost.

Ski Rental Integer Program x 1 - Buy 0 - Don't Buy z i 1 - Rent on day i 0 - Don't rent on day i Subject to: min Bx k i1 z i For each day i: xz i 1 xz, {0,1} i

Ski Rental Relaxation P: Primal Covering min Bx For each day i: Online setting: k i1 z i xz i 1 xz, i 0 D: Dual Packing max k i1 y For each day i: k i1 Primal: New constraints arrive one by one. y i B i yi Requirement: Upon arrival, constraints should be satisfied. Monotonicity: Variables can only be increased. 1

Ski Rental Algorithm P: Primal Covering min Bx For each day i: k i1 z i xz i 1 xz, i 0 Initially x 0 Each new day (new constraint): if x<1: z i 1-x x x(1+ 1/B) + 1/(c*B) y i 1 D: Dual Packing max k i1 y For each day i: i k i1 - c later. y 1 i y i B

Analysis of Online Algorithm Proof of competitive factor: 1. Primal solution is feasible. 2. In each iteration, ΔP (1+ 1/c)ΔD. 3. Dual is feasible. Conclusion: Algorithm is (1+ 1/c)-competitive Initially x 0 Each new day (new constraint): if x<1: z i 1-x x x(1+ 1/B) + 1/(c*B) y i 1 - c later.

Analysis of Online Algorithm 1. Primal solution is feasible. If x 1 the solution is feasible. Otherwise set: z i 1-x. 2. In each iteration, ΔP (1+ 1/c)ΔD: If x 1, ΔP =ΔD=0 Otherwise: Change in dual: 1 Change in primal: BΔx + z i = x+ 1/c+ 1-x = 1+1/c Algorithm: When new constraint arrives, if x<1: z i 1-x x x(1+ 1/B) + 1/c*B y i 1

Analysis of Online Algorithm 3. Dual is feasible: Need to prove: k i1 We prove that after B days x 1 x is a sum of geometric sequence a 1 = 1/(cB), q = 1+1/B B y i B 1 1 1 1 1 1 1 B B x cb 1 c 1 1 B B Algorithm: When new constraint arrives, if x<1: z i 1-x x x(1+ 1/B) + 1/c*B y i 1 1 c 1 1 e1 B 1 1 e c e 1 B

Randomized Algorithm X: 0 1 X 1 X 2 X 3 X 4 Choose d uniformly in [0,1] Buy on the day corresponding to the bin d falls in Rent up to that day Analysis: Probability of buying on the i-th day is x i Probability of renting on the i-th day is at most z i

Going Beyond the Ski Problem Ski problem: coefficients in the constraint matrix belong to {0,1} What can be said about general constraint matrices with coefficients from {0,1}?

The Online Set-Cover Problem elements: e 1, e 2,, e n set system: s 1, s 2, s m costs: c(s 1 ), c(s 2 ), c(s m ) Online Setting: Elements arrive one by one. Upon arrival elements need to be covered. Sets that are chosen cannot be unchosen. Goal: Minimize the cost of the chosen sets.

Online Set-Cover: Lower Bound elements: 1,,n µ n pn sets: all subsets of cardinality n cost: unit cost Adversary s strategy: While possible: pick an element that is not covered (# of elements offered n) Competitive ratio: n (cost of online: = n, cost of OPT = 1) µ p npn But, n ¼ log. So polylog(m,n) is not ruled out.

Set Cover Linear Program P: Primal Covering ss min c( s) x( s) e E x( s) 1 s es D: Dual Packing ee max ye ( ) s S y( e) c( s) es Online setting: Primal: constraints arrive one by one. Requirement: each constraint is satisfied. Monotonicity: variables can only be increased.

Primal-Dual Algorithms We will see two algorithms: Discrete algorithm generalizing ideas from the ski problem Continuous algorithm

Set Cover Discrete Algorithm P: Primal Covering ss min c( s) x( s) e E x( s) 1 s es D: Dual Packing ee max ye ( ) s S y( e) c( s) es Initially x(s) 0 When new element arrives, while y(e) y(e)+1. s es xs ( ) 1: s es x( s) x( s) 11/ c( s) 1/ mc( s)

Analysis of Online Algorithm Proof of competitive factor: 1. Primal solution is feasible. 2. In each iteration, ΔP 2ΔD. 3. Dual is (almost) feasible. Conclusion: We will see later. Initially x(s) 0 When new element e arrives, while y(e) y(e)+1. s es xs ( ) 1: s es x( s) x( s) 11/ c( s) 1/ mc( s)

Analysis of Online Algorithm 1. Primal solution is feasible. We increase the primal variables until the constraint is feasible. Initially x(s) 0 When new element e arrives, while y(e) y(e)+1. s es xs ( ) 1: s es x( s) x( s) 11/ c( s) 1/ mc( s)

Analysis of Online Algorithm 2. In each iteration, ΔP 2ΔD. In each iteration: ΔD = 1 xs ( ) 1 P = c(s) xs ( ) c(s) s es s es c( s) mc( s) Initially x(s) 0 When new element e arrives, while y(e) y(e)+1. s es x(s) 1/m 2 s es s es xs ( ) 1: s es x( s) x( s) 11/ c( s) 1/ mc( s)

Analysis of Online Algorithm 3. Dual is (almost) feasible: We prove that: s S, y(e) c(s)o(log m) If y(e) increases, then x(s) increases (for e in S). es x(s) is a sum of a geometric series: a 1 = 1/[mc(s)], q = (1+ 1/c(s)) Initially x(s) 0 When new element e arrives, while y(e) y(e)+1. s es xs ( ) 1: s es x( s) x( s) 11/ c( s) 1/ mc( s)

Analysis of Online Algorithm After c(s)o(log m) rounds: c( s) O(log m) 1 11/ cs ( ) 1 xs ( ) mc( s) 11/ c( s) 1 c( s) O(log m) 11/ cs ( ) 1 m 1 We never increase a variable x(s)>1! Initially x(s) 0 When new element e arrives, while y(e) y(e)+1. s es xs ( ) 1: s es x( s) x( s) 11/ c( s) 1/ mc( s)

Conclusions The dual is feasible with cost 1/O(log m) of the primal. The algorithm produces a fractional set cover that is O(log m)-competitive. Remark: no online algorithm can perform better (in the worst case).

Set Cover Continuous Algorithm Initially x(s) 0, y(e) 0 When new element e arrives: While s es xs ( ) 1: Increase variable y(e) continuously For each s e 2 s,.

Analysis of Online Algorithm Proof of competitive factor: 1. Primal solution is feasible 2. In the iteration corresponding to element e: @P @y(e) 2 ln(1 + m) @D @y(e) 3. Dual solution feasible

Analysis of Online Algorithm 1. Primal solution is feasible. We increase the primal variables until the constraint is feasible.

Analysis of Online Algorithm 2. In each iteration: @P @y(e) 2 ln(1 + m) @D @y(e) Dual change: @D @y(e) = 1 (variable y(e) is increased continuously)

Primal Change

Analysis of Online Algorithm 3. Dual is feasible: We prove that x(s) 1 (otherwise s satisfies the violated constraint for e) Hence,

The primal is feasible Conclusions The dual is feasible The ratio between primal change and dual change is 1/O(log m) The algorithm produces a fractional set cover which is O(log m)-competitive.

Discrete vs. Continuous Both algorithms are essentially the same: as long as c(s) is not too small. (c(s) 1) Description of discrete algorithm is simpler Analysis of continuous algorithm is simpler

Summary: Key Idea for Primal-Dual Update Primal: Min i c i x i Dual: Max t b t y t Step t, new constraint: New variable y t a 1 x 1 + a 2 x 2 + + a j x j b t + b t y t in dual objective x i (1+ a i /c i ) x i (mult. update) y t y t + 1 (additive update) primal cost = = Dual Cost

Online Randomized Rounding What about an integral solution? Round fractional solution: For set s, choose it with probability Δx(s) when incrementing variable x(s) Repeat O(logn) times to amplify success probability Competitive ratio is O(logm logn) Can be done deterministically online [AAABN03].