New methods for computing visibility graphs

Let <italic>S</italic> be a set of <italic>n</italic> non-intersecting line segments in the plane. The visibility graph <italic>G<subscrpt>S</subscrpt></italic> of <italic>S</italic> is the graph that has the endpoints of the segments in <italic>S</italic> as nodes and in which two nodes are adjacent whenever they can “see” each other (i.e., the open line segment joining them is disjoint from all segments or is contained in a segment). Two new methods are presented to construct <italic>G<subscrpt>S</subscrpt></italic>. Both methods are very simple to implement. The first method is based on a new solution to the following problem: given a set of points, for each point sort the other points around it by angle. It runs in time &Ogr;(<italic>n</italic><supscrpt>2</supscrpt>). The second method uses the fact that visibility graphs often are sparse and runs in time &Ogr;(<italic>m</italic> log <italic>n</italic>) where <italic>m</italic> is the number of edges in <italic>G<subscrpt>S</subscrpt></italic>. Both methods use only Ogr;(<italic>n</italic>) storage.