Recognition and Complexity of Point Visibility Graphs

A point visibility graph is a graph induced by a set of points in the plane, where every vertex corresponds to a point, and two vertices are adjacent whenever the two corresponding points are visible from each other, that is, the open segment between them does not contain any other point of the set. We study the recognition problem for point visibility graphs: given a simple undirected graph, decide whether it is the visibility graph of some point set in the plane. We show that the problem is complete for the existential theory of the reals. Hence the problem is as hard as deciding the existence of a real solution to a system of polynomial inequalities. The proof involves simple substructures forcing collinearities in all realizations of some visibility graphs, which are applied to the algebraic universality constructions of Mn\"ev and Richter-Gebert. This solves a longstanding open question and paves the way for the analysis of other classes of visibility graphs. Furthermore, as a corollary of one of our construction, we show that there exist point visibility graphs that do not admit any geometric realization with points having integer coordinates.


Introduction
Visibility between geometric objects is a cornerstone notion in discrete and computational geometry, that appeared as soon as the late 1960s in pioneering experiments in robotics [17]. Visibility is involved in major themes that helped shape the field, such as art gallery and motion planning problems [5,8,21]. However, despite decades of research on those topics, the combinatorial structures induced by visibility relations in the plane are far from understood. Among such structures, visibility graphs are arguably the most natural. In general, a visibility graph encodes the binary, symmetric visibility relation among sets of objects in the plane, where two objects are visible from each other whenever there exists a straight line of sight between them that does not meet any obstacle. More precisely, a point visibility graph associated with a set P of points in the plane is a simple undirected graph G = (P, E) such that two points of P are adjacent if and only if the open segment between them does not contain any other point of P . Note that the points play both roles of vertices of the graph and obstacles. In what follows, we will use the abbreviation PVG for point visibility graph.

Our results
We consider the recognition problem for point visibility graphs: given a simple undirected graph G = (V, E), does there exists a point set P such that G is isomorphic to the visibility graph of P ? More concisely, the problem consists of deciding the property of being a point visibility graph of some point set.
As is often the case for geometric graphs, the recognition problem appears to be intractable under usual complexity-theoretic assumptions. We actually characterize the problem as complete for the existential theory of the reals; hence recognizing point visibility graphs is as hard as deciding the existence of a solution to an arbitrary system of polynomial inequalities over the reals. Equivalently, this amounts to deciding the emptiness of a semialgebraic set. This complexity class is intimately related to fundamental results on oriented matroids and pseudoline arrangements starting with the insights of Mnëv on the algebraic universality properties of these structures [20]. The notation ∃R has been proposed recently by Schaefer [27] to refer to this class, motivated by the continuously expanding collection of problems in computational geometry that are identified as complete for it.
The only known inclusion relations for ∃R are N P ⊆ ∃R ⊆ P SP ACE. It is known from the Tarski-Seidenberg Theorem that the first-order theory of real closed fields is decidable, but polynomial space algorithms for problems in ∃R have been proposed only much more recently by Canny [4].
Whenever a graph is known to be a point visibility graph, the description of the point set as a collection of pairs of integer coordinates constitutes a natural certificate. Since it is not known whether ∃R ⊆ N P , we should not expect such a certificate to have polynomial size. In fact, we show that there exist point visibility graphs all realizations of which have an irrational coordinate, and point visibility graphs that require doubly exponential coordinates in any realization.

