Abstract 1 Introduction 2 Preliminaries 3 The proof of Theorem 3 4 Distance-𝒅 amiable families: The proof of Lemma 7 References

Maximum List 𝒓-Colorable Induced Subgraphs in 𝒌𝑷𝟑-Free Graphs

Esther Galby ORCID Chalmers University of Technology, Gothenburg, Sweden
University of Gothenburg, Sweden
Paloma T. Lima ORCID IT University of Copenhagen, Denmark Andrea Munaro ORCID Department of Mathematical, Physical and Computer Sciences, University of Parma, Italy Amir Nikabadi ORCID IT University of Copenhagen, Denmark
Abstract

We show that, for every fixed positive integers r and k, Max-Weight List r-Colorable Induced Subgraph admits a polynomial-time algorithm on kP3-free graphs. This problem is a common generalization of Max-Weight Independent Set, Odd Cycle Transversal and List r-Coloring, among others. Our result has several consequences.

First, it implies that, for every fixed r5, assuming 𝖯𝖭𝖯, Max-Weight List r-Colorable Induced Subgraph is polynomial-time solvable on H-free graphs if and only if H is an induced subgraph of either kP3 or P5+kP1, for some k1. Second, it makes considerable progress toward a complexity dichotomy for Odd Cycle Transversal on H-free graphs, allowing to answer a question of Agrawal, Lima, Lokshtanov, Rzążewski, Saurabh, and Sharma [ACM Trans. Algorithms 2025]. Third, it gives a short and self-contained proof of the known result of Chudnovsky, Hajebi, and Spirkl [Combinatorica 2024] that List r-Coloring on kP3-free graphs is polynomial-time solvable for every fixed r and k.

We also consider two natural distance-d generalizations of Max-Weight Independent Set and List r-Coloring and provide polynomial-time algorithms on kP3-free graphs for every fixed integers r, k, and d6.

Keywords and phrases:
Hereditary classes, list coloring, odd cycle transversal, independent set
Funding:
Paloma T. Lima: Supported by Independent Research Fund Denmark grant agreement number 2098-00012B.
Amir Nikabadi: Supported by Independent Research Fund Denmark grant agreement number 2098-00012B.
Copyright and License:
[Uncaptioned image] © Esther Galby, Paloma T. Lima, Andrea Munaro, and Amir Nikabadi; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Mathematics of computing Graph coloring
; Theory of computation Graph algorithms analysis
Related Version:
Full Version: https://arxiv.org/abs/2505.00412
Editors:
Anne Benoit, Haim Kaplan, Sebastian Wild, and Grzegorz Herman

1 Introduction

A fundamental class of graph optimization problems consists in finding a maximum-weight induced subgraph satisfying a certain fixed property Π. Lewis and Yannakakis [12] showed that, whenever this fixed property Π is nontrivial and hereditary, the corresponding problem is 𝖭𝖯-hard. In this paper, we investigate the case where Π is the property of being list r-colorable, leading to a meta-problem called Max-Weight List r-Colorable Induced Subgraph. In order to properly define this problem, we first require some definitions.

Let G=(V,E) be a finite simple graph. A coloring of G is a mapping ϕ:V{1,2,} that gives each vertex uV a color ϕ(u) in such a way that, for every two adjacent vertices u and v in G, we have that ϕ(u)ϕ(v). For r1, a coloring ϕ of G is an r-coloring if ϕ(u){1,,r} for every uV, and a graph is r-colorable if it admits an r-coloring. For r1, an r-list assignment of G is a function L:V2{1,,r} that assigns each vertex uV a list L(u){1,,r} of admissible colors for u. A coloring ϕ of G respects L if ϕ(u)L(u) for every uV. We are finally ready to define Max-Weight List r-Colorable Induced Subgraph, where r is a fixed positive integer.

Max-Weight List r-Colorable Induced Subgraph

Input: A graph G equipped with a weight function w:V(G)+, and an r-list assignment L of G.

Task: Find a subset FV(G) such that:

  1. 1.

    The induced subgraph G[F] admits a coloring that respects L, and

  2. 2.

    The weight w(F)=vFw(v) is maximum subject to the condition above.

Max-Weight List r-Colorable Induced Subgraph is a common generalization of several well-known and deeply investigated 𝖭𝖯-hard problems, as we explain next. Max-Weight List r-Colorable Induced Subgraph generalizes List r-Coloring and hence r-Coloring as well, which are known to be NP-hard for all r>2 [11]. Recall that, for a fixed r1, List r-Coloring is the problem to decide whether a given graph G with an r-list assignment L admits a coloring that respects L. By setting L(u)={1,,r} for every uV(G), we obtain r-Coloring. Note also that, for r1r2, List r1-Coloring is a special case of List r2-Coloring.

Several other NP-hard problems are special cases of Max-Weight List r-Colorable Induced Subgraph for specific values of r. For example, for r=1, Max-Weight List r-Colorable Induced Subgraph is equivalent to Max-Weight Independent Set, which is the problem of finding a maximum-weight subset of pairwise non-adjacent vertices of an input graph G. For r=2, Max-Weight List r-Colorable Induced Subgraph generalizes the problem of finding a maximum-weight induced bipartite subgraph of an input graph G which, by complementation, is equivalent to finding a minimum-weight subset of vertices intersecting all odd cycles in G. The latter is the well-known Odd Cycle Transversal.

Given the hardness of Max-Weight List r-Colorable Induced Subgraph, it is natural to investigate whether the problem becomes tractable for restricted classes of inputs. The framework of hereditary graph classes (i.e., graph classes closed under vertex deletion) is particularly well suited for this type of research, where the ultimate goal is to obtain complexity dichotomies telling us for which hereditary graph classes the problem at hand can or cannot be solved efficiently (under the standard complexity assumption that 𝖯𝖭𝖯).

