Reconstruction of weakly simple polygons from their edges

Given $n$ line segments in the plane, do they form the edge set of a \emph{weakly simple polygon}; that is, can the segment endpoints be perturbed by at most $\varepsilon$, for any $\varepsilon>0$, to obtain a simple polygon? While the analogous question for \emph{simple polygons} can easily be answered in $O(n\log n)$ time, we show that it is NP-complete for weakly simple polygons. We give $O(n)$-time algorithms in two special cases: when all segments are collinear, or the segment endpoints are in general position. These results extend to the variant in which the segments are \emph{directed}, and the counterclockwise traversal of a polygon should follow the orientation. We study related problems for the case that the union of the $n$ input segments is connected. (i) If each segment can be subdivided into several segments, find the minimum number of subdivision points to form a weakly simple polygon. (ii) If new line segments can be added, find the minimum total length of new segments that creates a weakly simple polygon. We give worst-case upper and lower bounds for both problems.


Introduction
In the design and analysis of geometric algorithms, the input is often assumed to be in general position. This is justified from the theoretical point of view: degenerate cases can typically be handled without increasing the computational complexity, or symbolic perturbation schemes can reduce any input to one in general position [3]. In this paper, we present a geometric problem about simple polygons in the plane, which has a straightforward solution if the input is in general position, but is NP-complete otherwise. Suppose we are given n line segments in the plane. It is easy to decide in O(n log n) time whether they form a simple polygon by detecting intersections in a line sweep: if the segments are disjoint apart from common endpoints, then they form a plane graph, and a simple traversal can determine whether the graph is a cycle. If the input segments overlap, more than two segments have a common endpoint, or some segment endpoints lie in the interior of another segment, then they definitely do not form a simple polygon, but they might still be perturbed into a simple polygon (i.e., they form a weakly simple polygon). We study the decision problem for weakly simple polygons in this paper.

Preliminaries
A polygon P = (p 0 , . . . , p n−1 ) is a cyclic sequence of points in the plane (vertices), where every two consecutive vertices are connected by a line segment (edge). The cycle of edges can be parameterized by a piecewise linear curve γ : S 1 → R 2 . Polygon P is simple if γ is a Jordan curve (i.e., γ is injective); equivalently, if (p 0 , . . . , p n−1 ) is the plane embedding of a Hamiltonian cycle. Polygon P is weakly simple if, for every ε > 0, the vertices p i can be perturbed to points p i , p i p i < ε, such that P = (p 0 , . . . , p n−1 ) is a simple polygon. The function . denotes the Euclidean length of a line segment. Equivalently, a polygon given by γ is weakly simple if it can be perturbed to Jordan curve γ : S 1 → R 2 such that the Fréchet distance of the two curves is bounded by ε (i.e., dist F (γ, γ ) < ε) [6]. We can test whether a polygon P = (p 0 , . . . , p n−1 ), is simple or weakly simple, respectively, in O(n) time [7] and O(n log n) time [1]. We define the WeaklySimplePolygonReconstruction (WSPR) problem as the following decision problem: Given a multiset E of line segments in R 2 , does there exist a weakly simple polygon P whose edge multiset is E? For a multiset E of directed segments, we also define Directed-WSPR that asks whether there exists a weakly simple polygon P = (p 0 , . . . , p n−1 ) such that {p i p i+1 mod n : 0 ≤ i ≤ n − 1} = E. In both undirected and directed variants, we represent the input segments as a straight-line multigraph G = (V, E), where V is the set of all segment endpoints. Note that G may have overlapping edges, and an edge may pass through vertices, so it need not be a geometric graph.
Two Necessary Conditions. Two line segments cross if they share exactly one interior point. If the multiset of segments E forms a weakly simple polygon, then no two segment cross. This condition can be easily tested in O(|E| log |E|) time by a line sweep.
If there is a weakly simple polygon P = (p 0 , . . . , p n−1 ) with edge set E, then P is an Euler tour of the graph G = (V, E). (However, an Euler tour need not be weakly simple; see Fig. 1(b)). A graph is Eulerian if and only if it is connected and every vertex has even degree. A simple (undirected) plane graph G is Eulerian if and only if its dual graph is bipartite. This result extends to plane multigraphs when an edge of multiplicity k is embedded as k interior-disjoint Jordan arcs, that enclose k − 1 faces. A directed graph is Eulerian if and only if all vertices are part of the same strongly connected component and if, for each vertex, the in-degree equals the out-degree.

