The Complexity of Drawing Graphs on Few Lines and Few Planes

It is well known that any graph admits a crossing-free straight-line drawing in $\mathbb{R}^3$ and that any planar graph admits the same even in $\mathbb{R}^2$. For a graph $G$ and $d \in \{2,3\}$, let $\rho^1_d(G)$ denote the smallest number of lines in $\mathbb{R}^d$ whose union contains a crossing-free straight-line drawing of $G$. For $d=2$, $G$ must be planar. Similarly, let $\rho^2_3(G)$ denote the smallest number of planes in $\mathbb{R}^3$ whose union contains a crossing-free straight-line drawing of $G$. We investigate the complexity of computing these three parameters and obtain the following hardness and algorithmic results. - For $d\in\{2,3\}$, we prove that deciding whether $\rho^1_d(G)\le k$ for a given graph $G$ and integer $k$ is ${\exists\mathbb{R}}$-complete. - Since $\mathrm{NP}\subseteq{\exists\mathbb{R}}$, deciding $\rho^1_d(G)\le k$ is NP-hard for $d\in\{2,3\}$. On the positive side, we show that the problem is fixed-parameter tractable with respect to $k$. - Since ${\exists\mathbb{R}}\subseteq\mathrm{PSPACE}$, both $\rho^1_2(G)$ and $\rho^1_3(G)$ are computable in polynomial space. On the negative side, we show that drawings that are optimal with respect to $\rho^1_2$ or $\rho^1_3$ sometimes require irrational coordinates. - We prove that deciding whether $\rho^2_3(G)\le k$ is NP-hard for any fixed $k \ge 2$. Hence, the problem is not fixed-parameter tractable with respect to $k$ unless $\mathrm{P}=\mathrm{NP}$.

