Excluding hooks and their complements

The celebrated Erdos-Hajnal conjecture states that for every $n$-vertex undirected graph $H$ there exists $\eps(H)>0$ such that every graph $G$ that does not contain $H$ as an induced subgraph contains a clique or an independent set of size at least $n^{\eps(H)}$. A weaker version of the conjecture states that the polynomial-size clique/independent set phenomenon occurs if one excludes both $H$ and its complement $H^{\compl}$. We show that the weaker conjecture holds if $H$ is any path with a pendant edge at its third vertex; thus we give a new infinite family of graphs for which the conjecture holds.


Introduction
The Erdős-Hajnal conjecture is a long-standing conjecture in Ramsey Theory bringing together extremal, structural and probabilistic aspects of graph theory. Informally it says that if a large graph G does not contain a fixed graph H as an induced subgraph then G contains a large clique or independent set.
More formally, a set of vertices in a graph G is homogeneous if it induces a clique or independent set, and we denote the largest homogeneous set of G by hom(G). Given a graph H (resp. a family of graphs F = {H 1 , H 2 , . . .}), a graph G is said to be H-free (resp. F-free) if G does not contain H (resp. any member of F) as an induced subgraph. The famous Erdős-Hajnal conjecture [21] is the following. Bounds on the diagonal Ramsey numbers due to Erdős-Szekeres [20] and Erdős [18] imply that for a general graph G, hom(G) > 1 2 log 2 n and for every sufficiently large n, there exist n-vertex graphs G satisfying hom(G) 2 log 2 n. Thus the Erdős-Hajnal conjecture suggests that H-free graphs behave quite differently to general graphs with respect to homogeneous sets. The best known bound for the Erdős-Hajnal conjecture is due to Erdős and Hajnal [22] who showed that the conjecture holds if we replace n c(H) with e c(H) √ ln n . Despite much attention, the conjecture is known to hold for only a limited choice of H. We give some brief background here and refer the interested reader to the survey [14] of Chudnovsky. The upper bounds on Ramsey numbers due to Erdős and Szekeres [20] immediately imply that every clique satisfies the Erdős-Hajnal conjecture. In [2], Alon, Pach and Solymosi show that if the conjecture is true for two graphs H 1 and H 2 , then it is also true for the graph formed by blowing up a vertex of H 1 and inducing a copy of H 2 amongst the new vertices. It is known that the Erdős-Hajnal conjecture holds for all graphs on at most four vertices and using the result in [2] immediately implies that the Erdős-Hajnal conjecture holds for all graphs on five vertices except the four-edge path, its complement, the cycle on five vertices, and a graph commonly called the bull (a triangle with two pendant edges). Chudnovsky and Safra [15] settled the conjecture for the bull, but the question remains unsolved for the other three graphs on five vertices.
The following slightly weaker (symmetric) form of the Erdős-Hajnal conjecture can be found e.g. in Chudnovsky [14]. Compared to the Erdős-Hajnal conjecture, this conjecture is known to hold for only a few additional choices of H. Let P k be the path on k vertices. Chudnovsky and Seymour [16] proved Conjecture 2 when H is P 6 . In a recent breakthrough Bousquet, Lagoutte and Thomassé [8] proved the conjecture for all paths. A natural next step is to consider the conjecture for trees. Our main contribution is to generalise their result from k-paths to what we call k-hooks, giving a new infinite family of H for which Conjecture 2 holds. In particular, this allows us to prove Conjecture 2 for all trees on at most 6 vertices as we discuss below.
A k-hook, denoted by H k , is the graph on k + 4 vertices {v 1 , . . . , v k+4 }, where {v 1 , . . . , v k+3 } form a (k + 3)-vertex path, and v k+1 v k+4 is a pendant edge. An illustration can be found in Figure 1a. We call this graph a k-hook (rather than, say, a (k + 3)-hook), since it is more convenient to treat it like a k-vertex path with a hook, i.e. a four-vertex path, attached to it.
Theorem 3. For every k 1 there exists c k such that if G is an n-vertex {H k , H c k }-free graph then hom(G) > n c k .
From Theorem 3, we deduce the following. Let us check that Theorem 4 follows from Theorem 3. The Erdős-Hajnal conjecture, and hence Conjecture 2, is known to hold for all trees on at most five vertices except P 5 , for which Conjecture 2 was shown to hold in [16]. There are six non-isomorphic trees on six vertices, which are depicted in Figure 2. The trees T 1 , T 2 , and T 3 can be obtained by the substitution operation discussed earlier by substituting independent sets into P 3 or P 4 , so it follows (from [2]) that T 1 , T 2 , and T 3 satisfy the Erdős-Hajnal conjecture. The path P 6 satisfies Conjecture 2 by [8]. The tree H 2 satisfies Conjecture 2 by Theorem 3. Finally since T 4 is an induced subgraph of H 3 (which satisfies Conjecture 2 by Theorem 3), then T 4 also satisfies Conjecture 2, so establishing Theorem 4.

