Emilie Diot
email: emilie.diot.pro@gmail.com

Marko Radovanović
email: markor@matf.bg.ac.rs

Nicolas Trotignon
email: nicolas.trotignon@ens-lyon.fr

Kristina Vušković
email: k.vuskovic@leeds.ac.uk

The (theta, wheel)-free graphs Part I: only-prism and only-pyramid graphs

Keywords:

Truemper configurations are four types of graphs (namely thetas, wheels, prisms and pyramids) that play an important role in the proof of several decomposition theorems for hereditary graph classes. In this paper, we prove two structure theorems: one for graphs with no thetas, wheels and prisms as induced subgraphs, and one for graphs with no thetas, wheels and pyramids as induced subgraphs. A consequence is a polynomial time recognition algorithms for these two classes. In Part II of this series we generalize these results to graphs with no thetas and wheels as induced subgraphs, and in Parts III and IV, using the obtained structure, we solve several optimization problems for these graphs.

Introduction

In this article, all graphs are finite and simple.

Figure 1: Pyramid, prism, theta and wheel (dashed lines represent paths)

A prism is a graph made of three node-disjoint chordless paths P 1 = a 1 . . . b 1 , P 2 = a 2 . . . b 2 , P 3 = a 3 . . . b 3 of length at least 1, such that a 1 a 2 a 3 and b 1 b 2 b 3 are triangles and no edges exist between the paths except those of the two triangles. Such a prism is also referred to as a 3P C(a 1 a 2 a 3 , b 1 b 2 b 3 ) or a 3P C(∆, ∆) (3PC stands for 3-path-configuration).

A pyramid is a graph made of three chordless paths P 1 = a . . . b 1 , P 2 = a . . . b 2 , P 3 = a . . . b 3 of length at least 1, two of which have length at least 2, node-disjoint except at a, and such that b 1 b 2 b 3 is a triangle and no edges exist between the paths except those of the triangle and the three edges incident to a. Such a pyramid is also referred to as a 3P C(b 1 b 2 b 3 , a) or a 3P C(∆, •).

A theta is a graph made of three internally node-disjoint chordless paths P 1 = a . . . b, P 2 = a . . . b, P 3 = a . . . b of length at least 2 and such that no edges exist between the paths except the three edges incident to a and the three edges incident to b. Such a theta is also referred to as a 3P C(a, b) or a 3P C(•, •).

A hole in a graph is a chordless cycle of length at least 4. Observe that the lengths of the paths in the three definitions above are designed so that the union of any two of the paths induce a hole. A wheel W = (H, c) is a graph formed by a hole H (called the rim) together with a node c (called the center ) that has at least three neighbors in the hole.

A 3-path-configuration is a a graph isomorphic to a prism, a pyramid or a theta. A Truemper configuration is a graph isomorphic to a prism, a pyramid, a theta or a wheel. They appear in a theorem of Truemper [36] that characterises graphs whose edges can be labeled so that all chordless cycles have prescribed parities (3-path-configurations seem to have first appeared in a paper Watkins and Mesner [START_REF] Watkins | Cycles and connectivity in graphs[END_REF]).

If G and H are graphs, we say that G contains H when H is isomorphic to an induced subgraph of G. We say that G is H-free if it does not contain H. We extend this to classes of graphs with the obvious meaning (for instance, a graph is (theta, wheel)-free if it does not contain a theta and does not contain a wheel).

Truemper configurations play an important role in the analysis of several important hereditary graph classes, as explained in a survey of Vušković [START_REF] Vušković | The world of hereditary graph classes viewed through Truemper configurations[END_REF]. Let us simply mention here that many decomposition theorems for classes of graphs are proved by studying how some Truemper configuration contained in the graph attaches to the rest of the graph, and often, the study relies on the fact that some other Truemper configurations are excluded from the class. The most famous example is perhaps the class of perfect graphs. In these graphs, pyramids are excluded, and how a prism contained in a perfect graphs attaches to the rest of the graph is important in the decomposition theorem for perfect graphs, whose corollary is the celebrated Strong Perfect Graph Theorem due to Chudnovksy, Robertson, Seymour and Thomas [START_REF] Chudnovsky | The strong perfect graph theorem[END_REF]. See also [START_REF] Trotignon | Perfect graphs: a survey[END_REF] for a survey on perfect graphs, where a section is specifically devoted to Truemper configurations. But many other examples exist, such as the seminal class of chordal graphs [START_REF] Dirac | On rigid circuit graphs[END_REF] (containing no holes and therefore no Truemper configurations), universally signable graphs [START_REF] Conforti | Universally signable graphs[END_REF] (which is exactly the class of graphs containing no Truemper configurations), evenhole-free graphs [START_REF] Conforti | Even-holefree graphs Part I: Decomposition theorem[END_REF][START_REF] Kloks | Even-hole-free graphs that do not contain diamonds: A structure theorem and its consequences[END_REF] (containing pyramids but not containing thetas and prisms), cap-free graphs [START_REF] Conforti | Even and odd holes in cap-free graphs[END_REF] (not containing prisms and pyramids, but containing thetas), ISK4-free graphs [START_REF] Lévêque | On graphs with no induced subdivision of K 4[END_REF] (containing prisms and thetas but not containing pyramids), chordless graphs [START_REF] Machado | Edgecolouring and total-colouring chordless graphs[END_REF] (containing no prisms, pyramids and wheels, but containing thetas), (theta, triangle)-free graphs [START_REF] Radovanović | A class of three-colorable trianglefree graphs[END_REF] (containing no prisms, pyramids and thetas), claw-free graphs [START_REF] Chudnovsky | The structure of claw-free graphs[END_REF] (containing prisms, but not containing pyramids and thetas) and bull-free graphs [START_REF] Chudnovsky | The structure of bull-free graphs II and III -a summary[END_REF] (containing thetas and the prism on six nodes, but not containing pyramids and prisms on at least 7 nodes). In most of these classes, some wheels are allowed and some are not. In some of them (notably perfect graphs and even-hole-free graphs), the structure of a graph containing a wheel is an important step in the study of the class. Let us mention that the classical algorithm LexBFS produces an interesting ordering of the nodes in many classes of graphs where some well-chosen Truemper configurations are excluded [START_REF] Aboulker | Vertex elimination orderings for hereditary graph classes[END_REF]. Let us also mention that many subclasses of wheel-free graphs are well studied, namely unichord-free graphs [START_REF] Trotignon | A structure theorem for graphs with no cycle with a unique chord and its consequences[END_REF], graphs that do not contain K 4 or a subdivision of a wheel as an induced subgraph [START_REF] Lévêque | On graphs with no induced subdivision of K 4[END_REF], graphs that do not contain K 4 or a wheel as a subgraph [START_REF] Thomassen | Non-separating induced cycles in graphs[END_REF][START_REF] Aboulker | On wheel-free graphs[END_REF], propeller-free graphs [START_REF] Aboulker | Graphs that do not contain a cycle with a node that has at least two neighbors on it[END_REF], graphs with no wheel or antiwheel [START_REF] Maffray | Graphs with no induced wheel and no induced antiwheel[END_REF] and planar wheel-free graphs [START_REF] Aboulker | Wheelfree planar graphs[END_REF].

All these examples suggest that a systematic study of classes of graphs defined by excluding Truemper configurations is of interest. It might shed a new light on all the classes mentioned above and be interesting in its own right. In this paper we study two of such classes. Since there are four types of Truemper configurations, there are potentially 2 4 = 16 classes of graphs defined by excluding them (such as prism-free graphs, (theta, wheel)-free graphs, and so on). In one of them, none of the Truemper configurations are excluded, so it is the class of all graphs. We are left with 15 non-trivial classes where at least one type of Truemper configuration is excluded. One case is when all Truemper configurations are excluded. This class is known as the class of universally signable graphs [START_REF] Conforti | Universally signable graphs[END_REF] and it is well studied: its structure is fully described, and many difficult problems such as graph coloring, and the maximum clique and stable set problems can be solved in polynomial time for this class (see [START_REF] Aboulker | Vertex elimination orderings for hereditary graph classes[END_REF] for the most recent algorithms for them). So we are left with 14 classes of graphs, and to the best of our knowledge, they were not studied so far, except for one aspect: the complexity of the recognition problem is known for 11 of them. Let us survey this.