We recall some relevant definitions. A graph G is H-free, for some graph H, if it contains no induced subgraph isomorphic to H. For a set of graphs {H1,,Hp}, a graph is (H1,,Hp)-free if it is Hi-free for every i{1,,p}. The disjoint union G+H of graphs G and H is the graph with vertex set V(G)V(H) and edge set E(G)E(H). We denote the disjoint union of k copies of G by kG and let Ps denote the chordless path on s vertices.

It is known that, for r=2, Max-Weight List r-Colorable Induced Subgraph admits no polynomial-time algorithm on H-free graphs unless H is a linear forest (i.e., a disjoint union of paths). Indeed, Chiarelli et al. [3] showed that its special case Odd Cycle Transversal is NP-hard on H-free graphs if H contains a cycle or a claw (the claw is the 4-vertex star). In recent years, considerable work has been done toward classifying the complexity of Odd Cycle Transversal (and its generalizations) on graphs forbidding an induced linear forest. In Theorem 1, we collect known results for Odd Cycle Transversal and its two generalizations Max-Weight r-Colorable Induced Subgraph and Max-Weight List r-Colorable Induced Subgraph on H-free graphs, where H is a linear forest. The problems are listed in increasing order of generality. In particular, an 𝖭𝖯-hardness result for a certain problem implies 𝖭𝖯-hardness for a more general problem. Note also that the hardness results hold even in the unweighted setting.

Theorem 1.

The following hold:

  1. (i)

    Odd Cycle Transversal on H-free graphs can be solved in polynomial time if

    • H=P5 (Agrawal et al. [1]), or

    • H=kP2 for all k (Chiarelli et al. [3]), or

    • H=P3+kP1 for all k (Dabrowski et al. [7]),

    and remains NP-hard if

    • H=(P6,P5+P2) (Dabrowski et al. [7]).

  2. (ii)

    Max-Weight r-Colorable Induced Subgraph on H-free graphs can be solved in polynomial time if

    • H=P5+kP1 for all k (Henderson et al. [10]),

    and remains NP-hard if

    • H=(P6,P5+P2) for r=2, or

    • H=2P4 for all r5 (Hajebi et al. [9]).

  3. (iii)

    Max-Weight List r-Colorable Induced Subgraph on H-free graphs can be solved in polynomial time if

    • H=P5 (Lokshtanov et al. [13]),

    • H=P5+kP1 for all k (Henderson et al. [10]),

    and remains NP-hard if

    • H=(P6,P5+P2) for r2, or

    • H=P4+P2 for all r5 (Couturier et al. [6]).

Recently, Chudnovsky et al. [4] obtained the following complete complexity dichotomy for List r-Coloring when r5. Assuming 𝖯𝖭𝖯, List r-Coloring (r5) can be solved in polynomial time on H-free graphs if and only if H is an induced subgraph of either kP3 or P5+kP1, for some k. Their main result toward this was showing that List r-Coloring (r1) can be solved in polynomial time on kP3-free graphs, for any k, and this was obtained building on a very technical result of Hajebi et al. [9, Theorem 5.1].

Motivated by the quest for a complexity dichotomy, Agrawal et al. [1] posed very recently as an open problem to classify the computational complexity of Odd Cycle Transversal on (P3+P2)-free graphs, the unique minimal open case stemming from Theorem 1.

It should also be mentioned that classifying the complexity of Max-Weight Independent Set on H-free graphs when H is a linear forest is a notorious open problem in algorithmic graph theory (see [5] for the state of the art). Note however that Max-Weight Independent Set substantially differs from Odd Cycle Transversal on H-free graphs, in the sense that it is polynomial-time solvable on claw-free graphs.

In this paper, we also consider the distance-d generalizations of Max-Weight Independent Set and List r-Coloring, defined as follows. For d2, a distance-d independent set of a graph G is a set of vertices of G pairwise at distance at least d in G. For fixed d2, Max-Weight Distance-d Independent Set (also known as d-Scattered Set) is the problem to find a maximum-weight distance-d independent set of an input graph G.

Trivially, for every fixed d2, Max-Weight Distance-d Independent Set is easy on Pd+1-free graphs, and the following hardness results are known.

Theorem 2.

The following hold for Distance-d Independent Set on H-free graphs:

  1. (i)

    It is 𝖭𝖯-hard if H contains 2P(d+1)/2, for every fixed odd d3 (Eto et al. [8]);

  2. (ii)

    Assuming ETH, it admits no 2o(|V(H)|+|E(H)|)-time algorithm if H contains a cycle or a claw, for every fixed d3 (Bacsó et al. [2]).

For d2, a (d,r)-coloring of a graph G is an assignment of colors to the vertices of G using at most r colors such that no two distinct vertices at distance less than d receive the same color. Thus, a (2,r)-coloring is nothing but an r-coloring. Similarly as above, for fixed d2 and r1, we define (d,r)-Coloring as the problem of determining whether a given graph G has a (d,r)-coloring. List (d,r)-Coloring is defined similarly but we require in addition that every vertex u must receive a color from some given list L(u){1,,r}.

Sharp [18] provided the following complexity dichotomy: For fixed d3, (d,r)-Coloring is polynomial-time solvable for r3d/2 and 𝖭𝖯-hard for r>3d/2.

Our results.

We prove three main algorithmic results for kP3-free graphs. The first result, proven in Section 3, concerns Max-Weight List r-Colorable Induced Subgraph.