Special Cases
We show that both WSPR and Directed-WSPR admit polynomial-time algorithms in the special cases that (i) G = (V, E) is a simple geometric graph, that is, no two edges overlap, and no vertex lies in the interior of an edge, and (ii) all edges in G = (V, E) are collinear. We assume that G satisfies both necessary conditions.

Geometric Graphs
Note that in an Eulerian geometric graph the boundary of each face is a weakly simple circuit, where repeated vertices are possible, but there are no repeated edges. The following is a modified version of Hierholzer's algorithm [12]. It computes a weakly simple Euler tour P in the Eulerian graph G, or reports that no such tour exists.

Algorithm A (G)
1. 2-color the faces of G white and gray so that the outer face is white; and create a list L of circuits on the boundaries of the gray faces. 2. If G is directed and the edges around a gray face do not form a directed circuit or if there exist both clockwise (cw) and counterclockwise (ccw) circuits in L, report that G has no weakly simple Euler tour. 3. Choose an arbitrary circuit in L, remove it from L and call it P . 4. While there is a circuit in L, do: 4.1 Find two consecutive edges, (u, v) and (v, w), along a white face such that (u, v) ∈ P and (v, w) ∈ C for some C ∈ L. 4.2 Remove C from the list L, and merge C and P by traversing C starting with the edge (v, w) followed by the traversal of P that ends with the edge (u, v); see Figure 2(a).  Proof. If G = (V, E) is undirected, the algorithm construct an Euler tour P [12]; and the tour is weakly simple by construction. In the remainder of the proof, we consider a directed Eulerian geometric graph G. First, we show that if G satisfies the conditions of Theorem 1, then Algorithm A returns a weakly simple Euler tour. If the circular order of edges around each vertex alternates between incoming and outgoing, then all edges on the boundary of a face of G have the same orientation (ccw or cw), and adjacent faces have opposite orientations. Without loss of generality, the edges on the boundaries of white (resp., gray) faces are oriented ccw (resp., cw). Hnece, the condition in step 2 of the algorithm is satisfied.

