<<

When Trees Grow Low: Shrub-depth and m-Partite ?

Robert Ganian1, Petr Hlinˇen´y2, Jaroslav Neˇsetˇril3, Jan Obdrˇz´alek2, and Patrice Ossona de Mendez4

1 Vienna University of Technology, Austria [email protected] 2 Faculty of Informatics, Masaryk University, Brno, Czech Republic† {hlineny,obdrzalek}@fi.muni.cz 3 Computer Science Inst. of Charles University (IUUK), Praha, Czech Republic†,‡ [email protected] 4 CNRS UMR 8557, Ecole´ des Hautes Etudes´ en Sciences Sociales, Paris, France‡ [email protected]

Abstract. The recent increase of interest in the graph invariant called -depth and in its algorithmic applications leads to a natural question: Is there an analogously useful “depth” notion also for dense graphs (say; one which is stable by graph complementation)? To this we intro- duce the notion of shrub-depth of a graph which is related to the established notion of -width in a similar way as tree-depth is re- lated to tree-width. We also introduce a common extension of cographs and of classes with bounded shrub-depth — m-partite cographs, which are well-quasi-ordered by the relation “being an of” and therefore allow time testing of any hereditary properties.

1 Introduction

In this paper, we are interested in structural graph parameters that are interme- diate between clique-width and tree-depth, sharing the nice properties of both. Clique-width, defined in [7], is the older of the two notions. In several aspects, the theory of graphs of bounded clique-width is similar to the one of bounded tree- width. Indeed, bounded tree-width implies bounded clique-width. However, un- like tree-width, graphs of bounded clique-width include arbitrarily large cliques and other dense graphs. On the other hand, clique-width is not closed under taking subgraphs (or minors), only under taking induced subgraphs. The tree-depth of a graph has been defined in [35], and is equivalent or similar to notions such as the ranking number and the minimum height of

? Full paper based on a preliminary short conference version from MFCS 2012; When Trees Grow Low: Shrubs and Fast MSO1, LNCS 7464, Springer (2012), 419-430. † Supported by the research centre Institute for Theoretical Computer Science (CE-ITI); Czech Science foundation project No. P202/12/G061. ‡ Supported by the project LL1201 CORES of the Ministry of Education of the Czech republic. an elimination tree [2, 8, 39], etc. Graphs with bounded tree-depth are sparse, and enjoy strong “finiteness” properties (finiteness of cores, existence of non-trivial automorphism if the graph is large, well-quasi-ordering by subgraph inclusion). They received almost immediate attention and play a central role in the theory of graph classes of [33, 34]. Graphs of bounded parameters such as clique-width allow us to efficiently solve various optimization problems which are difficult (e.g. NP-hard) in general [6, 12, 19, 18]. However, instead of solving each problem separately, we may ask for results which give a solution to a whole class of problems. We call such results algorithmic metatheorems. One of the most famous results of this kind is Courcelle’s theorem [5], which states that every expressible in MSO2 can be solved in linear time on graphs of bounded tree-width. More precisely, the MSO2 model-checking problem for a graph G of tree-width tw(G) and a formula φ, i.e. the question whether G = φ, can be solved in time ( G f(φ, tw(G))). (In the world of parameterized| complexity we call such problems,O | | · solvable in time (np f(k)) for some constant p and a computable function f, where k is some parameterO · of the input and n the size of the input, fixed-parameter tractable (FPT).) For clique-width a result similar to Courcelle’s theorem holds: MSO1 is FPT on graphs of bounded clique-width [6]. However, an issue with these results is that, as showed by Frick and Grohe [13] for MSO model checking of the class of all trees, the function f of Courcelle’s is, unavoidably, non-elementary in the parameter φ (unless P=NP). This brings the following question: Are there any interesting graph classes where the dependency on the formula is better? Only recently, in 2010, Lampis [29] gave an FPT algorithm for MSO2 model checking on graphs of bounded vertex cover with elementary (doubly-exponential) dependence on the formula. A recent result of Gajarsk´yand Hlinˇen´y[15] shows that there exists a linear-time FPT algorithm for MSO2 model checking for graphs of bounded tree-depth, again with elementary dependency on the formula. This result is essentially optimal as shown now by Lampis [30]. As for applicability of the latter result to MSO1 model checking, one would first need to extend the clique-width concept towards “bounded depth” (as with tree-depth), but this does not seem an easy task. Actually, the paper [15] was not the first time the issue of restricting clique- width towards bounded depth was explicitly raised in the literature. We, for instance, cite the following sentence of Elberfeld, Grohe, and Tantau from the conclusion of [11], raised in the different context of expressive power of FO logic: One idea is to develop an adjusted notion of clique-width that has the same relation to clique-width as tree-depth has to tree-width. Our paper provides the following positive answer to all: We formalize a graph parameter which extends tree-depth towards a logic-flavoured graph description such as that of clique- width. The new definition is based on the notion of a tree-model (Definition 3.1), which can be seen as a minimalistic analogue of simple graph interpretation into a tree, and we are interested in the number of layers (the depth) such a model must have to be able to interpret given graphs.

2 We in fact introduce two such parameters; shrub-depth (Definition 3.3) and SC-depth (Definition 3.5) which are asymptotically equivalent to each other. The first main result of this paper is that the classes of the graphs resulting from an MSO1 graph interpretation in the class of all finite rooted trees of height d, with vertices labelled by a finite of labels, are exactly the classes of graphs≤ of shrub-depth at most d (Theorem 4.1). This result, in combination with [15], then leads to an FPT algorithm for MSO1 model checking for graphs of bounded shrub-depth (SC-depth) with an elementary dependence on the formula (Corollary 4.5). Yet another motivation of our research is the aforementioned well-quasi- ordering property of the induced subgraph order on the graphs of bounded tree- depth, first discovered by Ding [10]. Being well-quasi-ordered is a very strong finiteness property of a graph class and it, for instance, often immediately gives FPT for solving problems which are monotone with respect to the well-quasi-ordering — simply by testing the finitely many obstructions. Although graph classes of bounded tree-width and of bounded clique-width are not well-quasi-ordered under the induced subgraph order, for the new shrub- depth measure this holds true (as follows already from Ding’s results in [10]). We find another graph width parameter which is strictly “sandwiched” between graph classes of bounded shrub-depth and graphs of bounded clique-width. These so-called m-partite cographs (Definition 5.1), which generalize ordinary cographs, are also well-quasi-ordered under the induced subgraph order (Theorem 5.5). Consequently, we obtain an FPT algorithm for any hereditary (i.e., closed under induced subgraphs) graph property on m-partite cographs (Corollary 5.8). We argue that m-partite cographs represent a smooth intermediate transition from our shrub- and SC-depth to the significantly wider and established notion of clique-width. Indeed, we show that all graphs in any class of shrub-depth d are m-partite cographs with a representation of depth d, for suitable m. On the other hand, every m-partite has clique-width≤ at most 2m. For more relations between the classes we refer to Figure 6.

2 Definitions

