Jacob Holm

Giuseppe F Italiano
email: giuseppe.italiano@uniroma2.it

Adam Karczmarz
email: a.karczmarz@mimuw.edu.pl

Jakub Łącki

Eva Rotenberg

Decremental SPQR-trees for Planar Graphs

Keywords: 2012 ACM Subject Classification Theory of computation → Dynamic graph algorithms, Theory Graph embeddings, data structures, graph algorithms, planar graphs, SPQR-trees, triconnectivity

We present a decremental data structure for maintaining the SPQR-tree of a planar graph subject to edge contractions and deletions. The update time, amortized over Ω(n) operations, is O(log 2 n).

Via SPQR-trees, we give a decremental data structure for maintaining 3-vertex connectivity in planar graphs. It answers queries in O(1) time and processes edge deletions and contractions in O(log 2 n) amortized time. This is an exponential improvement over the previous best bound of O( √ n ) that has stood for over 20 years. In addition, the previous data structures only supported edge deletions.

Introduction

A graph algorithm is called dynamic if it is able to answer queries about a given property while the graph is undergoing a sequence of updates, such as edge insertions and deletions. It is incremental if it handles only insertions, decremental if it handles only deletions, and fully dynamic if it handles both insertions and deletions. In designing dynamic graph algorithms, one is typically interested in achieving fast query times (either constant or polylogarithmic), while minimizing the update times. The ultimate goal is to perform fast both queries and updates, i.e., to have both query and update times either constant or polylogarithmic. So far, the quest for obtaining polylogarithmic time algorithms has been successful only in few cases. Indeed, efficient dynamic algorithms with polylogarithmic time per update are known only for few problems, such as dynamic connectivity, 2-connectivity, minimum spanning tree and maximal matchings in undirected graphs (see, e.g., [START_REF] Baswana | Fully dynamic maximal matching in O(log n) update time[END_REF][START_REF] Rauch | Sampling to provide or to bound: With applications to fully dynamic graph algorithms[END_REF][START_REF] Holm | Poly-logarithmic deterministic fully-dynamic algorithms for connectivity, minimum spanning tree, 2-edge, and biconnectivity[END_REF][START_REF] Holm | Faster fully-dynamic minimum spanning forest[END_REF][START_REF] Kapron | Dynamic graph connectivity in polylogarithmic worst case time[END_REF][START_REF] Solomon | Fully dynamic maximal matching in constant update time[END_REF][START_REF] Thorup | Near-optimal fully-dynamic graph connectivity[END_REF][START_REF] Wulff-Nilsen | Faster deterministic fully-dynamic graph connectivity[END_REF]). On the other hand, some dynamic problems appear to be inherently harder. For example, the fastest known algorithms for basic dynamic problems, such as reachability, transitive closure, and dynamic shortest paths have only polynomial times per update (see, e.g., [START_REF] Chechik | Decremental single-source reachability and strongly connected components in O(m √ n ) total update time[END_REF][START_REF] Demetrescu | A new approach to dynamic all pairs shortest paths[END_REF][START_REF] Demetrescu | Mantaining dynamic matrices for fully dynamic transitive closure[END_REF][START_REF] King | Fully dynamic algorithms for maintaining all-pairs shortest paths and transitive closure in digraphs[END_REF][START_REF] Roditty | Improved dynamic reachability algorithms for directed graphs[END_REF][START_REF] Sankowski | Dynamic transitive closure via dynamic matrix inverse (extended abstract)[END_REF][START_REF] Thorup | Worst-case update times for fully-dynamic all-pairs shortest paths[END_REF]).

A similar situation holds for planar graphs where dynamic problems have been studied extensively, see e.g. [START_REF] Abraham | Fully dynamic approximate distance oracles for planar graphs via forbidden-set distance labels[END_REF][START_REF] Diks | Dynamic plane transitive closure[END_REF][START_REF] Eppstein | Separator based sparsification I: Planarity testing and minimum spanning trees[END_REF][START_REF] Eppstein | Maintenance of a minimum spanning forest in a dynamic plane graph[END_REF][START_REF] Giammarresi | Decremental 2-and 3-connectivity on planar graphs[END_REF][START_REF] Gustedt | Efficient union-find for planar graphs and other sparse graph classes[END_REF][START_REF] Holm | Contracting a Planar Graph Efficiently[END_REF][START_REF] Italiano | Improved algorithms for min cut and max flow in undirected planar graphs[END_REF][START_REF] Łacki | Improved deterministic algorithms for decremental reachability and strongly connected components[END_REF][START_REF] Łacki | The power of dynamic distance oracles: Efficient dynamic algorithms for the Steiner tree[END_REF][START_REF] Łacki | Min-cuts and shortest cycles in planar graphs in O(n log log n) time[END_REF][START_REF] Łacki | Optimal decremental connectivity in planar graphs[END_REF][START_REF] Subramanian | A fully dynamic data structure for reachability in planar digraphs[END_REF]. Despite this long-time effort, the best algorithms known for some basic problems on planar graphs, such as dynamic shortest paths and dynamic planarity testing, still have polynomial update time bounds. For instance, for fully dynamic shortest paths on planar graphs the best known bound per operation is 5 O(n 2/3 ) amortized [START_REF] Fakcharoenphol | Planar graphs, negative weight edges, shortest paths, and near linear time[END_REF][START_REF] Italiano | Improved algorithms for min cut and max flow in undirected planar graphs[END_REF][START_REF] Kaplan | Submatrix maximum queries in Monge matrices and Monge partial matrices, and their applications[END_REF][START_REF] Philip | Multiple-source shortest paths in planar graphs[END_REF], while for fully dynamic planarity testing the best known bound per operation is O( √ n ) amortized [START_REF] Eppstein | Separator based sparsification I: Planarity testing and minimum spanning trees[END_REF]. In the last years, this exponential gap between polynomial and polylogarithmic bounds has sparkled some new exciting research. On one hand, it was shown that there are dynamic graph problems, including fully dynamic shortest paths, fully dynamic single-source reachability and fully dynamic strong connectivity, for which it may be difficult to achieve subpolynomial update bounds. This started with the pioneering work by Abboud and Vassilevska-Williams [START_REF] Abboud | Popular conjectures imply strong lower bounds for dynamic problems[END_REF], who proved conditional lower bounds based on popular conjectures. Very recently, Abboud and Dahlgaard [START_REF] Abboud | Popular conjectures as a barrier for dynamic planar graph algorithms[END_REF] proved polynomial update time lower bounds for dynamic shortest paths also on planar graphs, again based on popular conjectures.

On the other hand, the question of improving the update bounds from polynomial to polylogarithmic, has, for several other dynamic graph problems, received much attention in the last years. For instance, there was a very recent improvement from polynomial to polylogarithmic bounds for decremental single-source reachability (and strongly connected components) on planar graphs: more precisely, the improvement was from O( √ n ) amortized [START_REF] Łacki | Improved deterministic algorithms for decremental reachability and strongly connected components[END_REF] to O(log 2 n log log n) amortized [START_REF] Italiano | Decremental single-source reachability in planar digraphs[END_REF] (both amortizations are over sequences of Ω(n) updates). Other problems that received a lot of attention are fully dynamic connectivity and minimum spanning tree in general graphs. Up to very recently, the best worst-case bound for both problems was O( √ n ) per update [START_REF] Eppstein | Sparsificationa technique for speeding up dynamic graph algorithms[END_REF]: since then, much effort has been devoted towards improving this bound (see e.g., [START_REF] Kapron | Dynamic graph connectivity in polylogarithmic worst case time[END_REF][START_REF] Kejlberg-Rasmussen | Faster worst case deterministic dynamic connectivity[END_REF][START_REF] Nanongkai | Dynamic spanning forest with worstcase update time: adaptive, Las Vegas, and O(n 1/2 -)-time[END_REF][START_REF] Nanongkai | Dynamic minimum spanning forest with subpolynomial worst-case update time[END_REF][START_REF] Wulff-Nilsen | Fully-dynamic minimum spanning forest with improved worst-case update time[END_REF]).

In this paper, we follow the ambitious goal of achieving polylogarithmic update bounds for dynamic graph problems. In particular, we show how to improve the update times from polynomial to polylogarithmic for another important problem on planar graphs: decremental 3-vertex connectivity. Given a graph G = (V, E) and two vertices x, y ∈ V we say that x and y are 2-vertex connected (or, as we say in the following, biconnected) if there are at least two XX:3 vertex-disjoint paths between x and y in G. We say that x and y are 3-vertex connected (or, as we say in the following, triconnected) if there are at least three vertex-disjoint paths between x and y in G. The decremental planar triconnectivity problem consists of maintaining a planar graph G subject to an arbitrary sequence of edge deletions, edge contractions, and query operations which test whether two arbitrary input vertices are triconnected. We remark that decremental triconnectivity on planar graphs is of particular importance. Apart from being a fundamental graph property, a triconnected planar graph has only one planar embedding, a property which is heavily used in graph drawing, planarity testing and testing for isomorphism [START_REF] Hopcroft | A V log V algorithm for isomorphism of triconnected planar graphs[END_REF][START_REF] Hopcroft | Linear time algorithm for isomorphism of planar graphs (preliminary report)[END_REF][START_REF] Kant | Algorithms for drawing planar graphs[END_REF]. Furthermore, our extended repertoire of operations, which includes edge contractions, contains all operations needed to obtain a graph minor, which is another important notion for planar graphs.