Fig. 1: Two drawings of the same planar 3-tree in 2D and a drawing of K 5 in 3D.In the 3D drawing (c), the four white vertices lie in a common (gray) plane, whereas the black vertex lies above it.
are k pairs of points, determining a set L of k lines, and that there are n points representing the vertices of G such that the segments corresponding to the edges of G lie on the lines in L and do not cross each other.This observation shows that deciding whether or not ρ l d (G) ≤ k reduces in polynomial time to the decision problem (Hilbert's Entscheidungsproblem) for the existential theory of the reals.The problems admitting such a reduction form the complexity class ∃R introduced by Schaefer [38], whose importance in computational geometry has been recognized recently [8,26,39].In the complexity-theoretic hierarchy, this class occupies a position between NP and PSPACE.It possesses natural complete problems like the decision version of the rectilinear crossing number [5] and the recognition of segment intersection graphs [25], unit disk graphs [23], and point visibility graphs [9].Related questions deal with the realizability of abstract simplicial complexes [28,27,1], polyhedral complexes [2], graphs, and hypergraphs [18] in three and higher dimensions.
Below, we summarize our results on the computational complexity of the affine cover numbers.
The complexity of the line cover numbers in 2D and 3D.We begin by showing that it is ∃R-hard to compute, for a given graph G, its line cover numbers ρ 1 2 (G) and ρ 1 3 (G); see Section 2. Our proof uses some ingredients from a paper of Durocher et al. [15] who showed that it is NP-hard to compute the segment number seg(G) of a graph G.This parameter was introduced by Dujmović et al. [12] as a measure of the visual complexity of a planar graph.A segment in a straight-line drawing of a graph G is an inclusion-maximal connected path of edges of G lying on a line, and the segment number seg(G) of a planar graph G is the minimum number of segments in a straight-line drawing of G in the plane.Note that while ρ 1 2 (G) ≤ seg(G), the two parameters can be far apart as demonstrated, for instance, by a graph with m isolated edges.For connected graphs, we have shown in previous work [11] that seg(G) ∈ O(ρ 1 2 (G) 2 ) and that this bound is optimal as there exist planar triangulations with ρ 1 2 (G) ∈ O( √ n) and seg(G) ∈ Ω(n).Despite this difference, we follow Durocher et al. [15] to some extent in that we also reduce from Arrangement Graph Recognition (see Theorem 1).
Another noteworthy related result is the ∃R-hardness of computing the slope number slope(G) of a planar graph G, which has recently been established by Hoffmann [22].The value of slope(G) is equal to the minimum possible number of slopes in a straight-line drawing of G.It should be noted that, whereas ρ 1 2 (G) ≥ slope(G), the two parameters are generally unrelated.For example, if G is a nested-triangle graph, then the former parameter is linear while the latter is bounded by a constant.
Parameterized complexity of computing the line cover numbers in 2D and 3D.It follows from the inclusion NP ⊆ ∃R that the decision problems "ρ 1 2 (G) ≤ k?" and "ρ 1 3 (G) ≤ k?" are NP-hard if k is given as a part of the input.On the positive side, in Section 3, we show that both problems are fixed-parameter tractable (FPT).To this end, we first describe a lineartime kernelization procedure that reduces the given graph to one of size O(k 4 ).Then, in k O(k 2 ) time, we carefully solve the problem on this reduced instance by using the exponential-time decision procedure for the existential theory of the reals by Renegar [35,36,37] (see Theorem 4 in Section 2) as a subroutine.To the best of our knowledge, this is the first application of Renegar's algorithm for obtaining an FPT result, in particular, in the area of graph drawing where FPT algorithms are widely known.For comparison note that, for every fixed k, the decision problem "slope(G) ≤ k?" is in NP [22].

Realizability of ρ 1
d -optimal drawings.Since ∃R belongs to PSPACE (as shown by Canny [7]), the parameters ρ 1 d (G) for both d = 2 and 3 are computable in polynomial space.We show, however, that constructing a ρ 1  2 -optimal drawing of a given planar graph G can be an unfeasible task by the following reason: there is a planar graph G such that every ρ 1  2 -optimal drawing of G requires irrational coordinates (see Theorem 7).
This result shows that, even if a graph G is known to be drawable on k lines, it may happen that G does not admit a k-line drawing on the integer grid.Nevertheless, in FPT time we are always able to produce a combinatorial description of an optimal drawing (see Theorem 6).
The complexity of the plane cover number.Though the decision problem "ρ 2 3 (G) ≤ k?" also belongs to ∃R, its complexity status is different from that of the line cover numbers.In Section 5, we establish the NP-hardness of deciding whether ρ 2 3 (G) ≤ k for any fixed k ≥ 2, which excludes an FPT algorithm for this problem unless P = NP.To show this, we first prove NP-hardness of Positive Planar Cycle 1-in-3-Sat (a new problem of Planar 3-Sat type), which we think is of independent interest.
In subsequent work, Pilz [34] showed that another variant of this type is NP-hard, namely the restriction of Planar 3-Sat to instances where a Hamiltonian cycle can be added to the bipartite variable-clause graph without violating planarity.While in his case, the cycle goes through all clause vertices and then through all variable vertices, our restriction only asks for a cycle through all clause vertices.On the other hand, Pilz showed that his variant remains NP-hard for the Monotone variant (where no clause may combine negative and positive literals), while we show this for the Positive 1-in-3 variant (where all literals are positive and the task is to decide whether there exists an assignment of truth values to the variables such that exactly one variable in each clause is true).
Weak affine cover numbers.We previously defined the weak affine cover number π l d (G) of a graph G similarly to ρ l d (G) but under the weaker requirement that the l-dimensional planes in R d whose number has to be minimized contain the vertices (and not necessarily the edges) of G [11].Based on our combinatorial characterization of π 1 3 and π 2 3 [11], we show in Section 6 that the decision problem "π l 3 (G) ≤ 2?" is NP-complete for l ∈ {1, 2}.Recently, Erhardt [17] strengthened our result for l = 1.He showed that deciding whether π 1 3 (G) ≤ 2 is NP-hard even if G has maximum degree 5 or if G is planar and has maximum degree 6.For general graphs, his result is tight because Matsumoto [29] has proven that for every graph G ̸ = K 5 of maximum degree 4, it holds that π 1 3 (G) ≤ 2. Erhardt also showed that, for any constant c, the problem of deciding whether π 1 3 (G) ≤ c is FPT parameterized by the treewidth of G. Further, we prove that it is NP-hard to approximate π l 3 (G) within a factor of O(n 1−ϵ ), for any ϵ > 0. Recently, Biedl et al. [4] showed that it is NP-complete to decide whether π 1 2 (G) = 2 for a given planar graph G. Firman et al. [20] gave formulations of the problem as an integer linear program and as an instance of Boolean satisfiability and compared them on test data; they also examined the drawability of several special graphs.
Given a graph G, we write V (G) for its vertex set and E(G) for its edge set.For any dimension d > 1 and two points x and y in R d , we write [x, y] for the line segment that connects x and y, and we write xy for the line that goes through x and y.

Computational Hardness of the Line Cover Numbers
In this section, we show that, for a given graph G and an integer k, the decision problems "ρ 1 2 (G) ≤ k?" and "ρ 1 3 (G) ≤ k?" are ∃R-complete.The ∃R-hardness results are often established by a reduction from the Pseudoline Stretchability problem: Given an arrangement of pseudolines in the projective plane, decide whether it is stretchable, that is, equivalent to an arrangement of lines [30,31].Our reduction is based on an argument of Durocher et al. [15] who designed a reduction of the Arrangement Graph Recognition problem, defined below, to the problem of computing the segment number of a graph.
A simple line arrangement is a set L of k lines in R 2 such that each pair of lines crosses each other in a point, their crossing point, and no three lines share a common point.In the following, we assume that every line arrangement is simple.We define the arrangement graph for a (simple) line arrangement as follows [6] (see Fig. 2a): The vertices correspond to the crossing points of the lines and two vertices are adjacent in the graph if and only if they are adjacent along some line.Note that the arrangement graph for a simple line arrangement consisting of k lines has k 2 = k(k − 1)/2 vertices and k(k − 2) edges (the latter because each of the k lines hosts k − 2 edges between k − 1 crossing points).The Arrangement Graph Recognition problem is to decide whether a given graph is the arrangement graph of some line arrangement.
Bose et al. [6] showed that this problem is NP-hard by reduction from a version of Pseudoline  Stretchability for the Euclidean plane, whose NP-hardness was proved by Shor [41].It turns out that Arrangement Graph Recognition is actually an ∃R-complete problem [16, page 212].This stronger statement follows from the fact that the Euclidean Pseudoline Stretchability is ∃R-hard as well as the original projective version [26,38].
Theorem 1 Given any planar graph G and any integer k, the decision problems "ρ 1 2 (G) ≤ k?" and "ρ 1 3 (G) ≤ k?" are ∃R-hard.Proof: We first treat the 2D case.We show hardness by reduction from Arrangement Graph Recognition.Let G be an instance of this problem consisting of more than one vertex; otherwise we accept.Here and below, by acceptance (resp.rejection) we mean mapping an instance of Arrangement Graph Recognition to a fixed yes-instance (resp.no-instance) of the decision problem "ρ 1 2 (G) ≤ k?".If G is an arrangement graph, then there must be an integer ℓ ≥ 3 such that G consists of ℓ(ℓ − 1)/2 vertices and ℓ(ℓ − 2) edges, and each of its vertices has degree 2, 3, or 4. So, we first check these simple conditions to determine ℓ and reject G if one of them fails.Let G ′ be the graph obtained from G by adding one tail (that is, an edge to a new degree-1 vertex) to each degree-3 vertex and two tails to each degree-2 vertex, see Fig. 2b.Thus, every vertex of G ′ has degree 1 or 4. Note that, if G is an arrangement graph, then there are exactly 2ℓ tails in G ′ (two for each line) -if this is not true we can already safely reject G.We now pick k = ℓ, and show that G is an arrangement graph if and only if ρ 1 2 (G ′ ) ≤ k.For one direction, assume that G is an arrangement graph.By our choice of k, it is clear that G corresponds to a line arrangement of k lines.Note that all edges of G lie on these k lines and the tails of G ′ can be added without increasing the number of lines.Hence, 2 degree-4 vertices (which are exactly the vertices in V (G)).As each of these vertices lies on the crossing point of two lines in L, we need k lines to get enough crossing points, that is, |L| = k, every two lines in L cross each other, and no three lines in L cross in the same point.Thus, L is a simple line arrangement.Let A L be the geometric realization of the arrangement graph of L, that is, V (A L ) consists of the k 2 crossing points of lines in L. The mapping γ is a bijection from V (G) to V (A L ), and it suffices to show that γ is an isomorphism from G to A L .Indeed, let u and v be vertices that are adjacent in G. Since γ ′ is a straight-line drawing of G ′ on L, the line segment [γ(u), γ(v)] is a segment between two crossing points on a line in L. This segment does not contain any other crossing point because any such point would be the image γ(w) of some vertex w ̸ ∈ {u, v} of G (which would contradict u and v being adjacent in G).It follows that γ(u) and γ(v) are adjacent in A L .Since G and A L have the same number k(k − 2) of edges, γ is an isomorphism.Now we turn to 3D.Let G be a planar graph (that passed all our initial rejection tests) and let G ′ be the corresponding graph augmented as above.We show that ρ ) is also ∃R-hard.For the first direction, if G ′ cannot be drawn on k lines in 3-space, then clearly it neither can in 2-space.For the second direction, assume that G ′ can be drawn on k or fewer lines in 3-space.Since G ′ has k 2 vertices of degree 4, each of them must be a crossing point of two lines.It follows that we have exactly k lines and that each of the k lines crosses all the others.Fix any two of the lines and consider the plane that they determine.Then all k lines must lie in this plane, which shows that also ρ 1 2 (G ′ ) ≤ k. □ It remains to notice that the decision problems under consideration lie in the complexity class ∃R.To this end, we transform the inequalities ρ l d (G) ≤ k into first-order existential expressions about the reals.More precisely, we call a first-order formula existential if it is written in prenex normal form, that is, as a prefix of quantifiers applied to a quantifier-free part, and the prefix consists only of existential quantifiers.Though this transformation is direct and elementary, we give some details in the proof of the following lemma, as they are relevant also to the proof of Theorem 6 in Section 3.
Lemma 1 Given any graph G with at least one edge and any positive integer k, the following decision problems belong to the complexity class ∃R: Proof: We have to express the conditions ρ l d (G) ≤ k in the formalism of the existential theory of the reals.This can be done rather straightforwardly applying elementary tools of Cartesian geometry.We provide the necessary details for the parameter ρ 1 2 (G) and sketch how these arguments need to be modified for the other two parameters.
Moreover, χ(a, b, c) = 0 if and only if the points a, b, and c are collinear, including the case that some of them coincide.Furthermore, the point a lies on the line segment [b, c] if and only if the following relation is fulfilled: We assume that the given graph G has the vertex set {1, . . ., n}, and we let E denote the edge set of G.We have to express the fact that there are n pairwise distinct points v 1 , . . ., v n lying on k lines ℓ 1 , . . ., ℓ k that determine a straight-line drawing of the graph G.Each ℓ i can be represented by a pair of points p i and q i lying on this line.Our existential statement about the reals begins, therefore, with the quantifier prefix ∃v 1 . . .∃v n ∃p 1 ∃q 1 . . .∃p k ∃q k , where quantification ∃a over a point a = (x, y) means the quantifier block ∃x∃y.Given this prefix of quantifiers, we use the following subformula to express that every edge of G lies on one of the k lines: where a ̸ = b for points a = (x 1 , y 1 ) and b = (x 2 , y 2 ) is an abbreviation for It remains to ensure that there are no edge crossings.To this end, we simply write This finishes our description of an existential first-order sentence about the reals that encodes the condition ρ 1 2 (G) ≤ k.In this sentence, each polynomial has total degree at most 4 and each variable has an integer coefficient whose absolute value is bounded by 2.
In order to encode "ρ 1 3 (G) ≤ k" or "ρ 2 3 (G) ≤ k", the polynomials will have slightly larger total degree and the variables will have coefficients with slightly larger absolute values.An obvious difference to the case of ρ 1 2 (G) that we treated above is that now we need three real coordinates to represent a point and four coefficients u 1 , . . ., u 4 to specify a plane by its canonical equation The condition that a point (x 1 , x 2 , x 3 ) lies on this plane can be expressed by plugging its coordinates into the plane's equation.
Finally, the condition that two line segments in 3D space do not intersect can be expressed either by using the fact that the orientation of a triple of vectors with a common origin is determined by the determinant of the matrix of their coordinates (allowing a simple reduction to the 2D case) or by using an explicit arithmetic formula for the crossing point of two lines; see, for example, [21,Section V.3].□ The proof of Lemma 1 implies the following.Recall that a first-order sentence is a formula in first-order logic where no free variables occur.(1,3), (2, 3)}.Given any graph G with n vertices and m ≥ 1 edges, and any positive integer k, we can construct, in time O(n 2 + m 2 ), an existential first-order sentence Φ G,k about the reals such that total degree and with integer coefficients of constant absolute value, and Note that the constant hidden in the big-O notation does not depend on k because, if k ≥ m, we can directly set Φ G,k to true since in this case we can easily cover m edges with k lines or planes.The same applies to the time bound in Theorem 3 below.