Return
We show that the Euler tour P constructed by Algorithm A is weakly simple, that is, it can be perturbed into a simple polygon. Initially, each circuit C = (p 0 , . . . , p k−1 ) in L is the boundary of a gray face, and hence it is a simple polygon. Let C = (p 0 , . . . , p k−1 ) be perturbation obtained by moving each point p i to the interior of the face along an angle bisector of ∠p i−1 p i p i+1 . Initially P is a weakly simple polygon (one of the circuits). It is enough to show that Step 4.2 maintains a weakly simple polygon, that is, when we merge P and a circuit C, their Jordan curve perturbations P and C can also be combined. Edges (u, v) and (v, w) are adjacent to a common white face f 0 ; they correspond to an edge (p u , p v ) in P and (q v , q w ) in C , where both p v and q v lie in the ε-neighborhood of v in two different gray faces adjacent to f 0 . We can modify P and C in the ε-neighborhood of v, by removing a short Jordan arc from each and reconnecting them across the white face f 0 into a single Jordan curve. By induction, we can obtain a Jordan curve within ε Frèchet distance from the output polygon P . Hence, the algorithm returns a weakly simple Euler tour P . Now, we show that if G has a vertex v with two consecutive incoming (resp., outgoing) edges (a, v) and (c, v), then G does not admit a weakly simple Euler tour. Suppose, for contradiction, that there exists a weakly simple Euler tour P . Since both (a, v) and (c, v) are directed into v, the tour P contains edge-disjoint paths (a, v, b) and (c, v, d). Since P is weakly simple, the circular order of these four edges incident to v must be as shown in Figure 2(b). The polygon must contain edge-disjoint paths π 1 = (v, b, . . . , c, v) and π 2 = (d, . . . , a). The perturbation of Note that a and d are on opposite sides of the cycle π ∪ v v . The perturbation of π 2 , path π 2 , can intersect neither π 1 nor v v , because (a, v) and (c, v) are adjacent to the same face. Hence P is not weakly simple.
Finally, Algorithm A runs in O(|E|) time.
Step 1 and 2 can be done by traversing the dual graph of G. Step  Proof. Replace every edge e of multiplicity k by k edge-disjoint paths of length two whose interior points are close to the midpoint of e. We obtain a simple Eulerian geometric graph with |V | + 2|E| vertices. Theorem 1 completes the proof.
Remark. In the case that G = (V, E) is a directed multigraph, replace every directed edge (u, v) of multiplicity k by edge-disjoint paths (u, w i , v), with new (subdivision) vertices w i , i = 1, . . . k, and denote by G the resulting simple directed graph. The alternating direction condition of Theorem 1 requires that the multiplicity of (u, v) and (v, u) differ by at most one. If their multiplicities differ by exactly one, then there is a unique way to interleave the replacement paths between u and v. In fact, if any edge of G has odd multiplicity, the alternating direction condition determines the cyclic order of all paths (u, w i , v), and we can apply Theorem 1 for G . If, however, all edges of G have even multiplicity, then there are two possibilities for the cyclic orders, both of which yield weakly simple Euler tours by Theorem 1. Proof. Without loss of generality, assume that all vertices are on the x-axis. Let ε > 0 be given. Let P = (p 0 , . . . , p n−1 ) be an Euler tour of G, and let p 0 be a leftmost vertex. For each vertex

NP-Completeness
In this section we analyze the general case of WSPR. First we discuss the undirected case and then the direct version.

Lemma 4. Both WSPR and Directed-WSCR are in NP.
Proof. Given a polygon P = (p 0 , . . . , p n−1 ) and a (directed) straight-line multigraph G = (V, E), we can check whether P is a (directed) Euler tour in G in O(|E|) time, and whether P is weakly simple in O(n log n) time [1].
We prove that both directed and undirected WSPC are strongly NP-hard in the general case by a reduction from Planar-Monotone-3SAT, which is strongly NP-hard [4]. An instance of Planar-Monotone-3SAT consists of a plane bipartite graph G B whose partite sets are variables nodes and clauses nodes. The variable nodes are on the x-axis, the clause nodes are above or below the x-axis; each clause is adjacent to three variables. A clause is positive if it lies above the x-axis, and negative otherwise. Planar-Monotone-3SAT asks if there is a binary assignment from {true,false} to the set of variables such that every positive clause is adjacent to at least one true variable and every negative clause is adjacent to at least one false variable.