Further results
We now describe some results used to prove Theorem 3, which may be of independent interest. A class G of graphs is said to have the (weak) Erdős-Hajnal property if there exists a constant c > 0 such that every graph G ∈ G satisfies hom(G) n c where n is the number of vertices in G. Clearly, Conjecture 1 is equivalent to the statement that, for every graph H, the class of H-free graphs satisfies the Erdős-Hajnal property. Instead of asking for homogeneous sets, one can ask for homogeneous pairs: for a graph G and two disjoint subsets of its vertices P and Q, we say that (P, Q) is a homogeneous pair if every edge between P and Q is present or if every edge between P and Q is absent. In the former case, we call (P, Q) an adjacent pair and in the latter case an anti-adjacent pair. A graph class G has the strong Erdős-Hajnal property if there exists a constant δ > 0 such that every G ∈ G with at least two vertices has a homogeneous pair (P, Q) with |P |, |Q| δ|V (G)|. It is not hard to show (see e.g. [1], [24]) that if a graph class G has the strong Erdős-Hajnal property, then it also has the (weak) Erdős-Hajnal property. We shall prove Theorem 3 by proving that a more general graph class has the strong Erdős-Hajnal property. A double k-hook, denoted by H 2 k , is the graph on k + 8 vertices {v 1 , . . . , v k+8 }, where the vertices {v 1 , . . . , v k+6 } form a (k + 6)-vertex path, and v 3 v k+7 and v k+4 , v k+8 are pendant edges. Again, we prefer to view this graph as a k-vertex path, with a hook attached to each end of the path: hence the name. For an illustration, see Figure 1b. Let H 2 k := {H 2 , (H 2 ) c : k} i.e. the set of double -hooks and their complements for all k. Since the class of {H k , H c k }-free graphs is a subclass of H 2 k -free graphs, Theorem 3 is implied by the following.
Theorem 5. For every k 1, the class of H 2 k -free graphs has the strong Erdős-Hajnal property.
Note that the result in [8] mentioned earlier, that the class of {P k , P c k }-free graphs has the Erdős-Hajnal property, is in fact proved by showing that {P k , P c k }-free graphs have the strong Erdős-Hajnal property. Furthermore, Bonamy, Bousquet and Thomassé [5] show that G k has the strong Erdős-Hajnal property, where G k is the class of graphs that do not contain the cycle C on vertices or its complement C c as an induced subgraph for all k. In the course of the paper, we shall prove that two further hereditary graph classes have the strong Erdős-Hajnal property. We believe these results may be of independent interest. A hole in a graph is an induced cycle of length at least 4 and an antihole is the complement of such a graph. A Berge graph is a graph that does not contain any odd hole or odd antihole. It follows easily from the Strong Perfect Graph Theorem that the class of Berge graphs satisfies the (weak) Erdős-Hajnal property, but a certain random poset construction [23] shows that it does not satisfy the strong Erdős-Hajnal property. However if we also forbid the claw, i.e. the star on four vertices then the strong Erdős-Hajnal property holds. Theorem 6. The class of claw-free Berge graphs has the strong Erdős-Hajnal property.
In [29], Lagoutte and Trunck show that another subclass of Berge graphs has the strong Erdős-Hajnal property. This class of graphs is incomparable to the class of claw-free Berge graphs.
The line graph L(G) of a graph G is the graph with vertex set E(G) where ef is an edge in L(G) if and only if e and f share a vertex in G. While the class of line graphs is a proper subclass of the class of claw-free graphs, it is incomparable to the class of claw-free Berge graphs so the result below gives another hereditary class for which the strong Erdős-Hajnal property holds.
Theorem 7. The class of line graphs has the strong Erdős-Hajnal property.
In fact we shall require weighted versions of Theorem 6 and Theorem 7, which we state and prove in Section 3.
We remark that although the strong Erdős-Hajnal property implies the (weak) Erdős-Hajnal property, there are graphs H such that the class G of H-free graphs satisfies the Erdős-Hajnal property, yet the class of {H, H c }-free graphs (and thus G) fails to satisfy the strong Erdős-Hajnal property. The bull, a self-complementary graph, is such an example, as implied by [15] and the following.  We expect that the result above, which is proved by a simple random construction, is probably known, but we cannot find it recorded anywhere. We give the details in Section 7. While the strong Erdős-Hajnal property requires homogeneous pairs of linear size, if we require homogeneous pairs of only polynomial size, then some strong results are known. In [19], Erdős, Hajnal and Pach improve results from [21] and show that for every graph H there exists c > 0 such that every H-free graph G on n vertices admits a homogeneous pair (P, Q) with |P |, |Q| n c . Fox and Sudakov [26] showed that in fact, every H-free graph G contains either a clique of size n c or an anti-adjacent pair (P, Q) with |P |, |Q| n c .
Finally, we remark that, as shown by Bousquet, Lagoutte, and Thomassé [7], if a hereditary graph class satisfies the strong Erdős-Hajnal property, then it also admits a clique-independent set separation family of polynomial size (for precise definitions we refer the reader to [7]). Consequently, the latter conclusion holds for the family for H 2 k -free graphs for every fixed k 1. We point out that a conjecture of Yannakakis [35], stemming from communication complexity and asserting that every graph admits a cliqueindependent set separation family of polynomial size, was very recently disproved by Göös [27]. Methods. Suppose H is a fixed graph and G is the class of {H, H c }-free graphs. Our first observation, which is essentially expressed in Lemma 19 but also requires a result from [25], is the following. If (for a contradiction) the strong Erdős-Hajnal property does not hold for G, then we may assume that each (connected) n-vertex graph G ∈ G has maximum degree o(n) and a minimal separator (an inclusion-wise minimal set of vertices whose deletion leaves the graph disconnected) of linear size. It immediately follows that G has three disjoint subsets of vertices A, B, S where S has linear size, where every vertex of S has at least one neighbour in A and B, and where there are no edges between A and B.
The next step is to use this additional structure of G to form a hook i.e. an induced path on four vertices and to grow a k-vertex induced path from the third vertex of the hook. This gives an induced copy of H k and the desired contradiction. In order to obtain the k-vertex induced path, we apply the simple but ingenious argument used in Bousquet, Lagoutte, and Thomassé [8] that allows one to grow an arbitrarily long (but constant size) induced path in a connected graph with sublinear maximum degree. The main work in our proof is to set up the hook so that it will not interfere with the path we wish to grow. If such a hook does not exist, then an involved analysis of vertices in S and how their neighbourhoods interact reveals that S has quite a restricted structure: in particular we can partition a large part of S such that each pair of parts forms a homogeneous pair and such that the 'quotient graph' of this partition belongs to a more restricted hereditary graph class than the one we started with. This allows us to push through an induction step which gives a linear sized homogeneous pair.
Structure. The rest of the paper is organised as follows. In Section 2, we provide all necessary definitions and tools that we use throughout the paper. In Section 3, we prove weighted versions of Theorem 6 and Theorem 7. In Section 4, we prove Theorem 5, using Theorem 10 and a structural result (cf. Theorem 20) which we prove in Section 6. As a warm-up for this technical result and to illustrate our method, we prove a simpler result in Section 5 (cf. Theorem 21). In Section 7, we prove Theorem 8. We close the paper with some concluding remarks in Section 8.

Preliminaries
In this section, we fix notation and terminology, and we prove a lemma which we will use several times throughout the paper.
A graph G = (V, E) consists of a set V (G) := V of vertices and a set E(G) := E of edges, where an edge is an unordered pair of vertices. A multigraph is defined in the same way except that we allow E(G) to be a multiset. A directed multigraph D = (V, A) consists of a vertex set V and an arc multiset A, where an arc is an ordered pair of vertices. For graphs and multigraphs we set v(G) := |V (G)| and e(G) := |E(G)|. We denote the complement of a graph G by G c where V (G c ) := V (G) and e ∈ E(G c ) if and only e ∈ E(G). For an edge e ∈ E(G), we write G \ e for the graph on the same vertex set as G and with edge set E(G) \ {e}. For a graph G and two disjoint sets X, Y ⊆ V (G), we denote by E G (X, Y ) the set of edges of G with one endpoint in X and one endpoint in Y .
We call a graph connected if for every pair of vertices x, y there exists a k-vertex path P for some k 1 that is a subgraph of G and that contains both x and y. A component in G is a maximally connected subgraph of G.
A complete graph is one where all possible edges are present. A clique in a graph G is a subset X ⊆ V (G) such that G[X] is a complete graph and an independent set in G is a subset X ⊆ V (G) such that G[X] is the empty graph. In each case, we may also refer to the subgraph G[X] as a clique or independent set.
We already defined the line graph of a graph, and more generally if G is a multigraph, the line graph L(G) of G is the graph with vertex set E(G) where ef is an edge of L(G) if and only if e and f share a vertex in G. A graph G is called a line graph if it is the line graph of some (multi)graph G.
Given four distinct vertices x, a, b, c of a graph G, we say that (x; a, b, c) is a claw in G, if G[{x, a, b, c}] is isomorphic to a claw with x being the degree-three vertex.
Hooks. For k 0, recall that a k-hook, denoted by H k , is a (k + 3)-vertex path, say on vertex set {v 1 , . . . , v k+3 } and edges v i v i+1 for 1 i k + 2, together with a pendant edge v k+1 v k+4 . The vertex v 1 is called the active vertex of the k-hook. Note that a 0-hook, denoted H 0 , is the four-vertex path P 4 , with one of its interior vertices designated as an active vertex.
When constructing an induced k-hook in a graph G we often start with a 0-hook i.e. a copy of an induced P 4 , and then "grow" a path by adding edges subsequently to the active vertex. The following notion is helpful. An active k-hook in a graph G is a pair (X, R), where X, R ⊆ V (G), X ∩ R = ∅, G[X] is isomorphic to a k-hook, G[R] is connected, and N (R) ∩ X consists of exactly one vertex, namely the active vertex of the k-hook G[X].
Modules. Frequently, we will encounter sets in our graph G that "behave like a single vertex" in the following way. A set X ⊆ V (G) is a module in G if for every x, y ∈ X we have N (x) \ X = N (y) \ X. For a partition V (G) = X 1 X 2 . . . X r into nonempty modules X 1 , . . . , X r , observe that, for every i = j, the pair (X i , X j ) is a homogeneous pair. For such a partition, the quotient graph G q is defined to be the graph with vertex set {X 1 , X 2 , . . . , X r } where two sets X i and X j are connected by an edge in G q if and only if they form an adjacent pair in G. Note that a quotient graph is necessarily isomorphic to the electronic journal of combinatorics 25(3) (2018), #P3.27 some induced subgraph of G, namely one formed by taking exactly one vertex from every set X i .
The following simple lemma is used frequently throughout the paper.
Lemma 9. Let G be a graph, µ be a probability measure on V (G), δ > 0, and X ⊆ V (G) such that µ(X) > 3δ. Then there exists either a set P ⊆ X such that (P, X \ P ) is an anti-adjacent pair and µ(P ), µ(X \ P ) > δ, or the largest component of G[X] has measure at least µ(X) − δ.
Proof. Let C be the vertex set of a component of G[X] such that µ(C) is maximal. If µ(C) µ(X) − δ, then we are done. Also, if δ < µ(C) < µ(X) − δ, then we are done by taking P := C. In the remaining case, when all components of G[X] have measure at most δ, we proceed as follows. We initiate P := ∅, and iterate over components of G[X] one-by-one, putting them into the set P until µ(P ) exceeds δ. Since every component of G[X] has measure at most δ, we have δ < µ(P ) 2δ at the end of the process. Since µ(X) > 3δ, we have µ(X \ P ) > δ. Furthermore, by construction, P and X \ P form an anti-adjacent pair. This concludes the proof of the lemma.