While polylogarithmic update bounds for decremental 2-edge and 3-edge connectivity, and for decremental biconnectivity on planar graphs have been known for more than two decades [START_REF] Giammarresi | Decremental 2-and 3-connectivity on planar graphs[END_REF], decremental triconnectivity on planar graphs presents some special challenges. Indeed, while connectivity cuts for 2-edge and 3-edge connectivity, and for biconnectivity have simple counterparts in the dual graph or in the vertex-face graph (see Section 2 for a formal definition of vertex-face graph), triconnectivity cuts (separation pairs, i.e., pairs of vertices whose removal disconnects the graph) have a much more complicated structure in planar graphs. Roughly speaking, maintaining 2-edge and 3-edge connectivity cuts in a planar graph under edge deletions corresponds to maintaining respectively self-loops and cycles of length 2 (pairs of parallel edges) in the dual graph under edge contractions. On the other side, maintaining biconnectivity and triconnectivity cuts in a planar graph under edge deletions corresponds to maintaining, respectively, cycles of length 2 and cycles of length 4 in the vertex-face graph. While detecting cycles of length 2 boils down to finding duplicates in the multiset of all edges, detecting cycles of length 4 under edge contractions is far more complex. We believe that this is the reason why designing a fast solution for decremental triconnectivity on planar graphs has been an elusive goal, and the best bound known of O( √ n ) per update [START_REF] Eppstein | Separator-based sparsification II: Edge and vertex connectivity[END_REF] has been standing for over two decades.

Our results and techniques. In this paper, we show how to solve the decremental triconnectivity problem on planar graphs in constant time per query and O(log 2 n) amortized time per edge deletion or contraction, over any sequence of Ω(n) deletions and contractions. This is an exponential speed-up over the previous O( √ n ) long-standing bound [START_REF] Eppstein | Separator-based sparsification II: Edge and vertex connectivity[END_REF]. To obtain our bounds, we also need to solve decremental biconnectivity on planar graphs in constant time per query and O(log 2 n) amortized time per edge deletion or contraction. (A better O(log n) amortized bound can be obtained if no contractions are allowed [START_REF] Holm | Contracting a Planar Graph Efficiently[END_REF]). Our results are achieved with the help of two new tools, which may be of independent interest.

The first tool is an algorithm for efficiently detecting and reporting cycles of length 4 as they arise in a dynamic planar embedded graph subject to edge contractions and insertions. The algorithm works for a graph with bounded face-degree, i.e, where each face is delimited by at most some constant number of edges. Specifically, given a plane embedded graph with bounded face-degree subject to edge-contractions and edge-insertions across a face, after each dynamic operation we can report all edges that lie on a length-4 cycle because of this dynamic operation. The total running time is O(n log n). One of the challenges that we face is that a planar graph may have as many as Ω(n 2 ) distinct cycles of length 4. Still, we give a surprisingly simple algorithm for solving this problem. The difficulty of the algorithm lies in the analysis -in fact, this analysis is the most technically involved part of this paper.

The second tool is a new data structure that maintains the SPQR-tree [START_REF] Di | On-line maintenance of triconnected components with SPQR-trees[END_REF] of a planar graph, while the graph is updated with edge deletions and edge contractions, in O(log 2 n) amortized time per operation. While incremental algorithms for maintaining the SPQR tree were known for more than two decades [START_REF] Di | On-line maintenance of triconnected components with SPQR-trees[END_REF][START_REF] Di | On-line planarity testing[END_REF], to the best of our knowledge no decremental algorithm was previously known.

Organization of the paper. The remainder of the paper is organized as follows. In Section 2, we introduce notation and definitions that we later use. Then, in Section 3 we present a high-level overview of our results. Section 4 presents our new algorithm for maintaining an SPQR-tree during edge deletions and contractions. Due to space constraints, an algorithm for detecting cycles of length 4 under contractions, which is a key tool in maintaining an SPQR tree is described in Appendix B. Moreover, the detailed discussion of how to use the SPQR-trees to maintain information about triconnectivity is deferred to Appendix A. Finally, the proofs omitted from Section 4 are given in Appendix C.

Preliminaries

Throughout the paper we use the term graph to denote an undirected multigraph, that is we allow the graphs to have parallel edges and self-loops. Formally, each edge e of such a graph is a pair ({u, w}, id(e)) consisting of a pair of vertices and a unique integer identifier used to distinguish between the parallel edges. For simplicity, in the following we skip the identifier and use just uw to denote one of the edges connecting vertices u and w. If the graph contains no parallel edges and no self-loops, we call it simple.

Given a graph G, we use V (G) to denote the vertices, and E(G) to denote the edges of G. For any

X ⊆ V (G) let G[X] denote the subgraph (X, {({u, v} , l) ∈ E(G) | u, v ∈ X}) of G induced by X.
The components of a graph G are the minimal subgraphs H ⊆ G such that for every edge uv ∈ E(G), u ∈ V (H) if and only if v ∈ V (H). The components of a graph partition the vertices and edges of the graph. A graph G is connected if it consists of a single component. For a positive integer k, a graph is k-vertex connected if and only if it is connected, has at least k vertices, and stays connected after removing any set of at most k -1 vertices. The local vertex connectivity of a pair of vertices u, v, denoted κ(u, v), is the maximal number of internally vertex-disjoint u, v-paths. By Menger's Theorem [START_REF] Menger | Zur allgemeinen kurventheorie[END_REF], G is k-vertex connected if and only if κ(u, v) ≥ k for every pair of non-adjacent vertices u, v. We say that u, v are (locally) k-vertex connected if κ(u, v) ≥ k. We follow the common practice of using biconnected as a synonym for 2-vertex connected and triconnected as a synonym for 3-vertex connected. An articulation point v of G is a vertex whose removal disconnects G. Thus a graph is biconnected if and only if it has no articulation points.

Let G be a graph and e ∈ E(G). We use G -e to denote the graph obtained from G by removing e. If e is not a self-loop, we use G/e to denote the graph obtained by contracting e. A cycle C of length |C| = k in a graph G is a cyclic sequence of edges C = e 1 , e 2 . . . , e k where e i = u i u i+1 for 1 ≤ i < k and e k = u k u 1 . A cycle is simple if id(e i ) = id(e j ) and u i = u j for i = j. We sometimes abuse notation and treat a cycle as a set of edges or a cyclic sequence of vertices. Note that this definition allows cycles of length 1 (a self-loop) or 2 (a pair of parallel edges).

Let G be a planar embedded graph. For each component H of G, let H * denote the dual graph of H, defined as the graph obtained by creating a vertex for each face in the embedding of H, and an edge e * (called the dual edge of e), connecting the two (not necessarily distinct) faces that e is incident to. Let G * denote the graph obtained from G by taking the dual of each component.

Each face f in a planar embedded graph is bounded by a (not necessarily simple) cycle called the face cycle for f . We call the length of this cycle the face-degree of f . We call any other cycle a separating cycle.

Let G be a connected planar embedded multigraph with at least one edge. Define the set E (G) of corners6 of G to be the the set of ordered pairs of (not necessarily distinct) edges (e 1 , e 2 ) such that e 1 immediately precedes e 2 in the clockwise order around some vertex, denoted v(e 1 , e 2 ). Note that if (e 1 , e 2 ) ∈ E (G), then (e * 2 , e * 1 ) ∈ E (G * ). We denote by G the vertex-face graph 7 of G (see Figure 1). This is a plane embedded multigraph with vertex set V (G) ∪ V (G * ), and an edge between v(e 1 , e 2 ) and v(e * 2 , e * 1 ) for each corner (e 1 , e 2 ) ∈ E (G). Abusing notation slightly, we can write

G as = (V (G) ∪ V (G * ), E (G)).
We use the following well-known facts about the vertex-face graph: 1. G is bipartite and planar, with a natural embedding given by the embedding of G. If v is an articulation point in G or has a self-loop, then in any planar embedding of G there is at least one face f whose face cycle contains v at least twice. Any such f is either an articulation point or has a self-loop in G * , and v and f are connected by (at least) two edges in G .

The dynamic operations on G correspond to dynamic operations on G * and G . Deleting a non-bridge edge e of G corresponds to contracting e * in G * , that is (G -e) * = G * /e * . Similarly, contracting an edge e corresponds to deleting the corresponding edge from the dual, so (G/e) * = G * -e * . Finally, deleting a non-bridge edge or contracting an edge corresponds to adding and then immediately contracting an edge across a face of G (and removing two duplicate edges).

The useful concept of a separation is well-defined, even for general graphs:

XX:6

Decremental SPQR-trees for Planar Graphs

Definition 1. Given a graph G = (V, E), a separation of G is a pair of vertex sets (V , V ) such that the induced subgraphs G = G[V ], G = G[V ] cover G, and V \ V and V \ V are both nonempty. A separation is balanced if max |V | , |V | ≤ α |V | for some fixed constant 1 2 ≤ α < 1. If (V , V ) is a separation of G, the set S = V ∩ V is called a separator of G. A separator S is small if |S| = O( |V |),

Overview of Our Approach

Our data structure for decremental triconnectivity in planar graphs consists of two main ingredients. Before describing them, we need a few definitions. We recall that a graph G that is biconnected but not triconnected has at least one separation pair, i.e., a pair of vertices that can be removed to disconnect G:

Definition 2 (Hopcroft and Tarjan [29, p. 6]). Let {a, b} be a pair of vertices in a biconnected multigraph G. Suppose the edges of G are divided into equivalence classes E 1 , E 2 , . . . , E k , such that two edges which lie on a common path not containing any vertex of {a, b} except as an end-point are in the same class. The classes E i are called the separation classes of G with respect to {a, b}. If there are at least two separation classes, then {a, b} is a separation pair of G unless (i) there are exactly two separation classes, and one class consists of a single edge, or (ii) there are exactly three classes, each consisting of a single edge (these two exceptions actually make it easier to state some properties related to separation pairs). Note that separation pair, which is a pair of vertices, should not be confused with separation (see Definition 1), which is a pair of vertex sets.

Our first ingredient for decremental triconnectivity is an algorithm for efficiently detecting separation pairs in planar graphs. The second ingredient is the maintenance of the SPQRtree [START_REF] Di | On-line maintenance of triconnected components with SPQR-trees[END_REF] for each biconnected component of a graph G under edge deletions and contractions. The SPQR-tree captures the structure of all separating pairs, and can be defined as follows: Definition 3. The SPQR-tree for a biconnected multigraph G = (V, E) with at least 3 edges is a tree with nodes labeled S, P, or R, where each node x has an associated skeleton graph Γ(x) with the following properties:

For every node x in the SPQR tree, V (Γ(x)) ⊆ V . For every edge (x, y) in the SPQR tree, V (Γ(x)) ∩ V (Γ(y)) is a separation pair {a, b} in G, and there is a virtual edge ab in each of Γ(x) and Γ(y).

For every node x in the SPQR tree, every edge in Γ(x) is either in E or a virtual edge corresponding to an edge (x, y) in the SPQR-tree.

For every edge e ∈ E there is a unique node x in the SPQR-tree such that e ∈ E(Γ(x)).

If x is an S-node, Γ(x) is a simple cycle with at least 3 edges.

If x is a P-node, Γ(x) consists of a pair of vertices with at least 3 parallel edges. If x is an R-node, Γ(x) is a simple triconnected graph.

No two S-nodes are neighbors, and no two P-nodes are neighbors. It turns out (see e.g. [START_REF] Di | On-line maintenance of triconnected components with SPQR-trees[END_REF]) that the SPQR-tree for a biconnected graph is unique. The (skeleton graphs associated with) nodes of the SPQR-tree are sometimes referred to as the triconnected components of G.

Detecting separating 4-cycles. A 4-cycle is a simple cycle of length 4. We say that a 4-cycle in a planar embedded graph G is a face 4-cycle if it is a cycle bounding a face of G, and a separating 4-cycle otherwise. As we show in Appendix C, there is a one-to-one correspondence between separation pairs in G and separating 4-cycles in the vertex-face graph G .

Since no two parallel edges can lie on the same 4-cycle, and no self-loop can be contained in a 4-cycle, we can assume the input graph is simple. However, when we contract edges, new parallel edges and self-loops may arise. To handle this, we could detect and remove parallel edges, but it turns out that both the algorithm and the analysis become simpler if we keep (most of) the additional edges, as long as no two parallel edges are consecutive in the circular ordering around both their endpoints.

If G has a face bounded by two edges, we can simplify the graph by deleting one of them. For our purposes we do not really care which one is deleted, but we need a rule that is consistent. For presentational purposes, we assume that we always keep the edge e with larger id(e).

This motivates the following definition of a quasi-simple graph8 : Definition 4. A plane embedded graph is quasi-simple if the dual of each non-simple component has minimum degree 3. Given a plane embedded graph G and a set of vertices X, we define the subgraph of G quasi-induced by X to be the unique quasi-simple subgraph of G with vertex set X and the maximum total sum of id(e) values. Let d X (v) denote the degree of v in the subgraph quasi-induced by X ∪ {v}.

Roughly speaking, a quasi-simple graph is obtained from a plane embedded multigraph by merging parallel edges that lie next to each other in the circular orderings around both their endpoints.

We build a structure for 4-cycle detection by recursively using balanced separators, and by detecting, for each separator, the cycles that cross the separator. Detecting 4-cycles that cross a separator is not trivial, and our analysis introduces a complicated potential function which reflects how well connected the non-separator vertices are with the separator, that is, how many neighbors on the separator they have. At the same time, we make sure that all the work done can be paid with the decrease in the potential. Our analysis exploits the fact that for a planar graph with separator S, at most O(|S|) vertices have more than 4 neighbors in S.

The recursive use of separators can be sketched as follows: Let S be a small balanced separator in

G = (V, E) that induces a separation (V 1 , V 2 ), that is, V 1 ∩ V 2 = S and V 1 ∪ V 2 = V . Moreover, let n = |V |. We observe that each 4-cycle is fully contained in V 1 or V 2 ,
or consists of two paths of length 2 that connect vertices of S. This motivates the following recursive approach. We compute a separator S of O( √ n) vertices and then find all paths of length 2 that connect vertices of S. Since the size of S is O( √ n), there are only O(n) pairs of vertices of S, and for each pair of vertices, we can easily check if the two-edge paths connecting them form any separating 4-cycles. It then remains to find the 4-cycles that are fully contained in either V 1 or V 2 , which can be done recursively. Because S is a balanced separator, the recursion has O(log n) levels.

This algorithm can be made dynamic under contractions and edge insertions that respect the embedding of G. Contractions are easy to handle, as they preserve planarity. Moreover, a separator S of a planar graph can be easily updated under contractions. Namely, whenever an edge uw is contracted, the resulting vertex belongs to the separator iff any of u and w did. Insertions that preserve planarity, however, are in general harder to accommodate. To handle this we introduce a new type of separators that we call face-preserving separators, which (like cycle-separators) always exist when the face-degree is bounded. These are still preserved by contractions, but also ensure that any edge across a face can be inserted.

All in all, there are O(log n) levels of size O(n) each, where each level handles insertions and contractions in constant time, leading to a total of O(n log n) time. The details of this construction and the proof of the below theorem can be found in Appendix B.

Theorem 5. Let G be an n-vertex quasi-simple plane embedded graph with bounded face degree. There exists a data structure that maintains G under contractions and embeddingrespecting insertions, and after each update operation reports edges that become members of some separating 4-cycle. It runs in O(n log n) total time.

Maintaining SPQR trees. The main challenge in maintaining an SPQR-tree is handling the case when an edge within a triconnected component is deleted. First of all, the data structure should be able to detect whether or not the component is still triconnected.

For any triconnected component Γ of G, we maintain a 4-cycle detection structure for the corresponding vertex-face graph Γ . A separating 4-cycle in Γ corresponds to a separation pair in Γ, which would witness that Γ is no longer triconnected. The deletion or contraction of the edge e in the triconnected component Γ of G corresponds to an (embedding-respecting) insertion and immediate contraction of an edge in Γ . This way by detecting 4-cycles in Γ , we can detect when the corresponding triconnected component falls apart.

However, this is not the only challenge. If Γ does indeed cease to be triconnected, the SPQR-tree of (Γ -e) (or (Γ/e) when doing a contraction) is a path P. This is where we need the 4-cycle structure to output the edges contained in separating 4-cycles. Those edges correspond to a set of corners N of G. We use those corners to guide a search, which helps identify the non-largest components of the SPQR-path P. More specifically, if a vertex v now belongs to two distinct triconnected components, there are two corners in N that separate the edges incident to v into two groups of edges, each belonging to a distinct triconnected component. We can afford to build a 4-cycle detection structure for Γ for any non-largest triconnected component Γ on the path from scratch. To obtain the data structure representing the largest component, we delete or contract the corresponding edges from Γ while updating Γ . Since an edge only becomes part of a structure built from scratch when its triconnected component size has been halved, this happens only O(log n) times per edge, so the total time used for rebuilding is O(n log 2 n). The second logarithmic factor comes from rebuilding the data structure for 4-cycle detection, that takes O(n log n) time to initialize and process any number of operations.

Finally, since no two S-nodes can be neighbors and no two P -nodes can be neighbors, some S-or P -nodes in P may have to be merged with their (at most 2) neighbors of the same type outside P. To handle this step efficiently, we keep the SPQR-tree rooted in an arbitrary node. While merging the skeleton graphs of two S-or P -nodes can be done in constant time, what can be more costly is updating the parent pointers in the children of the merged nodes. Hence, we move the children of the node with fewer children to the other node. This way, each node changes parent at most O(log n) times before it is deleted or split. The total number of distinct SPQR-nodes that exist throughout the lifetime of the data structure is O(n), so the total time used for maintaining the parent pointers is O(n log n).

Since SPQR-trees are only defined for biconnected graphs, another challenge is to maintain SPQR-trees for each biconnected component, even as the decremental update operations cause the biconnected components to fall apart. We recall here that the structure of the biconnected components of a connected graph can be described by a tree called the blockcutpoint tree [23, p. 36], or BC-tree for short. This tree has a vertex for each biconnected component (block) and for each articulation point of the graph, and an edge for each pair of a block and an articulation point that belongs to that block. If the tree is rooted arbitrarily at any block, each non-root block has a unique articulation point separating it from its parent.

