1 / 14

An Optimal Dynamic Interval Stabbing-Max Data Structure?

An Optimal Dynamic Interval Stabbing-Max Data Structure?. Pankaj K. Agarwal, Lars Arge and Ke Yi Department of Computer Science Duke University. 3. 4. 2. 1. 5. q. Problem Definition. S : n intervals in 1D w ( s ) : weight of s  S ; w ( s )  R

maire
Download Presentation

An Optimal Dynamic Interval Stabbing-Max Data Structure?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. An Optimal Dynamic Interval Stabbing-Max Data Structure? Pankaj K. Agarwal, Lars Arge and Ke Yi Department of Computer Science Duke University

  2. 3 4 2 1 5 q Problem Definition • S : n intervals in 1D • w(s): weight of sS; w(s)R • Stabbing-max query qR: max{w(s) | sS, qs} • Three operations: • Query • Insert an interval • Delete an interval

  3. Previous Results • Trivial if no deletions • A binary search tree: O(n) space, O(log n) query & insert • Interval tree • Size: O(n) • Query: O(log2n) • Insert: O(log n) • Delete: O(log n) • Kaplan, Molad and Tarjan [STOC’03] • The best known result • Size: O(n) • Query: O(log n) • Insert: O(log n) • Delete: O(log n loglog n) q 4 4 3 2 4 3 1

  4. Our Results • Trivial if no deletions • A binary search tree: O(n) space, O(log n) query & insert • Interval tree • Size: O(n) • Query: O(log2n) • Insert: O(log n) • Delete: O(log n) • Kaplan, Molad and Tarjan [STOC’03] • The best known result • Size: O(n) • Query: O(log n) • Insert: O(log n) • Delete: O(log n loglog n) q 4 4 3 2 4 3 1

  5. Base Tree T • Main idea: use a base interval tree with fan-out f = • Height of tree: O(log n / loglog n) • Each leaf stores Q(log n) endpoints • O(n / log3/2n) internal nodes, O(n / log n) nodes in total O( ) slabs slab slab multislab multislab multislab O(log n) multislabs

  6. Base Tree T v S(v): Intervals associated with nodev Each interval is broken into a left, a right and a middle segment

  7. Middle Segments: Overview • A secondary structure Mv for each internal node v of the base tree • Answers query within S(v) in O(loglog n) time • O(log n / loglog n) nodes on the path • O(log n) time in total • Insert or delete a segment in O(log n) time • Only one Mvis affected • Total time: O(log n) • Size: O(|S(v)| + log3/2n) • O(n / log3/2n) internal nodes • Total size: O(n) S(v)

  8. Secondary Structure Mv • Build a multislab heap for each multislab • Stores all segments spanning exactly this multislab • Build a slab heap for each slab • Stores the top elements of the relevant multislab heaps • Query: O(loglog n) • Find the slab heap • Update: O(log n) • Update the multislab heap: O(log n) • Update the slab heaps: 1 2 3 4 5 1 2 3 4 5 Size: O(log3/2n) 2-4 2-5 3-3 4-5 1-2 Size: O(|S(v)|)

  9. Left Segments: A Static Structure • L(v) : segments in iS(ui) with left endpoints in the slab of v • Basic idea: answer query inL(v) − L(w4) when visiting v • f(wj) : maximum interval inL(v) with left endpoint in the slab of wj • Organize in a tournament tree • Can find the maximumof the red segmentsin time O(loglog n) • Total: O(log n) q f(w2) u2 u1 v w1w2w3w4 w5 f(w1) f(w2) f(w3) f(w4)

  10. Updating f • Each segment at u2 affects the f values at O(log n / loglog n) descendents • Each f can be updatedin O(loglog n) time (using additional structures) • Total update time: O(log n) • Other issues (omitted) • Rebalancing of the base tree u2 u1 v w1w2w3w4 w5

  11. Is It Really Optimal? • Is the O(log n) deletion bound really optimal? • The O(log n) query bound is optimal in comparison model • Can show O(log n) query → W(log n) insert • O(log n) query & insert → W(log n) delete ? • Probably yes • Errata (Theorem 4.2 & 4.3) • Query & update time: • O(logd-1n) → O(logdn)

  12. Thank you!

  13. Putting Everything Together y(u, v) = max{y(u, w), for all of v’s children w} f(w) = max{y(u, w), for all v’s ancestors u execpt p(w)} Ta Base tree y(a,b) a y(a,c) y(a,d) y(a,e) b Tb c d y(b,d) y(b,c) Consider f(e) y(b,e) y(b,f) y(b,g) f g Td e h i j Tc y(d,e) y(c,e) y(c,f) y(c,g) y(d,f) y(d,g)

  14. Putting Everything Together Update: O(log n / loglog n· loglog n) = O(log n) Only one Tv is affected Ta Base tree y(a,b) a y(a,c) y(a,d) y(a,e) b Tb c d Total size is still linear y(b,d) y(b,c) y(b,e) f g Td e h i j Tc y(d,e) y(c,e)

More Related