Related work and Connections
The recognition problem for point visibility graphs has been explicitly stated as an important open problem by various authors [14], and is listed as the first open problem in a recent survey from Ghosh and Goswami [9].
A linear-time recognition algorithm has been proposed by Ghosh and Roy for planar point visibility graphs [10]. For general point visibility graphs they showed that recognition problem lies in ∃R. More recently, Roy [26] published an ingenious and rather involved NP-hardness proof for recognition of arbitrary point visibility graphs. Our result clearly implies NP-hardness as well, and, in our opinion, has a more concise proof.
Structural aspects of point visibility graphs have been studied by Kára, Pór, and Wood [14], Pór and Wood [24], and Payne et al. [23]. Many fascinating open questions revolve around the big-line-big-clique conjecture, stating that for all k, ≥ 2, there exists an n such that every finite set of at least n points in the plane contains either k pairwise visible points or collinear points.
Visibility graphs of polygons are defined over the vertices of an arbitrary simple polygon in the plane, and connect pairs of vertices such that the open segment between them is completely contained in the interior of the polygon. This definition has also attracted a lot of interest in the past twenty years. Ghosh gave simple properties of visibility graphs of polygons and conjectured that they were sufficient to characterize visibility graphs [6,7]. These conjectures have been disproved by Streinu [31] via the notion of pseudo-visibility graphs, or visibility graphs of pseudo-polygons [22]. A similar definition is given by Abello and Kumar [1].
Roughly speaking, the relation between visibility and pseudo-visibility graphs is of the same nature as that between arrangements of straight lines and pseudolines. Although, as Abello and Kumar remark, these results somehow suggest that the difficulty in the recognition task is due to a stretchability problem, the complexity of recognizing visibility graphs of polygons remains open, and it is not clear whether the techniques described in this paper can help characterizing it. The influential surveys and contributions of Schaefer about ∃R-complete problems in computational geometry form an ideal point of entry in the field [27,28]. Among such problems, let us mention recognition of segment intersection graphs [15], recognition of unit distance graphs and realizability of linkages [13,28], recognition of disk and unit disk intersection graphs [19], computing the rectilinear crossing number of a graph [3], simultaneous geometric graph embedding [16], and recognition of d-dimensional Delaunay triangulations [2].

Outline of the paper
In Section 2, we provide two simple visibility graph constructions, the fan and the generalized fan, all geometric realizations of which are guaranteed to preserve a specified collection of subsets of collinear points. The proofs are elementary and only require a series of basic observations.
In Section 3, we give two applications of the fan construction. In the first, we show that there exists a point visibility graph that does not have any geometric realization on the integer grid. In other words, all geometric realizations of this point visibility graph are such that at least one of the points has an irrational coordinate. Another application of the fan construction follows, where we show that there are point visibility graphs each grid realization of which require coordinates of values 2 2 3 √ n where n denotes the number of vertices of the point visibility graph.
The main result of the paper is given in Section 4. We first recall the main notions and tools used in the results from Mnëv [20], Shor [29], and Richter-Gebert [25] for showing that realizability of abstract order types is complete for the existential theory of the reals. We then combine these tools with the generalized fan construction to produce families of point visibility graphs that can simulate arbitrary arithmetic computations over the reals.

Notations
For the sake of simplicity, we slightly abuse notations and do not distinguish between a vertex of a point visibility graph and its corresponding point in a geometric realization. We denote by G[P ] the induced subgraph of a graph G = (P, E) with the vertex set P ⊆ P . For a point visibility realization R we denote by R[P ] the induced subrealization containing only the points P . The PVG of this subrealization is in general not an induced subgraph of G. By N (p) we denote the open neighbourhood of a vertex p.
The line through two points p and q is denoted by (p, q) and the open segment between p and q by pq. We will often call pq the sightline between p and q, since p and q see each other iff pq ∩ P = ∅. We call two sightlines p 1 q 1 and p 2 q 2 non-crossing if p 1 q 1 ∩ p 2 q 2 = ∅.
For each point p all other points of G lie on deg(p) many rays R p 1 , . . . , R p deg(p) originating from p.

Point visibility graphs preserving collinearities
We first describe constructions of point visibility graphs, all the geometric realizations of which preserve some fixed subsets of collinear points.

Preliminary observations
p p q q In the realization of a PVG, the point p sees exactly deg(p) many vertices, hence all other points lie on deg(p) rays of origin p.
. Then all points lie on one side of the line (p, q). Furthermore, the neighbor of q lies on the ray that forms the smallest angle with qp.
Proof. If the angle between two consecutive rays is smaller than π, then every vertex on one ray sees every vertex on the other ray. Hence one of the angles incident to q is at least π and the neighbour of q lies on the other incident ray. Proof. By Lemma 1 the two endpoints of the path lie on rays on the boundary of empty halfspaces. Thus all other rays form angles which are smaller than π, and thus they see their two neighbors of the path on their neighboring rays. Observation 3. Let q, q = p, be a point that sees all points of N (p). Then q is the second point (not including p) on one of the rays emerging from p.
Proof. Assume q is not the second point on one of the rays. Then q cannot see the first point on its ray which is a neighbor of p.
This also shows the following observation.