To handle updates, we notice that the SPQR-tree points to the fragile places where the graph is about to cease to be biconnected: An edge deletion in an S-node will break up a block in the BC-tree into path, and an edge contraction in a P -node breaks a block in the BC-tree into a star. Upon such an update, we remove the aforementioned S-or P -node from the SPQR-tree, breaking it up into an SPQR-forest. Each tree corresponds to a new block in the BC-tree. They form a path (or a star), and the ordering along the path, as well as the articulation points, can be read directly from the SPQR-tree.

On the other hand, in order to even know which SPQR tree to modify during an update, we can search in the BC-tree for the right SPQR-structure in which to perform the operation.

Bi-and triconnectivity. Finally, we use SPQR-trees to facilitate triconnectivity queries. First of all, vertices need to be biconnected in order to be triconnected. To facilitate biconnectivity queries, it is enough that each vertex v knows the name of the block B(v) closest to the root in the BC-tree that contains it, and each block b knows the name of the vertex separating it from the parent p(b). Then, any two vertices u and w are biconnected if and only if one of the following occur:

B(u) = B(v), or u = p(B(v)), or v = p(B(u)).
The information we maintain for triconnectivity is similar, using the SPQR-tree. Namely: each non-root node x in the SPQR-tree stores the virtual edge (see Definition 3) that separates it from its parent. Each vertex v stores (a pointer to) the node C(v) closest to the root that contains it, and, in a special case, at most two other nodes that are the children of C(v). Queries are handled similarly as above.

The main challenge is to handle updates. Note that the change to the SPQR-tree may involve both the split and merge of nodes. In particular, we have one split and up to several merges when a triconnected component falls apart into an SPQR-path. However, upon a merge, we can afford to update the information regarding vertices in the non-largest components, costing only an additive log n to the amortized running time. Similarly, upon a split, we update any information that relates to vertices in the non-largest components only.

The total running time is thus O(n log n + f (n)), where f (n) is the running time for maintaining the SPQR-tree. The following theorem is proven in Appendix A. Theorem 6. There is a data structure that can be initialized on a planar graph G on n vertices in O(n log n) time, and supports any sequence of k edge deletions or contractions in XX:10 Decremental SPQR-trees for Planar Graphs total time O((n + k) log 2 n), while supporting queries to pairwise triconnectivity in worst-case constant time per query.

Decremental SPQR-trees

In this section, we use the data structure of Theorem 5 (described in Appendix B) to maintain an SPQR-tree (see Definition 3) for each biconnected component of G with at least 3 edges under arbitrary edge deletions and contractions. We start with some useful facts.

Lemma 7.

For any pair of edges in a biconnected graph G, their corresponding faces of G are separated by a 4-cycle (v 1 , f 1 , v 2 , f 2 ) if and only if they belong to different separation classes with respect to v 1 , v 2 in G and with respect to

f 1 , f 2 in G * . Lemma 8. Let G be a biconnected graph. If a 4-cycle C = (v 1 , f 1 , v 2 , f 2 ) in G is a separating cycle, then v 1 , v 2 is a separation pair of G and f 1 , f 2 is a separation pair of G * . Lemma 9.
Let G be a loopless biconnected plane graph and u, w be a separation pair in G. Consider the set of edges E x incident to x ∈ {u, w}. Then, the edges of E x belonging to each separation class of u, w are consecutive in the circular ordering around both u and w.

Lemma 10. Let G be a triconnected plane graph and e = uw ∈ E(G). Assume that G -e is not triconnected. Then, the SPQR-tree of G -e is a path H (we call it an SPQR-path). Moreover, given all edges that lie on 4-cycles in (G -e) , we can compute all nodes of H except for the largest one in time that is linear in their size.

For a planar graph, there is a nice duality, as proven by Angelini et al. [4, Lemma 1]. Define the dual SPQR-tree as the tree obtained from the SPQR-tree by interchanging Sand P -nodes, and taking the dual of the skeletons.

Lemma 11 (Angelini et al [4]). The SPQR-tree of G * is the dual SPQR-tree of G.

Let G be a connected plane graph. Since (G ) * is 4-regular, G is quasi-simple and has bounded face-degree. Furthermore, any edge deletion or contraction in G that leaves G connected, corresponds to an edge insertion and immediate contraction in G . Thus by Theorem 5 we can maintain a data structure for G under connectivity-preserving edge deletions and contractions, that after each update operation reports the corners that become part of a separating 4-cycle in G . remove e from Γ(x) merge y and z into one node

In the algorithm we maintain one SPQR-tree for each biconnected component with at least 3 edges. We now describe how these trees are updated upon edge deletions. The procedures, depending on the type of the SPQR-tree node are given as Algorithms 1, 2 and 3. Note that the lines 4 and 5 in Algorithm 2 only introduce notation, that is the values of the variables are not computed. The proofs of correctness can be found in Appendix C. remove e from Γ(x)

3:

if Γ(x) has a separation pair then 4:

X := SPQR-path representing Γ(x)

5:

x big := the node of X st. Γ(x big ) has the most edges

6:
compute all nodes of X \ x big 7:

remove and contract edges of Γ(x) to obtain Γ(x big )

8:
replace x in T by X (connect each child of x to the correct node of X )

9:
for each S-or P -node z ∈ X do 10:

for each neighbor z / ∈ X do 11:

if z, z are same type then remove e from Γ(x)

3:

remove x from T 4:

for each edge e in Γ(x) do

5:

Make a new BC-node z 6:

if e is a virtual edge then 7:

y := neighbor of x in T corresponding to e 8:

Make the tree containing y the SPQR-tree for the new BC-node

9:
if y is a P -node then removeR(y, e , T )

We can now prove the main theorem of this section. Note that, as in the block-cutpoint tree, we root each SPQR-tree in an arbitrary vertex.

Theorem 12. There is a data structure that can be initialized on a simple planar graph G on n vertices in O(n log n) time, and supports any sequence of edge deletions or contractions in total time O(n log 2 n), while maintaining an explicit representation of a rooted SPQR-tree for each biconnected component with at least 3 edges, including all the skeleton graphs for the triconnected components. Moreover, during updates, the total number of times a node of an SPQR-tree changes its parent is O(n log n).

Proof. We first partition the graph into biconnected components, and, as sketched in Section 3, maintain the block-cutpoint tree explicitly. Thus, given two vertices u, v, we can in O(1) time access the biconnected component containing both of them, along with its auxiliary data. Now, for each biconnected component C i , we compute the SPQR-tree T . This can be done in linear time due to [START_REF] Gutwenger | A Linear Time Implementation of SPQR-Trees[END_REF]. We also root each SPQR-tree in an arbitrary node, and keep the trees rooted as they are updated.

For each node x of T we maintain the graph Γ(x). Each virtual edge of Γ(x) has a pointer to the neighbor of x it represents. Moreover, for each R-node r, we keep a data structure of Theorem 5 for detecting separating 4-cycles in the vertex-face graph (Γ(r)) . By Lemma 8, any separating 4-cycle in (Γ(r)) corresponds to a separation pair in Γ(r). Since r is an R-node, there are no separating 4-cycles to begin with, but some may appear after an update.

Since the total size of the R-components is n, it follows from Theorem 5 that the entire construction time is O(n log n).

Deletion.

When an edge e is removed we find the node x of the SPQR-tree, such that e is a non-virtual edge in x. Then, we proceed according to Algorithms 1, 2 and 3.

Whenever an edge f g is deleted from an R-node r, we update the corresponding 4-cycle detection structure for (Γ(r)) . We first insert the dual edge (f g) * in the vertex-face graph, and then contract along that edge. This allows us to detect whether Γ(r) has any separation pairs after each edge deletion.

Let us now analyze the running time. When processing an edge deletion, the following changes can take place in a SPQR-tree (all other changes can be handled in O(1) time):

an R-node is split into multiple nodes, two P -nodes or S-nodes are merged, an S-or P -node is deleted. Note, a P -or S-node can never get split. So, though each edge may at first belong to nodes that are split, once it becomes a part of a P -or S-node, its node only participates in merges.

When two S-or P -nodes are merged, we can merge their skeleton graphs in constant time. These skeleton graphs have only two common nodes, and their lists of adjacent edges can be merged in constant time thanks to Lemma 9. When nodes are merged, we also have to update the parent pointers of their children. To bound the number of these updates, we merge the node with fewer children into the node with more. Thus, the number of parent updates caused by these merges is O(n log n), and so is the impact on the running time.

A similar analysis applies to the case when an R-node r is split into an SPQR-path. By Lemma 10, we can compute all but the largest node of the SPQR-path in linear time. Since the size of the skeleton graph in each of these nodes is at most half the size of Γ(r), each edge takes part in this computation at most O(log n) times. For every new R-nodes, we also initialize their associated data structures for detecting 4-cycles. We charge the running time of each data structure to this initialization. From Theorem 5 we get that recomputing all the nodes and data structures takes O(n log 2 n) total time.

Taking care of the largest component of the SPQR-path is even easier, as we can simply reuse the skeleton graph of r and its associated data structure for detecting 4-cycles. To update the skeleton graph, we use the following lemma.

XX:13 Lemma 13. If G is triconnected, e ∈ E(G), and x is an R-node in the SPQR-tree for G -e, then there exists a sequence of E(G) -E(Γ(x)) edge deletions and contractions that transform G -e into Γ(x) while keeping the graph connected at all times.

