Optimal Window Queries on Line Segments using the Trapezoidal Search DAG
Abstract
We propose a new query application for the well-known Trapezoidal Search DAG (TSD) of a set of $n$~line segments in the plane, where queries are allowed to be {\em vertical line segments}. We show that a simple Depth-First Search reports the $k$ trapezoids that are intersected by the query segment in $O(k+\log n)$ expected time, regardless of the spatial location of the query. This bound is optimal and matches known data structures with $O(n)$ size. In the important case of edges from a connected, planar graph, our simplistic approach yields an expected $O(n \log^*\!n)$ construction time, which improves on the construction time of known structures for vertical segment-queries. Also for connected input, a simple extension allows the TSD approach to directly answer axis-aligned window-queries in $O(k + \log n)$ expected time, where $k$ is the result size.
Empirical ResultsBrowse all benchmarks →
| Benchmark | Method | Metric | Score | Protocol / Evidence |
|---|---|---|---|---|
| Open Street Map streets — New Caledonia | Trapezoidal Search DAG (TSD) vertical segment-query method | Average number of geometric comparisons | ~74.15 comparisons | Vertical Segment Query · params=0.2M · subset=New Caledonia · segments=0.2M · avg-intersected-segments=9.04Source quoteL385: New Caledonia │ 0.2M │ ~9.04 │ ~74.15 │ 46.96 │ 119.11 │ 119.29 │ ~~580.72 |
| Open Street Map streets — Serbia | Trapezoidal Search DAG (TSD) vertical segment-query method | Average number of geometric comparisons | 110.54 comparisons-118.77 vs baseline | Vertical Segment Query · params=6.9M · subset=Serbia · segments=6.9M · avg-intersected-segments=17.56Source quoteL399: Serbia │ 6.9M │ 17.56 │ 110.54 │ * │ 229.31 │ 243.00 │ 16484.74 |
Reported baseline / comparator measurements (4)
| Benchmark | Method | Metric | Score | Protocol / Evidence |
|---|---|---|---|---|
| Open Street Map streets — New Caledonia | SDS (Segment Data Structure) baseline | Average number of geometric comparisons | 46.96 comparisons | Vertical Segment Query · params=0.2M · subset=New Caledonia · segments=0.2M · avg-intersected-segments=9.04Source quoteL385: New Caledonia │ 0.2M │ ~9.04 │ ~74.15 │ 46.96 │ 119.11 │ 119.29 │ ~~580.72 |
| Open Street Map streets — Serbia | R-Tree-Q baseline | Average number of geometric comparisons | 229.31 comparisons | Vertical Segment Query · params=6.9M · subset=Serbia · segments=6.9M · avg-intersected-segments=17.56Source quoteL399: Serbia │ 6.9M │ 17.56 │ 110.54 │ * │ 229.31 │ 243.00 │ 16484.74 |
| Open Street Map streets — Serbia | R-Tree-L baseline | Average number of geometric comparisons | 243.00 comparisons | Vertical Segment Query · params=6.9M · subset=Serbia · segments=6.9M · avg-intersected-segments=17.56Source quoteL399: Serbia │ 6.9M │ 17.56 │ 110.54 │ * │ 229.31 │ 243.00 │ 16484.74 |
| Open Street Map streets — Serbia | R*-Tree baseline | Average number of geometric comparisons | 16484.74 comparisons | Vertical Segment Query · params=6.9M · subset=Serbia · segments=6.9M · avg-intersected-segments=17.56Source quoteL399: Serbia │ 6.9M │ 17.56 │ 110.54 │ * │ 229.31 │ 243.00 │ 16484.74 |
BibTeX
@inproceedings{brankovic2022optimal,
author = {Milutin Brankovic and Martin P. Seybold},
title = {{Optimal Window Queries on Line Segments using the Trapezoidal Search DAG}},
booktitle = {COCOON},
year = {2022},
url = {https://openreview.net/forum?id=keXcI04gcv},
}Ask Althea to put this paper to the test.
Loading related content...