We assume the reader is familiar with standard notation of . In particular, all our graphs (both directed and undirected) are finite and simple (i.e. without loops or multiple edges). For a graph G = (V,E) we use V (G) to denote its vertex set and E(G) the set of its edges. We will often use labelled graphs, where each vertex is assigned one of some fixed finite set of labels. A forest F is a graph without cycles, and a tree T is a forest with a single connected . We will consider mainly rooted forests (trees), in which every connected component has a designated vertex called the root. The height of a vertex x in a rooted forest F is the length of a from the root (of the component of F to which x belongs) to x. The height 5 of the rooted forest F is 5 There is a conflict in the literature about whether the height of a rooted tree should be measured by the “root-to-leaves ” or by the “number of levels” (a differ-

3 the maximum height of the vertices of F . Let x, y be vertices of F . The vertex x is an ancestor of y, and y is a descendant of x, in F if x belongs to the path of F linking y to the corresponding root. We also write y x in F . If x is an ancestor of y and xy E(T ), then x is called a parent of y,≤ and y is a child of x. The least common ancestor∈ of x and z in F is denoted by x z. ∧

2.1 Structural width parameters So called width parameters play an important role in structural graph theory and in its algorithmic applications. A prototypical width parameter is the tree-width of a graph [38] introduced by Robertson and Seymour together with related path-width. We refer to [9] for missing definitions and basic properties. The primary interest of our paper are two other, seemingly unrelated, width notions which we define now. Definition 2.1 (Clique-width [7]). A k-expression is an algebraic expression with the following four operations on vertex-labelled graphs using k labels: create a new vertex with label i; take the disjoint union of two labelled graphs; add all edges between vertices of label i and label j; and relabel all vertices with label i to label j. The clique-width cw(G) of a graph G equals the minimum k such that (some labelling of) G is the value of a k-expression. Note that clique-width may be low even on graphs for which the tree-width is unbounded, such as complete or complete bipartite graphs. One can, fur- thermore, define linear clique-width (see, e.g., [23]) which has the additional restriction that the union operator is allowed to take only a single vertex as the right-hand operand (i.e., the expression tree is a caterpillar—this is concep- tually related to path-width). We briefly mention that another graph measure asymptotically equivalent to clique-width is rank-width [36]. Similarly, linear clique-width is asymptotically equivalent to linear rank-width [16]. Definition 2.2 (Tree-depth [35]). The closure Clos(F ) of a forest F is the graph obtained from F by making every vertex adjacent to all of its ancestors. The tree-depth td(G) of a graph G is one more than the minimum height of a rooted forest F such that G Clos(F ). ⊆ Definition 2.2 is illustrated in Figure 1. For a proof of the following propo- sition, as well as for a more extensive study of tree-depth, we refer the reader to [34]. Proposition 2.3. Let G and H be graphs. Then the following is true: a) If H is a minor of G then td(H) td(G). ≤ b) If is the length of a longest path in G then log2(L + 2) td(G) L + 1. c) If tw(G) and pw(G) denote the tree-width andd path-widthe of ≤ a graph≤G, then tw(G) pw(G) td(G) 1. ≤ ≤ − ence of 1 on finite trees). We adopt the convention that the height of a single-node tree is 0 (i.e., the former view).

4 Fig. 1. The path of length n has tree-depth log2(n + 2), as in the depicted decompo- sition.

2.2 MSO logic and interpretation We now briefly introduce the monadic second order logic (MSO) over graphs and the concept of FO (MSO) graph interpretation. MSO is the extension of first- order logic (FO) by quantification over sets, and comes in two flavours, MSO1 and MSO2, differing by the objects we are allowed to quantify over:

Definition 2.4( MSO1 logic of graphs). The language of MSO1 consists of expressions built from the following elements: – variables x, y, . . . for vertices, and X,Y for sets of vertices, – the predicates x X and edge(x, y) with the standard meaning, – equality for variables,∈ quantifiers , ranging over vertices and vertex sets, and the standard Boolean connectives.∀ ∃

MSO1 logic can be used to express many interesting graph properties, such as 3-colourability. We also mention MSO2 logic, which additionally includes quan- tification over edge sets and can express properties which are not MSO1 definable (e.g. Hamiltonicity). The large expressive power of both MSO1 and MSO2 makes them a very popular choice when formulating algorithmic metatheorems (e.g., for graphs of bounded clique-width or tree-width, respectively). A useful tool when solving the model checking problem on a class of struc- tures is the ability to “efficiently translate” an instance of the problem to a different class of structures, for which we already have an efficient model check- ing algorithm. To this end we introduce simple FO/MSO1 graph interpretation, which is an instance of the general concept of interpretability of logic theories [37] restricted to simple graphs with vertices represented by singletons.

Definition 2.5. A FO (MSO1) graph interpretation is a pair I = (ν, µ) of FO (MSO1) formulae (with 1 and 2 free variables respectively) in the language of graphs, where µ is symmetric (i.e. G = µ(x, y) µ(y, x) in every graph G). To each graph G it associates a graph I(|G) (by standard↔ abuse of notation), which is defined as follows: – The vertex set of I(G) is the set of all vertices v of G such that G = ν(v); – The edge set of I(G) is the set of all the pairs u, v of vertices of| G such that G = ν(u) ν(v) µ(u, v). { } | ∧ ∧

5 This definition naturally extends to the case of vertex-labelled graphs (using a finite set of labels, sometimes called colours) by introducing finitely many unary relations in the language to encode the labelling. For example, a can be interpreted in any graph (with the same number of vertices) by letting ν µ true, and the complement of a graph has an interpretation using µ(x, y≡) ≡edge(x, y). ≡ ¬

3 Capturing height of dense graphs

The concept of tree-depth is used to measure the “height” of other graphs than just trees. In fact, tree-depth can be seen as a bounded-height analogue of tree- width. However, the drawback is that only graphs with few edges can ever be of small tree-depth ([1]). The primary goal of our paper is to provide a measure of graph height similarly related to clique-width. For instance, the property of having bounded clique-width is stable by com- plementation, in the sense that for the clique-width of the complement G of a graph G it holds that cw(G) 2cw(G) [7], and this is the desired behaviour of our new height measure(s),≤ too. Naturally, such measures then cannot be stable under taking non-induced subgraphs. In greater generality, we show that the concept of “bounded shrub-depth” is stable even under the very general model-theoretical notion of MSO1 graph interpretation (Definition 2.5), see The- orem 4.1. This is nicely aligned with well known properties of the concept of bounded clique-width.

3.1 Shrub-depth To motivate the new definition of shrub-depth, we recall the simple neighbour- hood diversity parameter introduced by Lampis [29] in his search for graph classes having a faster MSO1 model checking algorithm: Two vertices u, v are twins in a graph G if NG(u) v = NG(v) u . The neighbourhood diversity of a graph G is the smallest m\{such} that V (G\{) can} be partitioned into m sets such that in each part the vertices are pairwise twins (each part is then either a clique or independent). This basically means that V (G) can be coloured by m labels such that the existence of an edge uv depends solely on the labels of u and v. Inspired by some subsequent generalizations of neighbourhood diversity, e.g, in [17, 14], our idea is to enrich it with a bounded number of “layers”. That is, we use the following definition, which can also be viewed as a very simplified (or minimalistic) analogue of a graph interpretation (Definition 2.5) into a tree of bounded height:

Definition 3.1 (Tree-model). We say that a graph G has a tree-model of m labels and depth d if there exists a rooted tree T (of height d) such that i. the set of leaves of T is exactly V (G), ii. the length of each root-to-leaf path in T is exactly d, iii. each leaf of T is assigned one of m labels ( T is m-labelled),

6 Fig. 2. The graph obtained from K3,3 by subdividing a matching belongs to TM3(2). iv. and the existence of a G-edge between u, v V (G) depends solely on the labels of u, v and the distance between u, v in∈T . The class of all graphs having a tree-model of m labels and depth d is denoted by m(d). TM Point iv. can also be interpreted as that the existence of an edge uv depends only on the labels of u, v and the height of the least common ancestor u v in T . One could, instead of the tree T , also consider a set of d nested (non-crossing)∧ equivalence relations on V (G) as the underlying structure (cf. [14]). Note that there is no explicit computability assumption in Definition 3.1.iv; it is implicit from the fact that a tree-model has fixed height and uses a bounded number of labels. For instance, Kn 1(1) and Kn,n 2(1). Definition 3.1 is further ∈ TM ∈ TM illustrated in Figure 2. It is easy to see that each class m(d) is closed under complements and induced subgraphs, but neither underTM disjoint unions, nor un- der subgraphs. The depth of a tree model generalizes tree-depth of a graph as follows (while the other direction is obviously unbounded, e.g., for cliques):