Lemma 5.
Undirected WSPR is NP-hard. Proof. Given an instance of Planar-Monotone-3SAT, we build an instance of undirected WSPR as shown in Figure 4(c). We split the construction into two basic gadgets. A variable and a clause gadget are shown in Figure 4(a) and (b), respectively. The figure shows collinear edges distorted and colored for clarity. All vertices shown as small black disks are on the x-axis and vertices circled with a dotted ellipse represent the same graph vertex. First, place vertices v 0 , . . . , v n equally spaced on the variable line from left to right. The variable gadget corresponding to the ith variable consists of two collinear paths between v i−1 and v i , which are called red and black paths; see Figure 4. The red path is a single edge v i−1 v i ; and the black path is made of p + 1 edges where p is the degree of the i-th variable in the bipartite graph G B . We assign a vertex in the interior of this path to each edge connected to the variable, naming the vertex l i,a for the edge connecting the i-th variable to the a-th clause. We call such vertices literal vertices. The clause gadget is composed of 9 edges arranged in a cycle as shown in Figure 4(b). The three labeled vertices correspond to the literal vertices in the clause gadgets. The planar embedding of the Planar-Monotone-3SAT instance grantees that we can embed the graph of the directed WSPR instance.
Assume that the Planar-Monotone-3SAT instance have a satisfying assignment. We build a weakly simple Euler tour P as follows. Each individual gadget defines a cycle. As in Algorithm A, we will merge the cycles into the polygon P . Every cycle will be traversed clockwise, however, cycles defined by variable gadgets are collinear and there is no clear definition of winding direction for them. We perturb the red edges based on the truth values of the variables. For each variable assigned true (resp., false), we perturb the red edge to pass below (resp., above) the x-axis. All variable cycles can be safely merged into a single circuit. We merge each clause to the variable cycle through a literal vertex of a true variable if the clause is positive or through a literal vertex of a false variable otherwise.
To show that P is weakly simple, we build a simple polygon P within ε Fréchet distance from P as follows (see Figure 5). For each v i create two vertices v + i and v − i located ε/2 above and below v i respectively. If the solution assigns the i-th variable true, move vertices l i,a up by ε/2, replace vertices v i−1 and v i by v + i−1 and v + i in the black edges (of the corresponding gadget) and by v − i−1 and v − i in the red edges. Connect vertices v + 0 and v − 0 with an edge. Do the same for v + n and v − n . If the variable is assigned false, do analogous replacements symmetrically about the x-axis. For each clause gadget, choose a literal l i,a with a true value, split l i,a into two vertices, l i,a and l i,a , with the same y-coordinate and ε distance apart, such that they each are incident to one edge of the variable gadget and one edge of the clause gadget. For the other two literals, split l i,a into two vertices, l + i,a and l − i,a , with the same x-coordinate and ε 2 distance apart, such that the one closer to the x-axis is incident to two edges of the variable gadget, and the other to two edges of the clause gadget. The result is a simple polygon and therefore undirected WSPR have a positive solution. Now assume that the graph produced by the reduction admits a weakly simple Euler tour P . Then, there exist a simple polygon P within an arbitrarily small Fréchet distance from P . Such a polygon determines a vertical order between the paths of each variable gadget. Since every literal vertex has degree 4, there are only two possible ways to match its incident edges in a noncrossing manner: matching two horizontal edges and two clause edges, or a horizontal with a clause edge. In both cases, the two horizontal black edges incident to a literal vertex are placed above or below the red path. Therefore, all edges of the black path of a variable gadget are on the same side of its red path. For each variable, assign true if the black path of its gadget is above the red path and false otherwise. Since each clause gadget needs to be connected to some edge in a variable gadget, if the clause is positive/negative, one of its corresponding variables were assigned true/false. Hence, the assignment satisfies all clauses and the Planar-Monotone-3SAT instance have a positive solution.

Lemma 6. Directed-WSPR is NP-hard.
As a consequence of Lemmas 4, 5, and 6, we have the following result.

Theorem 7. Both WSPR and Directed-WSPR are NP-complete.
Remark. Our reduction can be modified by perturbing the points in our variable gadgets so that: (i) points belonging to the same gadget are collinear; (ii) no three points, each belonging to a different gadget are collinear; and (iii) no edge crossing is introduced. By reducing from Planar-Monotone-(2,3)-SAT-3 [9], in which clauses may have two or three literals and each variable can appear only in up to three clauses, we can show that WSPR remain NP-hard even if the number of mutually collinear points is constant.

Related problems
Since WSPR is NP-complete in the general case, we study related problems in which a weakly simple polygon is always achievable by allowing edge subdivision and insertion of new edges.