Observation 4.
Let q, q = p, be a point that is not the second point on one of the rays from p and sees all but one (r) of the neighbors of p. Then q lies on the ray of r.

Fans and generalized fans
We have enough tools by now to show the uniqueness of a PVG obtained from the following construction, which is depicted in Figure 2. Consider a set S of segments between two lines and intersecting in a point p. , such that each segment has one endpoint on each line. For each intersection of a pair of segments, construct a ray of origin p and going through this intersection point. Add two segments s 1 and s 2 between and , such that s 1 is the closest and s 2 is the second closest segments to p.  We now put a point on each intersection of the segments and rays and construct the PVG of this set of points. We call this graph the fan of S and denote it by fan(S). Since we have the choice of the position of the segments s 1 and s 2 we can avoid any collinearity between a point on s 1 or s 2 and points on other segments, except for the obvious collinearities on one ray. Thus every point sees all points on s 1 except for the one of the ray it lies on.

Lemma 5. All realizations of a fan preserve collinearities between points that lie on one segment and between points that lie on one ray.
Proof. We first show that the distribution of the points onto the rays of p is unique. By construction the points on s 2 see all the points on s 1 , which are exactly the neighbors of p. Thus by Observation 3 the points from s 2 are the second points of a ray. Since there is exactly one point for each ray on s 2 , all the other points are not second points on a ray. By construction each of the remaining points sees all but one point of s 1 . Observation 4 gives a unique ray a point lies on. The order of the rays is unique by Corollary 2. On each ray the order of the points is as constructed, since the PVG of points on one ray is an induced path. Now we have to show that the points originating from one segment are still collinear. Consider three consecutive rays R 1 , R 2 , R 3 . We consider a visibility between a point p 1 on R 1 and one point p 3 on R 3 that has to be blocked by a point on R 2 . Let p 2 be the original blocker from the construction. For each point on R 2 that lies closer to p there is a sightline blocked by this point, and for each point that lies further away from p there is a sightline blocked by this point. For each of those points pick one sightline that corresponds to an original segment and p 1 p 3 . This set of sightlines is non-crossing, since the segments only intersect on rays by assumption. So we have a set of non-crossing sightlines and the same number of blockers available. Since the order on each ray is fixed, and the sightlines intersect R 2 in a certain order, the blocker for each sightline is uniquely determined and has to be the original blocker. By transitivity of collinearity all points from the segments remain collinear.
To show the hardness of PVG recognition in the existential theory of the reals in Section 4 we need a unique realization property for the following generalization of a fan.
Consider again two lines and and a set of n segments S located between those lines. We assume for now that and are parallel, i.e., their intersection point p lies on the line at infinity, and horizontal. Now we are not interested in preserving the exact arrangement of the segments S in a PVG, but only in keeping the segments straight, and the order of the segments on and on as described by S. For that purpose we add three parallel and equidistant segments s 1 , s 2 , s 3 to the left of all segments of S. Below and above we add 5n equidistant rays each, that are parallel to and and start on the point at infinity p. Let ε be the distance between two consecutive rays in one bundle. We choose ε such that (5n) 4 ε is smaller that the distance of any intersection of segments in S to or . We call such a set of 5n rays a bundle. Above the bundle close to and below the bundle close to we add (5n) 4 segments starting on s 3 and ending in p. The segments are parallel to the rays of the bundles and are also equidistant with distance ε to their close bundle. The bundles together with the (5n) 4 segments forms what we will call the extended bundle. The equidistance property is preserved according to the following lemma. Proof. We first show that there is a projective transformation such that the columns lie on parallel lines. Using a projective transformation we can assume that the first two lines l 1 and l 2 of the grid are vertical. Assume the third line l 3 is not parallel to the first two. Then, since r ≥ 6, there is a 2 × 2 cell in which the distance between l 2 and l 3 is larger than between l 1 and l 2 on the upper and lower boundary of the cell, or the distance is smaller on the upper and lower boundary. Now consider the position of the middle point of the 2 × 2 cell. The point lies on l 2 and the intersection of the two diagonals. This does not coincide in the described case as shown in Figure 4. This argument also shows that the lines l 1 , l 2 , l 3 are equidistant. By symmetry also the lines r i are equidistant. Now we apply a projective transformation, such that the intersection point p of and does not lie on the line at infinity as shown in Figure 3. We add a segment s 0 between and that lies between p and s 1 . Again we take all the intersection points between segments, rays or lines as points and construct the visibility graph of those points. Note that we can add s 0 , such that each point on s 0 sees all points that do not lie on its ray or s 0 . A visibility graph constructed in this way will be called a generalized fan. In Lemma 7 we show that all realizations of a generalized fan preserve the collinearities between the points on the segments.
Let us briefly consider the differences between a fan and a generalized fan. In the fan in Figure 2 the vertical order of the intersection points is a > b > c > d > e. In contrast, the generalized construction, shown on the left of Figure 3, allows different vertical orders on those points. In Figure 5 we used three bundles instead of two bundles to fix the orders. In the proof of Lemma 7 it will turn out that all realizations for this construction also preserve collinearities. In this case we have a further restriction on the vertical order of the intersection points: the points a and b must lie above the middle bundle, and the points c, d, e must lie below. This restricts the possible vertical orders of intersection points to some linear extensions of the partial order shown in Figure 3. To indicate that a and b lie above c, d and e we introduce the notation {a, b} > {c, d, e}. This notation captures exactly the restriction we can add to the horizontal orders of a fan: given a realization of the segments S between the lines and it is possible to add bundles between some intersection points, partitioning the intersection points of the segments into subsets I 1 , . . . , I k . Now every realization of the PVG respects the vertical order I 1 > · · · > I k of the intersection points. If |I j | = 1, one line through an intersection point as in Figure 2 can also be used.