Proposition 3.2. If G is of tree-depth d, then G d (d), and ∈ TM2 G d (d 1) if, moreover, G is connected. ∈ TM2 − Proof. Let U be a rooted forest of height d 1 such that G Clos(U), and let T be a rooted tree obtained by adding a new− root r connected⊆ to the former roots of U, and d0 = d. If G is connected, then U already is a tree, and then we set T = U and d0 = d 1. − 0 For u V (T ) we set a label c(u) = (j, I) such that distT (r, u) = d j ∈ − and I = i : u, anci(u) E(G) , where anci(u) denotes the ancestor of u in T at distance{ { i from u}. ∈ Notice that} I 1, . . . , d 1 j (because of the height of U), and so the total number of⊆ distinct { c(−u) over− } all u V (U) is 2d−1 + 2d−2 + + 1 < 2d. Let T 0 be obtained from T as follows: For every∈ node ··· 0 u V (U) such that distT (r, u) < d , we add to u a new path with the other end ∈ 0 0 0 0 denoted by u such that distT 0 (r, u ) = d , and set c(u ) = c(u). We claim that this T 0 with the labels c(v) in the leaves of T 0 is the desired tree-model of G. Let G0 be the graph defined on the leaves of T 0 as follows; 0 0 u, v V (G ) is an edge of G iff, for c(u) = (j1,I1), c(v) = (j2,I2) and { } ⊆ 0 j1 < j2, it holds distT 0 (u, v) = 2j2 and j2 j1 I1. Then clearly G G. − ∈ ' ut

7 In the technical definition of a tree-model, the depth parameter d is much more important (for our purposes, e.g. efficient MSO property testing) than the number of labels m. With this in mind, it is useful to work with a more streamlined notion which only requires a single parameter, and to this end we introduce the following:

Definition 3.3 (Shrub-depth). A class of graphs G has shrub-depth d if there 0 exists m such that G m(d), while for all natural m it is G m0 (d 1). ⊆ TM 6⊆ TM − Note that Definition 3.3 is asymptotic as it makes sense only for infinite graph classes; the shrub-depth of a single finite graph is always at most one (0 for empty or one-vertex graphs). Furthermore, it makes no sense to say “the class of all graphs of shrub-depth d”. For instance, the class of all cliques has shrub-depth 1. We refer the reader to Section 6 for detailed account of how shrub-depth relates to other established concepts such as cographs and their generalizations. It is, however, immediate from Definition 3.1 that all graphs in m(d) have clique-width m, and our bounded shrub-depth indeed “lies between”TM bounded tree-depth≤ and bounded clique-width:

Proposition 3.4. Let G be a graph class and d an integer. Then: a) If G is of tree-depth d, then G is of shrub-depth d (cf. Proposition 3.2). b) If G is of bounded shrub-depth,≤ then G is of bounded≤ linear clique-width. The converse statements are not true in general.

Proof. a) This follows from Proposition 3.2, and the converse cannot be true in general because of, e.g., the class of cliques. b) We remark that it is trivial to see that G is of bounded clique-width. Here we even show how to straightforwardly translate a tree-model with m labels and depth d into a linear (caterpillar-shaped) m(d + 1)-expression: Let v1, . . . , vn be the natural left-to-right ordering of the leaves of a tree-model T of some G. The expression is constructed inductively for i = 1, . . . , n as follows:

– a vertex vi is created and added with a (currently unique) label (c, 0) where c = c(ui) is its label in T , – whenever label c is to be adjacent to label c0 at distance 2d in the model T , the expression adds all edges between the labels (c, 0) and (c0, d), and 0 – for 2d being the distance from vi to vi+1 in T , the expression changes all labels (c, d) with d < d0 to (c, d0). A counterexample for the converse claim is the class of all paths, see further Lemma 5.4. ut In relation to the latter sentence note, however, that graph classes of bounded shrub-depth are not asymptotically related to those excluding long induced sub- paths; the situation here is different than in Proposition 2.3 b). For a detailed discussion we refer to Sections 5.2 and 6.

8 e a, d, e a, b, e { } { }

a, b, c, d c, d, e a d { } { } e a a, c b, d b, c, e { } { } { } d

b c a c b d b c e

Fig. 3. A graph G and two possible SC-depth representations by depicted trees.

3.2 SC-depth

One can come up with yet another, very simple and single-parameter based, definition of a depth-like parameter which is asymptotically equivalent to shrub- X depth: Let G be a graph and let X V (G). We denote by G the graph G0 with vertex set V (G) where x = y are⊆ adjacent in G0 if (i) either x, y E(G) 6 { } ∈ X and x, y X, or (ii) x, y E(G) and x, y X. In other words, G is the graph{ } obtained 6⊆ from{G by} 6∈complementing{ the} edges⊆ on X.

Definition 3.5 (SC-depth6). We define inductively the class (n) as follows: SC – We let (0) = K1 ; SC { } – if G1,...,Gp (n) and H = G1 ˙ ... ˙ Gp denotes the disjoint union of ∈ SC ∪ ∪ X the Gi, then for every X of vertices of H we have H (n + 1). ∈ SC The SC-depth of G is the minimum integer n such that G (n). ∈ SC The SC-depth of a graph G is thus the minimum height of a rooted tree Y , such that the leaves of Y form the vertex set of G, and each internal node v is assigned a subset X of the descendant leaves of v. Then the graph corre- sponding to v in Y is the complement on X of the disjoint union of the graphs corresponding to the children of v (see Figure 3).

Proposition 3.6. Let G be a class of graphs. Then the following are equivalent:

– There exist integers d, m such that G m(d) (i.e. G has bounded shrub- depth). ⊆ TM – There exists an integer k such that G (k) (i.e. G has bounded SC-depth). ⊆ SC Instead presenting a proof here, we prove a more general reformulation of this claim later on, in Theorem 6.1. The reason we introduce both asymptotically equivalent SC-depth and shrub- depth measures here is that each brings a unique perspective on the classes of graphs we are interested in (see also Sections 5 and 6).

6 As the “Subset-Complementation” depth.

9 4 Height and MSO interpretation

In this section we present the first main result of the paper, Theorem 4.1, which shows that our tree-model (Definition 3.1) indeed exactly captures the power of an MSO1 graph interpretation. While such a result may be expected for the FO logic, we believe it is rather surprising in the full scope of the MSO logic. The assumption of bounded depth of the target tree is absolutely essential here.

Theorem 4.1. A class G of graphs has an MSO1 graph interpretation in the class of all finite rooted trees of height d, with vertices labelled by a finite set of labels if, and only if, G has shrub-depth≤ at most d. While the proof of Theorem 4.1 is rather involved by itself, it strongly re- lies also on (and has been inspired by) the following recent result which is of independent interest:

Proposition 4.2 (Gajarsk´yand Hlinˇen´y[15]). Let T be a rooted tree with each vertex assigned one of a finite set of m labels, 7 and let φ be any MSO1 sentence with q quantifiers. There exists a function R(q, m, d) exp(d)(q + m)O(1) such that the following holds: ≤ Assume any node u V (T ) such that the subtree Tu T rooted at u is of ∈ ⊆ height d, and denote by U1,U2,...,Uk the connected components of Tu u. If there is a (sufficiently large) subset of indices I 2, . . . , k , I R(q,− m, d), ⊆ { } | | ≥ such that there exist label-preserving isomorphisms from U1 to each Ui, i I; 0 0 ∈ let T = T V (U1). Then, T = φ T = φ. − | ⇐⇒ | Before actually proving Theorem 4.1, we need one more technical lemma.

Lemma 4.3. Assume X,Y are label-preserving vertex automorphism orbits in a rooted labelled tree T , and x X, y Y are chosen arbitrarily. If z = x y is the least common ancestor of x,∈ y in T ,∈ then the pair (x, y) is determined∧ uniquely up to a label-preserving automorphism of T by the pair of distances distT (x, z), distT (y, z). Proof. All isomorphisms in this proof are label-preserving (w.r.t. the node la- belling of T ). Firstly, we clarify the meaning of the claim; for any x1, x2 ∈ X, y1, y2 Y , and their least common ancestors z1, z2 in T , such that ∈ distT (x1, z1) = distT (x2, z2) and distT (y1, z1) = distT (y2, z2), there is an auto- morphism of T taking the pair (x1, y1) onto (x2, y2). We carry on the proof by induction on d = distT (x1, z1) + distT (y1, z1). The base case of d = 0 is trivial (since x1 = y1 and x2 = y2). Consider now an 0 0 induction step to d+1 where distT (x1, z1) 1. Let x1, x2 be the parent nodes of 0 ≥ x1, x2, respectively, and let X denote the set of parent nodes of all the members of X. Then X0 is a vertex orbit of T , too. By inductive assumption, there is an 0 0 automorphism τ of T taking the pair (x1, y1) onto (x2, y2). If τ(x1) = x3, then