Line graphs and claw-free Berge graphs
In this section, we state and prove weighted versions of Theorem 6 and Theorem 7 from which those theorems immediately follow.
A graph class G has the weighted strong Erdős-Hajnal property if there exists a constant δ > 0 such that every G ∈ G satisfies the following property. For every probability measure µ on V (G) satisfying µ(v) 1 − 2δ for all v ∈ V (G), there exists a homogeneous pair (P, Q) in G with µ(P ), µ(Q) δ. The condition that µ(v) 1 − 2δ for all v ∈ V (G) is necessary since for degenerate measures, where most of the mass is concentrated on one vertex only, we cannot hope to find a homogeneous pair of sufficient mass, for any graph G.
We shall prove the following two theorems.
Theorem 10. The class of claw-free Berge graphs has the weighted strong Erdős-Hajnal property.
Theorem 11. The class of line graphs has the weighted strong Erdős-Hajnal property.
Theorem 11 is an immediate corollary of the next lemma, where we prove that in any line graph with vertex weights, we find either an anti-adjacent pair or a clique of positive mass.
Lemma 12. Let δ 1 = 1 14 . Then for every graph G that is a line graph of some multigraph H, and every probability measure µ on V (G), there exists either a clique K in G with µ(K) 3δ 1 or an anti-adjacent pair (P, Q) in G with µ(P ), µ(Q) > δ 1 .
Recall that for a graph G and two disjoint sets X, Y of V (G), we denote by E G (X, Y ) the set of edges of G with one endpoint in X and the other in Y . Proof. Fix a multigraph H, let G be its line graph, and fix a probability measure µ on V (G). By definition, µ is a probability measure on the edges of H. We can find a partition of V (H) = L R such that w := µ(E H (L, R)) 1 2 . Such a partition exists since for a uniformly random partition V (H) = V 1 V 2 the expected value of µ(E H (V 1 , V 2 )) is We naturally extend f to subsets of V (H) by summation over the elements of the subset. Notice that w := f (L) = f (R) 1 2 . Assume that G has no clique of measure at least 3δ 1 . Since the set of edges adjacent to a single vertex in H forms a clique in G, we may deduce that f (v) < 3δ 1 for every vertex in H . We find a partition in the following way. Pick u ∈ L, set L 1 := {u}, and add vertices from L to L 1 , one at a time, Since we add less than 3δ 1 to f (L 1 ) each time, the upper bound on f (L 1 ) follows. Since f (L 2 ) = w − f (L 1 ), the same inequalities hold for f (L 2 ). In the same way, we find a partition In that case, we may take In the other case, if µ 12 , µ 21 δ 1 , we may take P = E H (L 1 , R 2 ) and Q = E H (L 2 , R 1 ), and again observe that (P, Q) is an anti-adjacent in G.
We now turn to the proof of Theorem 10. We resort to some known structural results on claw-free graphs. Let us first recall some standard terminology that we need. For a graph G, a pair ( is a function, and the following conditions hold: For a tree decomposition (T, β) and a node t ∈ V (T ), the set β(t) is called a bag. It is a standard fact about tree decompositions that if K is a clique of G then V (K) is contained in some bag. Indeed for each v ∈ V (K), T v is connected and hence is a subtree of T . Also for each u, v ∈ V (K) we have that T u ∩ T v = ∅. The Helly property of subtrees of a tree implies that ∩ v∈V (K) T v = ∅ and so taking t in this intersection, we see that is a separator of G and such that G[S] forms a clique. The following result on the existence of a clique separator decomposition is considered to be folklore, see e.g. [4]. Since in most references it is phrased as a recursive graph decomposition instead of a tree decomposition, we provide the short proof for completeness. Proof. We prove the claim by induction on |V (G)|. In the base case, G does not contain any clique separator, so we can create a tree decomposition (T, β) where T consists of a single node t and β(t) := V (G).
Otherwise, let S be a clique separator in G such that |S| is minimal. By minimality, is a clique, and S appears both in G 1 and G 2 , for every i = 1, 2, there exists a bag t i ∈ V (T i ) such that S ⊆ β i (t i ). To conclude, let T be the tree formed by taking the disjoint union of T 1 and T 2 and adding the edge The following lemma provides the main reason for considering tree decompositions (with additional suitable properties) when studying the strong Erdős-Hajnal property. It is considered folklore in the unweighted case, and we refer to it as the central bag argument.
Lemma 14. Let 0 < δ 1 4 be a constant, let G be a graph, let µ be a probability measure on V (G), and let (T, β) be a tree decomposition of G. Then there exists an anti-adjacent We define an orientation of the edges of T as follows. For an edge )), and orient the edge t 1 t 2 from t 2 to t 1 otherwise. Since the tree T has fewer edges than nodes, there exists a node t ∈ V (T ) of out-degree zero. For every , by the properties of the tree decomposition. Therefore, µ(C) µ(β(V (T C ))) 1 2 , since the edge between T C and t is oriented towards t.
If µ(β(t)) 1 2 − δ, then we are done, so assume otherwise. Note that then µ(V (G) \ β(t)) > 1 2 + δ 3δ since, by assumption, δ 1 4 . Therefore, by Lemma 9, there is an anti-adjacent pair (P, Since the second outcome is a contradiction, we indeed find an anti-adjacent pair of desired size. The previous two lemmas allow us to pass to a linear subset Y ⊆ V (G) of a graph G with the additional property that G[Y ] has no clique separators, provided that G has no anti-adjacent pair of linear size. In light of Theorem 10, we search for a good characterisation of claw-free Berge graphs. Chvátal and Sbihi [17] show that a claw-free graph without clique separators is Berge if and only if it is either "elementary" or "peculiar". A graph is called elementary if its edges can be coloured by two colours in such a way that edges xy and yz have distinct colours whenever x and z are nonadjacent. We decide not to give the exact definition of a peculiar graph here, but rather we point out that the vertex set of a peculiar graph can be partitioned into nine parts that each form a clique. The following is then an immediate implication of Theorem 2 in [17]. Theorem 15. Let G be a graph that is claw-free, Berge and that has no clique separator. Then G is either elementary or the vertex set V (G) can be partitioned into nine sets ] is a clique for each 1 i 9. We now resort to a characterisation of elementary graphs due to Maffray and Reed [32] that suits our purposes better than the original definition. We use the following terminology from [32]. Let G be a graph. We call an edge a flat edge in G if it does not appear in any triangle of G. Let xy be a flat edge in G, let X, Y be two disjoint sets such form cliques, such that there is at least one edge between X and Y in B. We can build a new graph G obtained from G − {x, y} and B by adding all possible edges between X and N (x) \ {y} and between Y and N (y) \ {x}. We say that G is augmented along xy, that x and y are augmented, and that x is replaced by X and y is replaced by Y . Intuitively, we replace the vertices x and y by cliques, and the edge xy by a (non-empty) bipartite graph. It is easy to see that, if x 1 y 1 and x 2 y 2 are independent edges in G, then the graph obtained by first augmenting G along x 1 y 1 and then the resulting graph along x 2 y 2 is the same as if we had first augmented x 2 y 2 and then x 1 y 1 . This leads to the following definition.
An augmentation of a graph G is a graph G that is obtained by augmenting G along the edges of some matching of flat edges in G.