After an R-node r is split into a SPQR-path H we also need to update the parent pointers in the children of r. However, the number of children to update is at most the number of edges in the non-largest components of the SPQR-path. As we have argued, the total number of such edges across all deletions is O(n log n).

Contraction. The contraction of an edge of the embedded planar graph G corresponds to the deletion of an edge of its dual graph, G * . By Lemma 11, the SPQR-tree of G * is the dual SPQR-tree of G. Thus, if the edge was in a P -node of the SPQR-tree, its contraction is handled like the deletion of an edge in a S-node, and vice versa.

If the contracted edge e belongs to an R-node, that R node may expand to a path in the SPQR-tree (because deletion in G * may expand an R-node into a path). In the vertex-face graph, we may find all edges participating in new separating 4-cycles, corresponding to separating corners of the graph. To find the new components, we simply apply Lemma 10 to the dual graph and proceed analogously to a deletion.

A Decremental Triconnectivity

To answer triconnectivity queries, we maintain a rooted SPQR-decomposition (see e.g. [START_REF] Di | On-line maintenance of triconnected components with SPQR-trees[END_REF][START_REF] Gutwenger | A Linear Time Implementation of SPQR-Trees[END_REF]) of each biconnected component of the planar graph. Now it follows from the definition that pair of vertices in a biconnected graph is triconnected if and only if there exists a P or R component in the SPQR-tree containing them both. By associating a constant amount of information with every vertex in G and every node in the SPQR-tree, we can answer triconnectivity queries in constant time: Definition 14. A triconnectivity query structure for a biconnected graph consists of a rooted SPQR-tree, and the following additional information:

For each node x in the SPQR-tree except the root, a pointer e(x) to the virtual edge that separates it from its parent.

For each vertex v, a pointer C(v) to the node containing v that is closest to the root.

For each vertex v such that C(v) points to an S-node x, a set D(v) of pointers to the at most 2 children of x that contain v.

Lemma 15.

Given the triconnectivity query structure described in Definition 14, we can answer triconnectivity for any pair of vertices in constant time.

Proof. Given vertices u and v. If C(u) = C(v) and C(u) is not an S-node, then u and v are triconnected. If C(u) = C(v) is an S-node, u and v are triconnected if and only if they share a virtual edge in Γ(C(u)), which happens if and only if

D(u) ∩ D(v) is non-empty. If C(u) = C(v)
, then u and v are triconnected if and only if either u is an endpoint of e(C(v)), or, v is an endpoint of e(C(u)).

Given Theorem 5, we have the tools ready for maintaining triconnectivity: Theorem 6. There is a data structure that can be initialized on a planar graph G on n vertices in O(n log n) time, and supports any sequence of k edge deletions or contractions in total time O((n + k) log 2 n), while supporting queries to pairwise triconnectivity in worst-case constant time per query.

Proof. For each vertex v and for each SPQR-node x, we associate the information e(x), C(v), D(v) described in Definition 14.

Query. To answer a triconnected query (u, v), we first ask if (u, v) are biconnected. Otherwise, they cannot be triconnected. If they are, we get the SPQR-tree associated with their common biconnected component and use Lemma 15. This answers the query in O(1) worst case time.

Updates. Our data structure for SPQR trees already maintain e(x), so the main difficulty is in maintaining C(v) and D(v) for each vertex. Let x be the value of C(v) before the change, let x the new value, and suppose x = x .

If x and x are both R-nodes, |E(Γ(x ))| < 1 2 |E(Γ(x))| so we are already using Ω(|E(Γ(x ))|) = Ω(|V (Γ(x ))|) time to rebuild Γ(x ) . We can thus afford to update C(v) for all v ∈ V (Γ(x )).

If x is an R-node and x is not, then C(c) was split into k > 1 new nodes. In this case we are already using Ω(k) time maintaining the SPQR tree, so we can spend an additional O(k) time on updating C(v) for the O(k) vertices from V (Γ(x)) whose new C(v) is not an R-node.

If x is a P -node, then it has to be the root (since C(v) = x), so this can happen for at most 2 vertices per update and we can easily afford that. Proof. From Definition 1, for each edge e of G, both endpoints of e are in A or B. Thus, an edge that has one endpoint in A \ B has its other endpoint in A. Using these facts, the lemma follows by simple case analysis.

XX:17 v u

It follows that we can use the separator tree to detect 4-cycles as follows. For each leaf x of the separator tree, the graph H x has constant size, so 4-cycles inside H x can be detected in constant total time. In any other node, we have a graph with a separator K, and we need to dynamically detect 4-cycles that cross K under edge contractions and embedding-respecting edge insertions. Referring to Lemma 21 above, we only need to detect the two halves of a 4-cycle, that is, length-2 paths between the vertices of K.

Lemma 22. Let G be a plane embedded graph on n vertices and K be a set of vertices of G

of size |K| = O( √ n).
Assume that G undergoes edge contractions and insertions respecting the embedding. There exists a data structure that after each update operation can report the edges of G that become members of separating 4-cycles whose two opposing vertices lie on K. Its total running time is O(n + k), where k is the total number of edge contractions and insertions.

We now proceed with the description of the data structure of the above lemma. First note that if a pair of vertices is connected by at least 4 paths of length two, all edges on those paths lie on separating 4-cycles (see Figure 3). Thus, if we can keep, for every pair of vertices of K, the list of all length 2 paths between them, we need to check at most 2 existing paths when a new path arrives, and then report at most 8 edges (4 new length-2 paths) that now belong to separating 4-cycles.

To report every edge only once, we also keep a Boolean flag for each edge that indicates whether it has been reported before, and check that flag before reporting.

We thus only need to argue that we can detect all the length-2 paths between K-vertices that arise in the graph under contractions and edge insertions, in O(n + k) total time. We do that by constructing a potential function Φ that is initially O(n), remains nonnegative, and drops at each operation proportionally to the amount of work done. We start by partitioning the vertices into 3 sets, that we need to treat differently. The aim of the data structure is to notice when new common neighbors of pairs of vertices in K appear. The idea is that since K has size O( |V |), there are only O(|V |) pairs of vertices of K. For each such pair, we maintain a doubly-linked list of all length-2 paths between them, and for each edge we maintain a doubly-linked list of all such paths it participates in.

When an edge uw is inserted, new length-2 paths can only appear if u ∈ K and/or w ∈ K. In this case the number of candidate paths to check is bounded by d K (u) + d K (w), and this can be done in constant time per path.

When an edge uw is contracted, new length-2 paths between vertices of K may appear in other ways. For example, we have new paths between neighbors of u contained in K and neighbors of w in K. Other cases are possible if u or w belongs to K.

We now define a potential function that decreases by at least the number of candidate paths after each contraction. We can decide if each candidate path is an actual length-2 path between vertices in K in constant time.

It is defined in stages:

Φ q (X) = v∈X d V (v) Φ v (X) = 4 |X| - 1 2 v∈X d X (v) = 4 |V (G X )| -|E(G X )| Φ s (X) = 63(Φ v (X)) 2 - v∈X (d X (v)) 2 Φ = 6Φ v (V ) + 3Φ q (Y ∪ M ) + Φ s (M ∪ K)
Lemma 24. The potential Φ is initially O(n) and remains nonnegative. The embeddingrespecting insertion or contraction of an edge uv decreases Φ by at least the number of candidate paths.

Before we proceed with the proof, we give a simple observation concerning quasi-simple graphs, which follows from Euler's formula and the fact that quasi-simple graphs of at least 3 vertices have faces of degree at least 3.

Observation 25. In a quasi-simple planar graph with n ≥ 3 vertices, the number of edges is at most 3n -6.

Proof of Lemma 24.

To see the first statement, note that

1 ≤ |K| ≤ |M ∪ K| ≤ Φ v (M ∪ K) ≤ 4 |M ∪ K| ≤ 4(2 |K| -2) = 8(|K| -1)
where the inequality

|M ∪ K| ≤ Φ v (M ∪K), stems from Φ v (M ∪K)-|M ∪ K| = 3 |V (G M ∪K )|- |E(G M ∪K )| ≥ 0,
which is true by Observation 25. The last inequality is because there cannot be more than |K| -2 vertices in M by Lemma 23. By a similar argument, we see that Φ v (V ) ≥ 0, and, being a sum of nonnegative terms, so is Φ q (Y ∪ M ) ≥ 0.

(Y, Y ) merge to Y : Φ q (Y ∪ M ) drops by at least 2, and the other terms in the potential are unchanged, so Φ drops by at least 6. Since the result v is in Y , there are at most 3 paths of length 2 in G K∪{v} with v as a middle vertex, and at most 2 of them are new. (Y, Y ) merge to M : The product of the degrees, and therefore the number of candidate paths is at most 9. ∆Φ v (M ∪ K) ≤ 0 and ∆Φ q (Y ∪ M ) ≤ -2, and the term v∈M ∪K (d M ∪K (v)) 2 drops by the sum of degrees squared. Thus, ∆Φ ≤ -2 + 0 -8 < -9, and we are done. (M, Y )-merge Suppose u ∈ M and v ∈ Y . Let w be the node that u, v are contracted to, it will be an M -node.

