Segment Visibility Counting Queries in Polygons

Let P be a simple polygon with n vertices, and let A be a set of m points or line segments inside P . We develop data structures that can efficiently count the number of objects from A that are visible to a query point or a query segment. Our main aim is to obtain fast, O(polylog nm), query times, while using as little space as possible. In case the query is a single point, a simple visibility-polygon-based solution achieves O(log nm) query time using O(nm2) space. In case A also contains only points, we present a smaller, O(n + m2+ε log n)-space, data structure based on a hierarchical decomposition of the polygon. Building on these results, we tackle the case where the query is a line segment and A contains only points. The main complication here is that the segment may intersect multiple regions of the polygon decomposition, and that a point may see multiple such pieces. Despite these issues, we show how to achieve O(log n log nm) query time using only O(nm2+ε + n2) space. Finally, we show that we can even handle the case where the objects in A are segments with the same bounds. 2012 ACM Subject Classification Theory of computation → Computational geometry

[1]  Mark H. Overmars,et al.  New methods for computing visibility graphs , 1988, SCG '88.

[2]  Joachim Gudmundsson,et al.  Planar visibility: testing and counting , 2010, SCG.

[3]  B. Joe,et al.  Corrections to Lee's visibility polygon algorithm , 1987, BIT.

[4]  Joseph O'Rourke,et al.  Worst-case optimal algorithms for constructing visibility polygons with holes , 1986, SCG '86.

[5]  Prosenjit Bose,et al.  Efficient visibility queries in simple polygons , 2002, Comput. Geom..

[6]  Mohammad Ghodsi,et al.  Weak visibility counting in simple polygons , 2015, J. Comput. Appl. Math..

[7]  Subir Kumar Ghosh,et al.  Visibility Algorithms in the Plane , 2007 .

[8]  Bernard Chazelle,et al.  A theorem on polygon cutting with applications , 1982, 23rd Annual Symposium on Foundations of Computer Science (sfcs 1982).

[9]  Jirí Matousek,et al.  Ray shooting and parametric search , 1992, STOC '92.

[10]  Micha Sharir,et al.  Applications of a New Space Partitioning Technique , 1991, WADS.

[11]  Mark de Berg,et al.  Efficient ray shooting and hidden surface removal , 2005, Algorithmica.

[12]  Michiel H. M. Smid,et al.  Further Results on Generalized Intersection Searching Problems: Counting, Reporting, and Dynamization , 1995, J. Algorithms.

[13]  Kenneth L. Clarkson,et al.  New applications of random sampling in computational geometry , 1987, Discret. Comput. Geom..

[14]  Maarten Löffler,et al.  Trajectory Visibility , 2020, SWAT.

[15]  Joseph S. B. Mitchell,et al.  Computing the visibility graph of points within a polygon , 2004, SCG '04.

[16]  Bernard Chazelle,et al.  Cutting hyperplanes for divide-and-conquer , 1993, Discret. Comput. Geom..

[17]  Leonidas J. Guibas,et al.  Linear-time algorithms for visibility and shortest path problems inside triangulated simple polygons , 1987, Algorithmica.

[18]  John Hershberger,et al.  A New Data Structure for Shortest Path Queries in a Simple Polygon , 1991, Inf. Process. Lett..

[19]  D. T. Lee,et al.  Visibility of a simple polygon , 1983, Comput. Vis. Graph. Image Process..

[20]  Leonidas J. Guibas,et al.  Visibility Queries and Maintenance in Simple Polygons , 2002, Discret. Comput. Geom..

[21]  Subhash Suri,et al.  A pedestrian approach to ray shooting: shoot a ray, take a walk , 1993, SODA '93.

[22]  Alireza Zarei,et al.  Visibility testing and counting , 2011, Inf. Process. Lett..

[23]  Leonidas J. Guibas,et al.  Optimal shortest path queries in a simple polygon , 1987, SCG '87.

[24]  Haitao Wang,et al.  Weak visibility queries of line segments in simple polygons , 2015, Comput. Geom..

[25]  Bernard Chazelle Triangulating a simple polygon in linear time , 1991, Discret. Comput. Geom..

[26]  Pankaj K. Agarwal,et al.  Connected component and simple polygon intersection searching , 1996, Algorithmica.

[27]  David G. Kirkpatrick,et al.  Optimal Search in Planar Subdivisions , 1983, SIAM J. Comput..

[28]  Leonidas J. Guibas,et al.  Visibility and intersection problems in plane geometry , 1989, Discret. Comput. Geom..

[29]  J. O'Rourke Art gallery theorems and algorithms , 1987 .

[30]  David Avis,et al.  A Linear Algorithm for Computing the Visibility Polygon from a Point , 1981, J. Algorithms.