Theorem 16 ([32]). A graph G is elementary if and only if it is an augmentation of a line graph of a bipartite multigraph.
We now prove the equivalent of Lemma 12 for elementary graphs.
Lemma 17. Let δ 2 = 1 28 . Then, for every graph G that is an elementary graph, and every probability measure µ on V (G), there exists either a clique K in G with µ(K) 3δ 2 or an anti-adjacent pair (P, Q) in G with µ(P ), µ(Q) δ 2 .
Proof. Let G be a line graph of a bipartite multigraph B such that G is an augmentation of G , which exists by Theorem 16. We define a probability measure µ on V (G ) in the natural way by setting µ (x) := µ(X) if x ∈ V (G ) was augmented and replaced by X, and µ (x) := µ(x) otherwise.
We apply Lemma 12 to G to find either an anti-adjacent pair (P, Q) in G with µ (P ), µ (Q) δ 1 = 2δ 2 , or a clique, say on vertex set K, such that µ (K) 3δ 1 . In the first outcome, note that some vertices of P and Q may have been replaced by cliques in the augmentation G, say x 1 , . . . , x p ∈ P are replaced by X 1 , . . . , X p , and In the second outcome, we consider two cases, depending on |K|. If |K| 2, then the heaviest vertex of K corresponds to a clique in G of measure at least 3δ 1 /2 = 3δ 2 . Otherwise, if K consists of at least three vertices, then none of its edges is flat, and therefore it remains a clique of measure at least 3δ 1 in G.
We now deduce Theorem 10 as a corollary. Proof of Theorem 10. We prove the weighted strong Erdős-Hajnal property with constant δ 3 = 1 58 . Let G be a graph that is claw-free and Berge, and let µ be a probability measure on V (G) such that for every vertex v of G we have that µ(v) 1 − 2δ 3 . In fact, we may assume that is an anti-adjacent pair in G of sufficient mass; in either case we are done and so we may assume µ(v) < δ 3 .
Let (T, β) be a tree-decomposition of G such that every bag induces a subgraph of G without a clique separator, which exists by Theorem 13. By Lemma 14, either there is an anti-adjacent pair (P, Q) in G with µ(P ), µ(Q) > δ 3 and we are done, or there is a bag Y with µ(Y )

Double hooks have the strong Erdős-Hajnal property
In this section, we state two technical lemmas and show how Theorem 5 can be derived from them. The lemmas will be proved in Sections 5 and 6. Fix k 1 and let G : To prove Theorem 5, we show that G has the strong Erdős-Hajnal property. That is, we need to find a δ > 0 such that every G ∈ G contains a homogeneous pair (P, Q) with |P |, |Q| δ · v(G). Similarly as in [8], our starting point is to pass down to an induced subgraph that is very sparse or very dense. The edge density of a graph G is the fraction e(G)/ v(G) 2 . The following is due to Fox and Sudakov [25], improving an earlier result of Rödl [34].
Theorem 18. For every 0 < ε < 1/2 and every graph H on at least two vertices there exists a constant δ = δ(ε, H) such that every H-free graph on n vertices contains an induced subgraph on at least δn vertices with edge density either at most ε or at least 1 − ε.
In case the induced subgraph is particularly sparse we find a special structure within it. Let G be a graph, and let S = (A, B, S) be a triple of non-empty subsets of V (G). We call the pair (G, S) an ε-structured pair if the electronic journal of combinatorics 25(3) (2018), #P3.27 Lemma 19. Fix 0 < ε < 1 10 and let G be a graph on n vertices such that every vertex has at most εn neighbours. Then The following theorem is the crucial step in our proof. It states that within an εstructured pair (G, (A, B, S)), we either find the desired homogeneous pair of linear size, or a very structured subsetŜ ⊆ S of linear size, or an -hook for some k which we can potentially extend to a double -hook. Recall that an active -hook in a graph G is a pair (X, R), where X, R ⊆ V (G), X ∩ R = ∅, G[X] is isomorphic to an -hook, G[R] is connected, and N (R) ∩ X consists of exactly one vertex, being the active vertex of the -hook G[X]. Remark -We note that any active -hook (X, R) of a graph G for k can easily be turned into an active k-hook. Indeed let v 1 , . . . , v +4 be the vertices of X with v 1 v 2 · · · v +3 forming the long path in the hook, and let v 1 be the active vertex. Taking X = {v −k+1 , . . . , v +4 } (which induces a k-hook) and R = R ∪ {v 1 , . . . , v −k } (which remains connected) we see (X , R ) is an active k-hook with v −k+1 being the active vertex.
We delay the proof of this theorem until Section 6. Informally, the idea is as follows. Let (G, (A, B, S)) be an ε-structured pair and assume that G does not contain a homogeneous pair of linear size or an active -hook. After some filtering, we partition the vertices in S into equivalence classes according to their neighbourhoods in A ∪ B. Assuming certain subgraphs like the hook are forbidden in G, it turns out that edges and non-edges between pairs of vertices in S correspond to a certain behaviour of the neighbourhoods of those vertices in A and B. This allows us to deduce that the equivalence classes of the partition on S are in fact modules. Furthermore, the quotient graph turns out to have an even more restricted structure in terms of the induced subgraphs that are forbidden.
We believe that these methods can be of further use to approach similar problems. Since the proof of Theorem 20 is rather technical, we present the following as a warm-up in Section 5 to illustrate our methods, although we will need many of the lemmas from Section 5 later.
Theorem 21. For every 1/10-structured graph (G, (A, B, S)) such that G is both claw-free and C 5 -free, there exists a subsetŜ ⊆ S with |Ŝ| |S|/5 and a partitionŜ = S 1 S 2 . . . S such that: 1. every set S i is contained in a neighbourhood of some vertex in A;

every set S i is a module of G[Ŝ];
3. the quotient graph of this partition of the vertex set of G[Ŝ] is a line graph of a triangle-free graph.
We now prove our main result.
Proof of Theorem 5. Note that if the theorem holds for k = r then it holds for all 1 k r. Hence it is sufficient to prove the theorem for all k 2. Thus, fix k 2 and let G := {G : G is H 2 k -free} and set ε 0 = ε 0 (k) to be the constant from Theorem 20. We shall prove the following claim.
Claim 22. Suppose G ∈ G has n vertices and maximum degree ε 0 n/100. Then either G has a homogenous pair (P, Q) where |P |, |Q| ε 0 n/3000 or we can find an active k-hook (X, R), where |R| ε 0 n/50. In the third outcome, we consider the quotient graph G q that has vertex set V q := {S i : 1 i m}, and where S i S j forms an edge in G q if and only if (S i , S j ) is an adjacent pair. We define a probability measure µ on V q in the natural way by setting µ(S i ) := |S i |/|Ŝ|. Note that, by Property (a), µ(S i ) ε 0 /2 for every vertex S i in G q . By Property (c), the graph G q is claw-free and Berge. We now invoke Theorem 10 to see that there is either a homogeneous pair (P q , Q q ) in G q with µ(P q ), µ(Q q ) δ cB , or there is a vertex S i ∈ V q with µ(S i ) 1 − 2δ cB , where δ cB is a constant that can be taken to be 1 58 (see Section 3). Since for every 1 i m we have that µ(S i ) ε 0 /2 1 − 2δ cB the first outcome must hold for G q . Consider the sets P := S i ∈Pq S i and Q := S i ∈Qq S i . Note that since the S i 's are modules and (P q , Q q ) is a homogeneous pair in G q , then (P, Q) is a homogeneous pair in G[Ŝ] and hence in G. Furthermore |P |, |Q| δ cB |Ŝ| δ cB 50 · n n 3000 , giving us the homogeneous pair of the desired size.
Thus we may assume the second outcome holds, where we find an active -hook (X, R), for some k, such that R ⊆ S and |R| 2 ε 0 10 |S| ε 0 50 n. By the remark after Theorem 20, we may assume = k as required.
Note that |N (X * ) ∩ R| (k + 4)∆(G 1 ) (4ε)(k + 4)v(G 1 ) |R|/4 by our choice of ε small. Hence |N [A] − N (X * )| |N (A)| − N (X * ) |R|/4 δv(G) by our choice of δ small enough. We may assume there is an edge between R * and N [A] − N (X * ); otherwise we have an anti-adjacent pair (R * , N [A] − N (X * )) of size δv(G) and we are done. N (A)) and G[R * ] is connected and there is an edge between R * and N [A] − N [X * ]. Writing P for the shortest path from x to x * in G[T ], we have that in G, X ∪ P ∪ X * induces a copy of a double -hook for some k.

