Authors: Danny Z. Chen and Haitao Wang
Abstract
This paper presents two new data structures for computing weak visibility polygons from query line segments in a simple polygon. The first solution achieves optimal $O(n)$ space and preprocessing time with an $O(k \log n)$ query time. The second solution provides a faster $O(k + \log n)$ query time using $O(n^3)$ space. These results are achieved through a novel "ray-rotating" query technique and a tighter combinatorial bound for line segment arrangements within simple polygons.
Introduction
In computational geometry, visibility is a fundamental concept. A point $p$ is weakly visible to a line segment $s$ if there is at least one point on $s$ that can "see" $p$ without the line of sight being blocked by the polygon's boundary. The set of all such points $p$ forms the weak visibility polygon, denoted as $Vis(s)$.
While algorithms existed to compute this for a single segment in $O(n)$ time, the "query" version of the problem—where a polygon is pre-processed to quickly answer visibility questions for any arbitrary segment $s$—was previously less efficient. This paper optimizes the trade-off between preprocessing time, space complexity, and query speed.
Methods
The authors propose two distinct approaches to solve the query problem:
1. The O(n) Space Approach (Result 1)
This method utilizes a "moving point" strategy, tracking visibility changes as a point slides along the query segment $s$. The core technical innovation is a novel ray-rotating query data structure. This allows the algorithm to find the next "principal child" in a shortest-path tree in $O(\log n)$ time, avoiding the complex $O(n^2)$ visibility decompositions used in prior work.
2. The O(n^3) Space Approach (Result 2)
This approach refines methods based on visibility decomposition ($VD(P)$), which partitions the polygon into cells of constant visibility. By employing modern algorithms for arrangement construction and a new Zone Theorem specifically for simple polygons, the authors achieve a more efficient $O(n^3)$ preprocessing time compared to the previous $O(n^3 \log n)$.
Key Insights
- Ray-Rotating Queries: A versatile tool that finds the first vertex hit by a rotating ray inside a polygon in $O(\log n)$ time with only linear preprocessing.
- Tighter Combinatorial Bounds: The authors proved that the "zone" of a line segment in an arrangement of $m$ lines within a simple polygon has a complexity of $O(m)$, rather than the general $O(m \alpha(m))$.
- Implementation Simplicity: Result 2 is simpler to implement than previous $O(n^3)$ methods as it avoids complex shortest-path tree maintenance.
Results
The following table compares the new data structures against previous benchmarks, where $n$ is the number of polygon vertices and $k$ is the size of the output visibility polygon.
| Data Structure | Preprocessing Time | Space (Size) | Query Time |
|---|---|---|---|
| Aronov et al. [1] | $O(n^2 \log n)$ | $O(n^2)$ | $O(k \log^2 n)$ |
| Our Result 1 | $O(n)$ | $O(n)$ | $O(k \log n)$ |
| Bygi & Ghodsi [3] | $O(n^3 \log n)$ | $O(n^3)$ | $O(k + \log n)$ |
| Our Result 2 | $O(n^3)$ | $O(n^3)$ | $O(k + \log n)$ |
Result 1 is particularly significant as it reduces space from quadratic to linear while improving query performance.
Conclusion
This work provides state-of-the-art solutions for weak visibility queries. Future work may involve extending these techniques to polygons with holes or investigating if $O(k + \log n)$ query time can be achieved with sub-cubic space.
Summary updated