It is convenient to sum up in a table all the 16 classes. In Table 1, each line of the table represents a class of graphs defined by excluding some Truemper configurations. The first four columns indicate which Truemper configurations are excluded and which are allowed. The last columns indicates the complexity of the recognition algorithm and a reference to the paper where this complexity is proved. Lines with a reference to a theorem indicate a result proved here. For instance line 5 of the table should be read as follows: the complexity of deciding whether a graph is in the class of (theta, prism)-free graphs is O(n 35 ) (throughout the paper, n stands for the number of nodes, and m for the number of edges of the input graph). Observe that a recognition algorithm for (theta, prism)-free graphs is equivalent to an algorithm to decide whether a graph contains a theta or a prism. Note that all the proofs of NP-completeness rely on a variant of a classical construction of Bienstock [START_REF] Bienstock | On the complexity of testing for odd holes and induced odd paths[END_REF].

As already stated, 13 of the recognition problems of Table 1 are solved in previous work. In this paper and its subsequent part [START_REF] Radovanović | The (theta, wheel)free graphs, Part II: structure theorem[END_REF] we resolve the complexity of recognition of the remaining three classes. In this paper we give a polynomial time recognition algorithm for the following two classes: (theta, wheel, pyramid)-free and (theta, wheel, prism)-free graphs. In the first class, the only allowed Truemper configurations are prisms, and in the second, the only ones are pyramids. We therefore use the names only-prism and only-pyramid for these two classes. The last problem from Table 1, namely the recognition of (theta, wheel)-free graphs, a similar approach is successful while being more complicated. This class is studied in a subsequent paper by the last three authors [START_REF] Radovanović | The (theta, wheel)free graphs, Part II: structure theorem[END_REF].

For each class, our recognition algorithm relies on a decomposition theo- rem for the class. In each case, this theorem fully describes the structure of the most general graph in the class, and could therefore be used to provide algorithms for several combinatorial optimisation problems. This is done in Parts III and IV of this series (see [START_REF] Radovanović | The (theta, wheel)free graphs, Part III: cliques, stable sets and coloring[END_REF] and [START_REF] Radovanović | The (theta, wheel)free graphs, Part IV: induced cycles and paths[END_REF]), where polynomial-time algorithms for finding maximum weighted clique and stable set, for optimal coloring and for induced version of k-linkage problem (for k fixed) are obtained for the class of (theta,wheel)-free graphs. We note that among the 16 classes described in Table 1, only universally signable graphs (line 0 from the table) have a (previously known) decomposition theorem. All the other (previously known) polynomial time algorithms mentioned in Table 1 are based on a direct algorithm to detect the obstruction.

In Section 2, we give some notation and we describe the results, in particular we state precisely the decomposition theorems proved in the rest of the paper. In Section 3, we prove several lemmas needed in many places. In Section 4, we prove the decomposition theorem for only-prism graphs. In Section 5, we prove the decomposition theorem for only-pyramid graphs (note that the proof relies mostly on theorems proved previously in [START_REF] Kloks | Even-hole-free graphs that do not contain diamonds: A structure theorem and its consequences[END_REF]). In Section 6, we prove that the 2-joins (a decomposition defined in the next section) that actually occur in our classes of graph have a special struc-ture. In Section 7, we describe the recognition algorithms and show how the decomposition theorems that we prove can be transformed into structure theorems.

Main results

A path P is a sequence of distinct nodes p 1 p 2 . . . p k , k ≥ 1, such that p i p i+1 is an edge for all 1 ≤ i < k. Edges p i p i+1 , for 1 ≤ i < k, are called the edges of P . Nodes p 1 and p k are the ends of P . A cycle C is a sequence of nodes p 1 p 2 . . . p k p 1 , k ≥ 3, such that p 1 . . . p k is a path and p 1 p k is an edge. Edges p i p i+1 , for 1 ≤ i < k, and edge p 1 p k are called the edges of C. Let Q be a path or a cycle. The node set of Q is denoted by V (Q). The length of Q is the number of its edges. An edge e = uv is a

chord of Q if u, v ∈ V (Q), but uv is not an edge of Q. A path or a cycle Q in a graph G is chordless if no edge of G is a chord of Q.
For a path P and u, v ∈ V (P ), we denote with uP v the chordless path in P from u to v.

A subset S of nodes of a graph G is a cutset if G \ S is disconnected. A clique in a graph is a (possibly empty) set of pairwise adjacent vertices. A clique on k nodes is denoted by K k . A K 3 is also referred to as a triangle, and is denoted by ∆. A node cutset S is a clique cutset if S is a clique. Note that in particular the empty set is a clique and that a disconnected graph has a clique cutset (the empty set).

Our main results are generalizations of the next two theorems. A graph is chordal if it is hole-free.

Theorem 2.1 (Dirac [START_REF] Dirac | On rigid circuit graphs[END_REF]) A chordal graph is either a clique or has a clique cutset. Theorem 2.2 (Conforti, Cornuéjols, Kapoor, Vušković [START_REF] Conforti | Universally signable graphs[END_REF]) A (theta, wheel, pyramid, prism)-free graph is either a clique or a hole, or has a clique cutset.

To state the next theorem, we need the notion of a line graph. If R is a graph, then the line graph of R is the graph G whose nodes are the edges of R and such that two nodes of G are adjacent in G whenever they are adjacent edges of R. We write G = L(R).

We need several results about line graphs. A diamond is a graph obtained from a K 4 by deleting an edge. A claw is a graph induced by nodes u, v 1 , v 2 , v 3 and edges uv 1 , uv 2 , uv 3 .

Theorem 2.3 (Harary and Holzmann [START_REF] Harary | Line graphs of bipartite graphs[END_REF]) A graph is (claw, diamond)-free graph if and only if it is the line graph of a trianglefree graph.

The following characterises the line graphs that actually appear in our classes. A graph G is chordless if every cycle of G is chordless. Note that chordless graphs have a full structural description not needed here and explained in [START_REF] Aboulker | Graphs that do not contain a cycle with a node that has at least two neighbors on it[END_REF].

Lemma 2.4 For a graph G, the following three conditions are equivalent.

(i) G is a (wheel, diamond)-free line graph.

(ii) G is the line graph of a triangle-free chordless graph.

(iii) G is (wheel, diamond, claw)-free.

proof -(i)→(ii). Let R be such that G = L(R). For every connected component of R that is isomorphic to a triangle, we erase the triangle and replace it by a claw. This yields a graph R and G = L(R ) = L(R) because a claw and a triangle have the same line graph. We claim that R is trianglefree, so suppose for a contradiction that R contains a triangle T = abc. By the construction of R , T is not a connected component of R , so there exists a node d not in T with a neighbor in T , say a. Now the edges ab, bc, ac, da of R induce a diamond in G, a contradiction. Also R is chordless because the edge set of a cycle together with a chord of that cycle in R yields a wheel in L(R ) (centred at the chord).

(ii)→(iii). Since G is the line graph of a triangle-free graph R, by Theorem 2.3, G is (diamond, claw)-free. Suppose for a contradiction that G contains a wheel (H, c). Let H = v 1 . . . v k v 1 . So, in R and with subscripts taken modulo k, v 1 , . . . , v k are edges of R, and for i = 1, . . . , k, v i is adjacent to v i+1 and v i-1 , and to no other edges among the v j 's since H is a hole. It follows that v 1 , . . . , v k are the edges of a cycle C of R. Now, c is an edge of R that is adjacent to at least three edges of C. It is therefore a chord of C, a contradiction.

(iii)→(i). Since G is (diamond, claw)-free, it is a line graph by Theorem 2.3, and it is (wheel, diamond)-free by assumption.

2

Our first decomposition theorem is the following. The proof is given in Section 4. Note that by Lemma 2.4, the line graph of a triangle-free chordless graph is only-prism (because every pyramid and every theta contains a claw).

Theorem 2.5 If G is an only-prism graph, then G is the line graph of a triangle-free chordless graph or G admits a clique cutset.

To state the next theorem, we need a new basic class and a new decomposition that we define now. We start with the basic class.

An edge of a graph is pendant if one of its ends has degree 1. Two pendant edges of a tree T are siblings if the unique path of T linking them contains at most one node of degree at least 3. A tree is safe if for every node u of degree 1, the neighbor v of u has degree at most 2 and uv has at most one sibling. A pyramid-basic graph is any graph G constructed as follows:

• Consider a safe tree T and give to each pendant edge of T a label x or y, in such a way that for every pair of siblings, distinct labels are given to the members of the pair.

• Build the line graph L(T ), and note that since the nodes of L(T ) are the edges of T , some nodes of L(T ) have a label (they are the nodes of degree 1 of L(T )).

• Construct G from L(T ) by adding a node x adjacent to every node with label x, and a node y adjacent to x and to every node with label y.

Lemma 2.6 Every pyramid-basic graph is only-pyramid.

proof -Let G be constructed as above.

Since L(T ) is claw-free by Theorem 2.3, and every node of L(T ) with a label has degree 1 in L(T ) and degree 2 in G, we see that no node in G apart from x and y can be the center of a claw. It follows that the centers of claws in G form a clique, so G cannot contain a theta.

Suppose for a contradiction that G contains a prism, say a 3PC(a 1 a 2 a 3 , b 1 b 2 b 3 ). Note that x and y are not contained in any triangle of G, so

a 1 , a 2 , a 3 , b 1 , b 2 , b 3 are all members of L(T ). In T , a 1 , a 2 ,
. So, {e, x, y} is a node-cut of L(T ) that separates {a 1 , a 2 , a 3 } \ {e} from {b 1 , b 2 , b 3 } \ {e}.
It follows that one path of the prism goes through x while another path goes through y. This is a contradiction since x and y are adjacent.

To prove that G is wheel-free, we study the holes of G. Let H be a hole of G. Since L(T ) contains no hole, H must contain x or y. If it contains exactly one of them, say x up to symmetry, then H = xp 1 . . . p k x and p 1 and p k have degree 1 in L(T ). Since all neighbors of y in L(T ) have degree 1 in L(T ), y has no neighbor in H \ x. A node of L(T ) not in H is an edge of T that can be adjacent (in T ) to at most two edges among p 1 , . . . , p k (that are indeed edges of T ). And if it is adjacent to two edges, it is a non-pendant node in L(T ), so it is non-adjacent to x. It follows that no node of G can be the center of wheel with rim H.

If H goes through x and y, then again H = xyp 1 . . . p k x and p 1 and p k have degree 1 in L(T ). As above, no node of G can have three neighbors in H. It follows that G is wheel-free.

2

We now define a decomposition that we need. A graph G has an almost 2-join (X 1 , X 2 ) if V (G) can be partitioned into sets X 1 and X 2 so that the following hold:

• For i = 1, 2, X i contains disjoint nonempty sets A i and B i , such that every node of A 1 is adjacent to every node of A 2 , every node of B 1 is adjacent to every node of B 2 , and there are no other adjacencies between X 1 and X 2 .

• For i = 1, 2, |X i | ≥ 3. An almost 2-join (X 1 , X 2 ) is a 2-join when for i = 1, 2, X i contains at least one path from A i to B i , and if |A i | = |B i | = 1 then G[X i ] is not a chordless path.
We say that (X 1 , X 2 , A 1 , A 2 , B 1 , B 2 ) is a split of this 2-join, and the sets A 1 , A 2 , B 1 , B 2 are the special sets of this 2-join. We often use the following notation:

C i = X i \ (A i ∪ B i ) (possibly, C i = ∅).
A pyramid is long if all of its paths are of length at least 2 (note that the long pyramids are precisely the wheel-free pyramid). Our second decomposition theorem is the following. It is proved in Section 5.

Theorem 2.7 An only-pyramid graph is either one of the following graphs:

• a clique, • a hole, • a long pyramid, or • a pyramid-basic graph,
or it has a clique cutset or a 2-join.

In Section 7, we will show that the two theorems above in fact lead to structure theorems: they can be turned into a method that actually allows us to build every graph in the class that they describe.

Preliminary lemmas

Lemma 3.1 If G is a diamond-free graph then every edge of G is contained in a unique maximal clique of G.

proof -An edge uv is obviously in at least one maximal clique. If it is not unique, then let K and K be two distinct maximal cliques containing uv. Since by maximality K ⊆ K , there exists w ∈ K \ K . By the maximality of K , there exists in K a non-neighbor w of w. So, {u, v, w, w } induces a diamond, a contradiction.

2

When C and H are two disjoint sets of nodes of a graph (or induced subgraphs), we say that C is H-complete, if every node of C is adjacent to every node of H. Lemma 3.2 If G is a wheel-free graph that contains a diamond, then G has a clique cutset.

proof -Let K be a clique of size at least 2 in G, such that there exist two nodes in G \ K, non-adjacent and K-complete. Observe that K exists because G contains a diamond. Suppose that K is maximal with respect to this property. We now prove that K is a clique cutset of G. Otherwise, for every pair a, b ∈ V (G) \ K of non-adjacent K-complete nodes there exists a path P from a to b in G \ K. Let (a, b, P ) be a triple as above and chosen subject to the minimality of P . If no internal node of P has a neighbor in K, then for any pair x, y ∈ K, V (P ) ∪ {x, y} induces a wheel, a contradiction. So, let c be the internal node of P closest to a along P that has a neighbor x in K. We claim that c has a non-neighbor y in K. Otherwise, one of the triple (a, c, aP c) or (c, b, cP b) contradicts the minimality of P , unless P has length 2. In this case, K ∪ {c} contradicts the maximality of K. So, our claim is proved. Let d be the neighbor of y in P closest to c along P (note that c = d, so ydP ay has length at least 4). Now, (ydP ay, x) is a wheel, a contradiction.

2

A star cutset in a graph is a node-cutset S that contains a node (called a center ) adjacent to all other nodes of S. Note that a nonempty clique cutset is a star cutset. proof -Let S be a star cutset centred at x, and assume that it is a minimal such cutset, i.e. no proper subset of S is a star cutset of G centred at x. We now show that S induces a clique. Assume not, and let u and v be two nonadjacent nodes of S. Let C 1 and C 2 be two of the connected components of G\S. By the choice of S, both u and v have neighbors in both C 1 and C 2 . So for i = 1, 2, there is a chordless uv-path 4 Only-prism graphs

P i in G[C i ∪ {u, v}]. But then P 1 ∪ P 2 ∪ x induces
In this section we prove Theorem 2.5.

Lemma 4.1 Let G be an only-prism graph. Suppose that G contains two chordless paths P = x P . . . y P and Q = x Q . . . z Q , of length at least 1, node disjoints, with no edges between them. Suppose x, y, z / ∈ V (P ) ∪ V (Q) are pairwise adjacent and such that N (x)

∩ (V (P ) ∪ V (Q)) = {x P , x Q }, N (y) ∩ (V (P ) ∪ V (Q)) = {y P } and N (z) ∩ (V (P ) ∪ V (Q)) = {z Q }. Then, G has a clique cutset.
proof -By Lemma 3.2, we may assume that G is diamond-free. So, by Lemma 3.1, there exists a unique maximal clique K of G that contains x, y and z. Suppose that K is not a clique cutset. So, G \ K contains a shortest path R = u . . . v such that u has a neighbor in P , and v has a neighbor in Q. From the minimality of R, R \ u has no neighbors in P and R \ v has no neighbors in Q. We set P x = xx P P y P , P y = yy P P x P ,

Q x = xx Q Qz Q , Q z = zz Q Qx Q . Let u x (
resp. u y ) be the neighbor of u in P x (resp. in P y ) closest to x (resp. to y) along P x (resp. along P y ). Let v x (resp. v z ) be the neighbor of v in Q x (resp. in Q z ) closest to x (resp. to z) along Q x (resp. along Q z ). By Lemma 3.4 applied to u and the hole xx P P y P yx, either u x = u y and u x / ∈ {x, y}, or u x u y ∈ E(G) and {u x , u y } = {x, y}. Similarly, either v x = v z and v x / ∈ {x, z}, or v x v z ∈ E(G) and {v x , v z } = {x, z}.

Note that every node of R has at most one neighbor in {x, y, z} because G is diamond-free and K is maximal. Suppose that x has a neighbor r ∈ R. Let Y be a shortest path from r to y in (uRr) ∪ P y , and Z a shortest path from r to z in (rRv) ∪ Q z . Since Y ∪ Z ∪ {x} cannot induce a wheel with center x, w.l.o.g. y has a neighbor in Z ∩ R. Let y be such a neighbor closest to r. Note that y = r. Let H be the hole induced by Y and rRy . Then x and H contradict Lemma 3.4. So x has no neighbor in R, and in particular x / ∈ {u x , v x }. Now let H be the hole induced by xP x u x , xQ x v x and R. If y has a neighbor r in R, then since x is not adjacent to r, hole H and node y contradict Lemma 3.4. Therefore y has no neighbors in R, and by symmetry neither does z.

