Fully Dynamic Algorithm for Recognition and Modular Decomposition of Permutation Graphs
Total Page:16
File Type:pdf, Size:1020Kb
Fully dynamic algorithm for recognition and modular decomposition of permutation graphs Christophe Crespelle Christophe Paul CNRS - D´epartement Informatique, LIRMM, Montpellier {crespell,paul}@lirmm.fr December 19, 2005 Abstract This paper considers the problem of maintaining a compact representation (O(n) space) of permutation graphs under vertex and edge modifications (insertion or deletion). That representation allows us to answer adjacency queries in O(1) time. The approach is based on a fully dynamic modular decomposition algorithm for permutation graphs that works in O(n) time per edge and vertex modification. We thereby obtain a fully dynamic algorithm for the recognition of permutation graphs. 1 Introduction The dynamic recognition and representation problem (see e.g. [16]) for a family F of graphs aims to maintain a characteristic representation of dynamically changing graphs as long as the modified graph belongs to F. The input of the problem is a graph G ∈ F with its representation and a series of modifications. Any modification is of the following: inserting or deleting a vertex (along with the edges incident to it), inserting or deleting an edge. Several authors have considered the dynamic recognition and representation problem for various graph families. [12] devised a fully dynamic recognition algorithm for chordal graphs which handles edge operations in O(n) time. For proper interval graphs [11], each update can be supported in O(d+log n) time where d is the number of edges involved in the operation. Cographs, a subfamily of permutation graphs, have been considered in [16] where any modification (edge or vertex) is supported in O(d) time, where d is the number of edges involved in the modification. This latter result has recently been generalised to directed cographs in [5]. This paper deals with the family of permutation graphs and is the complete version of [6]. Our algorithm maintains an O(n) space canonical representation based on modular decomposi- tion which enables us to answer adjacency queries in O(1) time. It should be noted that in [15] a purely incremental algorithm is presented for computing the modular decomposition tree of any graph. It runs in O(n) time per vertex insertion. Unfortunately, it is based on a partial representation of the graph compromising the possibility of any vertex deletion. Therefore such an algorithm cannot be applied for efficient fully dynamic recognition of permutation graphs. Our algorithm also performs in O(n) time per operation, but supports insertion as well as dele- tion of vertices and edges. Let us note that a modification of the input graph may lead to O(n) changes in the modular decomposition tree. Therefore our algorithm does not present any complexity extra cost in the maintain of the modular decomposition tree. 1 2 Preliminaries The paper deals with undirected and loopless graphs. If x is a vertex of a graph G = (V, E), N(x) denotes the neighbourhood of x and N(x) ist non-neighbourhood. The graph G is the complement graph of G. If S is a subset of vertices of a graph G, then G[S] is the subgraph of G induced by S. Two set of vertices S and S0 are adjacent iff any vertex of S neighbours any vertex of S0, and non-adjacent iff none vertex of S neighbours non vertex of S0. Two sets S and S0 overlap iff S ∩ S0 6= ∅ and S \ S0 6= ∅ and S0 \ S 6= ∅ (we note S ⊥ S0). Two vertices x and y are twins iff N(x)= N(y) or N(x) ∪ {x} = N(y) ∪ {y}. 2.1 Modular decomposition Modular decomposition theory has been independently rediscovered in many fields. Gallai [9] may be the first to deal with this concept in the context of graph theory. For a complete survey on the topics, refer to [14]. Let us give the standard definition and basic results we will need. A subset S ( V of vertices of a graph G is uniform wrt. to vertex x ∈ V \ S if S ⊆ N(x) or S ⊆ N(x) (otherwise S is mixed). A module of G is a subset of vertices M ⊆ V which is uniform wrt. any vertex x ∈ V \ M. It follows from definition that the whole vertex set V and the singleton sets {x}, for x ∈ V , are modules of G. These modules are called the trivial modules. A graph is prime if all its modules are trivial. Let us state a very simple observation. Observation 1 Let M be a module of G and S a subset of vertices. Then M ∩ S is a module of the induced subgraph G[S]. A module M is strong if it does not overlap any module M 0. Connected components of G and connected components of G are examples of strong modules. Thereby, the strong modules of a graph can be organized into an inclusion tree, called the modular decomposition tree TG. There is a one-to-one mapping between nodes of TG and strong modules of G. Thereby the root of TG represents the whole vertex set and the leaves are mapped to the singleton trivial modules of G. For an internal node p of TG, the corresponding strong module is the vertex set V (p)= P resulting from the union of modules mapped to its children. In the following, Tp denotes the subtree of TG rooted at node p (i.e. the modular decomposition tree TG[P ]). The children of a node p in TG will be denoted by C(p). A maximal strong module of a graph G = (V, E) is a strong module of G maximal wrt. inclusion and distinct from V . If G (resp; G) is non-connected, the connected components (resp. co-connected components) of G are precisely its maximal strong modules. Thanks to the well-known modular decomposition theorem (see [14] for references), any non-leaf node p of the modular decomposition tree is labelled as follows: parallel if G[P ] is not connected; series if G[P ] is not connected; and prime otherwise (the three cases are disjoint). The label of node p is denoted label(p). The series and parallel nodes (and their corresponding strong module) are also called degenerate. It should be notice that any module is either a strong module or the union of maximal strong submodules of a degenerated strong module. A partition P = {M1,...Mk} of the vertex set is a congruence partition iff any parts Mi (1 6 i 6 k) is a module. Congruence partitions play an important role in the theory of modular decomposition [14] as well in most of most decomposition algorithms (see [8] for example). Notice that it follows from the definition of module that any pair of distinct parts Mi and Mj of a congruence partition is either adjacent or non-adjacent. Thereby it is possible to define the quotient graph G/P of a congruence partition as the graph whose vertices are the elements of 2 P and where two vertices are adjacent iff their corresponding modules are adjacent. 1 An important property of congruence partition and quotient graph is: Lemma 1 Let P be a congruence partition of G. Then X ⊆ P is a non-trivial strong module of G/P iff X = ∪M∈X M is a non-trivial strong module of G. Proof: Actually, it is proved in [14], that X ⊆ P is a module of G/P iff X = ∪M∈X M is a module of G. So let X be a non-trivial module of G/P. ⇐ Assume X is not a strong module of G/P. There exists a module Y ⊂ P of G/P such that X ⊥Y. From above, Y = ∪M∈Y M is a module of G. Thereby Y ⊥ X and X is not a strong module of G. ⇒ Assume X is not a strong module of G. Thereby it is the union of maximal strong submodules of a degenerated strong module Z of G. For P to be a congruence partition, there must exist Y ⊂ P such that Y = ∪M∈Y M = Z \ X. As Z is degenerate, Y is a module of G and Y is a module of G/P. Now by assumption X is non-trivial. Thereby there exists S⊂X such that S = ∪M∈SM is a the union of maximal strong submodules of Z. Again as Z is degenerate, Y ∪ S is a module of G, in other words X and Y ∪ S are also modules of G/P. It follows that X is not a strong module of G/P as by definition of S, X ⊥Y∪S. The set MSM(G) of maximal strong modules of G is a congruence partition and by the way define a quotient graph. Similarly a quotient graph, denoted Gp and called representative graph can be associated to each node p of the modular decomposition tree. The children p1 ...pk of p are mapped to the maximal strong modules of G[P ]. The representative graph Gp is therefore the quotient graph G[P ]/MSM(G[P ]). Gp is a clique if p is a series node and a stable if p is a parallel node. It follows that if together with each prime node p of the modular decomposition tree, its representative graph Gp is stored, then adjacency queries between any pair of vertices x,y can be answered by a search in TG and in the quotient graphs. Notice that the size of the modular decomposition tree TG is O(n). If the representative graphs are added, it yields a O(n + r) space representation with r being the sum of the size of the encoding of representative graphs.