Presentation is loading. Please wait.

Presentation is loading. Please wait.

Online Algorithms, Linear Programming, and the k-Server Problem

Similar presentations


Presentation on theme: "Online Algorithms, Linear Programming, and the k-Server Problem"— Presentation transcript:

1 Online Algorithms, Linear Programming, and the k-Server Problem
Seffi Naor Computer Science Dept. Technion Barriers in Computational Complexity II Workshop 8/2010 Joint papers: Nikhil Bansal, Niv Buchbinder, Kamal Jain

2 Online Algorithms / Competitive Analysis
Input I: given “in pieces” over time, each piece is called a “request” Upon arrival of a new request: Online algorithm has to serve the request Decisions for previous requests cannot be changed Competitive ratio: competes against best possible solution (in hindsight!) Deterministic: maxI Alg(I) / OPT(I) Randomized: maxI E[Alg(I)] / OPT(I)] (adversary can’t see actual random coins of algorithm) Can we do anything at all? Surprisingly, Yes!

3 Canonical Example: Caching / Paging
CPU cache Browser cache web

4 The Paging/Caching Problem
Universe of n pages, cache of size k<n. Request sequence of pages 1, 6, 4, 1, 4, 7, 6, 1, … If requested page is already in cache, no penalty. Otherwise, cache miss! Cache miss: fetch page into the cache, (possibly) evicting some other page Main Question: which page to evict? Goal: minimize number of cache misses

5 The Paging/Caching Problem
What can be obtained deterministically? Best Algorithm: Evict the least recently used page (LRU) Theorem: LRU is k-competitive. (number of cache misses at most k times the optimal) Theorem: Any algorithm is at least k-competitive.

6 The Paging/Caching Problem
Can randomization help? A lot! Theorem: There is an O(log k)-competitive randomized paging algorithm (marking algorithm, 1988) Any randomized algorithm is Ω(log k)-competitive

7 Outline The k-server Problem
Linear Programming and Online Primal-Dual Approach New problems new techniques Back to k-server

8 The k-server Problem k servers (fire trucks) lie in an n-point metric space. Requests arrive at points. To serve request: move a server to request point. Goal: Minimize total distance traveled by servers. Example:

9 Paging/Caching Problem
Paging = k-server on a uniform metric. (every page is a point, page in cache iff server on the point) Weighted paging = k-server on a weighted star metric. Lower bounds: Deterministic: k Randomized: (log k) Barrier 1: Deterministic k-server conjecture: There is a k-competitive algorithm for any metric Randomized k-server conjecture: There is an O(log k)-competitive algorithm for any metric

10 25 years of deterministic history
[Sleator, Tarjan 1985]: LRU k-competitive for paging, k/(k-h+1)-competitive compared to opt with cache size h. Any algorithm at least k-competitive, [Manasse McGeoch Sleator 1988]: Definition of k-server and the k-server conjecture. [Fiat,Rabani, Ravid 1990]: (k!)3 for general metrics (independent of metric size) [Chrobak, Karloff, Payne, Vishwanathan 1990]: k-competitive for line. [Chrobak Larmore 1991]: k-competitive algorithm for trees [Koutsoupias, Papadimitriou 1994]: (2k-1)-competitive algorithm for any metric. [Young 1994]: k and k/(k-h+1)-competitive algorithm for weighted paging using duality!

11 25 years of randomized history
[Fiat, Karp, Luby, McGoch, Sleator, Young 1988]: O(log k)-competitive algorithm for paging. Any algorithm at least Ω(log k)-competitive. [Bartal, Blum, Burch, Tomkin 1997], [Fiat, Mendel 2000]: O(poly log k)-competitive algorithm for metric with k+c points. [Seiden 2001]: O(poly log k)-competitive algorithm for some well separated spaces. [Casba Lodha 2006]: O(n2/3)-competitive algorithm for the equally spaced line. [Bansal, Buchbinder, Naor 2007]: O(log k)-competitive algorithm for weighted paging. [Cote, Meyerson, Poplawski 2008]: O(log Δ)-competitive algorithm on binary HST with stretch Ω(log Δ)