Warm up: Proof of Theorem 21
The aim of this section is to provide a proof of Theorem 21 that will serve as a warm-up before proving the main technical step of this paper, namely Theorem 20. The proofs of Theorems 21 and 20 follow the same general outline, while the technical details in this section are much simpler. To exhibit the similarities between the proofs, we use nearly the same subsection structure in this section and the next one, even though here some subsections will consist only of a single simple observation. Let us fix a 1/10-structured pair (G, (A, B, S)) such that G is claw-free and C 5 -free. Define a binary relation R = on S as R = (x, y) if and only if N A∪B (x) = N A∪B (y) and we note that this is an equivalence relation. Our approach consists of the following steps: 1. We start with filtering out vertices x ∈ S that have large neighbourhood in A or in B. Since every vertex p ∈ A ∪ B satisfies |N S (p)| |S|/10, a standard averaging argument shows that the number of such vertices is small.
2. Second, for every x ∈ S, we study nonedges inside neighbourhoods N A (x); such nonedges turn out to be good starting points to construct either a claw (in the case of Theorem 21) or a hook (in the case of Theorem 20).
3. Then, for every two vertices x, y ∈ S, we investigate how the neighbourhoods N A (x) and N A (y) differ, depending on whether xy is an edge or a nonedge. Intuitively, we want to prove that if xy ∈ E(G), then the neighbourhoods in A and B cannot change much, while if xy / ∈ E(G), then they should change much or not at all. 4. We then collect the main properties we need from the aforementioned steps in the definition of a nice ε-structured pair. We prove that the relevant ε-structured pair is nice, both in the proof of Theorem 21 and Theorem 20. In this section we show that it is sufficient for the relevant ε-structured pair to be nice in order to find a large set 5. Finally, we show that in the case of Theorem 21, the quotient graph of the aforementioned decomposition is diamond-free; this, together with being claw-free, implies that the quotient graph is in fact a line graph of a triangle-free graph, concluding the proof of Theorem 21.
In the proofs of Theorems 21 and 20, if a statement is accompanied with a sign (A ↔ B), then we also claim that the same statement holds with the roles of A and B swapped.

Filtering step
Let S A = {x ∈ S : A ⊆ N (x)} and similarly define S B . A standard averaging argument shows the following: Proof. Consider the following random experiment: independently and uniformly at random pick a vertex p ∈ A and x ∈ S. Since every vertex in A is adjacent to at most |S|/10 vertices of S, the probability that px ∈ E(G) is at most 1/10. On the other hand, once x ∈ S A , we have px ∈ E(G) regardless of the choice of p. Consequently, the probability that x ∈ S A is at most 1/10. To simplify the notation, in the rest of this section we assume that the input structured graph is only 1/8-structured, but satisfies already (5.1).

Nonedges inside a neighbourhood in A
In the case of claw-free graphs, there are simply no edges inside neighbourhoods in A.

Claim 24 (A ↔ B).
For every x ∈ S the set N A (x) is a clique.
Proof. Assume the contrary, let p, q ∈ N A (x), p = q, and pq / ∈ E(G). Let z ∈ N B (x) be any vertex (it exists since N (B) = S). Then (x; p, q, z) is a claw in G, a contradiction.

Claim 25 (A ↔ B).
For every x, y ∈ S with x = y, xy / ∈ E(G), there is no edge between N A (x) ∩ N A (y) and A \ N A (x, y).
Proof. Assume the contrary, let p ∈ N A (x) ∩ N A (y) and q ∈ A \ N A (x, y) with pq ∈ E(G). Then (p; x, y, q) is a claw in G, a contradiction.

Neighbourhoods along an edge in S
Proof. Assume the contrary, let p Γ ∈ N Γ (x) \ N Γ (y) for Γ ∈ {A, B}. Then (x; y, p A , p B ) is a claw in G, a contradiction.

Niceness of an ε-structure and its corollaries
In the following definition, we extract some properties of the ε-structured pair (G, (A, B, S)) that were proven in Claims 24, 25, and 26, and then show what can be deduced from these properties only. Exactly the same properties will be proven in the next section, in the more general setting of Theorem 20, and hence we will be able to reuse the statements obtained here. Note that we have used here the notation (A ↔ B), denoting that the particular condition is required to hold also with the roles of A and B swapped. Whenever ε is unimportant for the analysis we shall drop it from the notation and speak only of a (nice) structured pair.
Let us now formally verify that the considered structured pair (G, (A, B, S)) is nice. We start our analysis of nice structured graphs with the following observation. Proof. Assume by contradiction that for some x, y ∈ S with x = y and xy / ∈ E(G) we have N A (x) = N A (y) but N B (x) = N B (y). By Property (NE2), there is no edge between We now move to a deeper study of the situation treated in Property (NE3). (A ↔ B). If (G, (A, B, S)) is a nice structured pair, then there do not exist three distinct vertices x, y, z ∈ S with xy, yz / ∈ E(G) and

Lemma 30
Proof. Assume the contrary, and let x, y, z be as in the statement. Let p be any vertex of N A (x) and q be any vertex of N A (z) \ N A (y). By Lemma 29 applied to the pair (x, y), Observe that the relations R = , R = , R = A , and R = B are symmetric, while R and R are strongly antisymmetric, and R (x, y) if and only if R (y, x). Furthermore, all six defined relations are pairwise disjoint. Note that this is not an exhaustive list of all possible neighbourhood relations that can occur in general graphs, but we will see that these cover all cases in our particular situation.
Lemma 30 implies that, along nonedges in S, the neighbourhoods in A cannot create chains with respect to inclusions. As a corollary, we can obtain the following:  A, B, S)) is a nice structured pair, then there exists a setŜ ⊆ S of size at least |S|/4 such that for every x, y ∈Ŝ with x = y and xy / ∈ E(G), either R = (x, y) or R = (x, y).
Proof. Consider an auxiliary directed multigraph G A defined as follows: we take V (G A ) = S and for every x, y ∈ S with x = y and xy / ∈ E(G) we add an arc (x, y) if N A (x) N A (y). Let S + A be the set of vertices of S that have positive out-degree in G A , and let S − A be the set of vertices of S that have positive in-degree. Symmetrically, define G B and sets S + Summarizing, we obtain the following statement, which says that for every distinct x, y ∈Ŝ, the existence or non-existence of an edge xy can be determined by examining the neighbourhoods of x and y in A ∪ B.
Theorem 32. For every nice structured pair (G, (A, B, S)) there exists a setŜ ⊆ S with |Ŝ| |S|/4 such that for every x, y ∈Ŝ with N A∪B (x) = N A∪B (y) the following holds.

xy ∈ E(G) if and only if exactly one of the following holds: R =
A (x, y), R = B (x, y), R (x, y), or R (x, y).

xy /
∈ E(G) if and only if R = (x, y).
Proof. We obtain the setŜ from Lemma 31. The "if" part of the assertion for edges xy and the "only if" part of the assertion for nonedges xy is straightforward from Lemma 31, while the remaining two implications follow from Property (E1).
As mentioned at the beginning of this section, we now partitionŜ according to the relation R = . Observe that due to Theorem 32, the presence or absence of an edge between two vertices x, y ∈ S is determined by N A∪B (x) and N A∪B (y) unless R = (x, y). An immediate corollary is the following. (G, (A, B, S)) be a nice structured pair, letŜ ⊆ S be the set obtained from Theorem 32, and let S 1 , S 2 , . . . , S r be the equivalence classes of the relation R = restricted toŜ. Then every set S i is a module of G[Ŝ].