7 Here exp(d) stands for the iterated (“tower of height d”) exponential, i.e., exp(1)(x) = (i) 2x and exp(i+1)(x) = 2exp (x).

10 0 x3 is a child of x2, and the subtree of T rooted at x3 is isomorphic to that of x2 by transitivity. Therefore, we may without loss of generality assume x3 = x2, and the induction step is complete. ut Notice that Lemma 4.3 and its proof can be easily extended to arbi- trary k-tuples of tree nodes, which are then uniquely determined up to a T - automorphism by the shape of their Steiner trees. We may now proceed to:

Proof (of Theorem 4.1). Observe that it is clear from Definition 3.1 that for any fixed integers d, m, the class m−1(d) has an MSO interpretation (or even FO TM interpretation) in the class Tm(d) of all finite rooted trees of height at most d with each node assigned one of m labels. It thus follows easily that so does every G of shrub-depth d for a suitable choice of m. Now, suppose that (α, β) are MSO formulae defining the interpretation of G in Tm(d) for suitable m, i.e., every G G is interpreted in some TG Tm(d) ∈ ∈ as follows: V (G) = x V (TG): TG = α(x) and E(G) = xy : x, y { ∈ | } { ∈ V (G) TG = β(x, y) . We will construct a tree-model of G of depth d using a bounded∧ number| of (new)} labels. For technical reasons, we transform β into a closed sentence, β0 x, yL(x) L(y) β(x, y), where L is a new label (added ≡ ∃ ∧ ∧ to nodes of the tree). We add the label L to precisely two nodes of TG for which we will need to test adjacency in G. Let G G be a fixed graph and let T = TG, as above. For u V (T ), denote ∈ ∈ 0 by Tu T the subtree rooted at u. Let q be the number of quantifiers in β , ⊆ 0 and for Ri = R(q, m, i) from Proposition 4.2, let Ri = Ri + 2. We repeat the following recursively, starting from the leaf nodes of T , going up to the root: For each u V (T ) such that Tu is of height i, consider the components of Tu u partitioned∈ into the equivalence classes according to the existence of a label-− preserving isomorphism. We prune the number of components in each class to 0 0 exactly Ri whenever possible. Let T be the resulting “reduced” subtree of T . Observe that T 0 is of bounded size depending only q, m and d, and independent of the size of T . Suppose x, y is a pair of nodes of T for which we want to test adjacency in G. Let T [L(x),L(y)] denote the tree T in which the new label L has been assigned to precisely x, y V (T ). Correspondingly, we denote by T 0[L(x),L(y)] the reduced tree as described∈ above. Note that up to symmetry, we may always assume x, y V (T 0). Furthermore, while forming T 0[L(x),L(y)], we only remove ∈ components from label preserving isomorphism classes of Tu[L(x),L(y)] u of 0 − size greater than R 2 = Ri, thereby accounting for the possibility that some i − (at most two) components of Tu[L(x),L(y)] u receive the label L. Then, it follows from Proposition 4.2 that T [L(x),L(y−)] = β0 T 0[L(x),L(y)] = β0. Consequently, for each pair x, y, one can determine| whether⇐⇒ or not it forms| an edge in G simply by testing if T 0 with a suitable assignment of L satisfies β0. We now describe how to obtain a tree model for G with height d and a bounded number of labels. Starting with the rooted Steiner tree of V (G) in TG, we construct U by possibly “pushing” the vertices V (G) to leaves at distance

11 exactly d from the root, in order to satisfy Definition 3.1. For each u V (G), let d(u) denote the distance it is pushed while forming U and Or(u) be the∈ automor- phism orbit of u in T 0. We assign the label (T 0, Or(u), d(u)) to each u V (G). For any pair u, v V (G), d(u) d(v) yields the height of their common∈ ancestor, z, ∈ | − | thereby also determining distT (x, z) and distT (y, z). Subsequently, Lemma 4.3 implies that the labels (T 0, Or(u), d(u)) and (T 0, Or(v), d(v)) determine the ex- act mutual position of u, v within T 0. Hence, this tree model can determine the value of T 0[L(x),L(y)] = β0, which in turn determines T [L(x),L(y)] = β0, and consequently, the logical| value of T = β(u, v). | | ut 4.1 Algorithmic consequence Theorem 4.1, combined with another recent result of [15] (stated here as Theo- rem 4.4) gives us an MSO1 model checking algorithm for graphs which is FPT and has an elementary dependence on the size of the formula φ. The price we have to pay is a stronger assumption of having bounded shrub-depth. Note, once again, the contrast with the well known algorithms of Courcelle [5] for MSO2 and Courcelle et al. [6] for MSO1 model checking problems on the graphs of bounded tree- and clique-width, both of which were shown to have a non-elementary lower bound in φ by Frick and Grohe [13]. Theorem 4.4 (Gajarsk´yand Hlinˇen´y[15]). Assume d 1 is a fixed integer. Let T be a rooted tree of height d with vertices labelled by≥ a finite set of m labels, and let φ be any MSO1 sentence with q quantifiers. Then the MSO1 model checking, i.e., testing G = φ for the input G G and MSO1 sentence φ, can be solved by an FPT algorithm| in time V (T )∈ + exp(d+1)(q + m)O(1). O | | Using the graph interpretation machinery (Definition 2.5), one can now easily reduce the MSO1 model checking problem of any bounded shrub-depth class onto the case of Theorem 4.4: Corollary 4.5. Assume d 1 is a fixed integer. Let G be any graph class of ≥ shrub-depth (or SC-depth) at most d. Then the MSO1 model checking problem on G has an FPT algorithm with an elementary dependence on the parameter φ. In the very straightforward way, Corollary 4.5 assumes G is given on the input alongside with its tree-model of depth d. This assumption can, however, be nicely avoided by using the fact that the algorithm of Theorem 4.4 employs a linear- time reduction of the input problem into a kernel of size exp(d)(q + m)O(1). Therefore, one can use a rank-decomposition of the input graph [24] and return back to the model checking algorithm of Courcelle et al [6], from which only a strictly smaller number of automaton states are accessible and used in this special case.

5 Generalizing cographs

A cograph, or complement reducible graph, is a graph that can be generated from K1 by complementations and disjoint unions. Cographs were first introduced by

12 Lerchs in [31, 32], where the author studied their structural and algorithmic prop- erties and proved that these graphs admit a tree representation of a special kind. The tree representation of a cograph G is a rooted tree T (called cotree) whose leaves are the vertices of G and whose internal nodes represent complemented union. An alternate definition is based on assigning the internal nodes of T a bi- nary value of 0 or 1 in such a way that two vertices are adjacent in G if and only if their least common ancestor in T is assigned the value 1. This representation was employed as the basic data structure for the linear recognition algorithm for cographs described in [4]. Note that this tree representation is unique if one requires the 0 and 1 to alternate on every branch of T . For such graphs, many intractable problems have efficient algorithmic solutions (see, for example, [3, 4]). Another characterization of cographs, obtained by Lerchs in [31], is that cographs are those graphs that contain no induced subgraph isomorphic to P4, the path on 4 vertices. A bipartite analogue of the class of complement reducible graphs was then introduced by Giakoumakis and Vanherpe under the name of bi-complement reducible graphs (or bi-cographs) [20]. These graphs are those bipartite graphs that can be reduced to single vertices by recursively bi-complementing the edge set of all connected bipartite subgraphs. Alternatively, bi-cographs are those graphs that admit a bi-cotree representation, that is a rooted tree T whose (two coloured) leaves correspond to the vertices of G, and whose internal vertices are labelled by 0 and 1 in such a way that two vertices are adjacent in G, if and only if they have a different color and their least common ancestor in T is assigned the value 1. It is proved in [20] that bi-cographs can be recognized in time O(n3) and that they are characterized by three excluded induced subgraphs.