12 Outline The k-server Problem
Linear Programming and Online Primal-Dual Approach New problems new techniques Back to k-server

13 Linear Programming Linear constraints, linear objective
Min x1 – 3 x2 + 2 x3 x1 – x2 + 7 x3 ≤ 2 x x3 ≥ 0 x1 + 3 x2 + x3 ≥ -3 polynomial time solvable lies at the heart of optimization

14 Covering/Packing Problems
Primal solutions Dual solutions P* = D* P: Primal Covering D: Dual Packing covering/packing framework captures many problems: matching, flows, cuts, connectivity problems … ci, aij, bj and the variables xi are all non-negative. Every covering LP has a dual packing LP: Primal constraint  dual variable Primal variable  dual constraint Dual solutions – lower bound on primal solutions.

15 Covering Packing Problems
Primal solutions P: Primal Covering D: Dual Packing P* = D* Dual solutions Generic (offline) primal-dual algorithm: Start: x=0, y=0 (primal infeasible, dual feasible) Increase dual and primal together: ΔD=1, ΔP≤c End: Primal/Dual are feasible  P ≤cD ≤cP*  c-approximate solution

16 Covering Packing Problems
Primal solutions P: Primal Covering D: Dual Packing P* = D* Dual solutions Primal-dual algorithms: Huge success for designing offline algorithms. Many approximate/exact algorithms are actually primal-dual: shortest path, matching, flows, cuts …

17 An Abstract Online Problem
P: Primal Covering D: Dual Packing Primal: constraints arrive one by one. Primal Goal: Find feasible solution x* with min cost. Requirements: Upon arrival constraint must be satisfied Cannot decrease variables (online nature)

18 An Abstract Online Problem
P: Primal Covering D: Dual Packing Dual: columns arrive one by one (new variables). Dual Goal: find feasible solution y* with max profit Requirements: new variable is set only upon arrival (online nature)

19 Example 1: Lower Bound min x1 + x2 + … + xn x1 + x2 + x3 + … + xn ¸ 1
Online ¸ ln n (1+1/2+ 1/3+ … + 1/n) Opt = 1 ( xn=1 suffices) Set all xi to 1/n Increase x2 ,x3,…,xn to 1/n-1 Increase xn to 1

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

21 Ski Rental Subject to: For each day i:

22 Example 3: Online Virtual Circuit Routing
Network graph G=(V, E) Capacity function u: E Z+ Requests: ri = (si, ti) Problem: Connect si to ti by a path, or reject the request. Reserve one unit of bandwidth along the path. No re-routing is allowed. Goal: Maximize the total throughput.

23 Routing – Linear Program
= Amount of bandwidth allocated for ri on path p - Available paths to serve request ri s.t: For each ri: For each edge e:

24 General Covering/Packing Results
{0,1} covering/packing matrix: [Buchbinder-N 05] Competitive ratio O(log D) (D: max number of non-zero entries in a constraint). Remarks: Fractional solutions  randomized algorithm (online rounding). Number of constraints/variables can be exponential. Possible tradeoff: competitive ratio/violation of constraints.

25 General Covering/Packing Results
For a general covering/packing matrix [BN05] : Covering: Competitive ratio O(log n) (n – number of variables). Packing: Competitive ratio O(log n + log [a(max)/a(min)]) a(max), a(min) – max/min non-zero entry Remarks: Results are tight. Can add “box” constraints to covering LP (e.g. x · 1)

26 Key Idea for Online Primal-Dual
Primal: Min i ci xi Dual Step t, new constraint: New variable yt a1x1 + a2x2 + … + ajxj ≥ bt bt yt in dual objective How much:  xi ? yt  yt (additive update)  primal cost = =  Dual Cost dx/dy proportional to x … so, x varies as exp(y)

27 Discrete vs. Continuous
Discrete version: multiplicative update Continuous version: exponential function as long as c is not too small. (c ≥1) Description of discrete algorithm is usually simpler Analysis of continuous algorithm is usually simpler