Corollary 33. Let
As a last step in our analysis of nice structured graphs, we investigate P 3 's in the quotient graph of the aforementioned partition of G[Ŝ] into modules.  A, B, S)) be a nice structured pair, letŜ ⊆ S be the set obtained from Theorem 32, and let x, y, z ∈Ŝ be three distinct vertices belonging to different equivalence classes of the relation R = , such that xy ∈ E(G), yz ∈ E(G), and xz / ∈ E(G). Then one of the following holds: A (x, y) and R = B (y, z); • R = B (x, y) and R = A (y, z); • R (x, y) and R (z, y); • R (x, y) and R (z, y); Proof. Since xz / ∈ E(G), we have R = (x, z); in particular the sets N A (x) and N A (z) are incomparable with respect to inclusion. If R = A (x, y), then the only option from Theorem 32 for the edge yz that allows this property to happen is R = B (y, z); symmetrical claims follow if we swap the roles of A and B and/or the roles of x and z. In the remaining case, if neither (x, y) nor (y, z) belongs to R = A ∪ R = B , then the only way to ensure incomparability of N A (x) and N A (z) is to have R (x, y) and R (z, y) or R (x, y) and R (z, y).
In the next lemma we remark that Lemma 34 already implies that the quotient graph of the partition of G[Ŝ] into equivalence classes of the relation R = is Berge. Proof. Assume that the setŜ contains a sequence x 1 , x 2 , . . . , x h of vertices for some odd integer h 5, such that x i x i+1 ∈ E(G) and x i x i+2 / ∈ E(G) for every 1 i h and for indices behaving cyclically modulo h. Furthermore, assume that no two vertices x i are in relation R = .
Consider the edge x 1 x 2 , and let us consider four cases, depending on which option of Theorem 32 holds for this edge. By symmetry between the sides A and B, we need only consider the cases R = A (x 1 , x 2 ) and R (x 1 , x 2 ). If R = A (x 1 , x 2 ), then Lemma 34 applied to the P 3 x 1 , x 2 , x 3 implies that R = B (x 2 , x 3 ). Inductively, we infer that ) if i is even. However, this leads to a contradiction as h is odd. A similar situation happens if R (x 1 , x 2 ): we have R (x i , x i+1 ) for odd i and R (x i , x i+1 ) for even i, again yielding a contradiction We infer that no such sequence x 1 , x 2 , . . . , x h exists. However, note that such a sequence is present in any odd hole in the quotient graph in the question (take the subsequent vertices on the hole) and is present in any odd anti-hole as well (if the anti-hole consists of h vertices y 1 , y 2 , . . . , y h in this order, take x i = y (i h/2 ) mod h ). We infer that the quotient graph in the question does not contain any odd hole nor anti-hole, and is thus Berge. G is claw-free and C 5 -free. Claim 28 implies that (after the filtering step) we are in fact dealing with a nice structured pair. Theorem 32 provides us with a candidate setŜ, that we fix for the remainer of this proof. Corollary 33 implies that the relation R = partitions G[Ŝ] into modules. Moreover, by construction, every such module S i is contained in a neighbourhood of some vertex from A. It remains to analyse the quotient graph of this partition.

The quotient graph: Excluding a diamond
Clearly, the quotient graph of the partition of G[Ŝ] into equivalence classes of the relation R = is claw-free, since G is claw-free. In the rest of this section we show that it is also diamond-free. This, together with a characterization from [28,33] showing that the class of (claw,diamond)-free graphs is exactly the class of line graphs of triangle-free graphs, concludes the proof of Theorem 21.
We start by showing that the last two cases of Lemma 34 cannot appear if G is claw-free and C 5 -free.
Claim 36. Let x, y, z be as in the statement of Lemma 34. Then either R = A (x, y) and R = B (y, z) or R = B (x, y) and R = A (y, z). That is, the last two cases cannot happen.
Proof. Assume the contrary; by swapping the sides A and B if needed, we can assume that R (x, y) and R (z, y). Since xz / ∈ E(G), the sets N A (x) and N A (z) are incomparable with respect to inclusion; let p ∈ N A (x) \ N A (z) and q ∈ N A (z) \ N A (x). By Claim 24, we have pq ∈ E(G), since p, q ∈ N A (y). Let s ∈ N B (y) be any vertex. Observe that {p, x, s, z, q} induce a C 5 in G, a contradiction.
We conclude with an observation that without the two cases of Lemma 34 excluded in Claim 36, we cannot have a diamond in the quotient graph.
Claim 37. The quotient graph of the partition of G[Ŝ] into equivalence classes of the relation R = is diamond-free.
Proof. Assume the contrary. Let x, y, s, t ∈Ŝ be four distinct vertices that belong to four different equivalence classes of the relation R = . Furthermore, assume that G[{x, y, s, t}] is isomorphic to a diamond with xy / ∈ E(G). By swapping the sides A and B if needed, by Claim 36 applied to the triple x, s, y, we can assume that R = A (x, s) and R = B (y, s). Let us now consider two cases of Claim 36 applied to the triple x, t, y. If R = A (x, t) and Since xy / ∈ E(G), we have by Theorem 32 that R = (x, y). By (5.2) this implies that R = (s, t), a contradiction to the assumption st ∈ E(G) and Theorem 32.