Theorem 3.

Let r1 be a fixed integer. For every k, Max-Weight List r-Colorable Induced Subgraph can be solved in polynomial time on kP3-free graphs.

Theorem 3 has several interesting consequences. First, it immediately implies that Odd Cycle Transversal can be solved in polynomial time on kP3-free graphs, for every k, thus solving a generalized version of the aforementioned open problem of Agrawal et al. [1]. Our result for Odd Cycle Transversal also complements the polynomial-time algorithms for Feedback Vertex Set and Even Cycle Transversal on kP3-free graphs of Paesani et al. [16]. Second, Theorem 3 generalizes the recent result of Chudnovsky et al. [4] that List r-Coloring can be solved in polynomial time on kP3-free graphs for every r,k. Although partially inspired by their approach, as we explain below, our proof of the more general Theorem 3 has the advantage of being considerably shorter and self-contained.

Theorem 3 also makes considerable progress toward a complete complexity dichotomy for Max-Weight List r-Colorable Induced Subgraph and Odd Cycle Transversal on H-free graphs. Indeed, paired with the recent result of [10], it completely settles the complexity of Max-Weight List r-Colorable Induced Subgraph on H-free graphs for r5 (see Theorem 1 and the discussion preceding it):

Theorem 4.

Let r5 be a fixed integer. Assuming 𝖯𝖭𝖯, Max-Weight List r-Colorable Induced Subgraph on H-free graphs is polynomial-time solvable if and only if H is an induced subgraph of either kP3 or P5+kP1, for some k1.

Moreover, paired with the results of [3, 7, 10] mentioned above, Theorem 3 leaves the case H=k4P4+k3P3+k2P2+k1P1, with k41 and k4+k32, as the only remaining open case toward a complete complexity dichotomy for Odd Cycle Transversal on H-free graphs.

We then consider the distance-d generalizations of Max-Weight Independent Set and List r-Coloring, for d6, and prove the following two results.

Theorem 5.

Let d6 be a fixed integer. For every k, Max-Weight Distance-d Independent Set can be solved in polynomial time on kP3-free graphs.

Theorem 6.

Let d6 and r1 be fixed integers. For every k, List (d,r)-Coloring can be solved in polynomial time on kP3-free graphs.

Paired with the aforementioned result of Eto et al. [8], Theorem 5 completely settles the computational complexity of Max-Weight Distance-d Independent Set on kP3-free graphs, except for the only remaining open case d=4.

Technical overview.

We now explain our approach toward Theorem 3, which combines ideas from [14, 15] and [4]. It is instructive to first consider the special case of Odd Cycle Transversal (by complementation, Max-Weight 2-Colorable Induced Subgraph) on kP2-free graphs, where a very simple algorithm can be obtained. Indeed, kP2-free graphs have polynomially many (inclusion-wise) maximal independent sets, and these can be enumerated in polynomial time. Consequently, a maximum-weight induced bipartite subgraph can be found by exhaustively enumerating all pairs of maximal independent sets [3]. However, it is easily seen that even P3-free graphs (i.e., graphs whose connected components are cliques) do not have polynomially many maximal independent sets. But it turns out that a weaker property is enough for our purposes: Admitting a polynomial family of “well-behaved” vertex sets such that every maximal independent set is contained in one of these sets. In our case, “well-behaved” means inducing a P3-free subgraph. The intuition is that, given such a family, we can efficiently guess the color classes, each of which will be a disjoint union of cliques, and then match vertices to the possible color classes.

The following key notion, which we dub amiable family, was first introduced by Lozin and Mosca [15]. For a graph G, a family 𝒮2V(G) of subsets of V(G) is an amiable family if it satisfies the following two properties:

  • Each member of 𝒮 induces a P3-free subgraph in G;

  • Each (inclusion-wise) maximal independent set of G is contained in some member of 𝒮.

Lozin and Mosca [15] showed that, when k=2, every kP3-free graph G admits an amiable family of size polynomial in |V(G)| and which can be computed in polynomial time. Later, Lozin [14] observed how such property in fact holds for every k2 (see Lemma 8 for a formal statement). Given an amiable family 𝒮 of polynomial size of a kP3-free graph G, we would like to exhaustively solve Max-Weight List r-Colorable Induced Subgraph on every possible r-tuple consisting of members of 𝒮. More precisely, let (S1,,Sr)𝒮r be an r-tuple of members of 𝒮. We would like to find a maximum-weight induced subgraph of G[i[r]Si] which admits an r-coloring respecting the given r-list assignment and such that, for i=1,,r, all vertices colored i are contained in Si. To do this, we then extend an idea of Chudnovsky et al. [4] as follows. We reduce our problem to that of finding a maximum-weight matching in an auxiliary bipartite graph where one partition class Y consists of i[r]Si, the other class X consists of the connected components of the subgraphs G[Si], for i=1,,r, and there is an edge between yY and xX if and only if y belongs to the connected component x. Since each weighted matching problem can be solved in polynomial time using the Hungarian method (see, e.g., [17, Theorem 17.3]) and we build |𝒮|r auxiliary problems, which is a polynomial in |V(G)|, a solution to Max-Weight List r-Colorable Induced Subgraph can be found in polynomial time.

Figure 1: Visualization for distance-d amiable family 𝒮={S1,S2,S3}. Circles represent cliques and α, β are maximal distance-d independent sets. Dashed lines depict paths of lengths at least d.

