Optimal Window Queries on Line Segments using the Trapezoidal Search DAG

Milutin Brankovic, Martin P. Seybold · DOI

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 →

BenchmarkMethodMetricScoreProtocol / Evidence
Open Street Map streets — New CaledoniaTrapezoidal Search DAG (TSD) vertical segment-query methodAverage number of geometric comparisons~74.15 comparisonsVertical Segment Query · params=0.2M · subset=New Caledonia · segments=0.2M · avg-intersected-segments=9.04
Source quote
L385: New Caledonia │ 0.2M │ ~9.04 │ ~74.15 │ 46.96 │ 119.11 │ 119.29 │ ~~580.72
Open Street Map streets — SerbiaTrapezoidal Search DAG (TSD) vertical segment-query methodAverage number of geometric comparisons110.54 comparisons-118.77 vs baselineVertical Segment Query · params=6.9M · subset=Serbia · segments=6.9M · avg-intersected-segments=17.56
Source quote
L399: Serbia │ 6.9M │ 17.56 │ 110.54 │ * │ 229.31 │ 243.00 │ 16484.74
Reported baseline / comparator measurements (4)
BenchmarkMethodMetricScoreProtocol / Evidence
Open Street Map streets — New CaledoniaSDS (Segment Data Structure) baselineAverage number of geometric comparisons46.96 comparisonsVertical Segment Query · params=0.2M · subset=New Caledonia · segments=0.2M · avg-intersected-segments=9.04
Source quote
L385: New Caledonia │ 0.2M │ ~9.04 │ ~74.15 │ 46.96 │ 119.11 │ 119.29 │ ~~580.72
Open Street Map streets — SerbiaR-Tree-Q baselineAverage number of geometric comparisons229.31 comparisonsVertical Segment Query · params=6.9M · subset=Serbia · segments=6.9M · avg-intersected-segments=17.56
Source quote
L399: Serbia │ 6.9M │ 17.56 │ 110.54 │ * │ 229.31 │ 243.00 │ 16484.74
Open Street Map streets — SerbiaR-Tree-L baselineAverage number of geometric comparisons243.00 comparisonsVertical Segment Query · params=6.9M · subset=Serbia · segments=6.9M · avg-intersected-segments=17.56
Source quote
L399: Serbia │ 6.9M │ 17.56 │ 110.54 │ * │ 229.31 │ 243.00 │ 16484.74
Open Street Map streets — SerbiaR*-Tree baselineAverage number of geometric comparisons16484.74 comparisonsVertical Segment Query · params=6.9M · subset=Serbia · segments=6.9M · avg-intersected-segments=17.56
Source quote
L399: 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},
}

Loading related content...

Figure