Inserting One Edge into a Simple Drawing is Hard

A simple drawing D(G) of a graph G is one where each pair of edges share at most one point: either a common endpoint or a proper crossing. An edge e in the complement of G can be inserted into D(G) if there exists a simple drawing of \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$G+e$$\end{document}G+e extending D(G). As a result of Levi’s Enlargement Lemma, if a drawing is rectilinear (pseudolinear), that is, the edges can be extended into an arrangement of lines (pseudolines), then any edge in the complement of G can be inserted. In contrast, we show that it is NP-complete to decide whether one edge can be inserted into a simple drawing. This remains true even if we assume that the drawing is pseudocircular, that is, the edges can be extended to an arrangement of pseudocircles. On the positive side, we show that, given an arrangement of pseudocircles \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathcal {A}$$\end{document}A and a pseudosegment \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sigma $$\end{document}σ, it can be decided in polynomial time whether there exists a pseudocircle \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\Phi _\sigma $$\end{document}Φσ extending \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sigma $$\end{document}σ for which \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathcal {A}\cup \{\Phi _\sigma \}$$\end{document}A∪{Φσ} is again an arrangement of pseudocircles.


Introduction
A simple drawing of a graph G (also known as good drawing or as simple topological graph in the literature) is a drawing D(G) of G in the plane such that every pair of edges shares at most one point that is either a proper crossing or a common endpoint.

