Frédéric Maffray
email: frederic.maffray@imag.fr

Nicolas Trotignon
email: nicolas.trotignon@univ-paris1.fr.

Kristina Vušković
email: vuskovi@comp.leeds.ac.uk.

Algorithms for square-3PC (.,.)-free Berge graphs

Keywords: AMS classification: 68R10, 68Q25, 05C85, 05C17, 90C27 recognition algorithm, maximum weight clique algorithm, combinatorial algorithms, perfect graphs, star decompositions

We consider the class of graphs containing no odd hole, no odd antihole, and no configuration consisting of three paths between two nodes such that any two of the paths induce a hole, and at least two of the paths are of length 2. This class generalizes clawfree Berge graphs and square-free Berge graphs. We give a combinatorial algorithm of complexity O(n 7 ) to find a clique of maximum weight in such a graph. We also consider several subgraph-detection problems related to this class.

Introduction

A graph G is perfect if every induced subgraph G ′ of G satisfies χ(G ′ ) = ω(G ′ ), where χ denotes the chromatic number and ω the size of a maximum clique. We say that a graph G contains a graph H, if H is isomorphic to an induced subgraph of G. A graph G is H-free if it does not contain H. A hole is a chordless cycle of length at least four. A square is a hole of length 4. A graph is said to be Berge if it does not contain an odd hole nor the complement of an odd hole.

Berge conjectured in 1960 that a graph is Berge if and only if it is perfect. This was proved by Chudnovsky, Robertson, Seymour and Thomas [START_REF] Chudnovsky | The strong perfect graph theorem[END_REF] in 2002. Later, Chudnovsky, Cornuéjols, Liu, Seymour and Vušković [START_REF] Chudnovsky | Recognizing Berge graphs[END_REF] gave a polynomial time algorithm that recognizes Berge graphs. In the 1980's, Gröstchel, Lovász and Schrijver [START_REF] Gröstchel | The ellipsoid method and its consequences in combinatorial optimization[END_REF], [START_REF] Gröstchel | Geometric algorithms and combinatorial optimization[END_REF] gave a polynomial time algorithm that for any perfect graph computes an optimal coloring, and a clique of maximum size. This algorithm uses the ellipsoid method and a polynomial time separation algorithm for a certain class of positive semidefinite matrices related to Lovász's upper bound on the Shannon capacity of a graph [START_REF] Lovász | On the Shannon capacity of a graph[END_REF]. The question remains whether these optimization problems can be solved by purely combinatorial polynomial time algorithms, avoiding the numerical instability of the ellipsoid method. The aim of this paper is to give such an algorithm for finding a clique of maximum weight in a subclass of perfect graphs that generalizes claw-free perfect graphs and square-free perfect graphs. 3P C(•, •)'s: A 3P C(x, y) is a graph induced by three chordless paths that have the same endnodes x and y and such that the union of any two of them induce a hole. We say that a graph G contains a 3P C(•, •) if it contains a 3P C(x, y) for some x, y ∈ V (G). It is easy to see that in a 3P C(x, y), each of the three paths must have length at least 2. In literature 3P C(•, •)'s are also known as thetas. A square-3P C(•, •) is a 3P C(•, •) that has at least two paths of length 2.

In this paper we give a combinatorial algorithm, with time complexity O(n 7 ), that computes a maximum weight clique in every square-3P C(•, •)-free Berge graph. We will show that every square-3P C(•, •)-free Berge graph has a node whose neighborhood has no long hole (where a long hole is a hole of length greater than 4). This yields a linear-size decomposition tree into square-3P C(•, •)-free Berge graphs that have no long hole, and then these graphs are further decomposed into co-bipartite graphs, resulting in the total decomposition tree of size O(n 4 ).

Recall that there is an O(n 9 ) recognition algorithm for the class of Berge graphs [START_REF] Chudnovsky | Recognizing Berge graphs[END_REF]. Detecting square-3P C(•, •)'s in a graph G can be done easily: it suffices to check, for every square a 1 , a 2 , a 3 , a 4 , a 1 , whether a 1 and a 3 are in the same connected component of G \ ((N (a 2 )∪N (a 4 ))\{a 1 , a 3 }). This takes time O(n 6 ). In Section 4, we deal with the complexity of several subgraph-detection problems related to this class.

A claw is a graph on nodes u, a, b, c with three edges ua, ub, uc. It is easy to see that every 3P C(•, •) contains a claw. So 3P C(•, •)-free graphs generalize claw-free graphs. 3P C(•, •)-free Berge graphs were first studied by Aossey and Vušković [START_REF] Aossey ; P C | Free Berge Graphs are Perfect[END_REF][START_REF] Aossey | free Berge graphs are perfect[END_REF] in the context of proving the Strong Perfect Graph Conjecture for this class. The conjecture was proved by decomposing 3P C(•, •)-free Berge graphs into claw-free graphs using star cutsets, homogeneous pairs and 6-joins (a new edge cutset introduced in that paper).

Clearly square-3P C(•, •) graphs generalize square-free graphs. In [START_REF] Conforti | Square-free perfect graphs[END_REF] square-free Berge graphs are decomposed by 2-joins and star cutsets into bipartite graphs and line graphs of bipartite graphs (hence proving the Strong Perfect Graph Conjecture for this class).

Square-3P C(•, •)-free Berge graphs contain both claw-free Berge graphs and square-free Berge graphs, and it is likely that one might be able to obtain a similar decomposition theorem that uses star cutsets and some of the other mentioned cutsets. And of course all Berge graphs have been decomposed in [START_REF] Chudnovsky | The strong perfect graph theorem[END_REF] (thus proving the Strong Perfect Graph Conjecture), into basic classes by skew cutsets, 2-joins and their complements, see also [5].

Our initial idea was to try to use the above mentioned types of decomposition theorems to develop an algorithm for finding a maximum weight clique in a square-3P C(•, •)-free Berge graph. Interestingly, we did end up developing a decomposition based algorithm for finding a maximum weight clique, but it does not use any of the types of decomposition theorems mentioned above.

Finding a maximum weight clique in a claw-free Berge graph is not difficult. Indeed in such a graph G the neighborhood of every node induces a co-bipartite graph (first observed in [START_REF] Hsu | Algorithms for minimum covering by cliques and maximum clique in claw-free perfect graphs[END_REF], see also [START_REF] Hsu | Algorithms for maximum weight clique, minimum weighted clique covers and minimum colorings of claw-free perfect graphs[END_REF]), so the problem reduces to n instances of the maximum weight stable set problem in a co-bipartite graph, which can be reduced to a maximum flow problem and can be done in time O(n 3 ), see [START_REF] Li | A combinatorial algorithm for minimum weighted colorings of claw-free perfect graphs[END_REF].

For a graph G let k denote the number of maximal cliques in G, n the number of nodes in G and m the number of edges of G. Farber [START_REF] Farber | On diameters and radii of bridged graphs[END_REF] shows that there are O(n 2 ) maximal cliques in any square-free graph. Tsukiyama, Ide, Ariyoshi and Shirakawa [START_REF] Tsukiyama | A new algorithm for generating all the maximal independent sets[END_REF] give an O(nmk) algorithm for generating all maximal cliques of a graph, and Chiba and Nishizeki [START_REF] Chiba | Arboricity and subgraph listing algorithms[END_REF] improve this complexity to O( √ m + n mk). So one can generate all the maximal cliques of a squarefree graph in time O( √ m + n mn 2 ). For square-free Berge graphs one can obtain a slightly better algorithm by using the following characterization obtained by Parfenoff, Roussel and Rusu [START_REF] Parfenoff | Triangulated neighborhoods in C 4 -free Berge graphs[END_REF]: every square-free Berge graph has a node whose neighborhood is triangulated.

