Decremental Single-Source Reachability in Planar Digraphs
Giuseppe F. Italiano, Adam Karczmarz, Jakub {\L}\k{a}cki, Piotr, Sankowski

TL;DR
This paper introduces efficient decremental algorithms for single-source reachability and strongly connected components in directed planar graphs, significantly improving update times over previous solutions and being among the first with polylogarithmic bounds for such problems.
Contribution
It presents the first almost optimal decremental algorithms with polylogarithmic update times for reachability and strongly connected components in directed planar graphs.
Findings
Total update time is $O(n ext{log}^2 n ext{log} ext{log} n)$
Achieves polylogarithmic update times for non-trivial reachability problems
First such algorithms with these bounds for directed planar graphs
Abstract
In this paper we show a new algorithm for the decremental single-source reachability problem in directed planar graphs. It processes any sequence of edge deletions in total time and explicitly maintains the set of vertices reachable from a fixed source vertex. Hence, if all edges are eventually deleted, the amortized time of processing each edge deletion is only , which improves upon a previously known solution. We also show an algorithm for decremental maintenance of strongly connected components in directed planar graphs with the same total update time. These results constitute the first almost optimal (up to polylogarithmic factors) algorithms for both problems. To the best of our knowledge, these are the first dynamic algorithms with polylogarithmic update times on general directed planar graphs for non-trivial…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsComplexity and Algorithms in Graphs · Advanced Graph Theory Research · Optimization and Search Problems
Decremental Single-Source Reachability in Planar Digraphs
Giuseppe F. Italiano Partly supported by the Italian Ministry of Education, University and Research under Project AMANDA (Algorithmics for MAssive and Networked DAta). University of Rome Tor Vergata, Italy
Adam Karczmarz Supported by the Polish National Science Center grant number 2014/13/B/ST6/01811. University of Warsaw, Poland
Jakub Łącki This work was done when the author was partly supported by the EU FET project MULTIPLEX no. 317532, 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. Google Research, New York, USA
Piotr Sankowski Supported by Polish National Science Center grant number 2014/13/B/ST6/01811. Part of this work was done while Piotr Sankowski was visiting the Simons Institute for the Theory of Computing. University of Warsaw, Poland
In this paper we show a new algorithm for the decremental single-source reachability problem in directed planar graphs. It processes any sequence of edge deletions in total time and explicitly maintains the set of vertices reachable from a fixed source vertex. Hence, if all edges are eventually deleted, the amortized time of processing each edge deletion is only , which improves upon a previously known solution. We also show an algorithm for decremental maintenance of strongly connected components in directed planar graphs with the same total update time. These results constitute the first almost optimal (up to polylogarithmic factors) algorithms for both problems.
To the best of our knowledge, these are the first dynamic algorithms with polylogarithmic update times on general directed planar graphs for non-trivial reachability-type problems, for which only polynomial bounds are known in general graphs.
1 Introduction
The design of dynamic graph algorithms and data structures is one of the classical areas in theoretical computer science. Dynamic graph algorithms are designed to answer queries about a given property while the underlying graph is subject to updates, such as inserting or deleting a vertex or an edge. A dynamic algorithm is said to be incremental if it handles only insertions, decremental if it handles only deletions, and fully dynamic if it handles both insertions and deletions. Typically, one is interested in very small query times (either constant or polylogarithmic), while minimizing the update times, whereas the ultimate goal is to have both query and update times either constant or polylogarithmic. This quest for obtaining polylogarithmic time algorithms has been so far successful only in few cases. Indeed, efficient dynamic algorithms with polylogarithmic time per update are known only for few problems, and are mostly limited to undirected graphs, such as dynamic connectivity, 2-connectivity, minimum spanning tree and maximal matchings (see, e.g., [4, 23, 24, 25, 30, 43, 47, 51]). On the other hand, dynamic problems on directed graphs are notoriously harder.111 The only exception being incremental single-source reachability that has trivial constant amortized update and query algorithm. For example, the fastest algorithms for basic dynamic problems like reachability and transitive closure, have only polynomial times per update (see, e.g., [9, 31, 41, 42]). Similarly, polynomial algorithms are only known for dynamic shortest paths that do not seem to be easier on undirected graphs than on directed ones [8, 31, 49].
In this paper we consider the decremental single-source reachability problem, in which we are given a directed graph and a source node and the goal is to maintain the set of vertices that are reachable from vertex , subject to edge deletions. Differently from undirected graphs, where polylog amortized bounds per update have been known for more than one decade even in the fully dynamic setting (see, e.g., [47]), for directed graphs there has been very limited progress on this problem. In fact, up until few years ago, the best known algorithm for decremental single-source reachability had query time and total update time (i.e., amortized time per update if all edges are deleted). This bound was simply achieved with Even-Shiloach trees [14], and it stood for over 30 years. In a recent breakthrough, Henzinger et al. [21] presented a randomized decremental single-source reachability algorithm with total update time , which they later improved to [22]. Very recently, Chechik et al. [7] improved the total update time to .
A closely related problem to decremental single-source reachability is decremental strong connectivity, where we wish to answer queries of the form: ’’Given two vertices and , do and belong to the same strongly connected component?‘‘, subject to edge deletions. This problem is known to be almost equivalent to decremental single-source reachability (see e.g., [7, 21, 41]), and the randomized algorithm by Chechik et al. [7] can solve also decremental strong connectivity in constant time per query and amortized time per update, over any sequence of deletions. Again, the undirected version of this problem can be solved much faster, i.e., in polylog amortized time per update, even in the fully dynamic setting [47]. Motivated by the limited progress on some dynamic graph problems, in their seminal work Abboud and Vassilevska-Williams [2] proved conditional polynomial lower bounds, based on popular conjectures, on several dynamic problems, including dynamic shortest paths, dynamic single-source reachability and dynamic strong connectivity.
Similar situation holds even for planar graphs where dynamic problems have been studied extensively, see e.g. [3, 11, 12, 13, 18, 19, 27, 34, 36, 37, 38, 44]. Despite this effort, the best known algorithms for some basic problems on planar graphs, such as dynamic shortest paths and decremental single-source reachability, still have polynomial update time bounds. For instance, for dynamic shortest paths on planar graphs the best known bound per operation is amortized [15, 16, 27, 29, 32]. Very recently, Abboud and Dahlgaard [1] proved polynomial update time lower bounds for dynamic shortest paths on planar graphs, again based on popular conjectures. In particular, they showed that obtaining bounds, for any , for dynamic shortest paths on planar graphs would yield a breakthrough for the all-pairs shortest paths problem in general graphs. Quite surprisingly, this lower bound almost matches the best running times for two related problems: dynamic reachability [11] and dynamic approximate shortest paths [3]. Hence, it might seem that the final answer to these problems is .
Moreover, no polynomially faster algorithms are known even for decremental single-source reachability on general planar graphs. The algorithm by Łącki [34] solves both decremental single-source reachability and decremental strong connectivity in a total of time, under any sequence of edge deletions. Note that this bound is only logarithmic factors away from the bound on general graphs [7]. Only in the very restricted case of -planar graphs, i.e., planar acyclic digraphs with exactly one source and exactly one sink, it was known for more than two decades how to solve the dynamic reachability problem in time per query and update [45, 46], provided that the edge insertions do not violate the embedding of the -planar graph.
In this paper, we break through the natural time barrier for directed problems on planar graphs and present new decremental single-source reachability and decremental strong connectivity algorithms for planar graphs with total update time of , i.e., in amortized time per update, over any sequence of deletions, and time per query. This result not only improves substantially the previously best known bound [34], but it also constitutes the first almost optimal (up to polylog factors) algorithm for those problems. To the best of our knowledge, our result is the first nontrivial dynamic algorithm for reachability problems on directed planar graphs with polylog update bound. We hope that this result will pave a way for obtaining polylogarithmic algorithms for dynamic directed problems on planar and possibly even general graphs.
Overview.
Our improved algorithms for decremental single-source reachability and decremental strongly connected components are based on several new ideas and techniques. First, we explore in a somewhat non-traditional way the relation between primal and dual graph. Indeed, in Section 3, we show a formal reduction from decremental single-source reachability to the switch-on reachability problem that we introduce. In the switch-on reachability problem we are given a directed graph, where all edges are initially off and can be switched on in a dynamic fashion. The goal is to maintain, for each edge , whether there is a path from to that consists solely of edges that are on.
In Section 4, we analyze the structural properties of a reachability matrix of a set of vertices222 A reachability matrix of a set is a submatrix of the transitive closure matrix consisting of rows and columns corresponding to vertices belonging to . that, roughly speaking, lie on a constant number of simple faces, i.e., faces bounded with a single simple cycle. We call such a matrix a face reachability matrix. The matrix viewpoint allows us to obtain properties that are algorithmically useful and otherwise not easy to capture using the previously used separating path approach to reachability in planar digraphs [11, 44, 48]. Those results are instrumental for designing a novel algorithm that can incrementally maintain the transitive closure of a graph defined by the union of two face reachability matrices that undergo incremental updates. This algorithm is described in Section 5 and is perhaps one of the the key technical achievements of this paper.
In order to solve the switch-on reachability problem, we combine the algorithm of Section 5 with a recursive decomposition of a planar graph , which is a tree-like hierarchy of subgraphs of a graph (pieces) built by recursively partitioning with small separators. For each piece , the size of the boundary of (i.e. the set of vertices of shared with pieces that are not descendants of ) is small. Moreover, we require the boundary of to lie on a constant number of faces of . Such decompositions proved very useful in obtaining near-linear planar graph algorithms, e.g., [5, 27, 35, 37], as well as dynamic planar graph algorithms [11, 15, 40]. For each piece of the decomposition, we dynamically maintain the face reachability matrix of the set in both and its complement . The idea of maintaining the information about the complements of the pieces of the decomposition has been used previously [5, 35, 40]. However, to the best of our knowledge, in our paper this idea is used for the first time in a dynamic setting. Moreover, we observe that in order to benefit from the Monge property of paths in the complement , the bounding cycles of faces constituting the boundary of have to be simple. Unfortunately, none of the state-of-the-art recursive decomposition algorithms [5, 33] produces decompositions with such a property. To overcome this issue, in Section 2 we propose an improved recursive decomposition that guarantees this property by possibly extending the input graph . We believe that this issue has been overlooked in the previous works that used the Monge property for complements of pieces [5, 35, 40]. Finally, Section 6 puts all the ingredients together to obtain our time algorithm for the switch-on reachability problem.
Our result can be further extended to decrementally maintain the maximal (wrt. inclusion) 2-edge-connected subgraphs of a planar digraph. For , an induced subgraph is 2-edge-connected iff it is strongly connected and contains no edges whose removal would make no longer strongly connected. The 2-edge-connectivity in digraphs has been often studied in recent years (see e.g., [6, 17, 20]). In particular, the static computation of the maximal 2-edge-connected subgraphs proved to be a challenging task. The best known bounds for general digraphs are for dense graphs [20] and for sparse graphs [6]. We show that for planar digraphs, the maximal 2-edge-connected subgraphs can be computed in time. Moreover, they can be maintained subject to edge deletions within the same total time bound.
Another extension is an incremental transitive closure algorithm, in which the embedding of the final graph is given upfront. In other words, we are given a directed planar graph in which all edges are off, each update operation switches some edge on and the goal is to answer reachability queries with respect to the edges that are currently on. We note that the same ’’switch-on‘‘ model was considered in [19] for undirected reachability. The reachability queries are answered in time, and any sequence of updates is handled in time. This result shows that progress can be made also in the case of incremental planar graph transitive closure. Moreover, it pinpoints the hardness of incremental planar graphs problems, where few results have been obtained so far, as it is not known how to incrementally maintain small separators.
2 Preliminaries
Let be a graph. We let and denote the vertex and edge set of , respectively. Assume that is a directed graph (digraph). A set of vertices is strongly connected if there is a path in between every two vertices of . A strongly connected component (SCC) of is a maximal (w.r.t. inclusion) strongly connected subset of vertices.
Throughout, we use the term planar digraph to denote a directed planar multigraph. In particular, we allow the digraphs to have parallel edges and self-loops. Formally, there might exist multiple edges , such that each connects the same pair of vertices . We use the notation to denote any of the edges , whereas when we write , we mean some specific edge going from to .
Even though we allow the graphs not to be simple, we assume throughout the paper that . This is justified by the fact that in the problems we solve, self-loops and parallel edges can be ignored. However, parallel edges and self-loops might arise as we transform our problem. To simplify the presentation, we do not prune them, but instead guarantee that at any time the number of edges remains linear in the number of vertices.
Let . We denote by the graph obtained from by removing and by the graph obtained by contracting .
Finally, if is a directed graph and , we use u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 4.70833pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.70833pt\hbox{\scriptstyle{\scriptscriptstyle{G}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 6.96562pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces w to denote a directed path from to in . The graph is sometimes omitted, if it is clear from the context.
Planar Graph Embeddings and Duality.
We provide intuitive definitions below. For formal definitions, see e.g. [10]. An embedding of a planar graph is a mapping of its vertices to distinct points and of its edges to non-crossing curves in the plane. We say that a planar graph is plane embedded (or plane, in short), if some embedding of is assumed. The face of a connected plane is a maximal open connected set of points that are not in the image of any vertex or edge in the embedding of . There is exactly one unbounded face.
The bounding cycle of a bounded (unbounded, resp.) face is a cycle consisting of edges bounding in clockwise (counterclockwise, resp.) order. Here, we ignore the directions of edges. The face is called simple if and only if its bounding cycle is a simple cycle.
By the Jordan Curve Theorem, a Jordan curve partitions into two connected regions, a bounded one and an unbounded one . We say that a set of points is strictly inside (strictly outside, resp.) , if and only if (, resp.). is weakly inside (weakly outside, resp.) if and only if (, resp.).
Let be a plane embedded planar digraph. The dual graph of , denoted by , is a plane directed graph, whose set of vertices is the set of faces of . Moreover, for each edge , contains a directed edge from the face left of (looking from in the direction of ) to the face right of . We denote this edge in the dual as .
We use the fact that removing an edge in the primal graph corresponds to contracting its dual edge in the dual graph. Formally:
Fact 2.1**.**
.
Let be a directed graph. We say that is an inter-SCC edge if and belong to distinct SCCs of , and an intra-SCC edge otherwise. Note that is an inter-SCC edge iff there is no path from to in . In our algorithm we use the following relation.
Lemma 2.2** (folklore, see e.g. [28]).**
Let be a plane embedded digraph and . Then, is an inter-SCC edge of iff is an intra-SCC edge of .
Subgraphs, etc.
Let be a plane (directed or undirected) graph. A plane graph is called a subgraph of if and . inherits the embedding of . For a subset we define an edge-induced subgraph to be a subgraph of such that is the set of endpoints of the edges .
For two graphs , we define their union as the graph . Analogously, we define the intersection as the graph .
Let be a subgraph of . We define a hole of a face of that is not a face of . A simple hole is a hole of that is a simple face of .
Planar Graph Decompositions.
Let be a connected, undirected plane graph. Let . A recursive decomposition of is a collection of connected, edge-induced subgraphs of organized in a binary tree . We write to denote that , which is a subgraph of , is a node of . The level of is defined as the number of edges on the path from the root to . The tree has the following properties:
- •
The root of is the graph itself.
- •
A non-leaf subgraph has exactly two children such that .
- •
We define the set of boundary vertices of a subgraph (denoted by ) inductively:
- –
If is the root of , that is, , then .
- –
Otherwise, let and be the parent and the sibling of in , resp. Then .
- •
Each has holes and all vertices of lie on the holes of .
- •
If is the level of , then , for some .
- •
.
- •
There are leaf subgraphs in and each leaf subgraph has edges.
- •
has levels.
Remark 2.3*.*
The definition of a recursive decomposition naturally extends to directed plane graphs. However, each is connected in the undirected sense, i.e., weakly-connected.
Corollary 2.4**.**
Let be a recursive decomposition of a plane graph . Then each is contained in some leaf subgraph of . Moreover, .
Definition 2.5**.**
We call a recursive decomposition simple if and only if for each :
the holes of are all simple and vertex-disjoint, 2. 2.
if has a sibling in , then .
An algorithm for building a recursive decomposition of an -vertex planar graph in time essentially follows from [5, 33]. However, these decompositions do not guarantee that the holes are simple, which is essential when using ’’external‘‘ reachability matrices. In Sections 6 and 8 we show how a planar graph can be augmented into a graph so that has a simple recursive decomposition and all the interesting reachability properties of are preserved in . Both the augmentation and the decomposition can be computed in time.
Problem Definitions.
This paper deals with two decremental graph problems. In both problems the input is a digraph and the goal is to design a data structure that supports two operations. The first operation deletes a given edge from . The second operation is a query operation and its meaning is problem-dependent.
In the decremental strongly connected components (decremental SCC) problem the query operation is given two vertices as parameters. The goal is to determine whether and are in the same SCC of .
In the decremental single-source reachability (decremental SSR) problem a source vertex is given in the input in addition to the graph . Each query operation has a vertex as parameter and asks to determine whether there exists a path s\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 4.70833pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.70833pt\hbox{\scriptstyle{\scriptscriptstyle{G}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 6.96562pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces v.
The efficiency measure of such data structures is the total time needed to process all edge deletions. Unless stated otherwise, the queries are answered in constant time.
3 The Switch-On Reachability Problem
The core part of our algorithm solves the following problem, which we call switch-on reachability problem. The input is a digraph . Each edge of this digraph is either on or off. Initially, each edge is of off and an update operation may turn an edge on. Turning edges off is not allowed. The goal is to maintain, for each edge of (regardless of whether it is on or off), whether there is a directed path from to consisting solely of edges that are on. Note that since turning edges off is not allowed, once such a path appears, it may never disappear.
We first show that the decremental SCCs problem in planar digraphs can be reduced to the switch-on reachability problem.
Lemma 3.1**.**
Assume there exists an algorithm for the switch-on reachability problem in planar digraphs. Then, there exists an algorithm that maintains the set of inter-SCC edges of a planar digraph under edge deletions with the same asymptotic running time and space usage.
Proof.
Consider a digraph subject to edge deletions. Our goal is to maintain the set of inter-SCC edges in . By Lemma 2.2, it suffices to maintain the set of intra-SCC edges in . Recall that when undergoes deletions, is subject to edge contractions (see Fact 2.1). To reduce to switch-on reachability, we build a graph such that (i) edge contractions in can be simulated by switch-on operations on , and (ii) preserves the reachability information of (i.e., for any pair of vertices and , there is a path from to in if and only if there is a path from to in consisting of edges that are on).
We do this as follows. Let where is the set of reverse edges, containing a unique edge for each edge . To initialize , we start from all edges switched off, and then switch on all the edges in . Note that, after this preprocessing, trivially preserves the reachability information of .
When an edge is deleted from and consequently its dual edge is contracted in , we update by switching on the reverse edge . As a result, contains a single vertex created by the contraction, while contains two vertices that are mutually adjacent (through edges that are on). Thus, throughout the sequence of updates (i.e., contractions in and switch-on operations in ), keeps preserving the reachability information of .
Recall that an edge of is an intra-SCC edge iff there exists a path from to in . This in turn happens if there is a path from to in , as is also an edge of and it is always switched on. In order to test this condition, we can run the algorithm for the switch-on reachability problem on . The algorithm maintains whether the endpoints of every edge are connected with a directed path. This allows us to maintain the set of intra-SCC edges in , which in turn gives the desired set of inter-SCC edges in .
We next analyze the running time. Building takes linear time. Initializing takes linear time, plus the time required to switch on all the edges in . Moreover, each edge deletion in can be translated to a corresponding operation of the algorithm for switch on-reachability in constant time, as we can precompute pointers between the corresponding edges of , and . Indeed, the edges of map to the edges of in a natural way, as is a minor of (i.e., can be obtained from by deleting and contracting edges). Thus, the running time and the space usage are dominated by the algorithm for switch-on reachability. ∎
Lemma 3.2**.**
Assume there exists an algorithm that maintains the set of inter-SCC edges of a planar digraph under edge deletions. Then, there exists an algorithm for the decremental SCC problem in planar digraphs with the same asymptotic total running time and space usage. The query time of the decremental SCC algorithm is constant.
Proof.
Let be a planar digraph subject to edge deletions. Define to be the undirected graph obtained from by first removing inter-SCC edges and then ignoring edge directions. Observe that the connected components of are exactly the same as the SCCs of . Thus, to determine if two vertices are strongly connected in it suffices to check if they are in the same connected component of .
Observe that if is an inter-SCC edge of , then is an inter-SCC edge in any subgraph of that contains it. Thus, once an edge becomes an inter-SCC edge in , it remains an inter-SCC edge until it is deleted.
The algorithm maintaining inter-SCC edges of allows us to maintain : whenever becomes an inter-SCC edge in , it is deleted from . Thus, edges may only be deleted from . As a result, we can use the decremental connectivity algorithm of Łącki and Sankowski [38] to maintain the connected components of . This allows us to answer connectivity queries in , and, consequently, strong connectivity queries in . The total update time of the decremental connectivity algorithm is linear and each query is answered in constant time. Thus, the update and query times and the space usage of the resulting algorithm are asymptotically the same as in the algorithm maintaining inter-SCC edges. ∎
Remark 3.3*.*
The paper of Łącki and Sankowski [38] also describes an algorithm that explicitly maintains the set of vertices in each connected component and runs in time. By using their algorithm, we can obtain a decremental SCC algorithm that not only supports queries in constant time, but also explicitly maintains the set of vertices in each SCC.
Moreover, a decremental SCC algorithm implies an algorithm for decremental single-source reachability. In general graphs, this follows from a very simple reduction (see e.g., [7]). However, this reduction does not preserve planarity, so we need to provide a slightly more complicated one.
Lemma 3.4**.**
Assume there exists an algorithm for decremental SCC problem in planar digraphs that explicitly maintains the set of vertices in each SCC and runs in time. Then, there exists an algorithm for decremental single-source reachability problem in planar digraphs with the same asymptotic total update time, query time and space usage.
Proof.
A condensation of a directed graph , denoted by , is a graph obtained from by contracting all its SCCs. The vertices of are sets of vertices of contained in the corresponding SCC. Note that is a directed acyclic graph (DAG).
Our goal is to maintain the set of vertices of , which are reachable from the vertex of containing the source vertex . The high-level idea is that in order to maintain SCCs of we use the decremental SCC algorithm, whereas to maintain the set of reachable vertices in we use the fact that it is a DAG, which makes the problem much easier.
We first describe a simple dynamic single-source reachability algorithm for DAGs. This algorithm maintains the set of vertices reachable from a fixed source and supports two types of updates. The first update removes a single edge, whereas the second one replaces a vertex with an acyclic subgraph . This happens in three steps. First, some number of new vertices are added to the maintained graph (vertex is not deleted). Second, some edges of , whose endpoint is may change this endpoint to one of the newly added vertices. Third, new edges can be added, but their endpoints can only be the newly added vertices and . Also, adding these edges may not introduce cycles.
Note that both operations are in a sense decremental, as once a vertex becomes unreachable from the source, it never becomes reachable again. The set of vertices reachable from the source can be easily maintained by iteratively applying the following principle: if a vertex distinct from the source has no incoming edges, it is not reachable from the source and thus can be deleted from . The resulting algorithm runs in time which is linear in the size of the original graph and the number of vertices and edges added in the course of the algorithm. See [34] for details.
It remains to describe how to maintain and funnel the updates to to the dynamic single-source reachability algorithm for DAGs. We run the decremental SCC algorithm that maintains the SCCs explicitly (see Remark 3.3). Whenever an inter-SCC edge of is deleted, it has a corresponding edge in and to update it suffices to remove this corresponding edge. Otherwise, if an intra-SCC edge is removed from an SCC , the SCC may decompose into SCCs . Wlog. assume that is the largest one of these SCCs. Thus, to update we add one new vertex for each of . We do not need to add a vertex corresponding to , as we update the vertex corresponding to (reuse it), so that it represents . Some edges that were incident to need to be updated, as after the edge deletion their endpoint is one of . In order to do that, we iterate through all edges of incident to vertices contained in . Similarly, by iterating through all these edges we may add all new inter-SCC edges that appear as a result of the edge deletion.
It follows that the total running time of the algorithm is dominated by the initial graph size and the total time of iterating through edges in the process of handling an edge deletion. An edge is considered only when the size of the SCC containing either or halves. Thus, we spend time for each edge, which gives total time. ∎
4 Structural Properties of Reachability in Plane Digraphs
In this section we present the structural properties of reachability in planar digraphs that we later exploit in our algorithms. We show how to efficiently represent reachability information between a set of vertices that, roughly speaking, lie on a constant number of faces. In fact, our analysis is more general and extends to sets of vertices that lie on a constant number of separator curves, which we define below. In the following definition, we consider undirected graphs or directed graphs where edge directions are ignored.
Definition 4.1**.**
Let be a plane embedded graph. A Jordan curve is a separator curve of if and only if one of the following holds:
each connected component of lies either weakly inside or strictly outside ; 2. 2.
each connected component of lies either weakly outside or strictly inside .
Moreover, for each , the interior of (the embedding of) is either a contiguous fragment of or is disjoint with .
We will sometimes abuse the notation and identify the separator curve with the set of vertices lying on it.
Fact 4.2**.**
Let be a cycle bounding some simple face of a plane embedded graph . Then, the closed curve defined by the embedding of is a separator curve.
Consider a plane digraph and let be a set of vertices of that lie on pairwise disjoint separator curves of . We have , which implies for . We define a total order on the elements of , which satisfies the following property. Consider the sequence of elements of sorted according to . Then, elements of each form a contiguous fragment of and are sorted in clockwise order. There could be multiple total orders that satisfy this property. Namely, for each the smallest vertex with respect to can be chosen arbitrarily and the contiguous fragments corresponding to sets may come in any order. However, this is not relevant to our later analysis. Thus, in the following, we assume that each set has an associated total order . For we also write if for each , , we have . Note that implies .
Definition 4.3**.**
Let be a binary matrix with both its rows and columns indexed with the vertices of , such that the sets lie on pairwise disjoint separator curves of , respectively. The rows and columns of are ordered according to the order induced by the sets . We say that is a reachability matrix for if and only if for each , if and only if there exists a path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 4.70833pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.70833pt\hbox{\scriptstyle{\scriptscriptstyle{G}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 6.96562pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces v.
In the following we fix the sequences and and the order satisfying the assumption of Definition 4.3. We set .
Definition 4.4**.**
Let and let be the reachability matrix of . A binary matrix with rows indexed with and columns indexed with is called a reachability submatrix for iff for all and . Also, denote by the matrix .
Definition 4.5**.**
Let . The subset of containing those such that for some , is called the set of active columns of and is denoted by .
Definition 4.6**.**
For a set of reachability submatrices and a row , we define a row projection to be the subset . Similarly, for , we define a column projection .
The following lemma provides a decomposition of the reachability matrix used in the next sections in a black-box manner.
Lemma 4.7**.**
Let be a plane embedded digraph and let be pairwise disjoint separator curves of , where . Let be a subset of of size such that and the vertices of lie on .
Then, the reachability matrix of in can be partitioned into a set of reachability submatrices such that:
for each , , there exists exactly one such that and , 2. 2.
for each and , the ones in each row of form blocks, 3. 3.
for any and , the sets and have size .
The sets and that define the partition do not depend on the entries of . The partition can be computed in time.
The remaining part of the section is devoted to proving Lemma 4.7.
Definition 4.8**.**
The reachability submatrix is called bipartite, if and lie on a single separator curve (i.e., for ) and either or .
Lemma 4.9** (Monge property).**
Let be a bipartite reachability submatrix of . Let and be such that and . Suppose and . Then and also hold.
Proof.
We have for some . Without loss of generality, assume that and that all connected components of lie either weakly inside of or strictly outside . Since lie on , the connected components of containing any of these vertices are all weakly inside . As , there exists a simple path P=a\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 4.70833pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.70833pt\hbox{\scriptstyle{\scriptscriptstyle{G}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 6.96562pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces c contained entirely weakly inside . Similarly, there exists a path Q=b\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 4.70833pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.70833pt\hbox{\scriptstyle{\scriptscriptstyle{G}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 6.96562pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces d contained weakly inside . By planarity of , we conclude that the paths and must have a common vertex (see Figure 2). Note that is reachable from both and . Analogously, both and are reachable from . Thus, there also exist paths a\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 4.70833pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.70833pt\hbox{\scriptstyle{\scriptscriptstyle{G}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 6.96562pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces d and b\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 4.70833pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.70833pt\hbox{\scriptstyle{\scriptscriptstyle{G}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 6.96562pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces c. ∎
Lemma 4.10**.**
Let be a bipartite reachability submatrix of . Let . Denote by the elements of . For each non-zero row of , the ones in that row form a single contiguous block, i.e., there exist and () such that holds if and only if .
Proof.
Let be some row of containing at least one non-zero entry. Suppose there exist such that and , and . By the definition of , there exists some other row , such that . Wlog. assume . Thus, we have both and . By Lemma 4.9 this implies , a contradiction. ∎
Lemma 4.11**.**
Let be a set of vertices lying on a single separator curve in and . The reachability submatrix can be partitioned into a set of bipartite reachability submatrices such that:
for each , , there exists exactly one such that and , 2. 2.
for any and , the sets and have size .
The sets and that define the partition do not depend on the entries of . The partition can be computed in time.
Proof.
We give a recursive procedure to construct the partition , for . If , the procedure exits immediately. Otherwise, let , where and . Let . Set and . Note that . Thus, both and are bipartite reachability submatrices. We add these matrices to the partition and recurse on the subsets and (see Figure 2).
Note that for any , , the last recursive call with both and in the input set places the entries and in the bipartite reachability submatrices and .
Fix and assume . Let be the number of bipartite reachability submatrices that are produced by the recursive algorithm and contain a row (column) corresponding to . We have and thus it is easy to see that . Thus, we conclude that for any , and similarly .
The recursive procedure runs in time that is proportional to the total size of matrices that are produced. Recall that for each , , there exists exactly one such that and . It follows that the total running time is . ∎
An analogue of Lemma 4.10 can be shown for reachability submatrices , where .
Lemma 4.12**.**
Let be a reachability submatrix for the sets , where . Let . For each row of , the ones in that row form connected blocks.
Proof.
Let be some row of containing at least one non-zero entry. Equivalently, there exists a path s\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 4.70833pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.70833pt\hbox{\scriptstyle{\scriptscriptstyle{G}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 6.96562pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces y for some . Without loss of generality, assume that all connected components of lie either weakly inside or strictly outside . As and is in the same connected component of as , lies weakly inside . However, and , so entire lies strictly inside . In particular, all vertices of lie strictly inside .
Let P=s\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 4.70833pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.70833pt\hbox{\scriptstyle{\scriptscriptstyle{G}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 6.96562pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces y be some shortest directed path from to a vertex of . Clearly, is simple and is the only vertex of . Let be the last vertex of such that and denote by the directed subpath of . By the definition of a separator curve, is weakly inside , weakly outside and , .
Let be obtained by ’’cutting‘‘ along the path as follows. We split each vertex of into two vertices and , that inherit the edges of strictly emanating left or right of , respectively. The created vertices are connected with directed paths and (see Figure 3). Let . Note that all the vertices of lie on a single separator curve of . This curve imposes some clockwise order on .
First we prove that any is reachable from in if and only if is reachable from either or in . The ’’if‘‘ part is trivial. Suppose there is a path R=q\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 4.70833pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.70833pt\hbox{\scriptstyle{\scriptscriptstyle{G}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 6.96562pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces t and let be the last vertex that and have in common. Note that is not the last vertex of and let the edge going out of emanate (wlog.) left of . The subpath z\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{\scriptscriptstyle{}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces t of only shares its starting point with and thus corresponds to a path z^{\prime}\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.00002pt\raise 5.26389pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-2.26389pt\hbox{\scriptstyle{\scriptscriptstyle{G^{\prime}}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 7.51563pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 18.03125pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 18.03125pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces t. Therefore, there exists a path q^{\prime}\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.00002pt\raise 5.26389pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-2.26389pt\hbox{\scriptstyle{\scriptscriptstyle{G^{\prime}}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 7.51563pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 18.03125pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 18.03125pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces z^{\prime}\overset{\scriptscriptstyle{G^{\prime}}}{\longrightarrow}t.
Next we prove that for , any is reachable from in if and only if is reachable from either or or in . To see the ’’if‘‘ part, note that is reachable from or in iff it is reachable from in , whereas is reachable from in . For the ’’only if‘‘ part, suppose there is a path s\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 4.70833pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.70833pt\hbox{\scriptstyle{\scriptscriptstyle{G}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 6.96562pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces t. Either this path intersects with and then is reachable from in (which implies that is reachable from or in ), or the path does not intersect with and is thus preserved in .
Now let and . Observe that the sets constitute contiguous fragments of the cycle containing the elements of ordered clockwise around . Consider the bipartite reachability matrix of the graph . We show that . Clearly, . Let . There exists a path S\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 4.70833pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.70833pt\hbox{\scriptstyle{\scriptscriptstyle{G}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 6.96562pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces x, where . If this path does not intersect with , then it also exists in . Otherwise, is reachable from in and thus is reachable from either or in .
By Lemma 4.10, the ones in each row of , where form at most one block. Now let be the matrix but with columns ordered according to the order imposed on . As the order of is just a cyclical shift of the order of , we conclude that for each row of , the ones in that row form blocks of columns. To finish the proof, observe that the ones in the row of can be seen as as the sum of:
- •
a single one in the column (as ),
- •
the ones in the row of ,
- •
the ones in the row of ,
- •
if , the ones in the row of ,
which clearly make up at most blocks of ones in the row . ∎
Proof of Lemma 4.7.
We first partition into reachability submatrices , for all . Each is then partitioned using Lemma 4.11, whereas each , for , is included in without further partitioning. As each belongs to exactly one , . By Lemmas 4.10 and 4.12, for all , the ones in each row of , where , form at most connected blocks. The running time of this procedure is . ∎
5 The Switch-On Monge Transitive Closure
Let and be two plane embedded digraphs and let be a set of vertices lying on a constant number of pairwise disjoint separator curves of , for . Moreover, assume that .
In this section we consider the following problem. Assume that the edges of and undergo switch-on operations. Denote by the subgraph of consisting of the edges that are switched on. This way, the entries of the reachability matrix of in may change from [math] to . We wish to maintain the reachability matrix of the graph subject to updates to the matrices and . Note that our assumptions imply that depends only on and .
Observe that as is a subgraph of , the separator curves of are also the separator curves of . The remaining part of this section is devoted to proving the following theorem.
Theorem 5.1**.**
Let be a set of vertices lying on a constant number of separator curves of (for ), such that . Let . Assume that the edges of undergo switch-ons and denote by the subgraph of consisting of the edges that are on. Let be the reachability matrix of in and let be the reachability matrix of in . Suppose that after a switch-on we are given the list of entries in and that changed. Then we can initialize and maintain the matrix in total time.
5.1 Queue-Based Incremental Transitive Closure Algorithm
We first show and analyze a simple queue-based algorithm for updating the transitive closure of a graph after a set of edges is added. Its pseudocode is given as Algorithm 1. The algorithm should be considered folklore, but for sake of completeness we describe it in a detailed way, as we need its efficient implementation.
The transitive closure algorithm is based on the following idea. Whenever it determines that a vertex is reachable from a vertex , it infers that every vertex reachable from by an edge is also reachable from and every vertex that has an edge to can also reach . Then, it propagates this information using a queue. In the pseudocode, we use to denote the set of heads of out-edges of and to denote the set of tails of in-edges of . Moreover, is the set of vertices such that and is the set of vertices such that .
Lemma 5.2**.**
Algorithm 1 is correct.
Proof.
We first show that the algorithm sets We use induction on . For each we show that at the beginning of the -th iteration of the while loop:
only if there is a path from to in , 2. 2.
only contains pairs such that .
The second item follows directly from the pseudocode. To show the first one, observe that the algorithm sets in line 12 when (since has been removed from ) and . Similarly, it sets when and . In both cases the induction hypothesis implies that the underlying paths exist. This completes the first part of the proof.
It remains to show that if adding causes to be reachable from , then the algorithm sets (we assume that was not reachable from before adding ). Let P=p\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 4.70833pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.70833pt\hbox{\scriptstyle{\scriptscriptstyle{G}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 6.96562pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces q. We say that an edge of has a detour avoiding if a subpath of containing can be replaced with a path (detour) that does not contain edges of and the obtained path still connects and . As long as has an edge of that has a detour avoiding we replace its respective subpath with the detour. This process terminates, as at each step we reduce the number of edges of on . Once the process terminates, contains some edge of , as there is no path from to that does not contain edges of . Moreover, does not have a detour avoiding .
Let P^{\prime}=p^{\prime}\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 4.70833pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.70833pt\hbox{\scriptstyle{\scriptscriptstyle{G}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 6.96562pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces q^{\prime} be a subpath of that contains the edge . We have that before the algorithm was run. We now use induction on the length of to show that the algorithm sets .
The case when is easy, because the only valid path of length contains the edge by itself. Let us now consider a path of length . Either the first or the last edge of is not equal to . Without loss of generality, let us assume that it is the last one and denote it by . By the induction hypothesis, the algorithm sets . This means that it then adds to the queue.
Consider the iteration of the while loop when is removed from the queue, that is . Clearly, , as is an edge on a path in . There are two cases to consider. If , then , so the procedure has already set . Otherwise, and then is set in line 12 of some iteration of the for-loop. This completes the proof. ∎
The following lemma highlights which part of Algorithm 1 can be sped up.
Lemma 5.3**.**
The running time of Algorithm 1, excluding the time needed to compute the sets and , is proportional to the number of entries of that are changed from [math] to (or constant, if no entries are changed).
Proof.
Let be the total number of entries of that are changed from [math] to by the algorithm. Observe that just before the algorithm sets in line 12, we have , as . The similar reasoning applies to line 15. Thus, the total running time of the two for loops is proportional to .
Moreover, the number of elements added to the queue is at most . This implies that the total number of iterations of the while loop is at most , and the lemma follows. ∎
5.2 Proof of Theorem 5.1
Our goal is to maintain the transitive closure of a matrix that is given as a bitwise OR of matrices and . The following notation will prove useful in the remainder of the paper.
Definition 5.4**.**
Let be some binary matrix with rows and columns indexed with a vertex set . Let . We denote by the graph .
Using this notation, our goal is to maintain the transitive closure of a graph . The vertex set of is . Note that as the entries of change only from zero to one, the set undergoes incremental updates.
In order to handle each update efficiently, we use Algorithm 1. Moreover, we leverage the special structure of these matrices to reduce the total time spent on computing the sets and in lines 11 and 14. In the following we only deal with the former set; in order to compute the latter, one needs to proceed symmetrically.
We first describe how the algorithm represents the matrices and and updates their representation. Let us focus on , as the representation of is analogous. The algorithm uses Lemma 4.7 to compute the partition . For each it maintains the following:
- •
the contents of the matrix ,
- •
the set ,
- •
for each row of , the set .
Let . By Lemma 4.7, the ones in each row of form contiguous blocks. Thus, internally the set is represented by a constant number of intervals. We have that iff and belongs to one of the intervals.
Lemma 5.5**.**
The representation of matrices of and can be computed and maintained in total time throughout any sequence of updates to and .
Proof.
For simplicity, let us consider . By Lemma 4.7, we can compute in time. Observe that, by Lemma 4.7, this partition is independent of the values in the cells of , so it does not need to be updated.
Whenever a cell of changes from [math] to we update the corresponding cell in some . Note that, again by Lemma 4.7, for each cell of there is exactly one that contains the corresponding cell. We can compute the mapping between the cells while computing , so the values in the matrices from can be updated in constant time. While updating the matrices, it is also easy to update the set for each .
It remains to describe how to maintain for each row of . Consider a sequence obtained from this row by removing cells in inactive columns. We store this sequence in a balanced binary tree, keyed by the column. This tree can be updated in time when a column becomes active or some cell changes its value from [math] to . Moreover, it can be easily augmented so as to maintain the intervals that we use to represent .
There is a small technicality here. Each update to may consist of multiple cells changing value from [math] to and only after all cells have been updated the structural properties of Lemma 4.7 hold. Thus, before all cells in the considered row are updated, the representation of may consist of more than a constant number of intervals, which could affect the running time. However, this does not pose an issue, as we can force the binary tree to compute only the first intervals of the representation. As a result, the running time is not affected and the representation is correct once all entries of are updated.
Updating the matrices and the sets takes time which is linear in the size of , that is . To bound the running time of updating the sets we note that each element is inserted into the binary tree only once (when the corresponding column becomes active) and can be updated only once (when the corresponding matrix entry changes value from [math] to ). Thus, we spend time for each cell of each . This gives time in total, and yields the lemma. ∎
For each and the algorithm stores a reachability candidates set . The algorithm maintains the invariant that . Whenever a column of becomes active, we check whether and if this is the case, we insert into . Once we set , is removed from (and, clearly, never added again, as will never change its value back to [math]). Each is stored as a dynamic predecessor data structure, such as the van Emde Boas tree [50].
Lemma 5.6**.**
The sets of reachability candidates can be updated in total time.
Proof.
Fix . For each each element of is added to and removed from at most once. If then the total number of operations is . By Lemma 4.7, for each there are matrices such that . Thus we make at most operations for a fixed , which gives operations in total. Since each operation on a van Emde Boas tree takes time, we conclude that maintaining reachability candidates takes time. ∎
We are now ready to show how to speed up line 11 of Algorithm 1. The goal is to compute the set efficiently. Algorithm 1 traverses this set, once it is computed, but this does not affect the running time considerably. Only the computation of the set could be slow. This means that it suffices to compute the set in time which is, say, almost linear in its size. Our algorithm, roughly speaking, uses the property that is represented by a small number of intervals, so computing an intersection with the set is easy. Recall that is the subset of consisting of matrices which contain the row .
Lemma 5.7**.**
Let
[TABLE]
Then .
Proof.
By Lemma 4.7 and the definition of the sets , we have
[TABLE]
Moreover . Hence
[TABLE]
Lemma 5.8**.**
* can be computed in time.*
Proof.
By Lemma 5.7, it suffices to compute
[TABLE]
Since (by Lemma 4.7), this is a sum of sets of the form . Moreover, these sets are disjoint since for the matrices such that , the sets are disjoint.
Let us focus on computing . Recall that is represented as a constant number of intervals, such that iff belongs both to and one of the intervals. However, we also have . As a result, to compute the intersection it suffices to take elements of that are contained in the intervals describing . Since is represented as a van Emde Boas tree, finding a single element of contained in a given interval can be done in time. Thus, we spend time on computing each element of plus time to consider sets that comprise the sum. ∎
Proof of Theorem 5.1.
By Lemmas 5.5 and 5.6 the total cost of computing and updating the representations of and and the reachability candidates is . By Lemma 5.3, the total running time of Algorithm 1 excluding the cost of lines 11 and 14 is . By Lemma 5.8, it takes to execute each of these lines, assuming that they compute a set of size . Since each such set is then traversed by the algorithm, the overhead implies that the transitive closure algorithm runs in total time. Thus, the overall running time is . ∎
6 The Switch-On Reachability Data Structure
In this section we show how to combine the recursive decomposition tree with the switch-on transitive closure data structure of Theorem 5.1 in order to solve efficiently the switch-on reachability problem. By Lemmas 3.1 and 3.2, this will imply an algorithm for solving the decremental strongly-connected components problem within the same time bounds.
Let be a plane embedded digraph and let . The following technical lemma is proved in Section 8.
Lemma 6.1**.**
Let be a planar digraph and let . In time we can construct a plane digraph along with:
- •
a simple recursive decomposition ,
- •
two disjoint subsets ,
- •
a 1-to-1 mapping from to the set of strongly connected components of ,
- •
a bijective function ,
satisfying the following properties.
* and .* 2. 2.
The are no inter-SCC edges in . 3. 3.
*For any , let . Then and . *
Corollary 6.2**.**
Let . Let , , , and be defined as in Lemma 6.1. Let and let and . Then for any , a path u^{\prime}\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{\scriptscriptstyle{}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces v^{\prime} exists in if and only if a path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{\scriptscriptstyle{}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces v exists in .
Proof.
The proof is trivial when , so suppose .
Let be a simple path in , where and . For , denote by the unique vertex of such that . Let be the edges of in order of their occurrence on . As for all edges of lying on we have (recall that has no intra-SCC edges), we conclude that for any . We also have and . Moreover, for each , . Thus, is a path s(u^{\prime})\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{\scriptscriptstyle{}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces s(v^{\prime}) in . To conclude, note that and .
Conversely, let be a path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{\scriptscriptstyle{}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces v in , where . Let be any vertices of such that and . For each we have and thus there exists a path v_{i-1}^{\prime}\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{\scriptscriptstyle{}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces u_{i}^{\prime} in . We now show that for each there is also a path u_{i}^{\prime}\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{\scriptscriptstyle{}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces v_{i}^{\prime} in . Let . Note that and and hence there is a path in .
We conclude that there is a path in . ∎
The data structure presented in this section requires a simple recursive decomposition . We now prove that the general case of any planar digraph can be reduced to the case when we are given a simple recursive decomposition without increasing the overall asymptotic running time of the whole algorithm.
Lemma 6.3**.**
Let be a planar digraph and let . In time we can reduce the switch-on reachability problem on to the switch-on reachability problem on a plane graph with a given simple recursive decomposition and such that and .
Proof.
Let and be defined as in Lemma 6.1. By definition, is accompanied with a simple recursive decomposition . Hence, we only need to show how to translate the updates to into the updates to .
We first switch on all edges of . When an edge of is switched on, we switch on in . The edges of are never switched on in . Let be the subset of edges of that are switched on at some point of time. For any , let . By Corollary 6.2, the path exists in iff the path exists in . Thus, to track the reachability between the endpoints of , we only need to track the reachability between the endpoints of . This is done by solving the switch-on reachability problem on . ∎
In the remaining part of this section we assume that we are given a simple recursive decomposition of .
For , denote by the edge-induced subgraph .
Lemma 6.4**.**
Let . Then .
Proof.
The proof is by induction of the level of in . If is the root, then is empty and the statement is clearly true.
Consider now which is not the root of . Let be the parent of and assume . Let be the sibling of . Recall that, by definition, . Let . Clearly, since . Moreover, is incident to at least one edge of . If , then and thus . Otherwise, and hence . ∎
Lemma 6.5**.**
Let . A cycle bounding a hole of is a separator curve of .
Proof.
By Fact 4.2, the cycle bounding a simple face of is a separator curve of . ∎
Lemma 6.6**.**
Let . A cycle bounding a hole of is a separator curve of .
Proof.
Note that the holes of can be seen as unions of original faces of , merged by removing the edges of from . Thus, each edge of lies inside some unique hole of . Let be the subset of edges lying inside .
Let be the cycle bounding a hole of . Assume wlog. that is a bounded face, then the inside of is the same as the inside of (the case when is unbounded is analogous; we replace each occurrence of ’’inside of ‘‘ with ’’outside of ‘‘). By Lemma 6.5, for each , lies weakly outside . If is the only hole of , then clearly lies weakly on one side of and the Lemma holds.
Assume now that is not the only hole, and let be some other hole of . As and are disjoint, lies strictly outside . Thus, all edges of lie strictly outside . Hence, for . To conclude, note that for each weakly connected component of , the edges of that component are contained in a unique subset . ∎
Remark 6.7*.*
The assumption that is simple is crucial to proving Lemma 6.6, which does not hold if the holes of are not pairwise-disjoint or not necessarily simple.
Lemma 6.8**.**
Let . The set can be partitioned into sets so that each lies on a curve such that is a separator curve of both and .
Proof.
Let be the holes of . By Lemmas 6.5 and 6.6, we can set to be the subset of lying on . By the definition of , each lies on a unique hole of . ∎
Denote by the subgraph of consisting of the edges that are switched on. Our strategy will be to maintain, for each leaf subgraph , a binary matrix with both rows and columns indexed with the vertices of , such that iff there exists a path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.00002pt\raise 5.83888pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-2.83888pt\hbox{\scriptstyle{\scriptscriptstyle{\overline{G}}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 7.50002pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 18.00003pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 18.00003pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces v. Recall that our goal is to track, for each , the information whether there is a path v\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.00002pt\raise 5.83888pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-2.83888pt\hbox{\scriptstyle{\scriptscriptstyle{\overline{G}}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 7.50002pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 18.00003pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 18.00003pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces u consisting of edges that are switched on. By the definition of , each edge is contained in some leaf subgraph and thus all the needed information is contained in the matrices . To efficiently update the matrices while the edges are switched on, we maintain two types of auxiliary information for each :
A binary matrix with both rows and columns indexed with the vertices of , such that iff and there exists a path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{\scriptscriptstyle{}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces v in ; 2. 2.
A binary matrix with both rows and columns indexed with the vertices of , such that iff and there exists a path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{\scriptscriptstyle{}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces v in .
Additionally, for each leaf subgraph we maintain the transitive closure of in a binary matrix . Note that is a subgraph of , namely . In the following we discuss how the matrices , , and interplay and we show how they can be efficiently maintained for any sequence of edge switch-ons. Observe that all these matrices undergo monotone changes: the edge switch-ons can only cause their entries to change from [math] to . Therefore, an matrix can be updated only times.
Lemma 6.9**.**
Let be a leaf subgraph of . can be initialized and maintained in total time subject to any sequence of switch-ons of edges of .
Proof.
As each leaf subgraph has constant size, once one of the edges of is switched-on, the matrix can be recomputed from scratch in time. ∎
In the following lemma we say that a matrix depends only on some matrices if the information contained in is sufficient to compute .
Lemma 6.10**.**
Let be a subgraph of and let .
If is a leaf subgraph, then depends only on . 2. 2.
If is a non-leaf subgraph, then depends only on and . 3. 3.
If is a non-root subgraph, then let and be the parent and the sibling of in , respectively. depends only on and . 4. 4.
If is a leaf subgraph of , then depends only on and .
Any of the matrices can be maintained in total time subject to any sequence of updates to the matrices it depends on.
The dependencies stated in Lemma 6.10 are depicted in Figure 4.
Proof.
(1) is a submatrix of , which is of constant size. The total number of updates to is .
(2) For , set , , and . Note that by Lemma 6.8, the set lies on a constant number of separator curves . We also have and . By Theorem 5.1, the reachability matrix of in can be maintained in total time, subject to any sequence of updates to and . As , is a submatrix of and thus can be maintained within the same time bounds.
(3) Set , , , , and . Note that by Lemma 6.4, and similarly . Therefore, . By Lemma 6.8, the set lies on a constant number of separator curves of .
By Theorem 5.1, the reachability matrix of in can be maintained in , since . As and , . Thus, actually represents the reachability between vertices in . As clearly , is a submatrix of and thus can be maintained in time as well.
(4) We show that iff there exists a path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{\scriptscriptstyle{}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces v in the graph (see Definition 5.4). Note that .
Clearly, by the definitions of the matrices and , if there exists a path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.00002pt\raise 5.39166pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.025pt\hbox{\scriptstyle{\scriptscriptstyle{T_{H}}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 8.63316pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 20.26633pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 20.26633pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces v, there also exists a path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.00002pt\raise 5.83888pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-2.83888pt\hbox{\scriptstyle{\scriptscriptstyle{\overline{G}}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 7.50002pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 18.00003pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 18.00003pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces v.
Now, let be some path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.00002pt\raise 5.83888pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-2.83888pt\hbox{\scriptstyle{\scriptscriptstyle{\overline{G}}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 7.50002pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 18.00003pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 18.00003pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces v such that . Split into maximal subpaths fully contained (as far as their edges are concerned) in either or .
Let be a subpath a\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{\scriptscriptstyle{}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces b entirely contained in . Then . We prove that . The proof that is analogous. We either have and implies , or the path is fully contained in and thus as well. Now, as , by Lemma 6.4, we have . Hence, there is an edge in .
By the definition of , for P_{i}=a\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.00002pt\raise 4.70833pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.70833pt\hbox{\scriptstyle{\scriptscriptstyle{H}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 7.28125pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 17.5625pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 17.5625pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces b, there is an edge in . We conclude that for each subpath P_{i}=a\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.00002pt\raise 5.83888pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-2.83888pt\hbox{\scriptstyle{\scriptscriptstyle{\overline{G}}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 7.50002pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 18.00003pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 18.00003pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces b, there is an edge and thus there is a path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.00002pt\raise 5.39166pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.025pt\hbox{\scriptstyle{\scriptscriptstyle{T_{H}}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 8.63316pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 20.26633pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 20.26633pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces v.
As each of the matrices is of constant size and , the matrix encoding the transitive closure of can be recomputed in time after any update to these matrices. Moreover, the total number of changes to the matrices is constant. ∎
Note that each matrix depends directly on at most two other matrices. The dependencies allow us to organize the matrices in a dependency list , such that each matrix depends only on matrices earlier in the sequence. The order of the elements of is as follows. The matrices form groups according to their type. The order on groups is . Matrices within the groups , and are sorted increasingly inclusion-wise by their corresponding subgraphs of . On the other hand, the matrices within the group are sorted decreasingly inclusion-wise by their corresponding subgraphs of .
Lemma 6.11**.**
Let be a plane digraph and let . Let be a simple recursive decomposition of . The switch-on reachability problem on can be solved in time.
Proof.
We initialize the data structures maintaining the matrices of the dependency list. When an edge is switched on, we create a priority queue of matrices that potentially need updates. The elements of are keyed by their position in the list . First, the unique matrix such that , is pushed to . We repeatedly pop matrices out of and process either the edge switch-on (in the case of matrices) or the changes in matrices such that directly depends on . If the matrix changes after switching on, we push to all matrices such that directly depends on . The correctness of this update procedure follows form the fact that the dependencies do not form cycles and all required matrices are notified about the switch-on.
Observe that as for each matrix , there are at most two matrices of that depend directly on , the total number of times a matrix is inserted to is proportional to the total size of the matrices of plus the sum of sizes of the leaf subgraphs of , i.e., , by Corollary 2.4. Thus, the cost of priority queue operations is . By Lemma 6.10 for , the total time needed to initialize and maintain the matrices subject to the updates to matrices that they depend on, is . Recall that . Thus, the total cost over all subgraphs is . ∎
Theorem 6.12**.**
Let be a planar digraph and let . The switch-on reachability problem on can be solved in time.
Proof.
We first apply Lemma 6.3 to reduce the problem to the case with a given simple recursive decomposition . The reduction takes time. Then, we apply Lemma 6.11. ∎
7 Extensions of the Switch-On Reachability Data Structure
7.1 Computing Maximal 2-Edge Connected Subgraphs
Definition 7.1**.**
Let be a digraph. We call an edge a strong bridge of iff has more strongly connected components than .
Lemma 7.2**.**
Let be a plane digraph and let be an intra-SCC edge of . Let . The edge is a strong bridge of iff there exists a path a\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{\scriptscriptstyle{}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces b in .
Proof.
By Lemma 2.2, is an inter-SCC edge of , or equivalently, there is no path b\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{\scriptscriptstyle{}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces a in . Note that is a strong bridge iff some edge is intra-SCC in but is inter-SCC in . Equivalently, by Fact 2.1, is inter-SCC in and is intra-SCC in . Consequently, there is a set of edges , , such that forms a directed cycle in , but does not form a directed cycle in . Thus, is in fact a directed path in . However, , and hence the lemma follows. ∎
Lemma 7.3**.**
Let be a planar digraph and let . The set of strong bridges of can be maintained subject to edge deletions in total time.
Proof.
Similarly as in the proof of Lemma 3.1, we reduce our problem to maintaining the graph under edge switch-ons. A contraction of in is translated to a switch-on of in . By Lemma 7.2, it is sufficient to solve the following extended switch-on reachability problem on the input graph . Given a planar digraph , we need to maintain for each edge of whether there is a path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{\scriptscriptstyle{}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces v in , where is an incremental, switched-on subgraph of .
The next step is to reduce such an extended switch-on reachability problem to the case when the underlying graph has a simple recursive decomposition . To this end, we apply Lemma 6.1 to and obtain the graph , function and the subsets . Analogously as in the proof of Lemma 6.3, the edges are switched on during the initialization, the edges are never switched-on, whereas a switch-on of the edge is translated to a switch-on of in . Note that, by Corollary 6.2, for any , and any , a path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{\scriptscriptstyle{}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces v exists in if and only if a path u^{\prime}\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{\scriptscriptstyle{}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces v^{\prime} exists in , where . Hence, in order to maintain the reachability between the endpoints of in we only need to maintain the reachability between the endpoints of in . Recall that the cost of applying Lemma 6.1 is and the size of the obtained graph is linear in the size of . Therefore, to finish the proof, we only need to solve our extended switch-on reachability problem on a graph having a simple recursive decomposition .
To this end, we extend the data structure of Section 6 as follows. Recall that, by the simplicity of , for each edge there is a unique leaf subgraph containing . Also recall that the reachability information between the vertices of in can be recomputed in time whenever the graph or the matrix changes. In fact, for all of edges and vertex pairs , whether the path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{\scriptscriptstyle{}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 13.00002pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces v exists in can be computed based only on and , when any of them changes, again in time (see the proof of Lemma 6.10). As the total update time remains , the lemma follows. ∎
Theorem 7.4**.**
Let be a planar digraph and let . The maximal 2-edge-connected subgraphs of can be maintained subject to edge deletions in total time.
Proof.
It is known that the maximal 2-edge-connected subgraphs can be found by repeatedly removing all the strong bridges of until none are left [17]. The maximal 2-edge-connected subgraphs of are defined as the strongly connected components of the obtained subgraph. Hence, we can combine Lemma 7.3 with our decremental strong connectivity algorithm to not only compute the maximal 2-edge-connected subgraphs (by repeatedly detecting and deleting the arising strong bridges) but also to maintain them subject to edge deletions. ∎
7.2 Incremental Switch-On Transitive Closure
In this section we show how to solve the incremental transitive closure problem in planar graphs, under the assumption that the embedding of the final planar graph is given upfront. We formulate this as a dynamic graph problem, in which the input is a directed graph and each edge can be either on or off. Initially all edges are off, and an update operation may turn a single edge on. Each query asks about the existence of a directed path that connects two vertices and consists of edges that are on. The goal of this section is to prove the following theorem.
Theorem 7.5**.**
There exists an algorithm that can maintain a planar digraph under switching edges on and can answer reachability queries. Its total update time is and the query time is
An easy corollary is as follows.
Theorem 7.6**.**
There exists an algorithm that can maintain a planar digraph under contracting edges and can answer reachability queries. Its total update time is and the query time is
Proof.
Let be the input graph. We build a graph which consists of together with all reverse edges of . The graph is used as an input to the algorithm of Theorem 7.5. Initially, we switch on all edges of in .
Whenever an edge of is contracted, we switch on its reverse edge in . This implies that at any point, each vertex of corresponds to a strongly connected set of vertices of . We call this set a group of . Clearly, the groups partition and contracting all groups of yields . Thus, in order to check whether there exists a path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 4.70833pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.70833pt\hbox{\scriptstyle{\scriptscriptstyle{G}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 6.96562pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces w, it suffices to check whether there exists a path u^{\prime}\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 5.13889pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.27777pt\hbox{\scriptstyle{\scriptscriptstyle{G_{sw}}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 9.38876pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 21.77754pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 21.77754pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces w^{\prime}, where and are arbitrary vertices contained in the groups of and , respectively. ∎
Let us now proceed with the proof of Theorem 7.5. We first recall some definitions from Section 6. By we denote the subgraph of consisting of the edges that are switched on. Moreover, for each of a simple recursive decomposition we define to be a binary matrix with both rows and columns indexed with the vertices of , such that iff and there exists a path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 5.83888pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-2.83888pt\hbox{\scriptstyle{\scriptscriptstyle{H\cap\overline{G}}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 11.44792pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 25.89586pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 25.89586pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces v. Note that we show that these matrices can be maintained under switch-ons in total time. In addition, we can actually maintain the representation of these matrices used in the proof of Theorem 5.1 (see Lemma 5.5).
To complete the description of our algorithm, we show how to use these matrices to answer queries efficiently. For a subgraph we define the dense reachability graph, denoted , to be a (possibly non-planar) graph on the vertices of , such that iff there is a path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 5.83888pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-2.83888pt\hbox{\scriptstyle{\scriptscriptstyle{H\cap\overline{G}}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 11.44792pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 25.89586pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 25.89586pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces v. Thus, is fully described by , that is (recall Definition 5.4).
In order to answer a query asking about the existence of a path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 4.70833pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.70833pt\hbox{\scriptstyle{\scriptscriptstyle{G}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 6.96562pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces w, we consider a graph , which is a union of dense reachability graphs (we give its full definition later). This graph has vertices in total, but can have as much as edges. Then, we show how to search for a path in such a graph in time that is almost linear in the number of its vertices. This is somewhat similar to the FR-Dijkstra algorithm for finding shortest paths in dense distance graphs [15], but due to lack of edge weights our algorithm is slightly faster.
Let us now describe how is constructed. Let be the set of ancestors of in , including , but excluding the root of . Moreover, let be the sibling of in . Recall that is the graph on , whose each edge corresponds to a path in .
We can now define . Let be any leaf node of that contains and be a leaf node containing . We have
[TABLE]
Lemma 7.7**.**
Let be a planar digraph and be a simple recursive decomposition of . Let and and be leaf nodes of that contain and . Then, either and every path from to is contained in or every path from to contains a vertex , such that , where and .
Proof.
Let be the lowest common ancestor of and in . There are three cases to consider. If is a leaf node, then . Thus, every path from to is either fully contained in or leaves in which case it contains a vertex of . If is not a leaf node, but one of (say, ) is contained both in and , then , so the lemma holds trivially. Finally, if is not a leaf node, and are contained in distinct children of . Thus, the path has to leave the child node of containing (wlog. assume it to be ), so it contains a vertex of . By the definition, of vertex of is also a vertex of or . Thus, the lemma follows. ∎
Lemma 7.8**.**
There exists a path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 4.70833pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.70833pt\hbox{\scriptstyle{\scriptscriptstyle{G}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 6.96562pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces w iff there exists a path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.00002pt\raise 5.5pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.25pt\hbox{\scriptstyle{\scriptscriptstyle{\mathit{DRG}(u,w)}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 16.56946pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 36.13892pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 36.13892pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces w.
Proof.
By the construction, it is clear that each path in corresponds to a path that exists in . It remains to prove that if there is a path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.0pt\raise 4.70833pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.70833pt\hbox{\scriptstyle{\scriptscriptstyle{G}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 6.96562pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 16.93126pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces w, then there also exists a path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.00002pt\raise 5.5pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.25pt\hbox{\scriptstyle{\scriptscriptstyle{\mathit{DRG}(u,w)}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 16.56946pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 36.13892pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 36.13892pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces w.
We show that contains paths from to all vertices of that are reachable from in . A symmetrical argument shows that contains paths to from all vertices of that can reach in . By Lemma 7.7 this suffices to complete the proof.
Fix a vertex that is reachable from in . It suffices to show that is reachable from in , which is a subgraph of . Consider . Observe that if we modify by replacing with , then is still reachable from in the obtained graph, as long as and are not removed, that is, . To complete the proof, it suffices to observe that the graph is indeed obtained from by performing such steps, as the graphs are disjoint and each edge of is contained in exactly one of them. ∎
In order to find a path in we use an algorithm based on breadth first search. We implement it efficiently using ideas similar to those from the proof of Theorem 5.1. In the following pseudocode, denotes the set of tails of out-edges of . The set is the set of vertices that have been deemed reachable from .
Lemma 7.9**.**
Algorithm 2 is correct. Its running time, excluding the time needed to compute is linear in .
Proof.
The correctness is clear, as this is an ordinary BFS-algorithm. The only difference is that the for-loop only considers vertices unreachable from . Clearly, the body of the for loop is executed once per each vertex of and each vertex of is added to only once. Thus, the running time bound follows. ∎
Lemma 7.10**.**
The graphs comprising can be decomposed into a collection of reachability matrices with the same properties as in Lemma 4.7, such that and two constant-size arbitrary reachability matrices. All these matrices are maintained by the algorithm that maintains the matrices .
Proof.
Recall that there are two types of graphs that comprise . First, there are two size graphs and whose reachability matrices are maintained explicitly by the data structure of Section 6. All remaining graphs that comprise are of the form , where . By Lemmas 4.7 and 6.8, each matrix can be decomposed into a family of matrices with properties from the statement of Lemma 4.7 such that each row of is a row of matrices of . Thus, if the level of in is , the total number of rows in matrices of is .
We now define . Observe that for any level of , there are at most two graphs in , such that has level . Thus, the total number of rows in the matrices of is since implies . To finish the proof, recall that the matrices of each (and thus ) are actually maintained explicitly by the data structure of Section 6. ∎
Lemma 7.11**.**
There exists an algorithm that determines whether there is a path u\lx@xy@svg{\hbox{\raise 0.0pt\hbox{\kern 3.0pt\hbox{\ignorespaces\ignorespaces\ignorespaces\hbox{\vtop{\kern 0.0pt\offinterlineskip\halign{\entry@#!@&&\entry@@#!@\cr&\crcr}}}\ignorespaces{\hbox{\kern-3.0pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{{}\ignorespaces\ignorespaces\ignorespaces\ignorespaces}}}}}}}}\ignorespaces\ignorespaces\ignorespaces\ignorespaces{}{\hbox{\lx@xy@droprule}}\ignorespaces\ignorespaces\ignorespaces{\hbox{\kern 5.00002pt\raise 5.5pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise-1.25pt\hbox{\scriptstyle{\scriptscriptstyle{\mathit{DRG}(u,w)}}}}}\kern 3.0pt}}}}}}\ignorespaces\ignorespaces{\hbox{\kern 16.56946pt\raise 0.0pt\hbox{{}\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\scriptstyle{}}}}\kern 3.0pt}}}}}}\ignorespaces{\hbox{\kern 36.13892pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\lx@xy@tip{1}\lx@xy@tip{-1}}}}}}{\hbox{\lx@xy@droprule}}{\hbox{\lx@xy@droprule}}{\hbox{\kern 36.13892pt\raise 0.0pt\hbox{\hbox{\kern 0.0pt\raise 0.0pt\hbox{\hbox{\kern 3.0pt\raise 0.0pt\hbox{\textstyle{}}}}}}}}\ignorespaces}}}}\ignorespaces w. It runs in time.
Proof.
We use the representation of from Lemma 7.10. Denote the matrices of this representation by , and .
For each the algorithm maintains the set of candidates . as an van Emde Boas tree. For the two matrices , the set of candidates is maintained in an array. In the remaining part of the proof we neglect the matrices and as they are constant-size and thus each operation on them can be performed in time.
Whenever a vertex is added to the set , it is removed from each set of candidates containing it. In order to compute , just as in the proof of Theorem 5.1, for each such that we compute the intersection of the set and the set of reachability candidates.
The running time of computing and updating the set of reachability candidates can be thus bounded as follows. For each , each element of is added and removed at most once from the set of reachability candidates. This takes time, as the set is represented with van Emde Boas tree. By Lemma 7.10, this takes time, which dominates the running time of Algorithm 2 (see Lemma 7.9). ∎
It remains to prove Theorem 7.5.
Proof of Theorem 7.5.
We first apply Lemma 6.1 to to obtain the graph such that and has a simple recursive decomposition . The computation of , and (as defined in Lemma 6.1) takes time.
For each we maintain and its representation used in the proof of Theorem 5.1 (see Lemma 5.5) under switching edges on. Similarly as in the proof of Lemma 6.3, all the edges of are switched on in during the initialization, whereas the edges are never switched on. To handle the switch-on of edge in , we switch on the edge in .
Denote by and the switched-on subgraphs of and , respectively. To decide whether there exists a path in , by Corollary 6.2 we can equivalently check whether there exists a path in , where and . Answering the reachability queries in , by Lemma 7.11, takes time. The theorem follows. ∎
8 The General Case of Non-Simple and Overlapping Holes
Let be a planar digraph. This section is devoted to proving Lemma 6.1. To this end, we transform our initial graph in a few steps. Each step produces an extended graph along with disjoint subsets such that:
- •
there is a 1-to-1 mapping between the vertices of and the SCCs of .
- •
there is a 1-to-1 mapping between and and for corresponding edges and , the SCC of (, resp.) in corresponds to the vertex ( resp.) of , i.e., and .
- •
The graph is larger than by a constant factor.
Roughly speaking, each step will alter the graph obtained in the previous step by expanding its vertices into strongly connected components of , mapping the edges to and adding some edges that will belong to and guarantee some structural property that we want. For brevity, we sometimes only discuss the correspondences between the SCCs of and vertices and edges mapped to the initial edge set . We may skip the formal definitions of the mappings and .
It can be easily seen that after such steps the obtained graph is still larger than only by a constant factor. In each step we obtain a graph with more useful structural properties and our goal is to eventually obtain a graph accompanied with a simple recursive decomposition.
Assume some first step transforms into where and some second step transforms into , where . We explain how the natural composition of such steps works, i.e., how the mappings between and , along with the sets , should look like after applying these steps in sequence. Let be the 1-to-1 mapping from to and let be the 1-to-1 mapping from to . We define and . Moreover, . Observe that and . Note that has no inter-SCC edges and there is a mapping between and the SCCs of . Moreover, the insertion of edges merges some of the SCCs of so that there are still no inter-SCC edges and there is still a natural 1-to-1 mapping between the SCCs of and .
8.1 Bounded-degree, Triangulated and Without Loops
The following two facts are folklore.
Fact 8.1**.**
A triangulated plane embedded graph is 3-connected.
Here, by triangulated we mean that each face of has size exactly .
Fact 8.2**.**
A plane embedded graph has only simple faces if and only if is biconnected.
The first step is to make connected by adding a minimal number of edges: for the obtained , where and , we set and . Clearly, is also planar. In the following, we assume is connected.
We next fix some embedding of in time [26]. Define an edge ring of to be the sequence of edges incident to and ordered clockwise as implied by the embedding. Note that if some is a loop, it appears in the edge ring of twice.
We compute based on as follows. Let be a vertex of with an edge ring . Define to be a directed cycle , i.e., contains directed edges for each , where . Define and . We also let – clearly for each , is strongly connected.
For any , suppose the tail of appears as the -th edge in the edge ring of and its head appears as the -th edge in the edge ring of . This is also well-defined in the case when is a loop. We include the edge in . Clearly, the edge goes from a vertex in a SCC of corresponding to to a vertex in a SCC corresponding to .
Note that is connected and let it naturally inherit the embedding from . Observe that each face of either constitutes the interior of some cycle and has size at least , or is an ’’expanded‘‘ version of one of the original faces of and its bounding cycle has length at least . Hence, we conclude that each face of is of size at least .
Additionally, note that each vertex of has degree at most . We finally obtain from by triangulating each face , , of by adding edges inside it, so that no occurrence of a vertex of gets added more than edges. This can be achieved e.g., by adding edges and so on. These edges are included in . Observe that as the vertices of had degrees no more than , each vertex gains at most additional edges in . Thus, is triangulated and of constant degree. It is also clear that has no loops.
Clearly, the described step can be implemented in time and produces a graph with and .
8.2 Admitting a Simple Recursive Decomposition
In this section we show how to transform a triangulated of bounded degree into such that we can expose a simple recursive decomposition of .
We first show how we build a (not necessarily simple) recursive decomposition of a planar digraph.
Lemma 8.3**.**
Let be an undirected triangulated plane graph and let . A recursive decomposition tree of can be computed in time.
Proof.
The algorithm essentially follows from [5, 33]. The decomposition tree that we use is in fact identical to the one used by Klein et al. [33]. However, Klein et al. [33] use advanced data structures to not build the decomposition tree explicitly, as their goal is to compute so-called -divisions in linear time. A trivial modification to their algorithm makes it possible to build the decomposition tree explicitly in time (see Algorithm 1 in [33]).
The decomposition tree used by Borradaile et al. [5], on the other hand, essentially contains every third level of the decomposition tree of [33] and is thus of degree . However, their detailed analysis of the sum of sizes of all subgraphs of and the sum of squares of boundary sizes, also easily applies to the recursive decomposition of [33].
The algorithm of [33] also guarantees that there exist constants such that for any on the -th level of , and . For completeness, we prove these bounds below. However, note that this properties alone do not necessarily imply , as might be smaller than .
The property is justified by the fact that the maximum number of vertices of a level- subgraph satisfies and , for any valid . Note that for , we have , and thus the desired property is satisfied with .
The maximum number of boundary vertices of a level- subgraph in [33] satisfies the following inequalities for any valid .
. 2. 2.
. 3. 3.
.
First note that , for . Moreover, observe that there exist constants such that . Now let . Then we can prove , for some as follows.
Assume for some to be chosen later. For we have . It suffices to pick such that . ∎
We refer to an important property of the algorithm of Klein et al. [33] that is used to build the recursive decomposition . Namely, in [33], the child subgraphs of are obtained by triangulating the holes of and separating using a simple cycle separator (see e.g., [39]). The following Lemma precisely describes the relation between the parent and the children in the decomposition of [33].
Lemma 8.4**.**
Let be a plane triangulated graph. Let be a non-leaf subgraph of , where is a decomposition produced by Lemma 8.3. There exists a Jordan curve (called a cycle separator) going through distinct vertices (where ) such that:
- •
The children of are exactly the subgraphs of contained respectively weakly-inside or weakly-outside .
- •
For each , the part of going from to either follows some (undirected) edge of (we call it an edge-part) or otherwise is strictly contained inside some hole of (we call it a hole-part) of size . Moreover the corners of connected by the hole part are not neighboring on .
- •
For each hole of , there exists at most one hole-part of inside .
- •
For , all vertices of belong to and lie on a single hole of . All holes of are also holes of and are located (weakly) on the same side of in as .
- •
The set contains exactly the edges corresponding to the edge-parts of , whereas .
The decomposition algorithms of [5, 33] can be modified to output all curves as a by-product of computing . The total running time of the algorithm remains .
Let be a plane embedded, triangulated digraph with bounded degree. Moreover, assume does not contain any loops. Let and let be a recursive decomposition build as in Lemma 8.3 (and possessing the properties summarized by Lemma 8.4). We now show how to use to build a simple (see Definition 2.5) recursive decomposition of a transformed graph .
The decomposition has the same shape as in the following sense.
- •
There is a -to- correspondence between the subgraphs of and the subgraphs of .
- •
For the root subgraph , is the root of . Moreover, has children iff has children in and for .
The graph has the following additional properties which make the transformation comply with the requirements posed on a transformation step at the beginning of this section.
Each vertex is mapped to a vertex . 2. 2.
Denote by the subset of edges of connecting vertices of of such that . There is a 1-to-1 mapping between the vertices and the strongly connected components of . 3. 3.
For any there is an edge such that and and is injective.
8.2.1 Overview of the Construction
For each , is conceptually extended, so that:
- •
Each vertex is expanded to a directed cycle of sub-vertices of . The cycle is further split into smaller faces, corresponding to the expansions of in the descendants of in .
- •
Each edge is expanded to a undirected cycle (i.e., a cycle, but when ignoring the direction of edges) in . The cycle is further split into smaller faces, corresponding to the expansions of in the descendants of .
- •
The subgraphs and are obtained from using the same (in a sense) cycle separator as used to obtain and of .
- •
There is a -to- correspondence between the faces of and so-called original faces of . In particular, there is a -to- correspondence between the holes of and .
- •
By introducing vertex faces and edge faces, we separate the original faces (and thus the original holes as well) of , so that they do not share vertices.
- •
The size of each original hole of is larger by a constant factor than the size of the corresponding hole of .
- •
The leaf subgraphs of are of constant size as well.
Figure 5 shows how a subgraph can be possibly expanded. Figure 6 shows how obtaining the children of with a cycle separator translates to obtaining the children of .
The remaining part of this section is devoted to providing the technical details of the construction sketched above.
8.2.2 Details of the Construction
Let . We first establish some structural requirements posed on the subgraphs of . Each vertex corresponds to a simple cycle of vertices of (ordered clockwise). For each of these , we set . Moreover, assuming , we have a directed edge for each . These edges are called border vertex edges of (with respect to ).
Let be the edge ring of in . For , there is a contiguous subsequence of vertices of . The fragments are disjoint and put on in the same order as the edges lie in the edge-ring of . However, there might be some other vertices in put between any two neighboring fragments and . We call the edge vertices of . An edge vertex that is either first or last in some is called a border edge vertex of . The remaining vertices are called the extra vertices of . If , then we require , so that the clockwise order of is well-defined. The extra vertices of can only be adjacent (in undirected sense) to other vertices of .
There may be some additional edges between the non-adjacent (but distinct) vertices of . All such edges are always embedded inside the cycle and do not cross. They partition the inside of all these cycles into faces, which are collectively called the vertex faces of . All edges connecting pairs of vertices of are called vertex edges of (with respect to ).
Let . Then, the fragments and have equal lengths and . Recall that , as we assume that has no loops.
We have two edges and , which are called the border edge edges of . Additionally, for each , there are two parallel edges . These edges are called the internal edge edges of (with respect to ). The rectangular faces (for ) and faces of length are collectively called the edge faces of (with respect to ). Consult Figure 5 for better understanding of how edge edges are constructed.
All the remaining faces of that are neither vertex faces nor edge faces are the original faces of . This name is justified by the fact that there is a 1-to-1 correspondence between such faces and faces of .
Lemma 8.5**.**
No two original faces of share vertices.
Proof.
Each original face of consists of border vertex edges and border edge edges only. Note that a border vertex edge on has a vertex face on its other side. Similarly, a border edge edge on has an edge face on its other side. Thus, the faces adjacent to are all vertex- or edge faces and hence an original face is not adjacent to . We conclude that and do not share vertices. ∎
Lemma 8.6**.**
All faces of are simple.
Proof.
We prove that is biconnected, or equivalently, that any two distinct edges (ignoring their directions) lie on a simple cycle (in an undirected sense). By Fact 8.2, this will imply that has only simple faces. Recall that biconnectivity is an equivalence relation on edges.
Clearly, if are the edge edges of the same edge , they lie on a simple cycle consisting only of edge edges of .
The border vertex edges of some all lie on a simple cycle by their definition. Moreover, each non-border vertex edge of is embedded inside this cycle and thus is biconnected with all the border vertex edges. This establishes the biconnectivity of vertex edges of a single vertex .
Note that the border edge edges of any lie on a simple cycle that includes both the border vertex edges of and . Thus, all edge edges of are biconnected with both the vertex edges of and vertex edges of .
Observe that as is connected, the above is enough to conclude that is biconnected. ∎
It is clear that contains only the vertex edges of and thus there is a 1-to-1 correspondence between the vertices of and the SCCs of . For , we include in any edge edge of and set .
We now have to guarantee that has all properties of a recursive decomposition, and to this end we pose additional requirements on . Let be a constant bounding the degree of .
- B.1
If and , then . 2. B.2
If and is an edge vertex of , then is a border edge vertex of . 3. B.3
For , the set has size at most . 4. B.4
The holes of are exactly the original faces of corresponding to the holes of . 5. B.5
If is a leaf subgraph of , then every edge vertex of is a border edge vertex and has no non-border vertex edges.
Lemma 8.7**.**
The above requirements imply that:
. 2. 2.
For any of the -th level of , , where . 3. 3.
Each leaf subgraph of has edges.
Proof.
Let . By B.2 and B.3, each contributes at most edge vertices of and extra vertices of to . Since , . This implies both properties 1 and 2.
Let be a leaf subgraph of . Recall that has edges. By B.3, B.5 and the structural requirements posed on , for each , has size at most and there are only vertex edges. Thus, has at most edges. ∎
Now we show how to actually build the subgraphs of so that all the described requirements are met and that has all the needed properties of a recursive decomposition. This, combined with Lemmas 8.5, 8.6 and 8.7 will finish the proof.
We will start with the root of and gradually move down the tree , introducing new edge vertices and edge edges of once they are needed.
Each subgraph is created once. The boundary vertices of do not change after it is created, but the graph itself might grow in a controlled way. We start by creating the root as a unique graph such that:
- •
for each such that is an endpoint of .
- •
if and otherwise.
We set . Clearly, these satisfies the requirements B.1-B.4 as and there are no holes in the root subgraph of . Moreover, we can consider as a leaf of at this point, as its children have not been created yet. The property B.5 that characterized leaves is indeed satisfied for at this point.
Each subsequent step of the construction will consist of taking a current leaf subgraph of and creating its children. We will proceed in such a way that the properties B.1-B.4 will remain satisfied for all created subgraphs at all times. On the other hand, the property B.5 will cease to be satisfied when subgraph stops to be a leaf of .
Now let be a non-leaf subgraph of such that has been created, as opposed to its children. Let (where ) be the cycle separator of Lemma 8.4.
For each edge part of corresponding to an edge , we first create new edge vertices by placing in between the only two (see B.5) vertices of on the cycle . Similarly, we put in between the only two vertices of on the cycle . The newly created vertices are connected with a pair of new edge edges of of the same direction as the neighboring two edge edges of in . The insertion of the new vertices and edges is propagated to all the ancestors of . Note that the insertion of new edge vertices does not break properties B.1-B.5 of and its ancestors (recall that is non-leaf).
Let be a hole part of inside the hole of . By Lemma 8.4, this hole part goes between two distinct, non-neighboring corners of the hole . Let . Let be the two, possibly equal edges of . If , pick to be the edge following in the cycle bounding (this is well-defined, since has at least edges).
- •
If , then and for (, resp.) we set (, resp.) to be any element of – recall that in this case.
- •
Observe that if , then and cannot both correspond to edge parts of .
If lies on , then set to be the first edge vertex of . Otherwise, set to be the last edge vertex of .
Similarly, If lies on , then set to be the first edge vertex of . Otherwise, set to be the last edge vertex of .
The vertices are defined in such a way that , and and are not next to each other on . To see that, consider the parts , of . If both parts are edge parts, then and are both edge vertices and are not border edge vertices. If both parts are hole parts, then and are both last edge vertices of distinct edges incident to . If exactly one of and (say, ) is an edge-part of , then is an edge vertex but not a border edge vertex of . If , then and otherwise is a border edge vertex of some other edge of .
For each , let (, resp.) be the clockwise path (, resp.) on . We add edges and inside the cycle of , so that the interiors of directed cycles , do not intersect. Note the added edges do not violate the embedding (see B.5). Similarly as before, these edges are added to all ancestors of , consistently with the embedding.
Now, we define a Jordan curve going through vertices : each part and goes ’’between‘‘ the added edges and (in other words, strictly inside the face bounded by these two edges), whereas each part from to is either inside an original hole of or goes between a pair of newly-added edge edges. We define () to be the part of weakly inside (outside, resp.) iff is the subgraph of weakly inside (outside, resp.) . Consult Figure 6 for better understanding.
It is easy to see that satisfies all structural properties posed on at the beginning of this section. Observe that contains the vertices and those vertices of that lie strictly inside (outside resp.) . The definition of also guarantees, that and have no edges in common.
Note that there are only two cases when for some and some , . The first one is when and are both edge parts and additionally the corresponding edges are neighboring in the edge ring of . But then both and are non-border edge vertices of and thus the partition with does not introduce extra vertices of in either or that were not extra vertices in . The second case is when (wlog.) is an edge part of corresponding to an edge of the cycle bounding and is a hole part going through the corner of incident to . In this case is and has one new extra vertex of . However, no new extra vertices of are introduced in .
Below we sketch how the properties B.1-B.5 are inductively satisfied for immediately after its creation and that they still hold later in the process.
Recall that the boundary is defined, by Lemma 8.4, as and thus is contained in . The property B.1 for follows from the property B.1 for and the fact that for each we have , i.e., and .
When is created, it does not contain edge edges that are not border edge edges. Also, when we create the descendants of , only non-border edge edges are added to and the boundary is never extended.
It is sufficient to show it immediately after creating , as no new extra vertices are added to later on. The vertices are defined in such a way that the size of can be greater than by at most and moreover this can only happen if . Thus . By adding this inequality to , which follows from the property B.3 for , we get the property B.3 for .
Without loss of generality, assume that is the subgraph of weakly inside . Note that each part of corresponding to the hole part of inside a hole , lies inside the original face of corresponding to , by B.4 for . On the other hand, for all holes that do not contain hole parts of , is entirely on one side of , and thus the original face of corresponding to is on one side of . By combining this fact with property B.4 of and Lemma 8.4, we get that the vertices lie either on the original faces of inside corresponding to the holes of both and inside , or on the ’’external‘‘ original face of , which corresponds to the ’’external‘‘ hole of . The vertices are clearly contained in and thus lie on the ’’external‘‘ original face of as well.
The new edges and vertices are introduced in in such a way that a child is given a separate pair of edge edges for each edge of . Moreover, for each , inherits a contiguous part of the cycle going through and a single new edge or that closes the cycle. For all vertices , no non-border vertex edges of are added to and thus no such edges can exist in .
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Amir Abboud and Søren Dahlgaard. Popular conjectures as a barrier for dynamic planar graph algorithms. In IEEE 57th Annual Symposium on Foundations of Computer Science, FOCS 2016, 9-11 October 2016, Hyatt Regency, New Brunswick, New Jersey, USA , pages 477–486, 2016.
- 2[2] Amir Abboud and Virginia Vassilevska Williams. Popular conjectures imply strong lower bounds for dynamic problems. In 55th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2014, Philadelphia, PA, USA, October 18-21, 2014 , pages 434–443, 2014.
- 3[3] Ittai Abraham, Shiri Chechik, and Cyril Gavoille. Fully dynamic approximate distance oracles for planar graphs via forbidden-set distance labels. In Proceedings of the 44th Symposium on Theory of Computing Conference, STOC 2012, New York, NY, USA, May 19 - 22, 2012 , pages 1199–1218, 2012.
- 4[4] Surender Baswana, Manoj Gupta, and Sandeep Sen. Fully dynamic maximal matching in O ( log n ) 𝑂 𝑛 {O}(\log n) update time. SIAM J. Comput. , 44(1):88–113, 2015.
- 5[5] Glencora Borradaile, Piotr Sankowski, and Christian Wulff-Nilsen. Min st -cut oracle for planar graphs with near-linear preprocessing time. ACM Trans. Algorithms , 11(3):16:1–16:29, 2015.
- 6[6] Shiri Chechik, Thomas Dueholm Hansen, Giuseppe F. Italiano, Veronika Loitzenbauer, and Nikos Parotsidis. Faster algorithms for computing maximal 2-connected subgraphs in sparse directed graphs. In Proceedings of the Twenty-Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2017, Barcelona, Spain, Hotel Porta Fira, January 16-19 , pages 1900–1918, 2017.
- 7[7] Shiri Chechik, Thomas Dueholm Hansen, Giuseppe F. Italiano, Jakub Łącki, and Nikos Parotsidis. Decremental single-source reachability and strongly connected components in O ~ ( m n ) ~ 𝑂 𝑚 𝑛 \widetilde{O}(m\sqrt{n}\,) total update time. In IEEE 57th Annual Symposium on Foundations of Computer Science, FOCS 2016, 9-11 October 2016, Hyatt Regency, New Brunswick, New Jersey, USA , pages 315–324, 2016.
- 8[8] Camil Demetrescu and Giuseppe F. Italiano. A new approach to dynamic all pairs shortest paths. J. ACM , 51(6):968–992, 2004.
