Professional Documents
Culture Documents
A Toolbox For Online Algorithms: Marcin Bieńkowski
A Toolbox For Online Algorithms: Marcin Bieńkowski
Marcin Biekowski
University of Wrocaw phd open 2011
Marcin Biekowski
What you need course: This are smart tools good tools quite and not smart problems for very simple problems
Marcin Biekowski
10 minute crash course into online algorithms Toolbox Potential functions Work functions Linear programming Classify and randomly select
Marcin Biekowski
Online algorithms
Marcin Biekowski
Online problems = input is revealed gradually for any instance we want scarce computational resources + we dont know the future offline optimum
Marcin Biekowski
Deterministic algorithms for any instance we want Randomized algorithms for any instance we want
We say that
is
-competitive
Marcin Biekowski
Marcin Biekowski
Marcin Biekowski
Marcin Biekowski
and -competitive
Marcin Biekowski
Marcin Biekowski
World is online
Many real life problems have online nature: network protocols routing scheduling exploration cache organization some data structures financial decisions and many more
Marcin Biekowski
Toolbox Outline
1. Potential functions (PF) 2. Work functions 3. Linear programming 4. Classify and randomly select
Marcin Biekowski
Input: sequence of the following operations insert(x): inserts x at the end of the list, cost L+1 search(x): finds x on the list, cost = position of x delete(x): deletes x from the list, cost as for search. Model: After search or insert, ALG may move x towards the front of the list for free. Afterwards, ALG may swap arbitrary adjacent elements paying 1.
Marcin Biekowski
Algorithm Move To Front (MTF) After each insert(x) or search(x) operation, move x to the beginning of the list (for free).
Marcin Biekowski
Casual approach: simulate both ALG and OPT (actually any other algorithm) on the same sequence and relate their costs.
Marcin Biekowski
PROOF
Does it help? Also known as: How the heck can I guess the correct potential function? There is a rule of the thumb that USUALLY works.
Marcin Biekowski
PF: states
For many online problems, algorithms are in states and the cost depends on request and state only.
State space:
ALG
OPT
Rule of the thumb: Define as a constant times the cost of changing state from ALG to Access(x) request OPT.
x is at the beginning of OPT x is at the end of MTF
Why does it help (in the bad case)? When is small and is large then ALG changes state towards OPT, MTF moves x to decreasing the potential! the beginning of the list
Marcin Biekowski
PROOF
Toolbox Outline
1. Potential functions 2. Work functions (WF) 3. Linear programming 4. Classify and randomly select
Marcin Biekowski
Marcin Biekowski
WF: randomization
Our algorithm will be randomized!
a b
Behavioral definition: ``At the end of step t, move the file to some random node. Distributional definition: ``At the end of step t, choose probability distribution nodes, i.e., file is at v with probability . Lemma: We may emulate distributional definition of ALG by behavioral one. The cost of changing from to is
Marcin Biekowski
over
PROOF
Marcin Biekowski
Marcin Biekowski
For such configuration, request at a does not change the work function (or OPT cost) Good guidance! Lets extrapolate it to intermediate values!
Define gradient Observation: . Moreover, if g = D (or D), then the algorithm should have the file at a (or at b) with probability 1.
Marcin Biekowski
Gradient Recall: Work Function Algorithm At step t, choose distribution such that
and
-competitive. PROOF
Marcin Biekowski
30
Toolbox Outline
1. Potential functions 2. Work functions 3. Linear programming (LP) 4. Classify and randomly select
Marcin Biekowski
In this example:
Input: sequence of elements to cover Output: at each step, output the subset of that covers all elements seen so far. Online factor: removing already chosen sets not possible!
Marcin Biekowski
Input: sequence of elements to cover Output: at each step, output the function which covers each already seen element , i.e., Online factor: removing already chosen fractions of sets not possible!
Marcin Biekowski
Yes, you guessed right, use linear programming! minimize: subject to: (for all ) (for all 1 i k)
Marcin Biekowski
Marcin Biekowski
Primal program (Pk) min.: subject to: (for all ) (for all max.:
Online = monotonic
implies competitive
PROOF
implies competitive
Assume we have a solution for Pk-1 Pk contains one extra constraint Algorithm for step k: While :
For each containing let Observation 2: PROOF Observation 3: Each constraint of the dual solution is violated at 1: Generated primal solution is feasible TRIVIAL PROOF Observationmost by factor O(log m)
Marcin Biekowski
Toolbox Outline
1. Potential functions 2. Work functions 3. Linear programming 4. Classify and randomly select (CRS)
Marcin Biekowski
Input: sequence of call requests: pairs (s i, ti). For each call request: decide whether to admit this call (INFINITE DURATION!) if so choose a routing path for it not violating capacities Goal: maximize the number of accepted calls
Marcin Biekowski
Input: sequence of call requests: pairs (si, ti). For each call request: decide whether to admit this call (INFINITE DURATION!) without violating capacities if so choose a routing path Goal: maximize the number of accepted calls
Marcin Biekowski
Lemma: Any deterministic algorithm on n-node line graph has the competitive ratio at least n-1. PROOF
Marcin Biekowski
Algorithm CRS: Choose j randomly from Accept greedily all calls from level j, and reject all other calls Theorem: CRS is (log n)-competitive.
Marcin Biekowski
PROOF
Marcin Biekowski
46