If u x u y ∈ E(G), then the three paths xQ x v x vRu, xP x u x and xyP y u y form a pyramid, a contradiction. Therefore, as noted above, u x = u y and u x / ∈ {x, y}. If u x x ∈ E(G) then R, P y and v z Q z z form the rim of a wheel centered at x. So, u x x / ∈ E(G). It follows that the three paths u x P x x, u x P y yx and u x uRvv x Q x x form a theta, a contradiction. 2

Lemma 4.2 Let G be an only-prism graph. Suppose that G contains two chordless paths P = x P . . . y P and Q = x Q . . . y Q , of length at least 1, node disjoints, with no edges between them. Suppose x, y / ∈ V (P ) ∪ V (Q) are adjacent and such that N (x) ∩ (V (P ) ∪ V (Q)) = {x P , x Q } and N (y) ∩ (V (P ) ∪ V (Q)) = {y P , y Q }. Then, G has a clique cutset.

proof -By Lemma 3.2, we may assume that G is diamond-free. So, by Lemma 3.1 there exists a unique maximal clique K of G that contains x and y. Observe that all common neighbors of x and y are in K. Suppose that K is not a clique cutset. So, G \ (H ∪ K) contains a shortest path R = u . . . v such that u has a neighbor in P , and v has a neighbor in Q. We suppose that P, Q, R are minimal w.r.t. all the properties above.

From the minimality of R, R \ u has no neighbors in P and R \ v has no neighbors in Q. We set P x = xx P P y P , P y = yy P P x P ,

Q x = xx Q Qy Q , Q y = yy Q Qx Q . Let u x (
resp. u y ) be the neighbor of u in P x (resp. in P y ) closest to x (resp. to y) along P x (resp. along P y ). Let v x (resp. v y ) be the neighbor of v in Q x (resp. in Q y ) closest to x (resp. to y) along Q x (resp. along Q y ). By Lemma 3.4 applied to u and the hole xx P P y P yx, either u x = u y and u x / ∈ {x, y}, or u x u y ∈ E(G) and {u x , u y } = {x, y}. Similarly, either v x = v y and v x / ∈ {x, y}, or v x v y ∈ E(G) and {v x , v y } = {x, y}. Suppose that both x and y have neighbors in the interior of R. So, there is a shortest path R in the interior of R linking a neighbor r of x to a neighbor r of y. Observe that R has length at least 1, because every common neighbor of x and y is in K. Hence, P, R , uRr contradict the minimality of P, Q, R. So, we may assume up to symmetry that y has no neighbor in the interior of R. If x has a neighbor in the interior of R, in particular R has length at least 2, so yP y u y uRvv y Q y y is a hole, and x has two non-adjacent neighbors in it (namely y and some internal node of R), a contradiction to Lemma 3.4. Hence, x and y have no neighbors in the interior of R.

Suppose that u x u y ∈ E(G).

If u x = x, then u y = y and (u y uRvv y Q y yP y u y , x) is a wheel, a contradiction. So, u x = x. By symmetry it follows that u (resp. v) is not adjacent to x nor y. Since Q has length at least 1, it is impossible that v x y ∈ E(G) and v y x ∈ E, so suppose up to symmetry that v y x / ∈ E(G). The three paths yQ y v y vRu, yxP x u x and yP y u y form a pyramid, a contradiction. Therefore, as noted above, u x = u y and u x / ∈ {x, y}. Similarly, v x = v y and v x / ∈ {x, y}. We may assume w.l.o.g. that u x x / ∈ E(G). If v x y ∈ E(G) then the three paths xP x u x , xyP y u x and xQ x v x vRuu x form a theta, a contradiction. So v x y ∈ E(G), and by symmetry it follows that u x y ∈ E(G). But then P , Q, R and {x, y} induce a wheel with center y, a contradiction. 2 proof -Let y be the unique neighbor of x in H. If y is not a cutnode of G, then some path P = u . . . v of G \ (H ∪ {x}) is such that u is adjacent to x, and v has a neighbor in H \ y. We suppose that H, x, P are minimal subject to all the properties above. Suppose that some node v of P is adjacent to y. If v = v, then by the minimality of P , v has a unique neighbor in H, so H, v , v P v contradicts the minimality of H, x, P . So, v = v and by Lemma 3.4, v is adjacent to a neighbor z of y in H. If u = v, then {x, y, z, u} induces a diamond, so G has a clique cutset by Lemma 3.2. If u = v, then by Lemma 4.1, G has a clique cutset. Hence, we may assume that no node of P is adjacent to y.

If v has two adjacent neighbors in H, then x, P and H form a pyramid. So, by Lemma 3.4, v has a unique neighbor in H. If this neighbor is not adjacent to y, then x, P and H form a theta. Otherwise, G has a clique cutset by Lemma 4.2.

2

Proof of Theorem 2.5: Assume G has no clique cutset. Then by Lemma 3.2, G does not contain a diamond and by Lemma 2.4, we may assume that G contains a claw {v, x, y, z} centered at v. Since v cannot be a cut node, there exists a path P in G \ v whose endnodes are distinct nodes of {x, y, z}. We assume that x, y, z, P are chosen subject to the minimality of P . W.l.o.g. P is a path from x to y, and by the minimality of P , it does not go through z. Suppose that no internal node of P is adjacent to v. Then P ∪ {v} induces a hole H. By Lemma 3.4, v is the unique neighbor of z in H. But this contradicts Lemma 4.3. Therefore an internal node of P is adjacent to v.

Let v be any internal node of P that is adjacent to v. We now show that N (v ) ∩ {x, y, z} = {z}. Since G does not contain a diamond, w.l.o.g. v is not adjacent to x. If z is not adjacent to v , then x, v , z and xP v contradict our choice of x, y, z and P . So z is adjacent to v . Since {v, y, v , z} does not induce a diamond, it follows that v is not adjacent to y. So, as claimed N (v ) ∩ {x, y, z} = {z}. Now, {v, x, y, v } is a claw centered at v and the path xP v contradicts the minimality of x, y, z and P . 2

Only-pyramid graphs

In this section we prove Theorem 2.7. The proof mostly relies on previously proved theorems and some terminology is needed to state them. We say that a clique is big if it is of size at least 3. Let L be the line graph of a tree. By Theorem 2.3 and Lemma 3.1, every edge of L belongs to exactly one maximal clique, and every node of L belongs to at most two maximal cliques. The nodes of L that belong to exactly one maximal clique are called leaf nodes. In the graph obtained from L by removing all edges in big cliques, the connected components are chordless paths (possibly of length 0). Such a path is an internal segment if it has its endnodes in distinct big cliques (when P is of length 0, it is called an internal segment when the node of P belongs to two big cliques). The other paths P are called leaf segments. Note that one of the endnodes of a leaf segment is a leaf node.

A nontrivial basic pyramid graph R is defined as follows: R contains two adjacent nodes x and y, called the special nodes. The graph L induced by R \ {x, y} is the line graph of a tree and contains at least two big cliques. In R, each leaf node of L is adjacent to exactly one of the two special nodes, and no other node of L is adjacent to the special nodes. Furthermore, no two leaf segments of L with leaf nodes adjacent to the same special node have their other endnode in the same big clique (this is referred to in the rest of the section as the uniqueness condition). The internal segments of R are the internal segments of L, and the leaf segments of R are the leaf segments of L together with the node in {x, y} to which the leaf segment is adjacent to. R is long if all the leaf segments are of length greater than 1.

An extended nontrivial basic pyramid graph is any graph R * obtained from a nontrivial basic pyramid graph R with special nodes x and y by adding nodes u 1 , . . . , u k satisfying the following: for every i = 1, . . . , k, there exists a big clique K i of R and some

z i ∈ {x, y} such that N (u i ) ∩ V (R) = V (K i ) ∪ {z i }.
Note that u i is the center of a wheel of R.

A wheel (H, x) is an even wheel if x has an even number of neighbors on H. A node cutset S of a graph G is a bisimplicial cutset if for some x ∈ S, S ⊆ N (x) ∪ {x} and S \ {x} is a disjoint union of two cliques.