28 Advantages Unified framework: generic ideas and algorithms applicable to many online problems: Ski rental, Dynamic TCP-Acknowledgement, Parking Permit Problem, Online Routing/Load Balancing Problems, Online Matching, Adwords Problem, Online Set Cover, Online Graph Covering Problems, Paging … Linear Program helps detecting the difficulties of the online problem. General recipe for the design and analysis of online algorithms. No potential function appearing “out of nowhere”. Competitiveness with respect to a fractional optimal solution.

29 Fractional Weighted Paging
Model: Fractions of pages are kept in cache: probability distribution over pages p1,…,pn The total sum of fractions of pages in the cache is at most k. If pi changes by , cost =  w(i) k units of cache

30 Overview High level idea:
Design a primal-dual O(log k)-competitive algorithm for fractional weighted paging. Obtain a randomized algorithm while losing only a constant factor.

31 Setting up the Linear Program
time line Page i Page j Page i Page j Page pt B(t): Set of pages requested until time t (including pt) We can only keep k pages out of the B(t) pages Evict ≥ [|B(t)| (k- 1)] = [|B(t)|-k] pages from B(t)\{pt}

32 Weighted Paging – Linear Program
Idea: charge for evicting pages instead of fetching pages x(i,j) – indicator for the event that page i is evicted from the cache between the j-th and (j+1)-st times it is requested r(i,t) - number of times page i is requested till time t, including t

33 Primal and Dual Programs
P: Primal Covering D: Dual Packing For each page i and the j th time it was asked:

34 Fractional Caching Algorithm
New primal constraint: Dual variable y(t) & constraint:

35 Fractional Caching Algorithm
New primal constraint: Dual variable y(t) & constraint: While primal constraint infeasible: Increase y(t) When dual constraint tight, x(i,j) = 1/k From then on, increase exponentially (until x(i,j)=1)

36 The growth function of x(i,j)
1 1/k Corresponding Dual constraint Dual violated by O(log k) Dual is tight Page fully in memory (marked) Page fully evicted Page is “unmarked”

37 Analysis of Online Algorithm
Proof of competitive factor: Primal solution is feasible. Primal ≤ 2 Dual. Dual is feasible up to O(log k) factor Conclusion (weak duality): Algorithm is O(log k)-competitive

38 Barrier 2 Extend the online primal-dual framework beyond covering/packing linear programs Design new update rules for setting the primal and dual variables

39 Commercial break The Design of Competitive Online Algorithms
More about this approach: The Design of Competitive Online Algorithms via a Primal-Dual Approach By Niv Buchbinder and Seffi Naor Foundations and Trends® in Theoretical Computer Science

40 Outline The k-server Problem
Linear Programming and Online Primal-Dual Approach New problems new techniques Back to k-server

41 Back to Barrier 1 Are these techniques strong enough to resolve the randomized k-server conjecture? Answer: maybe … but we don’t know how. certainly looks like the right direction. Main Difficulty: k-server is an online version of min cost flow. The solution of more general LP-s may be needed (Barrier 2 …)

42 Revisiting the C/P Framework
Positive objective function. New covering constraints arrive one-by-one. Feasible region is not known in advance (gradually exposed as more covering constraints appear). When out of feasible region - should move back inside and pay movement cost. Cost of “infinity” for staying outside the feasible region.

43 Metrical Task System (uniform)
Feasible region: distribution yt on n points (simplex) Each round: cost vector ct defines the cost at every point Algorithm: changes the distribution: yt-1  yt Payments: Service cost: ct yt (cost of serving at a point) Movement cost: earthmover distance metric between distributions

44 Metrical Task System (MTS)
[BBN10]: A new algorithm for MTS that for any 0<ɛ<1: Pays service cost at most (1+ɛ)OPT Pays movement cost at most log(n/ɛ)OPT Known using learning algorithms [BBBT97] Leads to best known algorithm for general metrics [FM00]. Very intuitive primal-dual algorithm MTS is formulated by a non-covering LP:

45 Learning from Expert Advice
Problem: N experts trying to predict “rain/sun” in each day Should I take an umbrella or sunglasses? Goal: predict (almost) as good as the best expert called minimum regret

