A linear-time algorithm for testing full outer-2-planarity

A linear-time algorithm for testing full outer-2-planarity

Discrete Applied Mathematics 255 (2019) 234–257 Contents lists available at ScienceDirect Discrete Applied Mathematics journal homepage: www.elsevie...

946KB Sizes 0 Downloads 66 Views

Discrete Applied Mathematics 255 (2019) 234–257

Contents lists available at ScienceDirect

Discrete Applied Mathematics journal homepage: www.elsevier.com/locate/dam

A linear-time algorithm for testing full outer-2-planarity✩ ∗

Seok-Hee Hong a , , Hiroshi Nagamochi b a b

University of Sydney, Australia Kyoto University, Japan

article

info

Article history: Received 29 July 2017 Received in revised form 15 August 2018 Accepted 20 August 2018 Available online 2 November 2018 Keywords: Full-outer-2-planar graphs

a b s t r a c t A planar graph can be drawn without edge crossings in the plane. It is well known that testing planarity of a graph can be solved in linear time. A graph is 1-planar, if it admits a 1-planar embedding, where each edge has at most one crossing. Testing 1-planarity of a graph is known to be NP-complete. This paper initiates the problem of testing 2-planarity of a graph, in particular, testing ‘‘full-outer-2-planarity’’ of a graph. A graph is outer- k-planar for an integer k ≥ 0, if it admits an outer-k-planar embedding, that is, every vertex is on the outer boundary and no edge has more than k crossings. A graph is full-outer-k-planar, if it admits a full-outer-kplanar embedding, that is, an outer-k-planar embedding such that no crossing appears along the outer boundary. We present several structural properties of triconnected outer-2-planar graphs and fullouter-2-planar graphs, and prove that every triconnected full-outer-2-planar graph has a constant number of full-outer-2-planar embeddings. Based on these properties, we present linear-time algorithms for testing full-outer-2-planarity of a graph G, where G is connected, biconnected or triconnected. The algorithm also produces a full-outer-2-planar embedding of a graph, if it exists. Moreover, we show that every outer-k-planar embedding admits a straight-line drawing. © 2018 Elsevier B.V. All rights reserved.

1. Introduction Planar graphs can be embedded in the plane without edge crossings, and have been extensively studied by researchers in Graph Theory and Graph Algorithms. For example, it is well known that planar graphs with n vertices can have at most 3n − 6 edges, and testing planarity of a graph can be solved in linear time [22]. A recent research topic in topological graph theory generalizes the notion of planarity to almost planar graphs (sometimes called beyond planar graphs), i.e., non-planar graphs with some specific types of crossings, or with some forbidden crossing patterns. Examples include

• • • •

k-planar graphs: graphs that can be embedded in the plane with at most k crossings per edge [26] k-quasi-planar graphs: graphs that can be embedded in the plane without k mutually crossing edges [2] RAC graphs: graphs that can be drawn in the plane such that edges cross forming right angles only [9] fan-crossing-free graphs: graphs that can be embedded in the plane without triple of edges e, f , g, such that e and f have a common endpoint and g crosses both e and f [7]

✩ Research was supported by ARC (Australian Research Council) Future Fellowship and ARC Discovery Project DP160104148. An extended abstract of this paper appeared in Hong [20]. ∗ Corresponding author. E-mail addresses: [email protected] (S.-H. Hong), [email protected] (H. Nagamochi). https://doi.org/10.1016/j.dam.2018.08.018 0166-218X/© 2018 Elsevier B.V. All rights reserved.

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

235

Fig. 1. Illustration for outer-2-plane embeddings of graphs: (a) An FO2PE γ1 of a biconnected graph G1 ; (b) An FO2PE γ2 of a triconnected graph G2 ; (c) An O2PE γ3 of a triconnected graph G3 .

• fan-planar graphs: graphs that can be embedded in the plane, such that each edge that is crossed more than once, is crossed by a bundle of two or more edges incident to a common vertex [23]. Some mathematical results are known for these graphs, for example, their density. Let n be the number of vertices of a graph. Pach and Toth [26] proved that every 1-planar graph has at most 4n − 8 edges, and Agarwal et al. [2] (resp., Ackerman [1]) showed that every 3-quasi-planar (resp., 4-quasi-planar) graph has a linear number of edges. Fox et al. [14] proved that every k-quasi-planar graph has at most O(n log1+o(1) n) edges, which was improved by Suk and Walczak [27] to c O(2α (n) ), where α (n) denotes the inverse Ackermann function and c depends only on k. Didimo et al. [9] showed that every straight-line RAC graph (i.e. every graph that admits a straight-line drawing where edges cross at right angles) has at most 4n − 10 edges, and Cheong et al. [7] proved that every fan-crossing free graph has at most 4n − 8 edges. Kaufmann and Ueckerdt [23] showed that every fan-planar graph has at most 5n − 10 edges. Recently, algorithmics and complexity for such graphs have been investigated. Grigoriev and Bodlaender [16] and Kohrzik and Mohar [24] independently proved that testing 1-planarity of a graph is NP-complete. Argyriou et al. [3] proved that testing whether a given graph is a RAC graph is NP-hard for straight-line drawings. Binucci et al. [6] showed that testing fan-planarity of a graph is NP-hard, and Bekos et al. [5] independently showed that it is NP-hard even if the rotation system (i.e., the circular ordering of edges for each vertex) of a graph is fixed. Bannister et al. [4] showed that testing 1-planarity is fixed parameter tractable in terms of the vertex cover number, tree-depth and cyclomatic number. On the positive side, Eades et al. [10] showed that the problem of testing maximal 1-planarity (i.e., the addition of an edge destroys 1-planarity) of a graph can be solved in linear time, if a rotation system is given. Testing outer-1-planarity (i.e., 1-planar graphs with every vertex on the outer face, introduced by Eggleton [12]) of a graph, can be solved in linear time [18]. Bekos et al. [5] presented a polynomial-time algorithm for testing maximal outer-fan-planarity (i.e., fan-planar graphs where every vertex is on the outer face and the addition of an edge destroys outer-fan-planarity). 1.1. New contribution This paper initiates the problem of testing 2-planarity of a graph, in particular, testing full-outer-2-planarity of a graph. An embedding γ of a graph G in the plane is k-planar for an integer k ≥ 0, if no edge has more than k crossings. A k-planar embedding of G is called outer-k-planar (OkPE), if every vertex is on the outer boundary (i.e., outer face). An outer-k-planar embedding of G is called full-outer-k-planar (FOkPE), if no edge crossings appear along the outer boundary. A graph G is kplanar (resp., outer-k-planar, full-outer-k-planar) if it admits a k-planar (resp., outer-k-planar, full-outer-k-planar) embedding (see Fig. 1 for an illustration of FO2PEs and an O2PE). It should be noted that the problem of testing outer-2-planarity is much harder than the problem of testing outer-1planarity [18]. Note that K4 is the only triconnected outer-1-planar graph, and it has a unique outer-1-planar embedding; thus the main problem for testing outer-1-planarity was to solve the biconnected case [18]. On the contrary, we can show that there is a triconnected outer-2-planar graph which has exponentially many outer-2-planar embeddings. In this paper, we study the problem of testing full outer-2-planarity. Note that the outer boundary of an FO2PE of a biconnected graph G is a Hamiltonian cycle of G, and testing whether a given graph has a Hamiltonian cycle is NP-complete, even for cubic graphs [15]. We first study several structural properties of triconnected outer-2-planar graphs and full-outer-2-planar graphs. Based on these properties, we present a linear-time algorithm for testing the full-outer-2-planarity of a graph G. The following theorem summarizes our main results. Theorem 1. There is a linear-time algorithm that tests whether a given graph G is full-outer-2-planar, and computes a full-outer2-planar embedding of the graph if it exists.

236

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

We use a connectivity approach to prove Theorem 1. The connected case is easy; see Theorem 4 in Section 3. The biconnected case is more involved; see Theorem 6 in Section 4. The main thrust of this paper is to solve the triconnected case, described in Section 5. We prove several structural results on triconnected outer-2-planar graphs and full-outer-2-planar graphs, and devise a sophisticated reduction approach, which recursively reduces the size of the input graph. The following theorem is the key to design a linear-time algorithm for testing FO2PE. Theorem 2. The number of all FO2PEs of a triconnected graph G is constant, and the set of all FO2PEs of G can be generated in linear time. Fary’s well-known Theorem [13] shows that every plane graph admits a straight-line drawing. However, Thomassen [28] presented two forbidden subgraphs for straight-line drawings of 1-plane graphs. Hong et al. [19] gave a linear-time testing and drawing algorithm to construct a straight-line 1-planar drawing, if it exists. Recently, Nagamochi solved the more general problem of straight-line drawability for a wider class of embedded graphs [25]. Straight-line drawings of almost planar graphs are studied in [11]. On the other hand, Eggleton [12] showed that every outer-1-plane graph admits a straight-line drawing. Here we also show that, for any integer k ≥ 0, every outer-k-plane graph admits a straight-line drawing. Theorem 3. For any integer k ≥ 0, every outer-k-plane embedding admits a straight-line drawing. This paper is organized as follows. Section 2 defines basic terminology and proves that every outer-k-plane embedding admits a straight-line drawing. Section 3 shows that an instance of a connected graph can be reduced to an instance of a biconnected graph. Section 4 shows that an instance of a biconnected graph can be reduced to that of a triconnected graph, and presents a linear-time algorithm for the biconnected case. The main result of this paper, a linear-time algorithm for the triconnected case using a reduction approach (i.e., proof of Theorem 2), is presented in Section 5. Finally, Section 6 makes some concluding remarks. 2. Preliminaries 2.1. Terminology Through out the paper, graphs are simple unless stated otherwise. The sets of vertices and edges of a graph G are denoted by V (G) and E(G) respectively, where n denotes |V (G)|. For notational simplicity, we denote a graph as G = (V , E), where V represents a vertex set V (G) and E represents an edge set E(G). For a vertex v ∈ V , let E(v ) denote the set of edges v u incident to v , deg(v ) denote the degree |E(v )| of v , and N(v ) denote the set of neighbors u of v . We may indicate the underlying graph G in these notations in such a way that E(v ) and N(v ) are written as E(v; G) and N(v; G). Let X ⊆ V be subsets of vertices and F ⊆ E be a subset of edges. Let G − F denote the graph obtained from G by removing the edges in F , and G − X denote the graph obtained from G by removing the vertices in X together with the edges in ∪v∈X E(v ). Let G[X ] denote the subgraph of G induced by the vertices in X , i.e., G[X ] = G − (V − X ). Let G/X denote the graph obtained from G by contracting the vertices of a subset X into a single vertex, where any resulting loops and multiple edges are removed. A vertex of degree d is called a degree-d vertex. A simple cycle of length k is called a k-cycle, where a 3-cycle is called a triangle. A topological graph or embedding γ of a graph G is a representation of a graph in the plane, where each vertex is a point and each edge is a Jordan arc between the points representing its endpoints. Two edges cross if they have a point in common, other than their endpoints. The point in common is a crossing. To avoid pathological cases, standard non-degeneracy conditions apply: (i) two edges intersect in at most one point; (ii) no edge contains any vertex other than its endpoints; (iii) no edge crosses itself; (iv) no two edges meet tangentially; and (v) no three edges share any crossing point. Let γ be an O2PE of a graph G = (V , E). We denote by ∂γ the outer boundary of γ , which may pass through a crossing point made by two edges. An edge e ∈ E is called an outer (resp., inner) edge of γ if the whole drawing of e is part of ∂γ (resp., ∂γ passes through only the end-vertices of e). An edge is neither outer nor inner when a crossing on it appears along ∂γ . Let V∂γ , E∂γ and C∂γ denote the sets of vertices, outer edges and crossings in ∂γ . For two vertices u, v ∈ V , the boundary path traversed from u to v in the clockwise order is denoted by ∂γ [u, v]. Let V∂γ [u, v], E∂γ [u, v] and C∂γ [u, v] denote the sets of vertices, outer edges and crossings in ∂γ [u, v]. Also let V∂γ (u, v] = V∂γ [u, v] − {u}, V∂γ [u, v ) = V∂γ [u, v] − {v}, and V∂γ (u, v ) = V∂γ [u, v] − {u, v}. We call the boundary path ∂γ [u, v] crossing-free if C∂γ [u, v] = ∅, i.e., it only consists of outer edges. For an O2PE γ of a triconnected graph G = (V , E), the cyclic order [v1 , v2 , . . . , vn ] of the vertices in ∂γ completely determines the embedding γ . 2.2. Proof of Theorem 3 We first prove that every outer-k-plane embedding (OkPE) with k ≥ 0 admits a straight-line drawing.

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

237

Proof. Assume that a given graph G = (V , E) admits an OkPE γ , where possibly G is not connected. When the boundary ∂γ is not a simple cycle that consists of edges in E, we apply the following two steps to augment the embedding γ by adding a set F of new outer edges to obtain an FOkPE of a biconnected graph G′ = (V , E ∪ F ) without introducing multiple edges or new crossings. The first step connects all components in G into a single component and eliminates crossings from the boundary of the embedding. We walk along the boundary of the embedding, and add a new edge uv as an outer edge to the embedding when we encounter a vertex v ∈ V that appears immediately after a vertex u ∈ V − {v} except for crossings in the current embedding and not adjacent to v in the current graph. We show that this does not create multiple edges between u and v . This clearly holds when u and v belong to distinct components of the current graph. On the other hand the boundary contains a subpath u, c1 , c2 , . . . , cp , v passing through crossings c1 , c2 , . . . , cp , where the end-vertices u and v of such a subpath are not adjacent, because otherwise the edge uu′ that has the crossing c1 would cross edge uv ∈ E (when u′ ̸ = v ) or cross the same edge twice (when u′ = v ). Let F1 be the set of new edges, and γ1 be the resulting FOkPE embedding of the augmented graph (V , E ∪ F1 ), which is simple and connected. The second step augments the boundary ∂γ1 into a simple cycle if the graph (V , E ∪ F1 ) has a cut-vertex. For this, we traverse the boundary ∂γ in the clockwise order starting with a vertex v1 . During this, we skip visiting a cut-vertex already traversed to form a permutation [v1 , v2 , . . . , vn ] of the vertices in V in the order that we first visit them. We add new edges between non-adjacent vertices vi and vi+1 , 1 ≤ i < n as outer edges. Note that we have skipped a vertex v only when it is a cut-vertex already traversed. The resulting embedding γ2 remains fully outer-k-planar, and for the set F2 of edges newly introduced in the second step, the boundary ∂γ2 forms a simple cycle of the augmented graph G′ = (V , E ∪ F1 ∪ F2 ), which is now biconnected. Hence it suffices to show the lemma only when a given graph is biconnected and admits an FOkPE embedding, since the added edges can be removed from any straight-line drawing of G′ to obtain a straight-line drawing of G. Let [v1 , v2 , . . . , vn ] be the cyclic order of an FOkPE γ of a biconnected graph. Then fix the positions of vertices as the apices of a convex n-gon Pn , which automatically determines straight-line segments of all edges. Clearly two inner edges vi vj and vh vk cross if and only if i < h < j < k on the cyclic order in the topological embedding γ . In the geometric embedding (i.e., with straight-line edges) by Pn , the straight-line segments of two inner edges vi vj and vh vk intersect only when i < h < j < k. This implies that Pn gives a straight-line drawing of γ . □ 3. Connected graphs We now observe that we can focus on biconnected graphs to design algorithms for testing (full) outer-2-planarity. Theorem 4. A graph is outer-2-planar (resp., full-outer-2-planar) if and only if its biconnected components are outer-2-planar (resp., full-outer-2-planar). Proof. Let γ be an O2PE (resp., FO2PE) of a graph G. Then the embedding γH of a biconnected component H of G induced by γ is an O2PE (resp., FO2PE) since no new crossing is introduced and the vertices in the component stay in the same order on the boundary of γH . Conversely assume that each biconnected component H of the graph G admits an O2PE (resp., FO2PE) γH . Starting with γ ∗ := γH for some biconnected component H, we combine γ ∗ with γH ′ for a biconnected component H ′ which shares a cut-vertex with one of the processed biconnected components. Since such a cut-vertex remains on the outer boundary of γ ∗ and no new cycle through the cut-vertex is created, the newly combined embedding is also an O2PE (resp., FO2PE). By repeating this, we can obtain an O2PE (resp., FO2PE) of G. □ Thus, in what follows, we consider only biconnected graphs G as input. 4. Biconnected graphs This section shows that we can further restrict ourselves only to triconnected graphs as input. For a permutation [v1 , v2 , . . . , vn ] of the vertices of a biconnected graph G, let γ = (G, [v1 , v2 , . . . , vn ]) denote an embedding of G such that vertices v1 , v2 , . . . , vn appear along ∂γ in the clockwise order. We observe the following property. Lemma 5. Let γ be an arbitrary FO2PE of a biconnected graph G = (V , E), and H be a component in G − {u, v} for a cut-pair {u, v}. Then γ is given by a cyclic order [v1 , v2 , . . . , vn ] such that vertices v1 = u, V (H) = {v2 , v3 , . . . , vi } and vi+1 = v appear in this order. Proof. Let EH denote the set of edges incident to a vertex in H, possibly joining a vertex in H and a vertex in {u, v}. Note that no edge e ∈ EH can be adjacent to any edge in E − EH unless e is incident to u or v . This means that the vertices in V (H) ∪ {u, v} must appear consecutively along ∂γ starting from one of u and v and ending with the other of them. This proves the lemma. □