Fixed-Parameter Tractability of the Line Cover Numbers
In this section, we show that, for a graph G with m ≥ 1 edges and a positive integer k, the decision problems "ρ 1 2 (G) ≤ k?" and "ρ 1 3 (G) ≤ k?" can both be solved in FPT time parameterized by k.
(The cases k = 0 and m = 0 are not interesting.)Given a graph G and a drawing Γ of G, we define L Γ to be the arrangement of the supporting lines of the line segments in Γ.In contrast to Section 2, we now consider line arrangements in R 2 and in R 3 that are not necessarily simple, that is, crossings of more than two lines in a point are allowed.
We also call L Γ a line cover of G; for this to be true, we move any isolated vertices onto distinct points of some line in L Γ , avoiding other vertices and edges of Γ.
Our FPT algorithm follows from a simple kernelization/pre-processing procedure in which we reduce a given instance (G, k) to a reduced instance (H, k) where H has O(k 4 ) vertices and edges, and G has a k-line drawing if and only if H does as well.After this reduction, we can apply any decision procedure for the existential theory of the reals since we have shown in Lemma 1 that the two k-line drawing problems are indeed members of this complexity class.Our kernelization approach is given as Theorem 3 and our FPT result follows as described in Corollary 5.
Theorem 3 For d ∈ {2, 3}, given any graph G with n vertices and m ≥ 1 edges, and any positive integer k, the decision problem "ρ 1 d (G) ≤ k?" admits a kernel of size O(k 4 ).Specifically, in O(n + m) time one can compute a graph H with at most 1.1k 4 vertices and at most 2k 4 edges such that Proof: For our kernel of G, we construct a graph H with O(k 4 ) many vertices and edges such that Our idea is based on the observation that, in any drawing Γ of G, the total number of bends in "long" paths of degree-2 vertices is naturally bounded by the number of crossing points of the underlying line cover L Γ .This fact allows us to sufficiently shrink long subpaths of degree-2 vertices without changing the drawability of the graph.
We compute our kernel in two steps.First, we remove from G all path components.In each of the remaining connected components, we shrink every path consisting only of vertices of degree at most 2 down to length k 2 by performing sufficiently many edge contractions.We can do this modification in time O(n + m) by using, e.g., breadth-first search to first measure the length of such paths and then to shrink them.Let G ′ be the resulting graph.Second, if G ′ has at most 1.1k 4 vertices and at most 2k 4 edges, we set H = G ′ ; otherwise we set H = K 1,2k+1 (which we use as a fixed no-instance of small size).Thus, the size of H is as required.
To see that H is a kernel, first observe that if G is drawable on k lines, then G ′ is drawable in the same way since every shrunken path has enough vertices to map to positions where the drawing of the original path makes bends; note that bends can happen only at crossing points and that their number is bounded by k 2 .On the other hand, if G ′ is drawable on k lines, then also G has a k-line drawing that we can obtain by appropriately subdividing shrunken paths in the k-line drawing of G ′ and by placing any path components on a single line such that they do not interfere with the drawings of the other components.
Moreover, if G ′ is drawable on k lines, then also H is -as then the size of G ′ is less than 4k 4 , which implies H = G ′ .To see the bound on the size, first observe that the number of vertices of degree larger than 2 is naturally bounded by k 2 , our upper bound on the number of crossing points.All remaining vertices, whose degree is at most 2, form edge-disjoint cycles and (maximal) paths.By our construction, the length of each such cycle or path is bounded by k 2 .Each of the cycles visits at least three crossing points; thus, the number of cycles is at most k 2 /3.Each of the paths is adjacent to at least one vertex of degree larger than 2 (otherwise it is a path component, but we have already removed them); thus, the number of paths is bounded by the total degree of the higher-degree vertices.Since the higher-degree vertices have to lie on crossing points and each line contains at most k − 1 higher-degree vertices, their total degree is at most k • 2(k − 1).In summary, the total number of vertices of G ′ is at most Finally, if H is drawable on k lines, then H = G ′ as K 1,2k+1 cannot be drawn on k lines.Thus, G ′ and, consequently, G are also drawable on k lines.This yields, as required, that Note that, for computing the plane cover number ρ 2 3 , we cannot get a polynomial kernel (assuming P ̸ = NP) as we show that it is NP-hard to decide, for a given graph G, whether ρ 2 3 (G) = 2 (see Theorem 10).
Let G be a graph of n vertices and m edges, and let H be a kernel of size O(k 4 ) as obtained by Theorem 3 from G in time O(n + m).By Corollary 2, the statement ρ 1 d (H) ≤ k can be expressed by a statement Φ in the existential first-order theory of the reals using O(k 4 ) first-order variables and k O(1) polynomial inequalities, each of constant total degree and with coefficients of constant absolute value.Furthermore, such a statement Φ can be computed in time k O (1) .If we directly apply the following decision procedure of Renegar to Φ, we obtain an algorithm for deciding for the original graph G whether ρ 1 d (G) ≤ k.
Theorem 4 (Renegar [35,36,37]) Given any existential sentence Φ about the reals, one can decide whether Φ is true or false in time where N is the number of variables occurring in Φ, P is the number of polynomials involved in Φ, D is the maximum total degree over the polynomials in Φ, and L is the maximum length of the binary representation over the coefficients of the polynomials in Φ. Proof: First, we apply to the given graph G the kernelization procedure from Theorem 3 to obtain a reduced graph H.By Theorem 3, H has at most 1.1k 4 vertices.At most k 2 of these vertices are mapped to crossing points of the lines.Hence we enumerate all possible 1.1k 4 ( k 2 ) ∈ k O(k 2 ) subsets that can be mapped to crossing points.Such a subset must contain all vertices of degree more than 2. The paths consisting of degree-2 vertices not in the subset are contracted.For each of these subsets, we test whether this further reduced instance has a k-line drawing using Renegar's decision algorithm.Since this reduces the number of vertices and, hence, the number of first-order variables to O(k 2 ), Theorem 4 ensures a total running time of k O(k 2 ) + O(n + m) as required.□ Corollary 5 says that we can decide in FPT time whether or not a graph G has a k-line drawing.However, this does not mean that, if such a drawing exists, we can construct it efficiently as well.In fact, there is a graph such that every ρ 1 2 -optimal drawing of this graph has a vertex with an irrational coordinate; see Section 4. Nevertheless, we are able to obtain a combinatorial description of a k-line drawing in FPT time whenever one exists.We now define this concept.
First, we need an additional variant of an arrangement graph.Let L be an arrangement of k distinct lines in R d .Without loss of generality, we can assume that there is no isolated line, that is, every line in L is crossed by at least one other line in L. Note that we do not assume that every point is contained in at most two lines.The augmented arrangement graph A L has crossing points of lines in L as vertices, and two such points are adjacent in A L if they are neighboring on a line in L.Moreover, the two tails, that is, the rays not containing crossing points, of each line in L are represented in A L by vertices of degree 1 adjacent to the crossing points from which the tails emanate.The graph A L is endowed in a natural way with a path factorization by which we mean a partition of the edge set of A L into k paths such that every two paths have at most one common vertex.
Let Γ be a drawing of a graph G on L. If we see A L in a natural way as a topological graph, then any vertex of G in Γ either is placed at a vertex of A L or subdivides an edge of A L .This motivates the following definition.A combinatorial description of a k-line drawing of G consists of • a graph A that is the augmented arrangement graph of an arrangement L of k lines, • the path factorization of A determined by L, • an isomorphism from G to a subgraph of A ′ .Theorem 6 For d ∈ {2, 3}, given any graph G with n vertices and m ≥ 1 edges, and any positive integer k, the decision problem "ρ If the answer is yes, a combinatorial description of a k-line drawing of G in R d can be found within the same time bound.
Proof: We apply Corollary 5.If the answer to the decision algorithm is no, we are done.Otherwise, we can assume that G satisfies some of the necessary properties observed in the proof of Theorem 3.For example, as in the proof of Theorem 3, we can assume that the input graph G has no path components.(If there are path components, we can place them on the "far end" of some line.)For i < n, we denote by V i the set of vertices of a graph G having degree i and by V ≥i the set of vertices of G having degree at least i.Again, following the proof of Theorem 3, a necessary condition for We also assume this condition here.Due to the fact that we have no path components, |V 1 | is bounded by the total degree of the vertices in V ≥3 , which is bounded by 2k 2 as we showed in the proof of Theorem 3. We call a path in the input graph G straight if its end vertices do not have degree 2 whereas all internal vertices have degree 2. Similarly, we call a cycle in G straight if all but one of its vertices have degree 2. (A cycle in G where all vertices have degree 2 is necessarily a component of G.) Note that G contains fewer than 2k 2 straight paths and cycles.(This is due to the fact that each of them "consumes" at least one unit from the sum of the vertex degrees of the augmented arrangement graph A L of a k-line arrangement L, which has at most k 2 edges.)Obviously, all vertices in V ≥3 are located at crossing points of a k-line arrangement L. Let S ⊆ V 2 be the set of degree-2 vertices located at crossing points of L. Clearly, Note also that S must contain at least two vertices of each straight cycle.Any such set S ⊆ V 2 satisfying also condition (2) will be referred to as admissible.Let G S denote the graph obtained from G by smoothing out all vertices in V 2 \S.More precisely, note that each connected component in the subgraph induced by V 2 \ S is a path incident to one or two unique vertices in We obtain G S from G by replacing each of the paths incident to two different vertices in V 1 ∪S ∪V ≥3 by an edge that connects the two vertices.Consider a slightly subdivided version of the augmented arrangement graph A L .Specifically, call an edge pendant if it is incident to a vertex of degree 1.For any subset E of the at most k(k − 1) non-pendant edges of A L , we use B L,E to denote the graph resulting from A L if we subdivide each edge in E by two extra vertices.The new vertices of B L,E correspond to possible locations of vertices from V 1 between two crossing points on a line in L, whereas edges that have not been subdivided correspond to possible edges between vertices in S ∪ V ≥3 .
Note that G is drawable on L if and only if there exists an admissible set S and a subset E of non-pendant edges of A L such that G S is isomorphic to a subgraph of B L,E .Our strategy consists, therefore, of the following steps: • for every admissible subset S of V 2 , generate the subgraph G S of G; • generate every possible, up to isomorphism, graph B L,E along with the path factorization determined by L; • for every pair (G S , B L,E ), check whether B L,E contains a subgraph isomorphic to G S and, if so, compute an isomorphism β from G S to such a subgraph; • subdivide G S back to restore G and extend β to an isomorphism from G to a subdivided version of B L,E ; As we show below, we will eventually find a suitable pair of G S and B L,E using our assumption Generating G S for each admissible set S. Let S and S ′ be two subsets of V 2 .We call them equivalent if each straight path and each straight cycle has equally many vertices in S and in S ′ .Note that, if S and S ′ are equivalent, then G S and G S ′ are isomorphic.
In order to generate representatives of each equivalence class, we first rename the vertices of G.For the vertices in V 1 and V ≥3 we use labels of binary length O(log k); this is possible since both sets have cardinality O(k 2 ) (see inequality (1) and the argument following it).The label of a vertex v of degree 2 consists of the labels assigned to the end vertices of the straight path containing v and the index of v along this path counted in the direction starting from the end vertex with lexicographically smaller label.We do similarly for the vertices along a straight cycle, fixing an orientation of each straight cycle for this purpose.Let K = k 2 .Now, we generate every subset S of V 2 with |S| ≤ K such that the intersection of S with each straight path and cycle is an initial segment of this path or cycle.This is no restriction since only the number of S-vertices in each straight path or cycle matters.The initial segment may be empty for some paths and must contain at least two vertices for every cycle.Let σ denote the number of such subsets of V 2 .Then σ ≤ K+2k 2 K since the right side bounds the number of ways of putting the K elements of V 2 into 2k 2 + 1 containers corresponding to the straight paths and cycles.(We put the elements of V 2 that are not used by S into an extra "dummy" container.)Using the bound a b < (e a/b) b , we get σ < (5 + 4/(k − 1))e K .Assuming k ≥ 2 yields σ < (9e Let F be the set of the graphs G S for every admissible subset S of V 2 .Clearly, |F| = σ < 5 k 2 .Moreover, every graph F in F has at most |V 1 | + |S| + |V ≥3 | ≤ 3k 2 vertices, and each vertex is represented by a binary label of length O(log k).As we observed above, each element G S of F corresponds to a partition of S into at most 2k 2 + 1 containers where each container (except the dummy container) gets an initial segment of the corresponding straight path or cycle.We can hence enumerate the partitions of S with a delay of O(k 2 ): we index the containers with numbers 1, 2, . . ., 2k 2 + 1, and then we go through the partitions of S in lexicographic order, always making sure that each cycle container gets at least two elements.In a preprocessing step, we compute from G (in O(n + m) time) a "frame" so that we can generate G S for each admissible set S in O(k 2 ) time: we simply put the vertices in each container (except for the dummy container) at the appropriate spot of the frame, that is, at the beginning of the corresponding straight path or cycle.Thus, after a preprocessing step taking O(k 2 + n + m) time, we can enumerate F in 5 O(k 2 ) time.
Generating B L,E .In general, a graph H with a specified path factorization is called factorized ; the corresponding paths will be referred to as path factors of H.We call a factorized graph H ′ a pre-template graph if • H ′ has no isolated edge and no vertex of degree 0 or 2; and • every path factor of H ′ is a path between two degree-1 vertices.
A factorized graph H is a template graph if there is a pre-template graph H ′ and a subset E of the non-pendant edges of H ′ such that H is obtained from H ′ by subdividing each edge in E by two new vertices.Each path factor of H ′ is "prolonged" to a path factor of H correspondingly.A factorized graph H is stretchable in R d if there is a drawing of H in R d such that every path factor of H lies on a line and different path factors occupy different lines.
Note that a factorized graph H with k path factors is a template graph that is stretchable in R d if and only if there is a family L of k non-isolated lines in R d and a subset E of non-pendant edges of A L such that H is the slightly subdivided augmented arrangement graph B L,E .In order to generate all such graphs, first consider the family H k of all pre-template graphs with k path factors.Label the path factors by 1, . . ., k.Given H ′ ∈ H k , label each vertex of H ′ with the set of labels of all path factors to which this vertex belongs.For a path factor i, let S i be the sequence of labels of all vertices appearing along that path factor.The list of the sequences S 1 , . . ., S k determines H ′ and allows to reconstruct it up to isomorphism.Now we argue that factorized graphs.To this end, for each sequence S i , we choose a permutation of the other line labels 1, . . ., i − 1, i + 1, . . ., k.Then, between any two consecutive line labels in the chosen permutation, we decide whether to start a new vertex label (which is a set of line labels) or not.The last positive of these k decisions separates the path factors that intersect path factor i from those that do not (that is, path factor i intersects between 1 and k − 1 other path factors).Moreover, each factorized graph in H k has at most 2k + k 2 vertices and k 2 edges.Hence, H k can be generated in time k O(k 2 ) .A template graph H is stretchable if and only if it is obtained from a stretchable pre-template graph H ′ .By Corollary 2, the statement saying that a given factorized graph H ′ ∈ H k is stretchable can be written in O(k 4 ) time as a sentence Φ H ′ in the existential first-order theory of the reals.Moreover, Φ H ′ uses O(k 2 ) first-order variables and involves O(k 4 ) polynomial inequalities of bounded degree with bounded coefficients.Hence the algorithm of Renegar takes time k O(k 2 ) to check whether Φ H ′ is valid; see Theorem 4. Thus, all stretchable pre-template graphs with k path factors can be generated in time . From each pre-template graph, we generate up to 2 k 2 template graphs, one for each possible subset of non-pendant edges.Consequently, all stretchable template graphs with k path factors and, hence, all slightly subdivided augmented arrangement graphs of k-line families in R d can be generated in time Isomorphism.Let S be any admissible set for G, let L be any family of k non-isolated lines in R d , and let E be any subset of non-pendant edges of A L .Recall that |V (G S )| < 3k 2 and note that also |V (B L,E )| < 3k 2 .Thus, by trial of all injections from V (G S ) to V (B L,E ), we can check in time k O(k 2 ) whether there exists an isomorphism β from G S to a subgraph of B L,E .If it exists, we can extend β to an isomorphism from G to a subgraph of a subdivision of B L,E using O(n + m) additional time.Indeed, we just have to restore the vertices in V 2 \ S that we removed from G, along with the incident edges, and subdivide B L,E correspondingly.In other words, for each straight path or cycle, we have to restore the final segment that was not included in F .Let P be a straight path, let w be the lexicographically larger end vertex of P , and, among the vertices of P that were included in F , let u be the neighbor of w in F .All what we have to do is to subdivide uw by the vertices that were removed from P .We treat the straight cycles similarly.Lastly, we restore the original vertex names of G from the respective vertex labels.
Overall time estimation.As we have seen, the set F (containing G S for every admissible set S) can be enumerated in time 5 O(k 2 ) time after a preprocessing step requiring O(k 2 + n + m) time.We have also seen that the set of all slightly subdivided augmented arrangement graphs of all families of k non-isolated lines in R d can be enumerated in k O(k 2 ) time.Thus, in time k O(k 2 ) + O(n + m), we can generate the set that, for every admissible set S, every family L of k non-isolated lines in R d , and every subset E of non-pendant edges of A L , contains the pair (G S , B L,E ).As discussed above, in time k O(k 2 ) we can check whether there is an isomorphism from G S to a subgraph of B L,E , and, if it exists, we can further extend it in time O(n + m) to an isomorphism from G to a subdivision of that subgraph.This results in an overall running time of k O(k 2 ) + O(n + m).□ 4 Rational (Non-) Realizability of ρ 1 2 -Optimal Drawings In this section, we show that there are graphs all of whose ρ 1 2 -optimal drawings require a vertex to be mapped to a point with an irrational coordinate; therefore such a drawing does not fit on any integer grid.
A collinearity configuration is a set V of abstract points along with a family of 3-element subsets of V called collinear triples.A realization of the collinearity configuration is an injective mapping α : V → R 2 such that any three abstract points a, b, and c form a collinear triple if and only if the points α(a), α(b), and α(c) are collinear.The Perles configuration is a collinearity configuration of 9 points whose realization is shown in Fig. 3a.It is known that every realization of the Perles configuration contains a point with an irrational coordinate [3, page 23].
Theorem 7 There exists a graph G such that every drawing Γ realizing ρ 1 2 (G) contains a vertex with an irrational coordinate.
Proof: Consider the graph G whose drawing is shown in Fig. 3b.Let r = ρ 1 2 (G) and note that r ≤ 10 as the drawing of G in Fig. 3b occupies 10 lines.
Let Γ be a drawing of G realizing r.By the detailed analysis below we will show that Γ has the same configuration as the drawing in Fig. 3b, that is, any three vertices are collinear in Γ if and JGAA, 27(6) 459-488 (2023) 473  Classify the vertices of G into three classes according to their degrees: one big vertex b of degree 10, ten medium vertices of degree 5 or 4, and five small vertices of degree 3. Let m 1 , . . ., m 10 = m 0 be the medium vertices enumerated as they appear along the pentagon in Fig. 3b.They form a cycle of length 10, which we denote by C.
For convenience we shall sometimes identify the vertices or edges of the graph G with their images in the drawing Γ.
For every two consecutive medium vertices m i and m i+1 , we claim that there is no medium vertex m j such that the open segment (m i , m i+1 ) intersects the ray bm j .Indeed, assume the contrary.Since the points b, m i , and m i+1 are the vertices of a triangular face, they cannot be collinear, so the ray bm j intersects (m i , m i+1 ) at a single point, which we denote by m ′ j .Since the drawing Γ is crossing free, the point m j is closer to the point b than the point m ′ j .Therefore, the triangle △bm i m i+1 contains the point m j in its interior.Since Γ is crossing-free, all the remaining vertices of C also lie in the interior of △bm i m i+1 .It follows that the ten lines bm 1 , bm 2 , . . ., bm 10 are pairwise different, and each of them is different from the line m i m i+1 .So we need at least 11 lines to cover Γ; a contradiction.Thus, the medium vertices appear in Γ around the point b in their innate cyclic order along C. In particular, the point b belongs to the part B of the plane bounded by C, and the segments [b, m i ], 1 ≤ i ≤ 10, partition B into ten triangles △bm 0 m 1 , △bm 1 m 2 , . . ., △bm 9 m 10 .It follows that, for each line ℓ passing through the point b, the intersection ℓ ∩ B is a segment.

Claim 1. All small vertices lie outside B.
Proof of Claim 1. Assume that a small vertex s is drawn in B. Then s is contained inside of a triangle △bm i m i+1 for some i.However, in this case s can be adjacent only to m i and m i+1 , and to no third medium vertex; a contradiction.◁ A cover L of Γ by r lines consists of the following three families.
• L b , consisting of the lines in L covering an edge bm i for some 1 ≤ i ≤ 10. • L s = L \ (L b ∪ L m ).We set r s = |L s | and call the lines in L s special.An edge of G that is not covered by any line in L b ∪ L m will be called special, too.Thus, a special edge has to be covered by a special line.Note also that every special edge connects a small and a medium vertex.Proof of Claim 5. Suppose for a contradiction that r m = 3.Then Claim 3 implies r C = 3, and the family L m consists of the three lines containing the sides of Ĉ.If a small vertex s belongs to two lines from the family L m , then s coincides with one of the corners of Ĉ, which is impossible.Therefore, s is covered by at most one line from L m .By Claim 4, this line can cover at most one edge incident to s.Along with Claim 2 this implies that the family L b ∪ L m covers at most two edges incident to s.Thus, for each small vertex s, there exists at least one edge incident to s that has to be covered by a special line; let e(s) be one such edge.Since we have r s ≤ 2 special lines covering five special edges e(s), there exists a special line ℓ containing at least three of these edges, say e(s 1 ), e(s 2 ), and e(s 3 ).The three points s 1 , s 2 , and s 3 split the line ℓ into four parts ℓ 1 , ℓ 2 , ℓ 3 , ℓ 4 .Since the triangle B is a convex set that, by Claim 1, contains no small vertex, it can intersect only one of these parts, say ℓ j .The part ℓ j has one or two endpoints, say, s 1 , or s 1 and s 2 .Then the edge e(s 3 ), connecting s 3 with C along ℓ, must contain one of the vertices s 1 and s 2 , a contradiction.◁ Claim 6. r m > 4.
Proof of Claim 6. Suppose for a contradiction that r m = 4. Then by Claim 3 r C = 4 and the family L m consists of the four lines containing the four sides of quadrilateral Ĉ.
First, assume that Ĉ is nonconvex.Note that B contains all crossing points of the lines from L m .So each small vertex s can be covered by at most one line from L m .Recall that, by Claim 4, such a line can cover at most one edge incident to s. Together with Claim 2 this implies that the family L b ∪ L m covers at most two edges incident to s.Thus, for each small vertex s, there exists an edge e(s) incident to s that has to be covered by a special line.Since r s ≤ r − r b − r m ≤ 1, there is a single special line ℓ, which covers all five special edges e(s).The five small points split ℓ into six parts.The quadrilateral B consists of two triangles, that contain no small vertices by Claim 1.It follows that B can intersect at most two of the six parts of ℓ.These two parts have at most four endpoints, and hence there is a small vertex s ′ different from them.Since the edge e(s ′ ) contains no small vertex except s ′ and, in particular, no endpoint of the two intersected parts, it cannot reach a medium vertex on Ĉ along ℓ; a contradiction.Now assume that Ĉ is convex.The four lines from the family L m (which are the straight-line extensions of the sides of B) have at most 4  2 = 6 crossing points.Four of them are vertices of B. Therefore, at most two small vertices can be crossing points of two lines from L m .Let s 1 , s 2 , and s 3 be the three remaining small vertices.Thus, each s i can be covered by at most one line from L m , which, by Claim 4, covers at most one edge incident to s i .Applying Claim 2, we have that the family L b ∪ L m covers at most two edges incident to s i .Thus, for each i = 1, 2, 3, there exists an edge e(s i ) incident to s i that has to be covered by a special line.Since there is a single special line ℓ, it covers all three special edges e(s i ).The three points s 1 , s 2 , and s 3 split ℓ into four parts ℓ 1 , ℓ 2 , ℓ 3 , ℓ 4 .Since B is a convex quadrilateral that contains no small vertex (by Claim 1), B can intersect only one of these parts, say ℓ j .One of the three small vertices, say s 1 , is different from any endpoint of ℓ j .The edge e(s 1 ) cannot reach Ĉ along ℓ without crossing another small vertex, which is an endpoint of ℓ j ; a contradiction.◁ Therefore, r m = 5.Thus, r s = 0, L s = ∅, and the drawing Γ is covered by L b ∪ L m .Since each small vertex s has degree 3, this vertex is the crossing point of at least two lines of L in the drawing Γ.We say a vertex s is proper if two of these lines are in L m and improper, otherwise.
In the latter case, by Claim 2, s is a crossing point of exactly two lines of L, namely, of a line ℓ ∈ L m and a line ℓ ′ ∈ L b , where ℓ covers two edges incident to s and ℓ ′ covers one such edge.Let s be adjacent to the medium vertices m i−1 , m i , and m i+1 .Since triangles △sm i−1 m i and △sm i m i+1 share the edge sm i , we see that the vertices m i−1 , s, and m i+1 lie, in this order, on the line ℓ.Since the point m i lies on ℓ ′ between b and s, it is an interior point of the triangle △bm i−1 m i+1 .That is, s is placed outside the reflex angle of the polygon Ĉ.Since this angle is determined by the triple of vertices m i−1 , m i , and m i+1 , every reflex angle of Ĉ hosts no more than one small vertex.
We claim that Ĉ is a pentagon.To show this, consider L m as a set of vertices of an auxiliary graph such that lines ℓ and ℓ ′ of L m are adjacent if and only if the crossing point of ℓ and ℓ ′ is a vertex of Ĉ. Going along the boundary of Ĉ, and listing the lines of L m covering passed edges, we construct an Eulerian cycle in L m .Since each vertex of the auxiliary graph has degree at least two and at most four, it is easy to check that the auxiliary graph is Eulerian if and only if the multiset of degrees of vertices of the graph L m is one of the following: {2, 2, 2, 2, 2}, {4, 2, 2, 2, 2}, {4, 4, 2, 2, 2}, or {4, 4, 4, 4, 4}.In the first case, Ĉ is a pentagon.We shall show that the other cases are impossible.
• Case {4, 2, 2, 2, 2}.In this case Ĉ is a hexagon and there is one line in L m , covering two sides of Ĉ, and four lines, covering one side of Ĉ.So it is easy to study all possible shapes for Ĉ, see Fig. 4. It is easy to check that each of the shapes have at most two reflex angles (for placing an improper vertex) and that in each of the shapes there are at most two crossing points of two lines of L m outside Ĉ, so at most two proper vertices can be drawn.As there are five small vertices, we get a contradiction.
• Case {4, 4, 2, 2, 2}.In this case Ĉ is a heptagon and there are two (necessarily intersecting) lines in L m , covering two sides of Ĉ, and three lines, each covering one side of Ĉ.So it is easy to study all possible shapes for Ĉ, see Fig. 5.It is easy to check that each of the shapes has at most three reflex angles (for placing an improper vertex) and that in each of the shapes there is at most one crossing point of two lines of L m outside Ĉ, so at most one proper vertex can be drawn.As there are five small vertices, we get a contradiction.
• Case {4, 4, 4, 4, 4}.In this case Ĉ is a decagon.For each line ℓ ∈ L m , the endpoints of sides of Ĉ covered by ℓ are its crossing points with the other lines of L m .Since there are at most four such points, Ĉ can be a decagon only if each line ℓ ∈ L m intersects all other lines of L m and all its crossing points are endpoints of two sides of Ĉ.Since each improper vertex belonging to ℓ is adjacent to the endpoints of such distinct sides, ℓ covers at most one improper vertex s.By the properties of an improper vertex, ℓ covers two edges incident to s.
Let s be adjacent to the medium vertices m i−1 , m i , and m i+1 .Then the vertices m i−1 , s, and m i+1 lie, in this order, on a line ℓ.Note that the angle ∠m i at m i in the decagon Ĉ is reflex.Thus, s contributes to the sum of angles of Ĉ.Since each crossing point among the lines of L m is an endpoint of a side of the decagon Ĉ, there remain no free crossing points to place proper vertices, so all small vertices are improper.Each of them contributes more than 2π to the sum of angles of the decagon, which equals 8π; a contradiction.
That is, Ĉ is a pentagon.We claim that B is convex.Suppose for a contradiction that B is nonconvex.Then Ĉ has one or two reflex angles.Let A be any of them.Each of the two lines of L m covering the sides of A has at most one crossing point with other lines of L m outside B. It follows that at most three crossing points of lines of L m are outside B. Therefore at least two small vertices are improper.Let s be one of them and s ∈ ℓ ∈ L m .Let m i−1 and m i+1 be neighbors of s placed on ℓ.It is easy to see (for instance, in Fig. 6) that we transform Ĉ into a triangle if we JGAA, 27 (6)  Thus, B is a convex pentagon.Since an improper small vertex has to be placed outside a reflex angle of Ĉ, every small vertex is proper.Therefore, each such vertex is placed at the crossing point of two lines from L m , which extend two non-adjacent sides of Ĉ.Since Ĉ is a pentagon, it has has exactly five pairs of non-adjacent sides.Therefore, the extensions of the sides in each pair intersect and, moreover, the crossing point lies outside B by Claim 1.Since B is a convex pentagon, no three lines from L m can have a common point.Therefore, it is impossible that each edge incident to a small vertex s is covered by its own line in L m .Since B is convex, similarly to the proof of Claim 2 we can show that each line from L m covers at most one edge incident to s.It follows that each small vertex s is the crossing point of exactly two lines from L m and exactly one line in L b , which we denote by ℓ s .
The equality r m = 5 implies that r b = 5 (and, hence, r = 10).Since each of the five lines in L b can intersect Ĉ in at most two points and there are 10 medium vertices, each ℓ ∈ L b intersects Ĉ in exactly two points, representing two medium vertices m(ℓ) and m ′ (ℓ).
The convexity of B also implies that this pentagon is contained in the angle created by the extensions of any pair of its non-adjacent sides.Therefore, each side l of B is contained in the triangle T created by the line extending l and the two non-adjacent sides of B. Thus, for each side l ′ of B adjacent to l, the triangle T ′ cut from T by l ′ shares with B only the side l ′ .Let s be the vertex of T ′ opposite to its side l ′ .Note that s is a small vertex.The line ℓ s ∈ L b crosses the boundary Ĉ of B at the points m(ℓ s ) and m ′ (ℓ s ), and one of these points must be an inner point of l ′ .Thus, every side of B contains a medium vertex as an inner point.Also, the five corners of Ĉ must be medium vertices.It readily follows that, for each ℓ ∈ L b (that crosses b by definition and contains one small vertex each), one of the medium points m(ℓ) and m ′ (ℓ) is a vertex of B and the other one is an inner point of the opposite side of B.
We now see that, as claimed, three vertices of G are collinear in Γ if and only if they are collinear in the drawing in Fig. 3b.□

Computational Complexity of the Plane Cover Number
While the graphs with ρ 2 3 -value 1 are exactly the planar graphs (which can be recognized in polynomial time), recognizing graphs with ρ 2 3 -value k, for any k > 1, immediately becomes NPhard.We prove this via the NP-hardness of a new problem of Planar 3-Sat type, which we think is of independent interest.Definition 8 Let Φ be a Boolean CNF formula where every clause consists of at most three literals.The associated graph (also known as the variable-clause incidence graph) of Φ, G(Φ), has a vertex v x for each variable x in Φ and a vertex v c for each clause c in Φ.There is an edge between a variable-vertex v x and a clause-vertex v c if and only if x or ¬x appears in c.The Boolean formula Φ is called planar if G(Φ) is planar.In the problem Planar 3-Sat, the task is to decide whether a given planar 3-CNF formula has a satisfying truth assignment.
Kratochvíl et al. [24] proved the NP-hardness of Planar Cycle 3-Sat, which is a variant of Planar 3-Sat restricted to instances where G(Φ) can be augmented by a simple cycle C that goes exactly through the clause-vertices such that G(Φ) + C remains planar.In their reduction every clause consists of at least two variables.
Mulzer and Rote [32] proved the NP-hardness of Positive Planar 1-in-3-Sat, another variant of Planar 3-Sat where all literals are positive and the assignment must be such that, in each clause, exactly one of the three variables is true.We combine ideas from the two proofs to show the NP-hardness of the following new problem.

Definition 9
In the Positive Planar Cycle 1-in-3-Sat problem, we are given a collection Φ of clauses each of which consists of exactly three literals and each literal is positive, together with a planar embedding of G(Φ) + C where C is a cycle that goes exactly through all clause-vertices.The problem is to decide whether Φ admits a truth assignment such that exactly one variable in each clause is true.
Proof: It is easy to see that the problem is in NP as it is a constrained version of the NPcomplete Positive Planar 1-in-3-Sat problem.To show NP-hardness we reduce from 3-Sat and use the construction by Kratochvíl et al. [24] to get an equivalent instance of Planar Cycle 3-Sat (represented by a formula Φ) together with a cycle C through the clause-vertices and a planar embedding Γ of the graph G(Φ) + C. Note that we do not reduce directly from Planar Cycle 3-Sat as the input of this problem does not specify a cycle through the clause-vertices-it only promises its existence.Remember that each clause contains at least two variables in the construction of Kratochvíl at al.
In the following, we iteratively replace the clauses in Γ by positive 1-in-3-Sat clauses while maintaining the cycle through these clauses.Hence, we ultimately obtain a Positive Planar Cycle 1-in-3-Sat instance.Our reduction uses some of the gadgets from the proof of Mulzer and Rote [32].We show how to maintain the cycle when inserting these gadgets.Some of the gadgets need to be modified to get the cycle in place, others can be simplified slightly as we do not insist on a rectilinear layout.Recall that, in 1-in-3-Sat, a clause is a triple (a, b, c) which is satisfied if exactly one of the variables a, b, or c is true.Thus, a clause is not a disjunction of its three literals as in 3-Sat.
We consider the interaction between the cycle and the clauses in Γ.In Φ, every clause consists of two or three literals and thus there are two or three faces around a clause in Γ.There are two options for the cycle: (O1) it can "touch" the clause, that is, the incoming and the outgoing edge are drawn in the same face; (O2) it can "pass through" the clause, that is, incoming and outgoing edge are drawn in different faces.where a, b, c, and d are new variables that are only used inside this gadget.It's easy to see that this expression is satisfiable if exactly one of the variables x and y is true [32,Lemma 3.4].A planar drawing of the gadget including the cycle through the clauses is depicted in Fig. 7a.Second, we show how to replace a clause (x ∨ y ∨ z) consisting of three literals.To this end, we use a variant of the gadget of Mulzer and Rote, in which we replaced the equality gadget by two inequalities: As before, the variables a, b, c, d, e, q, r, and u are new variables that are not used outside the gadget.This expression is satisfiable if and only if x ∨ y ∨ z holds [32,Lemma 3.5].Figure 7c shows the gadget with the cycle through the clauses.The four clauses in the inequality gadget can obviously be included on the cycle by a short detour.If x occurs in a clause as a negative literal, we add a new variable that is connected to x by an inequality gadget.For all gadgets that we use in our reduction it is possible to add the clauses of this inequality gadget into the cycle.In summary we constructed a Positive Planar Cycle 1-in-3-Sat instance that is satisfiable if and only if the given 3-Sat formula is satisfiable.Of course, this transformation can be done in polynomial time and hence we showed NP-completeness of the problem. □ We now introduce what we call the intersection line gadget; see Fig. 8.It consists of a K 3,4 in which the vertices in the smaller set of the bipartition-denoted by v 1 , v 2 , and v 3 -are connected by a path.The vertices in the other set are denoted by u 1 , u 2 , u 3 , and u 4 .
Fig. 8: The intersection line gadget and how it is depicted in Fig. 9.
Lemma 3 If a graph containing the intersection line gadget as a subgraph can be embedded on two non-parallel planes, the vertices v 1 , v 2 , and v 3 must be drawn on the intersection line of the two planes while the vertices u 1 , u 2 , u 3 , and u 4 cannot lie on the intersection line.
Proof: Let ℓ be the intersection line of the two planes.For a contradiction, assume that the middle vertex v 2 is not drawn on ℓ, but in another position on plane P .This implies that its whole neighborhood N (v 2 ), which consists of all other vertices of the gadget, has to be placed on P , too.But N (v 2 ) + v 2 is a supergraph of K 3,3 and thus cannot be drawn in one plane.Hence, v 2 has to be drawn on ℓ.Now assume that v 1 lies on P , but not on ℓ.Then, again, its neighborhood -including the vertices u 1 , u 2 , and u 3 -is also drawn on P .At most two of these vertices can be drawn on ℓ because they are all neighbors of v 2 .Therefore, one of them, say u 3 , lies on P without ℓ.As v 3 is a neighbor of u 3 , it is also placed on P .Again we draw a supergraph of K 3,3 on P ; a contradiction.
By applying a symmetric argument to v 3 , we can infer that v 1 , v 2 , and v 3 have to be drawn on ℓ.Since u 1 , u 2 , u 3 , u 4 are adjacent to all of the three vertices, they clearly cannot lie on ℓ. □ Theorem 10 Given any graph G, the decision problem "ρ 2 3 (G) = 2?" is NP-hard.
Proof: We show NP-hardness by reduction from Positive Planar Cycle 1-in-3-Sat which is NP-complete by Lemma 2. Consider an instance of that problem consisting of a formula Φ and a planar combinatorial embedding of G(Φ) + C where C = (c 1 , . . ., c n ) is a cycle through the clause-vertices.This embedding gives us a partition of the vertices that are not part of C: V 1 is the set of vertices in the interior of C, and V 2 is the set of vertices in the exterior of C. Let G ′ be the graph that is obtained from G(Φ) by adding the edges of C, except for the edge {c n , c 1 }.Consider a straight-line drawing Γ of G ′ such that c 1 , . . ., c n lie on a horizontal line that separates the vertices of V 1 from those of V 2 .We can obtain such a drawing, for example, by first computing straight-line drawings of the two subgraphs G c n }] such that the path (c 1 , . . ., c n ) is on the outer face in both drawings, and by then gluing the two drawings together using two appropriate linear transformations.
We build the graph G * (Φ) = (V, E) as follows: Each clause c is represented by a clause gadget that consists of three vertices v 1 c , v 2 c , and v 3 c that are connected by a path.Let x be a variable that occurs in the clauses c i1 , c i2 , . . ., c i l with i 1 < i 2 < • • • < i l .For the variable-clause incidence of the variable x with the clause c k (k ∈ i 1 , . . ., i l ), we add two vertices w x k and v x k that are adjacent to each other.Additionally, we make w x k adjacent to the clause-vertices v 1 c k , v 2 c k , and v 3 c k .Thus, v x k is connected to the three clause-vertices via w x k .Finally, we connect the vertices v x 1 , . . ., v x l such that they form a path that inherits the order c 1 , . . ., c n of the clauses on the cycle C.To each of the vertices v x 1 , . . ., v x l one instance of the intersection line gadget is connected.Finally, we add a blocking caterpillar that consists of the vertices v b 1 , . . ., v b n together with the clause-vertices and connects the clauses in the cyclic order of C. See Fig. 9 for an example of this construction.
We are going to show that the formula Φ has a truth assignment with exactly one true variable in each clause if and only if the graph G * (Φ) can be drawn onto two planes.
First, assume that the formula Φ has a 1-in-3-Sat assignment, that is, an assignment where exactly one variable in each clause is true.Then we can draw it onto two intersecting planes P T , P F in the following way: We place the clause-vertices on the intersection line of the two planes in the order given by the cycle C.This intersection line splits each of the two planes into two half-planes.
On the plane P T we place the variable-vertices that are set to true and the edges connecting them to the clause-vertices; see Fig. 10a.Obviously, we can draw the edges without crossings, because our 1-in-3-Sat instance is planar and each clause is connected to only one variable.We remark that the variables are possibly placed on both half-planes of P T , but we use an embedding where each variable is fixed to only one half-plane.Since the true variables cover only one side of each clause gadget, we can attach the corresponding vertex of the blocking caterpillar to the other side.Note that the path connecting the vertices v b i can cross the intersection line between the clause gadgets because all the edges incident to variable-vertices of one variable stay inside one of the half-planes.
On the plane P F we place the false variables' vertices; see Fig.The variable x is highlighted by a shaded background.The ellipses attached to variable-vertices stand for the intersection line gadget (see Fig. 8).The depicted vertices incident to the gadget correspond to u 1 in Fig. 8; u 2 , u 3 , and u 4 are not shown.If Φ is true, one plane covers the blue variable gadgets and one plane covers the blocking caterpillar (bold black) and the pale red variable gadgets.
variables are on the same side of the cycle C in the given planar embedding Γ, we draw one of the vertices w x i onto the other side.Since we have only two variables per clause, we can draw the edge {v x i , w x i }, which connects the two half-planes, directly alongside the clause gadget without destroying planarity.Clearly, we can add the remaining vertices of the intersection line gadgets without interfering each other.
For the other direction, we assume that we are given a drawing of G * (Φ) on two planes.Obviously, these planes intersect as otherwise the intersection line gadgets contained in G * (Φ) could not be drawn.Lemma 3 shows that the clause-vertices lie on the intersection line of the two planes, while the variable-vertices and the blocking caterpillar cannot lie on the intersection line.The vertices of each variable completely lie on one plane: Since they are connected, one of them had to be placed on the intersection line otherwise to prevent edges running outside of the planes.Similarly the blocking caterpillar is only on one of the planes; we call this plane P T , the other one P F .
To get a 1-in-3-Sat assignment for Φ, we now set the variables that are drawn on P T to true and those on P F to false.Obviously, every clause gadget can have at most one neighbor in each of the four half-planes.Since each clause is adjacent to a vertex of the blocking caterpillar in one of the half-planes of P T , it is connected to at most one variable in P T ; that is, each clause contains at most one true variable.On the other hand, only two variables of the clause can be drawn on P F , so there are at most two false variables in each clause.Together this yields that there is exactly one true variable in each clause and thus we constructed a feasible 1-in-3-Sat assignment for Φ. □ Corollary 11 Given any graph G and any integer k ≥ 2, the decision problem "ρ 2 3 (G) = k?" is NP-hard.
Proof: We extend the approach from Theorem 10 by additional blocking gadgets.We add (k − 2) identical gadgets, each of which blocks one plane.The gadget consists of two new vertices u and v,   For a given variable assignment, we can easily find a drawing: Use k different planes that share one common intersection line.Obviously, we can place each of the new gadgets onto one plane with no additional vertices on them.The variable-vertices are on the remaining two planes as described in Theorem 10.
For the other direction, we first discuss the arrangement of the k planes.They also have to be placed in a way that they share one common intersection line because otherwise the clause gadgets, which are part of a K 3,2k subgraph, could not be drawn.Each of the new blocking gadgets has to use an individual plane.The variable-vertices are forced on the "true" and "false" plane as in Theorem 10. □