Theorem 5.1 (Kloks, Müller, Vušković [START_REF] Kloks | Even-hole-free graphs that do not contain diamonds: A structure theorem and its consequences[END_REF]) A connected (diamond, 4hole, prism, theta, even wheel)-free graph is either one of the following graphs:

• a clique,

• a hole, proof -Let H = x 1 x 2 x 3 x 4 x 1 be a 4-hole of G, and assume that G = H. Let C be a connected component of G \ H. Suppose that two nonadjacent nodes of H, say x 1 and x 3 , both have a neighbor in C. Let P be a path in C such that x 1 P x 3 is a chordless path. W.l.o.g. we may assume that P is minimal such path. Suppose that both x 2 and x 4 have a neighbor in P . Then, by the choice of P and since G is wheel-free, P is of length at least 1, x 2 and x 4 are adjacent to different endnodes of P , and they each have a unique neighbor in P . But then P ∪ H induces a prism. So w.l.o.g. x 2 does not have a neighbor in P . But then P ∪ H induces a theta or a wheel. Therefore, for some edge uv of H, N (C) ∩ H = {u, v}, and so G has a clique cutset.

2

Proof of Theorem 2.7: Let G be an only-pyramid graph that does not have a clique cutset and is not a hole. By Lemmas 3.2 and 5.2, G is (diamond, 4-hole)-free. Since a bisimplicial cutset is a star cutset, by Theorem 5.1 and Lemma 3.3, it is enough to show that if G is an extended nontrivial basic pyramid graph, then it is pyramid-basic.

As noted above, if a wheel-free graph G is an extended nontrivial basic pyramid graph, then it is a long nontrivial basic pyramid graph. So, G is obtained from the line graph of a tree T by adding two nodes x and y as explained above.

Let us check that T is safe. First, note that by the uniqueness condition in the definition of nontrivial basic pyramid graphs, it cannot be that more than two leaf segments have the non-leaf end in the same big clique. This means that in T , there does not exists three pendant edges that are siblings, every pendant edge of T has at most one sibling. To check that T is safe, it remains to check that for every node u of degree 1, the neighbor v of u has degree at most 2. So, suppose for a contradiction that T contains a node u of degree 1 whose neighbor v has degree at least 3. So, the edge uv is a node c of L(T ). Node c is a leaf node of L(T ), so it must be adjacent to x or y, say to x. Also, c is adjacent to two nodes a, b of some big clique of G. Since edge c of T has at most one sibling, we may assume up to symmetry that a is the end of an internal segment of L(T ). So, there are two node-disjoint paths P = a . . . x and Q = y . . . b in L(T ): P starts by the internal segment ending at a, reaches another big clique, and then any leaf segment in that part of the tree with an end x, while Q starts from the segment ending at b (if it is a leaf segment, it is linked to y by the uniqueness condition, otherwise, it can be linked to x or y, and we choose y). The union of P and Q forms a hole, and c has three neighbors in that hole, namely a, b and x. This proves that T is safe. Now, the uniqueness condition shows that G is in fact a pyramid-basic graph. 2

2-joins

In this section, we describe more closely the structure of the 2-joins and the almost 2-joins that actually occur in our classes of graphs. An almost 2-join with a split (

X 1 , X 2 , A 1 , A 2 , B 1 , B 2 ) in a graph G is consistent if the following statements hold for i = 1, 2: (i) Every component of G[X i ] meets both A i , B i .
(ii) Every node of A i has a non-neighbor in B i .

(iii) Every node of B i has a non-neighbor in A i .

(iv) Either both A 1 , A 2 are cliques, or one of A 1 or A 2 is a single node, and the other one is a disjoint union of cliques.

(v) Either both B 1 , B 2 are cliques, or one of B 1 , B 2 is a single node, and the other one is a disjoint union of cliques.

(vi) G[X i ] is connected.

(vii) For every node v in X i , there exists a path in G[X i ] from v to some node of B i with no internal node in A i .

(viii) For every node v in X i , there exists a path in G[X i ] from v to some node of A i with no internal node in B i .

Note that the definition contains redundant statements (for instance, (vi) implies (i)), but it is convenient to list properties separately as above. Lemma 6.1 If G is a (theta, wheel)-free graph with no clique cutset, then every almost 2-join of G is consistent. proof -By Lemma 3.2, G contains no diamond, and by Lemma 3.3, it has no star cutset. This is going to be used repeatedly in the proofs below. Let (X 1 , X 2 , A 1 , A 2 , B 1 , B 2 ) be a split of an almost 2-join of G.

To prove (i), suppose for a contradiction that some connected component C of G[X 1 ] does not intersect B 1 (the other cases are symmetric). If there is a node c ∈ C \ A 1 then for any node u ∈ A 2 , we have that {u} ∪ A 1 is a star cutset that separates c from

B 1 . So, C ⊆ A 1 . If |A 1 | ≥ 2 then pick any node c ∈ C and a node c = c in A 1 . Then {c } ∪ A 2 is a star cutset that separates c from B 1 . So, C = A 1 = {c}.
Hence, there exists some component of G[X 1 ] that does not intersect A 1 , so by the same argument as above we deduce |B 1 | = 1 and the unique node of B 1 has no neighbor in

X 1 . Since |X 1 | ≥ 3, there is a node u in C 1 . For any node v in X 2 , {v} is a star cutset of G that separates u from A 1 , a contradiction.
To prove (ii) and (iii), consider a node a ∈ A 1 complete to B 1 (the other cases are symmetric).

If A 1 ∪ C 1 = {a} then B 1 ∪ A 2 ∪ {a} is a star cutset that separates (A 1 ∪ C 1 ) \ {a} from B 2 , a contradiction. So, A 1 ∪ C 1 = {a} and |B 1 | ≥ 2 because |X 1 | ≥ 3. Let b = b ∈ B 1 . So, {b, a} ∪ B 2 is a star cutset that separates b from A 2 , a contradiction.
We now prove (iv). If |A i | = 1 then A 3-i contains no path of length 2 since G contains no diamond. It follows that A 3-i is a disjoint union of cliques. We may therefore assume that |A 1 |, |A 2 | ≥ 2. If A i is not a clique, then it contains two non-adjacent nodes that form a diamond together with any edge of A 3-i . It follows that A 3-i is a stable set, and by symmetry, so is A i . Since K 2,3 is a theta, we have

|A 1 | = |A 2 | = 2.
Let A 1 = {a 1 , a 1 } and A 2 = {a 2 , a 2 }. Suppose that a 1 and a 1 are in the same connected component of G[X 1 ]. Then, a path of G[X 1 ] from a 1 to a 1 together with a 2 and a 2 form a theta, a contradiction. It follows that a 1 and a 1 are in different connected components of G[X 1 ]. By (i), it follows that G[X 1 ] has precisely two connected components. By the same argument, G[X 2 ] also has precisely two connected components. It follows that |B 1 |, |B 2 | ≥ 2, and by the same proof as in the paragraph above, B 1 and B 2 are stable sets of size 2. By (i), there is a chordless path P 1 in G[X 1 ] from a 1 to some node of B 1 , that we denote by b 1 . There are similar paths P 1 = a 1 . . . b 1 , P 2 = a 2 . . . b 2 and P 2 = a 2 . . . b 2 . If P 1 has length at least 2 (meaning that a 1 and b 1 are non-adjacent), then {a 1 , a 1 , b 1 } ∪ V (P 2 ) ∪ V (P 2 ) contains a 3P C(a 2 , a 2 ). Therefore P 1 has length 1, and by symmetry so do P 1 , P 2 and P 2 . But then {a 1 , a 1 , a 2 , a 2 , b 1 , b 1 , b 2 } induces a wheel with center a 2 , a contradiction. This completes the proof of (iv) and the proof of (v) is similar.