5.1 m-Partite cographs and related notions Several generalizations of cographs have been proposed recently — for instance in [26]. The generalization we present below is a very natural common gener- alization of cographs and bi-cographs (as illustrated by Figure 4), which also nicely relates to clique-width expressions.

d f(2,2)=1 e c f(1,1)=1 2 d

f(1,2)=f(2,1)=1 f(1,2)=f(2,1)=1

a 1 e 2 b 1 c 2 a b

Fig. 4. A 2-partite cotree representation of the graph C5, with f(x, y)=0 unless otherwise specified.

13 Definition 5.1( m-partite cograph). An m-partite cograph is a graph that admits an m-partite cotree representation, that is a rooted tree T such that – the leaves of T are the vertices of G, and are coloured by labels from 1, . . . , m , { } – the internal nodes v of T are assigned symmetric functions fv : 1, . . . , m 1, . . . , m 0, 1 such that two vertices x and y of G with{ respective}× { } → { } colours i and j are adjacent iff fx∧y(i, j) = 1 (where x y is their least common ancestor in T ). ∧ By extension, the depth of an m-partite cograph G is the minimum height of an m-partite cotree representation of G. Notice that the class of m-partite cographs is obviously hereditary and closed under disjoint union and complementation. If G is an m-partite cograph, then each label induces a cograph hence m is at least equal to the minimum number of parts in a partition of the vertex set of G such that each part induces a cograph. This notion appears independently in the study of P4-free colouring by Ho´angand Le [25] and as the definition of the c-chromatic number by Gimbel and Neˇsetˇril[21, 22]. Comparing an m-partite cotree representation to a clique-width expression, the difference lies, roughly saying, in the absence of the relabelling operator for the former. This suggests m-partite cographs form a smaller graph class, but the good thing is that m-partite cographs enjoy some useful strong properties not possessed by bounded clique-width graphs in general (cf. Section 6). The fact that the class of m-partite cographs has bounded clique-width can be formally deduced from the connection between clique-width and the classes NLCm introduced by Wanke [40]. Recall that NLCm consists of all graphs that can be obtained from single vertices with labels in 1, . . . , m using the two following operations: { }

– union of two graphs G1 and G2, with addition of all edges between vertices of G1 with label i and vertices of G2 with label j whenever (i, j) belongs to a given subset S of 1, . . . , m 1, . . . , m , called ; – relabelling of the vertices{ according} × { to some} mapping from 1, . . . , m to 1, . . . , m . { } { } The NLC-width of a graph is the minimum m such that the graph belongs to NLCm. It has been proved in [27] that the NLC-width and the clique-width of a graph G are related by NLC-width(G) clique-width(G) 2 NLC-width(G). (1) ≤ ≤ From this we immediately deduce: Proposition 5.2. Every m-partite cograph is of clique-width at most 2m. Proof. It is a straightforward induction over the depth of an m-partite cotree- representation that the class of m-partite cographs is included into NLCm. The proof then follows from inequality (1). ut

14 One can push the underlying idea of the definition of m-partite cographs further to another (smaller and yet) well established class: threshold graphs. To give a brief characterization, threshold graphs are cographs with a cotree representation in the form of a “rooted caterpillar” (every node has at most one non-leaf child).

Definition 5.3( m-partite ). An m-partite threshold graph is a graph that admits an m-partite cotree representation in the form of a cater- pillar rooted at one end.

Analogously to Proposition 5.2 one can easily show that m-partite threshold graphs are of bounded linear clique-width. However, m-partite threshold graphs do not seem to be much interesting in our context because of the following observation related to Proposition 3.4 b): The graph of a matching of m + 1 edges (which is of SC-depth 2) is not an m-partite threshold graph.

5.2 Long induced paths

For a further illustration of properties of the class of m-partite cographs, we present the following case study of long paths, which in particular shows that Proposition 5.2 cannot be reversed in any way (as paths are of clique-width at most three).

Lemma 5.4. A path on n vertices, i.e., of length n 1, is an m-partite cograph if and only if n 3(2m 1). − ≤ −

m Proof. We first prove by induction over m that if n = 3(2 1) then Pn is an − m-partite cograph. The case m = 1 is well known. So assume Pn is an m-partite cograph and let T be an m-partite cotree representation of Pn. Take two copies T1 and T2 of T , and replace in each of the trees one of the leaves x representing an extremity of the path by a small tree with a root r and two sons: one being x (with the same colour) and the other being a new vertex x0 with colour m + 1. Let the function assigned to r be constant and equal to 1. For all the functions assigned to other internal nodes of T1 and T2 define f(i, m+1) = f(m+1, i) = 0 for every 1 i m + 1. Let T 0 be the rooted tree with root r such that r ≤ ≤ has two sons: a vertex s, with sons T1 and T2, and a leaf t, with colour m + 1. At the internal vertex s we assign the function fs such that f(i, j) = 0 for every i, j. At the root r we assign the function fr such that f(i, j) = 1 only if 0 i = j = m+1. Then T is an (m+1)-cotree representation of P2n+3 (see Figure 5 for the construction of P9 as a 2-partite cograph). m We now prove by induction over m that if n = 3(2 1) + 1 then Pn is not an m-partite cograph. The case m = 1 is again well known.− So assume for contradiction that T is an m + 1-partite cotree representation of P3(2m+1−1)+1 = P2n+2 and let r be the root of T . As P2n+2 is connected, the function fr assigned to the root is non-zero and there exist i, j (possibly equal) such that some subtree Tu rooted at a son u of r includes at least a leaf with colour i, the subtree Tv

15 f( , ) = f( , ) = f( , ) = 0; f( , ) = 1 ◦ ◦ • ◦ ◦ • • • f( , ) = f( , ) = f( , ) = f( , ) = 0 ◦ ◦ • ◦ ◦ • • •

T f( , ) = f( , ) = f( , ) = 0; f( , ) = 1 • • • ◦ ◦ • ◦ ◦ f( , ) = f( , ) = f( , ) = f( , ) = 0 ◦ ◦ • ◦ ◦ • • • f( , ) = f( , ) = f( , ) = f( , ) = 1 ◦ ◦ • ◦ ◦ • • •

P9

Fig. 5. A 2-partite cotree representation of P9. rooted at a son v of r different from u includes a least one leaf with colour j, and fr(i, j) = 1. As none of K3,K2,2, and K1,3 are induced subgraphs of P2n+2, we can assume (by symmetry) that Tu includes 1 or 2 leaves with colour i and that Tv includes exactly 1 leaf with colour j. Two cases could occur:

If r has two sons u1 and u2 such that Tu1 and Tu2 each include one leaf with colour i, then i = j and only Tv includes a leaf z with colour j. Thus Gz is an 6 m-partite cograph. As this graph includes Pn as an induced subgraph, we get a contradiction. Otherwise, no son x other than u or v is such that Tx includes a leaf with colour i or j. In this case, we can permute the colours i and j in Tu (and consequently change the functions at interior vertices of T ) to ensure i = j. If Tu includes exactly one leaf with colour j then there exists a colour k such that fr(j, k) = 1. It follows that there exists in T exactly one leaf z of colour k, which belongs either to Tu or to Tv. As previously, G z is an m-partite cograph − that includes Pn as an induced subgraph, a contradiction. Thus Tu includes two leaves with colour j and fr(a, b) = 1 if and only if a = b = j. By deleting all the vertices of colour j (which form a K1,2), we get two connected components, each being a path. The longest one has order at least n. As it is an m-partite cograph, we get a contradiction. ut

5.3 Well-quasi-ordering

We now move to the second main contribution of this paper (and the prime motivation for this whole section); well-quasi-ordering of the classes of m-partite