In order to prove Theorems 5 and 6, we consider the following distance-d generalization of the notion of amiable family. For a graph G, a family 𝒮2V(G) of subsets of V(G) is a distance-d amiable family if it satisfies the following properties:

  • Each member of 𝒮 induces a P3-free subgraph in G;

  • For each S𝒮, the connected components of G[S] are pairwise at distance at least d in G;

  • Each (inclusion-wise) maximal distance-d independent set of G is contained in some member of 𝒮.

Clearly, a distance-2 amiable family is nothing but an amiable family. Our main technical contribution is the following Lemma 7, proven in Section 4. Although the algorithm for Lemma 7 is inspired by the case d=2 and hence by the work of Lozin and Mosca [15], its proof of correctness is much more involved and requires genuinely new ideas.

Lemma 7.

Let d6 be a fixed integer. For every k, every kP3-free graph admits a distance-d amiable family of size |V(G)|O(k), which can be computed in time |V(G)|O(k).

Equipped with Lemma 7, we immediately obtain Theorem 5. Indeed, in order to solve Max-Weight Distance-d Independent Set on a kP3-free graph G, we simply find in polynomial time a distance-d amiable family 𝒮 of G as above and, for each member S𝒮, find a max-weight independent set in the P3-free graph G[S]. The latter can be clearly done in polynomial time, thus proving Theorem 5. The proof of Theorem 6 is similar to that of Theorem 3, the only difference being the use of a distance-d amiable family for d6, and hence omitted.

A remark about our approach, which combines ideas of Lozin and Mosca [14, 15] and Chudnovsky et al. [4], is in place. The proof of Chudnovsky et al. [4] that List r-Coloring (r1) is polynomial-time solvable on kP3-free graphs generalizes the earlier result of Hajebi et al. [9] that List 5-Coloring is polynomial-time solvable on kP3-free graphs, by replacing the second step in the proof of Hajebi et al. (see [9, Theorem 4.3]) with a significantly simpler argument (the aforementioned reduction to a bipartite matching problem) that, in addition, works for all r. However, their result still relies on the very technical first step of Hajebi et al. (see [9, Theorem 5.1]). Our approach can be viewed as a step further in the direction of simplifying and generalizing, as exemplified by our Theorems 3 and 6, which extend in different ways the main result of Chudnovsky et al. [4] by means of an arguably elegant and self-contained proof.

Proofs of statements marked with “” are omitted due to space constraints.

2 Preliminaries

We denote the set of positive integers by . For every n, we let [n]:={1,,n}. Given a set A, we denote by Ar the set of all ordered r-tuples of elements of A, i.e., Ar={(a1,,ar):aiAfori=1,,r}.

All graphs in our paper are finite and simple. The empty graph is the graph with no vertices. Let now G be a graph. For XV(G), we denote the subgraph of G induced by X as G[X], that is G[X]=(X,{uv:u,vXanduvE(G)}). We use NG(X) to denote the neighbors in VX of vertices in X. For disjoint sets X,YV(G), we say that X is complete to Y if every vertex in X is adjacent to every vertex in Y, and X is anticomplete to Y if there are no edges between X and Y. For a subset XV(G), the anti-neighborhood of X, denoted by 𝒜(X), is the subset of vertices in V(G)X which are anticomplete to X. With a slight abuse of notation, if X={v1,,vi}, we denote 𝒜(X)=𝒜({v1,,vi}) by 𝒜(v1,,vi). Given two subsets X,YV(G), an X,Y-path in G is a path in G which has one end in X, the other end in Y, and whose inner vertices belong to neither X nor Y. For vertices u,vV(G), we denote by dG(u,v) the distance between u and v in G, i.e., the length of a shortest u,v-path in G. If no such path exists, we let dG(u,v)=. Moreover, for d, we let NGd(v)={uV(G):dG(v,u)d} and NGd(v)={uV(G){v}:dG(v,u)d}. Given two subsets X,YV(G), the distance between X and Y in G is the quantity dG(X,Y)=minxX,yYdG(x,y), i.e., the length of a shortest path in G between a vertex in X and a vertex in Y. Given uV(G) and QV(G), we say that u is connected to Q in G if there exists a u,Q-path in G (possibly of length 0).

A clique of a graph is a set of pairwise adjacent vertices and an independent set is a set of pairwise non-adjacent vertices. A matching of a graph is a set of pairwise non-adjacent edges. A connected component of G is a maximal connected subgraph of G. For convenience, we will often view a connected component as its vertex set rather than the subgraph itself. For this reason, we will say for example that “a connected component is a clique” rather than “a connected component is a complete subgraph”. Throughout the paper, we will repeatedly make use of the fact that every connected component of a P3-free graph is a clique.

3 The proof of Theorem 3

In this section we prove Theorem 3. As mentioned in the introduction, the first step is to obtain a polynomial-time algorithm for finding an amiable family (necessarily of polynomial size) of a kP3-free graph. The second step consists then in reducing Max-Weight List r-Colorable Induced Subgraph to polynomially many auxiliary weighted matching problems. We do this in Lemma 9. We finally combine these two steps and prove Theorem 3.

Lemma 8 ().

For every k, every kP3-free graph G admits an amiable family of size |V(G)|O(k), which can be computed in time |V(G)|O(k).

Lemma 9.

Let r1 and d2 be fixed integers. Let G be a graph with weight function w:V(G)+, L an r-list assignment of G, and 𝒮 a distance-d amiable family of G. Given an r-tuple (S1,,Sr)𝒮r, there exists an O(((r+1)|V(G)|)3)-time algorithm that finds a maximum-weight induced subgraph H of G[i[r]Si] which admits a (d,r)-coloring ϕ:V(H)[r] satisfying the following:

  1. 1.

    For every vV(H), ϕ(v)L(v);

  2. 2.

    For every i[r], {vV(H):ϕ(v)=i}Si.