Editor in Charge: Csaba D. Tóth
A preliminary version of this work appeared in the proceedings of the 46th International Workshop on Graph-Theoretic Concepts in Computer Science (WG '20).
Extended author information available on the last page of the article In particular, no tangencies between edges are allowed and edges must not contain any vertices in their relative interior. It is commonly assumed that no three edges intersect in the same point; the results in this paper are independent of this assumption. Simple drawings have received a great deal of attention in various areas of graph drawing, for example in connection with two long-standing open problems: the crossing number of the complete graph [37] and Conway's thrackle conjecture [7].
In this work, we study the problem of inserting an edge into a simple drawing of a graph. Given a simple drawing D(G) of a graph G = (V , E) and an edge e of the complement G of G we say that e can be inserted into D(G) if there exists a simple drawing of G = (V , E ∪ {e}) that contains D(G) as a subdrawing.
A pseudoline arrangement is an arrangement of simple biinfinite arcs, called pseudolines, such that every pair of pseudolines intersects in a single point that is a proper crossing. Similarly, an arrangement of pseudocircles is an arrangement of simple closed curves, called pseudocircles, such that every pair of pseudocircles intersects in either zero or two points, where in the latter case, both intersection points are proper crossings. A simple drawing D(G) is called pseudolinear if the drawing of every edge can be extended to a pseudoline such that the extended drawing forms a pseudoline arrangement. Recently, Arroyo et al. showed that one can fully characterize these drawings by forbidden subdrawings and recognize them in polynomial time [3]. Likewise, D(G) is called pseudocircular if the drawing of every edge can be extended to a pseudocircle such that the extended drawing forms an arrangement of pseudocircles.
Pseudoline arrangements were introduced by Levi [32] in 1926 and have since been extensively studied; see for example [21]. One of the most fundamental results on pseudoline arrangements, nowadays well known as Levi's Enlargement Lemma, stems from Levi's original paper. 1 It states that, for any given pseudoline arrangement L and any two points p and q not on the same pseudoline of L, it is always possible to insert a pseudoline through p and q into L such that the resulting arrangement is again a valid pseudoline arrangement. From Levi's Enlargement Lemma, it immediately follows that given any pseudolinear drawing D(G) and any set E * of edges from G, it is always possible to insert all edges from E * into D(G) such that the resulting drawing is again pseudolinear. In contrast, if the input drawing D(G) is simple, Kynčl [30] showed that not every edge of G can be added to D(G) such that the result is again a simple drawing, not even if G is a matching plus two isolated vertices which are the endpoints of the edge to be inserted [31]. The latter implies that an analogous statement to Levi's Enlargement Lemma is not true for arrangements of pseudosegments (simple arcs that pairwise intersect at most once). Moreover, Arroyo et al. [4] showed that given a simple drawing D(G) and a set E * of edges from G, it is NP-complete to decide whether E * can be inserted into D(G) (such that the resulting drawing is again simple). However, the cardinality of E * required for their hardness proof is linear in the size of the constructed graph. The main open problem posed in [4] is the complexity of deciding whether one single given edge e of G can be inserted into D(G).
In this work, we show that this decision problem is NP-complete, even if G is a matching plus two isolated vertices which are the endpoints of e. This implies that, given an arrangement S of pseudosegments and two points p and q not on the same pseudosegment, it is NP-complete to decide whether it is possible to insert a pseudosegment from p to q into S such that the resulting arrangement is again a valid arrangement of pseudosegments (Sect. 2). On the positive side, we observe that the decision problem is fixed-parameter tractable (FPT) in the number of crossings of the original drawing G (Sect. 5). This algorithm cannot be directly adapted to obtain an FPT-algorithm only with respect to the number of newly created crossings. Very recently, an overlapping set of authors showed an FPT-algorithm for this problem that is tight under the Exponential Time Hypothesis [22]. Using a different approach that requires invoking Courcelle's theorem [16], the authors present an FPT-algorithm for inserting a bounded number of edges with a bounded number of new crossings into a simple drawing G.
Snoeyink and Hershberger [39] showed the following analog to Levi's Enlargement Lemma for arrangements of pseudocircles: For any arrangement A of pseudocircles and any three points p, q, and r , not all of them on one pseudocircle of A, there exists a pseudocircle through p, q, and r such that A ∪ { } is again an arrangement of pseudocircles. Refining our hardness proof, we show that the edge-insertion decision problem remains NP-complete when D(G) is a pseudocircular drawing, regardless of whether the resulting drawing is required to be again pseudocircular or allowed to be any simple drawing. This holds even if we are in addition given an arrangement of pseudocircles extending D(G). On the positive side, we show that, given an arrangement A of pseudocircles and a pseudosegment σ , it can be decided in polynomial time whether there exists an extension σ of σ to a simple closed curve such that A ∪ { σ } is again an arrangement of pseudocircles (Sect. 4).

More Related Work
One of the implications of the results presented in this paper concerns so-called saturated drawings [31]. A simple drawing D(G) of a graph G is called saturated if no edge e from G can be inserted into D(G). Kynčl et al. showed that there are saturated simple drawings whose number of edges is only linear in the number of vertices [31]. The currently best upper bound on the minimum number of edges in saturated simple drawings is 7n and has been shown by Hajnal et al. [25]. A natural question is to determine the complexity of deciding whether a simple drawing is saturated. Our hardness result implies that the straight-forward idea of testing whether D(G) is saturated by checking for every edge in G whether it can be inserted into D(G) is not feasible unless P = NP.
The problem of inserting an edge (or multiple edges or a star) into a planar graph has been extensively studied in the contexts of determining the crossing number of the resulting graph [9,36] and of finding a drawing of the resulting graph in which the original planar graph is drawn crossing-free and the drawing of the resulting graph has as few crossings as possible [14,15,24,35]. In relation to our work, a main difference is that we consider inserting edges into some given non-plane drawing of a graph. Furthermore, the question considered in this paper is strongly related to work on extending partial representations of graphs. Here, we are usually given a representation of a part of the graph G and are asked to extend it into a full representation of G such that the partial representation is a sub-representation of the full one. Recent years have seen a plethora of results in this topic. For plane drawings Angelini et al. [1] showed that the problem can be solved in linear time, while Patrignani already proved earlier that the problem is NP-complete for plane straight-line drawings [34]. For level and upward planar graph drawings the problem was shown to be NP-complete [8,17]. However, under certain restrictions on the graph and the drawing, the extension problems become tractable [8,10,17,33]. Very recently, also orthogonal drawings have been considered [2]. Extension of other graph representations have been studied for several graph classes defined by intersection or visibility of geometric objects [11][12][13][26][27][28][29]. Very recently, the extension problem was also considered for 1-plane drawings through the lens of parameterized complexity [19,20].
A similar extension problem was studied when the graph class considered are trees. Here, we are also given a point-set P and ask if the given drawing can be extended using only points in P for vertex positions. Di Giacomo et al. [18] showed that this problem is polynomial time solvable if bends are allowed. Similarly to the case of planar graphs, Bagheri and Razzazi [6] showed that the problem is NP-complete when we require the extended drawings to be straight-line.

Outline
The remainder of our paper is organized as follows. In Sect. 2 we prove that, given a simple drawing D(G) of a graph G, it is NP-complete to decide whether a given edge e of G can be inserted into D(G). Furthermore, we discuss under which conditions the statement holds. Most notably, in Sect. 3, we show that the problem remains NPhard even if the input drawing is pseudocircular. In contrast, we show in Sect. 4 that for a given arrangement A of pseudocircles and a pseudosegment σ , we can decide in polynomial time whether σ can be extended to simple closed curve σ such that A ∪ { σ } is again an arrangement of pseudocircles. Finally, in Sect. 5, we observe that the problem of deciding whether a given edge e of G can be inserted into a simple drawing D(G) of a graph G is FPT in the number of crossings of D(G).

Inserting One Edge into a Simple Drawing is Hard
In this section we prove the following theorem containing our main result: It is straightforward to verify that the problem is in NP (see Arroyo et al. [4] for a combinatorial description of our problem using the dual of the planarization of the drawing). We show NP-hardness via a reduction from 3SAT. Let φ(x 1 , . . . , x n ) be a 3SAT-formula with variables x 1 , . . . , x n and set of clauses C = {C 1 , . . . , C m }. An occurrence of a variable x i in a clause C j ∈ C is called a literal. For convenience, we assume that in φ(x 1 , . . . , x n ), each clause has three (not necessarily different) literals. In a preprocessing step, we eliminate clauses with only positive or only negative literals via the transformation from Lemma 2.2.

Lemma 2.2
The following transformation of a clause with only positive or only negative literals, respectively, preserves the satisfiability of the clause (y is a new variable and false is the constant value false): Proof We prove the statement for the case in which the original clause has three positive literals; the other case is analogous. Assume that x i or x j satisfies the original clause. Then it also satisfies clause (ii) and y can be set to true to satisfy clause (i). If x k satisfies the original clause, then it also satisfies clause (i) and y can be set to false to satisfy clause (ii). If none of x i , x j , and x k satisfy the original clause, then to satisfy clause (ii) we have to set y to false, which implies that clause (i) is not satisfied.
After the preprocessing, we have a transformed 3SAT-formula where each clause is of one of the following four types. Type (i): two positive literals and one constant false; type (ii): one negative and two positive literals; type (iii): one positive and two negative literals; and finally, type (iv): two negative literals and one constant false.
Given a transformed 3SAT-formula φ = φ(x 1 , . . . , x n ) with set of clauses C = {C 1 , . . . , C m }, satisfiability of φ will correspond to being able to insert a given edge uv into a simple drawing D of a matching constructed from the formula φ. The main idea of the reduction is that the variable and clause gadgets in D act as "barriers" inside a simple closed region R of D, in which we need to insert a simple arc γ from one side to the other to connect u and v. Crossing a barrier in some way imposes constraints on how or whether we can cross other barriers afterwards.
To simplify the description, we first focus our attention to the inside of the simple closed region R. We assume that γ cannot cross the boundary of R. In the following we use two lines, named λ and μ, to bound the regions in which a variable and clause gadget will be placed. Particularly, these lines will be identified with opposite segments on R's boundary.

Variable Gadget
A variable gadget W is bounded from the left by a vertical line λ and from right by a vertical line μ. Additionally, it contains a horizontal segment κ between λ and μ, a set P of pairwise non-crossing arcs (parts of later-defined edges), each with one endpoint on κ and the other endpoint on μ, and a set N of pairwise non-crossing arcs, On κ, all the endpoints of arcs in P lie above all the endpoints of arcs in N , implying that every arc in P crosses every arc in N . Finally, we choose two points u and v such that u is below all arcs in W and v is above them; see Fig. 1 for an illustration. The arcs in P and N correspond to positive and negative appearances of the variable, respectively.

Lemma 2.3 Let W be a variable gadget. Any arc between the vertical lines λ and μ that connects u and v crosses all arcs in P or all arcs in N .
Proof Assume that there is an arc connecting u and v neither crossing all the arcs in P nor all the arcs in N . Hence, there are two arcs p ∈ P and n ∈ N such that this arc neither crosses p nor n. By the construction of the gadget, p and n cross. Thus, their union together with λ and μ separates u from v. It follows that the arc has to cross p or n.

Clause Gadget
Similar to a variable gadget, a clause gadget K is bounded from the left and right by two vertical lines λ and μ, respectively. Additionally, it contains three horizontal arcs (parts of later-defined edges) γ a , γ b , and γ c , where the former two have one endpoint on λ and the latter has one endpoint on μ. On λ, the endpoint of γ a lies to the right of the one of γ b . The other endpoints of γ a , γ b , and γ c are called a, b, and c, respectively. None of these three arcs cross. Moreover, K contains two points d and g and an edge dg that crosses γ a , γ c , and γ b in that order when traversed from d to g. Notice that we do not require any specific rotation of the crossings of dg with γ a and γ b (where the rotation is the clockwise order of the endpoints of the crossing arcs). However, to simplify the description, we assume that the rotations of the crossings are as in Fig. 2. The rotation of the crossing of dg with γ c is forced by the order of the crossings along dg. Finally, we again choose two points u and v such that u is below all arcs in K and v is above them; see Fig. 2 for an illustration.

Lemma 2.4
Let K be a clause gadget. Any arc uv between the vertical lines λ and μ that connects u and v crosses either dg twice or at least one of the arcs γ a , γ b , and γ c .
Proof Let × be the crossing point of γ c and dg. This point splits the arc dg into two arcs d× and g×. Assume that the arc uv does not cross the arcs γ a , γ b , and γ c . The union of γ a and γ c together with d× and the lines λ and μ separates u from v. Since the arcs γ a and γ c are not crossed by uv, uv must cross d× in a point × . Analogously, the union of γ b , γ c , together with g× and the lines λ and μ separates u from v. Thus, uv has to cross g× in a point × = × to avoid tangencies. This implies that uv crosses dg twice, a contradiction.

The Reduction
Let φ(x 1 , . . . , x n ) be a transformed 3SAT-formula with clause set C = {C 1 , . . . , C m } (each clause being of one of the four types identified above). To build our reduction we need one more gadget. First, we introduce the following simple drawing introduced by Kynčl et al. [31,Fig. 11] and depicted in Fig. 3. Here, we denote this drawing by . Following the notation by Kynčl et al., we denote its six arcs by a 1 , a 2 , a 3 , b 1 , b 2 , and b 3 ; and its eight cells by X , A 1 , A 2 , A 3 , B 1 , B 2 , B 3 , and Y ; see Fig. 3 for an illustration. The core property P of is that it is not possible to insert an edge between a point in cell X and another point in cell Y such that the result is a simple drawing [31,Lem. 15].
For our reduction, we first choose two arbitrary points u and v in the cells X and Proof Assume for contradiction that uv can be inserted not crossing b * 2 and let γ uv be such an arc. Refer to Fig. 3. If γ uv does not cross b 2 , then we would be able to prolong it and cross b 2 to reach Y , a contradiction of property P. Thus, γ uv crosses b 2 . Further, we may assume without loss of generality that γ uv does not cross b 2 inside A 2 or B 1 , as otherwise it would be possible to modify γ uv to not cross b 2 . Thus, γ uv intersects b 2 on the boundary of B 2 . Since γ uv cannot intersect Y , this crossing must be on b * 2 .
The final piece we need for our reduction is a set F of m I + m IV + 4 arcs that we insert into , where m I is the number of clauses of type (i) and m IV the number of clauses of type (iv). For an arc f ∈ F we will place one of its endpoints on a vertical line κ F inside A 2 and the other one inside B 2 ; see Fig. 4 for an illustration. The only crossings of f with are with the arcs a 2 , a 1 , b 3 , and b 2 , in that order, when traversing f from its endpoint on κ F to its endpoint in B 2 . Furthermore, when f is traversed in that direction, it crosses from A 2 to A 1 , from A 1 to B 3 , from B 3 to Y , and from Y to B 2 .
Consider the m I + m IV + 4 endpoints on κ F sorted from top to bottom. We denote by f j the arc in F incident with the j-th such endpoint. When traversing b 2 from its endpoint in A 2 to its endpoint in B 1 , the crossings of arcs in F with b 2 appear in the same order as their endpoints on κ F . More precisely, the crossings of b 2 , when b 2 is traversed in that direction, are with a 2 , a 1 , b 3 , f 1 , f 2 , …, f |F| , and b 1 , in that order.
The arcs f m I +1 , f m I +2 , f m I +3 , and f m I +4 will behave differently than the other arcs in F. In the following, we denote these four arcs by r 2 , r 1 , 1 , and 2 , respectively. There are only two crossings between arcs in F, namely, between r 1 and r 2 , and between 1 and 2 , and both these crossings are inside B 2 . These four crossing arcs divide B 2 into three regions. Let R denote the region with b * 2 on its boundary; let R r denote the (other) region incident with the crossing between r 1 and r 2 ; and let R denote the (other) region incident with the crossing between 1 and 2 . Arcs r 1 , r 2 ,

Lemma 2.6 The edge uv cannot be inserted into without crossing every arc in F in A 1 or B 3 (in the interior or common boundary of these cells).
Proof Assume for contradiction that there is an arc f ∈ F such that uv does not cross f . From Lemma 2.5 we know that uv has to cross b * 2 . Consider the region bounded by b * 2 , b 3 , f , and a 2 . Observe that, since b * 2 is fully contained on the boundary of this region, uv has to cross at least one of the three other arcs as well. By assumption, Fig. 3 The simple drawing presented in [31]. It is not possible to insert an edge between a point in X and one in Y 4 A schematic overview of the edges in F (red and orange) and how they are combined with uv does not cross f . Crossing b 3 is impossible by property P, as the part contained on this region's boundary separates B 3 from Y . Finally, crossing the arc which is part of a 2 is not possible, since this would imply the existence of a point v in A 2 such that uv passes through v without having crossed a 2 . Hence, we could prolong the arc uv that is part of uv by crossing a 2 such that it reaches B 2 without crossing b * 2 , a contradiction to Lemma 2.5. Thus, the statement follows.
It remains to insert inside R the clause and variable gadgets and precisely define the endpoints of arcs in F \ { 1 , 2 , r 1 , r 2 }. For simplicity, we first insert the variable gadgets and then the clause gadgets. The idea is that each clause and variable gadget is inserted in R separating b * 2 from v. This is done by identifying the endpoints that were lying on λ or μ with points on 1 , 2 , r 1 , r 2 , or b 2 . As a result, Lemmas 2.3 and 2.4 can be applied to the arc that we insert connecting u and v in the final drawing, since it has to cross b * 2 by Lemma 2.5. We now insert the variable gadgets into R. Let W (i) be the variable gadget corresponding to variable x i . For a gadget W (i) , the arcs in N are drawn such that the endpoints on λ lie on the part of 1 that bounds R. The arcs in P are drawn similarly, but with the endpoints on μ lying on the part of r 1 that bounds R. Moreover, we identify vertex v in the gadget with vertex v in . Gadgets corresponding to different variables are inserted without crossing each other. We now specify how they are inserted relative to each other. As we traverse 1 from its endpoint on κ F to its endpoint in R, we encounter the endpoints of arcs in W (i) before the endpoints of arcs in W (i+1) . Analogously, as we traverse r 1 from its endpoint on κ F to its endpoint in R,

Clause gadgets
Variable gadgets v Fig. 5 Illustration of the reduction we encounter the endpoints of arcs in W (i) before the endpoints of arcs in W (i+1) . See Fig. 5 for an illustration.
In a similar way we insert the clause gadgets. Let K ( j) be the clause gadget corresponding to clause C j . If C j is of type (i), K ( j) is inserted such that the endpoints on λ lie on the part of 2 that bounds R. If C j is the j -th clause of type (i), we identify c with the endpoint of the arc f j . Similarly, if C j is of type (iv), K ( j) is inserted such that the endpoints on λ lie on the part of r 2 that bounds R. If C j is the j -th clause of type (iv), we identify c with the endpoint of the arc f m I +4+ j . If C j is of type (ii), K ( j) is inserted such that the endpoints on λ lie on the part of 2 that bounds R and the endpoint on μ lies on the part of r 2 that bounds R. Similarly, if C j is of type (iii), K ( j) is inserted such that the endpoint on μ lies on the part of 2 that bounds R and the endpoints on λ lie on the part of r 2 that bounds R. The crossings in R of arcs from different clause gadgets are of arcs with an endpoint in r 2 with arcs in We now specify how different clause gadgets are inserted relative to each other. As we traverse 2 from its endpoint on κ F to its endpoint in R, we first encounter the endpoints of arcs corresponding to type (iii) clauses, followed by the ones corresponding to type (ii) clauses, and finally the ones corresponding to type (i) clauses. Analogously, as we traverse r 2 from its endpoint on κ F to its endpoint in R, we first encounter the endpoints of arcs corresponding to type (iv) clauses, followed by the ones corresponding to type (iii) clauses, and finally the ones corresponding to type (ii) clauses. Moreover, as we traverse 2 and r 2 in the specified directions, the endpoints of arcs corresponding to the j -th clause of a certain type are encountered before the endpoints of arcs corresponding to the ( j − 1)-st clause of this type. An illustration can be found in Fig. 5.
Finally, we connect arcs from variable and clause gadgets inside the regions R and R r . This is done such that if a literal in a clause is x k then the corresponding arc in the clause gadget, that has an endpoint on 2 , is connected with an arc in N of the gadget W (k) , that has an endpoint on 1 . Thus, these connections can lie in R . Analogously, if a literal in a clause is ¬x k then the corresponding arc in the clause gadget, that has an endpoint on r 2 , is connected with an arc in P of the gadget W (k) , that has an endpoint on r 1 . Thus, these connections can lie in R r . Since, without loss of generality, we can assume that R and R r are convex regions and the endpoints we want to connect are pairwise distinct points on the boundaries of those regions, the connections can be drawn as straight-line segments. (For visual clarity in Fig. 5 and to argue pseudocircularity in Sect. 3, we draw these connections with one bend per arc.) Therefore, there is at most one crossing between each pair of connecting arcs.
Each connecting arc is concatenated with the arcs in a variable and in a clause gadget that it joins. These concatenated arcs are edges in our drawing that have one endpoint in a variable gadget and the other one in a clause gadget. By construction, each such edge corresponds to a literal in the formula φ and each pair of them crosses at most once. Similarly, the arcs in F \ { 1 , 2 , r 1 , r 2 } have one endpoint in a clause gadget and also define edges in our final drawing that we denote by the same names as the corresponding arcs.
We now have all the pieces that constitute our final drawing. It consists of (i) the simple drawing ; (ii) the edges f i ∈ F drawn as the described arcs (with their endpoints as vertices); (iii) the edges corresponding to literals (with their endpoints as vertices); and (iv) the edges dg in each clause gadget (with d and g as vertices). Observe that the constructed drawing is a simple drawing, as it is the drawing of a matching (plus the vertices u and v) and, by construction, any two edges cross at most once.
It remains to show that the presented construction is a valid reduction.

Lemma 2.7
The above construction is a polynomial time reduction from 3SAT to the problem of deciding whether an edge can be inserted into a simple drawing.
Proof Given a 3SAT formula φ(x 1 , . . . , x n ) with clauses C 1 , . . . , C m we construct a simple drawing D as described in Sect. 2 and aim to insert the edge uv into it. This construction can clearly be computed in polynomial time and space, since only the combinatorial description of the drawing is needed. Assume uv can be inserted into D and let uv be the resulting arc. By Lemmas 2.5 and 2.6 we know that uv has to cross b * 2 and every arc in F. Let u * be the point where uv crosses b * 2 . Each clause and variable gadget separates u * from v and thus, Lemmas 2.3 and 2.4 can be applied. This means that in a variable gadget W (i) all arcs in P or all arcs in N are crossed. In the former case we assign to variable x i the value true, and otherwise the value false. Assume that this truth assignment does not satisfy φ(x 1 , . . . , x n ). Then there exists a clause C j for which all three literals evaluate to false. Consider the clause gadget K ( j) . By Lemma 2.4 we must cross in it an edge corresponding to one of its literals. However, by Lemma 2.6 an edge corresponding to the constant value false cannot be crossed (again) in a clause gadget. By construction and the truth assignment of the variables, the edges corresponding to the other literals of C j cannot be crossed either.
Conversely, assume we are given a satisfying assignment of φ(x 1 , . . . , x n ). We then can insert uv into D as follows. Starting from u, edge uv crosses a 1 to enter region A 1 , then crosses all arcs in F, and crosses b * 2 to enter R; see also the dotted line in Fig. 5. In each clause gadget, edge uv crosses one edge corresponding to a literal evaluating to true, none corresponding to a literal evaluating to false, and the edge dg in the gadget if necessary. By construction, this leaves in each variable gadget all arcs either in P or in N free to be crossed by uv. Moreover, this allows us to connect u and v without crossing any edge twice.
As our reduction from 3SAT constructs a simple drawing D(G) of a matching, the general problem is NP-hard even if G is as sparse as possible. We remark that if we do not require G to be a matching, our variable gadget can be simplified by identifying all the vertices on κ and removing the crossings between edges in N and P. Moreover, from the constructed drawing D(G), one can produce an equivalent instance that is connected: This is done by inserting an apex vertex into an arbitrary cell of the drawing, and then subdividing its incident edges so that the resulting drawing D * is simple. If uv can be inserted into D(G) then it can be inserted also into D * . Finally, in the next section we show that the problem remains hard even when the input drawing D(G) is a pseudocircular drawing and we are in addition given an arrangement of pseudocircles extending D(G), regardless of whether the resulting drawing is required to be again pseudocircular or allowed be any simple drawing.

Inserting One Edge into a Pseudocircular Drawing is Still Hard
In this section, we show that the simple drawings produced by our reduction are actually pseudocircular. Hence we obtain the following corollary.

Corollary 3.1 Given a pseudocircular drawing D(G) of a graph G = (V , E) and an edge uv of G, it is NP-complete to decide whether uv can be inserted into D(G), even if an arrangement of pseudocircles extending the drawing of the edges in D(G) is provided.
Proof Let D be a drawing produced by our reduction from 3SAT. We divide the edges that correspond to literals of the input 3SAT-formula into the blue edges and the purple edges. The former correspond to positive literals and the latter to negative ones. Furthermore, we call the edges corresponding to constant false values the orange edges and the four edges r 1 , r 2 , 1 , and 2 the red edges. For each clause gadget we find one edge that is not corresponding to a literal or constant false value; we call all these edges the black edges. Finally, we call the edges in the subdrawing in D the green edges.
To complete D into an arrangement of pseudocircles we have to close every blue, purple, black, orange, red, and green edge by a corresponding extension. For the six green edges this can be done as shown in Fig. 6a. The orange and red edges are partitioned into two groups. The first one contains r 1 , r 2 and the orange edges corresponding to false values in clauses of type (i). The second one contains 1 , 2 , and the orange edges corresponding to false values in clauses of type (iv). Inside the region R, for both groups the red and the orange extensions are drawn as parallel, pairwise non-intersecting curves between their endpoints in R and the boundary of the region A 2 ; see Fig. 6b. Additionally, also inside R, for each group the extensions of the two red edges cross all the orange edges in the group. Moreover, the clause gadgets are essentially placed between the red extensions. Inside the region A 2 , for each group the extensions of the two red edges cross and the orange extensions cross the red ones; see again Fig. 6b.
We close the black edges with black extensions by just connecting the endpoints of a black edge without producing any additional crossings with the edges of D, or with the extensions defined so far. It remains to extend the purple and the blue edges. An example of a fully extended drawing D can be seen in Fig. 7. The purple and blue extensions are essentially horizontally mirrored copies of their corresponding edges. In particular, two purple or blue extensions cross if and only if the corresponding purple or blue edges cross. Moreover, inside the region R, the purple and the blue extensions are drawn without crossings. As we traverse 1 from its endpoint in A 2 to its endpoint in R, we encounter the (crossing points of) purple extensions of arcs in W (i) after the blue arcs in W (i−1) and before the blue arcs in W (i) . Analogously, as we traverse r 1 from its endpoint in A 2 to its endpoint in R, we encounter the (crossing   6 Extending the gadgets that form the frame of our reduction to an arrangement of pseudocircles points of) blue extensions of arcs in W (i) after the purple arcs in W (i−1) and before the purple arcs in W (i) . Furthermore, as we traverse 2 from its endpoint in A 2 to its endpoint in R, we encounter the (crossing points of) purple extensions before the blue arcs. Similarly, as we traverse r 2 from its endpoint in A 2 to its endpoint in R, we encounter the (crossing points of) blue extensions before the purple arcs.
Let D • be the arrangement of closed curves constructed from D. It remains to prove that D • is an arrangement of pseudocircles. We consider the pseudocircles in D • to have the same color as the edges and extensions that define them. We first show that we can deform the purple, blue, black, red, and orange pseudocircles in D • such that they are all axis-aligned rectangles and the pairwise intersections are preserved. Then, to show that two of these rectangles cross at most twice we make use of the next observation: Observation 3.2 Let 1 and 2 be two axis-aligned rectangles whose vertices lie in general position (no three are collinear). If the leftmost and rightmost points of the projection of 1 ∪ 2 into the horizontal (or vertical) axis correspond to different rectangles, then 1 and 2 cross in at most two points.
We will show that all pseudocircles in D • except the green ones can be deformed to axis-aligned rectangles while maintaining their intersections with other pseudocircles. We refer to Fig. 7.
By construction, the red and orange pseudocircles extending the edges in the group of red and orange ones that contains r 1 and r 2 can be drawn directly as axis-aligned rectangles. See the the red and orange pseudocircles on the right side of Fig. 7. We deform (the bottom part of) the other orange and red pseudocircles such that the resulting pseudocircles are axis-aligned rectangles. This can easily be done by also deforming part of the subdrawing of D • . The purple pseudocircles can be drawn directly as axis-aligned rectangles. A black pseudocircle extending a black edge e can trivially be drawn as an axis-aligned rectangle such that only crosses pseudocircles extending edges that cross e.
We now deform the blue pseudocircles. The blue extensions as described above can be drawn such that the resulting blue pseudocircles are axis-aligned polygons with one reflex corner (between 1 and r 1 ). For a blue pseudocircle drawn in this way, let the corner point be the reflex vertex of the polygon and let the horizontal and vertical sides incident with it be the horizontal corner-arc and the vertical corner-arc of , (a) Blue pseudocircles.
(b) Blue and purple pseudocircles. respectively. To make a blue pseudocircle an axis-aligned rectangle, we deform it by moving its corner point; see Fig. 8. Obviously, this does not change the crossings with any green, black, red, or orange pseudocircle. Furthermore, it does not change the crossings with other blue pseudocircles as no new crossings are introduced and the crossings along the horizontal corner-arc are preserved. Finally, in the same way, this deformation preserves the crossings between the blue pseudocircle and purple ones along the vertical corner-arc. Consider the deformed drawing obtained from D • maintaining all intersections. We now argue that each two pseudocircles cross either zero or two times in this deformed drawing and hence in D • . To show that no two blue (or no two purple) rectangles cross more than twice we consider their projection onto the vertical axis. Then, by construction, two rectangles cross if and only if the topmost and the bottommost points of the projection correspond to different rectangles; see Fig. 8a. Thus, by Observation 3.2, in case the two rectangles cross they cross twice. For a blue and a purple pseudocircle we find that their projection to the horizontal axis is always such that the left-most point belongs to the purple extension and the right-most point to the blue extension by construction; see Fig. 8b for an illustration. From Observation 3.2 it follows that each pair of blue and purple rectangles crosses at most twice.
In the same manner we can argue about the red and orange rectangles. By construction, two orange rectangles do not cross. A red and an orange rectangle are either disjoint (if they extend edges in different groups of red and orange ones) or the leftmost and rightmost points of their projection onto the horizontal axis correspond to different rectangles. Thus, from Observation 3.2 it follows that each pair of red and orange rectangles crosses at most twice. Similarly, given a red or orange rectangle and a purple or blue one, the leftmost and rightmost points of their projection onto the horizontal axis correspond to different rectangles. Thus, by Observation 3.2, they cross at most twice.
Given two rectangles, one of them black, their projection onto the horizontal or the vertical axis shows that either they do not cross or, by Observation 3.2, they cross at most twice. Finally, it is easy to verify that no red, orange, or green pseudocircle σ Fig. 9 Obstruction where all pseudocircles intersect σ twice σ Fig. 10 Obstruction where one pseudocircle intersects σ only once crosses a green pseudocircle more than twice. Since by construction no other pseudocircle crosses a green pseudocircle, we conclude that D • is in fact an arrangement of pseudocircles.

Extending an Arrangement of Pseudocircles is Easy
In Sect. 2 we proved that deciding whether an edge can be inserted into a pseudocircular drawing such that the result is a simple (or a pseudocircular) drawing is hard. In this section we focus on extending arrangements of pseudocircles instead of drawings of graphs. Recall that in such an arrangement the restriction is that two pseudocircles can cross at most twice while in a simple drawing the restriction is that two edges share at most one point. The main difference in extending arrangements of pseudocircles and simple pseudocircular drawings is that in the latter the crossing possibilities are more restricted: the edge parts of two pseudocircles cannot cross twice.
Snoeyink and Hershberger [39] showed that given an arrangement A of pseudocircles and three points, not all three on the same pseudocircle, one can find a pseudocircle through the three points such that A∪{ } is again an arrangement of pseudocircles. Now, given any arrangement A and a pseudosegment σ intersecting each pseudocircle in A at most twice, it is not always possible to extend σ to a pseudocircle σ ⊃ σ such that A ∪ { σ } is again an arrangement of pseudocircles. Two examples are shown in Figs. 9 and 10. In both examples any pseudocircle σ extending σ crosses one red or blue pseudocircle at least four times. We show in the following that the extension decision question can be answered in polynomial time: v v v v Fig. 11 Algorithm extending σ to a pseudocircle σ tion problem does not depend on the particular geometry of the arrangement, only on the combinatorial equivalence class. Therefore, we can assume that the input is this combinatorial description (of polynomial size in n).

Proof of Theorem 4.1
Throughout this proof we write R := R 2 \ R for the complement of a set R ⊆ R 2 . By possibly transforming A into an isomorphic arrangement while preserving the incidences of σ , we can assume without loss of generality that an endpoint is incident with the unbounded cell and that the intersection points of σ with the pseudocircles in A are all proper crossings. Further, by possibly transforming the arrangement again into an isomorphic one, we can assume that σ is a horizontal segment with the left endpoint incident with the unbounded cell. Let u and v be the left and right endpoints of σ , respectively. Our algorithm aims to compute a pseudocircle σ = σ ∪ σ such that A ∪ { σ } is an arrangement of pseudocircles, or determine that no such σ exists. We call σ an extension of σ .
We partition the set of pseudocircles of A into three sets C 0 , C 1 , and C 2 , where for each i ∈ {0, 1, 2}, C i is the set of pseudocircles in A crossing σ exactly i times. Note that u lies outside all pseudocircles φ ∈ A while v lies outside of all φ ∈ C 0 ∪ C 2 and inside all φ ∈ C 1 , that is, each φ ∈ C 1 separates u and v. Further, an extension σ must not cross any φ ∈ C 2 , it needs to cross every φ ∈ C 1 exactly once, and it can cross each φ ∈ C 0 either twice or not at all.
The idea is to construct a finite sequence R 0 ⊂ R 1 ⊂ . . . of closed subsets of R 2 , each consisting of cells of A ∪ σ that cannot be reached by σ . Figure 11 illustrates this idea as well as various cases throughout the proof. Each set R i will be a simply Fig. 12 Proving that R 0 fulfills the invariant connected closed region of R 2 with both u and v on its boundary. Further, we will maintain the following invariant: for each R i and each φ ∈ C 0 , int(φ) ∩ R i is either a connected region or empty, where int(φ) denotes the interior of the bounded area enclosed by φ. The construction will either end by determining that σ cannot be extended, or with a set R m such that routing σ closely along the boundary of R m gives a valid extension of σ .
Let R 0 be the union of σ and all the closed disks bounded by the pseudocircles in C 2 and consider the faces induced by R 0 . Since u is incident with the unbounded cell of R 0 , and since σ must not intersect the interior of R 0 , σ cannot reach any bounded face of R 0 . Let R 0 be the closure of the union of these bounded faces and σ . We may assume that v ∈ ∂ R 0 , as otherwise no extension σ exists and we are done.
To see that the invariant holds for R 0 , assume that there exists a pseudocircle φ ∈ C 0 such that int(φ) ∩ R 0 is connected; see Fig. 12 for an illustration. Note that int(φ) ∩ R 0 is connected if and only if R 0 \ int(φ) is connected. As φ does not intersect σ , there exists a component D of R 0 \ int(φ) that is disjoint from σ . Further, as int(φ) is simply connected, D ∩ ∂ R 0 = ∅. Moreover, any point x on ∂ D ∩ ∂ R 0 lies on some pseudocircle φ x ∈ C 2 . On the other hand, any path in R 0 from a point of σ to x must enter and leave int(φ) and hence intersect φ at least twice. As φ x intersects σ twice and lies in R 0 , we get that φ x intersects φ in at least four points, a contradiction.
For the iterative step, consider the arrangement A φ i formed by ∂ R i and a pseudocircle φ ∈ C 0 ∪ C 1 , and the cells of it that lie in R i . If φ ∈ C 1 and an extension σ exists, then the only two such cells that can be intersected by σ are the ones incident to u and v, respectively. Similarly, if φ ∈ C 0 , then σ can only intersect the cell(s) incident to u and v, plus the (by the invariant) unique cell int(φ) ∩ R i . In both cases, all other cells of this arrangement should be added to the forbidden area. We denote all cells A φ i ∩ R i that can possibly be intersected by σ as reachable (by σ ) and all other cells as unreachable (by σ ).
Assume that there exists some pseudocircle φ ∈ C 0 ∪ C 1 such that the arrangement A φ i of φ and ∂ R i contains unreachable cells. Then we obtain R i+1 by adding all those cells to R i . If v lies in a bounded region of R i+1 , then no extension σ exists and we are done. (Recall that by assumption u always lies in the unbounded region.) Otherwise, R i+1 = R i+1 is a simply connected region that has both u and v on its boundary. It remains to show that the invariant is still maintained for R i+1 .

Lemma 4.2 If R i fulfills the invariant and u and v both lie in the unbounded region of R i+1 then R i+1 also fulfills the invariant.
Proof Let φ ∈ C 0 ∪ C 1 be the pseudocircle that causes the step from R i to R i+1 and consider the arrangement A φ i of φ and ∂ R i (which contains unreachable cells). Note that the boundaries of all cells of A φ i alternate between arcs of φ and parts of ∂ R i .

Moreover, all cells of
We first consider the case that φ ∈ C 0 . It is illustrated in Fig. 13a. Suppose that there exists a pseudocircle φ ∈ C 0 for which int(φ ) ∩ R i+1 is disconnected while int(φ ) ∩ R i is connected. Observe that φ = φ because all the cells of A φ i that are added to R i for obtaining R i+1 lie outside φ. Since R i fulfills the invariant, each cell of A φ i in R i+1 \ R i is bounded by a single arc of φ and a single arc of ∂ R i and all those cells are pairwise disjoint. Hence there exists at least one such cell c that disconnects int(φ )∩ R i , and the boundary of c along φ intersects φ (at least) twice. Recall that c is bounded and to the exterior of φ. If φ was only intersecting φ at those two points, the boundary of φ outside c would be completely contained in int(φ), but then c would not disconnect int(φ ) ∩ R i . Thus, φ must intersect φ in at least two more points, a contradiction. Now consider the case φ ∈ C 1 . For an illustration consider Fig. 13b. Assume again that there exists a pseudocircle φ ∈ C 0 for which int The cell c must not contain any of u and v as otherwise it would not be in R i+1 . Further, the cell c cannot separate u and v, as otherwise v would have been in a bounded region of R i+1 and we would have stopped the process. As c disconnects int(φ ) ∩ R i , φ intersects φ twice along the boundary of c (and hence outside R i ). As every pair of pseudocircles have at most two intersection points, φ does not intersect φ in any other points. Especially, φ does not intersect φ inside R i . Furthermore, φ intersects ∂ R i in int(φ ) at least twice along ∂c (causing the disconnection of int(φ ) ∩ R i ) and φ also intersects ∂ R i outside of φ (as it must intersect σ and φ cannot intersect σ ). This last property implies that each component of int(φ )∩ R i+1 induced by c lies in a different reachable cell of A φ i that is neighboring to c via an arc of φ. However, as c does not separate u and v, at most one such cell can exist, a contradiction to int(φ ) ∩ R i+1 being disconnected. Now assume that both u and v lie on the boundary of all sets R i constructed in this way. Then the iterative process stops with a set R m where for each φ ∈ C 0 ∪ C 1 , all cells in the arrangement A φ m of φ and ∂ R m that are contained in R m are reachable by σ . Note that m = O(n 2 ) as A has O(n 2 ) cells, in every iteration i at least one cell of A has been added to R i , and each cell of A is added at most once. Consider a path P from u to v in R m that is routed closely along the boundary ∂ R m (note that there are two different such paths). Then for any φ ∈ C 1 , P intersects exactly two cells of A φ m , namely, the ones incident to u and v, respectively. Hence P crosses φ exactly once. Similarly, for any φ ∈ C 0 , the path P intersects at most three cells of A φ m , namely, the one(s) incident to u and v plus possibly the cell int(φ) ∩ R m , which is one cell by the 13 Illustration of potentially separating cells in the proof of Lemma 4.2. The red arc and area belong to φ ∈ C 0 , the blue striped area is the cell c, the blue curve is the pseudocircle φ ∈ C 0 ∪ C 1 invariant. Hence P crosses φ at most twice. Thus σ = P is a valid extension for σ , which completes the correctness argument. Note that computing R 0 and σ (in case that the algorithm didn't terminate with a negative answer before) can be done in polynomial time. Also, for each R i and each φ ∈ C 0 ∪ C 1 , the set of unreachable cells of A φ i can be determined in polynomial time. As we have O(n 2 ) iteration steps, we can hence compute R m from R 0 (or determine that σ is not extendible) in polynomial time, which concludes the proof.
As an immediate consequence of Theorem 4.1 we have the following result: , that is, one resulting in a simple drawing of G \ {e} ∪ {uv}. We orient γ from u to v. If γ is not a valid drawing of uv in D(G) then it must intersect e more than once in D(G). We can modify γ such that it is routed close to e between its first and last intersection with e, producing at most one intersection; see Fig. 14 for an illustration. If e is not incident to u or v we are done. Else assume without loss of generality that e is incident to u and let γ be the drawing of uv that was modified such that it has only one intersection with e. Recall that e is uncrossed in D(G). Hence, the intersection point × of γ with e and the point u lie on the boundary of one cell in D(G). Consequently, we can modify γ in such a way that it is routed closely to e from u to × on the side of e on which γ continues to v without producing a crossing with any other edge in D(G). Either modification only reduces crossings, but does not introduce new ones, hence we obtained a valid drawing of uv in D(G) as desired.
Equipped with Observation 5.1 and Lemma 5.2 we are ready to prove the main theorem of this section.

Theorem 5.3 Given a simple drawing D(G) of a graph G = (V , E) and an edge uv of G, there is an FPT-algorithm in the number k of crossings in D(G) for deciding whether uv can be inserted into D(G).
Proof Let G be the subgraph of G remaining after exhaustively deleting uncrossed edges and isolated vertices distinct from u and v. Furthermore, let D (G ) be the corresponding subdrawing of D(G). By assumption, there are at most 2k crossed edges in G. Hence G has at most 4k + 2 vertices and 2k edges. Furthermore, by Observation 5.1 and Lemma 5.2 we can insert uv into D(G) if and only if it can be inserted into D (G ).
For solving the kernel instance of inserting uv into D (G ), we reformulate the problem of inserting an edge into a simple drawing as a problem in the dual graph of its planarization, as in [4]. In the planarization crossings are replaced by vertices resulting in a plane drawing. Given a simple drawing D(G) of a graph G, the dual graph G * (D) is the plane dual of the planarization of D(G). Thus, every vertex in G * (D) corresponds to a cell in D(G) and every edge in G * (D) corresponds to a segment of an edge in D(G). We assign to each edge in D(G) a different color (label) and define a coloring χ of the edges of G * (D), where every edge in G * (D) inherits the color of its primal edge in D(G). Given two vertices u, v ∈ V , let G * (D, {u, v}) be the subgraph of G * (D) obtained by removing from it the edges corresponding to segments of edges incident with u or to v. Let χ denote the coloring of the edges of G * (D, {u, v}) that coincides with χ in every edge. The problem of extending D(G) with one edge uv is then equivalent to the problem of finding a path in G * (D, {u, v}) between a vertex corresponding to a cell incident with u and a vertex corresponding to a cell incident with v in which no color given by χ is repeated (that is, the path is heterochromatic). The

Conclusions
In this paper we showed that given a simple drawing D(G) of a graph G it is NP-hard to decide if a particular edge from the complement of G can be inserted into D(G) such that the result is a simple drawing. On the positive side, we showed that for a given pseudocircular arrangement A of pseudocircles and a pseudosegment σ it can be decided in polynomial time whether σ can be extended to a simple closed curve σ such that A ∪ { σ } is again an arrangement of pseudocircles. Furthermore, we proved that the problem is FPT with respect to the number of crossings of D(G).
In the light of our results, checking whether a simple drawing D(G) is saturated by trying to insert every edge of the complement of G is hopeless (unless P = NP). Thus, it is an interesting open problem whether there is a polynomial algorithm for deciding if a simple drawing is saturated.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.