Lemma 7. All realizations of a generalized fan preserve collinearities between points that lie on one segment and between points that lie on one ray.
Proof. The argument showing that the distribution of the points onto the rays starting at p and the order of the rays remains as constructed is identical to the proof of Lemma 5. So we only have to show that the points from the segments stay collinear. We do this in two steps. In the first one we show that the points on segments within one extended bundle stay collinear. We will use this in a second step to show that the segments in two consecutive bundles stay aligned.
We proceed with the first step. First note that the points from one segment within one bundle stay collinear in each realization by the same arguments as in Lemma 5. The same holds for the points on a segment s k , k ∈ {0, . . . , 3}, and the intersection with the (5n) 4 segments. So for the first step we only have to show that the segments s 0 , . . . , s 3 in extended bundles stay aligned. Therefore we consider the lowest ray of the bundle close to and two neighboring segments. The points on the segments s k stay collinear on those three rays, because four non-crossing sightlines have to be blocked by four points. Now consider the two lowest rays of the bundle close to , and the (5n) 4 segments below. Assume that the points on one of the segments s 0 , . . . , s 4 do not stay aligned for one s k . Then the points on s k that lie on the two lowest rays u k (lowest) and v k (second lowest) and the lowest segment w k form the convex hull of all the points on s k that lie in between, see Figure 6. In this triangle there are (5n) 4 − 1 non-crossing sightlines that have to be blocked. This implies that one of the other segments s l have to support blockers. If the triple (u k , v k , w k ) is oriented clockwise some the blockers have to be supported by a segment s k to the right, or by one to the left otherwise. In the clockwise case the three according points on the convex hull of the s k have to be oriented clockwise as well. Since a symmetric case holds for the counterclockwise case we obtain a contradiction for the rightmost clockwise or leftmost counterclockwise oriented triple.