Proof.

Consider an r-tuple (S1,,Sr)𝒮r. For every i[r], let ci be the number of connected components of G[Si] and let Si1,,Sici be an arbitrary ordering of the connected components of G[Si]. By definition of distance-d amiable family, each such connected component of G[Si] is a clique and any two of them are pairwise at distance at least d in G.

The first step of our algorithm consists in preprocessing the graph G[i[r]Si] as follows. For every i[r], if there exists a vertex vSi such that iL(v), then we remove v from Si, that is, we set Si=Si{v}. Observe that this preprocessing is safe. Indeed, if H is an induced subgraph of G[i[r]Si] for which there exists a (d,r)-coloring ϕ satisfying both 1 and 2, then surely ϕ(v)i if vV(H).

We next show that finding such an induced subgraph of G[i[r]Si] of maximum weight boils down to finding a maximum-weight matching in an auxiliary weighted bipartite graph B constructed as follows. The graph B has bipartition XY and edge set E(B), where

X={xSij:i[r],j[ci]},Y={yv:vi[r]Si}andE(B)=i=1rj=1ci{yvxSij:vSij}.

Moreover, for each vi[r]Si, every edge of B incident to yv is assigned the weight w(v). Note that |V(B)|=|i[r]Si|+i[r]ci|V(G)|+r|V(G)|=(r+1)|V(G)|.

Claim 10 ().

Let m+. The graph G[i[r]Si] has an induced subgraph H with w(V(H))=m and which admits a (d,r)-coloring satisfying both 1 and 2 if and only if B has a matching of weight m.

Now, by Claim 10, our problem reduces to finding a maximum-weight matching in the bipartite graph B, which can be done in O(|V(B)|3)-time using the Hungarian method (see [17, Theorem 17.3]). Since |V(B)|(r+1)|V(G)|, this completes the proof of Lemma 9.

We can finally sketch the proof of Theorem 3.

Proof of Theorem 3.

Given a kP3-free graph G and an r-list assignment L of G, the following algorithm outputs, in polynomial time, an induced subgraph H of G admitting a coloring that respects L and such that H is of maximum weight among all such subgraphs of G.

  1. 1.

    Compute an amiable family 𝒮 of G of size |V(G)|O(k).

  2. 2.

    For each r-tuple (S1,,Sr)𝒮r, find a maximum-weight induced subgraph H of G[i[r]Si] which admits a coloring ϕ:V(H)[r] satisfying 1 and 2 of Lemma 9.

  3. 3.

    Among all induced subgraphs computed in Step 2, output one of maximum weight.

4 Distance-𝒅 amiable families: The proof of Lemma 7

In this section we prove Lemma 7, which is used for the proof of Theorem 6. To make our inductive proof of Lemma 7 work, we show in fact something more general, which requires the following definition. Given a graph G and a subset FV(G), a subset SV(G) is F-avoiding if SF=. By extension, a family 𝒮2V(G) is F-avoiding if each member of 𝒮 is F-avoiding. For a graph G, a family 𝒮2V(G) of subsets of V(G) is an F-avoiding distance-d amiable family if it satisfies the following properties:

  • 𝒮 is F-avoiding;

  • Each member of 𝒮 induces a P3-free subgraph in G;

  • For each S𝒮, the connected components of G[S] are pairwise at distance at least d in G;

  • Each (inclusion-wise) maximal F-avoiding distance-d independent set of G is contained in some member of 𝒮.

Note that a distance-d amiable family of G is nothing but an F-avoiding distance-d amiable family of G for F=. As we shall see, our proof of Lemma 7 in fact shows that, for every kP3-free graph G and every FV(G), the graph G admits an F-avoiding distance-d amiable family of size |V(G)|O(k) and which can be computed in time |V(G)|O(k).

Before formally proving Lemma 7, let us discuss why our approach fails for 3d5 (recall however that the failure for d{3,5} is to be expected given the hardness results in Theorem 2). The algorithm for computing a distance-d amiable family is, in essence, similar to the one for computing an amiable family (so d=2): it enumerates all P3’s uvw in the graph, “guesses” which vertex in the path is in the independent set and recursively calls the algorithm on (roughly) the anti-neighborhood of {u,v,w}, which is (k1)P3-free. The main difference (and difficulty) is in ensuring that the family computed recursively satisfies the distance requirement: the connected components of each member in this family could in principle be closer in the original graph. Consider, for instance, the case where u is picked in the independent set, and there are four connected components Q1,Q2,P1,P2 in a member of the recursively computed family with shortest paths between Q1 and Q2, and P1 and P2 as shown in Figure 2. Then, for d5, Q1 and Q2 can end up at a distance less than d, while P1 and P2 are at a distance at least d. Since there is a priori no way of “distinguishing” these two cases, we have to take d “large enough”. The precise argument appears in the proof of Lemma 7 (Claim 12). We finally restate Lemma 7.

Figure 2: The case d5 (paths in blue are of length d3, those in red, d2).
Lemma 7. [Restated, see original statement.]

Let d6 be a fixed integer. For every k, every kP3-free graph admits a distance-d amiable family of size |V(G)|O(k), which can be computed in time |V(G)|O(k).

Proof of Lemma 7.

To prove the lemma, we provide, for every d6 and every k1, an algorithm Λkd which takes as input a kP3-free graph G, together with an arbitrary ordering of V(G), and a subset FV(G), and outputs an F-avoiding distance-d amiable family Λkd(G,F) of G. The pseudo-code of the algorithm is given in Algorithm 1. Note that, if the input graph G is the empty graph, Λkd correctly outputs Λkd(G)={}.

