Seffi Naor Computer Science Dept Technion Barriers in Computational Complexity II Workshop 82010 Joint papers Nikhil Bansal Niv Buchbinder Kamal Jain Online Algorithms Competitive Analysis ID: 372843
Download Presentation The PPT/PDF document "Online Algorithms, Linear Programming, a..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Online Algorithms, Linear Programming, and the k-Server Problem
Seffi NaorComputer Science Dept.Technion
Barriers in Computational Complexity II Workshop 8/2010Joint papers: Nikhil Bansal, Niv Buchbinder, Kamal JainSlide2
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 requestDecisions for previous requests cannot be changedCompetitive 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!Slide3
Canonical Example: Caching / Paging
Browser cachewebCPU cacheSlide4
The Paging/Caching ProblemUniverse 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 pageMain Question: which page to evict?Goal: minimize number of cache missesSlide5
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.Slide6
The Paging/Caching Problem
Can randomization help? A lot!Theorem: There is an O(log k)-competitive randomized paging algorithm (marking algorithm, 1988)Theorem: Any randomized algorithm is Ω(log k)-competitiveSlide7
Outline
The k-server ProblemLinear Programming and Online Primal-Dual ApproachNew problems new techniquesBack to k-serverSlide8
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:Slide9
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 Slide10
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!Slide11
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 Δ)Slide12
Outline
The k-server ProblemLinear Programming and Online Primal-Dual ApproachNew problems new techniquesBack to k-serverSlide13
Linear ProgrammingLinear constraints, linear objective
Min x1 – 3 x2 + 2 x3 x1 – x2 + 7 x3 ≤ 2 x2 - x3 ≥ 0 x1 + 3 x2 + x3 ≥ -3 polynomial time solvable lies at the heart of optimization Slide14
D: Dual Packing
Covering/Packing ProblemsP: Primal Covering
Primal solutionsDual solutionsP* = D*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 constraintDual solutions – lower bound on primal solutions.
covering/packing
framework captures many problems:
m
atching
, flows, cuts, connectivity problems …Slide15
D: Dual Packing
Covering Packing ProblemsP: Primal Covering
Primal solutionsDual solutionsP* = D*Generic (offline) primal-dual algorithm:Start: x=0, y=0 (primal infeasible, dual feasible)Increase dual and primal together: ΔD=1, ΔP≤cEnd: Primal/Dual are feasible P ≤cD ≤cP* c-approximate solutionSlide16
D: Dual Packing
Covering Packing ProblemsP: Primal Covering
Primal solutionsDual solutionsP* = D*Primal-dual algorithms:Huge success for designing offline algorithms.Many approximate/exact algorithms are actually primal-dual: shortest path, matching, flows, cuts …Slide17
D: Dual Packing
An Abstract Online ProblemP: Primal Covering Primal: constraints arrive one by one.Primal Goal: Find feasible solution x* with
min cost.Requirements: Upon arrival constraint must be satisfiedCannot decrease variables (online nature)Slide18
An Abstract Online Problem
Dual: columns arrive one by one (new variables).Dual Goal: find feasible solution y* with max profitRequirements: new variable is set only upon arrival (online nature)
D: Dual Packing P: Primal Covering Slide19
Example 1: Lower Bound min x
1 + x2 + … + xnx1 + x2 + x3 + … + xn ¸ 1 x2 + x3 + … + xn ¸ 1 x3 + … + xn ¸ 1 … xn ¸ 1Online ¸ ln n (1+1/2+ 1/3+ … + 1/n)Opt = 1 ( xn=1 suffices)
Set all xi to 1/nIncrease x2 ,x3,…,xn to 1/n-1…Increase xn to 1Slide20
Example 2: Ski RentalBuying costs $B.Renting costs $1 per day.
Problem:Number of ski days is not known in advance.Goal: Minimize the total cost.Slide21
Ski RentalSubject to:
For each day i: Slide22
Example 3: Online Virtual Circuit RoutingNetwork 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.Slide23
Routing – Linear Programs.t:
For each ri:For each edge e: = Amount of bandwidth allocated for ri on path p- Available paths to serve request riSlide24
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.Slide25
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 entryRemarks:Results are tight.Can add “box” constraints to covering LP (e.g. x · 1)Slide26
Key Idea for Online Primal-Dual
Primal: Min i ci xi DualStep t, new constraint: New variable yta1x1 + a2x2 + … + ajxj ≥ bt + bt yt in dual objectiveHow much: xi ? yt
yt + 1 (additive update) primal cost = dx/dy proportional to x … so, x varies as exp(y) = Dual CostSlide27
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 simplerAnalysis of continuous algorithm is usually simplerSlide28
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.Slide29
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 cacheSlide30
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.Slide31
Setting up the Linear Program
time line
Page iPage iPage jPage j
We can only keep
k pages
out of the
B(t) pages
Evict ≥
[|B(t)| - 1 - (k- 1)] = [|B(t)|-k]
pages from B(t)\{p
t
}
B(t): Set of pages requested until time t (including p
t
)
Page p
tSlide32
Weighted Paging – Linear Program
Idea: charge for evicting pages instead of fetching pagesx(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 requestedr(i,t) - number of times page i is requested till time t, including tSlide33
Primal and Dual ProgramsFor each page i and the
j th time it was asked: D: Dual Packing P: Primal Covering Slide34
Fractional Caching Algorithm
New primal constraint: Dual variable y(t) & constraint:Slide35
New
primal constraint: Dual variable y(t) & constraint:While primal constraint infeasible: Increase y(t)When dual constraint tight, x(i,j) = 1/kFrom then on, increase exponentially (until x(i,j)=1) Fractional Caching AlgorithmSlide36
Corresponding Dual constraint
The growth function of x(i,j)
1/k1Dual is tightDual violated by O(log k)Page fully in memory (marked)Page fully evictedPage is “unmarked”0Slide37
Analysis of Online Algorithm Proof of competitive factor:
Primal solution is feasible.Primal ≤ 2 Dual. Dual is feasible up to O(log k) factorConclusion (weak duality): Algorithm is O(log k)-competitiveSlide38
Barrier 2
Extend the online primal-dual framework beyond covering/packing linear programsDesign new update rules for setting the primal and dual variablesSlide39
Commercial breakMore about this approach:
The Design of Competitive Online Algorithms via a Primal-Dual ApproachBy Niv Buchbinder and Seffi NaorFoundations and Trends® in Theoretical Computer ScienceSlide40
Outline
The k-server ProblemLinear Programming and Online Primal-Dual ApproachNew problems new techniquesBack to k-serverSlide41
Back to Barrier 1Are 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 …)Slide42
Revisiting the C/P FrameworkPositive 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.Slide43
Metrical Task System (uniform)
Feasible region: distribution yt on n points (simplex)Each round: cost vector ct defines the cost at every pointAlgorithm:changes the distribution: yt-1 ytPayments: Service cost: ct yt (cost of serving at a point)Movement cost: earthmover distance metric between distributions
Slide44
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 algorithmMTS is formulated by a non-covering LP: Slide45
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 expertcalled minimum regret Slide46
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 ytPayments: 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 Slide47
Paging
Feasible region: “distribution of k-mass” on n pointsEach round: mass on current request should be 1Algorithm:Changes the distribution: yt-1 ytPayments: Service cost: freeMovement cost: earthmover distance metric between distributions[BBN10]: LP formulation more involved … algorithm and analysis: very simple. Slide48
Outline
The k-server ProblemLinear Programming and Online Primal-Dual ApproachNew problems new techniquesBack to k-serverSlide49
k-
ary Vector: How much does it cost to run/service the project with any number of workers. Vectors are always monotonically decreasing.Coping with the k-Server ProblemThe allocation Problem [Cote, Meyerson, Poplawski 08]:
10≥4≥2 ≥1 ≥0…
3≥1≥1 ≥1v≥0…
2≥2≥1≥0≥0…
N (=5) possible locations for projects (uniform metric)
k (=8) workers
Projects arrive online
(total) Service Cost | Move cost
1 3
3 4
6 4
… Slide50
Hierarchically Separated Trees (HSTs)
c-competitive algorithm on an α-HST O(cα log n)-competitive algorithm for general metrics
1
α
α
2
HSTs
: requests
and servers reside in the leavesSlide51
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 HSTRemark: Important to have good bounds with respect to the service cost
D: Diameter of the metricn: number of points in the metrick: number of serversSlide52
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 thata line can be embedded into a binary
HST, however allocation needs α=Ω(log D).Slide53
More known results
(1+ɛ)-service + O(log(k/ɛ))-movement for general allocation problem … but with convexity (concavity) assumption [BBN10]
Num. of workers1 2 3 4 5 6 7
Service
Cost
Marginal utility of each additional worker is decreasing
Each project vectorSlide54
Relation to k-ServerIs solving the convex version of the problem enough?
Not clear …Instances used in the proof of the theorem do not have this propertyMaybe in some aggregate sense? Considering several steps together?Slide55
What’s Next?
Option 1: “fix” the application to the k-server problem via the convex allocation problemOption 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)Slide56
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 HSTsA randomized O(exp(√ln n lnln k))-competitive algorithm for an n-point line (improving on the previous O(n2/3) competitive ratio)Slide57
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”Slide58
Where Do We Go From Here?
Primal-dual method: powerful method for offline problems.seems useful for online problems as wellMain 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 conjecturesSlide59
Thank you