238

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

To solve the problem of finding an FO2PE γ of a graph G, we consider the problem with an additional constraint such that a set B of specified edges is required to appear along the boundary; i.e., B ⊆ E∂γ , and denote such an instance by (G, B). An FO2PE of γ of G such that B ⊆ E∂γ is called an FO2PE extension of (G, B), and an instance (G, B) is called extendible if it admits an FO2PE extension. We call a vertex subset W ⊆ V triconnected if G has at least three vertex-disjoint paths between any two vertices in W . For a maximal triconnected vertex set W with |W | ≥ 4, the triconnectivity among the vertices in W is represented by the vir graph G[W ] = (W , EW ) together with the set EW of all virtual edges that join every two nonadjacent vertices w, w ′ ∈ W vir ). that are connected by a path in the graph G − (W − {w, w ′ }). We denote by HW the triconnected graph (W , EW ∪ EW Then we can prove the next result. Theorem 6. A biconnected graph G = (V , E) admits an FO2PE if and only if the following hold: (i) for each cut-pair {u, v} ⊆ V , the number of connected components in G − {u, v} is at most 2; and vir (ii) for each maximal triconnected vertex set W ⊆ V with |W | ≥ 4, (HW , EW ) is extendible. Moreover, there is a linear-time algorithm for constructing an FO2PE of G, if it exists. Our algorithm for the biconnected case uses the decomposition of a biconnected graph G into triconnected components, defined by Hopcroft and Tarjan [21], which can be computed in linear time [17,21]. Each triconnected component consists of real edges (i.e., edges in the original graph) and virtual edges. (i.e., edges introduced during the decomposition process, which represents the other triconnected components, sharing the same virtual edges defined by cut-pairs). The SPQR tree is a data structure to represent the decomposition, defined by Di Battista and Tamassia [8]. Each node ν in the SPQR tree is associated with a graph called the skeleton of ν , denoted by σ (ν ), which corresponds to a triconnected component. There are four types of nodes ν in the SPQR tree (for details, see [8]):

• • • •

S-node: σ (ν ) is a simple cycle with at least three vertices; P-node: σ (ν ) consists of two vertices joined by at least three edges; Q-node: σ (ν ) consists of two vertices joined by two (one real and one virtual) edges; and R-node: σ (ν ) is a triconnected simple graph with at least four vertices.

The set of virtual edges in the skeleton of a node ν is denoted by Evir (ν ). In particular, for each cut-pair {u, v} ⊆ V of non-adjacent vertices (resp., adjacent vertices) removal of which leaves k ≥ 3 components (resp., k ≥ 2 components) in G − {u, v}, there is a P-node ν such that σ (ν ) consists of the vertices u and v and contains k virtual edges, each corresponding to a component in G − {u, v}; and for each maximal triconnected vertex set W ⊆ V with |W | ≥ 4, there is an R-node ν such that σ (ν ) is given by the graph HW defined above. In this paper, we use the SPR tree, a simplified version of the SPQR tree without Q-nodes, following the original definition of triconnected components by Hopcroft an Tarjan [21]. When a node ν ∗ in the SPR tree is designated as the root, the SPR tree is a rooted tree with the root ν ∗ . In a rooted SPR tree, we introduce the following notations. Let ρ be the parent node of an internal node ν . The graph σ (ρ ) has exactly one virtual edge e in common with σ (ν ); e is called the parent virtual edge in σ (ν ), and a child virtual edge in σ (ρ ). We denote by − σ − (ν ) the graph formed from σ (ν ) by deleting its parent virtual edge, and by G− ρ the graph formed from the union of σ (ν ) − − over all descendants ν of ρ , where Gρ is a subgraph of G. We also denote by Gρ the graph Gρ together with the parent virtual edge in σ (ρ ), where G− ρ = Gρ when ρ is the root. Note that Evir (ν ) is the set of virtual edges in σ (ν ) including the parent virtual edge when ν is a non-root node. For a given biconnected graph G, we establish a recurrence relationship of FO2PE problem instances (G, B) based on the SPR decomposition of G. In fact we prove that G admits an FO2PE if and only if for each node ν in the SPR decomposition of G, the instance (σ (ν ), Evir (ν )) is extendible. We easily see that for an S-node ν (σ (ν ), Evir (ν )) is a cycle and always extendible. Hence, Theorem 6, except for the time complexity result, is proved by the next lemma. Lemma 7. A biconnected graph G = (V , E) admits an FO2PE if and only if the following hold: (i) for each P-node ν , |Evir (ν )| ≤ 2; and (ii) for each R-node ν , (σ (ν ), Evir (ν )) is extendible. Proof. Necessity: Let γ be an arbitrary FO2PE of G = (V , E). For an arbitrary P-node ν , let p = |Evir (ν )|, where p ≥ 2. Thus for the two vertices u, v in the skeleton σ (ν ), G − {u, v} has p components Hi , i = 1, 2, . . . , p. By Lemma 5, for each i = 1, 2, . . . , p, the vertices u, V (Hi ) and v must appear consecutively along ∂γ . However, this is impossible unless p = 2. This proves the necessity of (i). In the following, we assume that |Evir (ν )| ≤ 2 for each P-node ν . We next show that (σ (ν ), Evir (ν )) is extendible for any R-node ν . For each virtual edge e = st ∈ Evir (ν ), the corresponding child µe of ν is an R- or an S-node or a P-node |Evir (µe )| ≤ 2, and thereby G − {s, t } consists of exactly two components He∗ and He , where V (He ) ∪ {s, t } = V (G− µe ). Hence by Lemma 5, the vertices in He for each virtual edge e = st ∈ Evir (ν ) appear consecutively between s and t along ∂γ . Therefore we can obtain an FO2PE extension ξν of (σ (ν ), Evir (ν )) from γ by

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

239

shortening the subsequence for the vertices in V (He ) ∪ {s, t } into [s, t ] for each virtual edge e = st ∈ Evir (ν ). This proves the necessity (ii). Sufficiency: For a given graph G, we first compute the SPR tree T of G, choosing a node ν ∗ as the root, and assume that the necessary condition (i) in Lemma 7 holds. For each R-node ν in the rooted SPR tree T , we assume that the necessary condition (ii) in Lemma 7 holds and an FO2PE extension ξν of (σ (ν ), Evir (ν )) can be obtained. For each P- or S-node ν in T , we can easily find an FO2PE extension ξν of (σ (ν ), Evir (ν )). We then construct an FO2PE γ of G by induction along the parent–child relationship of the rooted SPR tree T of G, as shown in the Algorithm BICONNECTED FO2PE below. Algorithm BICONNECTED FO2PE Input: A biconnected graph G. Output: An FO2PE γ of G if one exists or ∅ otherwise. 1: Construct the SPR tree T of G; 2: if |Evir (ν )|≥ 3 for some P-node ν or (σ (ν ), Evir (ν )) is not extendible for some R-node ν then 3: Return ∅ 4: else 5: Compute an FO2PE extension ξν of (σ (ν ), Evir (ν )) for each node ν in T ; 6: Choose a node ν ∗ in T as the root of T ; 7: for each node ν of T chosen from the bottom to the top along T do 8: Compute an FO2PE extension γν of (Gν , {ab}) with the parent virtual edge ab of ν (or (G, ∅) when ν = ν ∗ ) from ξν = [v1 , v2 , . . . , vn′ ] as follows: 9: for each child µ of ν and the corresponding child virtual edge st ∈ Evir (ν ) do 10: Replace the subsequence [vi = s, vi+1 = t ] in ξν with an FO2PE extension γµ = [u1 = s, u2 , u3 , . . . , up−1 , up = t ] of (Gµ , {st }) 11: end for 12: end for; 13: Return γ := γν ∗ 14: end if Let ν be a P-, R- or S-node chosen in the for-loop of lines 7–12 in Algorithm BICONNECTED FO2PE, where we have obtained an FO2PE extension ξν = [v1 , v2 , . . . , vn′ ] of (σ (ν ), Evir (ν )) in line 5, and an FO2PE extension γµ of (Gµ , {st }) for each child µ of ν and the corresponding child virtual edge st ∈ Evir (ν ) in the previous iterations of the for-loop. Since the parent edge st of µ is contained in Evir (µ), γµ is given by a cyclic order [u1 = s, u2 , u3 , . . . , up−1 , up = t ] of the vertices in Gµ . Also in ξν , the virtual edge st appears as an outer edge; i.e., vertices s and t appear consecutively as [vi = s, vi+1 = t ] in ξν . Therefore, by replacing each child virtual edge st in ξν with the corresponding FO2PE extension γµ , i.e., replacing the subsequence [vi = s, vi+1 = t ] in ξν with [u1 = s, u2 , u3 , . . . , up−1 , up = t ], we can obtain an FO2PE extension γν of (Gν , {ab}) with the parent virtual edge ab of ν or of (G, ∅) when ν = ν ∗ . This proves the sufficiency of Lemma 7. □ We now show time complexity analysis of Algorithm BICONNECTED FO2PE, which will prove the time complexity result in Theorem 6. Essentially, the algorithm can be implemented to run in linear time, if the R-node (i.e., triconnected) case can be solved in linear time. Thus, we now show that when Theorem 2 holds, Algorithm BICONNECTED FO2PE can be implemented to run in linear time. The time complexity of the line 1 of the Algorithm is linear [17,21]. After this, we see that any operation on a node ν in T takes O(|σ (ν )|) time. In lines 2 and 5, we can test whether there is no P-node ν with |Evir (ν )| ≥ 3 in O(|σ (ν )|) = O(1) time, and finding an FO2PE extension ξν of (σ (ν ), Evir (ν )) takes O(|σ (ν )|) time for a P- or S-node ν (since the structure of σ (ν ) is nearly a cycle) and O(|σ (ν )|) time for an R-node ν by Theorem 2. The for-loop of lines 7–12 takes O(n) time in total, because inserting a subsequence γµ = [u1 = s, u2 , u3 , . . . , up−1 , up = t ] into ξν = [v1 , v2 , . . . , vn′ ] at the position [vi = s, vi+1 = t ] can be carried out in O(1) time using doubly-linked lists for storing all sequences such as ξν and γµ . Hence to prove Theorem 1, it now suffices to prove Theorem 2. 5. Triconnected graphs In this section, we prove Theorem 2, i.e., every triconnected graph G has a constant number of FO2PEs, and they can be vir generated in linear time. By applying Theorem 2 to each triconnected graph (W , EW ∪ EW ) in Theorem 6, we see that FO2PE testing for biconnected graphs can be done in linear time. Section 5.1 observes some structural properties of triconnected O2PE. Sections 5.2 and 5.3 define some special partial structure of FO2PE, called ‘‘frill’’ and ‘‘rim’’, respectively. In particular, we see that every FO2PE contains a rim as its partial structure. Section 5.4 presents an outline of our inductive proof of Theorem 2 and an entire description of our algorithm to enumerate all FO2PEs. Section 5.5 gives the technical details of the reduction process in the algorithm.

240

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

5.1. Structural properties of triconnected O2PE In this section, we present some structural properties on triconnected O2PE. Lemma 8. Let G be a triconnected graph that admits an O2PE. (i) If G is not isomorphic to K3,3 , then every O2PE of G is 3-quasi-planar. (ii) Every vertex in G is of degree 3 or 4. (iii) If n ≥ 7 then G contains no subgraph isomorphic to K4 . Proof. Let γ be an arbitrary O2PE of G. (i) Assume that γ contains three pairwise crossing edges ei = ui vi , i = 1, 2, 3, where u1 , u2 , u3 , v1 , v2 and v3 appear in this order along ∂γ . Note that each of these three edges already has two crossings on it. Hence if V∂γ (u1 , u2 ) ̸ = ∅, then there must be an edge e = ab that connects a vertex a ∈ V∂γ (u1 , u2 ) and a vertex b ∈ V∂γ (u2 , u1 ), since otherwise {u1 , u2 } would be a cut-pair in a triconnected graph. However, γ cannot admit such an edge e = ab, since it would cross one of the three pairwise crossing edges. Hence V∂γ (u1 , u2 ) = ∅. Analogously we have V∂γ (u, v ) = ∅ for two end-vertices u and v of the three pairwise crossing edges which consecutively appear along ∂γ , indicating that V = {u1 , u2 , u3 , v1 , v2 , v3 }. Vertex u2 is of degree at least 3, and it has at least two incident edges e′2 and e′′2 other than edge u2 v2 , where neither of edges e′2 and e′′2 can cross e1 or e3 . This implies that vertex u2 has exactly three incident edges, u2 v2 , u2 u1 and u2 u3 . Analogously with other vertices in V , we see that each vertex in V is of degree 3 and C∂γ = ∅, indicating that G is a complete bipartite graph K3,3 between vertex sets {u1 , u3 , v2 } and {u2 , v1 , v3 }. (ii) Let v be a vertex of degree d ≥ 5 in G. Since G contains a vertex of degree ≥ 5, G is not K3,3 and γ is 3-quasi-planar by the result in (i). Without loss of generality, vertex v and its neighbors u1 , u2 , . . . , ud appear in this order along ∂γ . Since V∂γ (v, u3 ) ̸ = ∅ ̸ = V∂γ (u3 , v ) and {v, u3 } is not a cut-pair in G, an edge e = ab joins a vertex a ∈ V∂γ (v, u3 ) and a vertex b ∈ V∂γ (u3 , v ). We choose e = ab so that |V∂γ [a, b]| is maximum. Observe that a ∈ V∂γ [u1 , u3 ), b ∈ V∂γ (u3 , ud ] and (a, b) ̸ = (u1 , ud ), since otherwise e would cross at least three edges incident to v . Let a ̸ = u1 (the other case of b ̸ = ud can be treated analogously). Since u1 ∈ V∂γ (v, a) ̸ = ∅ and {v, a} is not a cut-pair in G, an edge ea = (sa , ta ) joins a vertex sa ∈ V∂γ (v, a) and a vertex ta ∈ V∂γ (a, v ). By the maximality of |V∂γ [a, b]|, edge ea crosses edge e, and hence b ̸ = ud (since otherwise e would cross ea , v u3 and v u4 ). Similarly by b ̸ = ud , we see that an edge eb = (sb , tb ) joining a vertex sb ∈ V∂γ (v, b) and a vertex tb ∈ V∂γ (b, v ) crosses e. This, however, means that e crosses three edges v u3 , ea and eb , a contradiction. This proves that no triconnected graph with a vertex of degree ≥ 5 admits any O2PE. (iii) It suffices to derive a contradiction assuming that n ≥ 7 and G contains a subgraph H of G isomorphic to K4 . Let the four vertices u1 , u2 , u3 and u4 in H appear in this order along ∂γ . Without loss of generality, let V∂γ (u1 , u2 ) ̸ = ∅. Since V∂γ (u1 , u2 ) ̸ = ∅ ̸ = V∂γ (u2 , u1 ) and {u1 , u2 } is not a cut-pair in G, an edge e = ab joins a vertex a ∈ V∂γ (u1 , u2 ) and a vertex b ∈ V∂γ (u2 , u1 ). Note that b must be vertex u3 or vertex u4 , say b = u3 , since otherwise edge ab would cross three edges in H. Now each of edges e = au3 and u2 u4 has two crossings on it. Then for each ordered pair (u, v ) ∈ {(a, u2 ), (u2 , u3 ), (u3 , u4 ), (u4 , u1 )}, we see that no edge e = xy can join a vertex x ∈ V∂γ (u, v ) and a vertex y ∈ V∂γ (v, u) without crossing three edges, and that V∂γ (u, v ) = ∅ holds, since otherwise {u, v} would be a cut-pair. Hence V = {u1 , a, u2 , u3 , u4 } ∪ V∂γ (u1 , a), where |V∂γ (u1 , a)| = n − 5 ≥ 2 by n ≥ 7. Since {u1 , a} is not a cut-pair in a triconnected graph, there is an edge e′ = a′ b′ that joins a vertex a′ ∈ V∂γ (u1 , a) and a vertex b′ ∈ V∂γ (a, u1 ). In this case, it holds b′ = u4 , since otherwise e′ would cross three edges. Now each of e′ = a′ u4 and u1 u2 has two crossings on it. Hence for each ordered pair (u, v ) ∈ {(u1 , a′ ), (a′ , u1 )}, we see that no edge e = xy can join a vertex x ∈ V∂γ (u, v ) and a vertex y ∈ V∂γ (v, u), and that V∂γ (u, v ) = ∅ holds, since otherwise {u, v} would be a cut-pair. This, however, contradicts that |V∂γ (u1 , a)| = n − 5 ≥ 2. □ Lemma 9. Let γ be an O2PE of a triconnected graph G = (V , E). Then all inner edges in γ can be sequentially ordered as e1 , e2 , . . . , ep so that ei crosses ei+1 for each i = 1, 2, . . . , p − 1. Proof. Each inner edge crosses another inner edge since otherwise its end-vertices would be a cut-pair in G. Let i := 1 and e1 be an inner edge in γ , where we choose as e1 an inner edge that crosses only one edge if one exists. After choosing inner edges e1 , e2 , . . . , ei , we let ei+1 be an inner edge e ∈ E \ {e1 , e2 , . . . , ei } that crosses ei if one exists. Note that ei+1 is uniquely determined for each i (except when i = 1 and e1 crosses two edges). We extend the sequence (e1 , e2 , . . . , ei ) as long as the next inner edge ei+1 exists. Let (e1 , e2 , . . . , ep ) denote the resulting sequence, where ep crosses no other inner edge than ep−1 (or than ep−1 and e1 ). Denote all end-vertices of edges in {e1 , e2 , . . . , ep } by z1 , z2 , . . . , zq in the order that they appear along ∂γ . By the choice of e1 and each ei , we see that no other edge in E \ {e1 , e2 , . . . , ep } crosses any inner edge in {e1 , e2 , . . . , ep }. Then for each i = 1, 2, . . . , q, the set V∂γ (zi , zi+1 ) (where zq+1 = z1 ) must be empty, since otherwise no edge joins a vertex in V∂γ (zi , zi+1 ) and a vertex in V∂γ (zi+1 , zi ) and {zi , zi+1 } would be a cut-pair in G. Hence V = {z1 , z2 , . . . , zq }. If there is an inner edge e ∈ E \ {e1 , e2 , . . . , ep }, then e crosses another inner edge e′ ∈ E \ {e1 , e2 , . . . , ep }, and the four end-vertices of e and e′ must be included in V∂γ [zi , zi+1 ] for some i since e and e′ do not cross any edge in {e1 , e2 , . . . , ep }. This contradicts that V∂γ (zi , zi+1 ) = ∅, proving that e1 , e2 , . . . , ep is a sequence of all inner edges in γ such that ei crosses ei+1 , i = 1, 2, . . . , p − 1. □

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

241

Fig. 2. (a) A frill e with span [s1 , s2 , s3 , s4 ] such that s2 is the head and s3 is the tail of e; (b) a frill e with span [s1 , s2 , s3 , s4 ] such that s2 is the tail and s3 is the head of e; (c) a (u, v )-hooked edge ab.

5.2. Frills in triconnected FO2PE In an FO2PE γ of a triconnected graph G, an outer edge e = uv joining a degree-3 vertex u and a degree-4 vertex v is called a frill if γ contains a subsequence [s1 , s2 , s3 , s4 ] with {s2 , s3 } = {u, v} such that s1 s2 s3 and s2 s3 s4 are triangles, where the degree-4 vertex v (resp., degree-3 vertex u) is called the head (resp., tail) of the frill e. We call [s1 , s2 , s3 , s4 ] the span of frill e. An operation of exchanging the positions of s2 and s3 in the cyclic order γ is called flipping frill e. It is easy to observe that the cyclic order γ ′ obtained from γ by flipping a frill is also an FO2PE of G. See Fig. 2(a)–(b) for illustrations of a frill e with span [s1 , s2 , s3 , s4 ], where the FO2PE in (b) is obtained from the FO2PE in (a) by flipping the frill e. We now prove that there are at most two frills in an FO2PE of a triconnected graph. Lemma 10. Let γ be an FO2PE of a triconnected graph G = (V , E) with n ≥ 7. Then there are at most two frills in γ , and if there are exactly two frills, then their spans share at most one vertex. Moreover flipping a frill in γ never introduces a new frill in the resulting cyclic order γ ′ . Proof. Assume that there are two frills e = xy and e′ = x′ y′ in γ . Denote their spans by [a, x, y, b] and [a′ , x′ , y′ , b′ ]. Without loss of generality assume that vertices a, x, y, b (resp., a′ , x′ , y′ , b′ ) appear in this order along ∂γ and {a, x, y, b} ∪ {a′ , x′ , y′ , b′ } ⊆ V∂γ [a, b′ ]. If the spans share at least two vertices, then we see that ‘‘x = a′ , y = x′ (deg(y) = 4) and b = y′ ’’ or ‘‘y = a′ and b = x′ (deg(y) = deg(x′ ) = 4)’’ holds, and G has no edge between V∂γ (a, b′ ) and V∂γ (b′ , a), where V∂γ (b′ , a) ̸ = ∅ by n ≥ 7. In this case, {a, b′ } would be a cut-pair, contradicting the triconnectivity of G. Hence their spans share at most one vertex. This also implies that flipping a frill in γ cannot create a triangle for a new frill and thereby never introduces a new frill. For each frill f in γ , the span contains exactly one pair of vertices u and v such that uv is an inner edge that crosses only one edge in γ , where we call such an inner edge uv the c1-edge of f . Since the spans of two frills share at most one vertex, no two frills share the same c1-edge. By Lemma 9, γ can have at most two c1-edges. Then there are at most two frills in γ . □ 5.3. Rims in triconnected FO2PE For an ordered pair (u, v ) of adjacent vertices in a triconnected graph G, an edge ab is called (u, v )-hooked in an FO2PE γ of G if ab crosses two inner edges uv and a′ a′′ such that a ∈ V∂γ (u, v ), b ∈ V∂γ (v, u) and a′ , a′′ ∈ V∂γ [u, v]. See Fig. 2(c) for an illustration of a (u, v )-hooked edge ab. We frequently use the following technical lemma on triconnected FO2PE. Lemma 11. Let γ be an FO2PE of a triconnected graph G, and let u and v be two vertices such that uv ∈ E(G) − E∂γ (i.e., uv is an inner edge). (i) If |V∂γ (u, v )| ≥ 3, then there is a (u, v )-hooked edge ab. (ii) If |V∂γ (u, v )| = 2 and there is no (u, v )-hooked edge, then each of the two vertices in V∂γ (u, v ) is of degree 3 and the inner edge incident to it crosses edge uv . Proof. Assume that |V∂γ (u, v )| ≥ 2 and there is no (u, v )-hooked edge in γ . To prove the lemma, it suffices to show that |V∂γ (u, v )| = 2 holds and each of the two vertices in V∂γ (u, v ) is of degree 3 and has an incident edge crossing uv . Since {u, v} is not a cut-pair, there is an edge ab that joins a vertex a ∈ V∂γ (u, v ) and a vertex b ∈ V∂γ (v, u). We choose an edge ab so that a is the closest to u among all edges ab crossing e = uv . If V∂γ (u, a) ̸ = ∅, then {u, a} would be a cut-pair,

242

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

Fig. 3. Illustration for rims: (a) A (3,3)-rim for a triangle v1 v2 v3 with a degree-3 vertex v2 ; (b) a (3,4)-rim for a triangle v1 v2 v3 with a degree-4 vertex v2 ; (c) a 4-rim for 4-cycle v1 v2 v3 v4 with degree-3 vertices v2 and v3 .

since each inner edge incident to a vertex in V∂γ (u, a) cannot cross a non (u, v )-hooked edge ab or edge uv by the choice of a. Hence we have V∂γ (u, a) = ∅. Similarly we choose an edge a′ b′ so that a′ ∈ V∂γ (u, v ) is the closest to v among all edges a′ b′ crossing e = uv , and we see that V∂γ (a′ , v ) = ∅. Now no edge incident to a vertex in V∂γ (a, a′ ) other than ab or a′ b′ can cross any of edges uv , ab and a′ b′ . This means that V∂γ (u, v ) = {a, a′ } (otherwise {a, a′ } would be a cut-pair) and deg(a) = deg(a′ ) = 3, as required. □ Let γ be an FO2PE of a triconnected graph G. A triangle uvw is called a (3, 3)-rim (resp., (3, 4)-rim) of γ if uv and vw are outer edges in γ and v is a degree-3 (resp., degree-4) vertex. A (3, 3)- or (3, 4)-rim is called a 3-rim. A 4-cycle uvv ′ w is a 4-rim of γ if v and v ′ are degree-3 vertices and uv , vv ′ and vw are outer edges in γ . A 3- or 4-rim is called a rim. See Fig. 3 for illustrations of rims. We first show that any FO2PE of a triconnected graph G contains a rim. Lemma 12. Every FO2PE γ of a triconnected graph G has a rim. Proof. By Lemma 8(ii), each vertex in G is of degree 3 or 4. Consider an inner edge uv such that ∂γ [u, v] is the shortest (i.e., with least edges). Hence there is no (u, v )-hooked edge, since otherwise there exists an inner edge a′ a′′ with a′ , a′′ ∈ V∂γ (u, v ), where ∂γ [a′ , a′′ ] would be shorter than ∂γ [u, v]. By Lemma 11(i), we have |V∂γ (u, v )| ≤ 2. We distinguish two cases. (Case a) |V∂γ (u, v )| = 1: Then for the vertex w ∈ V∂γ (u, v ), triangle uwv is a 3-rim of γ . (Case b) |V∂γ (u, v )| = 2: By Lemma 11(ii), each of the two vertices in V∂γ (u, v ) is of degree 3, indicating that the 4-cycle with the four vertices in V∂γ [u, v] is a 4-rim of γ . □ Moreover the next lemma tells how to choose a constant number of 3- or 4-cycles in a given triconnected graph G so that one of these cycles appears as a rim of an FO2PE of G, if one exists. Lemma 13. Let γ be an FO2PE of a triconnected graph G = (V , E) with n ≥ 10. (i) If G has a triangle, then each triangle t in G shares an edge with a triangle t ′ (possibly t ′ = t) that is a 3-rim in γ . (ii) If G does not have a triangle, then G has a 4-cycle C with an edge joining two degree-3 vertices. For any such 4-cycle C , γ contains a 4-rim with a subsequence [u1 , u2 , u3 , u4 ] that consists of the four vertices in C . Proof. Since n ≥ 7, the embedding γ is 3-quasi-planar by Lemma 8(iii). Let t be a triangle in G if one exists, and C be a 4-cycle with an edge joining two degree-3 vertices otherwise, where such a 4-cycle exists by Lemma 12. Let the vertices s1 , s2 , s3 in triangle t (resp., s1 , s2 , s3 , s4 in 4-cycle C ) appear in this order along ∂γ . For each pair (sj , sk ) such that sj sk ∈ E(G), let Ej,k be the set of edges crossing sj sk in γ . When |V∂γ (sj , sk )| ≥ 2 and V∂γ (sk , sj ) ̸ = ∅, we see by Lemma 11(i) and (ii) that Ej,k either contains an (sj , sk )-hooked edge ab with a ∈ V∂γ (sj , sk ) and b ∈ V∂γ (sk , sj ) or consists of two inner edges incident to the two degree-3 vertices in V∂γ (sk , sj ) with |V∂γ (sk , sj )| = 2. (i) Assume that triangle t is not a 3-rim of γ ; i.e., at least two edges in t, say s1 s2 and s2 s3 are inner edges in γ , where |V∂γ (s1 , s2 )| ≥ 3 and V∂γ (s2 , s3 ) ̸= ∅ can be assumed without loss of generality since n ≥ 10. Then E1,2 contains an (s1 , s2 )hooked edge ab joining a vertex a ∈ V∂γ (s1 , s2 ) and a vertex b ∈ V∂γ (s2 , s1 ), where b = s3 holds because edge ab already has two crossings. If |V∂γ (s2 , s3 )| ≥ 2 then an (s2 , s3 )-hooked edge a′ b′ in E2,3 or the two edges in E2,3 would cross s1 s2 , contradicting that neither of a′ b′ and s1 s2 has three crossings. Hence |V∂γ (s2 , s3 )| = 1 and the triangle t ′ = s2 xs3 for the vertex x ∈ V∂γ (s2 , s3 ) satisfies the lemma. (ii) We distinguish two cases, where s5 will be regarded as s1 in the following.

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

243

(Case a) No two edges in 4-cycle C cross in γ , i.e., C consists of the edges si si+1 , i = 1, 2, 3, 4: It suffices to show that at least three of these edges, say s2 s3 , s3 s4 and s4 s1 are outer edges, which implies that deg(s3 ) = deg(s4 ) = 3 in a graph with no triangles, since otherwise edge s1 s2 would have three or four crossings. Note that for each i = 1, 2, 3, 4, V∂γ (si , si+1 ) ̸ = ∅ implies that |V∂γ (si , si+1 )| ≥ 2 since G has no triangle. We first claim that |V∂γ (si , si+1 )| ≥ 3 for some i = 1, 2, 3, 4. If |V∂γ (si , si+1 )| ≤ 2 for all i = 1, 2, 3, 4, then an edge in the 4-cycle, say s4 s1 is an outer edge since otherwise deg(si ) ≥ 4 for all i = 1, 2, 3, 4. In this case, for i = 1, 2, 3, |V∂γ (si , si+1 )| = |Ei,i+1 | = 2 and the two edges in Ei,i+1 do not cross each other since n ≥ 10, G has no triangle, and γ is 3-quasi-planar. However, some edge uv ∈ E1,2 ∩ E2,3 must form a triangle us2 v , a contradiction. This proves the claim, where we assume without loss of generality that |V∂γ (s1 , s2 )| ≥ 3 and E1,2 contains an (s1 , s2 )-hooked edge a1 b1 with b1 = s4 . We observe from the structure of C that V∂γ (s2 , s3 ) ̸ = ∅ (resp., V∂γ (s2 , s3 ) ̸ = ∅) implies deg(s4 ) = 3 and (resp., deg(s2 ) = 3), and thereby s3 s4 (resp., s2 s3 ) is an outer edge in γ , since otherwise two inner edges would be incident to s4 (resp., s2 ). From the observation, if V∂γ (sj , sj+1 ) ̸ = ∅ for some j = 2, 3, 4, then an (sj , sj+1 )-hooked edge aj bj ∈ Ej,j+1 or the two edges in Ej,j+1 must cross edge s1 s2 , where edge aj bj or s1 s2 has three crossing, a contradiction. This proves that edges s2 s3 , s3 s4 and s4 s1 are all outer edges, as required. (Case b) Some two edges in 4-cycle C , say s1 s3 and s2 s4 cross in γ and s1 s2 and s3 s4 are edges in C : We prove that this case cannot occur. Now V∂γ (s2 , s3 ) ̸ = ∅ ̸ = V∂γ (s4 , s1 ) holds since G has no triangle. Assume without loss of generality that deg(s1 ) = 3 or deg(s2 ) = 3, which implies that V∂γ (s1 , s2 ) = ∅ since otherwise two inner edges would be incident to degree-3 vertex s1 or s2 . We see that |V∂γ (s3 , s4 )| ≤ 2 since otherwise an (s3 , s4 )-hooked edge in E3,4 would have three crossings. Hence |V∂γ (s2 , s3 )| ≥ 3 or |V∂γ (s4 , s1 )| ≥ 3, say |V∂γ (s2 , s3 )| ≥ 3 holds. Then an (s2 , s3 )-hooked edge in E2,3 joins a vertex a ∈ V∂γ (s2 , s3 ) and a vertex b ∈ {s1 , s4 }, where each edge in {ab, s2 s4 } (or {ab, s1 s3 }) has already two crossings. This means that no edge in E4,1 cannot cross these edges any more in γ , a contradiction. □ Note that, referring to Lemma 13(i), for each edge e of a triangle t, the number of triangles t ′ that can share edge e with t is at most four since the degree of any vertex is at most 4 by Lemma 8(ii). 5.4. Outline of the proof of Theorem 2 Here we give an outline of our algorithmic proof of Theorem 2. When n ≤ 9 we directly enumerate all possible embeddings of a given graph G. Consider the case of n ≥ 10. Initialization Given a triconnected graph G, we start to fix a rim of a possible FO2PE of G based on Lemma 13. More formally, we choose an arbitrary triangle t in G or a 4-cycle C = u1 u2 u3 u4 with deg(u2 ) = deg(u2 ) = 3 (if G has no triangle). If neither of such t and C exists, then G admits no FO2PE by Lemma 13. In the former case, we further select each triangle t ′ = uvw that shares an edge with the triangle t and treat B = {uv, vw} as a set of fixed outer edges along a 3-rim B of a possible FO2PE of G. In the latter case, we select one of B = {ui ui+1 , ui+1 ui+2 , ui+2 ui+3 } and B = {ui+3 ui+2 , ui+2 ui+1 , ui+1 ui }, i = 1, 2, 3, 4 such that deg(ui+1 ) = deg(ui+2 ) = 3 (where s5 = s1 , s6 = s2 and s7 = s3 ), and treat it as a set of fixed outer edges along a 4-rim B of a possible FO2PE of G. By Lemma 13, there are at most max{3 · 4, 4 · 2} = 12 candidates for a 3- or 4-rim in this step. Note that B is a partially fixed embedding of a possible FO2PE γ of G, and our aim is to determine the rest of the embedding of γ . We call an FO2PE of G that contains B as a subsequence an extension of (G, B). In what follows, we denote the fixed embedding constraint B = {uv, vw} (resp., B = {uv, vv ′ , v ′ w}) simply by a vertex sequence B = [u, v, w] (resp., B = [u, v, v ′ , w]) and may treat the sequence B as a set of the vertices in B for notational convenience. If G contains at most seven vertices, then we directly inspect all possible extensions of (G, B) in a constant time. We describe a scheme for reducing an instance (G, B) with at least eight vertices recursively to one with at most seven vertices. We call an instance (G, B) triconnected if G is triconnected. For an instance (G, B), where B is not necessarily defined by a rim structure, a sequence A = [s1 , s2 , . . . , sk ] is called inevitable to (G, B) if one of the following holds: (i) any FO2PE extension γ of (G, B) contains A as its subsequence; and (ii) there is a pair {si , si+1 } such that f = si si+1 is a frill in any FO2PE extension γ of (G, B) and any FO2PE extension γ of (G, B) contains A = [s1 , . . . , sk ] or the sequence A† = [s1 , . . . , si−1 , si+1 , si , si+2 , . . . , sk ] as its subsequence. Reduction Suppose that we are given a triconnected instance (G, B) with an embedding constraint B by a rim in G. We try to reduce (G, B) into a smaller instance (G′ , B′ ) with an embedding constraint B′ such that (R1) Every extension of (G, B) can be obtained from an extension of (G′ , B′ ); (R2) |V (G′ )| < |V (G)| or |V (G′ ) − B′ | < |V (G) − B| while |V (G′ )| ≤ |V (G)| and |V (G′ ) − B′ | ≤ |V (G) − B| always hold; (R3) the embedding constraint B′ satisfies the structure of a rim in G′ , where B′ may be of a different type of rim from that of B; and (R4) G′ remains triconnected (as long as (G, B) is extendible). Structural Property To find such an instance (G′ , B′ ), we will prove (via Lemmas 16–18) a structural property that a triconnected and extendible instance (G, B = [v1 , . . . , vp ]) always admits a sequence A inevitable to (G, B) which satisfies one of the following (the case that is symmetric up to reversal of whole sequences on V (G) is omitted for simplicity):

244

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

Fig. 4. (a) an inevitable sequence A = [u1 , v1 , v2 , . . . , vp ] of type (a), where V ∗ = {u1 , v1 } and v ∗ = u1 ; (b) an inevitable sequence A = [u1 , u2 , u3 , v1 , v2 , . . . , vp ] of type (b), where V ∗ = {u1 , u2 , u3 , v1 } and v ∗ = u1 ; (c) an inevitable sequence A = [u1 , u2 , . . . , uq ] of type (c); (d) a new instance (G′ = G/V ∗ , B′ = (A − V ∗ ) ∪ {v ∗ }) in the case of type (a); (e) a new instance (G′ = G/V ∗ , B′ = (A − V ∗ ) ∪ {v ∗ }) in the case of type (b); (f) a new instance (G′ , B′ = A) in the case of type (c), where G′ is obtained from G − {v2 , . . . , vp−1 } by adding a new edge u1 uq = v1′ vp′ ′ .

(a) A ⊋ B (see Fig. 4(a) for an example); (b) A = [u1 , u2 , u3 , v1 , v2 , . . . , vp ] such that f = u2 u3 is a frill with span {u1 , u2 , u3 , v1 } in any extension of (G, B) (see Fig. 4(b) for an example); and (c) A ∩ B = ∅ and edge v1 vp is not in any triangle in the graph G − {v2 , v3 , . . . , vp−1 } (see Fig. 4(c) for an example). Hence in any of the types above, a sequence of some vertices other than B can be fixed as part of an extension of (G, B) without changing the set of extensions of (G, B). In particular for (a), the set of extensions of (G, B) is equal to that of (G, A). Similarly in (b), the set of extensions of (G, B) is equal to the union of all extensions of (G, A) and those of (G, A† = [u1 , u3 , u2 , v1 , v2 , . . . , vp ]). In (c), the set of extensions of (G, B) is equal to that of G with two embedding constraints B and A. However, this observation does not immediately provide the above recursive conditions (R1)-(R4). In (a) (resp., (b)), A (resp., A or A† ) may not satisfy the structure of a rim in G. In (c), A ∪ B may not be even a single subsequence in an extension of the instance. Also in (b), two new instances (G, A) and (G, A† ) would need to be generated. To overcome these difficulties, we introduce the following three types of graph transformations. Transformation We also prove (via Lemmas 16–18) that (G, B) with an inevitable sequence A in (a)–(c) can be transformed into a new instance (G′ , B′ ) satisfying (R1)-(R4) in the following way: (T1) For type (b) and some case of type (a), choose a set V ∗ ⊆ A and a vertex v ∗ ∈ V ∗ such that each vertex in V ∗ − {v ∗ } has no neighbor in G − A, and contract the set V ∗ into the single vertex v ∗ . Let (G′ := G/V ∗ , B′ := (A − V ∗ ) ∪ {v ∗ }) be the resulting instance (see Fig. 4(d) and (e) for an example); (T2) For the remaining case of type (a), transform G into ˆ G by changing the set of edges in the induced graph G[A] so that the set of extensions of (G, B) is equal to that of (ˆ G, A). If A does not satisfy the structure of a rim in ˆ G (in Lemma 18(iv)), then (T1) will be further applied to (ˆ G, A) obtain an instance (G′ , B′ ); and (T3) For type (c), let G′ be the graph obtained from G by removing the vertices v2 , . . . , vp−1 and adding an edge u1 uq . Let (G′ , B′ := A) be the resulting instance (see Fig. 4(f)). We see that all the above transformations satisfy condition (R2), whereas a proof that condition (R1), (R3) and (R4) hold will be given in Lemmas 16–18. Precisely speaking on condition (R1), we will see that the next holds:

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

245

(i) For type (a), each extension γ of (G, B) can be obtained from an extension γ ′ of the new instance (G′ , B′ ) by replacing the contracted vertex v ∗ with a sequence ∆ for V ∗ as the reverse operation of the transformation; (ii) For type (c), each extension γ of (G, B) can be obtained from an extension γ ′ of the new instance (G′ , B′ ) by inserting sequence ∆ = [v2 , . . . , vp−1 ] between [v1 , vp ] in γ ′ as the reverse operation of the transformation; or (iii) For type (b), where the span of the frill f = u2 u3 shares a vertex v1 in B = [v1 , . . . , vp ], each extension γ of (G, B) can be obtained from an extension γ ′ of (G′ , B′ ) by replacing the contracted vertex v ∗ with a sequence ∆ for V ∗ , and by this reverse operation followed by flipping the frill f in the embedding. In (i) and (ii), there is a one-to-one correspondence between the FO2PEs of (G, B) and those of (G′ , B′ ). In (iii), exactly two FO2PEs of (G, B) will be generated from each FO2PE of (G′ , B′ ), where the instance (G, B) is reduced to a single instance (G′ , B′ ) instead of generating some two instances. Free and Fixed Frills For an instance (G, B), we call a frill f = uv in an extension γ of (G, B) free if the end-vertices of f is disjoint with B (i.e., u, v ∈ V (G) − B), and call f fixed otherwise. Note that when we determine an extension of (G, B), we do not need to consider the case where a fixed frill is flipped otherwise the embedding constraint B will be destroyed. Let us here observe that none of (T1)–(T3) introduces a ‘‘new’’ free frill in any extension of (G′ , B′ ). In (T1), let γ ′ be an extension of (G′ , B′ ), and let γ denote the extension of (G, B) obtained from γ ′ , where two sequences γ and γ ′ are equal except for the vertices in V ∗ . Let f = uv be a free frill in extension γ ′ of (G′ , B′ ), where u, v ∈ V (G′ ) − B′ . Recall that A ⊇ B, B′ = (A − V ∗ ) ∪ {v ∗ } and V (G′ ) = (V (G) − V ∗ ) ∪ {v ∗ } in (T1). Hence u, v ∈ V (G′ ) − B′ = V (G) − A ⊆ V (G) − B, implying that f = uv also appears as a free frill in γ of (G, B). In (T2), let γ ′ be an extension of (ˆ G, A), and γ denote the extension of (G, B) obtained from γ ′ , where γ = γ ′ as sequences of vertices. Let f = uv be a free frill in γ ′ of (ˆ G, A), where u, v ∈ V (ˆ G) − A. Recall that A ⊇ B and ˆ G − A = G − A in (T2). Hence ˆ u, v ∈ V (G) − A = V (G) − A ⊆ V (G) − B, implying that f = uv also appears as a free frill in γ of (G, B). In (T3), let γ ′ be an extension of (G′ , B′ ), and γ denote the extension of (G, B) obtained from γ ′ , where two sequences γ and ′ γ are equal except for the vertices {v2 , . . . , vp−1 }. Let f = uv be a free frill in extension γ ′ of (G′ , B′ ), where u, v ∈ V (G′ ) − B′ . Recall that B = [v1 , . . . , vp ], A ∩ B = ∅, B′ = A, V (G′ ) = V (G) − {v2 , . . . , vp−1 }, and v1 vp is not in any triangle in G′ in (T3). Hence the span of frill f = uv is disjoint with {v1 , vp }, since each outer edge in the span is in a triangle in γ ′ . This means that u, v ∈ V (G′ ) − {v1 , vp } = V (G) − B and f = uv also appears as a free frill in γ of (G, B). The number of FO2PEs We here analyze an upper bound on the number of FO2PEs of a triconnected instance G with n vertices according to our reduction scheme. We directly enumerate all possible embeddings of it when n ≤ 9 or generate a set of at most 12 candidates of rims B for initializing a partially fixed constraint of possible FO2PEs of G. In the former, the number of FO2PEs of G is at most (9 − 1)!. In the latter, we reduce each of the initial instances (G, B) to an instance (G′ , B′ ) with at most seven vertices by a repeated application of the reduction step. By Lemma 10, any FO2PE has at most two frills and no new frill is introduced by flipping a frill. Also, as we have observed in the above, no free fill is newly introduced in any extension of an instance (G′ , B′ ) after each application of the above reduction. Hence the number of times that a free frill appears (i.e., an inevitable sequence A is of type (b)) during the whole reduction process is at most two, which implies that the number of all extensions of the instance (G′ , B′ ) is at most 2 · 2 · (7 − 1)!. Therefore, the number of all FO2PEs of a given triconnected instance G is at most max{8!, 12 · 4 · 6!}, which is constant. Time Complexity To achieve linear-time complexity, we use several different transformations to reduce an instance (G, B) to a smaller instance (G′ , B′ ) in type (a) or (b), and we will observe that each transformation in any type of (a)–(c) can be easily executed in O(1) time, since in such cases we only need to examine a constant number of vertices or edges adjacent to B to decide which transformation to be applied. Supposing that our reduction from an instance (G, B) to a smaller instance (G′ , B′ ) can be executed in O(1) time, we see that the total running time for generating all FO2PEs of a given triconnected instance G can be done in linear time. In the rest of the paper, we prove the following lemma. Lemma 14. For a triconnected instance (G, B) with a fixed rim B, the maximum number of FO2PE extensions of (G, B) is constant, and all FO2PE extensions of (G, B) can be generated in O(n) time. Based on the outline of our algorithmic proof of Theorem 2, the entire algorithm is described as follows. Suppose that Algorithm EXTEND(G, B) is a procedure that returns all FO2PE extensions of (G, B). By executing such a procedure to each candidate rim, we can enumerate all FO2PE of a triconnected graph G, as described in Algorithm TRICONNECTED FO2PE below. Algorithm TRICONNECTED FO2PE Input: A triconnected graph G with maximum degree at most 4. Output: The set Γ of all FO2PEs of G. 1: if n ≤ 9 then 2: Output the set Γ of all FO2PEs of G 3: else 4: Γ := B := ∅; 5: if G contains a triangle then

246

6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16:

17: 18: 19: 20: 21: 22: 23:

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

Choose a triangle t in G; for each triangle t ′ = uvw that shares an edge with t (possibly t ′ = t) do B := B ∪ {[u, v, w], [v, w, u], [w, u, v]} end for; for each [u, v, w] ∈ B do Γ := Γ ∪ {EXTEND(G, [u, v, w])} end for else /* G has no triangles */ if G has a 4-cycle that contains an edge uv with deg(u) = deg(v ) = 3 then Choose a 4-cycle u1 u2 u3 u4 with deg(u2 ) = deg(u3 ) = 3; B := {[ui , ui+1 , ui+2 , ui+3 ] | i = 1, 2, 3, 4, s.t. deg(ui+1 ) = deg(ui+2 ) = 3} ∪{[ui+3 , ui+2 , ui+1 , ui ] | i = 1, 2, 3, 4, s.t. deg(ui+1 ) = deg(ui+2 ) = 3}, where s5 = s1 , s6 = s2 and s7 = s3 ; for each [u, v, v ′ , w] ∈ B do Γ := Γ ∪ {EXTEND(G, [u, v, v ′ , w])} end for end if end if; /* |Γ |= O(1) */ Output Γ after discarding duplications in Γ end if.

Assuming Lemma 14 holds, we now show that Algorithm TRICONNECTED FO2PE correctly runs in O(n) time. By Lemma 13, the set B of sequences of triangles/4-cycles is a candidate of a rim of some FO2PE extension of (G, B) if one exists. Hence the set {EXTEND(G, B) | B ∈ B} contains all FO2PE extensions of (G, B). Clearly |B| = O(1) in each of lines 11 and 19. Then {EXTEND(G, B) | B ∈ B} can be obtained in O(n) time, where |{EXTEND(G, B) | B ∈ B}|= O(|B|) = O(1) by Lemma 14. We can test if two sequences in {EXTEND(G, B) | B ∈ B} are the same cyclic order or not in O(n) time. Since |{EXTEND(G, B) | B ∈ B}|= O(1), we can output Γ after discarding duplications from {EXTEND(G, B) | B ∈ B} in O(n) time. Now to prove Theorem 2, it suffices to prove Lemma 14. In the next section, we show how to design Algorithm EXTEND(G, B). 5.5. Reducing instances with fixed rims: Proof of Lemma 14 In this section, we prove Lemma 14 by designing Algorithm EXTEND(G, B). To prove the lemma, we establish a reduction over triconnected instances (G, B) with fixed rims. More specifically, we try to extend a given partial embedding (G, B) by fixing some other vertices, and simplify the instance with the newly fixed vertices into a triconnected instance (G′ , B′ ) so that the new instance (G′ , B′ ) admits an FO2PE extension if and only if so does the original instance. Given an instance (G, B) with a fixed rim, we identify an inevitable sequence or a frill contained in any FO2PE extension of (G, B), without generating all possible permutations of the vertices in G. Based on the identified local structure of inevitable sequences or frills, we reduce (G, B) to a new smaller instance (G′ , B′ ) with a new fixed rim B′ such that (G, B) is extendible if and only if so is (G′ , B′ ). Before we establish such a reduction for the cases of (3, 3)-rim, (3, 4)-rim and 4-rim in Lemmas 16–18 respectively, we first introduce the following technical lemma. Lemma 15. For a triconnected graph G with n ≥ 8 and the maximum degree at most 4, let B = [v1 , v2 , . . . , vp ] be a p-cycle v1 v2 · · · vp in G such that p ∈ {3, 4} and deg(v2 ) = deg(v3 ) = 3 when p = 4, and let w ∈ N(v2 ) − B and w′ ∈ N(vp−1 ) − B, where w = w ′ for p = deg(v2 ) = 3, and w ̸ = w ′ for p = 3 and deg(v2 ) = 4. Assume that (G, B) admits an FO2PE extension γ , where w ∈ V∂γ (v1 , w ′ ) when p = 3 and deg(v2 ) = 4. (i) When p = 4, it holds that w ̸ = v4 , w ′ ̸ = v1 , w ′ ∈ V∂γ (v4 , w ) and w ∈ V∂γ (w ′ , v1 ). (ii) If |V∂γ (w, v1 )| ≥ 2, then there is exactly one edge e = ab between a vertex a ∈ V∂γ (w, v1 ) and a vertex b ∈ V∂γ [vp , w ), and edge e crosses two edges v1 w and a′ a′′ (̸ = v1 w ) for some vertices a′ , a′′ ∈ V∂γ [w, v1 ] (hence v1 w ̸ ∈ E(G)). Proof. Since n ≥ 8, embedding γ is 3-quasi-planar by Lemma 8(i). (i) Let p = 4. Since |V∂γ (v4 , v1 )| = n − 4 ≥ 3, there is a (v4 , v1 )-hooked edge e = ab by Lemma 11(i), where deg(v2 ) = deg(v3 ) = 3 implies a ∈ {w, w ′ } and b ∈ {v2 , v3 }. If w = v4 then e = w ′ v3 would cross edge v2 w having three crossings. Hence w ̸ = v4 . Symmetrically we have w ′ ̸ = v1 . Since γ is 3-quasi-planar, w ̸ = v4 and w ′ ̸ = v1 , implying that w ′ ∈ V∂γ (v4 , w ) and w ∈ V∂γ (w ′ , v1 ).

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

247

Fig. 5. Illustration for the reduction in Lemma 16(i) from an instance (G, B = [v1 , v2 , v3 ]) with a fixed (3, 3)-rim of a triangle v1 v2 v3 and a degree-3 vertex v2 to a new instance (G′ , B′ ): (a) a graph G with a degree-4 vertex v1 , adjacent to w ; (b) a new instance (G′ = G/{v2 , v3 }, B′ = [w, v1 , v ∗ ]) with a new (3, 3)-rim of triangle wv1 v ∗ with a degree-3 vertex v1 .

Fig. 6. Illustration for the reduction in Lemma 16(ii) from an instance (G, B = [v1 , v2 , v3 ]) with a fixed (3, 3)-rim of a triangle v1 v2 v3 and a degree-3 vertex v2 to a new instance (G′ , B′ ): (a) a graph G with a degree-3 vertex v1 , not adjacent to w; (b) a new instance (G′ = G/{z , v1 }, B′ = [v ∗ , v2 , v3 ]) with a new (3, 3)-rim of triangle v ∗ v2 v3 with a degree-3 vertex v2 .

(ii) Let |V∂γ (w, v1 )| ≥ 2. Since |V∂γ (w, v2 )| ≥ 3, a (w, v2 )-hooked edge e = ab with a ∈ V∂γ (w, v2 ) and b ∈ V∂γ (v2 , w ) crosses some edge a′ a′′ ∈ V∂γ (w, v2 ) by Lemma 11(i), where clearly a ̸ = v1 and a′ , a′′ ̸ = v2 . When p = 4, it holds b ̸ = vp−1 , since w ′ ∈ V∂γ (v4 , w ) in (i). Also no other edge than edges e = ab and v1 vp can cross v1 w , implying the uniqueness of edge e = ab. By Lemma 11 applied to (w, v1 ), this also implies that a′ a′′ ̸ = v1 w , since otherwise edge e = ab would be a (w, v1 )-hooked edge crossing another edge or two edges cross v1 w (hence would cross v1 w too). □ The next lemma shows how to reduce an instance with a fixed (3, 3)-rim, distinguishing two cases (i)–(ii) in Lemma 16, where cases (i) and (ii) are properties of type (a). Lemma 16 ((3, 3)-rim Reduction). Let (G, B) be a triconnected extendible instance with n ≥ 7 for a fixed (3, 3)-rim B = [v1 , v2 , v3 ] with N(v2 ) = {v1 , v3 , w}. Then one of the following conditions (i) and (ii) holds, and the instance (G′ , B′ ) defined in each condition is triconnected and extendible. (i) v1 or v3 , say v1 is a degree-4 vertex adjacent to w (see Fig. 5). In this case, [w, v1 , v2 , v3 ] is inevitable to (G, B). Let G′ = G/{v2 , v3 } and B′ = [w, v1 , v ∗ ] by transformation (T1). Any FO2PE extension of (G, B) is obtained by modifying an FO2PE extension γ ′ = [u1 = w, u2 = v1 , u3 = v ∗ , u4 , . . . , un′ ] of (G′ , B′ ) into γ = [w, v1 , v2 , v3 , u4 , . . . , un′ ]. (ii) v1 or v3 , say v1 is a degree-3 vertex adjacent to a vertex z ̸ ∈ {w} ∪ B (see Fig. 6). In this case, [z , v1 , v2 , v3 ] is inevitable to (G, B). Let G′ = G/{z , v1 } and B′ = [v ∗ , v2 , v3 ] by transformation (T1). Any FO2PE extension of (G, B) is obtained by modifying any FO2PE extension γ ′ = [u1 = v ∗ , u2 = v2 , u3 = v3 , u4 , . . . , un′ ] of (G′ , B′ ) into γ = [z , v1 , v2 , v3 , u4 , . . . , un′ ]. Proof. Let γ = [v1 , v2 , . . . , vn ] be an arbitrary FO2PE extension of (G, B). By Lemma 8(ii), each vertex in G is of degree 3 or 4. We first prove that either (i) or (ii) holds. Since n ≥ 7, |V∂γ (w, v1 )| ≥ 2 or |V∂γ (v3 , w )| ≥ 2. Consider the former (the latter can be treated symmetrically). By Lemma 15(ii) applied to (w, v1 ), a unique edge e = ab joins a vertex a ∈ V∂γ (w, v1 )

248

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

and b ∈ V∂γ [v3 , w ), and we also see that if deg(v1 ) = 4 then v1 is not adjacent to w . Moreover the uniqueness of e = ab implies that no (v2 , w )-hooked edge exists and |V∂γ (v3 , w )| ≤ 1, since otherwise edge e = ab would have three crossings by Lemma 15(ii) applied to (v3 , w ). When V∂γ (v3 , w ) = ∅, it holds that b = v3 and N(v3 ) = {v1 , v2 , a, w} satisfying condition (i). When |V∂γ (v3 , w )| = 1, i.e., |V∂γ (v2 , w )| = 2, we see that the condition in Lemma 11(ii) holds, since no (v2 , w )-hooked edge exists. In this case, deg(v3 ) = 3, v3 ̸ = b, N(v3 ) = {v1 , v2 , b} and V∂γ (v3 , w ) = {b} must hold, satisfying condition (ii). Clearly if deg(v1 ) = 3, then the remaining incident edge z v1 must be an outer edge in any FO2PE extension of (G, B) and [z , v1 , v2 , v3 ] is inevitable to (G, B). The above argument means that if deg(v3 ) = 4 and w ∈ N(v3 ) then deg(v1 ) = 3 or w ∈ N(v1 ), indicating that [v1 , v2 , v3 , w] is inevitable to (G, B). (i) Assume that v1 or v3 , say v1 is a degree-4 vertex adjacent to w . We have proven that [w, v1 , v2 , v3 ] is inevitable to (G, B). We now show that G′ = G/{v2 , v3 } is triconnected. If G′ is not triconnected, i.e., there is a pair of vertices u and u′ such that G′ − {u, u′ } is disconnected, then v ∗ ∈ {u, u′ } holds, since otherwise a component H in G′ − {u, u′ } not containing v ∗ still can be separated in G − {u, u′ }, contradicting the triconnectivity of G. Therefore, to show that G′ = G/{v2 , v3 } is triconnected, it suffices to show that G − {v2 , v3 , x} remains connected for any vertex x in G. Let N(v1 ; G) = {v2 , v3 , w, w ′ }. Since [w, v1 , v2 , v3 ] is inevitable to (G, B), G contains a Hamiltonian cycle along FO2PE γ where w, v1 , v2 and v3 appear consecutively. Hence if G − {v2 , v3 , x} is not connected, then it consists of exactly two components H = G[V∂γ (v3 , x)] and H ′ = G[V∂γ (x, v1 ]], where v1 , w, w ′ ∈ V∂γ (x, v1 ] by v1 w ′ ∈ E(G). See Fig. 5. Since v2 is not adjacent to any vertex of H in G, we see that H remains as a component in G − {v3 , x}, contradicting the triconnectivity of G. We next show that (G′ , B′ = [w, v1 , v ∗ ]) is extendible. Let γ ′′ be the cyclic order obtained from γ = [v1 , v2 , . . . , vn ] by replacing v2 and v3 with v ∗ . Then C∂γ ′′ = ∅ holds, B′ = [w, v1 , v ∗ ] is a (3, 3)-rim with a degree-3 vertex v1 in γ ′′ , and each edge not in the new triangle wv1 v ∗ has the same number of crossing on it, implying that γ ′′ is an FO2PE extension of (G′ , B′ ). Conversely for any FO2PE extension γ ′ = [u1 = w, u2 = v1 , u3 = v ∗ , u4 , . . . , un′ ] of (G′ , B′ ), let γ = [w, v1 , v2 , v3 , u4 , . . . , un′ ] be the cyclic order obtained from γ ′ by replacing subsequence [w, v1 , v ∗ ] with subsequence [w, v1 , v2 , v3 ]. By construction of (G′ , B′ ), we see that the expansion of v ∗ into {v2 , v3 } introduces no new crossing in γ except for one by edges v1 v3 and v2 w . Hence γ is an FO2PE extension of (G, B). The way of constructing γ from γ ′ is the reverse operation of the way of constructing the above FO2PE extension γ ′′ of (G′ , B′ ) from an FO2PE extension γ of (G, B). Hence if γ ′ = γ ′′ , then the original FO2PE extension γ can be obtained from γ ′′ . This means that any FO2PE extension of (G, B) is obtained by modifying an FO2PE extension γ ′ of (G′ , B′ ). (ii) Assume that v1 or v3 , say v1 is a degree-3 vertex not adjacent to w . We have proven that [z , v1 , v2 , v3 ] is inevitable to (G, B). To prove that G′ = G/{z , v1 } is triconnected, it suffices to show that G − {z , v1 , x} remains connected for any vertex x in G. Since [z , v1 , v2 , v3 ] is inevitable to (G, B), G contains a Hamiltonian cycle along FO2PE γ where z , v1 , v2 and v3 appear consecutively. Hence if G − {z , v1 , x} is not connected, then it consists of exactly two components H = G[V∂γ (x, z)] and H ′ = G[V∂γ [v2 , x)], where w ∈ V∂γ [v2 , x) by v2 w ∈ E(G). See Fig. 6. Since v1 is not adjacent to any vertex of H in G, we see that H remains as a component in G − {z , x}, contradicting the triconnectivity of G. Analogously with (i), we can show that (G′ , B′ ) is extendible and that any FO2PE extension of (G, B) can be obtained by modifying an FO2PE extension γ ′ = [u1 = v ∗ , u2 = v2 , u3 = v3 , u4 , . . . , un′ ] of (G′ , B′ ) into γ = [z , v1 , v2 , v3 , u4 , . . . , un′ ]. □ The next lemma shows how to reduce an instance with a fixed (3, 4)-rim, distinguishing four cases (i)–(iv) in Lemma 17, where cases (i) and (iii) are properties of type (a), (ii) of type (b) and (iv) of type (c). Note that for an instance (G, B = [v1 , v2 , v3 ]) with N(v2 ) = {v1 , v3 , w1 , w2 } for a (3, 4)-rim, we do not know the order of vertices w1 and w2 along the boundary of an FO2PE extension of (G, B). Lemma 17 ((3, 4)-rim Reduction). Let (G, B) be a triconnected extendible instance with n ≥ 7 for a fixed (3, 4)-rim B = [v1 , v2 , v3 ] with N(v2 ) = {v1 , v3 , w1 , w2 }. Then one of the following conditions (i)–(iv) holds, and the instance (G′ , B′ ) defined in each condition is triconnected and extendible. (i) v1 or v3 , say v1 is a degree-3 vertex, where N(v1 ) = {v2 , v3 , z } (see Fig. 7). In this case, [z , v1 , v2 , v3 ] is inevitable to (G, B). Let G′ = G/{v1 , z } and B′ = [v ∗ , v2 , v3 ] by transformation (T1). Any FO2PE extension of (G, B) is obtained by modifying an FO2PE extension γ ′ = [u1 = v ∗ , u2 = v2 , u3 = v3 , u4 , . . . , un′ ] of (G′ , B′ ) into γ = [z , v1 , v2 , v3 , u4 , . . . , un′ ]. (ii) v1 or v3 , say v1 is a degree-4 vertex adjacent to exactly one of w1 and w2 , say w2 , and there is a pair of degree-3 vertices z , y ̸ ∈ B such that v1 w2 z and w2 zy are triangles (see Fig. 8). In this case, any FO2PE extension of (G, B) has z w2 as a frill. Let G′ = G/{y, z , w2 , v1 } and B′ = [v ∗ , v2 , v3 ] by transformation (T1). Any FO2PE extension of (G, B) is obtained by modifying an FO2PE extension γ ′ = [u1 = v ∗ , u2 = v2 , u3 = v3 , u4 , . . . , un′ ] of (G′ , B′ ) into γ = [y, z , w2 , v1 , v2 , v3 , u4 , . . . , un′ ] and [y, w2 , z , v1 , v2 , v3 , u4 , . . . , un′ ]. (iii) v1 or v3 , say v1 is a degree-4 vertex adjacent to exactly one of w1 and w2 , say w2 , but there is no pair of degree-3 vertices z , y ̸ ∈ B such that v1 w2 z and w2 zy are triangles (see Fig. 9). In this case, [w2 , v1 , v2 , v3 ] is inevitable to (G, B). Let ˆ G be the graph obtained from G by a transformation (T2) of replacing edges v1 v3 and v2 w2 with a new edge w2 v3 , and B′ = [w2 , v1 , v2 , v3 ]. The set of FO2PE extensions of (G, B) is equal to that of (G′ = ˆ G, B′ = [w2 , v1 , v2 , v3 ]). (iv) none of the above conditions (i)–(iii) holds, edge v1 v3 is not in any triangle other than v1 v2 v3 in G, and there is an edge z1 z2 ∈ E(G) between two degree-3 vertices z1 ∈ N(w1 ) and z2 ∈ N(w2 ) (or there is a degree-4 vertex z ∈ N(w1 ) ∩ N(w2 ))

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

249

Fig. 7. Illustration for the reduction in Lemma 17(i) from an instance (G, B = [v1 , v2 , v3 ]) with a fixed (3, 4)-rim of a triangle v1 v2 v3 , a degree4 vertex v2 and a degree-3 vertex v1 (N(v1 ) = {v2 , v3 , z }) to a new instance (G′ , B′ ): (a) a graph G such that z ̸ ∈ {w1 , w2 }; (b) a new instance (G′ = G/{z , v1 }, B′ = [v ∗ , v2 , v3 ]) with a new (3, 4)-rim of triangle v ∗ v2 v3 and a degree-4 vertex v2 ; (c) a graph G such that z ∈ {w1 , w2 }; (d) a new instance (G′ = G/{z , v1 }, B′ = [v ∗ , v2 , v3 ]) with a new (3, 3)-rim of triangle v ∗ v2 v3 and a degree-3 vertex v2 .

See Fig. 10. In this case, any FO2PE extension of (G, B) contains exactly one of [w1 , z1 , z2 , w2 ] and [w2 , z2 , z1 , w1 ] (or exactly one of [w1 , z , w2 ] and [w2 , z , w1 ]) as a subsequence. Let G′ be the graph obtained from G by transformation (T3), i.e., removing vertex v2 and adding a new edge w1 w2 , and B′ = [w1 , z1 , z2 , w2 ] (or B′ = [w1 , z , w2 ]). Vertices v1 and v3 appear consecutively in any FO2PE extension γ ′ of (G′ , B′ ). Any FO2PE extension of (G, B) is obtained by modifying an FO2PE extension γ ′ = [u1 = v1 , u2 = v3 , u3 , . . . , un′ ] of (G′ , B′ ) into γ = [v1 , v2 , v3 , u3 , . . . , un′ ]. Proof. (i) Since deg(v1 ) = 3, clearly [z , v1 , v2 , v3 ] is inevitable to (G, B). Analogously with the proof of Lemma 16(i)–(ii), we can show that (G′ , B′ ) is triconnected and extendible and that for any FO2PE extension γ ′ = [u1 = v ∗ , u2 = v2 , u3 = v3 , u4 , . . . , un′ ] of (G′ , B′ ), γ = [z , v1 , v2 , v3 , u4 , . . . , un′ ] is an FO2PE extension of (G, B). (ii) Assume that v1 is a degree-4 vertex adjacent to exactly one of w1 and w2 , say w2 , and there is a pair of degree-3 vertices z and y such that v1 w2 z and w2 zy are triangles. Let γ = [v1 , v2 , . . . , vn ] be an arbitrary FO2PE extension of (G, B). We first show that γ contains [y, z , w2 , v1 , v2 ] or [y, w2 , z , v1 , v2 ] as a subsequence. Clearly γ contains [w2 , v1 , v2 ] or [z , v1 , v2 ], since it is Hamiltonian. Consider the case where γ contains [w2 , v1 , v2 ]. Since N(z) = {v1 , w2 , y}, vertices y, z and w2 must appear consecutively in this order (otherwise z would have only one outer edge incident to it in γ ). Similarly when γ contains [z , v1 , v2 ] we see from N(w2 ) = {v1 , v2 , z , y} that vertices y, w2 and z appear consecutively in this order (otherwise w2 would have only one outer edge incident to it in γ ). Therefore γ contains frill z w2 , and it holds that w2 ∈ V∂γ (w1 , v1 ). We next show that G′ = G/{y, z , w2 , v1 } is triconnected. For this, it suffices to show that the graph G − {y, z , w2 , v1 , x} remains connected for any vertex x in G. Since γ contains [y, z , w2 , v1 , v2 ] or [y, w2 , z , v1 , v2 ] as a subsequence, G contains a Hamiltonian cycle where the vertices y, {z , w2 }, v1 and v2 appear consecutively in this order. Hence if G − {y, z , w2 , v1 , x} is not connected, then it consists of exactly two components H = G[V∂γ (x, y)] and H ′ = G[V∂γ [v2 , x)], where w1 ∈ V∂γ [v2 , x) by v2 w1 ∈ E(G). See Fig. 8. Since no vertex in {z , w2 , v1 } is adjacent to any vertex of H in G, we see that H remains a component in G − {y, x}, contradicting the triconnectivity of G. Analogously with the proof of Lemma 16(i)–(ii), we can show that (G′ , B′ = [v ∗ , v2 , v3 ]) is extendible, and any FO2PE extension of (G, B) can be obtained by modifying an FO2PE extension γ ′ = [u1 = v ∗ , u2 = v2 , u3 = v3 , u4 , . . . , un′ ] of (G′ , B′ ) into [y, z , w2 , v1 , v2 , v3 , u4 , . . . , un′ ] and [y, w2 , z , v1 , v2 , v3 , u4 , . . . , un′ ].

250

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

Fig. 8. Illustration for the reduction in Lemma 17(ii) from an instance (G, B = [v1 , v2 , v3 ]) with a fixed (3, 4)-rim of a triangle v1 v2 v3 and a degree-4 vertex v2 to a new instance (G′ , B′ ): (a) a graph G such that v1 is a degree-4 vertex adjacent to exactly one of w1 and w2 , say w2 , and there is a pair of degree-3 vertices z and y such that v1 w2 z and w2 zy are triangles; (b) a new instance (G′ = G/{y, z , w2 , v1 }, B′ = [v ∗ , v2 , v3 ]) with a new (3, 3)-rim of triangle v ∗ v2 v3 and a degree-3 vertex v2 .

Fig. 9. Illustration for the reduction in Lemma 17(iii) from an instance (G, B = [v1 , v2 , v3 ]) with a fixed (3, 4)-rim of a triangle v1 v2 v3 and a degree-4 vertex v2 to a new instance (G′ , B′ ): (a) a graph G such that v1 is a degree-4 vertex adjacent to exactly one of w1 and w2 , say w2 , but there is no pair of degree-3 vertices z and y such that v1 w2 z and w2 zy are triangles; (b) a new instance (G′ = ˆ G, B′ = [w2 , v1 , v2 , v3 ]) with a new 4-rim of 4-cycle w2 v1 v2 v3 and degree-3 vertices v1 and v2 , where ˆ G is obtained from G by replacing edges v1 v3 and v2 w2 with a new edge w2 v3 .

(iii) Assume that v1 is a degree-4 vertex adjacent to exactly one of w1 and w2 , say w2 , but there is no pair of degree-3 vertices z and y such that v1 w2 z and w2 zy are triangles. Let z ∈ N(v1 ) − {v2 , v3 , w2 }, and γ = [v1 , v2 , . . . , vn ] be an arbitrary FO2PE extension of (G, B). We first claim that edge v1 w2 is an outer edge in γ . Otherwise by applying Lemma 15(ii) to inner edge v2 w2 , we see that V∂γ (w2 , v1 ) = {z } and z has exactly one inner edge za incident to it. Now deg(z) = 3 and v1 z w2 is a triangle, but we see that a is not adjacent to w2 , since w2 z is not in two triangles by the assumption on (iii). Hence V∂γ (a, w2 ) ̸ = ∅, which, however, implies that {a, w2 } is a cut-pair since each of edges w2 v2 and za has already two crossings. This proves the claim, and [w2 , v1 , v2 , v3 ] is inevitable to (G, B). Then without loss of generality it holds that w2 ∈ V∂γ (w1 , v1 ). Let ˆ G be the graph obtained from G by replacing edges v1 v3 and v2 w2 with a new edge w2 v3 . To show that ˆ G remains triconnected, we assume that ˆ G has a cut-pair {u, u′ }. We remove edges v1 v3 and v2 w2 and add a new edge w2 v3 in the FO2PE extension γ = [v1 , v2 , . . . , vn ] of (G, B). Since the same set of outer edges still forms a Hamiltonian cycle in the resulting embedding, we see that u and u′ are not consecutive along the cycle and both of them must be contained in V∂γ [v3 , w2 ] or V∂γ [w2 , v3 ] in ˆ G. In the former case, the component H in ˆ G − {u, u′ } with V (H) ⊆ V∂γ [v3 , w2 ] would be separated in G − {u, u′ }, contradicting the triconnectivity of G. In the latter, {u, u′ } is given by {w2 , v2 } or {v1 , v3 }, which, however cannot be a cut-pair in ˆ G due to edges v1 z and v2 w1 . This proves that ˆ G is triconnected. Any edge e incident to a vertex in V (G) − {w2 , v1 , v2 , v3 } = V (ˆ G) − {w2 , v1 , v2 , v3 } has the same number of crossings in γ even for ˆ G, implying that γ is also an FO2PE extension of (G′ = ˆ G, B′ = [w2 , v1 , v2 , v3 ]). Hence (G′ , B′ ) is extendible. ′ ′ ′ Similarly for any FO2PE extension γ = [u1 , u2 , . . . , un ] of (G , B ), any edge e incident to a vertex in V (G) − {w2 , v1 , v2 , v3 } has the same number crossings in γ ′ even for G, γ ′ is also an FO2PE extension of (G, B). (iv) Assume that none of the conditions (i)–(iii) holds. Hence each of v1 and v3 is a degree-4 vertex which is adjacent to both of w1 and w2 or neither of them in G. Let γ = [v1 , v2 , . . . , vn ] be an arbitrary FO2PE extension of (G, B), where w2 ∈ V∂γ (w1 , v1 ) without loss of generality. By Lemma 8(ii), each vertex in G is of degree 3 or 4.

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

251

Fig. 10. Illustration for the reduction in Lemma 17(iv) from an instance (G, B = [v1 , v2 , v3 ]) with a fixed (3, 4)-rim of a triangle v1 v2 v3 and a degree-4 vertex v2 to a new instance (G′ , B′ ): (a) a graph G such that none of conditions (i)-(iii) in Lemma 17 holds and there is an edge z1 z2 ∈ E(G) between two degree-3 vertices z1 ∈ N(w1 ) and z2 ∈ N(w2 ); (b) a new instance (G′ , B′ = [w1 , z1 , z2 , w2 ]) with a new 4-rim of 4-cycle w1 z1 z2 w2 and degree-3 vertices z1 and z2 , where G′ is obtained from G by removing vertex v2 and adding a new edge w1 w2 ; (c) a graph G such that none of conditions (i)–(iii) in Lemma 17 holds and there is a degree-4 vertex z ∈ N(w1 ) ∩ N(w2 ); (d) a new instance (G′ , B′ = [w1 , z , w2 ]) with a new (3, 4)-rim of 3-cycle w1 z w2 and a degree-3 vertex z, where G′ is obtained from G by removing vertex v2 and adding a new edge w1 w2 .

We first claim that neither v1 nor v3 is adjacent to both of w1 and w2 . To derive a contradiction, let w1 , w2 ∈ N(v1 ) ∩ N(v3 ). Then v1 w2 and v3 w1 are outer edges in γ , and |V∂γ (w1 , v1 )| ≥ n − 4 ≥ 3. By Lemma 11(i), a (w1 , v1 )-hooked edge e = ab joins a vertex a ∈ V∂γ (w1 , v1 ) and a vertex b ∈ V∂γ (v1 , w1 ) = {v2 , v3 }. Clearly a ̸ = w2 , but neither of v2 and v3 can be b. This proves the claim. Now each of v1 and v3 is a degree-4 vertex which is adjacent to neither of w1 and w2 in G. Let the two neighbors x1 and x2 in N(v1 ) −{v2 , v3 } appear in this order along ∂γ (v3 , v1 ). We show that x1 , x2 ∈ V∂γ (w2 , v1 ). Since v1 is not adjacent to w2 , we have x2 ∈ V∂γ (w2 , v1 ). If x1 ∈ V∂γ (v3 , w2 ), then an edge ab joins a vertex a ∈ V∂γ (w2 , v1 ) and a vertex b ∈ V∂γ (v1 , w2 ) since {w2 , v1 } is not a cut-pair. However, edge ab creates the third crossing on edge w2 v2 . Hence we have {x1 , x2 } ⊆ V∂γ (w2 , v1 ). Symmetrically we have N(v3 ) − {v1 , v2 } ⊆ V∂γ (v3 , w1 ). Since |V∂γ (w2 , v2 )| ≥ 3 (resp., |V∂γ (v2 , w1 )| ≥ 3), we see by Lemma 11(i) that there is a (w2 , v2 )-hooked edge y2 z2 with y2 ∈ V∂γ (w2 , v1 ) and z2 ∈ V∂γ (v3 , w2 ) (resp., a (v2 , w1 )-hooked edge y1 z1 with y1 ∈ V∂γ (v3 , w1 ) and z1 ∈ V∂γ (w1 , v1 )). In fact, it must hold that z1 ∈ V∂γ (w1 , z2 ] and z2 ∈ V∂γ [z1 , w2 ) since otherwise one of edges v2 w1 , v2 w2 , y1 z1 and y2 z2 would get three crossings. Note that possibly z1 = z2 . Since each of these four edges already has two crossings, we see that V∂γ (w1 , w2 ) = {z1 , z2 } (otherwise one of {w1 , z1 }, {z1 , z2 } and {z2 , w2 } would be a cut-pair), and that deg(z1 ) = deg(z2 ) = 3 when z1 ̸ = z2 . We easily see that no other pair {z1′ , z2′ } than {z1 , z2 } satisfies condition (iv), since otherwise edge y1 z1 would further cross some edge in the cycle w1 z1 z2 w2 z2′ z1′ (in other words, if a vertex pair {z1′ , z2′ } satisfies condition (iv) then {z1′ , z2′ } = {z1 , z2 }). Therefore any FO2PE extension of (G, B) contains exactly one of [w1 , z1 , z2 , w2 ] and [w2 , z2 , z1 , w1 ] (when z1 ̸ = z2 ) or exactly one of [w1 , z , w2 ] and [w2 , z , w1 ] (when z = z1 = z2 ) as a subsequence. This implies that edge v1 v3 is not in any triangle other than v1 v2 v3 in G since otherwise one of edges v2 w1 and v2 w2 would get three crossings. Let G′ be the graph obtained from G − v2 by adding a new edge w1 w2 , and B′ = [w1 , z1 , z2 , w2 ] (or B′ = [w1 , z , w2 ]). We show that (G′ , B′ ) is triconnected and extendible. Given any FO2PE extension γ = [v1 , v2 , v3 , . . . , vn ] of (G, B), we easily see that γ ′′ = [v1 , v3 , . . . , vn ] is an FO2PE extension of (G′ , B′ ), since the added edge w1 w2 has two crossings with edges y1 z1 and y2 z2 . Hence (G′ , B′ ) is extendible. To prove the triconnectivity of G′ , we assume that G′ has a cut-pair {u, u′ }. Clearly if {u, u′ } ⊆ V∂γ ′′ [v3 , w1 ], {u, u′ } ⊆ V∂γ ′′ [w2 , v1 ] or {u, u′ } ⊆ V∂γ ′′ [w1 , w2 ], then {u, u′ } would be a cut-pair in G. In γ ′′ , a vertex pair {u, u′ } can be a cut-pair in G′ only when |{u, u′ } ∩ V∂γ ′′ [a, b]| ∈ {0, 2} for any inner edge ab ∈ {y1 z1 , y2 z2 , w1 w2 }.

252

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

Hence it must hold that u ∈ V∂γ ′′ [v3 , y1 ], u′ ∈ V∂γ ′′ [y2 , v1 ] and {u, u′ } ̸ = {v1 , v3 }. Let H be the component in G′ − {u, u′ } containing vertex v1 or v3 , say v3 . Note that no vertex in V∂γ ′′ [v3 , u) has a neighbor in V∂γ ′′ [y2 , v1 ) since edge v2 w2 already crosses edges v1 v3 and z2 y2 in γ . Consider the vertex set V∂γ ′′ (v3 , u) ⊆ V (H), where V∂γ ′′ (v3 , u) ̸ = ∅ since deg(v3 ; G′ ) = 3 and v3 has no neighbor in V∂γ ′′ [y2 , v1 ). This means that the vertex set V∂γ ′′ (v3 , u) will be separated in G − {v3 , u}, contradicting the triconnectivity of G. Finally we show how to construct an FO2PE extension of (G, B) from an FO2PE extension γ ′ of (G′ , B′ ) after deriving an important property on γ ′ . We first examine the graph structure of (G, B) which admits an FO2PE extension γ . Let A1 = V∂γ (v3 , z1 ) and A2 = V∂γ (z2 , v1 ) when z1 ̸ = z2 , and A1 = V∂γ (v3 , z) and A2 = V∂γ (z , v1 ) when z1 = z2 . Consider the case of z1 ̸ = z2 (the case of z = z1 = z2 can be treated analogously). For B′ = [w1 , z1 , z2 , w2 ], any FO2PE extension γ ′ of (G′ , B′ ) contains [w1 , z1 , z2 , w2 ] as a subsequence by definition. Then G′ has only two edges between A1 and A2 , i.e., edges z1 z2 and v1 v3 . This means that the vertices in A1 appear in some order consecutively along ∂γ ′ of any FO2PE extension γ ′ of (G′ , B′ ), since otherwise a crossing would be generated on the boundary ∂γ ′ . Thus any FO2PE extension γ ′ = [u1 = v1 , u2 = v3 , u4 , . . . , un′ ] of (G′ , B′ ) satisfies A1 ⊆ V∂γ ′ (u3 , ui ) for ui = z1 and A2 ⊆ V∂γ ′ (ui+1 = z2 , u1 ). In particular v1 , v3 , w1 , z1 , z2 , w2 appear in this order and v1 and v3 appear consecutively along ∂γ ′ (recall that vertices w1 , z1 , z2 , w2 appear in this order in an FO2PE extension γ of (G, B)). Note that there is no edge between V∂γ ′ (u3 , ui = z1 ) and V∂γ ′ (ui+1 = z2 , u1 ). Therefore the cyclic order γ = [v1 , v2 , v3 , u4 , . . . , un′ ] obtained from γ ′ by inserting v2 between u1 = v1 and u2 = v2 is an FO2PE extension of (G, B), since the edge w1 w2 is replaced with edges w1 v2 and w2 v2 in G without creating any new crossings on the other edges in G. The way of constructing γ from γ ′ is the reverse operation of the way of constructing the above FO2PE extension γ ′′ of (G′ , B′ ) from an FO2PE extension γ of (G, B). Hence any FO2PE extension of (G, B) is obtained by modifying an FO2PE extension γ ′ of (G′ , B′ ). We here remark that computing the sets A1 and A2 would take Ω (n) time. However, without knowing {A1 , A2 }, in particular for the case of z = z1 = z2 , we can reduce (G, B) to (G′ , B′ ) only by identifying z1 and z2 (or z = z1 = z2 ), which can be done in O(1) time. □ The next lemma shows how to reduce an instance with a fixed 4-rim, distinguishing five cases (i)–(v) in Lemma 18, where cases (i) , (ii) and (iv) are properties of type (a), (iii) of type (b) and (v) of type (c). Note that for an instance (G, B = [v1 , v2 , v3 , v4 ]) with N(v2 ) = {v1 , v3 , w2 } and N(v3 ) = {v2 , v4 , w1 } for a 4-rim, we see that w1 and w2 appear always in this order after vertices v1 , v2 , v3 , v4 appear along the boundary of any ‘‘3-quasi-planar’’ FO2PE extension of (G, B). Lemma 18 (4-rim Reduction). Let (G, B) be a triconnected extendible instance with n ≥ 7 for a fixed 4-rim B = [v1 , v2 , v3 , v4 ] with N(v2 ) = {v1 , v3 , w2 } and N(v3 ) = {v2 , v4 , w1 } (possibly w1 = w2 ). Then one of the following conditions (i)–(v) holds, and the instance (G′ , B′ ) defined in each condition is triconnected and extendible. (i) v1 or v4 , say v1 is a degree-3 vertex adjacent to neither of w1 and w2 (see Fig. 11). In this case, for z ∈ N(v1 ) − {v2 , v4 }, [z , v1 , v2 , v3 , v4 ] is inevitable to (G, B). Let G′ = G/{v1 , z } and B′ = [v ∗ , v2 , v3 , v4 ] by transformation (T1). Any FO2PE extension of (G, B) is obtained by modifying an FO2PE extension γ ′ = [u1 = v ∗ , u2 = v2 , u3 = v3 , u4 = v4 , u5 , . . . , un′ ] of (G′ , B′ ) into γ = [z , v1 , v2 , v3 , v4 , u5 , . . . , un′ ]. (ii) for (v, w ) = (v1 , w2 ) or (v4 , w1 ), v is a degree-3 vertex adjacent to w . Let (v, w ) = (v1 , w2 ) without loss of generality (see Fig. 12). In this case, [w2 , v1 , v2 , v3 , v4 ] is inevitable to (G, B). Let G′ = G/{w2 , v1 , v2 } and B′ = [v ∗ , v3 , v4 ] by transformation (T1). Any FO2PE extension of (G, B) is obtained by modifying an FO2PE extension γ ′ = [u1 = v ∗ , u2 = v3 , u3 = v4 , u4 , . . . , un′ ] of (G′ , B′ ) into γ = [w2 , v1 , v2 , v3 , v4 , u4 , . . . , un′ ]. (iii) for (v, w ) = (v1 , w2 ) or (v4 , w1 ), v is a degree-4 vertex adjacent to w , and there is a pair of degree-3 vertices z , y ̸ ∈ B such that vw z and w zy are triangles. Let (v, w ) = (v1 , w2 ) without loss of generality (see Fig. 13). In this case, any FO2PE extension γ = [v1 , v2 , . . . , vn ] of (G, B) has z w2 as a frill. Let G′ = G/{y, z , w2 , v1 , v2 } and B′ = [v ∗ , v3 , v4 ] by transformation (T1). Any FO2PE extension of (G, B) is obtained by modifying an FO2PE extension γ ′ = [u1 = v ∗ , u2 = v3 , u3 = v4 , u4 , . . . , un′ ] of (G′ , B′ ) into γ = [y, z , w2 , v1 , v2 , v3 , v4 , u4 , . . . , un′ ] and [y, w2 , z , v1 , v2 , v3 , v4 , u4 , . . . , un′ ]. (iv) for (v, w ) = (v1 , w2 ) or (v4 , w1 ), v is a degree-4 vertex adjacent to w , but there is no pair of degree-3 vertices z , y ̸ ∈ B such that vw z and w zy are triangles. Let (v, w ) = (v1 , w2 ) without loss of generality (see Fig. 14). In this case, [w2 , v1 , v2 , v3 , v4 ] is inevitable to (G, B). Let ˆ G be the graph obtained from G by adding a new edge w2 v4 and deleting edge v1 v4 , let G′ = ˆ G/{v1 , v2 } and B′ = [w2 , v ∗ , v3 , v4 ], where G′ is obtained by transformation of (T2) and (T1), as shown in Fig. 14(b)-(c). Any FO2PE extension of (G, B) is obtained by modifying an FO2PE extension γ ′ = [u1 = w2 , u2 = v ∗ , u3 = v3 , u4 = v4 , u5 , . . . , un′ ] of (G′ , B′ ) into γ = [w2 , v1 , v2 , v3 , v4 , u5 , . . . , un′ ]. (v) none of the above conditions (i)–(iv) holds, edge v1 v4 is not in any triangle in G, w1 ̸ = w2 , and there is an edge z1 z2 ∈ E(G) between two degree-3 vertices z1 ∈ N(w1 ) and z2 ∈ N(w2 ) (or there is a degree-4 vertex z ∈ N(w1 ) ∩ N(w2 )). See Fig. 15. In this case, [w1 , z1 , z2 , w2 ] (or [w1 , z , w2 ]) is inevitable to (G, B). Let G′ be the graph obtained from G by transformation (T3), i.e., removing vertices v2 and v3 and adding a new edge w1 w2 , and B′ = [w1 , z1 , z2 , w2 ] (or B′ = [w1 , z , w2 ]). Vertices v1 and v4 appear consecutively in any FO2PE extension γ ′ of (G′ , B′ ). Any FO2PE extension of (G, B) is obtained by modifying an FO2PE extension γ ′ = [u1 = v1 , u2 = v4 , u3 , . . . , un′ ] of (G′ , B′ ) into γ = [v1 , v2 , v3 , v4 , u3 , . . . , un′ ].

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

253

Fig. 11. Illustration for the reduction in Lemma 18(i) from an instance (G, B = [v1 , v2 , v3 , v4 ]) with a fixed 4-rim of a 4-cycle v1 v2 v3 v4 with degree3 vertices v2 and v3 to a new instance (G′ , B′ ): (a) a graph G such that v1 is a degree-3 vertex adjacent to neither of w1 and w2 ; (b) a new instance (G′ = G/{v1 , z }, B′ = [v ∗ , v2 , v3 , v4 ]) with a new 4-rim of 4-cycle v ∗ v2 v3 v4 with degree-3 vertices v2 and v3 .

Fig. 12. Illustration for the reduction in Lemma 18(ii) from an instance (G, B = [v1 , v2 , v3 , v4 ]) with a fixed 4-rim of a 4-cycle v1 v2 v3 v4 with degree-3 vertices v2 and v3 to a new instance (G′ , B′ ): (a) a graph G such that v1 is a degree-3 vertex adjacent to w2 ; (b) a new instance (G′ = G/{w2 , v1 , v2 }, B′ = [v ∗ , v3 , v4 ]) with a new (3, 3)-rim of triangle v ∗ v3 v4 with a degree-3 vertex v3 .

Fig. 13. Illustration for the reduction in Lemma 18(iii) from an instance (G, B = [v1 , v2 , v3 , v4 ]) with a fixed 4-rim of a 4-cycle v1 v2 v3 v4 with degree-3 vertices v2 and v3 to a new instance (G′ , B′ ): (a) a graph G such that v1 is a degree-4 vertex adjacent to w2 , and there is a pair of degree-3 vertices z and y such that v1 w2 z and w2 zy are triangles; (b) a new instance (G′ = G/{y, z , w2 , v1 , v2 }, B′ = [v ∗ , v3 , v4 ]) with a new (3, 3)-rim of triangle v ∗ v3 v4 with a degree-3 vertex v3 .

Proof. Let γ = [v1 , v2 , . . . , vn ] be an arbitrary FO2PE extension of (G, B). By Lemma 8(ii), each vertex in G is of degree 3 or 4. Since n ≥ 7, embedding γ is 3-quasi-planar by Lemma 8(i), and hence it holds w2 ∈ V∂γ (w1 , v1 ).

Let z ∈ N(v1 ) − {v2 , v4 }, where z ∈ V∂γ (w2 , v1 ). If v1 (resp., v4 ) is a degree-3 vertex adjacent to w1 or w2 , then it cannot

be adjacent to w1 (resp., w2 ) in γ . This means that when v1 or v4 is a degree-3 vertex, condition (i) or (ii) holds. Also when

v1 is a degree-4 vertex adjacent to w2 or v4 is a degree-4 vertex adjacent to w1 , condition (iii) or (iv) holds.

254

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

Fig. 14. Illustration for the reduction in Lemma 18(iv) from an instance (G, B = [v1 , v2 , v3 , v4 ]) with a fixed 4-rim of a 4-cycle v1 v2 v3 v4 with degree-3 vertices v2 and v3 to a new instance (G′ , B′ ): (a) a graph G such that v1 is a degree-4 vertex adjacent to w2 , but there is no pair of degree-3 vertices z and y such that v1 w2 z and w2 zy are triangles; (a) the graph ˆ G obtained from G by adding a new edge w2 v4 and deleting edge v1 v4 ; (c) a new instance (G′ = ˆ G/{v1 , v2 }, B′ = [w2 , v ∗ , v3 , v4 ]) with a new 4-rim of 4-cycle w2 v ∗ v3 v4 with degree-3 vertices v ∗ and v3 .

Fig. 15. Illustration for the reduction in Lemma 18(v) from an instance (G, B = [v1 , v2 , v3 , v4 ]) with a fixed 4-rim of a 4-cycle v1 v2 v3 v4 with degree-3 vertices v2 and v3 to a new instance (G′ , B′ ): (a) a graph G such that none of conditions (i)-(iv) in Lemma 18 holds, w1 ̸ = w2 , and there is an edge z1 z2 ∈ E(G) between two degree-3 vertices z1 ∈ N(w1 ) and z2 ∈ N(w2 ); (b) a new instance (G′ , B′ = [w1 , z1 , z2 , w2 ]) with a new 4-rim of 4-cycle w1 z1 z2 w2 with degree-3 vertices z1 and z2 , where G′ is obtained from G by removing vertices v2 and v3 and adding a new edge w1 w2 ; (c) a graph G such that none of conditions (i)-(iv) in Lemma 18 holds, w1 ̸ = w2 , and there is a degree-4 vertex z ∈ N(w1 ) ∩ N(w2 ); (d) a new instance (G′ , B′ = [w1 , z , w2 ]) with a new (3, 4)-rim of triangle w1 z w2 with degree-4 vertex z, where G′ is obtained from G by removing vertices v2 and v3 and adding a new edge w1 w2 .

We consider the remaining case where v1 is a degree-4 vertex not adjacent to w2 and v4 is a degree-4 vertex not adjacent to w1 . Let the two neighbors x1 , x2 ∈ N(v1 ) − {v2 , v4 } appear in this order along ∂γ (v4 , v1 ). We show that x1 , x2 ∈ V∂γ (w2 , v1 ). Since v1 is not adjacent to w2 , we have x2 ∈ V∂γ (w2 , v1 ). If x1 ∈ V∂γ (v4 , w2 ), then an edge ab joins a vertex a ∈ V∂γ (w2 , v1 ) and a vertex b ∈ V∂γ (v1 , w2 ) since {w2 , v1 } is not a cut-pair. However, edge ab creates the third crossing on edge w2 v2 . Hence we have {x1 , x2 } ⊆ V∂γ (w2 , v1 ). Symmetrically we have N(v4 ) − {v1 , v3 } ⊆ V∂γ (v4 , w1 ). Since |V∂γ (w2 , v2 )| ≥ 3 (resp., |V∂γ (v3 , w1 )| ≥ 3), there is a (w2 , v2 )-hooked edge y2 z2 between y2 ∈ V∂γ (w2 , v1 ) and z2 ∈ V∂γ (v4 , w2 ) (resp., a (v3 , w1 )hooked edge y1 z1 between y1 ∈ V∂γ (v4 , w1 ) and z1 ∈ V∂γ (w1 , v1 )). In fact, it must hold that w1 ̸ = w2 , z1 ∈ V∂γ (w1 , z2 )

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

255

and z2 ∈ V∂γ (z1 , w2 ) since otherwise one of edges v2 w1 , v2 w2 , y1 z1 and y2 z2 would get three crossings. Note that possibly z1 = z2 . Since each of these four edges already has two crossings, we see that V∂γ (w1 , w2 ) = {z1 , z2 } (otherwise one of {w1 , z1 }, {z1 , z2 } and {z2 , w2 } would be a cut-pair), and that deg(z1 ) = deg(z2 ) = 3 when z1 ̸= z2 . This proves that condition (v) holds when none of (i)–(iv) occurs. (i) Since deg(v1 ) = 3, clearly [z , v1 , v2 , v3 , v4 ] is inevitable to (G, B). Analogously with the proof of Lemma 16(i)–(ii), we can show that (G′ , B′ ) is triconnected and extendible and that any FO2PE extension of (G, B) can be obtained by modifying an FO2PE extension γ ′ = [u1 = v ∗ , u2 = v2 , u3 = v3 , u4 = v4 , u5 , . . . , un′ ] of (G′ , B′ ) into γ = [z , v1 , v2 , v3 , v4 , u5 , . . . , un′ ]. (ii) Since deg(v1 ) = 3, clearly [w2 , v1 , v2 , v3 , v4 ] is inevitable to (G, B). Analogously with the proof of Lemma 16(i)–(ii), we can show that (G′ , B′ ) is triconnected and extendible and that any FO2PE extension of (G, B) can be obtained by modifying an FO2PE extension γ ′ = [u1 = v ∗ , u2 = v3 , u3 = v4 , u4 , . . . , un′ ] of (G′ , B′ ) into γ = [w2 , v1 , v2 , v3 , v4 , u4 , . . . , un′ ]. (iii) Analogously with the proof of Lemma 17(ii), we can show that any extension B into an FO2PE γ = [v1 , v2 , . . . , vn ] of G has z w2 as a frill, and that any FO2PE extension of (G, B) can be obtained by modifying any FO2PE extension γ ′ = [u1 = v ∗ , u2 = v3 , u3 = v4 , u4 , . . . , un′ ] of (G′ , B′ ) into [y, z , w2 , v1 , v2 , v3 , v4 , u4 , . . . , un′ ] and [y, w2 , z , v1 , v2 , v3 , v4 , u4 , . . . , un′ ]. (iv) Assume that for (v, w ) = (v1 , w2 ) or (v4 , w1 ), v is a degree-4 vertex adjacent to w , but there is no pair of a degree-3 vertices z and y such that vw z and w zy are triangles. Without loss of generality let (v, w ) = (v1 , w2 ) and denote N(v1 ; G) = {v2 , v4 , w2 , y}. Analogously with the proof of Lemma 17(iii), we can show that [w2 , v1 , v2 , v3 , v4 ] is inevitable to (G, B). Let ˆ G be the graph obtained from G by adding a new edge w2 v4 and deleting edge v1 v4 , and let G′ = ˆ G/{v1 , v2 }. Clearly the graph (V , E ∪ {w2 v4 }) obtained from G by adding a new edge w2 v4 is triconnected. We see that ˆ G obtained from this graph by deleting edge v1 v4 remains triconnected, since ˆ G has three internally disjoint paths, v1 v2 v3 v4 , v1 w2 , v4 and v1 yu1 u2 · · · ur v4 for {u1 , u2 , . . . , ur } = V∂γ (v4 , y). To show that G′ = ˆ G/{v1 , v2 } is triconnected, it suffices to show that ˆ G − {v1 , v2 , x} remains connected for any vertex x in ˆ G. Since [w2 , v1 , v2 , v3 , v4 ] is inevitable to (G, B), G contains a Hamiltonian cycle where the vertices w2 , v1 , v2 , v3 and v4 appear consecutively in this order. Hence if ˆ G − {v1 , v2 , x} is not connected, then it consists of exactly two components H = G[V∂γ [v3 , x)] and H ′ = G[V∂γ (x, w2 ]]. However, by the existence of edges v3 w1 and v4 w2 , no such vertex subsets V∂γ [v3 , x) and V∂γ (x, w2 ] can induce components. Hence G′ = ˆ G/{v1 , v2 } is triconnected. Analogously with the proof of Lemma 17(iii), we can prove that the set of FO2PE extensions of (G, B) is equal to that of (ˆ G, [w2 , v1 , v2 , v3 , v4 ]). Analogously with the proof of Lemma 16(i), we see that (G′ , B′ = [w2 , v ∗ , v3 , v4 ]) is extendible and that any FO2PE extension of (G, B) can be obtained by modifying an FO2PE extension γ ′ = [u1 = w2 , u2 = v ∗ , u3 = v3 , u4 = v4 , u5 , . . . , un′ ] of (G′ , B′ ) into γ = [w2 , v1 , v2 , v3 , v4 , u5 , . . . , un′ ]. (v) Analogously with the proof of Lemma 17(iv), we see that any FO2PE extension γ of (G, B) satisfies the following properties: N(v1 ) − {v2 , v4 } ⊆ V∂γ (w2 , v1 ), N(v4 ) − {v1 , v3 } ⊆ V∂γ (v4 , w1 ), there is a (w2 , v2 )-hooked edge y2 z2 between y2 ∈ V∂γ (w2 , v1 ) and z2 ∈ V∂γ [z1 , w2 ) (resp., a (v3 , w1 )-hooked edge y1 z1 between y1 ∈ V∂γ (v4 , w1 ) and z1 ∈ V∂γ (w1 , z2 ]) such that V∂γ (w1 , w2 ) = {z1 , z2 } (possibly z1 = z2 ), and deg(z1 ) = deg(z2 ) = 3 when z1 ̸ = z2 . Hence w1 ̸ = w2 . Also no other pair {z1′ , z2′ } than {z1 , z2 } satisfies condition (iv). Therefore any FO2PE extension of (G, B) contains [w1 , z1 , z2 , w2 ] (when z1 ̸ = z2 ) or [w1 , z , w2 ] (when z = z1 = z2 ) as a subsequence. Edge v1 v3 is not in any triangle in G since otherwise one of edges v2 w2 and v3 w1 would get three crossings. Analogously with the proof of Lemma 17(iv), we can prove that (G′ , B′ ) is triconnected and extendible and that any FO2PE extension of (G, B) can be obtained by modifying an FO2PE extension γ ′ = [u1 = v1 , u2 = v4 , u3 , . . . , un′ ] of (G′ , B′ ) into γ = [v1 , v2 , v3 , v4 , u3 , . . . , un′ ]. □ Note that in each of Lemmas 16–18, constructing a new instance (G′ , B′ ) and modifying an FO2PE extension γ ′ of (G′ , B′ ) into an FO2PE extension γ of (G, B) can be executed in O(1) time since G is a degree-bounded graph and γ can be obtained by inserting a subsequence. Algorithm EXTEND(G, B), which takes a triconnected graph G and a permutation B of vertices in a triangle uvw or a 4-cycle uvv ′ w with degree-3 vertices v and v ′ , and outputs all FO2PE extensions of (G, B), is described below. Algorithm EXTEND(G, B) Input: A triconnected graph G = (V , E) with n ≥ 7 and a permutation B of vertices in a triangle uvw or a 4-cycle uvv ′ w with degree-3 vertices v and v ′ . Output: All FO2PE extensions of (G, B). 1: if n ≤ 7 then 2: Return all FO2PE extensions γ of (G, B) (if one exists), or Return ∅ (otherwise) 3: else /* Partial embedding B is specified as one of the following: Case 1: B = [v1 , v2 , v3 ] for a triangle v1 v2 v3 with a degree-3 vertex v2 , where N(v2 ) = {v1 , v3 , w}; Case 2: B = [v1 , v2 , v3 ] for a triangle v1 v2 v3 with a degree-4 vertex v2 , where N(v2 ) = {v1 , v3 , w1 , w2 }; and Case 3: B = [v1 , v2 , v3 , v4 ] for a 4-cycle v1 v2 v3 v4 with degree-3 vertices v2 and v3 , where N(v2 ) = {v1 , v3 , w2 } and N(v3 ) = {v2 , v4 , w1 } */

256

4: 5: 6: 7: 8: 9:

10: 11: 12: 13: 14: 15:

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

if Case 1 (resp., Case 2, 3) holds, but none of the conditions (i)- (ii) in Lemma 16 (resp., (i)- (v) in Lemma 17, Lemma 18) holds then Return ∅ else Construct (G′ , B′ ) according to the conditions (i)- (ii) in Lemma 16 (resp., (i)- (v) in Lemma 17, Lemma 18) currently satisfied by (G, B); if Γ :=EXTEND(G′ , B′ ) ̸ = ∅ then Modify each γ ′ ∈ Γ into an FO2PE extension γ of (G, B) according to the operation in Lemma 16 (resp., Lemma 17, Lemma 18), where two FO2PE extensions of (G, B) will be constructed from the same γ ′ for the cases (ii) in Lemma 17 and (iii) in Lemma 18; Return all the resulting FO2PE extensions γ else Return ∅ end if end if end if.

Based on Algorithm EXTEND(G, B), we finally prove Lemma 14. We first show that Algorithm EXTEND(G, B) correctly delivers all FO2PE extensions of (G, B), if one exists. In line 8, EXTEND(G′ , B′ ) returns the set Γ of all FO2PE extensions γ ′ of (G′ , B′ ). In line 9, all FO2PE extensions of (G, B) can be obtained from Γ ̸ = ∅ according to the modifications stated in Lemmas 16–18. Since Algorithm EXTEND(G′ , B′ ) returns all FO2PE extensions when n ≤ 7, we see by induction that EXTEND(G, B) correctly delivers all FO2PE extensions of (G, B). We next show that Algorithm EXTEND(G, B) delivers a constant number of solutions. When n ≤ 7, the graph G has at most n − |B| ≤ 4 vertices to be arranged along the boundary of a possible FO2PE extension of (G, B), and at most 4! FO2PE extensions of (G, B) will be constructed. We construct exactly one FO2PE extension γ of (G, B) from an FO2PE extension γ ′ of (G′ , B′ ), except for the cases (ii) in Lemma 17 and (iii) in Lemma 18 wherein exactly two FO2PE extensions, say γ1 and γ2 of (G, B) will be generated from the same FO2PE extension γ ′ of (G′ , B′ ). Note that in this case, γ1 is obtained from γ2 by flipping a frill z w in the lemmas, and the frill in γi will be preserved in any extensions obtained from γi until it is output as a final solution. By Lemma 10, any FO2PE of a graph can contain at most two frills. Since no new free frill is introduced during any reduction process, generating two FO2PE extensions in line 9 can occur at most twice. Therefore, Algorithm EXTEND(G, B) delivers a constant number of FO2PE extensions of (G, B). As we have already observed, constructing a new instance (G′ , B′ ) and modifying an FO2PE can be done in O(1) time, Algorithm EXTEND(G, B) runs in O(n) time. This completes a proof of Lemma 14. 6. Conclusion In this paper, we initiate the problem of testing 2-planarity of graphs, and show that testing full-outer-2-planarity of graphs can be solved in linear time. The algorithm also produces a full-outer-2-planar embedding of a graph, if it exists. Our algorithm is based on the connectivity, i.e., we reduce a given instance of a connected graph to a biconnected graph, and then reduce a biconnected instance to a triconnected graph using the SPQR tree decomposition. Therefore, the main contribution of this paper is testing full-outer-2-planarity for a triconnected graph. On the contrary, testing outer-1-planarity for triconnected case is trivial, since K4 is the only possible triconnected outer-1-planar graph with unique outer-1-planar embedding; thus the main problem was to solve the biconnected case [18]. We present several structural properties of outer-2-planar embeddings and full-outer-2-planar embeddings of triconnected graphs, and then prove that triconnected full-outer-2-planar graphs can have constant number of full-outer-2planar embeddings. The algorithm for the triconnected case uses a sophisticated reduction approach for testing full-outer-2planarity and generating all possible full-outer-2-planar embeddings in linear time. We also show that every outer-k-planar graph admits a straight-line drawing. It is left as a future work to solve the problem of testing outer-2-planarity of a graph. References [1] E. Ackerman, On the maximum number of edges in topological graphs with no four pairwise crossing edges, Discrete Comput. Geom. 41 (3) (2009) 365–375. [2] P.K. Agarwal, B. Aronov, J. Pach, R. Pollack, M. Sharir, Quasi-planar graphs have a linear number of edges, Combinatorica 17 (1) (1997) 1–9. [3] E.N. Argyriou, M.A. Bekos, A. Symvonis, The straight-line RAC drawing problem is NP-hard, J. Graph Algorithms Appl. 16 (2) (2012) 569–597. [4] M.J. Bannister, S. Cabello, D. Eppstein, Parameterized complexity of 1-planarity, in: Proc. of WADS 2013, 2013, pp. 97–108. [5] M.A. Bekos, S. Cornelsen, L. Grilli, S. Hong, M. Kaufmann, On the recognition of fan-planar and maximal outer-fan-planar graphs, in: Proc. of Graph Drawing 2014, 2015, pp. 198–209.

S.-H. Hong and H. Nagamochi / Discrete Applied Mathematics 255 (2019) 234–257

257

[6] C. Binucci, E. Di Giacomo, W. Didimo, F. Montecchiani, M. Patrignani, A. Symvonis, I.G. Tollis, Fan-planarity: properties and complexity, Theoret. Comput. Sci. 589 (2015) 76–86. [7] O. Cheong, S. Har-Peled, H. Kim, H.-S. Kim, On the number of edges of fan-crossing free graphs, Algorithmica 73 (4) (2015) 673–695. [8] G. Di Battista, R. Tamassia, On-line planarity testing, SIAM J. Comput. 25 (5) (1996) 956–997. [9] W. Didimo, P. Eades, G. Liotta, Drawing graphs with right angle crossings, Theoret. Comput. Sci. 412 (39) (2011) 5156–5166. [10] P. Eades, S.-H. Hong, N. Katoh, G. Liotta, P. Schweitzer, Y. Suzuki, A linear time algorithm for testing maximal 1-planarity of graphs with a rotation system, Theoret. Comput. Sci. 513 (2013) 65–76. [11] P. Eades, S-H. Hong, G. Liotta, N. Katoh, S-H. Poon, Straight-line drawability of a planar graph plus an edge, in: Proc. of WADS 2015, 2015, pp. 301–313. [12] R.B. Eggleton, Rectilinear drawings of graphs, Util. Math. 29 (1986) 149–172. [13] I. Fáry, On straight line representations of planar graphs, Acta Sci. Math. Szeged 11 (1948) 229–233. [14] J. Fox, J. Pach, A. Suk, The number of edges in k-quasi-planar graphs, SIAM J. Discrete Math. 27 (1) (2013) 550–561. [15] M.R. Garey, D.S. Johnson, Computers and Intractability: A Guide to the Theory of NP-Completeness, Freeman, San Francisco, 1979. [16] A. Grigoriev, H.L. Bodlaender, Algorithms for graphs embeddable with few crossings per edge, Algorithmica 49 (1) (2007) 1–11. [17] C. Gutwenger, P. Mutzel, 2001. A linear time implementation of SPQR-trees, in: Proc. of Graph Drawing 2000, pp. 77–90. [18] S.-H. Hong, P. Eades, N. Katoh, G. Liotta, P. Schweitzer, Y. Suzuki, A linear-time algorithm for testing outer-1-planarity, Algorithmica 72 (4) (2015) 1033–1054. [19] S.-H. Hong, P. Eades, G. Liotta, S.-H. Poon, Fary’s theorem for 1-planar graphs, in: Proc. of COCOON 2012, 2012, pp. 335–346. [20] S.-H. Hong, H. Nagamochi, Testing full outer-2-planarity in linear time, in: Proc. of WG 2015, 2015, pp. 406–421. [21] J.E. Hopcroft, R.E. Tarjan, Dividing a graph into triconnected components, SIAM J. Comput. 2 (1973) 135–158. [22] J.E. Hopcroft, R.E. Tarjan, Efficient planarity testing, JACM 21 (4) (1974) 549–568. [23] M. Kaufmann, T. Ueckerdt, The density of fan-planar graphs, CoRR abs/1403.6184, 2014. [24] V.P. Korzhik, B. Mohar, Minimal obstructions for 1-immersions and hardness of 1-planarity testing, J. Graph Theory 72 (1) (2013) 30–71. [25] H. Nagamochi, Straight-line drawability of embedded graphs, Technical Report [2013-005], Department of Applied Mathematics and Physics, Kyoto University, 2013. [26] J. Pach, G. Toth, Graphs drawn with few crossings per edge, Combinatorica 17 (3) (1997) 427–439. [27] A. Suk, B. Walczak, New bounds on the maximum number of edges in k-quasi-planar graphs, Comput. Geom. 50 (2015) 24–33. [28] C. Thomassen, Rectilinear drawings of graphs, J. Graph Theory 12 (3) (1988) 335–341.