In the following, we prove three claims (Claims 11, 12, and 13) which altogether show that, for every d6 and every k1, if G is a kP3-free graph and FV(G), then the family Λkd(G,F) is indeed an F-avoiding distance-d amiable family. We will then show that Λkd(G,F) has size |V(G)|O(k) and that the algorithm Λkd has running time |V(G)|O(k). Taking F=, will prove the lemma.

Given a graph G on n vertices and an ordering v1,,vn of V(G), we let Gi=G[{v1,,vi}]. Moreover, an induced path in G with vertex set {x1,x2,,x} and edge set {x1x2,x2x3,x1x} is denoted by listing its vertices in the natural order x1x2x.

Algorithm 1 Λkd.
Claim 11 ().

For every d6 and every k1, if G is a kP3-free graph and FV(G), then Λkd(G,F) is F-avoiding.

Claim 12.

For every d6 and k1, if G is a kP3-free graph, FV(G), and SΛkd(G,F), then G[S] is P3-free and its connected components are pairwise at distance at least d in G.

Proof of Claim 12.

For fixed d6, we proceed by induction on k. The statement holds for k=1, since for every P3-free graph G and every FV(G), Λ1d(G)={V(G)F}. Suppose now that k>1 and that the statement holds for k1. Let G be an n-vertex kP3-free graph and let FV(G) as in input. For every i[n], let 𝒮i be the state of the family 𝒮 at the end of the i-th iteration of the main loop. We show by induction on i that each member of 𝒮i induces a P3-free subgraph of G whose connected components are pairwise at distance at least d in G. The case i=1 trivially holds, since either v1F in which case 𝒮1={}, or v1F in which case 𝒮1={{v1}}. Thus, suppose that i>1 and that the statement holds for i1.

Consider S𝒮i. If S𝒮i1 then, by the induction hypothesis, G[S] is P3-free and its connected components are pairwise at distance at least d in G. Thus, we may assume that S𝒮i1. This implies that S is added to 𝒮i in one of the three inner loops during the i-th iteration of the main loop. If S is added in line 6 as an extension of a member of 𝒮i1, then the statement holds by construction. Suppose next that S is added to 𝒮i in line 10. Hence, there exist an induced P3 uvw in Gi such that uF and a set CΛk1d(G[NG4(u)],(FNG4(u))(NG4(u)NGd1(u))) such that S=C{u}. Observe now that since G is kP3-free and (NG(v)NG(w))NG4(u)=, the graph G[NG4(u)] is (k1)P3-free, and thus, by the induction hypothesis on k1, every member of Λk1d(G[NG4(u)],(FNG4(u))(NG4(u)NGd1(u))) induces a P3-free subgraph of G whose connected components are pairwise at distance at least d in G[NG4(u)]. We claim that then, the connected components of G[C] are in fact pairwise at distance at least d in G. Suppose, to the contrary, that there exist two connected components Q1 and Q2 of G[C] such that dG(Q1,Q2)d1. Since the distance in G[NG4(u)] between Q1 and Q2 is at least d, every shortest path in G from Q1 to Q2 contains at least one vertex of V(G)NG4(u); let P be such a shortest path and let xV(G)NG4(u) be an arbitrary vertex on P. Clearly, dG(u,x)3. Now, by Claim 11, C((FNG4(u))(NG4(u)NGd1(u)))= which implies, in particular, that CNGd(u). It follows that for j[2],

ddG(u,Qj)dG(u,x)+dG(x,Qj)3+dG(x,Qj)and thus,
dG(Q1,Q2)=dG(Q1,x)+dG(x,Q2)2(d3).

Since, by assumption, dG(Q1,Q2)d1, we conclude that 2(d3)d1, that is, d5, a contradiction. Thus, the connected components of G[C] are pairwise at distance at least d in G. Since CNGd(u), as previously observed, and G[C] is P3-free, it follows that S=C{u} induces a P3-free graph whose connected components are pairwise at distance at least d in G. We conclude similarly in the case where S is added to 𝒮i in line 14.

Claim 13.

For every d6 and k1, if G is a kP3-free graph and FV(G), then every F-avoiding distance-d independent set of G is contained in a member of Λkd(G,F).

Proof of Claim 13.

For fixed d6, we proceed by induction on k. The statement clearly holds for k=1, since for every P3-free graph G and every FV(G), Λ1d(G,F)={V(G)F}. Suppose now that k>1 and that the statement holds for k1. Let G be a kP3-free graph and let FV(G) as in input. For every i[n], let 𝒮i be the state of the family 𝒮 at the end of the i-th iteration of the main loop. Furthermore, given a distance-d independent set I of G such that IV(Gi), we say that I is Gi-compatible if for every uI and every connected component Q of Gi such that u is connected to Q in G, there exists a shortest u,Q-path Pu,Q in G such that NG2(u)V(Pu,Q)V(Gi). We now show, by induction on i, that for every Gi-compatible F-avoiding distance-d independent set I of G such that IV(Gi), there exists S𝒮i such that IS. Note that this is enough to prove our statement for k, since any F-avoiding distance-d independent set of G=Gn is surely Gn-compatible.

The base case i=1 trivially holds, since either v1F and 𝒮1={} in which case is the only G1-compatible F-avoiding distance-d independent of G1, or v1F and 𝒮1={{v1}} in which case {v1} is the only maximal G1-compatible F-avoiding distance-d independent set of G1. Thus, suppose that i>1 and that the statement holds for i1.