To prove (vi) suppose by contradiction and up to symmetry that G[X 1 ] is disconnected. By (i), G[A 1 ] and G[B 1 ] must be disconnected, so by (iv) and (v), they are disjoint union of cliques and A 2 and B 2 are both made of a single node, say a 2 and b 2 respectively. By (i) there exists a chordless path P in G[X 2 ] from a 2 to b 2 . By (ii) this path is of length at least 2. Therefore, by considering three paths from a 2 to b 2 (one that goes through a component of X 1 , one that goes through another component of X 1 , and P ), we obtain a theta, a contradiction. Suppose (vii) does not hold. So, up to symmetry there exists a node v ∈ X 1 such that every path in G[X 1 ] from v to B 1 has an internal node in A 1 . Note in particular that v / ∈ B 1 . Also, A 1 = {v} is impossible, because if so, by (vi) there exists a path in G[X 1 ] from v to B 1 , and since A 1 = {v}, this path has no internal node in A 1 , a contradiction. It follows that A 2 ∪A 1 \{v} is a cutset that separates v from B 1 , and since A 1 = {v}, this cutset contains at least one node of A 1 . If A 1 is a clique, then A 2 ∪ A 1 \ {v} is a star cutset (centered at any node of A 1 \ {v}) that separates v from the rest of the graph, a contradiction. Since A 1 is not a clique, by (iv) it is a disjoint union of cliques and A 2 is single node a. It follows that {a} ∪ A 1 \ {v} is a star cutset centered at a, a contradiction. Hence (vii) holds, and by an analogous proof, so does (viii).

2

We now define the blocks of decomposition of a graph with respect to a 2-join. Let G be a graph and (X 1 , X 2 ) a 2-join of G. The blocks of decomposition of G with respect to (X 1 , X 2 ) are the two graphs G 1 and G 2 that we describe now. We obtain G 1 from G by replacing X 2 by a marker path P 2 = a 2 c 2 b 2 , where a 2 is a node complete to A 1 , b 2 is a node complete to B 1 , and c 2 has no neighbor in X 1 . The block G 2 is obtained similarly by replacing X 1 by a marker path P 1 = a 1 c 1 b 1 of length 2. Lemma 6.2 Let (X 1 , X 2 ) be a consistent 2-join of a graph G, and let G 1 and G 2 be the blocks of decomposition of G with respect to (X 1 , X 2 ). Then, for i = 1, 2, (X i , V (P 3-i )) is a consistent almost 2-join of G i .