(
a) A line arrangement (black lines) with the corresponding arrangement graph G (in green).(b) The modified arrangement graph G ′ (in blue) is obtained from G by adding two leaves on each line.

Fig. 2 :
Fig. 2: A simple line arrangement of four lines (depicted in black) with the corresponding arrangement graph and the modification used in the proof of Theorem 1.
the points a, b, and c are collinear and the sum of the distances from a to b and from a to c does not exceed the distance of b and c.Two line segments [a, b] and [c, d] do not intersect if and only if the points a, b, c, and d satisfy the following relation: D(a, b, c, d) def = χ(a, b, c)χ(a, b, d) > 0 ∨ χ(c, d, a)χ(c, d, b) > 0 ∨ χ(a, b, c) = χ(a, b, d) = 0 ∧ ¬B(a, c, d) ∧ ¬B(b, c, d) ∧ ¬B(c, a, b) ∧ ¬B(d, a, b) , that is, c and d are on the same side of the line ab, or a and b are on the same side of the line cd, or [a, b] and [c, d] are disjoint segments lying on the same line.

Corollary 5
Using Renegar's result, our decision algorithm runs in k O(k 4 ) + O(n + m) time.This already shows that deciding ρ 1 d (G) ≤ k is in FPT.We now reduce the exponent in the running time to O(k 2 ).For d ∈ {2, 3}, given any graph G with n vertices and m ≥ 1 edges, and any positive integer k, the decision problem "ρ 1 d (G) ≤ k?" can be solved in k O(k 2 ) + O(n + m) time, that is, in FPT time parameterized by k.
(a) The Perles configuration has at least one vertex with an irrational coordinate.C (b) The graph G contains the Perles configuration in a ρ 1 2 -optimal drawing.