Consider a Gi-compatible F-avoiding distance-d independent set I of G such that IV(Gi). If IV(Gi1) and I is Gi1-compatible then, by the induction hypothesis, there exists S𝒮i1 such that IS. Observe now that, by construction, there then exists S𝒮i such that SS and hence IS. Thus, assume that this does not hold. This implies that either IV(Gi1), or IV(Gi1) but I is not Gi1-compatible. We distinguish these two cases and argue that we can always find S𝒮i such that IS.

Case 1.

IV(Gi1).
Hence, viI. Since I is F-avoiding, viF. We claim that I{vi} is Gi1-compatible. Indeed, since I is Gi-compatible, for every uI{vi} and every connected component Q of Gi such that u is connected to Q in G, there exists a shortest u,Q-path Pu,Q in G such that NG2(u)V(Pu,Q)V(Gi). But vi is at distance at least d6 from u in G and so vi(NG2(u)V(Pu,Q)), that is, NG2(u)V(Pu,Q)V(Gi1) which proves our claim. By the induction hypothesis, there exists S𝒮i1 such that I{vi}S. If G[S{vi}] is P3-free and its connected components are pairwise at distance at least d in G, then S{vi}𝒮i by construction (cf. line 6) and IS{vi}. Thus, we may assume that this does not hold. Hence, either G[S{vi}] contains at least one induced P3, or G[S{vi}] is P3-free but at least two of its connected components are at distance strictly less than d in G.

Case 1.1.

G[S{vi}] contains at least one induced P3.
By Claim 12, G[S] is P3-free and thus, any induced P3 in G[S{vi}] must contain vi. We distinguish two cases. Suppose first that there exist a connected component Q of G[S] and a vertex uQ such that vi is adjacent to u but not complete to Q, say wQ is nonadjacent to vi. Note that at some point during the i-th iteration of the main loop, the induced P3 viuw is considered in the second inner loop, since viF. Furthermore, since G is kP3-free and (NG(u)NG(w))NG4(vi)=, the graph G[NG4(vi)] is (k1)P3-free. Thus, by the induction hypothesis on k1 and since I{vi}NGd(vi)F, there exists CΛk1d(G[NG4(vi)],(FNG4(vi))(NG4(vi)NGd1(vi))) such that I{vi}C. But then, C{vi}𝒮i and IC{vi}. The case where, for every connected component Q of G[S] the vertex vi is either complete or anticomplete to Q, is handled similarly.

Case 1.2.

G[S{vi}] is P3-free but at least two of its connected components are at distance strictly less than d in G.
By Claim 12, the connected components of G[S] are pairwise at distance at least d in G and so there must exist a connected component Q of G[S{vi}] at distance strictly less than d in G to the connected component of G[S{vi}] containing vi. Now, since vi is connected to Q in G and viI, the assumption that I is Gi-compatible implies that there exists a shortest vi,Q-path Pvi,Q in G such that NG2(vi)V(Pvi,Q)V(Gi). Let u1,u2V(Gi) be the two vertices on Pvi,Q at distance one and two, respectively, from vi. Note that at some point during the i-th iteration of the main loop, the induced P3 viu1u2 is considered in the second inner loop, since viF. Moreover, since G is kP3-free and (NG(u1)NG(u2))NG4(vi)=, the graph G[NG4(vi)] is (k1)P3-free. Thus, by the induction hypothesis on k1 and since INGd(vi)F, there exists CΛk1d(G[NG4(vi)],(FNG4(vi))(NG4(vi)NGd1(vi))) such that I{vi}C. But then, C{vi}𝒮i and IC{vi}.

Case 2.

IV(Gi1) but I is not Gi1-compatible.
Hence, there must exist uI and a connected component Q of Gi to which u is connected in G such that viNG2(u)V(Pu,Q), where Pu,Q is a shortest path in G from u to Q given by the Gi-compatibility of I. Let u1,u2V(Gi) be the vertices on Pu,Q at distance one and two, respectively, from u. Note that at some point during the i-th iteration of the main loop, the induced P3 uu1u2 is considered in the second inner loop, since viF. Moreover, since G is kP3-free and (NG(u1)NG(u2))NG4(u)=, the graph G[NG4(u)] is (k1)P3-free. Thus, by the induction hypothesis on k1 and since INGd(u)F, there exists CΛk1d(G[NG4(u)],(FNG4(u))(NG4(u)NGd1(u))) such that I{u}C. But then, C{u}𝒮i and IC{u}.

Since in all cases we found S𝒮i with IS, this concludes the proof of Claim 13.

It follows now from Claims 11, 12, and 13 that, for every d6 and every k1, if G is a kP3-free graph and FV(G), then the family Λkd(G,F) is indeed an F-avoiding distance-d amiable family. It remains to show that Λkd(G,F) has size at most |V(G)|O(k) and that the running time of the algorithm Λkd is |V(G)|O(k). To this end, let

fd(n,k)=max{|Λkd(G,F)|:|V(G)|n,FV(G) and G is kP3-free}.

Clearly, fd(n,1)=1 for every n. We claim that, for every n and k>1, fd(n,k)2n4fd(n,k1). Indeed, for every n-vertex kP3-free graph G and every FV(G), a member of Λkd(G,F) can only be created during an i-th iteration of the main loop (for some i[n]) in one of the inner loops from an induced P3 of Gi and some set resulting from a call to Λk1d. Since for each i[n] there are at most i3 such copies of P3 in Gi, at most 2i3fd(n,k1) new members are added in the i-th iteration of the main loop. It follows that fd(n,k)i[n]2i3fd(n,k1)2n4fd(n,k1) and thus fd(n,k)2k1n4(k1).

