Recognizing Cographs and Threshold Graphs Through a Classification of Their Edges
Total Page:16
File Type:pdf, Size:1020Kb
Information Processing Letters 74 (2000) 129–139 Recognizing cographs and threshold graphs through a classification of their edges Stavros D. Nikolopoulos 1 Department of Computer Science, University of Ioannina, P.O. Box 1186, GR-45110 Ioannina, Greece Received 24 September 1999; received in revised form 17 February 2000 Communicated by K. Iwama Abstract In this work, we attempt to establish recognition properties and characterization for two classes of perfect graphs, namely cographs and threshold graphs, leading to constant-time parallel recognition algorithms. We classify the edges of an undirected graph as either free, semi-free or actual, and define the class of A-free graphs as the class containing all the graphs with no actual edges. Then, we define the actual subgraph Ga of a non-A-free graph G as the subgraph containing all the actual edges of G. We show properties and characterizations for the class of A-free graphs and the actual subgraph Ga of a cograph G, and use them to derive structural and recognition properties for cographs and threshold graphs. These properties imply parallel recognition algorithms which run in O.1/ time using O.nm/ processors. 2000 Elsevier Science B.V. All rights reserved. Keywords: Cographs; Threshold graphs; Edge classification; Graph partition; Recognition; Parallel algorithms; Complexity 1. Introduction early 1970s by Lerchs [12] who studied their struc- tural and algorithmic properties. Lerchs has shown, Cographs (also called complement reducible among other properties (see [1,5,6,13]), the following graphs) are defined as the graphs which can be reduced two very nice algorithmic properties: to single vertices by recursively complementing all (P1) cographs are exactly the P4 restricted graphs, connected subgraphs. More precisely, the class of co- and graphs can be defined recursively as follows: (P2) cographs have a unique tree representation called (i) a single-vertex graph is a cograph; cotree. (ii) the disjoint union of a cograph is a cograph; Threshold graphs, a well-known class of perfect (iii) the complement of a cograph is a cograph. graphs, are defined as those graphs where stable sub- Cographs have arisen in many disparate areas of math- sets of their vertex sets can be distinguished by us- ematics and computer science and have been indepen- ing a single linear inequality. Equivalently, a graph dently rediscovered by various researchers under var- G D .V; E/ is threshold if there exists a threshold as- ∗ ious names such as D -graphs, P4 restricted graphs, signment Tα, tU consisting of a labeling α of the ver- 2-parity graphs and HD-graphs or Hereditary Dacey tices by non-negative integers and an integer threshold graphs. Cographs themselves were introduced in the t such that: (i) S is a stable set if and only if α(v1/Cα(v2/C···C 1 Email: [email protected]. α(vp/ 6 t, 0020-0190/00/$ – see front matter 2000 Elsevier Science B.V. All rights reserved. PII:S0020-0190(00)00041-7 130 S.D. Nikolopoulos / Information Processing Letters 74 (2000) 129–139 where vi 2 S; 1 6 i 6 p,andS ⊆ V . Threshold graphs their edges and obtain the actual subgraph Ga which were introduced in 1973 by Chvátal and Hammer [4]. is the subgraph of G containing all the actual edges. There are several recognition algorithms for the Based on this classification, we define the class of A- class of threshold graphs which run in linear sequen- free graphs as the class containing all the undirected tial time. On the other hand, the class of cographs graphs with no actual edges. Consequently, we prove is known to have logarithmic-time parallel recogni- that any A-free graph does not contain P4 or C4 as tion algorithms. For the class of cographs, Adhar and induced subgraphs. This implies that Peng [1] presented a parallel recognition algorithm (i) A-free graphs are a special kind of cographs, and which requires O.log2 n/ time and uses O.nm/ proces- (ii) a graph is threshold if and only if it is an A-free sors on a CRCW PRAM model of computation, where graph and has no induced subgraphs isomorphic n and m are the number of vertices and edges in the to 2K2. graph, respectively. Dahlhaus [7] proposed a nearly We show that G has no induced subgraph isomorphic c optimal parallel recognition algorithm which runs in to 2K2 if and only if the complement G of G is O.log2 n/ time with O.n C m/ processors on a CREW an A-free graph. Moreover, we show certain proper- PRAM model. Recently, He [10] published a cograph ties and characterizations for the actual subgraph Ga recognition algorithm working in O.log2 n/ time with of a cograph G. Based on these results, we propose O.n C m/ processors on a CREW PRAM model. It O.1/-time algorithms for recognizing A-free graphs, is worth noting that all previously known parallel al- cographs and threshold graphs using O.nm/ proces- gorithms use the fact that cographs can be represented sors on a CRCW PRAM. by a unique tree (so-called cotree). This representation Throughout the paper log n denotes logarithm to the forms the base for the logarithmic time parallel recog- base two, n denotes the number of vertices and m nition [5,7,10]. As far as threshold graphs are con- denotes the number of edges in a graph. cerned, De Agostino and Petreschi [2] presented a par- allel algorithm derived from a characterization based on degrees that runs in O.log n/ time with O.n= logn/ 2. Edge classification and graph partition processors on a EREW PRAM. The main technique D used for recognizing threshold graphs is the degree Let G .V; E/ be an undirected simple graph with partition of the vertex set [8]. (We note that the degree n vertices and m edges. Following the notation and partition of the vertex set V of a graph G D .V; E/ is terminology in [9], the neighbourhood of a vertex u of G is the set N.u/D N .u/ consisting of all vertices v given by V D D0 C D1 C···CDk where Di is the set G of all the vertices of degree δ ; 0 6 i 6 k.) which are adjacent with u.Theclosed neighbourhood i T UD T UVDf g[ In this paper we attempt to establish recognition is N u NG u u N.u/. The subgraph of ⊆ T U properties and characterization for two classes of per- G induced by a subset S V is denoted by G S . fect graphs, namely cographs and threshold graphs, We shall use the notation NGTSU.u/ (respectively T U leading to efficient O.1/-time parallel recognition al- NGTSU u ) to denote the neighbourhood (respectively gorithms. Most of the previously proposed recognition closed neighbourhood) of a vertex u of the graph T U algorithms for cographs are based on a unique tree rep- G S . D resentation, while recognition algorithms for thresh- Given a graph G .V; E/, we define three classes old graphs are based on a degree partition. Here, we of edges in G, denoted by AE, FE and SE according take a different approach relying on a classification to relationship of the closed neighborhoods of the D of the edges of an undirected graph and on the fact endpoints of its edges [14]. Let x .u; v/ be an edge that cographs contain no induced subgraph isomorphic of G. Then, to P (see Lerchs [12]) and threshold graphs contain 4 .u; v/ 2 FE if NTuUDNTvU; no induced subgraphs isomorphic to 2K2, P4,orC4 (see Chvátal and Hammer [4]). To this end, we clas- .u; v/ 2 SE if NTu]⊂NTvU; sify the edges of a graph G as either free, semi-free .u; v/ 2 AE if NTu]−NTvU6D;and or actual, according to the relationship of the closed neighborhoods of the endpoints (or end-vertices) of NTv]−NTuU6D;: S.D. Nikolopoulos / Information Processing Letters 74 (2000) 129–139 131 Fig. 1. Three undirected graphs. Free, semi-free and actual edges are denoted by f, s and a, respectively. Obviously the edge set E of G can be partitioned into vertices u such that the length of the shortest path from the three subsets of free edges, semi-free edges and of v to u is equal to i. actual edges, respectively; that is, E D FE C SE C AE. Given a connected graph G D .V; E/ and a vertex We illustrate with three graphs G, H and I shown in v 2 V , we define a partition L.G; v/ of the vertex set Fig. 1. V (we shall frequently use the term partition of the Having classified the edges of a graph G D .V; E/ graph G), with respect to the vertex v as follows: as either free, semi-free or actual, let us now define the L.G; v/ D N.v;i/j v 2 V; 0 6 i 6 L ; class of A-free graphs as follows: v 1 6 Lv < jV j ; D Definition 1. An undirected graph G .V; E/ is where N.v;i/; 0 6 i 6 Lv,aretheadjacency-level called A-free if every edge of G is either free or semi- sets, or simply the adjacency-levels,andLv is the free edge. length of the partition L.G; v/ [15]. The adjacency- level sets of the partition L.G; v/ of the graph G,are By definition, a graph G is an A-free graph if and formally defined as follows: only if for every edge .x; y/ of G,wehaveNTx]⊆ N.v;i/D u 2 V j d.v;u/ D i ; NTyU or NTx]⊇NTyU.