We call an edge (v, k) important if it participates in a new length 2 path between different vertices of K. Each important edge incident to v ∈ Y will become part of the graph quasi-induced by M ∪ K, and therefore cause a drop in Φ v (M ∪ K). This drop is enough to pay for all new paths containing that edge. (K, Y )-merge Suppose u ∈ K and v ∈ Y . Let w be the node that u, v are contracted to, it will be an K-node.

There are two types of new length-two (K, K) paths that arise: Paths having w as the middle vertex, and paths having w as an end vertex.

The paths with w as a middle vertex are accounted for just like the previous case.

Each new path having w as an end vertex must have a neighbor of v as middle vertex.

There are (less than) d V (v) of these neighbors. Since ∆Φ q (Y ∪ M ) ≤ -d V (v) we can afford to look at each of them, and pay for at most 2 new paths for each. Now consider a neighbor m of v that is middle vertex of some new path. If m ∈ Y (after the contraction), then there is at most 2 new paths involving m, and the drop in Φ q (Y ∪ M ) pays for them. If m ∈ M ∪ K, then d M ∪K (m) has increased, and Φ s (M ∪ K) drops appropriately. (M, M )-merge Suppose u, v ∈ M are merged to the new vertex w. Note that w ∈ M . Let X = {x 1 , . . . , x k } be the set of common neighbors of u, v in G M ∪K that lose an edge when quasi-simplifying after the contraction, and note that 0

≤ η ≤ 2. Let Φ v = Φ v (M ∪ K), then ∆(Φ 2 v ) = (Φ v + ∆Φ v ) 2 -Φ 2 v = (Φ v -(3 -η)) 2 -Φ 2 v = (3 -η) 2 -2(3 -η)Φ v Let a = d M ∪K (u), b = d M ∪K (v), and for i ∈ {1, . . . , η} let c i = d M ∪K (x i ). Then a, b, c i ≤ a + b + η i=1 c i ≤ y∈M ∪K d M ∪K (y) ≤ 6 |M ∪ K| -12 ≤ 6Φ v -12 And finally ∆Φ s (M ∪ K) ≤ 63∆(Φ 2 v ) - (a + b -(η + 2)) 2 + η i=1 (c i -1) 2 -a 2 + b 2 + η i=1 c 2 i = 63((3 -η) 2 -2(3 -η)Φ v ) -2ab + (η + 2) 2 -2(η + 2)a -2(η + 2)b - η i=1 (2c i -1) = 63((3 -η) 2 -2(3 -η)Φ v ) -2ab -((η + 2) 2 + η) + 2(η + 2)a + 2(η + 2)b + η i=1 2c i ≤ 63((3 -η) 2 -2(3 -η)Φ v ) -2ab -((η + 2) 2 + η) + 2(η + 2) + 2(η + 2) + η i=1 2 (6Φ v -12) = 63((3 -η) 2 -2(3 -η)Φ v ) -2ab -((η + 2) 2 + η) + (6η + 8)(6Φ v -12) = -2ab +        467 -330Φ v if η = 0 74 -168Φ v if η = 1 -195 -6Φ v if η = 2 ≤ -2ab -6Φ v for Φ v ≥ 2 (1)
In particular, ∆Φ ≤ -ab

= -d M ∪K (u) • d M ∪K (v) ≤ -d S (u) • d S (v)
, as desired. (K, M )-merge: Suppose u ∈ K and v ∈ M . Let w be the node that u, v are contracted to, it will be an K-node.

There are two types of new length-two (K, K) paths that arise: Paths having w as the middle vertex, and paths having w as an end vertex.

The paths with w as a middle vertex are accounted for just like the previous case. Each new path having w as an end vertex must have a neighbor of v as middle vertex.

There are (less than) d V (v) of these neighbors. Since ∆Φ q (Y ∪ M ) ≤ -d V (v) we can afford to look at each of them, and pay for at most 2 new paths for each. Now consider a neighbor m of v that is middle vertex of some new path. If m ∈ Y (after the contraction), then there is at most 2 new paths involving m, and the drop in Φ q pays for them. Let M be the set of neighbors of v in M ∪ K that is middle of some new path. The number of such paths is at most

|E(G M ∪K )| ≤ 3 |M ∪ K| -6 ≤ 3Φ v (M ∪ K) - 6
, since each must contain a unique edge from G M ∪K . And the -6Φ v (M ∪ K) pays for them. (K, K)-merge: Suppose u, v ∈ K. Let w be the node that u, v are contracted to, it will be an K-node.

There are two types of new length-two (K, K) paths that arise: Paths having w as the middle vertex, and paths having w as an end vertex. The paths with w as a middle vertex are accounted for just like the previous two cases.

Each new path having w as an end vertex was already an (K, K) path with either u or v before the merge. For each of u, v there is at most |K| -1 such pairs that (may) need to be updated, so the total cost of updating these is less than 2(|K| -1) ≤ 2Φ v . The -6Φ v can pay for these updates.

As a result, Lemma 22 follows, and we are finally ready to prove Theorem 5.

Proof of Theorem 5. Given a planar graph G with bounded face-degree, we build a facepreserving separator tree as in Lemma 20 in O(n log n) time. For each internal vertex of the tree, we may detect new 4-cycles crossing the separator due to Lemma 22. The leaves have size at most n 0 = O(1), and we can detect 4-cycles in the leaves in O(1) time. We can distinguish between face 4-cycles and separating 4-cycles. Namely, we can choose to report only when an edge first lies on any 4-cycle, or when it first lies on a separating one, as described in Lemma 22. An edge insertion in the graph H x needs to be duplicated in each child of x that contains both vertices. However, the drop in the Φ potentials for each node is large enough to pay for each cascading insertion. Whenever a contraction in the graph H x for a node x of the separator tree introduces a new edge between two separator vertices, that edge may need to be added to the subtree containing the other side of the separation, but again that is paid for. In general, if we update graphs closer to the root first, the changes only propagate down and every change is paid for by a corresponding drop in the potential.

C

Omitted proofs from Section 4

= (v 1 , f 1 , v 2 , f 2 ) in G is a separating cycle, then v 1 , v 2 is a separation pair of G and f 1 , f 2 is a separation pair of G * .
Proof. If C is a separating cycle, there is at least two faces on either side. By Lemma 7 there are thus at least two different separation classes with respect to v 1 , v 2 (or f 1 , f 2 ). If there exactly 2 separation classes, each consists of at least two edges. If there are exactly 3 classes, at least one of them consists of at least two edges.

Lemma 9.

Let G be a loopless biconnected plane graph and u, w be a separation pair in G. Consider the set of edges E x incident to x ∈ {u, w}. Then, the edges of E x belonging to each separation class of u, w are consecutive in the circular ordering around both u and w.

Proof. The proof is by contradiction. Assume that the circular order of some 4 edges incident to u is e 1 , e 2 , e 3 , e 4 . Moreover, assume that only e 1 and e 3 belong to the same separation class. From Definition 2 there is a path that begins with e 1 and ends with e 3 that does not contain u or w as its internal point. Thus, this path is a cycle C that does not go through w. Hence, every path from either e 2 or e 4 , that ends in w and does not contain u as an internal point, has to go through C. This contradicts the fact that e 2 and e 4 are in different separation classes than e 1 and e 3 . Clearly, the same argument applies to w.

Proof. Let us first prove that H is indeed a path. Since G -e is biconnected, there exist two internally vertex-disjoint paths between u and w. No separation pair in G -e can have both vertices on the same of these paths, since otherwise it would be a separation pair in G. Moreover, observe that each separation pair defines at most two separation classes that consist of more than one edge (otherwise, it is also a separation pair in G). Thus, we can split G -e into two subgraphs by using an arbitrary separation pair in G -e. By repeating the same reasoning on both subgraphs, we get that H is a path. Observe that u and w belong to the nodes at the opposite ends of H.

Note that since we know the edges belonging to 4-cycles in (G -e) , by using Lemma 7 we also know all separation pairs in G -e. We now describe how to compute all components of H (i.e. the skeleton graphs stored in the nodes) except the largest one. Consider an algorithm that starts from one end of H and discovers the components one by one, each in linear time. Observe that if each component of H has size at most |E(G)|/2, we can afford to detect all components of H, without affecting the total running time. However, to prepare for the opposite case, we need to do the search in parallel, starting from both ends of H. Let y be the largest component of H. Observe that only one search can start exploring edges of y. As soon as the other search reaches y, we have discovered all separation pairs (that is why we need to know all separation pairs upfront), and both searches can stop. Thus, one of the searches only uses time that is at most the total size of all non-largest components of H. Since the other search runs in parallel, it runs in the same asymptotic time.

To complete the proof it remains to describe how the search procedure works. Recall that by Lemma 9, for each separation pair u, w of G -e, the edges belonging to each separation class come in consecutive order around u and w. Observe that the edges of the 4-cycles of (G -e) correspond to the corners of G -e that lie between edges belonging to distinct separation classes. Thus, once we mark these corners in G -e, we can run a DFS-search that, once started from an edge belonging to a skeleton graph of an S-or R-node, explores all edges of this graph (and only those).