Proof of Theorem 20
In this section we prove Theorem 20 using the same proof outline as for Theorem 21 from the previous section. In particular, after a filtering step we will prove that the ε-structured pair at hand is actually nice (c.f. Definition 27), which allows us to apply the tools developed in Section 5.3.
It will be convenient for the proof to split the constant ε into three constants ε, δ, and γ in the following way. We show that, for every k 0, if ε, δ, γ are small enough positive constants that satisfy 2ε < γ then in every ε-structured pair (G, (A, B, S) Instead of giving an explicit formula for ε, δ, and γ, we will state a number of inequalities that these constants should satisfy in the course of the proof. Every such inequality will be true for sufficiently small positive constants; in particular, taking ε = δ = Let (G, (A, B, S)) be an ε-structured graph for some (small) constant ε > 0.

Filtering
In the proof of Theorem 20 we need a stronger filtering step than the one used for Theorem 21: we need not only to discard vertices of S that are adjacent to the entire set A or B, but all vertices that are adjacent to a large fraction of A or B. Furthermore, we need to use a non-uniform measure on A and B, as defined below.
For every x ∈ S, we fix one neighbour π A (x) ∈ N A (x) and one neighbour π B (x) ∈ N B (x). We define a probability measure µ A on A by µ A (X) = |π −1 A (X)|/|S|. That is, the measure µ A corresponds to a random experiment where we choose a vertex x ∈ S uniformly at random, and output π A (x). Similarly we define a probability measure µ B on B using the function π B . Proof. Consider the following random experiment: independently choose x ∈ S uniformly at random and p ∈ A according to the measure µ A . Since every vertex in A is adjacent to at most ε|S| vertices of S, the probability that px ∈ E(G) is at most ε. On the other hand, conditioning on x ∈ S A , we have px ∈ E(G) with probability at least 10ε by the definition of S A . Consequently, the probability that x ∈ S A is at most 1/10. The proof for S B is symmetric.
By Claim 38, we have |S A ∪ S B | |S|/5. Consequently, by considering the pair (G \ (S A ∪ S B ), (A, B, S \ (S A ∪ S B ))) instead of (G, (A, B, S)), and by suitably adapting the constant ε, in the rest of the proof we can assume that our ε-structured pair (G, (A, B, S)) has the additional property that for all x ∈ S : µ A (N A (x)) < ε and µ B (N B (x)) < ε. (6.1) However, we now need to exhibit a setŜ of size at least |S|/4 (instead of |S|/5 in the statement of Theorem 20).
In the remainder of the proof, let us assume that, for some sufficiently small constants ε, δ, and γ, our input structured graph (G, (A, B, S)) does not admit the desired anti-adjacent pair nor the desired active hook; our goal is to prove that (G, (A, B, S)) is nice and use the results of Section 5.3 to obtain the setŜ. Observe that (6.1) already implies Property (NE1) for (G, (A, B, S)).
Since µ A (reach(Q → D)) > |Z|ε + δ, and by the definition of µ A , there exists x ∈ S 0 with π A (x) ∈ reach(Q → D). In particular, there exists a path from Q to S 0 with all internal vertices in D. Let L be a shortest such path; note that it is possible that L consists of a single edge, but L contains at least two vertices since Q ⊆ A and S 0 ⊆ S.
Let q be the endpoint of L in Q, y be the second endpoint of L, and x be the neighbour of y on L (it is possible that x = q). Using assumption (iii), we find an integer i 0 0 and an i 0 -hook with vertex set X ⊆ {q} ∪ Z and active vertex q. We lengthen this hook with the path L: define i := i 0 + |V (L)| − 2, X i := X ∪ (V (L) ∩ D), and R i := S 0 . Observe that, since Z and D ∪ S 0 are fully anti-adjacent, and L is a shortest path from Q to S 0 via D, we have that G[X i ] is an i-hook with x being the active vertex, and N ( If i k, then (6.3) ensures that (X i , R i ) is a desired active hook, a contradiction. Otherwise, we use the path-growing argument of [8] to turn it into an active k-hook, using the slack in (6.3) in the process. More formally, we build a sequence of active j-hooks (X j , R j ) for j = i, i + 1, . . . , k, with X i ⊂ X i+1 ⊂ · · · ⊂ X k , S 0 ⊇ R i ⊃ R i+1 ⊃ · · · ⊃ R k , and additionally maintain that Clearly, (6.4) holds for j = i (using (6.3) and the fact that R i = S 0 ), while for j = k, (6.4) gives the desired lower bound on |R k | for the active k-hook (X k , R k ). Assume that an active j-hook (X j , R j ) has been constructed for some j < k. Let v j ∈ X j be the active vertex of this hook. Let R j+1 be the vertex set of the largest component of G[R j \ N (v j )]; by (6.4), we have that |R j \ N (v j )| > 3δ|S| as R j ⊆ S 0 , and Lemma 9 asserts that |R j+1 | |R j | − ε|S| − δ|S|, proving (6.4) for R j+1 . We take v j+1 to be any vertex of R j ∩ N (v j ) ∩ N (R j+1 ); such a vertex exists by the connectivity of G[R j ] and the assumption v j ∈ N (R j ). Let X j+1 = X j ∪ {v j+1 }. A direct check shows that the choice of v j+1 , X j+1 , and R j+1 ensures that G[X j+1 ] is a (j + 1)-hook with active vertex v j+1 , and N (R j+1 ) ∩ X j+1 = {v j+1 }, finishing the description of the construction of (X j+1 , R j+1 ). Hence, (X k , R k ) is an active k-hook with R k ⊆ S and |R k | > γ|S|, a contradiction. This concludes the proof of the claim.
In the remainer of the proof we assume that the constants ε, δ, and γ are sufficiently small such that 2ε + 3(6ε + δ) < 1. In particular this means that assumption (iv) of Claim 39 is satisfied as long as |Z| 6. It also means that the bound in the conclusion of Claim 39 is small for |Z| 6; specifically, we can assume that any two neighbourhoods N A (x), N A (y) of vertices x, y ∈ S, together with any three sets reach(Q → D) ⊆ A obtained from Claim 39 (applied with |Z| 6), cannot cover the entire set A.
6.3 Neighbourhoods in A ∪ B

Non-edges inside an A-neighbourhood
We start with proving an analogue of Claim 24.
Claim 40 (A ↔ B). For every x ∈ S and p, q Proof. By contradiction, and using the symmetry between vertices p and q, let us assume there exists r ∈ A\N A (x) with pr ∈ E(G) and qr / ∈ E(G). Let Z = {p, q, r, x} and observe that G[X] is isomorphic to P 4 , with x being one of the internal vertices. Consequently, the assumptions of Claim 39 are satisfied (with the roles of A and B swapped) for Q = N B (x) and D = B \ N B (x), and we have µ A (reach(Q → D)) 4ε + δ. However, the connectivity of B implies that reach(Q → D) = D, a contradiction to (6.5).

Neighbourhoods along a nonedge in S
We start by proving Property (NE2). Proof. Let z ∈ N B (x) N B (y) be any vertex. Observe that the assumptions of Claim 39 are satisfied for Z = {x, y, z}, Q = N A (x) ∩ N A (y) and D = A \ N A (x, y): for every q ∈ Q the graph G[{z, x, q, y}] is a P 4 with q being one of its internal vertices. Hence, µ A (reach(Q → D)) 3ε + δ. Let us denote F = reach(Q → D); our goal is to prove that F = ∅.
Assume the contrary, let p ∈ F and q ∈ Q with pq ∈ E(G). Let D = D \ F and Q = N A (D ); note that, by the definition of F , we have Q ⊆ N A (x) N A (y). Furthermore, Claim 40 implies that qq ∈ E(G) for every q ∈ Q : q has a neighbour in D , while q does not have such a neighbour, and both q and q belong either to N A (x) or to N A (y).
Let z x be any vertex in N B (x), z y be any vertex in N B (y), and Z = {p, q, x, y, z x , z y }. We claim that the assumptions of Claim 39 are satisfied for Z , Q , and D : clearly Z and D are fully anti-adjacent by construction, so it remains only to check assumption (iii).
To this end, consider q ∈ Q . By symmetry between x and y, assume q ∈ N A (x)\N A (y). If pq ∈ E(G), then G[{p, q , x, z x }] is a 0-hook with q being the active vertex. If pq / ∈ E(G), then G[{q, q , p, y, z y }] is a 1-hook with q being the active vertex.
Claim 42 (A ↔ B). For every x, y ∈ S with x = y and xy / ∈ E(G), if N A (x) N A (y), then the sets N A (x) and N A (y) \ N A (x) are fully adjacent.
Proof. Since N A (x) N A (y), Lemma 29 implies that N B (x) = N B (y). Consequently, Claim 41 asserts that D := A \ N A (y) and N A (x) are fully anti-adjacent. That is, if we define Q = N A (D), then Q ⊆ N A (y) \ N A (x).
By contradiction, assume there exists z ∈ N A (y)\N A (x) and p ∈ N A (x) with pz / ∈ E(G). Claim 40 implies that z / ∈ Q, as p / ∈ Q and p, z ∈ N A (y). Furthermore, Claim 40 also implies that z is fully adjacent to Q. We also know that p is fully adjacent to Q. We infer that the conditions of Claim 39 are satisfied for Z = {z, p, x} and the sets Q and D: for every q ∈ Q, the graph G[{z, q, p, x}] is a P 4 with q being one of its internal vertices. Consequently, µ A (reach(Q → D)) 3ε + δ, which stands in contradiction with the connectivity of G[A] and (6.5).

Neighbourhoods along an edge in S
In the next three claims we prove Property (E1).
Proof. By contradiction, assume there exists p ∈ N A (x) N A (y); by symmetry, assume . Let z be any vertex in N B (y), and let Z = {p, y, z}. Observe that Claim 40 implies that p is fully adjacent to Q, as they are both contained in N A (x) and p does not have any neighbour in D. Consequently, the assumptions of Claim 39 are satisfied for the sets Z, Q, and D: for every q ∈ Q, the graph G[{p, q, y, z}] is a P 4 with q being one of the middle vertices. Hence, µ A (reach(Q → D)) 3ε + δ. However, reach(Q → D) = D by the connectivity of A, and we have a contradiction with (6.5).
Let p be any vertex in N A (x) \ N A (y) and let z be any vertex in N B (y).
If N B (y) ⊆ N B (x), then let z 1 be any vertex of N B (y) \ N B (x) and define Z = {x, y, z, p, z 1 }. Otherwise, unless N B (x) = N B (y), Claim 43 implies that there exists an edge z 2 z 3 with z 2 ∈ N B (x) \ N B (y) and B \ N B (x, y), and we take Z = {x, y, z, p, z 2 , z 3 }.
We claim that in both cases the sets Z, Q, and D satisfy the assumptions of Claim 39. Clearly, D and Z are fully anti-adjacent, so it remains to check only assumption (iii). To this end, consider q ∈ Q. If pq ∈ E(G), then G[{p, q, y, z}] is a P 4 with q being one of the middle vertices. Otherwise, Claim 40 implies that q / ∈ N A (x), that is, q ∈ N A (y) \ N A (x). If the vertex z 1 exists, then G[{y, q, x, p, z 1 }] is a 1-hook with q being the active vertex. Finally, if the edge z 2 z 3 exists, then G[{x, y, q, p, z 2 , z 3 ] is a 2-hook with q being the active vertex. We infer that µ A (reach(Q → D)) 6ε + δ. However, the connectivity of G[A] implies that D = reach(Q → D). This is in contradiction with (6.5) and the assumption µ A (F ) 6ε + δ.
Proof. Assume the contrary. Since N A (x) = N A (y), Claim 44 applied to the side B instead of the side A asserts that µ B (reach(N B (x)\N B (y) → B \N B (x, y))) > 6ε+δ; in particular, there exists an edge z 1 z 2 ∈ E(G) with z 1 ∈ N B (x) \ N B (y) and z 2 ∈ B \ N B (x, y). y). Observe that the assumptions of Claim 39 are satisfied for these sets: for every q ∈ Q the graph G[{x, q, y, z 1 , z 2 }] is a 1-hook with q being its active vertex. Consequently, µ A (reach(Q → D)) 4ε + δ, a contradiction to Claim 44 and the assumption N B (x) = N B (y).

Niceness and quotient graph
Summing up, we have so far proven the following.
Let us define relations R = , R = , R , R , R = A , and R = B on S as in Section 5.3. We apply Theorem 32, obtaining a setŜ ⊆ S of size at least |S|/4; by Corollary 33, the equivalence classes of R = restricted toŜ partitionŜ into modules of G[Ŝ]. Furthermore, Lemma 35 asserts that the quotient graph of this partition is Berge. Thus, to conclude the proof of Theorem 20, it suffices to show that the quotient graph of this partition is also claw-free.

Excluding a claw in the quotient graph
Claim 47. The quotient graph of the partition of G[Ŝ] into equivalence classes of the relation R = is claw-free.
Proof. By contradiction, assume there exists a claw (t; x, y, z) in G[Ŝ] such that no pair of vertices from {t, x, y, z} are in relation R = .
We apply Lemma 34 to three P 3 s contained in the claw (t; x, y, z). Observe that if one of the first two outcomes happens for one of P 3 s, say R = A (x, t) and R = B (y, t), then we have R = A (z, t) by looking at the P 3 on vertices y, t, z. Thus we obtain R = A (x, z), a contradiction to the properties ofŜ obtained from Theorem 32. We infer that the only two possibilities are R (x, t), R (y, t), and R (z, t), or the symmetrical option R (x, t), R (y, t), and R (z, t). By swapping the sides A and B if needed, we may assume that the first option happens, that is, , and similarly define Q yz and Q xz . Since xy / ∈ E(G), by Theorem 32 we have R = (x, y) and there exists p ∈ N B (x) \ N B (y). Furthermore, observe that also p / ∈ N B (t). We infer that the sets Z = {t, x, y, p}, Q xy , and D satisfy the assumptions of Claim 39: for every q ∈ N A (x) ∩ N A (y) the graph G[{p, x, q, y}] is a P 4 with q being one of the middle vertices, while for every q ∈ N A (t) \ N A (x, y) the graph G[{t, q, x, p, y}] is a 1-hook with q being its active vertex. Consequently, µ A (reach(Q xy → D)) 4ε + δ. Symmetrically, the same conclusion holds for Q yz and Q xz . Note now that Q xy ∪ Q yz ∪ Q xz = N A (t), as (X Y ) ∩ (Y Z) ∩ (Z X) = ∅ for any three sets X, Y, Z. Consequently, µ A (reach(N A (t) → D)) 3(4ε + δ). However, reach(N A (t) → D) = D by connectivity of G[A], and we have a contradiction with (6.5). This concludes the proof of the claim, and of Theorem 20.

The strong Erdős-Hajnal property is much stronger
In this section, we prove Theorem 8. Both statements, (a) and (b), are implied by the following lemma.
Lemma 48. Let k > 2 be fixed and let H be a family of graphs such that (P 1) every H ∈ H contains a cycle of length at most k; or (P 2) for every H ∈ H, the complement of H contains a cycle of length at most k.
Then the class of H-free graphs does not have the strong Erdős-Hajnal property.
Proof. Assume first that H is a family of graphs with Property (P 1), i.e. every H ∈ H contains a cycle of length at most k. For every δ > 0, we construct a graph G δ , say on n vertices, that is H-free and that does not contain a homogeneous pair (P, Q) with |P |, |Q| δn.
Fix δ > 0, let n be large enough, and let G ∼ G(n, p) be a random graph on n vertices where every edge is present independently at random with probability p = 50 δ 2 n .
Let X k be a random variable that counts the number of cycles of length at most k in G, and for 3 k, let X be a random variable that counts the number of cycles of length in G. By linearity of expectation we have Therefore, by Markov's Inequality, Let Z δ be a random variable that counts the number of homogeneous pairs (P, Q) in G with |P |, |Q| = δ 2 n . Then E(Z δ ) 2 n · 2 n · (1 − p) δ 2 n 2 /10 + 2 n · 2 n · p δ 2 n 2 /10 , where the first term is an upper bound on the expected number of anti-adjacent pairs (P, Q) and the second term is an upper bound on the expected number of adjacent pairs (P, Q). For n large enough we have p < 1 2 , so that we can deduce E(Z δ ) 2 2n+1 (1 − p) δ 2 n 2 /10 2 2n+1 e −pδ 2 n 2 /10 , where we use 1 − x e −x in the last inequality. Therefore, by a standard first-moment argument and our choice of p, Pr(Z δ > 0) = Pr(Z δ 1) E(Z δ ) e (2n+1) ln(2)−pδ 2 n 2 /10 e −n .
Therefore, with probability at most 1 3 + o(1), G satisfies X k 3C or Z δ > 0. That is, there exists a graph G that has at most 3C cycles of length at most k, and that has no homogeneous pair (P, Q) with |P |, |Q| = δ 2 n . Remove a vertex from every cycle of length at most k to obtain a graph G δ on n n/2 vertices with no homogeneous pair (P, Q) with |P |, |Q| δn . In particular, G δ is H-free, which proves the claim.
Assume now that the family H satisfies Property (P 2). Then the family H c := {H c : H ∈ H} satisfies Property (P 1). So, by the first part, for every δ > 0 we find a graph G δ , say on n vertices, that is H c -free and has no homogeneous pair (P, Q) with |P |, |Q| δn. But then, the collection of graphs G c δ shows that the family H cannot have the strong Erdős-Hajnal property either.
We are ready to prove Theorem 8.
Proof of Theorem 8. First, observe that since P c 4 = P 4 , the class of P 4 -free graphs has the strong Erdős-Hajnal property by the result of [8]. To prove the implication in the other direction, notice that if H is not an induced subgraph of P 4 then either H or H c contains a cycle. But then we can apply Lemma 48 to H = {H} and we are done. Thus, we proved statement (a). Statement (b) follows from Lemma 48 by taking H = {H, H c }.

Conclusions
We proved in this paper that for every k 1, the class of H 2 k -free graphs has the strong Erdős-Hajnal property. Specifically, there exists ε(k) > 0 such that every H 2 k -free n-vertex graph contains a clique or an independent set of size at lest n ε(H) . This result extends e.g. the result on forbidding long paths and antipaths [8]. Furthermore, from combinations of known results, the only tree on six vertices for which the Conjecture 2 was not previously known to hold is the 2-hook, also known as the E-graph. Therefore, Conjecture 2 is now known to be true for every tree on at most six vertices. The question for general trees remains wide open.
The original inspiration for our work comes from a paper of Lokshtanov, Vatshelle, and Villanger [31], who used the framework of minimal separators and potential maximal cliques to give a polynomial-time algorithm for the (algorithmic) Independent Set problem in P 5 -free graphs. For the interested reader, below we give some brief background to this framework without defining all the notions we make reference to. A minimal separator in a connected graph is an inclusion-wise minimal set of vertices whose deletion leaves the graph disconnected. A minimal triangulation of a graph G is an inclusion-wise minimal set of edges F such that G + F , the graph obtained by adding the edges of F to G, is a chordal graph. A potential maximal clique of G is a set K ⊆ V (G) which is a maximal clique in G + F for some minimal triangulation F . These notions all turn out to be closely related through the notion of treewidth and tree decompositions.
Bouchitte and Todinca [6] studied the notion of potential maximal cliques from this perspective and showed that the natural dynamic programming algorithm for finding a maximum independent set in a graph of bounded treewidth can be modified to find such a set in time polynomial in the size of G and linear in the number of potential maximal cliques in G. In this way, they obtained a unified explanation for the existence of polynomial-time algorithms for the Independent Set problem in many hereditary graph classes. The work for P 5 -free graphs [31] follows the same approach, but generalises it, by showing that in P 5 -free graphs one needs to examine only a particular (polynomially-sized) set of potential maximal cliques in the aforementioned algorithm. Subsequent work [30] uses minimal separators and potential maximal cliques in a different way to develop a quasipolynomial-time algorithm for the Independent Set problem in P 6 -free graphs.
Since the framework of minimal separators and potential maximal cliques has been successfully applied to the Independent Set problem for various hereditary graph classes, we wished to investigate to what extent these methods are useful for problems related to the Erdős-Hajnal conjecture. While our original proof of Theorem 3 followed this framework closely, we eventually found a simpler proof which circumvents most of the theory, although some artefacts remain.
The question of excluding pairs of graphs in the context of the Erdős-Hajnal conjecture was considered also in the directed setting (see [9]). The directed version of the conjecture is equivalent to the undirected one and was recently heavily investigated ( [3,11,13,10,12]). In the directed setting the analogue of the complement of the graph is the graph obtained by reversing directions of all the edges. It would be interesting to see whether techniques presented in this paper can be applied in the directed setting to get generalisations of some of the known results.