16 cographs under the induced subgraph order i, which extends the aforemen- tioned analogous results for graphs of bounded⊆ tree-depth and shrub-depth (re- call Ding’s results in [10]). This in particular implies efficient solvability of all hereditary properties on the m-partite cographs for each m. A class or property is said to be hereditary if it is closed under taking induced subgraphs. A well-quasi-ordering (or wqo) of a set X is a quasi-ordering such that for any infinite sequence of elements x1, x2,... of X there exist i < j with xi ≤ xj. In other words, a wqo is a quasi-ordering that does not contain an infinite strictly decreasing sequence or an infinite set of non-comparable elements (i.e. an infinite antichain). The existence of a well-quasi-ordering has great algorithmic consequences in general. For instance, the Robertson-Seymour theorem, which proves that the relation “is a minor of” is a well-quasi-ordering of graphs, implies that for every minor-closed family there is a finite set of forbidden minors for , and hence there is a polynomialC time algorithm for testing whether a graph belongsC to . In our case we obtain: C Theorem 5.5. Let m be an integer. The class of m-partite cographs is well- quasi-ordered by the relation i (“is isomorphic to an induced subgraph of”). ⊆ Before giving the proof, we introduce the folklore Kruskal’s theorem. Let T,T 0 be rooted labelled trees, with labels from a (X, ). A homeomorphic embedding f : T T 0 is an injection from V (T ) in V (T 0) such that → – for every x in T it holds that label(x) label(f(x)); – for every x y in T it holds that f(x) f(y) in T 0; – for every x,≤ y in T it holds that f(x y≤) = f(x) f(y). ∧ ∧ Theorem 5.6 (Kruskal [28]). Let Ti i∈I be a family of rooted labelled trees, { } with labels in a well-quasi-ordered set X. Then there exist i < j such that Ti embeds homeomorphically in Tj. Recall Definition 5.1; that an m-partite cotree representation is a labelled rooted tree. We have the following technical observation: Lemma 5.7. Let, for an integer m, G and H be m-partite cographs having m- partite cotree representations TG and TH , respectively. Assume that TH embeds homeomorphically in TG in such a way that the leaves of TH are mapped to leaves of TG, and that the labels are preserved. Then H is isomorphic to an induced subgraph of G.

Proof. Let f : V (TH ) V (TG) be the homeomorphic embedding. Recall from the definition that the→ vertex sets of G and H are identified with the sets of leaves of TG and TH , and that internal nodes v of TG and of TH are assigned symmetric functions gv and hv, respectively. Consider a pair x, y V (H). If x ∈ and y have respective colours i and j in TH , then the same holds for f(x) and f(y) in TG. Moreover, as f is injective, f(x) and f(y) are adjacent in G if, and only if, gf(x)∧f(y)(i, j) = 1. Since f(x) f(y) = f(x y) and gf(z) hz, we get that f(x) and f(y) are adjacent in G ∧iff x and y are∧ adjacent in H≡. It follows that H is isomorphic to the subgraph of G induced by f(V (H)). ut

17 Proof (of Theorem 5.5). Let (Gi)i∈I be a family of m-partite cographs and let (Ti)i∈I be m-partite cotree representations of these graphs. Ti are rooted labelled trees with labels from a disjoint union of two finite sets; 1, . . . , m (on the leaves) and the set of the symmetric functions from 1, . . . , m { 1, . . . ,} m to 0, 1 (on the internal nodes). This set of labels is trivially{ wqo}×{ by the identity} relation.{ } According to Theorem 5.6, there exist i < j such that Ti embeds homeomor- phically in Tj. By Lemma 5.7, it follows that Gi is isomorphic to an induced subgraph of Gj. ut Notice that Theorem 5.6 obviously also holds if we use a well-quasi-ordered set to label the vertices and consider the natural “labelled” extension of the induced subgraph relation. Corollary 5.8. a) For every integer m > 0, the class of m-partite cographs is defined by a finite set of excluded induced subgraphs. Hence m-partite cographs are recognizable by an FPT algorithm. b) For every and every integer m, the property can be decided by an FPT algorithm onP the class of m-partite cographs. P Proof. a) For an integer m, let G be a graph that is not an m-partite cograph, such that every proper induced subgraph of G is an m-partite cograph. Let v be a vertex of G. Consider an m-partite cotree representation T of G v. Let r be the root of T . Relabel every leaf x of T by 2 label(x) if x is not adjacent− to v in G and 2 label(x) + 1 otherwise. For each internal· node x of T which was originally · assigned a symmetric function fx : 1, . . . , m 1, . . . , m 0, 1 , assign the { } × { } → { } symmetric function gx : 1,..., 2m + 1 1,..., 2m + 1 0, 1 defined by { } × { } → { } gx(i, j) = fv( i/2 , j/2 ) if i, j < 2m + 1, gx(i, j) = 0 if at least one of i, j is b c b c 2m+1, with exception of gr(2i+1, 2m+1) = gr(2m+1, 2i+1) = 1 if 1 i < m. Add to the root r of T a new son with label 2m + 1 for v. Then, the≤ obtained rooted tree together with the functions gx is a (2m + 1)-cotree representation of G. It follows that the class m of minimal non m-partite cographs is included in the class of (2m + 1)-partiteF cographs. According to Theorem 5.5, the class of (2m + 1)-partite cographs is well-quasi-ordered by i. Hence, as m is an ⊆ F antichain for i, it is finite, and checking whether a graph G is an m-partite ⊆ cograph reduces to testing whether a graph in m is an induced subgraph of G. F b) By Theorem 5.5, there exists a finite set P,m of the excluded induced subgraphs for the hereditary property over theX class of m-partite cographs. P This set P,m may generally not be computable, but since it is finite, we always get (at least)X a nonuniform algorithm. The tool which allows us to test for an induced subgraph in P,m in FPT time is a rank-decomposition of bounded width: Using PropositionX 5.2 and [24] we can obtain such a bounded-width de- composition of the input graph G in FPT time, and then use an FPT test for P,m, e.g., by means of MSO1 [6]. X ut For instance, for every fixed integers k and m, the k-colourability problem can be solved in polynomial time in the class of m-partite cographs. This is,

18 of course, not an impressive application as k-colourability is MSO1 expressible, but there exist other hereditary problems which do not have obvious MSO1 definitions and where Corollary 5.8 may be used; e.g., choosability or for a quick illustration (see also Corollary 6.5).

6 Relations between the classes

In this section, we provide an exhaustive comparison of the graph parameters and classes defined in this paper with other established graph classes (cf. Figure 6).

6.1 m-partite cographs of bounded depth

First, we pay a close look at the general relation of m-partite cographs to shrub- depth and SC-depth. Since the only crucial difference between a tree-model and an m-partite cotree representation lies in bounding the height of the former, it is only natural to consider cotree representations of bounded height (as anticipated in Definition 5.1):

Theorem 6.1. Let G be a graph class. Then the following three are equivalent:

– There exist integers d, m such that G only contains m-partite cographs of depth d. – The class≤ G has bounded shrub-depth. – The class G has bounded SC-depth.

This statement readily follows from Definition 3.3 together with the following three lemmas, which relate m-partite cographs to tree-models and SC-depth.

Lemma 6.2. Let m, d be arbitrary positive integers. Then the following hold:

– All graphs in the class m(d) have m-partite cotree representations of depth at most d. TM – For each m there exists m0 such that every m-partite cograph of depth d belongs to the class m0 (d). TM Proof. The former direction is trivial, since every tree-model of m labels is also an m-partite cograph. As for the latter direction, we utilize the following trick. For each internal node v of a cotree representation T of a graph G, there is only a bounded number of possible choices of the function fv (cf. Definition 5.1) for fixed m. Hence, for every leaf x (of T ) we can, in addition to the original label, record the functions fv for all ancestors v of x. Since the cotree representation T is of bounded depth d, this implies a finite number m0 of possible new labels. Lastly, it remains to “extend” each branch of T to length exactly d. Hence G m0 (d). ∈ TM ut Lemma 6.3. Assume G (n); then G has a 2n-partite cotree representation of depth n. ∈ SC