Observe moreover, that from our earlier analysis it follows that the endpoints u and w of e do not belong to any separation pair. This implies that both u and w are contained in S-or R-nodes. Let us focus on the search starting from u. Note that it discovers the entire component containing u and the separation pairs that separates it from the rest of the SPQR-tree. If the skeleton graph of this component is a path connecting the vertices of the separation pair, we have found an S-node. Otherwise, we have found an R-node. Now assume we have found some prefix of the SPQR-path that ends at a separation pair a, b. If there is an edge ab (this edge comes next in the circular ordering after the edges we have visited, so it is easy to find), the next node on the SPQR-path is a P -node. After we have processed all edges between a and b, we insert a virtual edge between a and b and continue the search starting from this edge in a similar way to the search that has discovered the first node on the SPQR-path. Clearly, the algorithm runs in linear time.

We now show that algorithms 1, 2, 3 are correct. In each proof, the goal is to show that after the procedure the tree T satisfies Definition 3.

Lemma 28. Algorithm 1 is correct.

Proof. If after the edge deletion, Γ(x) sill has at least 3 edges, then clearly T is a valid SPQR-tree. Otherwise, Γ(x) has exactly two edges and we consider three cases. Recall that the number of virtual edges in a node is equal to the number of the node's neighbors in the SPQR-tree. If Γ(x) has no virtual edges, then x is the only node of T , and thus this biconnected component now only has 2 edges, so we should delete the entire SPQR-tree.

Figure 1

 1 Figure 1 Left: a plane embedded graph. Right: the corresponding vertex-face graph (red) and the underlying graph (gray).

2 . 3 .

 23 The vertex-face graphs of G and G * are the same: G = (G * ) . There is a one-to-one correspondence between the edges of G and the faces of G (in the natural embedding, each face of G contains exactly one edge of G interior, see Fig 1). 4. (G ) * (also known as the medial graph) is 4-regular. 5. G is simple if and only if G is loopless and biconnected (See e.g. [8, Theorem 5(i)]). 6. G is simple, triconnected and has no separating 4-cycles if and only if G is simple and triconnected (See e.g. [8, Theorem 5(iv)]).

Figure 2 A

 2 Figure 2 A biconnected graph and its SPQR tree. See Definition 3.

Algorithm 1

 1 Removing an edge e from a P -node x of T 1: function removeP(e, x, T ) 2:

Algorithm 2

 2 Removing an edge e from an R-node x of T 1: function removeR(e, x, T )2:

12 : merge z with z Algorithm 3

 123 Removing an edge e from an S-node x of T 1: function removeS(e, x, T )2:

Figure 3 4

 3 Figure 3 4 paths all participate in separating 4-cycles.

Figure 4 Lemma 21 .

 421 Figure 4The sets M (magenta), Y (yellow), and K (black) from Lemma 23.

Lemma 23 .

 23 Given a planar graph G = (V, E) and a vertex set K ⊆ V , let M denote the vertices m ∈ V \ K that have d K (m) ≥ 4 (see Definition 4), and let Y denote V \ (M ∪ K). Then Y , M and K form a partition of V , and |M | ≤ |K| -2. XX:18 Decremental SPQR-trees for Planar Graphs Proof. The partition property follows trivially from the definition. Consider the maximal quasi-simple bipartite subgraph H of G with bipartition (M, K). By definition, each m ∈ M has at least 4 neighbors in the subgraph of G quasi-induced by K ∪{m}. Thus for each m ∈ M , d H (m) ≥ 4, and so 4 |M | ≤ E(H). Since H is bipartite and quasi-simple, by Euler's formula we have E(H) ≤ 2(|M |+|K|)-4. Combining the two we get 4 |M | ≤ E(H) ≤ 2(|M |+|K|)-4, which implies |M | ≤ |K| -2.

  and it is a cycle separator if the subgraph of G induced by S is Hamiltonian.

Lemma 7 .

 7 For any pair of edges in a biconnected graph G, their corresponding faces of G are separated by a 4-cycle (v 1 , f 1 , v 2 , f 2 ) if and only if they belong to different separation classes with respect to v 1 , v 2 in G and with respect to f 1 , f 2 in G * . Proof. Let C be the 4-cycle. Consider a path L in G containing edges e 1 and e 2 . Consider the set of faces F in G that are incident to a vertex on L. L does not cross v 1 , v 2 if and only if F is completely contained on one side of C, which happens if and only if e 1 and e 2 are not separated by C. An identical argument can be made about f 1 , f 2 in G

* Lemma 8. Let G be a biconnected graph. If a 4-cycle C

Throughout the paper, we use the notation O(f (n)) to hide polylogarithmic factors.

For alternative definitions, see e.g.[START_REF] Holm | Dynamic planar embeddings of dynamic graphs[END_REF] and[START_REF] Rosenstiehl | Embedding in the plane with orientation constraints: The angle graph[END_REF]. The latter uses the name angles for what we call corners.

A.k.a. the vertex-face incidence graph[START_REF] Brightwell | Representations of planar graphs[END_REF], the angle graph[START_REF] Rosenstiehl | Embedding in the plane with orientation constraints: The angle graph[END_REF], and the radial graph[START_REF] Archdeacon | The construction and classification of self-dual spherical polyhedra[END_REF].

In[START_REF] Klein | Optimization algorithms for planar graphs[END_REF] these graphs are called semi-strict.

1 Jacob Holm is supported by Mikkel Thorup's Advanced Grant DFF-0602-02499B from the Danish Council for Independent Research under the Sapere Aude research career programme. 2 Giuseppe F. Italiano is partially supported by the Italian Ministry of Education, University and Research under Project AMANDA (Algorithmics for MAssive and Networked DAta). 3 Adam Karczmarz is supported by the grants 2014/13/B/ST6/01811 and 2017/24/T/ST6/00036 of the Polish National Science Center. 4 When working on this paper Jakub Łącki was partly supported by the EU FET project MULTIPLEX no. 317532 and the Google Focused Award on "Algorithms for Large-scale Data Analysis" and Polish National Science Center grant number 2014/13/B/ST6/01811. Part of this work was done while Jakub Łącki was visiting the Simons Institute for the Theory of Computing.

XX:15

If x is an S-node, then either the biconnected component was split into k > 1 new components and we can afford to spend O(k) time on updating C(v) for the k -2 vertices in S that were pointing to x. Or x was merged into another S-node. The total cost is linear in the total number of times some node changes parent due to such a merge, which is O(n log n).

Finally for each node x that has a new parent p in the SPQR-tree, if p is an S-node, e(x ) has the two vertices whose D(v) need to be changed, and this can be done in constant time. The total number of times this happens is O(n log n).

B Detecting 4-Cycles Under Edge Contractions and Insertions

In this section we give an algorithm for detecting 4-cycles (simple cycles of length 4) in a planar embedded graph that undergoes contractions and edge insertions that respect the embedding. We say that a 4-cycle in a planar embedded graph G is a face 4-cycle if it is a cycle bounding a face of G, and a separating 4-cycle otherwise. For our purposes, only the separating 4-cycles are interesting, but we note in passing that new face 4-cycles are easy to detect under edge insertions and contractions:

Observation 16. An embedding-respecting edge insertion creates two new faces, and we may check in constant time whether each of them has degree 4 or not. An edge contraction affects degrees of only two faces (the two incident to the contracted edge), and we may check in constant time whether their new degree is 4 or not.

The main goal of this section is to prove the following theorem.

Theorem 5. Let G be an n-vertex quasi-simple plane embedded graph with bounded face degree. There exists a data structure that maintains G under contractions and embeddingrespecting insertions, and after each update operation reports edges that become members of some separating 4-cycle. It runs in O(n log n) total time.

In order to detect 4-cycles, we use planar separators. In fact, in order to maintain our data structure dynamically, we need something a little bit stronger. Definition 17. Given a planar graph G, a separation (A, B) of G is said to be facepreserving if for any face f of G, all vertices of f belong to A or all vertices of f belong to B.

For instance, given a cycle separator K, we can form a face-preserving separation (A, B) such that A ∩ B = K. Namely, K corresponds to a Jordan curve dividing the plane into two parts, S A , S B , where every face lies entirely in one part. Define A by all vertices incident to faces on S A , and B similarly. Then, A ∪ B = G, and A ∩ B = K.

In our algorithm we need to maintain separations under edge insertions and contractions. Let (A, B) be a separation in G. When an edge is inserted, we do not modify the separation. When an edge uw is contracted into a vertex x, we obtain a new separation (A , B ) as follows. If u ∈ A or w ∈ A, we set A = (A \ {u, w}) ∪ {x}. Otherwise, A = A. The set B is defined analogously. Thanks to this convention, we obtain the following. Lemma 18. Let (A, B) be a face-preserving separation in G. Let G be the result of an embedding-respecting edge insertion or edge contraction, and let A , B be the vertices corresponding to A and B in G . Then (A , B ) is a face-preserving separation in G , and

Proof. If an edge is inserted that respects the embedding, it is inserted into some face f . By definition at least one of A, B contain all vertices on f , and in particular it also contains all the vertices of the two new faces that appear in G . Since A = A and B = B in this case, the result follows.

If an edge uv is contracted, the resulting graph G has the same faces as G, and the separation

Otherwise uv has an endpoint outside A ∩ B. Without loss of generality, we can assume that u ∈ A \ B. In that case, v ∈ A and B = B and it follows that

Definition 19. Given a graph G, a separator tree is a binary tree where each node x is associated with an induced subgraph H x of G, such that for some constant n 0 > 0:

If

) is face-preserving, for all nodes x with children y and z.