Edge subdivision
Given a noncrossing graph G = (V, E) where every vertex has even degree and the point set E is connected, we define the problem WSPR * as finding a sequence of edge subdivision operations that produces a graph G * = (V, E * ) that admits a weakly simple Euler tour. The subdivision of an edge uv at a vertex w ∈ relint(uv) replaces uv by two edges uw and wv.
It is easy to see that WSPR * is always feasible with O(n 2 ) subdivisions where n = |V |. Indeed, subdivide every edge uv recursively at each vertex that lies in the interior of uv. We obtain a connected geometric multigraph with even degrees, which admits a weakly simple Euler tour by Corollary 2. The main result of this section is the following. Before the proof, we introduce some notation (from [1,6,8]). Let G = (V, E) be a noncrossing graph. The transitive closure of the overlap relation is an equivalence relation on E. The union of all edges in an equivalence class is called a bar, it is a line segment. A vertex v ∈ b is called b-odd if v is incident to an odd number of edges contained in b, or b-even otherwise. A vertex can be b-odd and b -even for different bars b and b (see Figure 6(b)).

I S A
Our algorithm will compute simple paths formed by subdivided edges. Let b be a horizontal bar with vertices p 1 , p 2 ∈ b, x(p 1 ) ≤ x(p 2 ). Let q 1 q 2 ∈ E be an edge that contains p 1 and its right endpoint has minimum x-coordinate. A subdivided paths, denoted by p 1 p 2 , is a path between p 1 and p 2 , defined recursively (see Fig. 6 (ii) if p 2 ∈ q 1 q 2 , then subdivide q 1 q 2 into three edges e 1 = q 1 p 1 , e 2 = p 1 p 2 , and e 3 = p 2 q 2 and put p 1 p 2 = (e 2 ); (iii) if p 2 ∈ q 1 q 2 , then subdivide q 1 q 2 into two edges e 1 = q 1 p 1 and e 2 = p 1 q 2 , and put p 1 p 2 = (e 2 ) ⊕ q 2 p 2 , where ⊕ denotes concatenation. Consequently, if the segment p 1 p 2 contains k vertices, a path p 1 p 2 can be constructed using at most k edge subdivisions. An example is shown in Figure 6(c).
Proof of Theorem 8. The proof of the upper bound is constructive. The algorithm subdivides edges within each bar independently. Let b be a bar containing m vertices. We apply O(m) edge subdivisions and partition the edges in b into subsets: Subsets M + and M − will consists of subdivision paths between the intersection points of b with other bars lying above and below b, respectively; all remaining edges will be partitioned into tours (each of which is a weakly simple polygon by Theorem 3). The algorithm is divided into three phases: Phase 1 creates M + and M − ; phase 2 forms circuits; and phase 3 establishes common vertices between the subdivision paths and circuits. Refer to Figure 6. Phase 1. Compute a list B + (resp., B − ) of points p in the interior of b such that p is b -odd for some bar b that is above or collinear to b (resp., below b). A point can appear more than once in each list if it is odd in multiple bars b . Sort the lists by x(p), ties are broken by clockwise (resp., counterclockwise) order of the corresponding bars b . If the left (resp., right) endpoint of b is b-odd, add it to the beginning (resp., end) of the list B + . If any of the lists have odd cardinality, append the right endpoint of b at the end of the list. Create a perfect matching of consecutive endpoints in each list. Construct edge disjoint subdivided paths between each pair of matched points, and let M + and M − denote the set of edges in such paths for B + and B − , respectively (see Figure 6(d)). Phase 2. Let B be the set of (subdivided) edges that lie on b and are not in M + ∪ M − . The union of edges in B may be a disconnected point set (e.g., as shown in Figure 6(d)). Let the line segment r 1 r 2 be one of the connected components of B. Construct two edge disjoint subdivided paths r 1 r 2 + and r 1 r 2 − from the edges in B. For every path p 1 p 2 in M + (resp., M − ) that overlaps with r 1 r 2 , identify an edge of r 1 r 2 + (resp., r 1 r 2 − ) that contains a vertex of p 1 p 2 and subdivide it at such vertex (see Figure 6(e)). Let O + (resp., O − ) be the set of edges in r 1 r 2 + (resp., r 1 r 2 − ) for all components r 1 r 2 of the union of edges in B.  some component in O + . Since edge subdivisions do not change the parity of degrees, every vertex in G * has even degree, hence G * is Eulerian. We construct an Eulerian geometric graph G such that every Euler tour in G is within ε/2 Fréchet distance from an Euler tour in G * . Theorem 1 will then imply that there exists a simple polygon within ε Fréchet distance from an Euler tour in G * .
We recall some notation introduced in [6]. For every vertex v ∈ V , let D v be a disk centered at v of radius ε 4 . For a bar b between u 0 and u k , let D b be the Theorem 1 completes the proof: An Euler tour P of G can be perturbed into a simple polygon P such that dist F (P, P ) < ε 2 . The tour P maps to an Euler tour P * of G * by identifying the vertices that lie in the same disk D v , v ∈ V * ; and dist F ( P , P * ) < ε 2 . Our lower bound construction is shown in Figure 7(a). It consists of a graph G = (V, E) containing a long edge e R (shown in red) and a path of (|E| + 5)/7 non-overlapping collinear edges that connects the endpoints of e R . Each vertex in the interior of e R is also incident to two small cycles above and below e R respectively. Although the graph is Eulerian, it does not admit a weakly simple Euler tour. Each vertex p in the interior of the red edge e R is incident to two small triangles. Suppose that e R is not subdivided at p. Then p has degree 6. In any perturbation of a weakly simple Euler tour, vertex p is split into 3 copies, each of degree 2, and each lying above or below e R . Suppose only one copy of p lies below e R . Then it is incident to two edges of a small triangle below e R , which is then disconnected from the rest of the graph, a contradiction. Consequently, e R must be subdivided at all interior vertices. Figure 7(b) shows that O(|E|) subdivisions of e R suffice in this case.

Edge insertion
We define the problem WSPR + as finding a set of edges E + such that G + = (V, E ∪ E + ) admits a weakly simple Euler tour. Denote by E and E + , respectively, the sum of the lengths of all edges in E and E + . If the point set E is disconnected, then there is no upper bound on E + . Otherwise, we can establish worst-case upper and lower bounds for E + in terms of E . Theorem 9. Let G = (V, E) be a noncrossing multigraph such that E is a connected point set. Then there exists a set of line segments E + such that E + ≤ 3 E and G + = (V, E∪E + ) admits a weakly simple Euler tour.

Proof.
We construct E + as follows. Partition E into bars (equivalence classes of the transitive closure of the overlap relation on E). Denote by b the union of edges in a bar. W.l.o.g., we may assume that b is horizontal. Denote by u 0 , . . . , u k ∈ V the vertices of V along b sorted by x-coordinates (where b = u 0 u k ). For i = 1, . . . , k, add an edge u i−1 u i to E + if the edges of E in the bar cover the line segment u i−1 u i an odd number of times. The old and new edges in the bar b jointly form a graph of even degree that we denote by G(b). By Theorem 3, every component of G(b) admits a weakly simple Euler tour. Finally, add two more copies of edge u i−1 u i to E + for all i = 1, . . . k. After repeating the above steps for every bar, we have Figure 7 Lower bound constructions.
We omit the proof of correctness (which is provided in Appendix A.), that shows that G + admits a weakly simple Euler tour, since it is similar to the proof of Theorem 8.
Lower bound constructions. All our lower bound constructions are graphs G = (V, E) in which an edge connects two points on the boundary of the convex hull of V , denoted ch(V ). G be a family of noncrossing multigraphs. For G = (V, E) ∈ G, let E + be an edge set of minimum length E + such that G + = (V, E ∪ E + ) admits a weakly simple Euler tour; and let λ(G) = sup G∈G E + / E . Then:

Theorem 10. Let
Proof. (1) Refer to Figs. 7(a)-(c). Let n ∈ N and δ ∈ (0, 1 3 ). Place vertices v i = (i, 0), for i = 0, . . . , n, on the x-axis. A red edge of length n connects v 0 and v n . A black edge of length 1/n connects v i−1 and v i for 1 ≤ i ≤ n. A small cycle of length δ < 1 3 is placed on each v i , 1 ≤ i ∈ n − 1, on each side of the x-axis. The total length of the construction is E = 2n + 2(n − 1)δ.
Let G + = (V, E ∪ E + ) be a multigraph in which P is a weakly simple Euler tour; and let P be an ε-perturbation into a simple polygon, for some 0 < ε < δ. We define a pair of vertical lines − i : x = i + δ and + i : The portion of P between any two of these lines consists of disjoint paths whose endpoints are on the lines. By Morse theory, P contains an even number of paths between any two of these lines; and the length of such a path is at least the distance between the parallel lines. The input edges already contain two line segments between any two of these lines: a red and a black segment.
We claim that G + contains at least 4 paths between − i and + i for all but at most one index 0 ≤ i ≤ n − 1. Indeed, suppose that there are two such paths between − i and + i and between − j and + j (0 ≤ i < j ≤ n − 1). We may assume w.l.o.g. that the black edge is above the red edge between − i and + i . Then the black edge must be above the red edge between − j and + j , as well. Consequently, P cannot reach the small cycles at v i+1 , . . . , v j . This confirms the claim. It follows that E ∪ E + ≥ (4n − 2)(1 − 2δ). This lower bound tends to 2 E as n → ∞ and δn → 0.
Due to space restrictions, we omit the proofs for cases 2 and 3.

Conclusions
We have shown that WSPR is NP-complete. It follows that the decision version of the problems in Section 5 are also NP-complete: It is NP-complete to find up to k subdivision points to form a weakly simple polygon, or to find an edge set with length up to k that produce a weakly simple polygon. We have shown that Θ(|E|) subdivision points are always sufficient and sometimes necessary when the input is Eulerian; and new edges of length Θ( E ) are always sufficient and sometimes necessary when E is connected. However, the best constant coefficients are not known in most cases. We conjecture that every noncrossing Eulerian graph G = (V, E) can be augmented into a graph G + = (V, E ∪ E + ) that admits a weakly simple Euler tour such that E + ≤ E . If the segments in E do not form a weakly simple polygon, we can subdivide segments or insert new segments to create a weakly simple polygon. On the other end of the spectrum, a set of n line segment may form an exponential number of weakly simple polygons, even if all segments are collinear. It is an open problem to count exactly how many weakly simple I S A A C 2 0 1 6 143:12 Reconstruction of Weakly Simple Polygons from their Edges polygons can be obtained from the same set of line segments. Finally, we mention an open problem about reconstructing simple polygons from a subset of its edges. It is NP-complete to decide whether a geometric graph G = (V, E) can be augmented into a simple polygon P = (V, E ∪ E + ) [16]. However, it is not known whether the problem remains NP-hard when G is a perfect matching.

A Omitted proofs
Proof of Lemma 6. The reduction to Directed-WSPR is very similar to the one described in the proof of Lemma 5. Figure 8(a) shows an example of the reduction with the edges on the variable line distorted to show the overlapping segments. Black disks circled by dotted ellipses represent the same vertex. The key difference is the addition of four segments colored blue in Figure 8. All segments of the variable gadgets are directed to the right and the clause gadgets form clockwise cycles. If the Planar-Monotone-3SAT have a positive solution, we can construct a weakly simple polygon as shown in Figure 8(b) in a similar way as described in the proof of Lemma 5. The difference is that we place a blue edge in between the black and red paths of the variable gadgets and connect v n and v 0 with a blue path above the construction. Analogously to the proof of Lemma 5, if there is a positive solution for the Directed-WSPR instance, all edges of the black path of a variable gadget are on the same side of the red path. Then we can assign true/false values as previously explained, and obtain a satisfying assignment.

Proof of correctness (Theorem 9).
Here we show that G + admits a weakly simple Euler tour. Note that an ε 2 -perturbation of an ε 2 -perturbation is an ε-perturbation. We shall construct an ε 2 -perturbation of G + into an Eulerian geometric graph, and then Theorem 1 yields and ε 2 -perturbation into a simple polygon for all ε > 0.  γ 1 (b), . . . , γ (b) (b), for all bars b, into a simple Eulerian noncrossing geometric graph G.
Theorem 1 completes the proof: An Euler tour P of G can be perturbed into a simple polygon P such that dist F (P, P ) < ε 2 . The Euler tour P of G maps to an Euler tour P + of G + by identifying the vertices that lie in the same disk D v , v ∈ V ; and dist F ( P , P + ) < ε 2 .
The following lemma provides a canonical form of a weakly simple Euler tour when an edge connects two points on the boundary of the convex hull of V . Proof. Assume w.l.o.g. that ab is horizontal. Let P be an arbitrary weakly simple Euler tour of G. Cut P at the vertices u and v into paths P = {P 1 , . . . , P k }. Note that every path in P consists of edges that lie in one closed halfplane bounded by uv, since every subpath of P between the two open halfplanes must go through u or v.
Clearly, the number of paths in P between u and v is even, and the path (u, v) ∈ P lies in both closed halfplanes. Therefore, there is a partition P = P − ∪ P + such that every path in P − (resp., P + ) lies in the closed halflane below (resp., above) uv; and P − and P + each contain an even number of paths between u and v. Assume w.l.o.g. that (u, v) ∈ P + . Then the paths in P + form a weakly simple polygon. The paths in P − incident to u also form a weakly simple polygon; and the remaining paths in P − (all incident to v only) also form a weakly simple polygon, as claimed.

Proof of cases (2) and (3) (Theorem 10). (3)
The construction is similar to case (1) above. Refer to Figs. 7(d)-(e). Let n ∈ N and δ ∈ (0, 1 3 ). Place vertices v i = (i, 0), for i = 0, . . . , n, on the x-axis. A red edge of length n connects v 0 and v n . A small vertical edge of length δ is attached to each v i , 1 ≤ i ∈ n − 1, on each side of the x-axis. The total length of the construction is E = n + 2(n − 1)δ.
Let G + = (V, E ∪ E + ) be a multigraph in which P is a weakly simple Euler tour; and let P be an ε-perturbation into a simple polygon, for some 0 < ε < δ. Consider the vertical lines − i : x = i + δ and + i : x = (i + 1) − δ, for 0 ≤ i ≤ n − 1, defined above. Analogously to case (1), G + contains at least 4 path between − i and + i for all but at most one index 0 ≤ i ≤ n − 1. It follows that E ∪ E + ≥ (4n − 2)(1 − 2δ). This lower bound tends to 4 E as n → ∞ and δn → 0.
. v 2n , that alternated between the two sized of the red edge. Finally, for every i = 1, . . . , n, we have a path when i is odd, and a reflection of this path in the x-axis when i is even. The total length of the construction is E = 5n + 6nδ.
Let G + = (V, E ∪ E + ) be a multigraph in which P is a weakly simple Euler tour. The red edge connects two points on the boundary of ch(V ), we can apply Lemma 11, and P can be decomposed into three weakly simple tours: W.l.o.g., γ 1 contains the red edge and all edges of P above the x-axis; γ 2 (resp., γ 3 ) is incident to v 0 (resp., v 2n ) and contains edges below the x-axis.