46 Learning from Expert Advice
Feasible region: distribution yt on n points (simplex) Each round: cost vector ct defines cost in every point (right/wrong) Algorithm: Changes the distribution: yt-1  yt Payments: Service cost: ct yt-1 (cost of staying in a point) Movement cost: free [BBN10]: primal-dual algorithm: same guarantees on the regret as weighted majority

47 Paging Feasible region: “distribution of k-mass” on n points
Each round: mass on current request should be 1 Algorithm: Changes the distribution: yt-1  yt Payments: Service cost: free Movement cost: earthmover distance metric between distributions [BBN10]: LP formulation more involved … algorithm and analysis: very simple.

48 Outline The k-server Problem
Linear Programming and Online Primal-Dual Approach New problems new techniques Back to k-server

49 Coping with the k-Server Problem
The allocation Problem [Cote, Meyerson, Poplawski 08]: N (=5) possible locations for projects (uniform metric) k (=8) workers Projects arrive online (total) Service Cost | Move cost 1 3 k-ary Vector: How much does it cost to run/service the project with any number of workers. Vectors are always monotonically decreasing. 3 4 3≥1≥1 ≥1v≥0… 6 4 10≥4≥2 ≥1 ≥0… 2≥2≥1≥0≥0…

50 Hierarchically Separated Trees (HSTs)
α2 α 1 HSTs: requests and servers reside in the leaves c-competitive algorithm on an α-HST O(cα log n)-competitive algorithm for general metrics

51 Allocation Problem & k-Server [CMP08]
Theorem: An algorithm for the allocation problem that: pays at most (1+ɛ)OPT service cost. pays at most O(log(k/ɛ))OPT movement cost.  Õ(log2D logn log2k)-competitive algorithm for k-server for any metric (Õ – additional loglog factors) Main idea: applying recursively the allocation problem to the nodes of an HST Remark: Important to have good bounds with respect to the service cost D: Diameter of the metric n: number of points in the metric k: number of servers

52 What is Known? Not a lot … [CMP08]: 1-service 1-movement on (only) 2 nodes. O(log D)-competitive algorithm on binary HST with stretch Ω(log D) (D – diameter of the metric) Ideas seem to be tailored to the binary case and not extend beyond that a line can be embedded into a binary HST, however allocation needs α=Ω(log D).

53 More known results (1+ɛ)-service + O(log(k/ɛ))-movement for general allocation problem … but with convexity (concavity) assumption [BBN10] Each project vector Marginal utility of each additional worker is decreasing Service Cost Num. of workers

54 Relation to k-Server Is solving the convex version of the problem enough? Not clear … Instances used in the proof of the theorem do not have this property Maybe in some aggregate sense? Considering several steps together?

55 (Configurations of the k workers + embedding)
What’s Next? Option 1: “fix” the application to the k-server problem via the convex allocation problem Option 2: solve original allocation problem (Barrier 3) Considering option 2: Allocation Problem on d points  MTS problem on HST with n= kd nodes. (Configurations of the k workers + embedding) 2. A new one shot MTS algorithm for HSTs that is (1+ɛ, min{l log (n/ɛ), log2(n/ɛ)})-competitive [BBN, ICALP 10] (l – height of the HST)

56 What Do We Get for k-Server?
An (1+ɛ, d log2n log n/ɛ)-competitive algorithm for the allocation problem on d points (without the convexity assumption)  Randomized algorithm for the k-server problem on certain well separated/low degree/low height HSTs A randomized O(exp(√ln n lnln k))-competitive algorithm for an n-point line (improving on the previous O(n2/3) competitive ratio)

57 Barrier 3 Can a primal-dual approach be applied directly to the k-server problem on HSTs (huge breakthrough)? Even to a 2-level HST? Recall that paging corresponds to a “single level HST”

58 Where Do We Go From Here? Primal-dual method: powerful method for offline problems. seems useful for online problems as well Main questions: Extending the online primal-dual framework beyond covering/packing linear programs – how far can we push it? (problematic even in the offline setting) Randomized/deterministic k-server conjectures

59 Thank you


Download ppt "Online Algorithms, Linear Programming, and the k-Server Problem"

Similar presentations


Ads by Google