proof -Obviously, (X i , V (P 3-i )) is an almost 2-join of G i (but not a 2-join, the side V (P 3-i ) violates the additional condition in the definition of 2-joins). It is consistent, because all the conditions to be checked in X i are inherited from the fact that they hold in G, and the conditions in V (P Suppose first that G has a clique cutset K. By the definition of a 2-join and up to symmetry, either K ⊆ X 1 , or K ⊆ A 1 ∪ A 2 . In the first case, by condition (vi) in the definition of consistent 2-joins, G[X 2 ] is connected, so X 2 is included in some component of G \ K. It follows that K is a clique cutset of G 1 . In the second case, by condition (vii) of consistent 2-joins, every node of G \ K can be linked to a node of B 1 ∪ B 2 by a path that avoids K. So, K is not a cutset, a contradiction.

Conversely, suppose up to symmetry that G 1 has a clique cutset K. By Lemma 6.2, (X 1 , V (P 2 )) is a consistent almost 2-join of G 1 . So, by exactly the same proof as in the paragraph above, we can prove that G has a clique cutset.

2

We now need to study how a hole may overlap a consistent almost 2-join of a graph. So, let G be graph, (X 1 , X 2 , A 1 , A 2 , B 1 , B 2 ) a split of a consistent almost 2-join of G, and H a hole of G. Because of the adjacencies in an almost 2-join, H must be one of the following five types: Type 0 : for some i ∈ {1, 2}, V (H) ⊆ X i . {p k , q 1 } ⊆ B 1 . By the conditions (iv) and (v) in the definition of consistent 2-joins, A 2 = {a} and B 2 = {b}. It follows that v ∈ X 1 , and that (H, v) is a wheel of G 1 . If H is of type 3, then up to symmetry we suppose that v ∈ X 1 . We observe that (H 1 , v) is a wheel of G 1 .

The proof of the converse statement is analogous: we start with a wheel of G 1 or G 2 , and according to the type of the rim, we build a wheel of G.

We now prove that G contains a theta if and only if G 1 or G 2 contains a theta.

Suppose that G contains a theta T . Note that a theta contains three holes, and we denote by H a hole of T whose type is maximal w.r.t. the order defined in the proof of Lemma 6.4. Hence, T is made of H, together with a path P = u . . . v of length at least 2, where u and v are non adjacent nodes of H. If H is of type 0, then up to symmetry V (H) ⊆ X 1 , and by the maximality of H, all holes of T are of type 0 and V (T ) ⊆ X 1 . So, T is also a theta of G 1 . If H is of type 1A, then up to symmetry H = ap 1 . . . p k a, p 2 , . . . , p k-1 ∈ X 1 \ A 1 and a ∈ A 2 . Hence, A 1 contains non-adjacent nodes, so by the condition (iv) in the definition of consistent 2-joins, A 2 = {a}. It follows by the maximality of H that P does not contain a subpath from A 2 to B 2 , so V (P ) ⊆ X 1 ∪ B 2 , and if P overlap B 2 , then the condition (v) implies that |B 2 | = 1. Hence, after possibly replacing the node of B 2 by a marker node, H and P form a theta of G 1 . The case when H is of type 1B is symmetric to the previous one. The proof is similar when H is of type 2. If H is of type 3, then we claim that the interior of P is in X 1 or in X 2 . Otherwise, the interior of P must contains adjacent nodes in X 1 and X 2 , up to symmetry in A 1 and A 2 respectively. This violates the condition (iv), a contradiction that proves our claim. So, up to symmetry the interior of P is in X 1 , and H 1 and the interior of P form a theta of G 1 .

The proof of the converse statement is analogous: we start with a theta of G 1 or G 2 , and according to the type of a maximal hole of the theta, we build a theta of G.

2

Lemma 6.6 If a graph G has a consistent 2-join (X 1 , X 2 ), then |X 1 |, |X 2 | ≥ 4.
proof -Suppose for a contradiction that |X 1 | = 3. Up to symmetry we assume |A 1 | = 1, and let a 1 be the unique node in A 1 . By the condition (iii) in the definition of consistent 2-joins, every node of B 1 has a non-neighbor in A 1 . Since A 1 = {a 1 }, this means that a 1 has no neighbor in B 1 . By (i), G[X 1 ] is a path of length 2 whose interior is in C 1 . This contradicts the definition of a 2-join (note that this does not contradict the definition of an almost 2-join). 2

Algorithms

We are now ready to describe our recognition algorithms based on decomposition by clique cutsets and 2-joins. When a graph G has a clique cutset K, its node set can be partitioned into nonempty sets A, K, and B in such a way that there are no edges between A and B. We call such a triple a split for the clique cutset. When (A, K, B) is a split for a clique cutset of a graph G, the blocks of decomposition of G with respect to (A, K, B) are the graphs

G A = G[A ∪ K] and G B = G[K ∪ B].
Lemma 7.1 Let G be a graph and (A, K, B) be a split for a clique cutset of G. Then, G contains a prism (resp. a pyramid, a theta, a wheel) if and only if one of the blocks of decomposition G A or G B contains a prism (resp. a pyramid, a theta, a wheel).

proof -Follows directly from the fact that a Truemper configuration has no clique cutset. 2

A clique cutset decomposition tree for a graph G is a rooted tree T defined as follows.

• The root of T is G.

• Every non-leaf node of T is a graph G that contains a clique cutset K with split (A, K, B) and the children of G in T are the blocks of decomposition G A and G B of G with respect to (A, K, B).

• Every leaf of T is a graph with no clique cutset.

• T has at most n leaves.

Theorem 7.2 (Tarjan [START_REF] Tarjan | Decomposition by clique separators[END_REF]) A clique cutset decomposition tree of an input graph G can be computed in time O(nm).

A consistent 2-join decomposition tree for a graph G is a rooted tree T defined as follows.

• The root of T is G.

• Every non-leaf node of T is a graph G that contains a consistent 2-join with split (X 1 , X 2 , A 1 , A 2 , B 1 , B 2 ) and the children of G in T are the blocks of decomposition G 1 and G 2 with respect to (X 1 , X 2 , A 1 , A 2 , B 1 , B 2 ).

• Every leaf of T is a graph with no 2-join, or a graph with a nonconsistent 2-join (and is identified as such).

• T has at most O(n) nodes.

Theorem 7.3 A consistent 2-join decomposition tree of an input graph G can be computed in time O(n 3 m).

proof -Here is an algorithm that outputs a tree T . We run an algorithm from [START_REF] Charbit | Detecting 2-joins faster[END_REF] that outputs in time O(n 2 m) a split of a 2-join of G, or certifies that no 2-joins exists (warning: what we call here a 2-join is called in

[6] a non-path 2-join). If G has no 2-join, then G is declared to be a leaf of T . If a split (X 1 , X 2 , A 1 , A 2 , B 1 , B 2
) is outputted, we check whether (X 1 , X 2 ) is consistent (this can be easily done in time O(nm), all the conditions in the definition of consistent 2-joins are easy to check). If the 2-join is not consistent, then G is declared to be a leaf of T . Otherwise, we compute the blocks of decomposition G 1 and G 2 of G with respect to (X 1 , X 2 , A 1 , A 2 , B 1 , B 2 ), and run the algorithm recursively for G 1 and G 2 . The algorithm is clearly correct. Here is the complexity analysis. We may assume that the input graph has at least 7 nodes (otherwise, we look directly for the tree in constant time). Note that by Lemma 6.6, at every recursive call, the size of the graph decreases, so the algorithm terminates. Also, every graph involved in the algorithm has at least seven nodes. We denote by f (G) the number of calls to the algorithm for a graph G on n nodes. We show by induction that f (G) ≤ 2n -13. If G is a leaf of T , this is true because f (G) = 1, and since n ≥ 7, we have 2n -13 ≥ 1. If G is not a leaf, then it has a 2-join (X 1 , X 2 ) and we set n 1 = |X 1 | and n 2 = |X 2 |. Note that n = n 1 + n 2 and that the blocks of decomposition G 1 and G 2 have respectively n 1 + 3 and n 2 + 3 nodes. Since there is one call to the algorithm plus at most f (G 1 ) + f (G 2 ) recursive calls, by the induction hypothesis we have:

f (G) ≤ f (G 1 ) + f (G 2 ) + 1 ≤ 2(n 1 + 3) -13 + 2(n 2 + 3) -13 + 1 = 2n -13.
So, there are at most 2n-13 calls to an algorithm of complexity O(n 2 m). The overall complexity is therefore O(n 3 m). Since the number of nodes of the tree is bounded by the number of recursive calls, T has at most O(n) nodes.

2

We need to recognize in polynomial time the basic classes of our theorems. Lemma 7.4 There is an O(n 2 m)-time algorithm that decides whether an input graph is the line graph of a triangle-free chordless graph (resp. a pyramid-basic graph, a long pyramid, a clique, a hole).

proof -Note first that deciding whether a graph G is a line graph, and if so computing a graph R such that G = L(R) can be performed in time O(n + m) as shown in [START_REF] Lehot | An optimal algorithm to detect a line graph and output its root graph[END_REF][START_REF] Roussopoulos | A max {m, n} algorithm for determining the graph H from its line graph G[END_REF]. Deciding whether a graph is chordless can be done easily in time O(nm + m 2 ): for every edge uv, compute in time O(n + m) the blocks of G \ uv by the classical algorithm from [START_REF] Tarjan | Depth first search and linear graph algorithms[END_REF]. Then, check whether u and v are in the same 2-connected block (this holds if and only if uv is a chord of some cycle of G). Deciding whether a graph is triangle-free can be performed trivially in time O(nm). By combining all this, we test in time O(n 2 m) whether a graph is a line graph of a triangle-free chordless graph.

To test whether a graph is a pyramid-basic graph, for every edge xy, we test whether G \ {x, y} is the line-graph of a tree, and if so, we compute the tree, and check whether it is safe. Checking whether x and y satisfy the requirement of the definition of pyramid-basic graphs is then easy.

Checking whether a graph is a long pyramid, a hole or a clique is trivial.2

Theorem 7.5 There exists a O(n 3 m) time algorithm that decides whether an input graph G is only-prism.

proof -We run the algorithm of Theorem 7.2. This gives a list of O(n) graphs (the leaves of the decomposition tree) that have no clique cutsets, and by Lemma 7.1, G is only-prism if and only if so are all graphs of the list. By the algorithm from Lemma 7.4, we test whether all graphs from the list are line graphs of triangle-free chordless graphs. If so, G is only-prism by Lemma 7.1, and the algorithm outputs "G is only-prism". If one graph from the list fails to be the line graph of a triangle-free chordless graph, then since it has no clique cutset, it is not only-prism by Theorem 2.5. So, the algorithms outputs "G is not only-prism". In the worst case, we run O(n) times an algorithm of complexity O(n 2 m). 2

Theorem 7.6 There exists an O(n 4 m)-time algorithm that decides whether an input graph G is only-pyramid.

proof -We first run the algorithm of Theorem 7.2. This gives a list of O(n) graphs (the leaves of the decomposition tree) that have no clique cutsets, and by Lemma 7.1, G is only-pyramid if and only if so are all graphs of the list. Therefore, it is enough to provide an algorithm for graphs with no clique cutsets. So, suppose G has no clique cutset. By Theorem 7.3, we build a consistent 2-join decomposition tree T of G. By Lemma 6.3, all nodes of T are graphs that have no clique cutset. If one leaf T has a non-consistent 2-join, then it cannot be an only-pyramid graph by Lemma 6.1. The algorithm therefore outputs "G is not only-pyramid", the correct answer by Lemmas 6.4 and 6.5. Now, we may assume that all leaves of T have no 2-join. By Lemma 7.4, we check whether some leaf of T is a long pyramid, a clique, a hole or a pyramid-basic graph. If one leaf fails to be such a graph, then, since it has no clique cutset and no 2-join, it cannot be only-pyramid by Theorem 2.7, so again the algorithm outputs "G is not only-pyramid". Now, every leaf of T can be assumed to be a long pyramid, a clique, a hole or a pyramid-basic graph, and it is therefore only-pyramid by Lemma 2.6. By Lemmas 6.4 and 6.5, G itself is only-pyramid.

Complexity analysis. The algorithm when there is no clique cutset runs in time O(n 3 m) because in the worst case, the search for a 2-join and the recognition of basic graphs has to be done O(n) times. This algorithm is performed n times in the worst case. So, the overall complexity is O(n 4 m).

2

We now explain how our decomposition theorems can be turned into structure theorems.

Let G 1 be a graph that contains a clique K and G 2 a graph that contains the same clique K, and is node disjoint from G 1 apart from the nodes of K. The graph G 1 ∪ G 2 is the graph obtained from G 1 and G 2 by gluing along a clique.

Let G 1 be a graph that contains a path a 2 c 2 b 2 such that c 2 has degree 2, and such that (V (G 1 ) \ {a

  a 3 are edges with a common end a and b 1 , b 2 , b 3 are edges with a common end b. In T , there is a cut-edge e separating a and b

Lemma 3 . 3

 33 If a (theta, wheel)-free graph G has a star cutset, then G has a clique cutset.

Lemma 4 . 3

 43 If G is an only-prism graph, H is a hole in G, and x ∈ V (G) \ V (H) has a unique neighbor in V (H), then G has a clique cutset.

•

  a long pyramid, or • an extended nontrivial basic pyramid graph, or it has a bisimplicial cutset or a 2-join. Lemma 5.2 If G is a connected only-pyramid graph that contains a 4-hole, then either G is a 4-hole or it has a clique cutset.

  2 , c 2 , b 2 }, {a 2 , c 2 , b 2 }) is a consistent almost 2-join of G 1 . Let G 2 , a 1 , c 1 , b 1 be defined similarly. Let G be the graph built on (V (G 1 ) \ {a 2 , c 2 , b 2 }) ∪ (V (G 2 ) \ {a 1 , c 1 , b 1 }) by keeping all edges inherited from G 1 and G 2 , and by adding all edges between N G 1 (a 2 ) and N G 2 (a 1 ), and all edges between N G 1 (b 2 ) and N G 2 (b 1 ). Graph G is said to

Table 1 :

 1 Detecting Truemper configurations

	k	theta	pyramid	prism	wheel	Complexity	Reference
	0 excluded excluded excluded excluded	O(nm)	[13][32]
	1 excluded excluded excluded	-	O(n 7 )	[24][25]
	2 excluded excluded	-	excluded	O(n 3 m)	Theorem 7.5
	3 excluded excluded	-	-	O(n 7 )	[25]
	4 excluded	-	excluded excluded	O(n 4 m)	Theorem 7.6
	5 excluded	-	excluded	-	O(n 35 )	[9]
	6 excluded	-	-	excluded	O(n 4 m)	Part II [26]
	7 excluded	-	-	-	O(n 11 )	[12]
	8	-	excluded excluded excluded	NPC	[16]
	9	-	excluded excluded	-	O(n 5 )	[24]
	10	-	excluded	-	excluded	NPC	[16]
	11	-	excluded	-	-	O(n 9 )	[8]
	12	-	-	excluded excluded	NPC	[16]
	13	-	-	excluded	-	NPC	[24]
	14	-	-	-	excluded	NPC	[16]
	15	-	-	-	-	O(1)	Trivial

  a theta or a wheel with center x. 2 Lemma 3.4 Let G be a (theta, wheel)-free graph. If H is a hole of G and v a node of V (G) \ V (H), then v has at most two neighbors in H, and if it has two neighbors in H, then they are adjacent.

proof -Node v has at most two neighbors in H, since otherwise (H, v) is a wheel. If v has two nonadjacent neighbors in H, then H ∪ {v} induces a theta.

2

  Lemma 6.3 Let G be a graph with a consistent 2-join (X 1 , X 2 ) and G 1 , G 2 be the blocks of decomposition with respect to this 2-join. Then, G has no clique cutset if and only if G 1 and G 2 have no clique cutset.proof -We prove an equivalent statement: G has a clique cutset if and only if G 1 or G 2 has a clique cutset.

		3-i )
	are trivially true.	2