We conclude this section by defining two more types of 3-path-configurations (3P C's) and wheels.

3P C(∆, ∆)'s: Let x 1 , x 2 , x 3 , y 1 , y 2 , y 3 be six distinct nodes of G such that {x 1 , x 2 , x 3 } and {y 1 , y 2 , y 3 } both induce triangles. A 3P C(x 1 x 2 x 3 , y 1 y 2 y 3 ) is a graph induced by three chordless paths

P 1 = x 1 • • • y 1 , P 2 = x 2 • • • y 2 and P 3 = x 3 • • • y 3 ,
such that any two of them induce a hole. We say that a graph G contains a 3P C(∆, ∆) if it contains a 3P C(x 1 x 2 x 3 , y 1 y 2 y 3 ) for some x 1 , x 2 , x 3 , y 1 , y 2 , y 3 ∈ V (G). Such graphs are also known as prisms in [START_REF] Chudnovsky | The strong perfect graph theorem[END_REF] and stretchers in [START_REF] Everett | even pairs[END_REF].

3P C(∆, •)'s: Let x 1 , x 2 , x 3 , y be four distinct nodes of G such that {x 1 , x 2 , x 3 } induces a triangle. We call 3P C(x 1 x 2 x 3 , y) any graph induced by three chordless paths

P 1 = x 1 • • • y, P 2 = x 2 • • • y and P 3 = x 3 • • • y,
such that the union of any two of them induces a hole. Note that at least two of three paths must have length at least 2. We say that a graph G contains a 3P C(∆, •) if it contains a 3P C(x 1 x 2 x 3 , y) for some x 1 , x 2 , x 3 , y ∈ V (G). Such graphs are called pyramids in [START_REF] Chudnovsky | The strong perfect graph theorem[END_REF].

Wheels: A wheel (H, x) is a graph induced by a hole H and a node x ∈ V (H) that has at least three neighbors in H. Node x is the center of the wheel. A wheel is odd if it contains an odd number of triangles.

It is easy to see that every odd wheel and every 3P C(∆, •) contains an odd hole, so Berge graphs cannot contain these two structures. These facts will be used repeatedly in the proofs.

2 Finding a maximum weight clique in a square-3P C(•, •)-free

Berge graph

We assume that we are given a graph G with a weight f (x) associated with every node x.

The problem is to find a clique of G of maximum weight, where the weight of a subset of nodes is the sum of the weights of its elements. The maximum weight of a clique is denoted by ω f (G). The next theorem will help us solve this problem. For x ∈ V (G), N (x) denotes the set of nodes of G that are adjacent to x, and The proof of this theorem is long and technical, and we leave it for Section 3. Here we give a corollary of Theorem 2.1 and show how to use it in an algorithm for the maximum clique problem.

N [x] = N (x)∪ {x}. For A ⊆ V (G), G[A]
Let F be a class of graphs. We say that a graph G is F-free if G does not contain any of the graphs from F.

A class F of graphs satisfies property (*) w.r.t. a graph G if the following holds: for every node x of G such that G \ N [x] = ∅, and for every connected component

C of G \ N [x], if F ∈ F is contained in N (x)
, then there exists a node of F that has no neighbor in C.

In a graph G, for any node x, let C 1 , . . . , C k be the components of

G \ N [x], with |C 1 | ≥ |C 2 | ≥ • • • ≥ |C k |,
and let the numerical vector (|C 1 |, . . . , |C k |) be associated with x. The nodes of G can thus be ordered according to the lexicographical ordering of the numerical vectors associated with them. Say that a node x is lex-maximal if the associated numerical vector is lexicographically maximal over all nodes of G.

Theorem 2.2 Let F be a class of graphs such that for every F ∈ F, no node of F is adjacent to all the other nodes of F . If F satisfies property (*) w.r.t. a graph G and x is a lex-maximal node of G, then N (x) is F-free.

Proof. Let F be a class of graphs such that for every F ∈ F, no node of F is adjacent to all the other nodes of F . Assume that F satisfies property (*) w.r.t. G.

Let x be a lex-maximal node of G and suppose that N (x) is not F-free. Then G is not a clique, and hence, since

x is lex-maximal, G \ N [x] = ∅. Let C 1 , . . . , C k be the connected components of G \ N [x], with |C 1 | ≥ |C 2 | ≥ • • • ≥ |C k |. Let N = N (x) and for i = 1, . . . , k, let N i = N (x) ∩ N (C i ). Claim 1: N 1 ⊆ N 2 ⊆ • • • ⊆ N k and for every i = 1, . . . , k, every node of (N \ N i ) ∪ (C i+1 ∪ • • • ∪ C k ) is adjacent to every node of N i .
Proof of Claim 1: We argue by induction. First we show that every node of (N

\ N 1 ) ∪ (C 2 ∪ • • • ∪ C k ) is adjacent to every node of N 1 . Assume not and let y ∈ (N \ N 1 ) ∪ (C 2 ∪ • • • ∪ C k ) be such that it is not adjacent to z ∈ N 1 . Clearly y has no neighbor in C 1 , but z does. So G \ N [y] contains a connected component that contains C 1 ∪ z, contradicting the choice of x. Now let i > 1 and assume that N 1 ⊆ • • • ⊆ N i-1 and every node of (N \N i-1 )∪(C i ∪• • •∪C k ) is adjacent to every node of N i-1 . Since every node of C i is adjacent to every node of N i-1 , it follows that N i-1 ⊆ N i . Suppose that there exists a node y ∈ (N \ N i ) ∪ (C i+1 ∪ • • • ∪ C k ) that is not adjacent to a node z ∈ N i . Then z ∈ N i \ N i-1
and z has a neighbor in C i . Also y is adjacent to all nodes in N i-1 and no node of

C 1 ∪ • • • ∪ C i . So there exist connected components of G \ N [y], C y 1 , . . . , C y l such that C 1 = C y 1 , . . . , C i-1 = C y i-1 and C i ∪ z is contained in C y i .
This contradicts the choice of x. This completes the proof of Claim 1.

Since Let F be the class of square-3P C(•, •)-free Berge graphs that contain no long hole. Suppose that we have an algorithm A that computes a clique of maximum weight for every graph in F in time O(n t ). Then we can compute a clique of maximum weight for every square-3P C(•, •)free Berge graph G as follows. By Theorem 2.3, G has a node x whose neighborhood contains no long hole. Let G 0 be the subgraph of G induced by N (x). So G 0 is in F. Clearly, since every clique of G either contains x or not, we have ω f (G) = max{f (x)+ω f (G 0 ), ω f (G\{x})}. Thus, in order to compute ω f (G), we need only compute ω f (G 0 ) and ω f (G\{x}). The former can be done by Algorithm A, and the latter can be done recursively. Note that computing the numerical vector associated with a node takes time O(n 2 ), and so we can find a lexmaximal node in time O(n 3 ). So we can find in time O(n 4 ) an ordering x 1 , . . . , x n of the nodes of G such that, for each i = 1, . . . , n, node x i is lex-maximal in the subgraph induced by x i , . . . , x n . Thus we can compute ω f (G) for every square-3P C(•, •)-free Berge graph G in time O(n 4 + n t+1 ). Now we describe such an algorithm A. For this purpose we will use the following definition.

Full star decomposition: For x ∈ V (G) such that x is not adjacent to every node of G \ {x}, let C 1 , . . . , C m be the connected components of G \ N [x]. Note that N [x] need not be a cutset, i.e. possibly m = 1. The blocks of the full star decomposition at x are the graphs G 0 , G 1 , . . . , G m defined as follows: G 0 is the subgraph of G induced by N (x) and, for i = 1, . . . , m, G i is the subgraph of G induced by C i ∪ N i , where N i is the set of nodes of N (x) that have a neighbor in C i .

Remark 2.4 From the construction of the blocks of full star decomposition of G it follows easily that

ω f (G) = max{f (x) + ω f (G 0 ), ω f (G 1 ), . . . , ω f (G m )}.
This remark shows that the problem of finding a maximum weight clique in G can be reduced to finding a maximum weight clique in some subgraphs of G. Our algorithm for finding a maximum weight clique in a square-3P C(•, •)-free Berge graph G with no long hole consists of the following two stages:

• Stage 1: A decomposition tree T is constructed, where each leaf node is co-bipartite (i.e. complement of a bipartite graph), and for each non-leaf node F , the children of F in T represent the blocks of a full star decomposition of F .

• Stage 2: A maximum weight clique is computed for each of the leaf nodes, and then the algorithm backtracks along T to find a maximum weight clique for G using Remark 2.4.

Finding a maximum weight clique in a co-bipartite graph is equivalent to finding a maximum weight stable set in a bipartite graph, and it is well-known that this problem can be reduced to a maximum flow in a directed network associated with the bipartite graph, see [START_REF] Li | A combinatorial algorithm for minimum weighted colorings of claw-free perfect graphs[END_REF]. From them it is easy to deduce an algorithm (henceforth the "co-bipartite maximum weight clique algorithm") that computes a maximum weight clique in a co-bipartite graph G in time O(n 3 ). So if the size of the decomposition tree is polynomial, then Stage 2 of the algorithm can be performed in polynomial time. The key difficulty is to construct T in polynomial time. To perform Stage 1, we decompose using a full star centered at a node contained in an independent set of size 3. Note that when a Berge graph does not contain any independent set of size 3, then it is co-bipartite. The following lemma implies that the decomposition tree so constructed has polynomial size. Lemma 2.5 Let G be a square-3P C(•, •)-free Berge graph that contains no long hole, and let G 0 , G 1 , . . . , G m be the blocks of a full star decomposition at some node x of G. Then the following hold:

(1) No independent set of G of size 2 is contained in both G i and G j for any 1 ≤ i = j ≤ m. (2) No independent set of G of size 3 is contained in both G 0 and G i for any 1 ≤ i ≤ m. Proof. Note that in a long-hole-free graph every 3P C(•, •) is a square-3P C(•, •).
To prove (1), suppose that {a, b} is an independent set of G contained in both G i and G j with 1 ≤ i = j ≤ m. Then {a, b} ⊆ N (x), and both a and b have neighbors in both C i and C j . But then there exists a chordless a, b-path P i (resp. P j ) whose intermediate nodes are in C i (resp. C j ), and hence P i ∪ P j ∪ x induces a 3P C(a, b), a contradiction.

To prove (2), suppose that there exists an independent set {a, b, c} that is contained in both G 0 and G 1 . Then {a, b, c} ⊆ N (x) and every node of {a, b, c} has a neighbor in C 1 . Let u, v, t be neighbors of a, b, c respectively in C 1 . Then there is a path P in C 1 from u to v. W.l.o.g. u, v, P are chosen so that P is minimal. Then P ∪ {x, a, b} induces a hole, and since this hole cannot be long,

u = v. If t = u then {x, a, b, c, u} induces a 3P C(x, u). So t = u. Let Q be a shortest path from t to u in C 1 . W.l.o.g. no node of Q \ {t} is adjacent to c.
Since the graph induced by Q ∪ {x, a, c} cannot contain a long hole, a is adjacent to t. By symmetry, b is also adjacent to t, and hence {x, a, b, c, t} induces a 3P C(x, t). 2

Algorithm 2.6

Input: A square-3P C(•, •)-free Berge graph G with no long hole, and a weight function f on V (G).

Output: A maximum weight clique of G.

Method:

Step 1. Let L = {G}, L ′ = ∅ and let T be a tree that consist of a single node G.

Step 2. If L = ∅, then go to Step 3. Otherwise, remove a graph F from L. If F does not contain an independent set of size 3, then place F in L ′ and return to Step 2. Otherwise, let {x, y, z} be an independent set of F . Decompose F using the full star decomposition centered at x. Place the blocks of the decomposition in L, add the blocks of the decomposition to T as children of F , and return to Step 2.

Step 3. For every F ∈ L ′ , find a maximum weight clique of F using the co-bipartite maximum weight clique algorithm. Note that the leaves of T are precisely the graphs in L ′ . Using Remark 2.4, backtrack along T to a maximum weight clique of G.

Complexity: O(n 6 ).

Proof. By the definition of Step 2, the graphs in L ′ (that represent the leaves of T ) do not contain any independent set of size 3. Since G is Berge, these graphs are co-bipartite. So

Step 3 correctly finds a maximum weight clique. Now we determine the complexity of the algorithm. Consider the tree T obtained at the end of Step 2. We show that the number of non-leaf nodes in T is O(n 3 ). Let F be a non-leaf node of T . Let {x, y, z} be an independent set of F from Step 2 such that F is decomposed by the full star centered at x. We view {x, y, z} as the label of F . By Lemma 2.5 and the fact that x is not contained in any of the blocks of decomposition of F , no two non-leaf nodes of T have the same label. So the number of non-leaf nodes of T is at most n 3 .

We now show that the number of leaf nodes of T is also O(n 3 ). For a node F of T , define a measure τ (F ) as follows: if F is a non-leaf node of T , then let τ (F ) be the number of independent sets of size 3 in F ; if F is a leaf node and F has at least three siblings in the decomposition tree, then τ (F ) = 1; otherwise, τ (F ) = 0. Let F be a non-leaf node of T . Suppose that F is decomposed by a full star centered at x. Let C 1 , . . . , C m be the connected components of F \ N [x], and let F 0 , . . . , F m be the blocks of decomposition. We claim that the following inequality holds:

τ (F ) ≥ τ (F 0 ) + τ (F 1 ) + • • • + τ (F m ).
(1) Indeed, by Lemma 2.5, no independent set of F of size 3 is contained in more than one block of the decomposition. So if m < 3, then (1) clearly holds. Suppose that m ≥ 3. To show [START_REF] Aossey ; P C | Free Berge Graphs are Perfect[END_REF], it is enough to show that the number of independent sets of F of size 3 that are not contained in any of the blocks is ≥ m + 1. For i = 1, . . . , m, let c i be a node of C i . The number of sets that contain x and two nodes from {c 1 , . . . , c m } is m 2 . The number of sets that contain three nodes from {c 1 , . . . , c m } is m 3 . Note that all these sets of size 3 are independent sets of F that are not contained in any of the blocks of the decomposition. So the number of independent sets of size 3 of F that are not contained in any of the blocks is

at least m 2 + m 3 . Since m ≥ 3, m 2 + m 3 ≥ m + 1.
Therefore, (1) holds. By repeated applications of (1) we get the inequality:

τ (G) ≥ {τ (F ) | F leaf of T }. So the number of leaves F of T such that τ (F ) = 1 is O(n 3 )
. By the definition of τ , the number of leaves F of T such that τ (F ) = 0 is at most 3 times the number of internal nodes of T . Hence, the number of leaves F of T such that τ (F ) = 0 is O(n 3 ). Therefore the number of leaves of T is O(n 3 ).

So the size of T is O(n 3 ). When the algorithm examines a non-leaf node of T , it looks for an independent set of size 3. Since F is Berge, it suffices to check whether its complement F is bipartite, which can be done in time O(n 2 ) with standard breadth-first search (and this method will produce an independent set of size 3 whenever F is not bipartite). So the complexity of constructing T is O(n 5 ), and the total complexity of Step 3 is O(n 6 ). Therefore, the overall complexity of the algorithm is O(n 6 ).

2

This implies that we can compute ω f (G) for every square-3P C(•, •)-free Berge graph G in time O(n 7 ). In fact this algorithm can be turned into a robust algorithm (in Spinrad's sense [START_REF] Spinrad | Efficient Graph Representations[END_REF]). We would not neet to know that the input graph G to the algorithm is a square-3P C(•, •)-free Berge graph. The algorithm would then either correctly compute ω f (G) (in all cases when G is a square-3P C(•, •)-free Berge graph, and in some cases when it is not) or it would identify G as not being a square-3P C(•, •)-free Berge graph. As in the algorithm we have just given, we would start by looking for a lex-maximal vertex x. We would then check whether N (x) is long-hole-free. If it is not, we would terminate the algorithm, outputing that G is not a square-3P C(•, •)-free Berge graph (by Theorem 2.3). In the second part of the algorithm where we decompose graphs with no long hole, at each decomposition we would verify that (1) and ( 2) of Lemma 2.5 hold (which can easily be done). If one of those conditions fails, we would again terminate the algorithm, outputing that G is not a square-3P C(•, •)-free Berge graph. Otherwise, we would end up with an O(n 3 ) decomposition tree as before. We would now just have to check whether the leaves are co-bipartite. If they are not, we would again terminate, outputing that G is not a square-3P C(•, •)-free Berge graph.

Proof of Theorem 2.1

To prove Theorem 2.1 we prove the following stronger result. We sign a graph by assigning 0, 1 weights to its edges in such a way that, for every triangle in the graph, the sum of the weights of its edges is odd. A graph G is even-signable if there is a signing of its edges so that for every hole in G, the sum of the weights of its edges is even. Clearly, every odd-hole-free graph is even-signable (assign weight 1 to all its edges). The following theorem is an easy consequence of a theorem of Truemper [START_REF] Truemper | Alpha-balanced graphs and matrices and GF(3)-representability of matroids[END_REF].

Theorem 3.1 (Conforti et al. [START_REF] Conforti | A Mickey mouse decomposition theorem[END_REF][START_REF] Conforti | Universally signable graphs[END_REF]) A graph is even-signable if and only if it does not contain an odd wheel nor a 3P C(∆, •).

The fact that even-signable graphs do not contain odd wheels and 3P C(∆, •)'s will be used throughout the proof of the next theorem.

Remark: Even though Theorem 3.2 below implies that every square-3P C(•, •) evensignable graph has a node whose neighborhood is long-hole-free, finding a largest clique in a claw-free odd-hole-free graph (and hence in a square-3P C(•, •)-free even-signable graph) is NP-hard. Indeed it is proved in [START_REF] Murphy | Computing independent sets in graphs with large girth[END_REF] that it is NP-hard to find a largest independent set in a graph with no cycle of length 3, 4, or 5, and so it is NP-hard to find a largest clique in a graph with no stable set of size 3 and no hole of length 5. Proof. Assume that every node of H has a neighbor in C. We will show that this leads to a contradiction. Let n be the length of H, and let

H = h 1 h 2 • • • h n h 1 .
Note that since (H, x) cannot be an odd wheel, H must be of even length, so n ≥ 6. For any node u, we denote by N H (u) the set N (u) ∩ V (H).

Claim 1 Every node u of C that has a neighbor in H is one of the following five types:

• Type i, i = 1, 2, 3: u has exactly i neighbors in H, and they are consecutive along H.

• Type 4: u has exactly four neighbors h i , h i+1 , h j , h j+1 in H (that appear in this order when traversing H clockwise), where i, j have different parities.

• Type 5: u has exactly two neighbors h i and h j in H, i and j are of the same parity and the two subpaths of H from h i to h j are of length greater than 2. Finally, if p 1 , p k are both of Type 1, say N H (p 1 ) = h i and N H (p k ) = h j with i < j, then either we have outcome (i), or P ∪ {h i , . . . , h j , x} induces an odd wheel with center x. If one of p 1 , p k is of Type 1 and the other is of Type 2, then H ∪ P induces a 3P C(∆, •). If p 1 , p k are both of Type 2, then either we have outcome (ii), or there is a subpath Proof. Suppose that there is such a path. Without loss of generality we have either k = 1 and

Proof. Let s = |N H (u)|.
H ′ = h i • • • h j of H such that N (p 1 ) ∩ H ′ = {h i }, N (p k ) ∩ H ′ = {h j }
N H (p 1 ) = {h 1 , h 2 , h t , h t+1 }, or k ≥ 2, N H (p 1 ) = {h 1 , h 2 } and N H (p k ) = {h t , h t+1 }.
Then by Claims 1 and 2, t is even. In particular, h 2 h t and h t+1 h 1 are not edges. Since every node of H has a neighbor in C, there exists a chordless path Q = q 1 • • • q l in C such that q 1 is adjacent to a node of H \ {h 1 , h 2 , h t , h t+1 } and q l is adjacent to a node of P . We may assume that such paths P and Q are chosen so that |V (P ) ∪ V (Q)| is minimized. Thus no node of Q \ {q l } has a neighbor in P , and the only nodes of H that can have a neighbor in

Q \ {q 1 } are h 1 , h 2 , h t , h t+1 . First suppose that k = 1. W.l.o.g. q 1 has a neighbor h i in h 3 • • • h t-1 . Some node q j of Q must be adjacent to one of h 1 , h t+1 , else Q ∪ {p 1 , h 1 , h t+1 , h i , x} induces a square-3P C(x, p 1 ).
Let j be the smallest such index; say q j is adjacent to h 1 . Then q j is not adjacent to h t+1 , else {q 1 , . . . , q j , x, h 1 , h i , h t+1 } induces a square-3PC(x, q j ). By the choice of j, node q 1 is not adjacent to h t+1 . Then j < l, else {q 1 , . . . , q j , p 1 , h 1 , h i , h t+1 , x} induces a 3PC(h 1 p 1 q j , x).

Then q 1 has a neighbor in h t+2 • • • h n , else {p 1 , q 1 , . . . , q j } ∪ H \ {h 2 , . . . , h i-1 } contains a 3P C(h t h t+1 p 1 , h 1 ). It follows that q 1 is either of Type 4, or of Type 5 not adjacent to any of h 1 , h 2 , h t , h t+1 . By Claim 2 applied to Q∪ {p 1 }, some node q s of Q\{q 1 } has a neighbor in H, and we choose the smallest such s. By Claim 2 applied to q 1 • • • q s , we have N H (q s ) ⊆ N H (q 1 ), which is possible only if q 1 is of Type 4 with a neighbor in {h 1 , h 2 , h t , h t+1 }; so, up to symmetry, N H (q 1 ) = {h n , h 1 , h i , h i+1 }, 2 < i < t. Let R be the shortest path from q 1 to h t+1 in the subgraph induced by Q ∪ {p 1 , h t+1 }. If n > t + 2, then R ∪ {h t+2 , . . . , h n , x} induces an odd wheel with center x, while if n = t + 2 then R ∪ {h n , x, h i } induces a 3P C(xh t+1 h t+2 , q 1 ), a contradiction. Therefore we must have k ≥ 2, and p 1 and p k are of Type 2. Now we show that either p 1 or p k is the only neighbor of q l in P . For suppose the contrary. Let a, b be respectively the smallest and largest integers such that q l is adjacent to nodes p a and p b of P . So either a = b or 1 < a = b < k. Let j be the largest integer such that q j has a neighbor in H. We can apply Claim 2 to paths

P a = p 1 • • • p a q l • • • q j and P b = p k • • • p b q l • • • q j .
Since N H (q j ) cannot be a subset of both N H (p 1 ) and N H (p k ), this implies that either N H (q j ) = {h 1 , h 2 , h t , h t+1 } or N H (q j ) = {h i , h i+1 } for some i. In the first case, {q 1 , . . . , q j } contradicts the minimality of P ∪ Q. So we have the second case. If i = 1, then {p b , . . . , p k } ∪ Q contradicts the minimality of P ∪ Q. If i = t we have a similar contradiction. If i / ∈ {1, t}, then the parity condition of Claim 2 (ii) is violated by one of P a , P b . Therefore, and up to symmetry, we may assume that p k is the only neighbor of q l in P .

Put p k = q l+1 . Let r be the largest index such that a node q r of Q has a neighbor in H \ {h t , h t+1 }. Along the path q r+1 • • • q l+1 , let s be the smallest index such that q s has a neighbor in H. By the choice of q r , we have N H (q s ) ⊆ {h t , h t+1 }, and q s is of Type 1 or 2. W.l.o.g., q s is adjacent to h t . By Claim 2 applied to path q r • • • q s , we have either case (a) nodes q r , q s are both of Type 1, or (b) nodes q r , q s are both of Type 2, or (c) N H (q s ) ⊆ N H (q r ). More precisely: In case (a), we have N H (q s ) = {h t } and N H (q r ) = {h i } for some even i = t. Suppose

t + 2 ≤ i ≤ n. So r = 1. If s = l, then P ∪ Q ∪ {x, h 2 , h t , h i } induces a 3PC(p k q l h t , x). If s < l then P ∪ {q 1 , . . . , q s } ∪ {h t , . . . , h n , h 1 } induces a 3PC(p k h t h t+1 , h i ). Thus 2 ≤ i ≤ t -2.
In case (b), we have N H (q s ) = {h t , h t+1 } and N H (q r ) = {h i , h i+1 } for some odd i. If i = 1, then r > 1 and {q 1 , q 2 , . . . , q s } contradicts the minimality of P ∪ Q. Thus we may assume w.l.o.g. that 3 ≤ i ≤ t -1. In case (c), we have either case (c1) node q r is of Type 2 or 3 adjacent to h t-1 and h t , or (c2) node q r is of Type 4 with N H (q 1 ) = {h i , h i+1 , h t , h t+1 } for some odd i with 3 ≤ i ≤ t -3, or (c3) node q r is of Type 4 and not adjacent to one of h t , h t+1 , or (c4) node q r is of Type 5 adjacent to h t and h i for some even i = t -2, t, t + 2. In case (c3), {q r , . . . , q l , p k } contradicts the minimality of P ∪ Q. In case (c4), suppose t + 2 ≤ i ≤ n. If r = l, then P ∪ {q r , x, h 2 , h t , h i } induces a 3PC(p k q l h t , x), while if r < l then P ∪ {q r } ∪ {h t , . . . , h n , h 1 } induces a 3PC(p k h t h t+1 , h i ). Thus 2 ≤ i ≤ t -2. So we have cases (a), (b), (c1), (c2) or (c4), and in either case there is an index i, with 2 ≤ i ≤ t -1, such that q r is adjacent to h i and N H (q r ) ⊆ {h i , . . . , h t+1 }. Now, if h t+1 has no neighbor in q r • • • q l , then P ∪ (H \ {h i+1 , . . . , h t }) ∪ {q r , . . . , q l } induces a 3P C(h 1 h 2 p 1 , p k ). If h t+1 has a neighbor in q r • • • q l-1 , then P ∪ (H \ {h i+1 , . . . , h t }) ∪ {q r , . . . , q l-1 } contains a 3P C(h 1 h 2 p 1 , h t+1 ). So q l is the unique neighbor of h t+1 in q r • • • q l . If i = 2, then P ∪ {q r , . . . , q l , x, h 2 , h t+1 } induces a 3P C(h t+1 p k q l , h 2 ). If i > 2, then P ∪ {q r , . . . , q l , x, h 1 , h i , h t+1 } induces a 3P C(h t+1 p k q l , x). This proves the claim.

2

For i = 1, . . . , n, let H i be the set of Type 3 nodes of C adjacent to h i , h i+1 , h i+2 (indices taken modulo n). Note that H i induces a clique, for if a, b ∈ H i are not adjacent, then {a, b, x, h i , h i+2 } induces a square-3P C(h i , h i+2 ).

Claim 4 Let h s , h t be non-adjacent nodes of H and P = y • • • z be a chordless path in C such that y is the only neighbor of h s in P and z is the only neighbor of h t in P . If both h s-1 , h s+1 have a neighbor in P , then N H (y) = {h s-1 , h s , h s+1 }.

Proof. We may assume up to symmetry that s = 2 and t = 4. Let H ′ be the hole induced by P ∪ {x, h 2 , h t }. Since (H ′ , h 3 ) cannot be an odd wheel, (H ′ \ {x}) ∪ {h 3 } must contain an odd number of triangles. Let R be any long sector of (H ′ , h 1 ). If R ∪ {h 3 } contains an odd number of triangles and R contains at least three neighbors of h 3 , then R ∪ {h 1 , h 3 } induces an odd wheel with center h 3 . If R contains only two adjacent neighbors a, b of h 3 , then R cannot contain x and h t ; and then, if R does not contain h 2 then R ∪ {h 1 , h 3 , x} induces a 3PC(h 3 ab, h 1 ), while if R contains h 2 then {a, b} = {h 2 , y} and R ∪ {h 1 , h 3 , x} induces an odd wheel with center h 2 . Thus R ∪ {h 3 } contains an even number of triangles for every long sector R of (H ′ , h 1 ). It follows that some edge of H ′ \ {x} is a short sector of both (H ′ , h 1 ) and (H ′ , h 3 ), and thus some node of P is adjacent to h 1 and h 3 ; by Claims 1 and 3, such a node is of Type 3 adjacent to h 1 , h 2 , h 3 and so it can only be y. This proves the claim.

2

Claim 5 Let u be a node of C that has a neighbor in

h 4 • • • h n . Let P = p 1 • • • p k be a path of C such that p k = u, p 1 ∈
≥ 3. Furthermore, if Q = q 1 • • • q l is any other path of C such that q l = u, q 1 ∈ H 1 and no node of Q \ {q 1 } belongs to H 1 , then h 1 has a neighbor in Q \ {q 1 }.

Proof.

For let h i be any neighbor of u in h 4 • • • h n , and let j be the smallest index such that h i is adjacent to p j . Suppose that neither h 1 nor h 3 has a neighbor in p 2 • • • p j . If i / ∈ {4, n}, then {p 1 , . . . , p j , h 1 , h 3 , h i , x} induces a square-3P C(p 1 , x). Otherwise, w.l.o.g. i = 4, and hence the same node set induces a 3P C(h 3 h 4 x, p 1 ). Therefore h 1 or h 3 must have a neighbor in P \ {p 1 }.

Suppose that both h 1 and h 3 have a neighbor in P \ {p 1 }. If they both have a neighbor in P \ {p 1 , p 2 }, then there is a shortest subpath P ′ of P \ {p 1 , p 2 } whose one endnode is adjacent to h 1 and the other to h 3 , and hence P ′ ∪ {p 1 , x, h 1 , h 3 } induces a square-3P C(h 1 , h 3 ). So we may assume w.l.o.g. that p 2 is the unique neighbor of h 1 in P \ {p 1 }. Let p t be the node of P with lowest index adjacent to h 3 . If t = 2, then Claim 1 implies p 2 ∈ H 1 , a contradiction. So t > 2, and hence {p 1 , . . . , p t , h 1 , h 3 , x} induces a 3P C(p 1 p 2 h 1 , h 3 ). Therefore, not both h 1 and h 3 can have a neighbor in P \ {p 1 }.

Assume w.l.o.g. that h 1 has a neighbor in P \{p 1 }. Suppose that p 2 is the unique neighbor of h 1 in P \{p 1 }. If a node h t , 4 < t < n, has a neighbor in P , then P ∪{h 1 , h 3 , h t , x} contains a 3P C(h 1 p 1 p 2 , x). So no node of h 5 • • • h n-1 has a neighbor in P . If h n has no neighbor in p 1 • • • p j , then i = 4 and hence {p 1 , . . . , p j , x} ∪ (H \ {h 2 , h 3 }) induces an odd wheel with center x. So h n has a neighbor in p 1 • • • p j . Let p t be such a neighbor with smallest index. If t < j or t = j and p j is not adjacent to h 4 , then {p 1 , . . . , p t , x} ∪ (H \ {h 1 , h 2 }) induces an odd wheel with center x. So t = j and p j is adjacent to h 4 . Hence {p 1 , . . . , p j , h 3 , h 4 , h n , x} induces a 3P C(h 3 h 4 x, p j ). Therefore, h 1 has a neighbor in P \ {p 1 , p 2 }. Now suppose that h 1 does not have a neighbor in Q \ {q 1 }. Then h 3 must have a neighbor in Q \ {q 1 , q 2 }, and hence (P \ {p 1 , p 2 }) ∪ (Q \ {q 1 , q 2 }) ∪ {h 1 , h 3 } contains a chordless path R from h 1 to h 3 . But then R ∪ {p 1 , x} induces a square-3P C(h 1 , h 3 ). This proves the claim. 2

Suppose that H 1 = ∅. Let u be any node of C that has a neighbor in h 4 • • • h n . Then there exists a path Proof. Suppose, up to symmetry, that some node u of C adjacent to h 4 is labeled 1 w.r.t.

P = p 1 • • • p k in C such that p k = u, p 1 ∈ H 1 ,
H 1 . Let P = p 1 • • • p k be a path of C such that p 1 ∈ H 1 , p k = u,
and no node of P \ {p 1 } belongs to H 1 . Then h 3 has no neighbor in P \ {p 1 }. Let p j be the node of P with lowest index adjacent to h 4 . By Claim 5, we have j ≥ 3 and h 1 has a neighbor in p 3 • • • p j . But then {p 1 , p 3 , . . . , p j , h 1 , h 3 , h 4 , x} contains a 3P C(h 3 h 4 x, h 1 ). This proves the claim. 2

Claim 7 No node of C is of Type 3.

Proof. Assume the contrary. W.l.o.g.

H 1 = ∅. Suppose that H 3 = ∅. Let P = p 1 • • • p k be a shortest path in C from a node p 1 of H 1 to a node p k adjacent to h 4 .
So no node of P \ {p 1 } belongs to H 1 , and no node of P \ {p k } is adjacent to h 4 . By Claims 5 and 6, we have k ≥ 3, node h 3 has a neighbor in P \ {p 1 , p 2 }, node h 1 has no neighbor in P \ {p 1 }, and so, by Claim 6 again, h n has no neighbor in P . Then h 5 has no neighbor in P , else by Claim 4, applied to h 4 and P , we should have p k ∈ H 3 . Some node of h 6 , . . . , h n-1 must have a neighbor in P , else P ∪ (H \ {h 2 , h 3 }) ∪ {x} induces an odd wheel with center x. Let h i be such a node with smallest index. If i is odd, then P ∪ {h 4 , . . . , h i , x} contains an odd wheel with center x. So i is even. If h i has a neighbor in P \ {p k }, then (P \ {p k }) ∪ {h 3 , . . . , h i , x} contains an odd wheel with center x. So p k is the only neighbor of h i in P . By Claims 1 and 3, node h 3 cannot be adjacent to p k . But then

P ∪ {h 3 , h 4 , h i , x} contains a 3PC(xh 3 h 4 , p k ), a contradiction. So H 3 = ∅.
Repeating this argument, we obtain that H i = ∅ for each odd i. Let y • • • z be any shortest path in C from a node y of H 1 to a node z of H 3 . By Claim 6, z is labeled 3 w.r.t. H 1 , and y is labeled 3 w.r.t. H 3 . So there exists a largest odd integer i such that C contains a chordless path

P = p 1 • • • p k from a node p 1 of H 1 to a node p k of H i , with no intermediate nodes in H 1 ∪ H i , such that p k is labeled 3 w.r.t. H 1 and p 1 is labeled i w.r.t. H i .
In particular, by Claim 5, we have k ≥ 3, node h i has a neighbor in P \ {p k , p k-1 } and h i+2 has no neighbor in P \ {p k }. Also since p k is labeled 3 w.r.t. H 1 , and since by Claim 6 all nodes of H n-1 are labeled 1 w.r.t. H 1 , it follows that i < n -1. Since H i+2 = ∅, there exists a shortest path Q = q 1 • • • q l in C such that q 1 ∈ H i+2 and q l has a neighbor in P . Node q 1 is not adjacent to p k , for otherwise {x, h i+1 , h i+2 , h i+3 , p k , q 1 } induces an odd wheel.

Suppose that q l is not adjacent to p k . If q l has a neighbor in

P \ {p k , p k-1 }, then (P \ {p k-1 }) ∪ Q ∪ {h i , h i+2 , x} contains a square-3P C(h i , h i+2 ). So N (q l ) ∩ P = {p k-1 }. Let Q ′ = q ′ 1 • • • q ′ t
be the path induced by (P \ {p k }) ∪ Q, where q ′ 1 = q 1 and q ′ t = p 1 . Suppose that q 1 is labeled 1 w.r.t. H 1 . By Claim 5 applied to Q ′ , this is possible only if p k is the only neighbor of h 3 in P , so i = 3, and h 1 has a neighbor in Q. Then k = 3, for otherwise

Q ∪ {x, h 1 , h 3 , p 1 , p k-1 , p k } contains a square-3P C(h 1 , h 3 ). But then {x, h 3 , h 6 } ∪ P ∪ Q contains a square-3P C(h 3 , p 2 ). So q 1 is labeled 3 w.r.t
′ \ {q ′ 1 , q ′ 2 }, and h i+2 has no neighbor in Q ′ \ {q ′ 1 }. If l > 1, then (Q ′ \ {q ′ 2 }) ∪ {p k , h i+2 , h i+4 , x} contains a square-3P C(h i+2 , h i+4 ). So l = 1. But then P ∪ {q 1 , h 2 , h i+2 , x} contains a square-3P C(p k-1 , h i+2 ). Therefore, q l must be adjacent to p k . Thus l ≥ 2.
Let p j be the node of P with smallest index adjacent to q l . Let Q ′ = q ′ 1 • • • q ′ t be the path induced by Q ∪ {p 1 , . . . , p j }, where q ′ 1 = q 1 and q ′ t = p 1 . Note that h 1 cannot have a neighbor in Q, since otherwise

(P \ {p 2 }) ∪ Q ∪ {h 1 , h 3 , x} contains a square-3P C(h 1 , h 3 ). So node q ′ 1 must be labeled 3 w.r.t. H 1 . Node q ′
t must be labeled i + 4 w.r.t. H i+2 , else the maximality of i is contradicted. So, by Claim 5, we have t ≥ 3, node h i+4 has a neighbor in

Q ′ \ {q ′ 1 , q ′ 2 }, and h i+2 has no neighbor in Q ′ \ {q ′ 1 }. But then P ∪ (Q \ {q 2 }) ∪ {h i+2 , h i+4 , x} contains a square-3P C(h i+2 , h i+4
). This proves the claim.

2

By Claims 1, 3 and 7, the nodes of C that have a neighbor in H are of Type 1, 2 or 5. Let C ′ be a minimal connected induced subgraph of C such that for some s, t ∈ {1, . . . , n} node h t is not adjacent to h s nor h s+1 , and each of h s , h s+1 , h t has a neighbor in C ′ . W.l.o.g.

s = 1. Let P = p 1 • • • p k be a shortest path in C ′ such that h 1 is adjacent to p 1 and h 2 to p k . Suppose that k = 1. So p 1 is of Type 2. Let Q = q 1 • • • q l be a path in C ′ such that q 1 has a neighbor in H \ {h n , h 1 , h 2 , h 3 } and q l is adjacent to p 1 . Thus C ′ = Q ∪ {p 1 }, and no node of Q \ {q 1 } has a neighbor in H \ {h n , h 1 , h 2 , h 3 }. If both h 1 , h 2 have a neighbor in Q, then Q contradicts the minimality of C ′ .
So we may assume that h 1 has no neighbor in Q. Then h n has no neighbor in Q ∪ {p 1 }, for otherwise a subpath of Q ∪ {p 1 } violates Claim 2 or 3. If h 2 too has no neighbor in Q, then similarly h 3 has no neighbor in Q ∪ {p 1 }, and then by Claim 2, H ∪ Q ∪ p 1 induces a 3P C(∆, ∆), contradicting Claim 3. So h 2 has a neighbor in Q. Let h t be the node of H \ {h n , h 1 , h 2 , h 3 } with highest index adjacent to q 1 . Then Q ∪ {h t , . . . , h n , h 1 , h 2 } and Q ∪ {h 1 , h 2 , h t , x} induce two wheels with center h 2 , one of which is odd, a contradiction. So k > 1.

Let Q = q 0 • • • q l be a shortest path such that q 0 ∈ H \ {h n , h 1 , h 2 , h 3 }, Q \ {q 0 } ⊆ C ′ , and q l has a neighbor in P (possibly l = 0). So if l > 0, no node of P ∪ Q \ {q 0 , q 1 } has a neighbor in H \ {h n , h 1 , h 2 , h 3 }. Note that C ′ = P ∪ Q \ {q 0 }.

Suppose that h 1 has a neighbor in Q. So l > 0. Let h t be the node of h 4 • • • h n-1 with smallest index adjacent to q 1 . Then, by the minimality of C ′ , N (q l ) ∩ P = {p 1 } and h 2 has no neighbor in Q. If h 3 has no neighbor in P ∪ Q, then P ∪ (Q \ {q 0 }) ∪ {h 1 , h 2 , . . . , h t } or P ∪ (Q \ {q 0 }) ∪ {x, h 1 } induces an odd wheel with center h 1 . So h 3 has a neighbor in P ∪ Q. Then Claim 4, applied to h 2 and P ∪ Q, implies that p k is of Type 3, a contradiction. Therefore h 1 cannot have a neighbor in Q, and similarly neither can h 2 .

If q l has exactly one neighbor p a in P , then P ∪Q∪{h 1 , h 2 , x} induces a 3P C(h 1 h 2 x, p a ). If q l has two non-consecutive neighbors in P , then the same node set contains a 3P C(h 1 h 2 x, q l ). So N (q l ) ∩ P = {p a , p a+1 }. Node h 3 must have a neighbor in P , else P ∪ Q ∪ {h 1 , h 2 , . . . , q 0 } contains a 3P C(q l p a p a+1 , h 2 ). By Claim 1, h 3 cannot be adjacent to p 1 . Now h 2 , h 3 , q 0 all have a neighbor in C ′ \ {p 1 }, which is connected, and so the minimality of C ′ implies q 0 = h 4 .

Then N (h 3 ) ∩ P = {p k }, else h 1 , h 3 , h 4 all have a neighbor in C ′ \ {p k }, contradicting the minimality of C ′ . But then P ∪ {h 1 , h 2 , h 3 , x} induces an odd wheel with center h 2 . This completes the proof of the theorem. 2

4 On the complexity of several detection problems Step 1. Compute the set X 1 of those nodes of V (G) that are adjacent to b 1 and not adjacent to u, b 2 or b 3 , and the similar sets X 2 , X 3 , and compute the set X of those nodes of V (G) that are not adjacent to any of u, b 1 , b 2 , b 3 . Compute the connected components of X in G. For each component H of X, and for i = 1, 2, 3, if some node of H has a neighbour in X i then mark H with label i.

Step 2. For every component H of X that has received label i ∈ {1, 2, 3}, and for every node x of X i that has a neighbour in H, assign to x the other labels of H (if any). For each i = 1, 2, 3 and for every node x of X i that has a neighbour in X j with j ∈ {1, 2, 3} and j = i, assign label j to x.

Step 3. If some node of X 1 ∪ X 2 ∪ X 3 gets two different labels, return the positive answer and stop.

If the positive answer has not been returned at step 3, return the negative answer. Conversely, suppose that the algorithm returns the positive answer when it is examining a u-centered claw {x, b 1 , b 2 , b 3 }. So (up to symmetry) some node c 1 ∈ X 1 gets labels 2 and 3 at step 2. This means that for j = 2, 3, there exists a path R j from c 1 to a node of X j such that the interior nodes of R j (if any) lie in X. We can apply Lemma 4.1 to the to the claw {u, b 1 , b 2 , b 3 } and the set W = V (R 2 ) ∪ V (R 3 ), which implies that this subgraph (and thus G itself) contains a long 3P C(∆, •) or a 3P C(•, •) (that is non-square because the c i 's are pairwise distinct). This completes the proof of correctness.

Finding all 4-tuples takes time O(n 4 ). For each 4-tuple, computing the sets X 1 , X 2 , X 3 , X takes time O(n 2 ). Finding the components of X takes time O(n 2 ). Marking the components at the end of step 1 can be done as follows: for each edge uv of G, if u is in a component H of X and v is in some X i then mark H with label i. This takes time O(n 2 ). Marking the nodes of X 1 ∪ X 2 ∪ X 3 at step 2 can be done similarly. Thus the overall complexity is O(n 6 ). 2

Step

1. Compute in V (G) \ (N (b) ∪ N (c) ∪ N (e)) a shortest path P from a to d (if any). Compute in V (G) \ (N (b) ∪ N (a) ∪ N (d)) a shortest path Q from c to e (if any
). If at least one of the paths does not exist, go to the next 5-tuple.

Step 2. Check if the edge-set of G[V (P ) ∪ V (Q) ∪ {a, b, c, d, e}] is exactly E(P ) ∪ E(Q) ∪ {bd, be, de}. If it does not, go to the next 5-tuple.

Step 3. For every node u of G, check if ua, ub and uc are the only edge from u to V (P ) ∪ V (Q) ∪ {a, b, c, d, e}. If it is the case, return the positive answer and stop. Else, go to the next 5-tuple.

If after checking every 5-tuple, the positive answer has not been returned, return the negative answer.

Complexity: O(n 7 ).

Proof. If the algorithm gives the positive answer, let us consider the 5-tuple (a, b, c, d, e), the paths P, Q, and the node u that make the algorithm stop. It is clear by the method that V a,b,c,d,e), then let us examine what the algorithm will do when checking the 5-tuple (a, b, c, d, e). By two applications of lemma 4.2, we see that the two paths computed by the algorithm can take the place of the corresponding paths of K, to give another short 3P C(∆, •) K ′ (possibly not K) with apex u. So, since u exists, the algotithm will find a node that has same neighbourhood that u (in K ′ ) and give the positive answer. This proves the correctness of the algorithm. Checking every 5-uple takes O(n 5 ), compute shortest paths takes O(n 2 ), checking every possible edge at step 2 takes O(n) 2 , checking every u at step 3 take O(n), and checking every neighbour of u takes O(n). So the overall complexity is O(n 7 ).

(P ) ∪ V (Q) ∪ {a, b, c, d, e} induces a short 3P C(∆, •). Conversely, if G has a short 3P C(∆, •) K with frame (u,
2

By the algorithms above, we obtain:

NP-completeness results

Let us call problem Π the decision problem whose input is a graph G and two non-adjacent nodes a, b of G of degree 2 and whose question is: "Does G have a hole that contains both a, b?" Bienstock [START_REF] Bienstock | On the complexity of testing for odd holes and induced odd paths[END_REF] proved that this problem is NP-complete. Adapting Bienstock's proof, Maffray and Trotignon [START_REF] Maffray | Algorithms for perfectly contractile graphs[END_REF] remarked that the problem remains NP-complete for triangle-free graphs. Here is an easy consequence: •) in H has apex a. So there is a short 3P C(∆, •) in H if and only if there is a hole passing through a and b in G. Similarly, there is an odd wheel in H if and only if there is a hole passing through a and b in G. Thus, Algorithm A (or A ′ ) yields a polynomial time algorithm that solves the NP-complete problem Π.

2

When k ≥ 2, a kP C(∆, •) is a graph induced by k chordless paths P 1 , . . . , P k , such that each path P i is from a node x to a node y i = x, the nodes y 1 , . . . , y k are distinct and pairwise adjacent, and the union of any two paths P i , P j induces a hole. Note that this latter condition implies that at most one of the paths P 1 , . . . , P k can have length 1.

When k ≥ 2, a kP C(•, •) is a graph induced by k chordless paths P 1 , . . . , P k , such that they all have the same endnodes, and the union of any two paths P i , P j induces a hole.

For any integer n ≥ 1, let K 1,n denote the graph on n + 1 nodes with n edges and a node of degree n. Adapting the proof of Bienstock, we prove that Π remains NP-complete for K 1,4 -free graphs. Before presenting the proof of this result, we point out that Problem Π is polynomial for K 1,3 -free graphs. To see this, consider an instance (G, a, b) of Π where G is K 1,3 -free. Consider the graph G ′ obtained from G by adding a node c of degree 2 adjacent to a and b. It is easy to see that G contains a hole going through a and b if and only if G ′ contains a 3P C(•, •). Since this last problem is polynomial [START_REF] Chudnovsky | Testing for a theta[END_REF], Π is polynomial when restricted to K 1,3 -free graphs.

Theorem 4.5 Problem Π is NP-complete for K 1,4 -free graphs.

Proof. Let us give a polynomial reduction from the problem 3-Satisfiability of Boolean functions to problem Π restricted to K 1,4 -free graphs. Recall that a Boolean function with n variables is a mapping f from {0, 1} n to {0, 1}. A Boolean vector ξ ∈ {0, 1} n is a truth assignment for f if f (ξ) = 1. For any Boolean variable z on {0, 1}, we write z := 1z, and each of z, z is called a literal. An instance of 3-Satisfiability is a Boolean function f given as a product of clauses, each clause being the Boolean sum ∨ of three literals; the question is whether f admits a truth assignment. The NP-completeness of 3-Satisfiability is a fundamental result in complexity theory, see [START_REF] Garey | Computer and intractability : A guide to the theory of NPcompleteness[END_REF].

Let f be an instance of 3-Satisfiability, consisting of m clauses C 1 , . . . , C m on n variables z 1 , . . . , z n . Let us build a graph G f with two specialized nodes a, b, such that there will be a hole containing a and b in G if and only if there exists a truth assignment for f .

For each variable z i (i = 1, . . . , n), make a graph G(z i ) with four nodes a i , b i , a ′ i , b ′ i , and 4(m + 2) nodes t i,j , f i,j , t ′ i,j , f ′ i,j , with j ∈ {0, . . . , m + 1}. Add edges so that the four sets {a i , t i,0 , t i,1 , . . . , t i,m+1 , b i }, {a i , f i,0 , f i,1 , . . . , f i,m+1 , b i }, {a ′ i , t ′ i,0 , t ′ i,1 , . . . , t ′ i,m+1 , b ′ i }, {a ′ i , f ′ i,0 , f ′ i,1 , . . . , f ′ i,m+1 , b ′ i } all induce paths (and the nodes appear in this order along these paths). Add four more edges t i,0 f ′ i,0 , t ′ i,0 f i,0 , t i,m+1 f ′ i,m+1 , t ′ i,m+1 f i,m+1 to form G(z i ). See Figure 1.

For each clause C j (j = 1, . . . , m), with C j = y 1 j ∨ y 2 j ∨ y 3 j , where each y p j (p = 1, 2, 3) is a literal from {z 1 , . . . , z n , z 1 , . . . , z n }, make a graph G(C j ) with fourteen nodes c j , d j , u 1 j , v 1 j , w 1 j , x 1 j , u 2 j , v 2 j , w 2 j , x 2 j , u 3 j , v 3 j , w 3 j , x 3 j . Add edges so that the three sets {c j , u 1 j , v 1 j , w 1 j , x 1 j , d j }, {c j , u 2 j , v 2 j , w 2 j , x 2 j , d j }, {c j , u 3 j , v 3 j , w 3 j , x 3 j , d j }, all induce paths (and the nodes appear in this order along these paths). Add six more edges so that {u 1 j , u 2 j , u 3 j }, {x 1 j , x 2 j , x 3 j } induce two triangles. See Figure 2.

t i,0 t i,m+1 t i,1 t i,m a i f i,0 f i,m+1 f i,1 f i,m b i t ′ i,0 t ′ i,m+1 t ′ i,1 t ′ i,m a ′ i f ′ i,0 f ′ i,m+1 f ′ i,1 f ′ i,m b ′ i
f i,j f ′ i,j t i,0 t i,m+1 t i,1 t i,m a i f i,0 f i,m+1 f i,1 f i,m b i t ′ i,0 t ′ i,m+1 t ′ i,1 t ′ i,m a ′ i f ′ i,0 f ′ i,m+1 f ′ i,1 f ′ i,m b ′ i c j d j u 1 j v 1

Theorem 2 . 1

 21 denotes the subgraph of G induced by the node set A. G\A denotes the subgraph of G obtainbed by removing the node set A, i.e. G \ A = G[V (G) \ A]. Let G be a square-3P C(•, •)-free Berge graph. Let x be a node of G such that N (x) contains a long hole H, and let C be any connected component of G \ N [x]. Then some node of H has no neighbor in C.

Theorem 3 . 2

 32 Let G be a square-3P C(•, •)-free even-signable graph. Let x be a node of G such that N (x) contains a long hole H, and let C be any connected component of G\ N [x].Then some node of H has no neighbor in C.

2 Claim 3 C

 23 and H ′ is of odd length, and then P ∪ H ′ ∪ {x} induces an odd wheel with center x. This proves the claim. does not contain a path P = p 1 • • • p k such that either k = 1 and p 1 is of Type 4 or k ≥ 2 and H ∪ P induces a 3P C(∆, ∆).

Lemma 4 . 1 2

 412 Let G be a graph with four nodes u, a, b, c and a set W ⊆ V (G) \ {u, a, b, c} such that:• {u, a, b, c} induces a claw centered at u;• W induces a connected subgraph of G;• u has no neighbour in W ;• Every node in {a, b, c} has exactely one neighbour in W . Then, G contains a 3P C(•, •) or a long 3P C(∆, •). Proof. Let a ′ , b ′ , c ′ be the neighbours of a, b, c in W . If a ′ = b ′ = c ′ , then {u, a, b, c, a ′ } induces a 3P C(u, a ′ ). Now we may assume a ′ = b ′ . Then G[W ] contains a path with ends a ′ and b ′ , and we let P be a shortest such path. Let Q = c ′ , . . . , v be a path in G[W ] such that v has a neighbour in P and no node of Q \ v has a neighbor in P . Such a Q exists because W is connected (possibly c ′ = v). Let d (respectively e) be the neighbour of v in P closest to a ′ (respectively to b ′ ). Let T be the graph induced by P ∪ Q ∪ {u, a, b, c}. If d = e, then T is a 3P C(d, u). If d, e are distinct and adjacent then T is a long 3P C(vde, u). If d, e are distinct and non-adjacent then T contains a 3P C(v, u). Now we can give an O(n 6 ) algorithm for the detection of non-square-3P C(•, •)'s or long 3P C(∆, •)'s, very similar to an O(n 5 ) algorithm by Maffray and Trotignon [21] that detects 3P C(∆, ∆)'s or 3P C(∆, •)'s: Input: A graph G. Output: The positive answer "G contains a non-square 3P C(•, •) or a long 3P C(∆, •)" if it does; else the negative answer "G contains no non-square-3P C(•, •) and no long 3P C(∆, •)." Method: For every claw {u, b 1 , b 2 , b 3 } centered at u do:

  Complexity: O(n 6 ). Proof of correctness. Suppose that G contains a non-square-3P C(•, •) or a long 3P C(∆, •), say K. Let u, b 1 , b 2 , b 3 be the four nodes of a u-centered claw of K, and for i = 1, 2, 3 let c i be the neighbour of b i in K \ {u, b 1 , b 2 , b 3 }. Let us observe what the algorithm will do when it examines the 4-tuple {u, b 1 , b 2 , b 3 }. The algorithm will place the three nodes c 1 , c 2 , c 3 in the sets X 1 , X 2 , X 3 respectively. First suppose that K is neither a 3P C(•, •) with one of the paths of length 2 nor a 3P C(∆, •) with all three paths of length 2. Then K \ {u, b 1 , b 2 , b 3 , c 1 , c 2 , c 3 } is contained in a connected component H of X, and all three nodes c 1 , c 2 , c 3 have a neighbor in H, i.e. H gets assigned all three labels 1, 2 and 3. So c 1 gets labels 2 and 3, and hence step 3 returns the positive answer. If K is a 3P C(∆, •) with all three paths of length 2, then K is a 3P C(c 1 c 2 c 3 , u), so by step 2 c 1 gets labels 2 and 3, and hence step 3 returns the positive answer. Finally assume that K is a 3P C(•, •) with one of the paths of length 2. W.l.o.g. K is a 3P C(u, c 1 ). Let H 2 (resp. H 3 ) be the connected component of K \ {u, b 1 , b 2 , b 3 , c 1 , c 2 , c 3 } in which both c 1 and c 2 (resp. c 1 and c 3 ) have a neighbor. Since c 1 has a neighbor in both H 2 and H 3 , in step 2 c 1 gets labels 2 and 3, and hence step 3 returns the positive answer.

Theorem 4 . 3

 43 There is an O(n 7 )-time algorithm that decides whether a graph has a 3P C(•, •) or a 3P C(∆, •).

Theorem 4 . 4

 44 The problem of deciding whether a graph has an odd wheel is NP-complete. The problem of deciding whether a graph has a short 3P C(∆, •) is NP-complete. Proof. Suppose there is a polynomial time algorithm A for the detection of short 3P C(∆, •)'s or an algorithm A ′ for the detection of odd wheels. Let G, a, b be an instance of Π. Let b ′ , b ′′ be the neighbours of b in G. Build a graph H by adding to G nodes c 1 , c 2 , c 3 , c 4 , c 5 and edges c 1 a, c 1 c 2 , c 1 c 3 , c 2 c 3 , c 2 c 4 , c 4 b ′ , c 3 c 5 , c 5 b ′′ . Since G has no triangle, every short 3P C(∆,

Figure 1 : 3 jFigure 2 :

 132 Figure 1: Graph G(z i )

3 jFigure 3 :

 33 Figure 3: The four edges added to G f in the case y 1 j = z i

  G[N ] is not F-free, it contains F ∈ F. By property (*), a node y of F has no neighbor in C k . By Claim 1, y is adjacent to every node of N k , and no node of N \ N k has a neighbor in C = C 1 ∪ . . . ∪ C k . So (since every node of F has a non-neighbor in F ) F must contain another node z ∈ N \ N k , nonadjacent to y. But then C 1 , . . . , C k are connected components of G \ N [y] and z is contained in (G \ N [y]) \ C, so y contradicts the choice of

	x.	2
	Theorem 2.3 Let G be a square-3P C(•, •)-free Berge graph. Let x be a lex-maximal node in G. Then the neighborhood of x in G contains no long hole.
	Proof. Let G be a square-3P C(•, •)-free Berge graph and let x be a lex-maximal node of G. Let F be the set of all long holes of G. By Theorem 2.1, F satisfies property (*) w.r.t. G. So by Theorem 2.2, N (x) is F-free, i.e. long-hole-free. 2

  Note that if u has three pairwise non-adjacent neighbors a, b, c in H, then {x, u, a, b, c} induces a square-3P C(x, u), a contradiction. Therefore N H (u) is covered by at most two cliques of H and s ≤ 4. If s = 1 then u is of Type 1. Suppose s = 2 and u is not of Type 2. Let h i and h j be the two neighbors of u in H. Let H ′ be a subpath of H whose one endnode is h i and the other is h j . If i and j are not of the same parity, H ′ is of odd length greater than one and hence H ′ ∪ {u, x} induces an odd wheel with center x. IfH H (p 1 ) = {h i , h i+1 , h i+2 }, indices taken modulo n, N (p k ) ∩ {h i , h i+1 , h i+2 } = h i ,and p k is of Type 3 or 5. (iv) Nodes p 1 and p k are both of Type 5 and they have a common neighbor in H. Proof. Consider the following property S 3 : there are three pairwise non-adjacent nodes h r , h s , h t of H such that p 1 is adjacent to h r and h s (and thus not to h t ) and p k is adjacent to h t and not to h r , h s . Note that S 3 does not hold, for otherwise P ∪ {h r , h s , h t , x} induces a square-3P C(p 1 , x). By Claim 1, p 1 and p k are of Type 1, 2, 3, 4 or 5. This leads, up to symmetry, to the following case analysis. First suppose that p 1 is of Type 4, with N H (p 1 ) = {h 1 , h 2 , h t , h t+1 } with t even, 4 ≤ t ≤ n -2. If p k is of Type 1, 2 or 5, then S 3 holds. If p k is of Type 3 then either S 3 holds, or N H (p k ) = {h 1 , h 2 , h 3 }, and in this case either k = 2 and {p 1 , p 2 , h 1 , h 3 , h t+1 , x} induces a 3P C(h 1 p 1 p 2 , x) or k > 2 and (H \ {h 2 }) ∪ {p 1 , p k } induces an odd wheel with center p 1 . If p k is of Type 4, then either S 3 holds; or N H (p k ) = {h 1 , h 2 , h s , h s+1 } with s even and 4 ≤ s ≤ t -2 < t ≤ n -2, and in this case either k = 2 and {p 1 , p 2 , h 1 , h s+1 , h t+1 , x} induces a 3P C(h 1 p 1 p 2 , x), or k > 2 and {h s+1 , . . . , h n , h 1 , p 1 , p k } induces an odd wheel with center p 1 ; or N H (p k ) = {h 2 , h 3 , h t+1 , h t+2 }, and in this case either k = 2 and {x, h 1 , h 2 , h 3 , p 1 , p 2 } induces an odd wheel with center h 2 or k > 2 and {x, h 2 , h t+1 , p 1 , p k } induces a square-3PC(h 2 , h t+1 ). Now suppose that p 1 is of Type 3, with N H (p 1 ) = {h 1 , h 2 , h 3 }. If p k is of Type 1, 2 or 3, then either Property S 3 holds, or we have outcome (iii), or p k is adjacent to h 4 and N H (p k ) ⊆ {h 2 , h 3 , h 4 }, and in this case (H \ {h 2 , h 3 }) ∪ P ∪ x induces an odd wheel with center x. If p k is of Type 5 then either S 3 holds, or we have outcome (iii). Now suppose that p 1 is of Type 5, with N H (p 1 ) = {h 1 , h t } and t odd, 5 ≤ t ≤ n -3. If p k is of Type 1 or 2 then either S 3 holds, or p k is adjacent to h 2 and N H (p k ) ⊆ {h 1 , h 2 }, and in this case P ∪ {x, h 2 , . . . , h t } induces an odd wheel with center x. If p k is of Type 5 then either S 3 holds, or we have outcome (iv), or N H (p k ) = {h 2 , h s } with s = t ± 1, and in this case P ∪ {x, h 1 , h 2 , h t } induces a 3PC(xh 1 h 2 , p 1 ).

′ is of length 2, then H ∪ u induces a square-3P C(h i , h j ). So u must be of Type 5. If s = 3 and u is not of Type 3, then (H, u) is an odd wheel. Suppose s = 4 and u is not of Type 4. Then u has four neighbors h i , h i+1 , h j , h j+1 in H where i, j have the same parity. Let H ′ be a subpath of H from h i+1 to h j . H ′ cannot be of length one, since then (H, u) is an odd wheel. So H ′ is of odd length greater than one, and hence H ′ ∪ {u, x} induces an odd wheel with center x. This proves the claim.

2 Claim 2 Let P = p 1 • • • p k be a chordless path in C such that k ≥ 2, nodes p 1 and p k both have neighbors in H, and no node of P \ {p 1 , p k } has a neighbor in H. If N H (p 1 ) ⊆ N H (p k ) and N H (p k ) ⊆ N H (p 1 ), then one of the following holds: (i) N H (p 1 ) = {a}, N H (p k ) = {b} and either ab is an edge or the two subpaths of H \ {a, b} are both of even length. (ii) N H (p 1 ) = {a, b}, N H (p k ) = {c, d}, ab and cd are edges, and the subpaths of H \ {a, b, c, d} are of even length.

(iii) For some i ∈ {1, . . . , n}, N

  and no node of P \ {p 1 } belongs to H 1 . By Claim 5, exactly one of h 1 , h 3 has a neighbor in P \ {p 1 }. If h 1 does then we say that u is labeled 1 w.r.t. H 1 , and otherwise u is labeled 3 w.r.t. H 1 . Note that by Claim 5 this label is unique. Claim 6 If H 1 = ∅, every node of C adjacent to h 4 must be labeled 3 w.r.t. H 1 , and every node of C adjacent to h n must be labeled 1 w.r.t. H 1 .

  . H 1 . If p 1 is labeled i + 2 w.r.t. H i+2 , the maximality of i is contradicted. Hence p 1 is labeled i + 4 w.r.t. H i+2 , and by Claim 5, we have t ≥ 3, node h i+4 has a neighbor in Q

  Chudnovsky and Seymour gave an O(n11 ) to decide if a graph contains a 3P C(•, •)[START_REF] Chudnovsky | Testing for a theta[END_REF] and an O(n 9 ) algorithm to decide if a graph contains a 3P C(∆, •)[START_REF] Chudnovsky | Recognizing Berge graphs[END_REF]. Here we give an O(n 7 ) algorithm that decides whether a given graph has either a 3P C(•, •) or a 3P C(∆, •). Say that a 3P C(∆, •) is long if its three paths have length at least 2. Otherwise, exactly one of its paths has length 1, and we say it is short. Here is a sufficient condition for a graph to have a 3P C(•, •) or a long 3P C(∆, •).

	4.1 Detecting a 3P C(•, •) or a 3P C(∆, •)

Partially supported by EPSRC grant EP/C518225/1.

Detecting square-3P C(•, •)'s is easy to do in time O(n 6 ) as noted in the introduction. So, in order to detect 3P C(•, •)'s or 3P C(∆, •)'s, we are left with the problem of deciding whether a graph has a short 3P C(∆, •). This is an NP-complete problem (proved in the next section) but we can solve it assuming that the graph has no 3P C(•, •) and no long 3P C(∆, •). This could be done in time O(n 9 ) using the algorithm of Chudnovsky and Seymour [START_REF] Chudnovsky | Recognizing Berge graphs[END_REF] that detects 3P C(∆, •). We propose here something faster and simpler but based on the same ideas.

If K is a short 3P C(bde, u) such that u sees b, a is the neighbour of u along the path of K from u to d, and c is the neighbour of u along the path of K from u to e, then we say that (u, a, b, c, d, e) is a frame of K. Lemma 4.2 Let G be a graph with no 3P C(•, •) and no long 3P C(∆, •). Let K be a smallest short 3P C(∆, •) of G with frame (u, a, b, c, d, e). Let P be the path of K \ {u} between a and d. Let R be a shortest path of G between a and d such that the interior nodes of R are not adjacent to b, c, e. Then the graph induced by

Proof. Note that G has no 3P C(∆, •) smaller that K, because it has no long 3P C(∆, •) at all, and because K is a smallest short 3P C(∆, •). Let us denote by r 1 = a, . . . , r k = d the nodes of R. Let r s the neighbour of u in R with greatest index. Note that r s exists because r 1 is a neighbor of u.

We claim that the graph induced by (K \ P ) ∪ {r s , . . . , r k } induces a short 3P C(∆, •). Indeed, let Q be the path of K\{u} with end-nodes c and e. Let us denote by q 1 = c, . . . , q l = e the nodes of Q. If no node of r s . . . r k-1 has neighbours in Q, then the claim holds. So, we may assume that there is a node r t in r s . . . r k-1 that has a neighbour in the interior of Q, and we choose t maximum. Note that t > 1. Let i be the smallest index and j be the greatest index such that q i , q j are neighbors of r t . If t = s, then {r t , . . . , r k , q j , . . . , q l , u, b} induces a 3P C(bde, r t ) that is smaller than K, a contradiction. So t > s. If i = j then Q∪{r t , . . . , r k , u, b} induces a 3P C(bde, q j ) that is smaller than K, a contradiction. If j > i+1 then {r t , . . . , r k , q 1 , . . . , q i , q j , . . . , q l , u, b} induces a 3P C(bde, r t ) that is smaller than K, a contradiction. So j = i + 1. There is a shortest path S with end-nodes r t and a in the graph induced by P ∪ {r t . . . , r k }. If d / ∈ V (S), then Q ∪ S ∪ {u, b} induces a long 3P C(r t q i q j , u), a contradiction. If d ∈ V (S) then S ∪ {q 1 , . . . , q i , b, u} induces a 3P C(d, u), a contradiction. This proves the claim.

We proved that

Now we can give an algorithm for the detection of short 3P C(∆, •)'s in graphs with no 3P C(•, •) and no long 3P C(∆, •):

Output: The positive answer "G contains a short 3P C(∆, •)" if it does; else the negative answer "G contains no short 3P C(∆, •)."

Method:

For every 5-tuple (a, b, c, d, e) of nodes do:

The graph G f is obtained from the disjoint union of the G(z i )'s and the G(C j )'s as follows. For i = 1, . . . , n -1, add edges b i a i+1 and b ′ i a ′ i+1 . Add an edge b ′ n c 1 . For j = 1, . . . , m -1, add an edge d j c j+1 . Introduce the two special nodes a, b and add edges aa 1 , aa ′ 1 and bd m , bb n . See Figure 4. For p = 1, 2, 3, if y p j = z i , then add four edges v p j f i,j , v p j f ′ i,j , w p j f i,j , w p j f ′ i,j , while if y p j = z i then add four edges v p j t i,j , v p j t ′ i,j , w p j t i,j , w p j t ′ i,j . See Figure 3. Clearly the size of G f is polynomial (actually quadratic) in the size n + m of f . Moreover, it is a routine matter to check that G f contains no K 1,4 , and that a, b are non-adjacent and both have degree two.

Suppose that f admits a truth assignment ξ ∈ {0, 1} n . We can build a hole in G by selecting nodes as follows. Select a, b.

where j ∈ {0, . . . , m + 1}. For j = 1, . . . , m, since ξ is a truth assignment for f , at least one of the three literals of C j is equal to 1, say y p j = 1 for some p ∈ {1, 2, 3}. Then select c j , d j and u p j , v p j , w p j , x p j . Now it is a routine matter to check that the selected nodes induce a cycle Z that contains a, b, and that Z is chordless, so it is a hole. The main point is that there is no chord in Z between some subgraph G(C j ) and some subgraph G(z i ), for that would be either an edge t i,j v p j (or similarly t ′ i,j v p j , t i,j w p j , t ′ i,j w p j ) with y p j = z i and ξ i = 1, or, symmetrically, an edge f i v p j (or similarly f ′ i v p j , f i w p j , f ′ i w p j ) with y p j = z i and ξ i = 0, and in either case this would contradict the way the nodes of Z were selected.

Conversely, suppose that G f admits a hole Z that contains a, b. Clearly Z contains a 1 , a ′ 1 since these are the only neighbours of a in G f .

Claim 1 For i = 1, . . . , n, Z contains exactly 2m+8 nodes of G i : four of these are a i , a ′ i , b i , b ′ i , and the others are either the t i,j , t ′ i,j 's or the f i,j , f ′ i,j 's where j ∈ {0, . . . , m + 1}. Proof. First we prove the claim for i = 1. Since a, a 1 are in Z and a 1 has only three neighbours a, t 1,0 , f 1,0 , exactly one of t 1,0 , f 1,0 is in Z. Likewise exactly one of t ′ 1,0 , f ′ 1,0 is in Z. If t 1,0 , f ′ 1,0 are in Z then the nodes a, a 1 , a ′ 1 , t 1,0 , f ′ 1,0 are all in Z and they induce a hole that does not contain b, a contradiction. Likewise we do not have both t ′ 1,0 , f 1,0 in Z. Therefore, up to symmetry we may assume that t 1,0 , t ′ 1,0 are in Z and f 1,0 , f ′ 1,0 are not. This implies t 1,1 , t ′ 1,1 ∈ Z. Suppose that for some j ∈ {2, . . . , m + 1} one of t 1,j , t ′ 1,j is not in Z. Let j be minimum with that property and assume up to a symmetry that t 1,j is not in Z. Then t 1,j-1 is in Z and one of v p j , w p j , p ∈ {1, 2, 3}, say v 1 j up to a symmetry, must be in Z. But then, by the definition of G f , v 1 j is adjacent to t ′ 1,j . So, Z has node set {a, t 1,0 , t ′ 1,0 , . . . , t 1,j-1 , t ′ 1,j-1 , v 1 j } and b is not in Z, a contradiction. So, for j = 0, . . . , m + 1, we have t 1,j , t ′ 1,j ∈ Z. Suppose that the neighbor of t 1,m+1 along

This is a contradiction because now t 1,0 has degree 3 in Z. Hence, b 1 ∈ Z and similarly b ′ 1 ∈ Z. This proves our claim for i = 1. The proof of the claim for i = 2 is essentially the same as for i = 1, and by induction the claim holds up to i = n. 2 Claim 2 For j = 1, . . . , m, Z contains c j , d j and exactly one of {u 1 j , v 1 j , w 1 j , x 1 j }, {u 2 j , v 2 j , w 2 j , x 2 j }, {u 3 j , v 3 j , w 3 j , x 3 j }. Proof. First we prove this claim for j = 1. By Claim 1, b ′ n is in Z and exactly one of

for in that case that neighbour would be either t i,1 (or f i,1 ) and thus, by Claim 1, node t ′ i,1 (or f ′ i,1 ) would be a third neighbour of v 1 1 in Z, a contradiction. Thus the other neighbour of v 1 1 in Z is w 1 1 . Similarly, we prove that w 1 1 , x 1 1 , d 1 are in Z, and so the claim holds for j = 1. Since d 1 has degree 4 in G f and exactly one of x 1 1 , x 2 1 , x 3 1 is in Z, it follows that the fourth neighbour c 2 of d 1 is in Z. Now the proof of the claim for j = 2 is the same as for j = 1, and by induction the claim holds up to j = m. 2

We can now make a Boolean vector ξ as follows. For i = 1, . . . , n, if Z contains t i,0 , t ′ i,0

By Claim 1 this is consistent. Consider any clause C j (1 ≤ j ≤ m). By Claim 2 and up to symmetry we may assume that v 1 j is in Z. If y 1 j = z i for some i ∈ {1, .., n}, then the construction of G f implies that f i,j , f ′ i,j are not in Z, so t i,j , t ′ i,j are in Z, so ξ i = 1, so clause C j is satisfied by x i . If y 1 j = z i for some i ∈ {1, .., n}, then the construction of G f implies that t i,j , t ′ i,j are not in Z, so f i,j , f ′ i,j are in Z, so ξ i = 0, so clause C j is satisfied by z i . Thus ξ is a truth assignment for f . This completes the proof of the lemma. 2 Reduction to the detection of a kP C(•, •): Starting from G, build a graph G ′ as follows: Add nodes y 1 , . . . , y k-2 . Add edges ay 1 , . . . , ay k-2 , by 1 , . . . , by k-2 . We see that G ′ contains a kP C(•, •) if and only if G contains a hole that contains a and b. So every instance of Π can be reduced polynomially to an instance of the detection of a kP C(•, •), which proves that this problem is NP-complete. Reduction to the detection of a kP C(∆, •): Starting from G, build the same graph G ′ as above. Subdivide every edge ay i , i ∈ 1, . . . , k -2, by adding a node z i of degree 2. Subdivide edge aa ′ by adding a node a ′′′ of degree 2. Add every possible edge between the nodes of {b ′ , b ′′ , y 1 , . . . , y k-2 }. We see that G ′ contains a kP C(∆, •) if and only if G contains a hole that contains a and b. So every instance of Π can be reduced polynomially to an instance of the detection of a kP C(∆, •), which proves that this problem is NP-complete.

2