Fig. 3 :
Fig. 3: The Perles configuration and a supergraph of it.
Set r b = |L b | and note that r b ≥ 5. • L m , consisting of the lines in L covering the cycle C.It is easy to see that L m ⊆ L \ L b and, hence, r m = |L m | ≤ r − r b ≤ 5.

Claim 2 .
If s is a small vertex, then L b covers at most one edge incident to s. Proof of Claim 2. Assume that a line ℓ ∈ L b covers an edge incident to s.Since ℓ passes through the points s and b, ℓ is unique.Recall that the intersection ℓ ∩ B is a segment.By Claim 1, the point s lies outside B. Since s is adjacent only to medium vertices, all lying on C ⊂ B, the line ℓ covers no other edge incident to s. ◁ The cycle C is drawn as a closed polyline Ĉ with 3 ≤ r C ≤ 10 corners.Therefore, 3 ≤ r m ≤ 5 and so r s ≤ r − r b − r m ≤ 2. Claim 3. If r m ≤ 4, then every line in L m covers exactly one side of Ĉ, and r C = r m .Proof of Claim 3. If a line ℓ ∈ L m covers two sides of Ĉ, then each of the four endpoints of these sides need a separate line from L m to cover its incident side not covered by ℓ. ◁ Claim 4. Suppose that r m ≤ 4. If s is a small vertex, then a line ℓ ∈ L m covers at most one edge incident to s. Proof of Claim 4. By Claim 3, r C = r m ≤ 4.This bound implies that the intersection ℓ ∩ B is a segment.If ℓ passes through s, then ℓ can contain at most one of the three medium vertices adjacent to s, because all of them lie on Ĉ whereas s lies outside B by Claim 1. ◁ Claim 5. r m > 3.