Figure 6
A clockwise orientation of (u k , v k , w k ) forces the triple on a right segment s k to be oriented clockwise.
So it is left to show that the two subsegments within consecutive bundles stay aligned. We will refer to those subsegments as the upper and the lower part of a segment. First note that the segments s k , k ∈ {0, . . . , 3} stay aligned in consecutive extensions of a bundle, thus they cannot provide blockers for sightlines between upper and lower part on the other segments.
We assume the points from one original segment s are not all collinear in a realization of the fan. We denote by s and s respectively the lower and upper part of s. If s and s are not aligned then one of the two lower points of s does not lie on the supporting line of s . We denote this point by q. Between q and the points on s there are at least (5n) 4 − 1 non-crossing sightlines that have to be blocked. At most n of those sightlines can be blocked from points on the upper bundle, namely the points from the lowest ray if q lies on the second lowest ray. The other blockers lie on the other n − 1 lower parts of the segments. From the pigeonhole principle there is a lower part b of a segment that provides at least (5n − n − 1)/(n − 1) = 5 blockers for sightlines between q and points on s . We will show that this is not possible.
By first reversing the projective transformation applied in the construction of the generalized fan, and then applying Lemma 6, we can assume that the lines in the lower bundle are parallel and equidistant, as shown in Figure 7. Now we use an affine transformation such that the points of s have coordinates (0, i) for i ∈ {−k, . . . , r − 1 − k}, where k is chosen such that the lowest point blocked by a point on b has coordinates (0, 0). By another linear transformation we can ensure that q = (N, N ) for some N > 0. We can now use the segments starting from s 3 to give a lower bound on N : the segments above the bundle of s are also equidistant with the same distance as the lines in the bundle, since the segments extend the grid. Since q lies on a parallel line above those rays we know that N > (5n) 4 .
The points on b that block visibilities between points on s from q also have y-coordinates in {0, . . . , r − 1 − k}, since they lie on lines in the same bundle as s . Let us assume that the point b ij on b has y-coordinate j and blocks the visibility of (0, i) from q. Then the Calculating d min using the expression above once with b 1 and once with b 2 leads to the following equation.
Since all coefficients in the last equation are integral we obtain that i 1 i 2 j 0 (j 2 − j 1 ) is a multiple of N . This is a contradiction to N > (5n) 4 since each of the factors is bounded by 5n and is nonzero.

Drawing point visibility graphs on grids
We give a first simple application of the fan construction.

Theorem 8. There exists a point visibility graph every geometric realization of which has at least one point with one irrational coordinate.
Proof. We use the so-called Perles configuration of 9 points on 9 lines illustrated in Fig. 8. It is known that for every geometric realization of this configuration in the Euclidean plane, one of the points has an irrational number as one of its coordinate [12]. We combine this construction with the fan construction described in the previous section. Hence we pick two lines and intersecting in a point p, such that all lines of the configuration intersect both and in the same wedge. Note that up to a projective transformation, the point p may be considered to be on the line at infinity and and taken as parallel. We add two non-intersecting segments s 1 and s 2 close to p, that do not intersect any line of the configuration. We then shoot a ray from p through each of the points, and construct the visibility graph of the original points together with all the intersections of the rays with the lines and the two segments s 1 , s 2 . From Lemma 5, all the collinearities of the original configuration are preserved, and every realization of the graph contains a copy of the Perles configuration.
Also note that point visibility graphs that can be realized with rational coordinates do not necessarily admit a realization that can stored in polynomial space in the number of vertices of the graph. To support this, consider a line arrangement A, and add a point p in an unbounded face of the arrangement, such that all intersections of lines are visible in an angle around p that is smaller than π. Construct rays and through the extremal intersection points and p. From Lemma 5, the fan of this construction gives a PVG that fixes A. Since there are line arrangements that require integer coordinates of values 2 2 Θ(|A|) [11] and the fan has Θ(|A| 3 ) points we get the following worst-case lower bound on the coordinates of points in a representation of a PVG.