Partially supported by Serbian Ministry of Education, Science and Technological Development project 174033. ‡ CNRS, LIP, ENS de Lyon. Partially supported by ANR project Stint under reference ANR-13-BS02-0007 and by the LABEX MILYON (ANR-10-LABX-0070) of Université de Lyon, within the program Investissements d'Avenir (ANR-11-IDEX-0007) operated by the French National Research Agency (ANR). Also Partially supported by EPSRC grant EP/K016423/1, and Serbian Ministry of Education and Science projects 174033 and III44006.

Type 1A : for some i ∈ {1, 2}, H = ap 1 . . . p k a where k ≥ 3, p 2 , . . . , p k-1 ∈ X i \ A i , a ∈ A 3-i , and {p 1 , p k } ⊆ A i .

Type 1B : for some i ∈ {1, 2}, H = bp 1 . . . p k b where k ≥ 3, p 2 , . . . , p k-1 ∈ X i \ B i , b ∈ B 3-i , and {p 1 , p k } ⊆ B i .

Type 2 : for some i ∈ {1, 2}, H = ap 1 . . . p k bq 1 . . . q l a where k ≥ 2, l ≥ 2, p 2 , . . . , p k-1 , q 2 , . . . , q l-1 ∈ X i \(A i ∪B i ), a ∈ A 3-i , b ∈ B 3-i , {p 1 , q l } ⊆ A i , and {p k , q 1 } ⊆ B i .

Note that if (X 1 , X 2 ) is a 2-join (rather that just an almost 2-join) and H a hole of type 0, 1A, 1B or 2, then up to the replacement of a and/or b by a marker node, H is a hole of G 1 or a hole of G 2 , and we simply denote this hole by H (with a slight abuse, due to the replacement of a node by a marker node). If H is of type 3, then by replacing q 1 . . . q l by the marker path P 2 , we obtain a hole H 1 of G 1 , and by replacing p 1 . . . p l by the marker path P 1 , we obtain a hole H 2 of G 2 . We will use this notation in what follows.

Let G be a graph that contains a consistent 2-join (X 1 , X 2 ), and let G 1 and G 2 be the corresponding blocks of decomposition. Consider G 1 (analogous statements hold for G 2 ). (X 1 , V (P 2 )) is not a 2-join of G 1 (but is still an almost 2-join, and a consistent one by Lemma 6.2). Suppose G 1 contains a hole H 1 . Then, as above, from H 1 we may build a hole H of G. If H 1 is of type 0 or 1A or 1B, this is straightforward. If H 1 is of type 2, then we need to be careful when replacing a and b by nodes from X 2 : the new nodes need to be non-adjacent, but the existence of such nodes is guaranteed by the condition (ii) in the definition of consistent 2-joins. If H 1 is of type 3, then it contains the marker path P 2 , but a hole H in G can be obtained by replacing this marker path by a shortest path linking the special sets of X 2 (whose existence follows from the condition (i)).

In the proofs of the next lemmas, we will use repeatedly the notation and constructions from the two paragraphs above. Lemma 6.4 Let G be a graph with a consistent 2-join (X 1 , X 2 ). Let G 1 and G 2 be the blocks of decomposition of G with respect to (X 1 , X 2 ). Then, G is prism-free if and only if G 1 and G 2 are both prism-free.

proof -We prove the equivalent statement "G contains a prism if and only if G 1 or G 2 contains a prism".

Suppose that G contains a prism T . Note that a prism contains three holes, and we denote by H a hole of T whose type is maximal (we order types as follows: 0 < 1A, 1B < 2 < 3). Hence, T is made of H, together with a path P = u . . . v of length at least 1, node disjoint from H, and u and v are adjacent to two disjoint edges of H. Note that P is contained in the two holes of T that are different from H. If H is of type 0, then up to symmetry V (H) ⊆ X 1 , and by the maximality of H, all holes of T are of type 0 and V (T ) ⊆ X 1 . So, T is also a prism of G 1 . If H is of type 1A, then up to symmetry H = ap 1 . . . p k a, p 2 , . . . , p k-1 ∈ X 1 \ A 1 and a ∈ A 2 . Hence, A 1 contains non-adjacent nodes, so by the condition (iv) in the definition of consistent 2-joins, A 2 = {a}. It follows by the maximality of H that P does not contain a subpath from A 2 to B 2 , so V (P ) ⊆ X 1 ∪ B 2 , and if P overlaps B 2 , then the condition (v) implies that |B 2 | = 1. Hence, after possibly replacing the node of B 2 by a marker node, H and P form a prism of G 1 . The case when H is of type 1B is symmetric to the previous one. The proof is similar when H is of type 2. If H is of type 3, then we claim that P is in X 1 or in X 2 . Otherwise, P must contains adjacent nodes in X 1 and X 2 , up to symmetry in A 1 and A 2 respectively. Hence, |A 1 |, |A 2 | ≥ 2, so by condition (iv), A 1 and A 2 are both cliques, a contradiction since a prism contains no K 4 . So, up to symmetry P is in X 1 , and H 1 and P form a prism of G 1 .

The proof of the converse statement is analogous: we start with a prism of G 1 or G 2 , and according to the type of a maximal hole of the prism, we build a prism of G. 2 Lemma 6.5 Let G be a graph with a consistent 2-join (X 1 , X 2 ). Let G 1 and G 2 be the blocks of decomposition of G with respect to (X 1 , X 2 ). Then, G is (theta, wheel)-free if and only if G 1 and G 2 are both (theta, wheel)-free.

proof -We first prove that G contains a wheel if and only if G 1 or G 2 contains a wheel. Suppose that G contains a wheel with rim H and center v. If H is of type 0, then up to symmetry V (H) ⊆ X 1 . Then, H is also the rim of a wheel of G 1 (the center is v, or possibly a marker node). If H is of type 1A, then up to symmetry H = ap 1 . . . p k a, p 2 , . . . , p k-1 ∈ X 1 \ A 1 and a ∈ A 2 . Hence, A 1 contains non-adjacent nodes, so by the condition (iv) in the definition of consistent 2-joins, A 2 = {a}. It follows that v ∈ X 1 , and that (H, v) is a wheel of G 1 . The case when H is of type 1B is symmetric to the previous one. If H is of type 2, then up to symmetry H = ap 1 . . . p k bq 1 . . . q l a p 2 , . . . , p k-1 , q 2 , . . . , q l-1 ∈ X

of G and that G 1 and G 1 are the blocks of decomposition of G with respect to this 2-join.

With a proof similar to the proof of Theorem 7.5, it is straightforward to check the following structure theorem. Every only-prism graph can be constructed as follows:

• Start with line graphs of triangle-free chordless graphs.

• Glue along a clique previously constructed graphs.

Similarly, it can be checked that every only-pyramid graph can be constructed as follows:

• Start with long pyramids, holes, cliques and pyramid-basic graphs.

• Repeatedly use consistent 2-join compositions from previously constructed graphs.

• Glue along a clique previously constructed graphs.