Lemma 20. Given a planar graph with bounded face degree, we can in O(n log n) time build a face-preserving separator tree where each node x explicitly stores S x and H x . This tree has height O(log n), and uses O(n log n) space.

We construct the tree in three steps. First, we take our graph G and make a triangulation G . Then, referring to a result by Klein, Mozes, and Sommer [START_REF] Philip | Structured recursive separator decompositions for planar graphs in linear time[END_REF], we make a cycle separator tree for G . Finally, we can transform the cycle separator tree for G to a face preserving separator tree for G:

Proof. Let G be a graph with maximum face-degree k and let G be a triangulation of G. Then using the algorithm from [41, Theorem 3], we can in linear time compute a cycle separator tree for G . Since the cycle separator tree is balanced, it has height h ∈ O(log n). Since the children of each node partition the faces of G contained in the node, and contain at most a constant number of other faces (called "holes"), the total number of faces (and hence vertices) in graphs associated with depth i nodes is O(n) for each 0 ≤ i < h. Thus the total size of all these graphs in the cycle separator tree is

While this cycle separator tree indeed is face preserving for G , it may be not face preserving for G because we may have edges e ∈ G \ G in the cycle separator. Luckily, for each such edge, we can fix the problem by adding the at most k vertices of the crossed face to the separator as follows:

For each H x in the cycle separator tree for G , we can construct H x by starting with V (H x ), adding the remaining vertices of each face of G that is crossed by an edge in E(H x )\ E(G), and taking the induced subgraph of G. By construction,

and, by construction, it is face-preserving. What remains to be shown is that the size of the corresponding separator is small.

Given a node x in the separator tree with children y, z we compute S x = V (H y ) ∩ V (H z ). Note that each vertex in S x \ S x must belong to a face of G that is crossed by an edge in S x , so also S x ≤ |S x | ≤ O(k S x ). Thus the H x and S x form a face-preserving separator tree for G.

The total time to explicitly construct the face-preserving separator tree and all the associated graphs is O(kn log n).

We may thus realize that Φ is always positive:

Before continuing with the second statement in the theorem, we consider how the different terms of Φ behave during changes.

Define ∆Φ, ∆Φ q , ∆Φ v and ∆Φ s as the increases of the respective values Φ, Φ q , Φ v , Φ s resulting from a change.

First we observe, that Φ q (Y ∪ M ) has the following properties when contractions occur:

Furthermore, we observe that for any X ⊆ V , Φ v (X) has the following properties when changes occur: 1. ∆Φ v (X) ≤ 0 when a vertex of degree ≥ 4 is added to X. 2. -4 ≤ ∆Φ v (X) ≤ -1 when a vertex of degree ≤ 3 is deleted from X. 3. ∆Φ v (X) = -1 when an edge is added to G X . 4. -3 ≤ ∆Φ v (X) ≤ -1 when contracting any edge and reducing to a quasi-simple graph.

(∆Φ v (X) = -(3 -η), where 0 ≤ η ≤ 2 is the number of additional edges deleted). All the statements have similar proofs, so take for instance statement 4. Here, we decrease the first term by 4 but increase the second by η + 1, and thus, the resulting change is between -3 and -1.

When an edge uv is inserted, it can only create new length-2 paths between vertices of K if at least one of its ends is in K. Suppose without loss of generality that u ∈ K. Then we have the following cases for where v is before the insertion: v ∈ Y : Then v had at most 3 neighbors in K before uv was added, and thus at most 3 candidate paths need to be checked. In this case Φ v (V ) drops by one, Φ q (Y ∪M ) increases by one, and Φ s (M ∪ K) is unchanged. Thus Φ drops by 3. v ∈ M : In this case there are d K (v) new candidate paths, Φ v (V ) drops by one and Φ q (Y ∪M ) increases by one just like before. However, now Φ v (M ∪ K) drops by one, so

drops by one and

Φ q (Y ∪ M ) is unchanged. However, as in the previous case Φ v (M ∪ K) drops by one so Φ s (M ∪ K) drops by at least 102 |M ∪ K| + 225, which is much larger than

Finally we consider the case where an edge uv is contracted. To check the lemma, one simply has to check the different combinations of which partition the two elements and the result belong to:

XX:23

Lemma 26. Let G be a loopless biconnected plane graph. Let F be a subset of edges of G, such that F is a separation class for some pair u, w of vertices of G. Then there exists a 4-cycle (possibly non-separating) in G that separates the set of faces that correspond to F from all other faces.

Proof. Throughout the proof by separation class we mean one of separation classes defined by u and w. Clearly, each separation class has to have an edge incident to u or w (otherwise, since the graph is connected, it would not be maximal). In fact, since G is biconnected, each separation class has edges incident both to u and w. If a separation class had edges incident only to one of the two vertices, this vertex would be an articulation point.

Denote the edges incident to u in circular order by e 1 , . . . , e k . For convenience, let e k+1 := e 1 and e 0 := e k . Moreover, assume that e i ∈ F iff a ≤ i ≤ b, where 1 ≤ a ≤ b ≤ k. Note that by Lemma 9, a and b are well-defined (for some way of breaking the circular ordering into a sequence e 1 , . . . , e k ).

Let f 1 be the face that comes in the circular order between e a-1 and e a and f 2 be the face that comes between e b and e b+1 . Note that f 1 = f 2 .

We now show that there is a 4-cycle in G that contains u, w, f 1 and f 2 . To that end, we prove that both u and w lie on f 1 . Indeed, the cycle bounding f 1 is simple and contains edges from two separation classes. Thus, it has to contain both u and w. Similarly, both u and w lie on f 2 .

This implies that G contains a 4-cycle C F going through u, w, f 1 and f 2 , and by construction, C F separates the faces corresponding to F from all other edges.

Proof. If every separation class with respect to v 1 , v 2 consists of a single edge, then G consists of two vertices connected by multiple edges and the lemma is trivial. It suffices to use the fact that since v 1 , v 2 is a separation pair, there are at least 4 edges in G. Otherwise there is a separation class F with at least two edges, such there are at least two edges in E(G) \ F . Now apply Lemma 26, to get a delimiting cycle C in G that separates faces corresponding to F from all other faces. Denote the vertices of C by v 1 , f 1 , v 2 , f 2 . Since both F and E(G) \ F are nontrivial (both contain more than one edge), C is a separating cycle in G . It then follows from Lemma 8 that f 1 , f 2 form a separation pair in G * . Lemma 13. If G is triconnected, e ∈ E(G), and x is an R-node in the SPQR-tree for G -e, then there exists a sequence of E(G) -E(Γ(x)) edge deletions and contractions that transform G -e into Γ(x) while keeping the graph connected at all times.

Proof. For each neighbor y of x in the SPQR-tree T we proceed as follows. Let a, b be the separation pair corresponding to the edge in T between x and y. Consider all nodes reachable from y in T with a path that does not contain x. Let D be the set of non-virtual edges in all these nodes. While there is an edge e in D that is not a self-loop and not an edge between a and b, contract it. Then if there are any self-loops delete them. When all edges in D go between a and b, delete edges until there is only one left.

Lemma 10. Let G be a triconnected plane graph and e = uw ∈ E(G). Assume that G -e is not triconnected. Then, the SPQR-tree of G -e is a path H (we call it an SPQR-path). Moreover, given all edges that lie on 4-cycles in (G -e) , we can compute all nodes of H except for the largest one in time that is linear in their size.

XX:25

If Γ(x) has exactly one virtual edge, x has exactly one neighbor. In this case, simply x represents one edge of the graph, so it has to be merged with its only neighbor and the virtual edge in the neighbor becomes non-virtual. If Γ(x) has two virtual edges we remove x and the neighbors of x become neighbors. Note that the neighbors of x cannot be P -nodes. Thus, unless x has two neighboring S-nodes, we obtain a valid SPQR-tree. In the remaining case, it is easy to see that the two S-nodes can be merged into one S-node. Lemma 29. Algorithm 2 is correct.

Proof. If after removing the edge, Γ(x) is triconnected, clearly the tree is a valid SPQR-tree. Otherwise, by Lemma 10, Γ(x) is represented by a SPQR-path. It is easy to see that after replacing x by the SPQR-path X , we obtain a valid SPQR-tree, unless there are two neighboring S-nodes or P -nodes. Since the SPQR-path is a SPQR-tree, each such pair contains exactly one node z from the SPQR-path. If it is a P node, it can not be the end of the path, and so has at least 2 virtual edges to its neighbors on the path, and at most one more virtual edge to a neighbor z outside the path. If it is an S-node it may have up to 2 virtual edges to a neighbor z outside the path. Clearly, if z and z have the same type, they can be merged into one node, and this yields a valid SPQR-tree.

Lemma 30. Algorithm 3 is correct.

Proof. Observe that after removing an edge e = uw, each vertex of Γ(x) distinct from u and w is an articulation point. Thus, each neighbor of x now belongs to a different biconnected component. Thus, we update T by deleting x, which breaks T into a piece for each neighbor y. For each piece we create a new BC-node z.

Each non-virtual edge of Γ(x) becomes a biconnected component by itself, so we could simply ignore these edges from now on. For each virtual edge of Γ(x), we delete the corresponding edge in the neighbor of x using an appropriate function. From Lemmas 28 and 29 it follows that the SPQR-trees are updated correctly.