∃R-completeness reductions
The existential theory of the reals (∃R) is a complexity class defined by the following complete problem. We are given a well-formed quantifier-free formula F (x 1 , . . . , x k ) using the numbers 0 and 1, addition and multiplication operations, strict and non-strict comparison operators, Boolean operators, and the variables x 1 , . . . , x k , and we are asked whether there exists an assignment of real values to x 1 , . . . , x k , such that F is satisfied. This amounts to deciding whether a system of polynomial inequalities admits a solution over the reals. The first main result connecting this complexity class to a geometric problem is the celebrated result of Mnëv, who showed that realizability of order types, or -in the dual -stretchability of pseudoline arrangements, is complete in this complexity class [20]. In what follows, we use the simplified reductions due to Shor [29] and Richter-Gebert [25]. The latter is in turn well explained in a recent manuscript by Matoušek [18]. We refer the curious reader to those references for further details.
The orientation of an ordered triple of points (p, q, r) indicates whether the three points form a clockwise or a counterclockwise cycle, or whether the three points are collinear. Let P = {p 1 , . . . , p n } and an orientation O of each triple of points in P be given. The pair (P, O) is called an (abstract) order type. We say that the order type (P, O) is realizable if there are coordinates in the plane for the points of P , such that the orientations of the triples of points match those prescribed by O.
In order to reduce the order type realizability problem to solvability of a system of strict polynomial inequalities, we have to be able to simulate arithmetic operations with order types. This uses standard constructions introduced by von Staudt in his "algebra of throws" [30].

Arithmetics with order types.
To carry out arithmetic operations using orientation predicates, we associate numbers with points on a line, and use the cross-ratio to encode their values.
The cross ratio (a, b; c, d) of four points a, b, c, d ∈ R 2 is defined as where |x, y| is the determinant of the matrix obtained by writing the two vectors as columns.
The two properties that are useful for our purpose is that the cross-ratio is invariant under projective transformations, and that for four points on one line, the cross-ratio is given by , where − → xy denotes the oriented distance between x and y on the line. We will use the cross-ratio the following way: We fix two points on a line and call them 0 and 1. On the line through those points we call the point at infinity ∞. For a point a on this line the cross-ratio x := (a, 1; 0, ∞) results in the distance between 0 and a scaled by the distance between 0 and 1. Because the cross-ratio is a projective invariant we can fix one line and use the point a for representing the value x. In this way, we have established the coordinates on one line. For computing on this line, the gadgets for addition and multiplication depicted in Figure 9 can be used. Let us detail the case of multiplication. We are given the points ∞ < 0 < 1 < x < y on the line , and wish to construct a point on that represents the value x · y. Take a second line ∞ that intersects in ∞, and two points a, b on this line. Construct the segments by, b1 and ax. Denote the intersection point of ax and b1 by c. Call d the intersection point of by and (0, c). The intersection point of and (d, a) represents the point x · y =: z on , i.e., (z, 1; 0, ∞) = (x, 1; 0, ∞) · (y, 1; 0, ∞). In a projective realization of the gadget in which the line ∞ is indeed the line at infinity, the result can be obtained by applying twice the intercept theorem, in the triangles with vertices 0, d, y and 0, d, z, respectively. To add the cross ratios of two points on a line, a similar construction is given in Figure 9.

The reduction for order types
Using the constructions above we can already model a system of strict polynomial inequalities. However, it is not clear how we can determine the complete order type of the points without knowing the solution of the system. Circumventing this obstacle was the main achievement of Mnëv [20]. We cite one of the main theorems in a simplified version. Theorem 10 ( [29], [25]). Every primary semialgebraic set V ⊆ R d is stably equivalent to a semialgebraic set V ⊆ R n , with n = poly(d), for which all defining equations have the form x i + x j = k or x i · x j = x k for certain 1 ≤ i ≤ j < k ≤ n, where the variables 1 = x 1 < x 2 < · · · < x n are totally ordered.
A primary semialgebraic set is a set defined by polynomial equations and strict polynomial inequalities with coefficients in Z. Although we cannot give a complete definition of stable equivalence within the context of this paper, let us just say that two semialgebraic sets V and V are stably equivalent if one can be obtained from the other by rational transformations and so-called stable projections, and that stable equivalence implies homotopy equivalence. From the computational point of view, the important property is that V is the empty set if and only V is, and that the size of the description of V in the theorem above is polynomial in the size of the description of V . We call the description of a semialgebraic set V given in the theorem above the Shor normal form.
We can now encode the defining relations of a semialgebraic set given in Shor normal form using abstract order types by simply putting the points ∞, 0, 1, x 1 , . . . , x n in this order on . To give a complete order type, the orientations of triples including the points of the gadgets and the positions of the gadget on ∞ have to be specified. This can be done exploiting the fact that the distances between the points a and b of each gadget and their position on ∞ can be chosen freely. We refer to the references mentioned above for further details. We next show how to implement these ideas to construct a graph G V associated with a primary semialgebraic set V , such that G V has a PVG realization if and only if V = ∅.

