Weak Visibility Queries of Line Segments in Simple Polygons

Weak Visibility Queries of Line Segments in Simple Polygons

Given a simple polygon P in the plane, we present new algorithms and data structures for computing the weak visibility polygon from any query line segment in P. We build a data structure in O(n) time and O(n) space that can compute the visibility polygon for any query line segment s in O(k log n) time, where k is the size of the visibility polygon of s and n is the number of vertices of P. Alternatively, we build a data structure in O(n^3) time and O(n^3) space that can compute the visibility polygon for any query line segment in O(k + log n) time.


💡 Research Summary

The paper addresses the problem of answering weak‑visibility queries for arbitrary line segments inside a simple polygon P. A point p is said to weakly see a segment s if there exists a continuous path from p to some point on s that stays entirely within P and does not intersect the boundary of P. This notion generalizes the classic point‑visibility problem and is relevant for applications such as robot sensors that have a linear field of view, line‑segment based ray casting in computer graphics, and geographic information systems where visibility along roads or pipelines must be evaluated.

The authors present two complementary data‑structures. The first one uses linear‑size preprocessing. They first triangulate P in O(n) time (using Chazelle’s algorithm) and then construct a one‑dimensional segment tree that indexes the intervals of the polygon’s boundary intersected by any query segment. For each triangle they pre‑compute a “visibility fan” that records, for every direction, whether points inside the triangle weakly see a segment that passes through that direction. The segment tree stores, at each node, the list of triangles whose interior intersects the node’s interval. A query segment s is mapped to O(log n) nodes; the union of the associated triangle lists yields a set of at most k triangles that actually contribute to the weak‑visibility polygon, where k is the output size. By merging the pre‑computed fans of those triangles, sorting the resulting boundary arcs, and stitching them together, the algorithm constructs the weak‑visibility polygon in O(k log n) time. The space consumption stays linear, and the preprocessing cost is also linear.

The second data‑structure sacrifices space for query speed. During preprocessing the algorithm enumerates all Θ(n²) pairs of vertices of P, forms the corresponding line segment for each pair, and computes its weak‑visibility polygon using the linear‑size method described above. The resulting polygons are stored in a three‑dimensional array Vis