Fig. 6 :
Fig. 6: The transformation of the pentagon Ĉ into a triangle.
Gadget of Mulzer and Rote for x ̸ = y.Our gadget for the clause x ∨ y.Gadget of Mulzer and Rote for the clause x ∨ y ∨ z.

Fig. 7 :
Fig. 7: Gadgets for our NP-hardness proof.Variables are represented by circles, clauses by empty boxes.Boxes with inequality sign represent the inequality gadget depicted in (a).The dashed line shows how we weave the cycle through the clauses.There are two variants of the cycle, which differ in only one edge.The cycle either touches (O1) or passes through (O2) the gadget.
Finally, we have to consider clauses that consist of only two literals: x ∨ y.The corresponding construction of Mulzer and Rote did not allow us to add a cycle through the clauses.Therefore, we use a new gadget: (a, b, c) ∧ (x ̸ = b) ∧ (y ̸ = c) We show that the clause in this gadget is satisfiable if and only if x ∨ y holds: If both x and y are false, b and c are true and hence more than one variable in the clause is true.If x and y are true, b and c are false and the clause can be fulfilled by setting a to true.If x and y have distinct truth values, b and c also have distinct truth values and thus the clause can be fulfilled by setting a to false.A drawing of the gadget including the cycle is depicted in Fig. 7b.If some of the literals in the 3-Sat clause are negated, we can simply add a new variable and an inequality gadget.For example, we can transform the clause (¬x ∨ y ∨ z) to (x ̸ = a) ∧ (a ∨ y ∨ z), where a is a new variable.