∃R-completeness of PVG recognition
The idea to show that PVG recognition is complete in ∃R is to encode the gadgets described in the previous section in a generalized fan. We therefore consider the gadgets not as a collection of points with given order types, but as a collection of segments between the lines and ∞ with given crossing information, i.e., a certain arrangement of the segments of the fan.
We will consider the addition and multiplication gadgets given in Fig. 9, and for a copy g i of the addition gadget, denote by a i , b i , c i , d i , and e i the points corresponding to g i , and similarly for the multiplication gadget. To formalize the freedom we have in choosing the points a i and b i for each addition or multiplication gadget g i , we make the following two observations. The points of a gadget that do not lie on are denoted by P i . Observation 11 ([25], [18]). The points a i and b i can be positioned arbitrarily on ∞ . The position of the other points of P i is fully determined by a i , b i and the input values on .
Observation 12 ([25], [18]). All points of P i are placed close to a i if a i and b i are placed close to each other. (For each ε > 0 there exists a δ > 0, such With those two observations in hand, we show we can place the points of the gadgets on ∞ one by one, such that we have a partial information on the relative height of the crossings of the involved segments. This partial information can be combined with the generalized fan construction to force the exact encoding.
Here we need a generalized fan since we cannot obtain the full information of the height all the crossings with the segments of other gadgets, since the position and distance of the other segments of gadgets is influenced by the solution of the inequality system.
For simplicity, we can work in the projective plane. This allows us to apply a projective transformation such that the point ∞ is mapped onto the line at infinity, and the lines and ∞ are parallel. Furthermore we can assume and ∞ are horizontal lines. In this setting we have to specify a order on the y-coordinate of the intersection points of the segments/the points of the gadgets. Therefore we fix one order of the gadgets g 1 , g 2 , . . . , g l on ∞ .
Lemma 13. Let V be a nonempty primary semialgebraic set given in Shor normal form and let g 1 , g i−1 , g i , . . . , g l be the gadgets realizing the defining equations, such that g j is realizing an addition if j < i and a multiplication otherwise. Then there exists a realization such that the order of the y-coordinates of the intersection points is given by where I j denotes the intersections between the segments of the gadget g k with the segments of the gadgets g j for j < k. Figure 10 The vertical order of the points in the reduction.
Proof. We fix one solution for the relations defining V . The points on are fixed realizing this solution. We place the points a i and b i such that the other points of the gadgets realize the order of the y-coordinates described in the lemma. First note that the order of the points within one gadget is determined as described by the construction of the gadgets. The points corresponding to variables are also on and the points a, b and f all lie on ∞ . Thus the total relations given in (1) and (5), as well as the relations between each triple of points belonging to one gadget in (2) and (3) are satisfied in all realizations.
We place the points a i and b i of the gadgets inductively. Assume that we have placed the first i − 1 gadgets such that the inequalities above are satisfied. Now there exists a real ε such that none of the points of the gadgets lies in an ε-neighborhood of or ∞ , see Figure 10. For this reason there exists an axis-aligned rectangle of height ε with lower boundary on , such that every segment drawn so far intersects the upper and the lower boundary of this rectangle (the lower grey box in Figure 10). We now place a i such that all segments that are constructed for the gadget g i (blue) intersect the right boundary of this rectangle. This can be achieved by placing a i further than the intersection point of ∞ and the supporting line of the diagonal with positive slope of the rectangle (the red segment in Figure 10). This shows that (4) can be satisfied.
To show the inequalities in (2) and (3) hold it remains to check that the points c i , d i (and eventually e i ) can be placed in an ε-neighborhood of ∞ . This can be done, using Observation 12, by placing b i close to a i .

Theorem 14. The recognition of point visibility graphs is ∃R-complete.
Proof. To prove completeness, we first have to check that the problem belongs to ∃R. For this, we have to encode, for each edge pq of the visibility graph, that no other point lies on the segment pq, and the opposite for nonedges. This can be done with polynomial inequalities and Boolean operations. For an detailed formulation of this inequality system we refer to [10].
For the hardness part, the idea of the proof is the following. For a semialgebraic set V we compute the Shor normal form and denote the corresponding primary semialgebraic set by V . For V , we can construct the arrangement of pseudosegments that are attached on the lines and ∞ . By inverting the projective transformation applied in Lemma 13 we can construct a generalized fan G V of the pseudosegments between and ∞ , such that in any PVG realization the order of the intersection points of the segments satisfies the inequalities in Lemma 13.
The bundles and rays for the generalized fan are added, such that the possible vertical orders are fixed to the ones described in Lemma 13, see Figure 10: We add an orange ray from p through each of the points c i , d i and e i of each gadget g i , i ∈ [l]. This fixes the inequalities in lines (2)-(3). A green bundle is added before and after each of the sets I j , j ∈ {2, . . . , l}, such that (4) is satisfied.
From this generalized fan we want to construct a point visibility graph G V . Here we have to be a careful with collinearities between point that do not lie on one segment or one ray. Therefore, we show that we can construct the edges and nonedges between points on different segments and different rays, such that they do not restrict too many solutions of our strict inequality system. First notice that we can avoid collinearities between points on segments of different gadgets by perturbing the positions of the points a i b i , the exact position of the bundles, and the distance of the rays within a bundle (we have this freedom in the proof of Lemma 13). So we can assume that the only collinearities of points on different segments appear between segments in one gadget. In the addition gadget we have no three segments that intersect in one point. By perturbing the position of the bundles we can avoid collinearities in those gadgets.
In the multiplication gadget we are in the situation that we have three segments 0, 1, x (and 0, y, x·y) that intersect in one point. If the ratio of those three points on is rational they are (after projective transformations) columns in the integer grid. If those are intersected by a bundle we obtain the points on projective transformation of the integer grid and thus collinearities. The point here is that we can compute during the construction which collinearities appear: the solutions of the original strict inequality system form an open set. In this set we can assume that our solution consists of sufficiently independent numbers, e.g. they are algebraically independent over Q, such that 0, 1, x and 0, y, x · y only have a rational ratio if x is a coefficient of the inequality system. In this case we can calculate the collinearities. Otherwise, we can perturb the bundles a i and b i to avoid collinearities. Hence all collinearities between points on different segments can be computed and do not influence the solvability of the inequality system. This way we can determine all edges of G V .
The number of vertices of the graph G V is polynomial in the size of V since calculating the Shor normal form of V gives a description of V which has size polynomial in the size of V . The number of segments, bundles, rays, and the size of a bundle in the fan are all polynomial in the number of operations in the Shor normal form. All calculations in this construction can be done in polynomial time.
For the ∃R-hardness it remains to show that the graph G V is a point visibility graph if and only if V (and thus V ) is nonempty. To show that V is nonempty if G V has a PVG realization we observe that the collinearities from a ray and from a segments stay collinear in each realization by Lemma 7. Thus the gadgets implementing the calculations on are preserved. Using the cross-ratio as described in Subsection 4.1 a PVG realization encodes a point in V , and V is nonempty if G V has a PVG realization.
We show that there exists a PVG realization if V and V are nonempty. We consider a solution x ∈ V and place the points corresponding to the variables on a line . With points in this position the gadgets implementing the calculations can be realized between and ∞ , such that the intersection points of the segments satisfy the order in Lemma 13.