19 Proof. We prove the statement by induction over n. If n = 1 then the statement is trivially true. Assume G (n + 1). Then there exist G1,...,Gp (n) ∈ SC S X ∈ SC and a subset X of vertices of G such that G = i Gi . By induction, each Gi, n 1 i p, has a 2 -partite cotree representation of depth n. Let Xi = X V (Gi). ≤ ≤ ∩ We define a new labelling of the vertices of Gi as follows: Considering a vertex x currently assigned label label1(x), we set label2(x) = (label1(x), 0) if x X and 6∈ label2(x) = (label1(x), 1) if x X. By complementing the Boolean functions defining adjacencies between vertices∈ whose label have the form (`, 1), we get Xi n+1 that Gi has a 2 -partite cotree representation of depth n. By gluing tree representations if p > 1, and by defining a new Boolean function f at the root by f((k, a), (`, b)) = 1 iff a = b = 1, we get that G has a 2n+1-cotree representation of depth n + 1. ut Lemma 6.4. Assume G has an m-partite cotree representation of depth d. Then G (3dm(m + 1)). ∈ SC

Proof. We prove the statement by induction over d. If d = 0 (i.e. G = K1) then the statement is true. Assume G has an m-partite cotree representation of depth d + 1. Then there exist a subset G1,...,Gp of graphs, each having an m-partite cotree representation of depth{ d, and a} symmetric function f : S 1, . . . , m 1, . . . , m 0, 1 such that G is obtained from Gi by adding { } × { } → { } i edges between vertices with label a in Gi and vertices with label b in Gj whenever i = j and f(a, b) = 1. By induction, each Gi belongs to (3dm(m + 1)). For each6 i, we proceed to a sequence of complementations ofSC of vertices of Gi in such a way that for every 1 a b m with f(a, b) = 1, the set of edges ≤ ≤ ≤ between vertices of Gi with label a and label b is complemented. This takes at m+1 0 most 3 2 iterations (three per each such pair a, b) and leads to the graph Gi 0 m+1 such that Gi (3dm(m + 1) + 3 2 ). ∈ SC 0 S 0 Then we consider G = i Gi and again proceed to a (similar) sequence of complementations of subsets of vertices of G0 in such a way that for every 1 a b m with f(a, b) = 1, the set of edges between vertices of G0 with label ≤ ≤ ≤ m+1 a and label b is complemented. This takes another at most 3 2 iterations to m+1 arrive at the graph G, and hence G (k) where k = 3dm(m+1)+2 3 2 = 3(d + 1)m(m + 1). ∈ SC · ut Regarding algorithmic properties, we immediately obtain the following claim as a special case of Corollary 5.8, since all the considered graphs are now m- partite cographs for some bounded m.

Corollary 6.5. a) For all integers m, d > 0, the classes m(d) and (d) are recognizable by FPT algorithms. TM SC b) For every hereditary property and every graph class G of bounded shrub- depth, there exists an FPT algorithmP for testing on G. P ut

20 6.2 Some further examples We continue by summarizing what (and where) we have learned so far about existing inclusion relations between the studied graph classes: i. Tree-depth is bounded by both tree-models and shrub-depth; in Proposi- tions 3.2 and 3.4. ii. Bounded shrub-depth implies bounded linear clique-width; in Proposi- tion 3.4. iii. Classes of bounded shrub-depth and asymptotically equivalent SC-depth may be represented as m-partite cographs (bounded height) for some m; in Theorem 6.1. iv. m-partite cographs are included under graphs of bounded clique-width; in Proposition 5.2. These relations are depicted also in Figure 6. Furthermore, there are no other “accidental” inclusions between the mentioned classes which is shown by the following three examples:

rooted forests of bounded height

bounded tree-depth

stability under large graphs have complementation bounded shrub-depth “large” non-trivial ≈ bounded SC-depth automorphisms

bounded path-width cographs

bounded linear bounded tree-width m-partite cographs clique-width

bounded clique-width well quasi-ordered ≈ bounded NLC-width by induced subgraph

Fig. 6. Hierarchy of graph classes, with the new classes shaded in grey. Arrows mean strict inclusion, and no other inclusion holds.

Example 6.6. There exist graphs of bounded shrub-depth which do not have bounded tree-width, and graphs of bounded tree-width (and path-width) which are not m-partite cographs for bounded m.

21 b1 b2 b3 b4 ... bn

a1 a2 a3 a4 ... an

Fig. 7. The graph Hn of Example 6.7 is a threshold graph (lay down the vertices in the backward order an, bn, an−1, bn−1, . . . , a1, b1).

Proof. Take the class of all cliques as the first example, and the class of all paths as the second example (Lemma 5.4). ut Example 6.7. There exist cographs (and threshold graphs) which are of arbitrar- ily large SC-depth and hence form a class of unbounded shrub-depth.

Proof. Let Hn denote the graph obtained from the disjoint union of an indepen- dent set a1, . . . , an and a clique on b1, . . . , bn by adding all edges aibj such that i {j; see Figure} 7. { } ≥ For a graph G, let f(G) denote the maximum integer n such that there exist distinct vertices a1, . . . , an, b1, . . . , bn in G such that ai is adjacent to bj if and only if i j. It is easily checked that the f-value of a graph G is the maximum of the f-values≥ of its connected components. Let G be a graph with SC-depth t, which can be obtained by taking the G1,...,Gk (each having SC-depth at most t 1) and complementing a subset W of vertices. If − f(G) = n then there exist distinct vertices a1, . . . , an, b1, . . . , bn in G such that ai is adjacent to bj if and only if i j. Let I = i 1, . . . , n : ai, bi W . Let ≥ { ∈ { } { } ⊆ } C = maxi f(Hi)+1. If I n C, then (considering vertices ai, bi out of W ) we S | | ≤ − deduce f( Gi) C hence maxi f(Hi) C, a contradiction. Thus I > n C. By complementing≥ W and observing the≥ largest connected component| | of− the subgraph induced by the ai’s and the bi’s, we get that there exists 1 j k ≤ ≤ such that f(Gj) n 1 C, thus n 2C. By induction, we deduce that every graph G with SC-depth≥ − t−has f(G) ≤2t−1. ≤ In particular, as f(Hn) = n, the SC-depth of Hn is at least log2 n. We see that although each Hn is a threshold graph, the class Hn has unbounded shrub-depth. { } ut Example 6.8. There exist cographs which are not of bounded linear clique-width.

Proof. The closure (cf. Definition 2.2) of a complete rooted binary tree (of arbi- trary height) is a cograph, but it is not of bounded linear clique-width. ut

22 The remaining remarks return to the notion of tree-depth and its relation to the new concepts of depth (which have been inspired by tree-depth, anyway). The common ground of these notions is also witnessed by the simple observation below: Remark 6.9. Let be a monotone (i.e. closed under subgraphs) class of graphs. Then has boundedC tree-depth if and only if there exists m such that all the graphsC in are m-partite cographs. C Furthermore, in view of the asymptotic characteristic of the graphs of bounded tree-depth by absence of long paths (Proposition 2.3), one could specu- late what it means to exclude long induced paths and their complements from a hereditary class. By Lemma 5.4, this exclusion is true for the m-partite cographs for any m, but it is unfortunately not a characteristic property: Example 6.10. There exist graphs of bounded clique-width which contain neither an of length 4 nor its complement, such that they are not m-partite cographs for bounded m.

Proof. The graph Gn obtained from the path Pn = (v1, . . . , vn) by adding all edges between vertices with even index obviously contains no P5 and no P 5 as an induced subgraph. So assume all the Gn are m-partite cographs for some fixed integer m. By assigning to each vertex vi with original label label(vi) the new label (label(vi), i mod 2), one could easily deduce a 2m-cotree representation of 2m Pn, and hence we get a contradiction to Lemma 5.4 if we choose n > 3(2 1). − ut 7 Concluding notes

The main motivation of this paper has been to come up with a notion of “bounded graph depth” which extends the established notion of tree-depth to- wards dense graphs and parameters similar to clique-width. We have succeeded in this direction by discovering two new, asymptotically equivalent, parameters; shrub-depth and SC-depth. The advantage of the former is that it exactly char- acterizes the graph classes interpretable in trees of height d, while the latter (SC-depth) outdoes the former with a simpler, single-parameter definition. This success brings new interesting structural questions, primarily repre- sented by the problem of giving a “nice” asymptotic structural characterization of (hereditary) graph classes of unbounded shrub-depth. Here by “nice” we mean a characterization which would resemble the beautifully simple characterization of bounded tree-depth by absence of long paths. A related question may be to characterize the hereditary graph classes excluding long paths and the comple- ments of those. Our research topic is also closely related to the class of cographs, and to their natural generalization — m-partite cographs. Briefly speaking, graphs of bounded SC-depth are those having an m-partite cotree representation of bounded depth. On the other hand, the larger class of all m-partite cographs is

