200 likes | 374 Views
Optimal 3-d Orthogonal Range Reporting Kasper Dalgaard Larsen Joint work with Peyman Afshani and Lars Arge. Orthogonal Range Reporting. Input: n points in d -dimensional space. Task: Build structure that reports all points inside an axis-aligned query box efficiently. Our Focus:
E N D
Optimal 3-d Orthogonal Range ReportingKasper Dalgaard LarsenJoint work with PeymanAfshani and Lars Arge
Orthogonal Range Reporting • Input: npoints in d-dimensional space. • Task: Build structure that reports all points inside an axis-aligned query box efficiently. • Our Focus: • Pointer Machine Model • Near-linear space, Polylog(n)+t queries.
Previous 2-d Results • Upper Bounds: • O(lgn+t) query O(n) space for 3-sided [McCreight 85]. • O(lgn+t) query O(n lgn/lglgn) space [Chazelle 86]. • Lower Bounds: • Ω(n lgn/lglgn) space for O(logO(1)n+t) query [Chazelle 90]. Solved
Infinite Range Variants • Query Variants: • Q(d,k): d-dimensional space, k ranges are finite.
Previous Results: Adding Sides • Range Trees [Bentley 80]: Q(d,k) to Q(d,k+1) Q(d,k) to Q(d+1,k+1) • Binary- and fanout (lgn)e trees. • Recently (FOCS’09) we showed.
Previous Results 2-d opt. space • Upper Bounds in 2 and 3-d: • Lower Bounds Q(3,3): • Ω(n (lgn/lglgn)2) space for O(logO(1)n+t) query [Chazelle 90]. 3-d opt. queries
Our Results • We achieve: • 3-d closed, but problem still open for d≥4.
How To Get Better Reductions • We want: Q(d,k) to Q(d,k+1) Q(d,k) to Q(d+1,k+1) • Define new and harder variant of range reporting. • Give reductions with lgn/lglgn penalty. • Solve base case efficiently.
Goals • Fanout (lgn)e • Perform O(1) queries at level. • Store points in one structure at level. • Observations: • Same Q(d,k) query on subset of children. • Only O((lgn)2e) possible subsets to query. Q(d+1,k+1) Q(d+1,k) Q(d,k) Q(d+1,k) Q(d,k) (lgn)e
Concurrent Range Reporting • Color points based on child. • Perform Q(d,k) query on all the points. • Report only with colors { , }. • Recurse. • Observations: • (lgn)e colors. • O((lgn)2e) possible color subsets to query. Q(d+1,k+1) Q(d+1,k) Q(d,k) Q(d+1,k) Q(d,k)
Concurrent Range Reporting • Concurrent Q(d,k) (CQ(d,k)): • n points in d-dimensional space. • Points have colors from a set C. • Set P of subsets of C (possible color queries). • Queries: • A Q(d,k) box q and a set p from P. • Output all points in q with color in p. p={ } C={ } P={ , , , }
Concurrent Range Reporting • We reduce Q(3,3) to CQ(2,2): • |C|=(lgn)e , |P|= (lgn)2e • O(lgn/lglgn) levels. • Points stored in one CQ(2,2) at level. • Two CQ(2,2) queries at level. • CQ(d,k) solution with: • Sd,k(n,|C|,|P|) space. • Qd,k(n,|C|,|P|)+O(t) queries. Q(3,3) Q(3,2) Q(2,2) Q(3,2) Q(2,2) • Q(d+1,k+1) solution with: • Sd,k(n,|C|,|P|) lgn/lglgn • Qd,k(n,|C|,|P|) lgn/lglgn+O(t)
Concurrent Range Reporting • CQ(d+1,k+1) to CQ(d,k): • New colors C’ are pairs (old color,child). • P’ is product of P and ranges of child colors. • |C’|=(lgn)e |C| • |P’|=(lgn)2e|P| Q(d+j,k+j) to CQ(d,k) with |C|=(lgn)ej and |P|=(lgn)2ej Q(d+1,k+1) C={ } P={ , } C’={ } Q(d+1,k) Q(d,k) Q(d+1,k) Q(d,k) P’={ , , , , , } , , , p={ } to p’={ } ... , , ...
Overview of Optimal 3-d Solution • Combination of many previous techniques: • [Afshani 08],[Afshani et. al 09],[Chazelle 86],[Chazelle and Guibas 86],[Karpinski and Nekrich 09],[Makris and Tsakalidis 98]. • CQ(3,0): O(n) space, O(lgn+t) queries. • [Afshani 08],[Afshani et. al 09],[Chazelle 86],[Makris and Tsakalidis 98]. • CQ(3,2): O(nlgn/lglgn) space, O(lgn+t) queries. • [Afshani et. al 09],[Chazelle and Guibas 86],[Karpinski and Nekrich 09]. • CQ(3,3): O(n(lgn/lglgn)2) space, O(lgn+t) queries. • [Afshani et. al 09].
Sketch of CQ(3,0) • lgn-shallow cutting [Afshani 08] for every color. • Q(3,0) structure in every box and one for every color. • O(n) space, O(|C|lglgn+t) queries. • 2-d rect. point location finds boxes [Makris and Tsakalidis 98]. • Point Enclosure [Chazelle 86] finds all boxes at same time. • O(n) space, O(lgn+|C|) queries.
Sketch of CQ(3,2) • A grid of size yxy where y=√(n/|C||P|lg2n) [KN 09]. • n/y points in slabs. • Query: • grid query. • 4 recursive. • Need to answer grid queries. • Recursive: • grid query. • 1 recursive. • 2 CQ(3,0) queries.
Sketch of CQ(3,2): Grid Queries • Answering grid queries. • Snap points to grid. • Linked lists for each color. • Q(3,2) structure [Chazelle and Guibas 86] for every pєP on bottom points. • Link to lists. • S(n)=2n/yS(y)+O(n), S(lgn)=lgn S(n)=nlgn/lglgn • Q(n)=Q(y)+lgn Q(n)=lgn
Summary • We thus have: Solved
Open Problems • Pointer Machine Model: • 4-d queries with O(lgn+t) query time? • Query bounds of the form O(lgd/2+O(1)n+t)? • External Memory: • We have CQ(3,0) (modification). • CQ(3,2) not space optimal. • Q(3,3) with O(lgBn+t/B) queries and O(n(lgn/lglgBn)2) space?