Similarly, for every d6 and every n,k, if Td(n,k) denotes the running time of the algorithm Λkd on an n-vertex kP3-free graph, then clearly Td(n,1)=O(n). Furthermore, we obtain the following recurrence for Td(n,k), where we use the fact that checking if an n-vertex graph is P3-free can be done in O(n3) time and determining if the connected components of an n-vertex graph are pairwise at distance at least d can be done in O(n3) time (using an all-pair-shortest-path algorithm):

Td(n,k)cn(fd(n,k)n3+2n3(Td(n,k1)+fd(n,k1)))2cn4Td(n,k1)+O(n4k),

for some constant c>0. We conclude that Td(n,k)nO(k).

References

  • [1] Akanksha Agrawal, Paloma T Lima, Daniel Lokshtanov, Paweł Rzążewski, Saket Saurabh, and Roohani Sharma. Odd Cycle Transversal on P5-free graphs in polynomial time. ACM Transactions on Algorithms, 21(2):16:1–16:14, 2025.
  • [2] Gábor Bacsó, Daniel Lokshtanov, Dániel Marx, Marcin Pilipczuk, Zsolt Tuza, and Erik Jan van Leeuwen. Subexponential-time algorithms for Maximum Independent Set in Pt-free and broom-free graphs. Algorithmica, 81(2):421–438, 2019.
  • [3] Nina Chiarelli, Tatiana R Hartinger, Matthew Johnson, Martin Milanič, and Daniël Paulusma. Minimum connected transversals in graphs: new hardness results and tractable cases using the price of connectivity. Theoretical Computer Science, 705:75–83, 2018. doi:10.1016/J.TCS.2017.09.033.
  • [4] Maria Chudnovsky, Sepehr Hajebi, and Sophie Spirkl. List-k-Coloring H-free graphs for all k>4. Combinatorica, 44(5):1063–1068, 2024.
  • [5] Maria Chudnovsky, Rose McCarty, Marcin Pilipczuk, Michał Pilipczuk, and Paweł Rzążewski. Sparse induced subgraphs in P6-free graphs. In David P. Woodruff, editor, Proceedings of the 2024 ACM-SIAM Symposium on Discrete Algorithms (SODA 2024), pages 5291–5299. SIAM, 2024. doi:10.1137/1.9781611977912.190.
  • [6] Jean-François Couturier, Petr A Golovach, Dieter Kratsch, and Daniël Paulusma. List coloring in the absence of a linear forest. Algorithmica, 71:21–35, 2015. doi:10.1007/S00453-013-9777-0.
  • [7] Konrad K Dabrowski, Carl Feghali, Matthew Johnson, Giacomo Paesani, Daniël Paulusma, and Paweł Rzążewski. On cycle transversals and their connected variants in the absence of a small linear forest. Algorithmica, 82:2841–2866, 2020. doi:10.1007/S00453-020-00706-6.
  • [8] Hiroshi Eto, Fengrui Guo, and Eiji Miyano. Distance-d independent set problems for bipartite and chordal graphs. Journal of Combinatorial Optimization, 27(1):88–99, 2014.
  • [9] Sepehr Hajebi, Yanjia Li, and Sophie Spirkl. Complexity dichotomy for List-5-Coloring with a forbidden induced subgraph. SIAM Journal on Discrete Mathematics, 36(3):2004–2027, 2022. doi:10.1137/21M1443352.
  • [10] Cicely Henderson, Evelyne Smith-Roberge, Sophie Spirkl, and Rebecca Whitman. Maximum k-colourable induced subgraphs in (P5+rK1)-free graphs. arXiv, 2024. arXiv:2410.08077.
  • [11] Richard M. Karp. Reducibility among combinatorial problems. In Raymond E. Miller, James W. Thatcher, and Jean D. Bohlinger, editors, Complexity of Computer Computations: Proceedings of a symposium on the Complexity of Computer Computations, pages 85–103. Springer US, 1972. doi:10.1007/978-1-4684-2001-2_9.
  • [12] John M. Lewis and Mihalis Yannakakis. The node-deletion problem for hereditary properties is 𝖭𝖯-complete. Journal of Computer and System Sciences, 20(2):219–230, 1980. doi:10.1016/0022-0000(80)90060-4.
  • [13] Daniel Lokshtanov, Paweł Rzążewski, Saket Saurabh, Roohani Sharma, and Meirav Zehavi. Maximum Partial List H-Coloring on P5-free graphs in polynomial time. arXiv, 2024. arXiv:2410.21569.
  • [14] Vadim V. Lozin. From matchings to independent sets. Discrete Applied Mathematics, 231:4–14, 2017. doi:10.1016/J.DAM.2016.04.012.
  • [15] Vadim V. Lozin and Raffaele Mosca. Maximum regular induced subgraphs in 2P3-free graphs. Theoretical Computer Science, 460:26–33, 2012.
  • [16] Giacomo Paesani, Daniël Paulusma, and Paweł Rzążewski. Feedback Vertex Set and Even Cycle Transversal for H-free graphs: Finding large block graphs. SIAM Journal on Discrete Mathematics, 36(4):2453–2472, 2022. doi:10.1137/22M1468864.
  • [17] Alexander Schrijver. Combinatorial Optimization – Polyhedra and Efficiency, volume 24 of Algorithms and Combinatorics. Springer, 2004.
  • [18] Alexa Sharp. Distance coloring. In Lars Arge, Michael Hoffmann, and Emo Welzl, editors, Algorithms – ESA 2007, 15th Annual European Symposium, volume 4698 of Lecture Notes in Computer Science, pages 510–521. Springer, 2007. doi:10.1007/978-3-540-75520-3_46.