23 “sandwiched” strictly between bounded shrub-depth and bounded clique-width, and it shares several nice finiteness properties with classes of bounded shrub- depth (e.g., well-quasi-ordering under coloured induced subgraphs, which is not true for bounded clique-width classes in general). Although the class of m-partite cographs can be defined using finitely many excluded induced subgraphs for each m, this characterization is non-constructive. A simple and more natural asymptotic characterization would also be of high interest. Additionally, it may be interesting to try to characterize the maximal graph classes admitting well-quasi-ordering under coloured induced subgraphs. The prime algorithmic applications are of two kinds: Firstly, in connection with [15], we obtained an FPT algorithm for MSO1 model checking for graph classes of bounded shrub-depth which is faster than the algorithm of [6] in the sense that it depends on the checked formula in an elementary way. Secondly, via the well-quasi-ordering property of m-partite cographs, we have proved an- other algorithmic metatheorem claiming FPT (nonuniform) decidability of all hereditary properties on the classes of m-partite cographs. Finally, we remark on the possibility of extending our tools and notions from graphs to general relational structures.

References

1. A. Blumensath and B. Courcelle. On the monadic second-order transduction hier- archy. Log. Methods Comput. Sci., 6(2), 2010. 2. H. L. Bodlaender, J. S. Deogun, K. Jansen, T. Kloks, D. Kratsch, H. M¨uller,and Z. Tuza. Rankings of graphs. SIAM J. Discrete Math., 11(1):168–181, 1998. 3. D. G. Corneil, H. Lerchs, and L. K. Stewart. Complement reducible graphs. Dis- crete Appl. Math., 3:163–174, 1981. 4. D. G. Corneil, Y. Perl, and L. K. Stewart. A linear recognition algorithm for cographs. SIAM J. Comp., 14(4):926–934, 1985. 5. B. Courcelle. The monadic second order logic of graphs I: Recognizable sets of finite graphs. Inform. and Comput., 85:12–75, 1990. 6. B. Courcelle, J. A. Makowsky, and U. Rotics. Linear time solvable optimization problems on graphs of bounded clique-width. Theory Comput. Syst., 33(2):125– 150, 2000. 7. B. Courcelle and S. Olariu. Upper bounds to the clique width of graphs. Discrete Appl. Math., 101(1-3):77–114, 2000. 8. J. Deogun, T. Kloks, D. Kratsch, and H. M¨uller.On vertex ranking for permutation and other graphs. In STACS’94, volume 775 of LNCS, pages 747–758. Springer, 1994. 9. R. Diestel. Graph Theory, volume 173 of Graduate texts in mathematics. Springer, New York, 2005. 10. G. Ding. Subgraphs and well-quasi-ordering. J. Graph Theory, 16(5):489–502, 1992. 11. M. Elberfeld, M. Grohe, and T. Tantau. Where first-order and monadic second- order logic coincide. In LICS’12, pages 265–274, 2012. 12. W. Espelage, F. Gurski, and E. Wanke. How to solve NP-hard graph problems on clique-width bounded graphs in polynomial time. In WG’01, volume 2204 of LNCS, pages 117–128. Springer, 2001.

24 13. M. Frick and M. Grohe. The complexity of first-order and monadic second-order logic revisited. Ann. Pure Appl. Logic, 130(1-3):3–31, 2004. 14. J. Gajarsk´y. Efficient solvability of graph MSO properties. Master’s thesis, Masaryk University, Brno, 2012. 15. J. Gajarsk´yand P. Hlinˇen´y. Faster deciding MSO properties of trees of fixed height, and some consequences. In FSTTCS, volume 18 of LIPIcs, pages 112–123, 2012. 16. R. Ganian. Thread graphs, linear rank-width and their algorithmic applications. In IWOCA’10, volume 6460 of LNCS, pages 38–42. Springer, 2010. 17. R. Ganian. Twin-cover: Beyond vertex cover in parameterized algorithmics. In IPEC’11, volume 7112 of LNCS, pages 259–271. Springer, 2012. 18. R. Ganian, P. Hlinˇen´y,and J. Obdrˇz´alek.Clique-width: When hard does not mean impossible. In STACS’11, volume 9 of LIPIcs, pages 404–415. Dagstuhl Publishing, 2011. 19. M. U. Gerber and D. Kobler. Algorithms for vertex-partitioning problems on graphs with fixed clique-width. Theoret. Comput. Sci., 299(1-3):719–734, 2003. 20. V. Giakoumakis and J.-M. Vanherpe. Bi-complement reducible graphs. Adv. Appl. Math., 18:389–402, 1997. 21. J. Gimbel and J. Neˇsetˇril. Partitions of graphs into cographs. Electron. Notes Discrete Math., 11(0):705–721, 2002. 22. J. Gimbel and J. Neˇsetˇril. Partitions of graphs into cographs. Discrete Math., 310(24):3437–3445, 2010. 23. P. Heggernes, D. Meister, and C. Papadopoulos. Characterising the linear clique- width of a class of graphs by forbidden induced subgraphs. Discrete Appl. Math., 160(6):888–901, 2012. 24. P. Hlinˇen´yand S. Oum. Finding branch-decomposition and rank-decomposition. SIAM J. Comput., 38:1012–1032, 2008. 25. C. Ho´angand V. Le. P4-free colorings and P4-bipartite graphs. Discrete Math. Theor. Comput. Sci., 4:109–122, 2001. 26. L.-J. Hung and T. Kloks. k-cographs are Kruskalian. Chic. J. Theoret. Comput. Sci., 2011:1–11, 2011. 27. O.¨ Johansson. Clique-decomposition, NLC-decomposition, and modular decompo- sition — relationships and results for random graphs. Congr. Numer., 132:39–60, 1998. 28. J. Kruskal. Well-quasi-ordering, the tree theorem, and Vazsonyi’s conjecture. Trans. Amer. Math. Soc., 95(2):210–225, 1960. 29. M. Lampis. Algorithmic meta-theorems for restrictions of treewidth. Algorithmica, 64(1):19–37, 2012. 30. M. Lampis. Model checking lower bounds for simple graphs. In ICALP’13, volume 7965 of LNCS, pages 673–683. Springer, 2013. 31. H. Lerchs. On cliques and kernels. Technical report, Department of Computer Science, University of Toronto, 1971. 32. H. Lerchs. On the clique-kernel structure of graphs. Technical report, Department of Computer Science, University of Toronto, 1972. 33. J. Neˇsetˇriland P. Ossona de Mendez. Grad and classes with bounded expansion I. Decompositions. European J. Combin., 29(3):760–776, 2008. 34. J. Neˇsetˇriland P. Ossona de Mendez. Sparsity (Graphs, Structures, and Algo- rithms), volume 28 of Algorithms and Combinatorics. Springer, 2012. 465 pages. 35. J. Neˇsetˇriland P. Ossona de Mendez. Tree-depth, subgraph coloring and homo- morphism bounds. European J. Combin., 27(6):1024–1041, 2006.

25 36. S. Oum and P. D. Seymour. Approximating clique-width and branch-width. J. Combin. Theory Ser. B, 96(4):514–528, 2006. 37. M. O. Rabin. A simple method for undecidability proofs and some applications. In Y. Bar-Hillel, editor, Logic, Methodology and Philosophy of Sciences, volume 1, pages 58–68. North-Holland, Amsterdam, 1964. 38. N. Robertson and P. D. Seymour. Graph minors. II. Algorithmic aspects of tree- width. J. Algorithms, 7(3):309–322, 1986. 39. P. Schaffer. Optimal node ranking of trees in linear time. Inform. Process. Lett., 33:91–96, 1989/90. 40. E. Wanke. k-NLC graphs and polynomial algorithms. Discrete Appl. Math., 54:251–266, 1994.

26