Download presentation
Presentation is loading. Please wait.
1
Dynamic and Online Algorithms:
Anupam Gupta Carnegie Mellon University Based on joint works with: Albert Gu, Guru Guruganesh, Ravishankar Krishnaswamy, Amit Kumar, Debmalya Panigrahi, Cliff Stein, and David Wajc
2
Dynamic (and) Online Algorithms: a little change will do you good
Anupam Gupta Carnegie Mellon University Based on joint works with: Albert Gu, Guru Guruganesh, Ravishankar Krishnaswamy, Amit Kumar, Debmalya Panigrahi, Cliff Stein, and David Wajc
3
Dynamic Approximation Algorithms: a little change will do you good
Anupam Gupta Carnegie Mellon University Based on joint works with: Albert Gu, Guru Guruganesh, Ravishankar Krishnaswamy, Amit Kumar, Debmalya Panigrahi, Cliff Stein, and David Wajc
4
online algorithms and competitive analysis
At any time π‘, maintain a solution for the current input past decisions are irrevocable solution should be comparable to the best offline algorithm which knows the input till time π‘. Competitive ratio of an on-line algorithm on input π 1 , π 2 , β¦, π π‘ , β¦ sup π‘ cost of solution produced at time π‘ optimal solution cost for π 1 ,β¦, π π‘
5
problem 1: load balancing
At each time, a unit size job arrives β can be processed by a subset of machines. Jobs already assigned cannot be reassigned to another machine. Goal: Minimize the maximum load on any machine.
6
problem 1: load balancing
At each time, a unit size job arrives β can be processed by a subset of machines. Jobs already assigned cannot be reassigned to another machine. Goal: Minimize the maximum load on any machine. Greedy has competitive ratio Ξ(logβ‘π), where m = #machines. [Azar Naor Rom β92]
7
problem 1b: edge orientation
Edges (say, of a tree) arrive online, must orient each arriving edge. Minimize the maximum in-degree of any vertex. Special case of load balancing, where each job can go to two machines. Can make in-degree of one vertex Ξ©( log π) [Azar, Naor, Rom β92]
8
problem 2: online spanning tree
v1 v0 v3 v4 v2 Start with a single point π£0 At time π‘, new point π£π‘ arrives Distances π(π£π‘, π£π) for π<π‘ revealed // π(.,.) satisfy triangle ineq. Want: At any time π‘, spanning tree on revealed points Goal: Minimize tree cost Theorem: cost(Greedy tree) β€ O(log π) Γ MST(π£0, β¦, π£π) Matching lower bound of ο(log π) [Imase Waxman β91]
9
problem 2: online spanning tree
Theorem: cost(Greedy tree) β€ O(log π) Γ MST(π£0, β¦, π£π) Matching lower bound of ο(log π) [Imase Waxman β91]
10
problem 3: set cover π 5 π 4 π 3 π 2 π 1 Given collection of π sets
At time π‘, new element ππ‘ arrives and reveals which sets it belongs to Want: At any time π‘, maintain set cover on revealed elements Goal: Minimize cost of set cover. Theorem: cost(algorithm) β€ O(log m log π) Γ OPT( π 1 , β¦, ππ) Matching lower bound on deterministic algos [Alon Awerbuch Azar Buchbinder Naor β05]
11
(dynamic) online algorithms
At any time π‘, maintain a solution for the current input past decisions are irrevocable solution should be comparable to the best offline algorithm which knows the input till time π‘. Relax this requirement. Still compare to clairvoyant OPT. Measure number of changes (βrecourseβ) per arrival - e.g., at most O(1) changes per arrival (worst-case) - or, at most t changes over first t arrivals (amortized) Competitive ratio of an on-line algorithm on input π 1 , π 2 , β¦, π π‘ , β¦ sup π‘ cost of solution produced at time π‘ optimal solution cost for π 1 ,β¦, π π‘ a.k.a. dynamic (graph) algorithms: traditionally measure the update time instead of #changes, we measure recourse. traditionally focused on (exact) graph algorithms, now for appox.algos too.
12
consider edge orientationβ¦
Edges (of a tree) arrive online, a solution should orient each arriving edge. Minimize the maximum in-degree of any vertex. What if we change orientation of few edges upon each arrival?
13
consider edge orientationβ¦
Edges (of a tree) arrive online, a solution should orient each arriving edge. Minimize the maximum in-degree of any vertex. What if we change orientation of few edges upon each arrival?
14
or spanning tree⦠v3 v0 v2 v5 v4 v1 i.e., allowed to delete some old edges, pick new ones instead. trade-off between #swaps and cost of tree
15
a glimpse of some resultsβ¦
v0 v1 v2 v3 v4 π 5 π 4 π 3 π 2 π 1 In-degree π(logβ‘π) Cost π(logβ‘π) Cost π( log π logβ‘π) In-degree π(1) Recourse π(1) (amortized) Cost π(1) Recourse π 1 (worst-case) Cost π log π Recourse O(1) (amortized) extend to load-balancing and single-sink flows extend to fully-dynamic O(1) amortized extend to fully-dynamic O(1) amortized
16
a glimpse of some resultsβ¦
v0 v1 v2 v3 v4 π 5 π 4 π 3 π 2 π 1 In-degree π(logβ‘π) Cost π(logβ‘π) Cost π( log π logβ‘π) In-degree π(1) Recourse π(1) (amortized) Cost π(1) Recourse π 1 (worst-case) Cost π log π Recourse O(1) (amortized) extend to load-balancing and single-sink flows extend to fully-dynamic O(1) amortized extend to fully-dynamic O(1) amortized
17
consider edge orientationβ¦
Recourse vs in-degree trade-off: Competitive ratio No. of re-orientations NaΓ―ve 1 π Greedy log π [Brodal and Fagerberg β98] 2 3 (amortized) Amortized: after π edge insertions, at most 3π edge reorientations.
18
the Brodal-Fagerberg algorithm
When a new edge arrives, orient it arbitrarily. If the in-degree of a vertex becomes 3, flip all the incoming edges.
19
the Brodal-Fagerberg algorithm
When a new edge arrives, orient it arbitrarily. If the in-degree of a vertex becomes 3, flip all the incoming edges. Could lead to cascade of edge flips. In fact, a single edge addition could cause Ξ© π edge flips!
20
analysis Algorithm Optimal (has in-degree 1)
Theorem: total number of flips till time π is at most 3π. βbadβ edge = oriented oppositely from the optimal tree. Ξ¦(π‘) : number of bad edges at time π‘ When a new edge arrives, Ξ¦(π‘) may increase by 1. What happens to Ξ¦(π‘) when we flip three 3 incoming edges for some vertex? Ξ¦(π‘) must decrease by at least 1 ! Total increase in Ξ¦ is β€π, so total decrease β€π.
21
open problems and extensions
Recourse vs in-degree trade-off: Competitive ratio No. of re-orientations NaΓ―ve 1 π Greedy log π [Brodal and Fagerberg β98] 2 3 (amortized) Extensions: Theorem: O(1)-competitive load balancing with O(1) amortized recourse Theorem: O(1)-competitive single-sink flows with O(1) amortized recourse Open: get a O(1) competitive algorithm with O(1) re-orientations worst-case. Open: get a O(1) competitive algorithm with O(1) re-orientations (even amortized) for fully-dynamic case.
22
a glimpse of some resultsβ¦
v0 v1 v2 v3 v4 π 5 π 4 π 3 π 2 π 1 In-degree π(logβ‘π) Cost π(logβ‘π) Cost π( log π logβ‘π) In-degree π(1) Recourse π(1) (amortized) Cost π(1) Recourse π 1 (worst-case) Cost π log π Recourse O(1) (amortized) extend to load-balancing and single-sink flows extend to fully-dynamic O(1) amortized extend to fully-dynamic O(1) amortized
23
online spanning tree (with recourse)
Recourse: when new request vertex π£π‘ arrives, 1) add edge connecting π£π‘ to some previous vertex 2) possibly swap some existing tree edges with non-tree edges Let ππ‘ be tree after π‘ arrivals. v3 v0 v2 v5 v4 v1
24
results Competitive ratio No. of reassignments Greedy logβ‘π Trivial 1
Trivial 1 π Imase, Waxman β91 2 π (amortized) Megow et al. β12 1+π 1/πβ
log 1/π (amortized) Gu, G., Kumar β13 1/π (amortized) O(1)
25
results Competitive ratio No. of reassignments Greedy logβ‘π Trivial 1
Trivial 1 π Imase, Waxman β91 2 π (amortized) Megow et al. β12 1+π 1/πβ
log 1/π (amortized) Gu, G., Kumar β13 1/π (amortized) O(1)
26
algorithm idea (Greedy) When a new vertex arrives, it connects to the closest vertex in the tree. Repeat If there are edges πβπ, πβπ such that π lies in the cycle formed by π+π π π β€ π π Leads to MST, but may incur too many swaps. then swap π,π
27
algorithm idea (Greedy) When a new vertex arrives, it connects to the closest vertex in the tree. Repeat If there are edges πβπ, πβπ such that π lies in the cycle formed by π+π π π β€ π π /(1+π) Leads to 1+π -approximate MST, with π 1 π amortized recourse. then swap π,π
28
analysis MST
29
analysis 1 2 MST 4 8 7 5 6 3 Greedy
30
analysis 1 2 MST 4 8 7 5 6 3 Greedy Product of lengths of red greedy edges Goal: β€ 4n Product of lengths of blue edges (no matter what order the vertices arrive) Each swap some edge length decreases by (1+Ξ΅) ο number of swaps is log1 + Ξ΅ 4n = O(n/Ξ΅) [Gu, also Abraham Bartal Neiman Schulman]
31
analysis β€ 4n β€ β€ 1 2 MST 4 8 7 5 6 e 3 Greedy
Product of lengths of red greedy edges πΆ πβ1 π 2 Goal: β€ 4n β€ Product of lengths of blue edges Exists e on this path P such that len(P)/ len(e) β€ βsmallβ β€ len(first greedy edge)/ len(e)
32
analysis β€ β€ 1 MST πΏ π nodes e π
π nodes Greedy
Product of lengths of red greedy edges πΆ πβ1 π 2 Goal: β€ Product of lengths of blue edges πΆβ
πΏ π 2 β
π
π 2 π 2 Exists e on this path P such that len(P)/ len(e) β€ βsmallβ β€ len(first greedy edge)/ len(e)
33
οΌ analysis Γ Γ β€ β€ β€ 1 MST πΏ π nodes e π
π nodes Greedy
οΌ Product of lengths of red greedy edges πΆ πβ1 π 2 Goal: β€ Product of lengths of blue edges πΆβ
πΏ π 2 β
π
π 2 π 2 len(first greedy edge)/ len(e) β€ Γ Induction on the two subtrees: πΆ πΏ π β1 πΏ π 2 Γ πΆ π
π β1 π
π 2 Product(greedy)/product(blue) β€
34
analysis 1 MST πΏ π nodes e π
π nodes Greedy πΆβ
πΏ π 2 β
π
π 2 π 2
πΆβ
πΏ π 2 β
π
π 2 π 2 New Goal: Exists e on this path P such that len(P)/ len(e) β€
35
analysis 1 = β€ ο₯e in P β€ ο₯e in P β€ < 1 1 MST e Greedy
π 2 πΆβ
πΏ π 2 β
π
π 2 New Goal: Exists e on this path P such that len(e)/ len(P) β₯ Suppose not: π 2 πΆβ
πΏ π 2 β
π
π 2 4 πΆβ
minβ‘(πΏ π 2 , π
π 2 ) 4β
2β
π 2 /6 πΆ 1 = ο₯e in P len(e)/len(P) β€ ο₯e in P β€ ο₯e in P β€ < 1 contradiction for C large!
36
results Competitive ratio No. of reassignments Greedy logβ‘π Trivial 1
Trivial 1 π Imase, Waxman β91 2 π (amortized) Megow et al. β12 1+π 1/πβ
log 1/π (amortized) Gu, G., Kumar β13 1/π (amortized) O(1)
37
extensions Allow vertex deletions too (fully-dynamic model) [G., Kumar β14] Theorem: O(1)-competitive algorithm with O(1)-amortized swaps. Theorem: non-amortized O(1)-swaps if we allow deletions only. Theorem: π( π )-update time dynamic graph algorithms. [Εacki Pilipczuk Sankowski Zych β15]
38
road-map In-degree π(logβ‘π) Cost π(logβ‘π) Cost π( log π logβ‘π)
v0 v1 v2 v3 v4 π 5 π 4 π 3 π 2 π 1 In-degree π(logβ‘π) Cost π(logβ‘π) Cost π( log π logβ‘π) In-degree π(1) Recourse π(1) (amortized) Cost π(1) Recourse π 1 (worst-case) Cost π log π Recourse O(1) (amortized) extend to load-balancing and single-sink flows extend to fully-dynamic O(1) amortized extend to fully-dynamic O(1) amortized
39
online set cover Given a collection of m sets Elements arrive online. Element π π‘ announces which sets it belongs to. Pick some set to cover element if yet uncovered. Minimize cost of sets picked. Today: Allow recourse. Assume unit costs. Get O(log n) competitive with O(log n) recourse. π 5 π 4 π 3 π 2 π 1
40
offline: the greedy algorithm
Solution (a) picks some sets (b) assigns every element to some picked set. Greedy: Iteratively pick set S with most yet-uncovered elements, assign them to S ο (1 + ln n)-approx. very robust: if βcurrent-bestβ set covers π uncovered elements, pick some set covering Ξ©(π) elements ο lose only π(1) factor.
41
online: the βgreedyβ algorithm
density = 3 density = 2 density = 2 density = 1 Universe of current points
42
online: the βgreedyβ algorithm
density = 3 density = 2 density = 2 density = 1 π 1 π 2 π 5 π 3 π 8 π 4 π 7 π 6
43
online: the βgreedyβ algorithm
π 6 density = 1 π 3 π 8 π 4 π 7 density = 2 π 1 π 2 π 5 density [3,4] density [5,8]
44
online: the βgreedyβ algorithm
π 6 density = 1 π 3 π 8 π 4 π 7 density = 2 π 1 π 2 π 5 density [3,4] density [5,8] Unstable set S: set that contains β( 2 πβ1 ,2 π ] elements, all currently being covered at densities β€ 2 πβ1 . E.g., suppose some set contains π 3 , π 4 and π 6 . Then it is unstable. Lemma: no unstable sets ο solution is O(log n)-approximate.
45
online: the βgreedyβ algorithm
π 3 π 6 π 9 π 9 π 6 density = 1 π 3 π 8 π 4 π 7 density = 2 π 1 π 2 π 5 density [3,4] density [5,8] Suppose π 9 arrives. Cover it with any set containing it. Now green set is unstable. So add it in, and assign π 3 , π 6 , π 9 to it. Clean up, resettle sets at the right level.
46
overview of the analysis
Invariant: element at level β 2 π has 2(logβ‘π β π) tokens When a new element arrives and not covered by current sets, pick any set that covers it, add it with density 1 If some unstable set exists, add it to the correct level, assign those elements to it. May cause other sets to lose elements, become lighter. They βfloat upβ to the correct level. Cause other sets to become unstable, etc. Claim: system stabilizes. Also, O(log n) changes per arrival, amortized. Start each element with 2 log π tokens Elements moving down lose 2 tokens use 1 to pay for new set Sets moving up lose Β½ of their elements use their other token to pay for rising up* *minor cheating here.
47
road-map In-degree π(logβ‘π) Cost π(logβ‘π) Cost π( log π logβ‘π)
v0 v1 v2 v3 v4 π 5 π 4 π 3 π 2 π 1 In-degree π(logβ‘π) Cost π(logβ‘π) Cost π( log π logβ‘π) In-degree π(1) Recourse π(1) (amortized) Cost π(1) Recourse π 1 (worst-case) Cost π log π Recourse O(1) (amortized) extend to load-balancing and single-sink flows extend to fully-dynamic O(1) amortized extend to fully-dynamic O(1) amortized get fully-dynamic polylog(n) update times too
48
other problems considered in this model
Online Bin-packing, Bin-covering [Jansen et al. β14] [G. Guruganesh Kumar Wajc β17] Makespan Minimization on parallel/related machines [Andrews Goemans Zhang β01] on unrelated machines [G. Kumar Stein β13] Traveling Salesman Problem (TSP) [Megow Skutella Verschae Wiese β12] Facility Location Problem [Fotakis β06, β07] Tree Coloring [Das Choudhury Kumar β16] β¦
49
so in summary⦠For combinatorial optimization problems online,
allowing bounded recourse can improve the competitive ratio qualitatively. Many open problems: specific problems like Steiner forest, or fully-dynamic matchings understanding lower bounds connections to dynamic algorithms (and lower bounds) other models for ensuring solutions are Lipschitz?
50
thanks!!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.