3 c7Fig. 9 :
Fig.9: Example for the graph G * (Φ) constructed from a Positive Planar Cycle 1-in-3-Sat instance Φ.The clauses are depicted by the black boxes with three vertices inside and denoted by c 1 , . . ., c 7 from left to right.The variables are drawn in pale red (true) and blue (false).The variable x is highlighted by a shaded background.The ellipses attached to variable-vertices stand for the intersection line gadget (see Fig.8).The depicted vertices incident to the gadget correspond to u 1 in Fig.8; u 2 , u 3 , and u 4 are not shown.If Φ is true, one plane covers the blue variable gadgets and one plane covers the blocking caterpillar (bold black) and the pale red variable gadgets.
Plane PT for the instance shown in Fig.9.The true variables are drawn in red.The remaining black vertices and edges form the blocking caterpillar.
Plane PF for the instance shown in Fig.9.The false variables are drawn in blue.At the clause gadget in the middle variable y crosses the intersection line of the two planes.

Fig. 10 :
Fig. 10: The two planes for the instance shown in Fig. 9.The clauses are depicted by the black boxes with three vertices inside.The dashed line is the intersection line between the two planes.At the clause gadget in the middle of the line one of the variables crosses the intersection line of the two planes.The intersection line gadgets are left out in these figures, but can easily placed on the dashed line without interfering.