1 Introduction

For any missing notation or reference let us refer to [6].

For any graph G, let V(G) and E(G) denote respectively the vertex-set and the edge-set of G. Let G be a graph. For any subset \(U \subseteq V(G)\), let G[U] denote the subgraph of G induced by U. For any vertex-set \(U \subseteq V(G)\), let \(N(U) = \{v \in V(G) \setminus U:\) v is adjacent to some \(u \in U\}\) be the neighborhood of U in G. In particular: if \(U = \{u_1,\ldots ,u_k\}\), then let us simply write \(N(u_1,\ldots ,u_k)\) instead of \(N(\{u_1,\ldots ,u_k\})\); for any vertex-set \(W \subseteq V(G)\), with \(U \cap W = \emptyset \), let us write \(N_W(U) = N(U) \cap W\). For any vertex-set \(U \subseteq V(G)\), let us say that \(A(U) = V(G) \setminus (U \cup N(U))\) is the anti-neighborhood of U in G. For any vertex \(v \in V(G)\) and for any subset \(U \subset V(G)\) (with \(v \not \in U\)), let us say that: v contacts U if v is adjacent to some vertex of U; v is partial to U if v contacts U but is non-adjacent to some vertex of U; v is universal to U if v is adjacent to all vertices of U.

A component of G is a maximal connected subgraph of G. A component of G is trivial if it is a singleton, and nontrivial otherwise. A component-set of G is the vertex set of a component of G. A component-set of G is trivial if it is a singleton, and nontrivial otherwise. A clique of G is a set of pairwise adjacent vertices of G. An independent set (or a stable set) of G is a subset of pairwise nonadjacent vertices of G. An independent set of G is maximal if it is not properly contained in another independent set of G.

A graph G is H-free, for a given graph H, if G contains no induced subgraph isomorphic to H; in particular H is called a forbidden induced subgraph of G. A graph class is hereditary if it is defined by a hereditary graph property or equivalently by forbidding a family of induced subgraphs. Given two graphs G and F, \(G + F\) denotes the disjoint union of G and F; in particular \(lG = G + G + \cdots + G\) denotes the disjoint union of l copies of G.

A graph G is bipartite if V(G) admits a partition \(\{A,B\}\) such that A and B are independent sets of G, i.e., such that \(E(G) \subseteq A \times B\); in particular G is complete bipartite if \(E(G) = A \times B\).

The following specific graphs are mentioned later. A \(P_k\) has vertices \(v_1,v_2,\ldots ,v_k\) and edges \(v_jv_{j+1}\) for \(1 \le j < k\). A \(C_k\) has vertices \(v_1,v_2,\ldots ,v_k\) and edges \(v_jv_{j+1}\) for \(1 \le j < k\) and \(v_kv_1\). A \(K_n\) is a complete graph of n vertices. A Claw has vertices abcd, and edges abacad. A Fork has vertices abcde, and edges abacadde (then a Fork contains a Claw as an induced subgraph). A \(S_{i,j,k}\) is the graph obtained from a Claw by subdividing respectively its edges into i, j, k edges (e.g., \(S_{0,1,2}\) is \(P_4\), \(S_{1,1,1}\) is Claw).

The Maximum Weight Independent Set Problem (WIS) is the following: Given a graph G and a weight function w on V(G), determine an independent set of G of maximum weight, where the weight of an independent set I is given by the sum of w(v) for \(v \in I\). Let \(\alpha _w(G)\) denote the maximum weight of any independent set of G. The WIS problem reduces to the IS problem if all vertices v have the same weight \(w(v) = 1\).

The WIS problem is NP-hard [19]. It remains NP-hard under various restrictions, such as e.g. Triangle-free graphs [37] and more generally graphs with no induced cycle of given length [31, 37], cubic graphs [18] and more generally k-regular graphs [16], planar graphs [17]. It can be solved in polynomial time for various graph classes, such as e.g. \(P_4\)-free graphs [10], bipartite graphs [1, 12, 21] and more generally perfect graphs [20], Claw-free graphs [13, 30, 32, 33, 40] and more generally Fork-free graphs [4, 26], \(2K_2\)-free graphs [14] and more generally \(lK_2\)-free graphs for any constant l (by combining an algorithm generating all maximal independent sets of a graph [41] and a polynomial upper bound on the number of maximal independent sets in \(lK_2\)-free graphs [3, 15, 38]), \(K_2+\)Claw-free graphs [27], \(2P_3\)-free graphs [28], and more generally \(lP_3\)-free graphs for any constant l, and lClaw-free graphs for any constant l [8]; then recently, after many attempts, for \(P_5\)-free graphs [24] and more generally for \(P_6\)-free graphs [22].

Let us report the following result due to Alekseev [2, 5].

Theorem 1

[2] Let \({{\mathcal {X}}}\) be a class of graphs defined by a finite set \({{\mathcal {M}}}\) of forbidden induced subgraphs. If \({{\mathcal {M}}}\) contains no graph every component of which is \(S_{i,j,k}\) for some indices ijk, then the (W)IS problem is NP-hard in the class \({{\mathcal {X}}}\).

Theorem 1 implies that (unless P = NP) for any graph F, if WIS can be solved for F-free graphs in polynomial time, then each component of F is \(S_{i,j,k}\) for some indices ijk. Then Lozin [25] conjectured that WIS can be solved in polynomial time for \(S_{i,j,k}\)-graphs for any fixed indices ijk. The above allows one to focus on possible open problems, i.e., on possible graph classes for which WIS may be solved in polynomial time.

This manuscript shows that (i) WIS can be solved for (\(P_4+P_4\), Triangle)-free graphs in polynomial time, and that in particular it turns out that (ii) for every (\(P_4+P_4\), Triangle)-free graph G there is a family \({{\mathcal {S}}}\) of subsets of V(G) inducing (complete) bipartite subgraphs of G, which contains polynomially many members and can be computed in polynomial time, such that every maximal independent set of G is contained in some member of \({{\mathcal {S}}}\).

The class of \(P_4+P_4\)-free graphs has been considered since, according to the above mentioned polynomial results and to possibly forthcoming similar polynomial results, it may be one of the next boundary graph classes for which the complexity of WIS is an open problem.

The class of Triangle-free graphs, which seems to be a more studied graph class (see e.g. [23]), has been considered in the context of similar previous manuscripts on other subclasses of Triangle-free graphs; namely on (\(P_7\),Triangle)-free graphs [7], more generally on (\(P_7\),Bull)-free and (\(S_{1,2,3}\),Bull)-free graphs [29], and on (\(S_{1,2,4}\),Triangle)-free graphs [9].

However let us observe that Lozin’s conjecture is open also for those \(S_{i,j,k}\)-graphs for any fixed indices ijk which in addition are Triangle-free—recalling that WIS remains NP-hard for Triangle-free graphs—that is for restricted and more studied graph classes. Let us mention just a recent strong result due to Pilipczuk et al. [36] stating that graphs containing no Theta [a Theta is a graph made of three internally vertex-disjoint chordless paths \(P1 = a . . . b\), \(P2 = a . . . b\), \(P3 = a . . . b\) of length at least 2 and such that no edges exist between the paths except the three edges incident to a and the three edges incident to b], no Triangle, and no \(S_{i,j,k}\) as induced subgraphs for any fixed indices ijk have bounded treewidth, which implies that a large number of NP-hard problems can be solved in polynomial time for such graphs, in particular the WIS problem.

2 Independent Sets in (\(P_4+P_4\), Triangle)-Free Graphs

In this section let us show that WIS can be solved for (\(P_4+P_4\), Triangle)-free graphs in polynomial time.

First let us introduce two general observations: they are easy to prove and are the basis of the approach—in other contexts called anti-neighborhood approach—which will be used later.

Observation 1

For any graph G, \(\alpha _w(G) = max \{\alpha _w(G[V(G) \setminus N(v)]): v \in V(G)\}\); then for any \(v \in V(G)\), \(\alpha _w(G) = max \{\alpha _w(G[V(G) \setminus N(v)]), \alpha _w(G[V(G) \setminus \{v\}]) \}\)

Observation 2

For any graph G and for any order \(v_1,v_2,\ldots ,v_n\) of the vertices of G, \(\alpha _w(G) = max \{\alpha _w(G[V(G) \setminus N(v_1)]), \alpha _w(G[(V(G) \setminus \{v_1\})\setminus N(v_2)]), \ldots , \alpha _w(G[(V(G) \setminus \{v_1,\ldots ,v_{n-1}\})\setminus N(v_n)])\}\). □

For any induced \(P_4\) of any (\(P_4+P_4\), Triangle)-free G, say P, of vertex set \(V(P) = \{a,b,c,d\}\) and edge set \(E(P) = \{ab,bc,cd\}\), one has that N(V(P)) admits the partition

$$ \{S_a,S_b,S_c,S_d,S_{a,c},S_{a,d},S_{b,d}\} $$

where \(S_X = \{v \in V(G) \setminus X : N(v) \cap V(P) = X\}\) for any \(X \subseteq V(P)\).

It is well known [and easy to check] that every non-trivial component of a (\(P_4\), Triangle)-free graph is complete bipartite.

Then the following observation can be shown with no difficult.

Observation 3

Let G be a (\(P_4+P_4\), Triangle)-free graph. Then for any subset \(T \subseteq V(G)\) such that G[T] is \(P_4\)-free one has that:

  1. (i)

    every non-trivial component of G[T] is complete bipartite;

  2. (ii)

    each vertex of \(V(G) \setminus T\) does not contact both sides of any non-trivial component of G[T].

Note that, for any induced \(P_4\) say P of G, G[A(P)] is \(P_4\)-free. □

Then let us recall that WIS can be solved for bipartite graphs in polynomial time [1, 12, 21]. In particular let us formalize as lemma the following fact which can be (independently) shown with no difficult.

Lemma 1

The WIS problem can be solved for complete bipartite graphs in polynomial time, i.e., in linear time. □

The case of a and c (or b and d, symmetrically) being in the sought independent set turns out to be the most challenging and interesting. We isolate the behaviour of the algorithm in this case as Lemma 2 below, whose proof is postponed in Sect. 2.1. In this section we show the main result assuming Lemma 2.

Lemma 2

Let G be a (\(P_4+P_4\), Triangle)-free graph containing an induced \(P_4\), say P, of vertex set \(V(P) = \{a,b,c,d\}\) and edge set \(E(P) = \{ab,bc,cd\}\). Then a maximum weight independent set of G containing \(\{a,c\}\) (containing \(\{b,d\}\), respectively, by symmetry) can be computed in polynomial time.

Proof

The proof is introduced in Sect. 2.1. □

Then let us consider the following algorithm.

Algorithm Last

Input: a (\(P_4+P_4\), Triangle)-free graph G.

Output: a maximum weight independent set of G.

Step 1.

For each induced \(P_4\) of G, say P, of vertex set \(V(P) = \{a,b,c,d\}\) and edge set \(E(P) = \{ab,bc,cd\}\) do:

  1. (1.1)

    compute [by Lemma 2] a maximum weight independent set of G containing \(\{a,c\}\): denote it as \(Q_1\);

  2. (1.2)

    compute [by Lemma 2] a maximum weight independent set of G containing \(\{b,d\}\): denote it as \(Q_2\);

  3. (1.3)

    compute [by Lemma 1] a maximum weight independent set of \(G[\{a,d\} \cup L \cup A(V(P))]\) where L is the set of those vertices in \(S_b \cup S_c\) which are isolated in \(G[S_b \cup S_c \cup A(V(P))]\): denote it as \(Q_3\);

  4. (1.4)

    select a best weight independent set of G over \(\{Q_1,Q_2,Q_3\}\): denote it as Q(P).

Step 2.

Select a best weight independent set of G over \(\{Q(P): P\) is an induced \(P_4\) of \(G\}\): denote it as \(Q_{black}\).

Step 3.

  1. (3.1)

    Remove from G all the vertices of G which belong to an induced \(P_4\) of G: let \(G'\) be the graph obtained in this way.

  2. (3.2)

    Compute [by Lemma 1] a maximum weight independent set of \(G'\): denote it as \(Q_{white}\).

Step 4.

Select a best weight independent set of G over \(\{Q_{black},Q_{white}\}\) and output it.

Theorem 2

The WIS problem can be solved for \((P_4+P_4, Triangle)\)-free graphs in polynomial time via Algorithm Last.

Proof

First let us show that Algorithm Last can be executed in polynomial time.

As a preliminary let us observe that any (input) graph G contains \(O(n^4)\) induced \(P_4\)’s. Concerning Step 1: steps (1.1)–(1.2) can be executed in polynomial time by Lemma 2; step (1.3) can be executed in polynomial time since every component of \(G[\{a,d\} \cup L \cup A(V(P))]\) is complete bipartite: that follows since by construction \(\{a,d\} \cup L\) is an isolated independent set of \(G[\{a,d\} \cup L \cup A(V(P))]\) and since by Observation 3 each non-trivial component of G[A(V(P))] is complete bipartite; step (1.4) can be executed in constant time; then, by the preliminary observation, Step 1 can be executed in polynomial time. Concerning Step 2: it can be executed in polynomial time by the preliminary observation and since Step 1 can be executed in polynomial time. Concerning Step 3: it can be executed in polynomial time, by the preliminary observation, and since every component of \(G'\) is complete bipartite by Observation 3. Concerning Step 4: it can be executed in constant time.

Then let us show that Algorithm Last is correct.

Let U be any maximum (weight) independent set U of G: then let us show that Algorithm Last computes U or an equivalent optimal solution.

Case 1 \(U \cap V(P) \ne \emptyset \) for some induced \(P_4\) say P of G.

Let \(V(P) = \{a,b,c,d\}\) and \(E(P) = \{ab,bc,cd\}\). Then one has \(1 \le |U \cap V(P)| \le 2\).

Then let us consider the following exhaustive subcases.

Case 1.1 \(U \cap V(P) = \{a,c\}\).

Then a maximum weight independent set of G is computed in steps (1.1)-(1.2) with respect to P.

Case 1.2 \(U \cap V(P) = \{b,d\}\).

This case can be treated similarly to Case 1.1 by symmetry.

Case 1.3 \(U \cap V(P) = \{a,d\}\).

Then a maximum weight independent set of G is a maximum weight independent set of \(G[\{a,d\} \cup S_b \cup S_c \cup A(V(P))]\). Note that, since G is Triangle-free, \(S_b\) and \(S_c\) are independent sets. Then \(S_b \cup S_c\) admits a partition, say \(\{L,L'\}\), where L is the set of those vertices of \(S_b \cup S_c\) which are isolated in \(G[S_b \cup S_c \cup A(V(P))]\) [as defined above] and \(L' = (S_b \cup S_c) \setminus L\). Now: (i) either \(U \cap L' = \emptyset \), in which case a maximum weight independent set of G is contained in \(\{a,d\} \cup L \cup A(V(P))\), so that it is computed in step (1.3) with respect to P; (ii) or \(U \cap L' \cap S_b \ne \emptyset \), namely there is a vertex say \(b' \in U \cap L' \cap S_b\) with a neighbor say \(b'' \in S_c \cup A(V(P))\), so that vertices \(a,b,b'b''\) induce a \(P_4\) say P(b) of G, and then a maximum weight independent set of G is computed in step (1.3) with respect to P(b); (iii) or \(U \cap L' \cap S_c \ne \emptyset \), namely there is a vertex say \(c' \in U \cap L' \cap S_c\) with a neighbor say \(c'' \in S_b \cup A(V(P))\), so that vertices \(d,c,c'c''\) induce a \(P_4\) say P(c) of G, and then a maximum weight independent set of G is computed in step (1.3) with respect to P(c).

Case 1.4 \(U \cap V(P) = \{a\}\).

Note that every maximum weight (thus maximal) independent set of \(G[V(G) \setminus N(a)]\) not containing vertices of \(\{b,c,d\}\) has to contain some vertex of \(S_c\), namely there is a vertex say \(c' \in U \cap S_c\), so that vertices \(a,b,c,c'\) induce a \(P_4\) say \(P'\) of G, and then a maximum weight independent set of G is computed in step (1.3) with respect to \(P'\).

Case 1.5 \(U \cap V(P) = \{b\}\).

Note that every maximum weight (thus maximal) independent set of \(G[V(G) \setminus N(b)]\) not containing vertices of \(\{a,c,d\}\) has to contain some vertex of \(S_d \cup S_{a,d}\), namely there is a vertex say \(d' \in U \cap (S_d \cup S_{a,d})\), so that vertices \(b,c,d,d'\) induce a \(P_4\) say \(P'\) of G, and then a maximum weight independent set of G is computed in step (1.3) with respect to \(P'\).

Case 1.6 \(U \cap V(P) = \{c\}\).

This case can be treated similarly to Case 1.5 by symmetry.

Case 1.7 \(U \cap V(P) = \{d\}\).

This case can be treated similarly to Case 1.4 by symmetry.

Case 2 \(U \cap V(P) = \emptyset \) for any induced \(P_4\) say P of G.

Then a maximum weight independent set of G is computed in Step 3.

This completes the proof of the theorem. □

2.1 Proof of Lemma 2

In this subsection let us introduce the proof of Lemma 2.

Let G be a (\(P_4+P_4\), Triangle)-free graph, with vertex weight function w, containing an induced \(P_4\) say P of vertex set \(V(P) = \{a,b,c,d\}\) and edge set \(E(P) = \{ab,bc,cd\}\).

Let us show that a maximum weight independent set of G containing \(\{a,c\}\) (containing \(\{b,d\}\), respectively, by symmetry) can be computed in polynomial time.

A maximum weight independent set of G containing \(\{a,c\}\) can be computed by solving WIS for \(G[\{a,c\} \cup S_b \cup S_d \cup S_{b,d} \cup A(V(P))]\). Then, since vertices of \(\{a,c\}\) are isolated in such a graph, the problem can be reduced to graph \(G[S_b \cup S_d \cup S_{b,d} \cup A(V(P))]\).

Then let us show that WIS can be solved for \(G[S_b \cup S_d \cup S_{b,d} \cup A(V(P))]\) in polynomial time.

The proof consists of solving a sequence of cases which are more and more difficult/general, each of which is solved by a reduction to the previous solved case, where the basic case is that of complete bipartite graphs; in this sense the proof is not a massive case distinction; in particular for the sake of completeness let us mention that is inspired to a teaching, by Professor Renato Caccioppoli, reported in the book [11].

In what follows two main macro-cases are solved, namely, Case A as the facilitated case and Case B as the general case.

2.1.1 Case A: The Facilitated Case

Case A is the following: graph G is such that V(G) admits a partition \(\{S, T\}\), where S is an independent set and G[T] is \(P_4\)-free, so that by Observation 3 every non-trivial component of G[T] is complete bipartite.

Then let us show that WIS can be solved for G in polynomial time.

For any \(v \in S\) and for any non-trivial component-set H of G[T] let us say that: v is bi-partial to H if v is partial to one of the sides of G[H]; v is bi-universal to H if v is universal to one of the two sides of G[H]; then by Observation 3, if v contacts H, then v is either bi-partial to H or bi-universal to H.

Let \({{\mathcal {H}}}\) denote the family of non-trivial component-sets of G[T]: then, as recalled above, every member of \({{\mathcal {H}}}\) induces a complete bipartite graph. For any \(v \in S\), let \({{\mathcal {H}}}[v]\) be the family of members of \({{\mathcal {H}}}\) contacted by v.

Case A.1 No vertex of S is bi-partial to any member of \({{\mathcal {H}}}\).

Then, according to the above, to our aim each member H of \({{\mathcal {H}}}\), say of sides \(H'\) and \(H''\), can be assumed to be [contracted into] one edge say \(h'h''\) by defining the weight of \(h'\) and of \(h''\) as follows: \(w(h') = \sum _{h \in H'}w(h)\) and \(w(h'') = \sum _{h \in H''}w(h)\).

Case A.1.1 Each vertex of S contacts at most one member of \({{\mathcal {H}}}\).

Then since G is \(P_4+P_4\)-free, there exists at most one member of \({{\mathcal {H}}}\), i.e., one edge say \(h'h''\) of G[T], such that both \(h'\) and \(h''\) have neighbors in S: if such an edge \(h'h''\) of G[T] does not exist, then every component of G is complete bipartite, and then WIS can be solved for G in polynomial time; if such an edge \(h'h''\) of G[T] does exist, then every component of both \(G[V(G) \setminus N(h')]\) and \(G[V(G) \setminus \{h'\}]\) is complete bipartite, and then WIS can be solved for G in polynomial time.

Case A.1.2 Some vertex of S contacts more than one member of \({{\mathcal {H}}}\).

Let \(v' \in S\) be such that \(|{{\mathcal {H}}}[v']| \ge |{{\mathcal {H}}}[v]|\) for all \(v \in S\). Let \({{\mathcal {H}}}_{one}\) denote the family of non-trivial component-sets of \(G[T \setminus N(v')]\). Note that each vertex of S contacts at most one member of \({{\mathcal {H}}}_{one}\): in fact, if a vertex \(v \in S\) should contact two members of \({{\mathcal {H}}}_{one}\), then by construction and by Observation 3 vertex v would contact two members of \({{\mathcal {H}}}\), and then by definition of \(v'\) there would exist two members of \({{\mathcal {H}}}\) which are contacted by \(v'\) and non-contacted by v, and then by Observation 3 an induced \(P_4+P_4\) would arise. Then WIS can be solved for G in polynomial time as follows: for \(G[V(G) \setminus N(v')]\) one can refer to CASE A.1.1; for \(G[V(G) \setminus \{v'\}]\) one can iterate the above argument until the graph is reduced to G[T]; for G[T] one can solve WIS in polynomial time since every component of G[T] is complete bipartite.

Case A.2 Some vertex of S is bi-partial to some member of \({{\mathcal {H}}}\).

Case A.2.1 Each vertex of S is bi-partial to at most one member of \({{\mathcal {H}}}\).

Let \(v' \in S\) be bi-partial to one member of \({{\mathcal {H}}}\) and be such that \(|{{\mathcal {H}}}[v']| \ge |{{\mathcal {H}}}[v]|\) for all \(v \in S\) which are bi-partial to one member of \({{\mathcal {H}}}\): in particular let \(H'\) be the member of \({{\mathcal {H}}}\) such that \(v'\) is bi-partial to \(H'\).

Then let \({{\mathcal {Z}}}\) be the family of non-trivial component-sets Z of \(G[(T \setminus H') \setminus N(v')]\) such that there is a vertex of S bi-partial to Z.

Claim 1

\({{\mathcal {Z}}}\) has at most one member.

Proof

By contradiction assume that \({{\mathcal {Z}}}\) has two members, say \(Z_1\) and \(Z_2\). By definition of \({{\mathcal {Z}}}\), let \(v_1,v_2 \in S\) be respectively bi-partial to \(Z_1,Z_2\) (actually \(v_1\) may coincide to \(v_2\); however both \(v_1,v_2\) are different to \(v'\)).

Let us observe that: if \(v_1\) coincides to \(v_2\), then such a vertex contacts both \(Z_1\) and \(Z_2\); if \(v_1\) does not coincide to \(v_2\), then to avoid a \(P_4+P_4\), either \(v_1\) contacts \(Z_2\) or \(v_2\) contacts \(Z_1\). Then, without loss of generality by symmetry, let us assume that \(v_1\) contacts [both \(Z_1\) and] \(Z_2\).

Then by construction and by Observation 3, there exist two members of \({{\mathcal {H}}}\), say \(H_1,H_2\), such that \(Z_1 \subseteq H_1\) and \(Z_2 \subseteq H_2\). By definition of \(v'\), one has that \(v'\) does not contact \(H_1,H_2\): in fact, if \(v'\) should contact either \(H_1\) or \(H_2\), then by construction \(v'\) would be bi-partial to it (a contradiction to the assumption of Case A.2.1, since \(v'\) is bi-partial to \(H'\)). Then, by definition of \(v'\), one has that \(v'\) contacts at least two members of \({{\mathcal {H}}}\) which are not contacted by \(v_1\): then, from one hand the subgraph induced by \(v'\) and by such two members contains an induced \(P_4\), and from the other hand the subgraph induced by \(v_1\) and by \(Z_1\) contains an induced \(P_4\), i.e., an induced \(P_4+P_4\) arises (contradiction). □

Claim 2

WIS can be solved for \(G[V(G) \setminus N(v')]\) in polynomial time.

Proof

By Claim 1, \({{\mathcal {Z}}}\) has at most one member. Let us consider only the case in which such a member does exist, say \({{\mathcal {Z}}} = \{Z\}\), since the other case can be treated similarly. Then let H be the member of \({{\mathcal {H}}}\) such that \(Z \subseteq H\). Note that \(H \setminus N(v')\) and \(H' \setminus N(v')\) are the only (two) non-trivial component-sets of \(G[T \setminus N(v')]\) to which any vertex of S may be bi-partial. Furthermore by Observation 3, for any \(h \in H\) (for any \(h' \in H'\), respectively), h is universal to one side of H (\(h'\) is universal to one side of \(H'\), respectively).

For any maximum (weight) independent set U of G one of the following cases occurs: (i) \(U \cap H = \emptyset \) and \(U \cap H' = \emptyset \), (ii) \(U \cap H = \emptyset \) and \(U \cap H' \ne \emptyset \), (iii) \(U \cap H \ne \emptyset \) and \(U \cap H' = \emptyset \), (iv) \(U \cap H \ne \emptyset \) and \(U \cap H' \ne \emptyset \).

Then WIS can be solved for \(G[V(G) \setminus N(v')]\) as follows.

In case (i): by solving WIS for \(G[(V(G) \setminus N(v')) \setminus (H \cup H')]\), which enjoys Case A.1 by the above. In case (ii): by solving WIS for \(G[(V(G) \setminus N(v')) \setminus N(h')]\), for all \(h' \in H'\), which enjoys Case A.1 by the above. In case (iii): by solving WIS for \(G[(V(G) \setminus N(v')) \setminus N(h)]\), for all \(h \in H\), which enjoys Case A.1 by the above. In case (iv): by solving WIS for \(G[(V(G) \setminus N(v')) \setminus N(h,h')]\), for all \((h,h') \in H \times H'\), which enjoys Case A.1 by the above.

Then WIS can be solved for \(G[V(G) \setminus N(v')]\) in polynomial time by referring to Case A.1. □

Then WIS can be solved for G in polynomial time as follows: for \(G[V(G) \setminus N(v')]\) one can refer to Claim 2, that is, finally to Case A.1; for \(G[V(G) \setminus \{v'\}]\) one can iterate the above argument until the graph is reduced to G[T]; for G[T] one can solve WIS in polynomial time since every component of G[T] is complete bipartite.

Case A.2.2 Some vertex of S is bi-partial to more than one member of \({{\mathcal {H}}}\).

Let us define a binary relation \(' < '\) on S: let us say that, for any \(u,v \in S\), \(u < v\) if v is bi-partial to two non-trivial component-sets of \(G[T \setminus N(u)]\).

Then let us define a directed graph \(D=(S,E(D))\) such that for any \(u,v \in S\) one has \((u,v) \in E(D)\) if and only if \(u < v\).

Claim 3

The directed graph \(D=(S,E(D))\) is acyclic. In particular: (i) there exists a vertex \(v^* \in S\) such that no vertex of S is bi-partial to two non-trivial component-sets of \(G[T \setminus N(v^*)]\), and (ii) WIS can be solved for \(G[V(G) \setminus N(v^*)]\) in polynomial time.

Proof

As a preliminary let us introduce the following observation. Let \(u,v \in S\) and assume \(u < v\), that is, v be bi-partial to two non-trivial component-sets, say \(Z_1,Z_2\), of \(G[T \setminus N(u)]\): then by construction and by Observation 3 there exist two members of \({{\mathcal {H}}}\), say \(H_1,H_2\), such that \(Z_1 \subseteq H_1\) and \(Z_2 \subseteq H_2\).

Then let us prove the following facts.

Fact 1

Let \(u,v \in S\) and assume \(u < v\), that is, let v be bi-partial to two non-trivial component-sets, say \(Z_1,Z_2\), of \(G[T \setminus N(u)]\); then let \(H_1,H_2\) be the two members of \({{\mathcal {H}}}\) such that \(Z_1 \subseteq H_1\) and \(Z_2 \subseteq H_2\). Then: if u contacts \(H_1\) (contacts \(H_2\), respectively), then \(N_{H_1}(u) \subset N_{H_1}(v)\) (then \(N_{H_2}(u) \subset N_{H_2}(v)\), respectively).

Proof of Fact 1

By contradiction assume that u contacts \(H_1\) and that \(N_{H_1}(u) \not \subset N_{H_1}(v)\) (i.e., u is adjacent to a vertex of \(H_1 \setminus Z_1\) non-adjacent to v). Then, by Observation 3 and since v is bi-partial to \(Z_1\), one has that (considering that u may contact \(H_1\) either in the same side as v or in the other side): from one hand the subgraph induced by u and \(H_1\) contains an induced \(P_4\) not contacted by v, and from the other hand the subgraph induced by v and by \(Z_2\) contains an induced \(P_4\), i.e., an induced \(P_4+P_4\) arises (contradiction). The same holds for \(H_2\) instead of \(H_1\) by symmetry. □

Fact 2

Let \(u,v \in S\) and assume \(u < v\). Then \(v \not < u\).

Proof of Fact 2

By assumption let v be bi-partial to two non-trivial component-sets, say \(Z_1,Z_2\), of \(G[T \setminus N(u)]\). Then let \(H_1,H_2\) be the two members of \({{\mathcal {H}}}\) such that \(Z_1 \subseteq H_1\) and \(Z_2 \subseteq H_2\). By contradiction assume that \(v < u\). Then let u be bi-partial to two non-trivial component-sets, say \(Z_3,Z_4\), of \(G[T \setminus N(v)]\). Then let \(H_3,H_4\) be the two members of K such that \(Z_3 \subseteq H_3\) and \(Z_4 \subseteq H_4\).

Then by Fact 1 one has that \(H_3 \ne H_1,H_2\) and that \(H_4 \ne H_1,H_2\). Then, from one hand the subgraph induced by v and \(Z_1\) contains an induced \(P_4\), and from the other hand the subgraph induced by u and \(Z_3\) contains an induced \(P_4\), i.e., an induced \(P_4+P_4\) arises (contradiction). □

Now let \(v_1,v_2,\ldots ,v_p \in S\), for some natural \(p \ge 3\), and assume \(v_1< v_2< \cdots < v_p\). Then \(v_j\) is bi-partial to two non-trivial component-sets, say \(Z_1(j),Z_2(j)\), of \(G[T \setminus N(v_{j-1})]\) for \(j \in \{2, \ldots , p\}\). Then let \(H_1(j),H_2(j)\) be the two members of \({{\mathcal {H}}}\) such that \(Z_1(j) \subseteq H_1(j)\) and \(Z_2(j) \subseteq H_2(j)\) for \(j \in \{2, \ldots , p\}\).

Fact 3

\(v_p\) contacts \(Z_1(2),Z_2(2)\).

Proof of Fact 3

First let us show that \(v_p\) contacts \(Z_1(p-1),Z_2(p-1)\). Let us show that \(v_p\) contacts \(Z_1(p-1)\). If either \(H_1(p-1) = H_1(p)\) or \(H_1(p-1) = H_2(p)\), say \(H_1(p-1) = H_1(p)\) (without loss of generality by symmetry), then by construction \(N_{H_1(p)}(v_{p-1}) \subseteq H_1(p) \setminus Z_1(p)\), that is \(Z_1({p-1}) \subseteq Z_1(p)\), that is \(v_p\) contacts \(Z_1(p-1)\). If \(H_1(p-1) \ne H_1(p), H_2(p)\), then \(v_p\) contacts \(Z_1(p-1)\), since otherwise a \(P_4+P_4\) arises (one \(P_4\) is contained in the subgraph induced by \(v_{p-1}\) and \(Z_1({p-1})\), one \(P_4\) is contained in the subgraph induced by \(v_{p}\), \(Z_1(p)\), \(Z_2(p)\)). Then \(v_p\) contacts \(Z_1(p-1)\). The same holds for \(Z_2(p-1)\) by symmetry.

Then let us show that for \(3 \le j \le p-1\), if \(v_p\) contacts \(Z_1(j),Z_2(j)\), then \(v_p\) contacts \(Z_1(j-1),Z_2(j-1)\). Let us show that if \(v_p\) contacts \(Z_1(j),Z_2(j)\), then \(v_p\) contacts \(Z_1(j-1)\). If either \(H_1(j-1) = H_1(j)\) or \(H_1(j-1) = H_2(j)\), say \(H_1(j-1) = H_1(j)\) (without loss of generality by symmetry), then by construction \(N_{H_1(j)}(v_{j-1}) \subseteq H_1(j) \setminus Z_1(j)\), that is \(Z_1({j-1}) \subseteq Z_1(j)\), that is \(v_p\) contacts \(Z_1(j-1)\). If \(H_1(j-1) \ne H_1(j), H_2(j)\), then \(v_p\) contacts \(Z_1(j-1)\), since otherwise a \(P_4+P_4\) arises (one \(P_4\) is contained in the subgraph induced by \(v_{j-1}\) and \(Z_1({j-1})\), one \(P_4\) is contained in the subgraph induced by \(v_{p}\), \(Z_1(j)\), \(Z_2(j)\)). Then \(v_p\) contacts \(Z_1(j-1)\). The same holds for \(Z_2(j-1)\) by symmetry.

Then Fact 3 is proved. □

Fact 4

\(v_p \not < v_1\).

Proof of Fact 4

By contradiction assume \(v_p < v_1\). Then \(v_1\) is bi-partial to two non-trivial component-sets, say \(Z_1,Z_2\), of \(G[T \setminus N(v_p)]\). Then let \(H_1,H_2\) be the two members of \({{\mathcal {H}}}\) such that \(Z_1 \subseteq H_1\) and \(Z_2 \subseteq H_2\). Let us recall that \(v_p\) contacts \(Z_1(2),Z_2(2)\) by Fact 3. If either \(H_1 = H_1(2)\) or \(H_1 = H_2(2)\), say \(H_1 = H_1(2)\) (without loss of generality by symmetry), then by construction \(N_{H_1(2)}(v_{1}) \subseteq H_1(2) \setminus Z_1(2)\), that is \(Z_1 \subseteq Z_1(2)\), that is \(v_p\) contacts \(Z_1\) (contradiction). If \(H_1 \ne H_1(2), H_2(2)\), then \(v_p\) contacts \(Z_1\) (contradiction), since otherwise a \(P_4+P_4\) arises (one \(P_4\) is contained in the subgraph induced by \(v_{1}\) and \(Z_1\), one \(P_4\) is contained in the subgraph induced by \(v_{p}\), \(Z_1(2)\), \(Z_2(2)\)). □

Let us conclude the proof of Claim 3. By Facts 2 and 4, there are no vertices \(u_1,u_2,\ldots ,u_k \in S\) (for \(k \ge 2\)) such that \(u_1< u_2< \cdots< u_k < u_1\), i.e., the directed graph \(D = (S,E(D))\) is acyclic.

In particular: (i) it is well-known [and not difficult to check] that any acyclic directed graph—and thus the directed graph \(D = (S,E(D))\)—contains at least one vertex with zero out-degree, that is, there exists a vertex \(v^* \in S\) such that no vertex of S is bi-partial to two non-trivial component-sets of \(G[T \setminus N(v^*)]\); (ii) WIS can be solved for \(G[V(G) \setminus N(v^*)]\) in polynomial time, since \(G[V(G) \setminus N(v^*)]\) enjoys Case A.2.1. □

Then WIS can be solved for G in polynomial time as follows: construct the directed graph \(D = (S,E(D))\) as above and solve WIS for \(G[V(G) \setminus N(v^*)]\) according to Claim 3, that is, by finally referring to Case A.2.1; iterate this procedure for \(G[V(G) \setminus \{v^*\}]\) until the graph is reduced to G[T]; solve WIS for G[T] in polynomial time since every component of G[T] is complete bipartite.

This completes the solution for Case A.

2.2 Case B: The General Case

Let us show that WIS can be solved for \(G[S_b \cup S_d \cup S_{b,d} \cup A(V(P))]\) in polynomial time. Let us recall that \(S_b \cup S_{b,d}\) and \(S_d \cup S_{b,d}\) are independent sets and that every non-trivial component of G[A(V(P))] is complete bipartite.

For brevity, let us write \(T = A(V(P))\).

For any \(v \in S_b \cup S_d \cup S_{b,d}\) and for any H be a non-trivial component-set of G[T] let us say that: v is bi-partial to H if v is partial to one of the sides of G[H]; v is bi-universal to H if v is universal to one of the two sides of G[H]; then by Observation 3, if v contacts H, then v is either bi-partial to H or bi-universal to H.

For any maximum (weight) independent set U of \(G[S_b \cup S_d \cup S_{b,d} \cup T]\) one of the following cases occurs: (i) \(U \cap S_b = \emptyset \) and \(U \cap S_d = \emptyset \), (ii) \(U \cap S_b = \emptyset \) and \(U \cap S_d \ne \emptyset \), (iii) \(U \cap S_b \ne \emptyset \) and \(U \cap S_d = \emptyset \), (iv) or \(U \cap S_b \ne \emptyset \) and \(U \cap S_d \ne \emptyset \).

Then WIS can be solved for \(G[S_b \cup S_d \cup S_{b,d} \cup T]\) as follows.

In case (i): by solving WIS for \(G[S_{b,d} \cup T]\), in polynomial time, since it enjoys CASE A. In case (ii): by solving WIS for \(G[S_d \cup S_{b,d} \cup T]\), in polynomial time, since it enjoys Case A. In case (iii): by solving WIS for \(G[S_b \cup S_{b,d} \cup T]\), in polynomial time, since it enjoys Case A. In case (iv): by solving WIS for \(G[(S_b \cup S_d \cup S_{b,d} \cup T) \setminus N(s_b,s_d)]\) for all non-adjacent pair of vertices \((s_b,s_d) \in S_b \times S_d\).

Then—to show that WIS can be solved for \(G[S_b \cup S_d \cup S_{b,d} \cup T]\) in polynomial time—it remains to show that WIS can be solved for \(G[(S_b \cup S_d \cup S_{b,d} \cup T) \setminus N(s_b,s_d)]\) in polynomial time for all non-adjacent pair of vertices \((s_b,s_d) \in S_b \times S_d\).

Then let us write \(G' = G[(S_b \cup S_d \cup S_{b,d} \cup T) \setminus N(s_b,s_d)]\) for any fixed \((s_b,s_d) \in S_b \times S_d\).

Then let us write \(S'_X = S_X \setminus N(s_b,s_d)\) for \(X = \{\{b\},\{d\},\{b,d\}\}\), and \(T' = T \setminus N(s_b,s_d)\): then \(G' = G[\{s_b,s_d\} \cup S'_b \cup S'_d \cup S'_{b,d} \cup T']\).

Let \({{\mathcal {H}}}'\) denote the family of non-trivial component-sets of \(G[T']\).

Let \({{\mathcal {H}}}'_{all}\) denote the family of [all, i.e., trivial or non-trivial] component-sets of \(G[T']\). For any \(v \in S'_b \cup S'_d\), let \({{\mathcal {H}}}'_{all}[v]\) be the family of members of \({{\mathcal {H}}}'_{all}\) contacted by v.

Let \(v' \in S'_b \cup S'_d\) such that: (j) \(|{{\mathcal {H}}}'_{all}[v']| \ge |{{\mathcal {H}}}'_{all}[v]|\) for all \(v \in S'_b \cup S'_d\), and (jj) \(N_{T'}(v') \not \subset N_{T'}(v)\) for all \(v \in (S'_b \cup S'_d) \setminus \{v'\}\).

Let us assume that \(v' \in S'_b\) without loss of generality by symmetry.

Let us show that WIS can be solved for \(G'[V(G') \setminus N(v')]\) in polynomial time.

Let us write \(G'' = G'[V(G') \setminus N(v')]\).

Then let us write \(S''_X = S'_X \setminus N(s_b,s_d)\) for \(X = \{\{b\},\{d\},\{b,d\}\}\), and \(T'' = T' \setminus N(v')\): then \(G'' = G[\{s_b,s_d,v'\} \cup S''_b \cup S''_d \cup S''_{b,d} \cup T'']\).

Case B.1 No vertex of \(S''_d\) is bi-partial to any member of \({{\mathcal {H}}}'\).

Then let us prove the following facts.

Fact 1

Each vertex of \(S''_d\) contacts no component-set of \(G[T']\) not contacted by \(v'\).

Proof of Fact 1

By contradiction assume that a vertex \(v \in S''_d\) contacts a component-set say H of \(G[T']\) not contacted by \(v'\), i.e., v is adjacent to a vertex \(h \in H\) with H not contacted by \(v'\). Then by definition of \(v'\), there is a vertex \(h' \in T' \setminus H\) which is adjacent to \(v'\) and non-adjacent to v. Then \(s_b,b,v',h'\) and \(s_d,d,v,h\) induce a \(P_4+P_4\) (contradiction). □

Fact 2

Each vertex of \(S''_d\) has neighbors, which are non-neighbors of \(v'\), in at most one component-set of \(G[T']\).

Proof of Fact 2

By contradiction assume that a vertex \(v \in S''_d\) has neighbors say \(h_1,h_2\), which are non-neighbors of \(v'\), in respectively two component-sets say \(H_1,H_2\) of \(G[T']\). Then by definition of \(v'\), there is a vertex \(h' \in T'\) such that \(h'\) is nonadjacent to v, in particular \(h'\) does not belong to at least one component-set over \(H_1\) and \(H_2\) by construction: without loss of generality by symmetry let us say that \(h'\) does not belong to \(H_2\). Then \(s_b,b,v',h'_1\) and \(s_d,d,v,h_2\) induce a \(P_4+P_4\) (contradiction). □

Fact 3

\(G[S''_d \cup T'']\) is \(P_4\)-free.

Proof of Fact 3

By contradiction assume that \(G[S''_d \cup T'']\) contains an induced \(P_4\), say \(P^*\), of vertex-set \(V(P^*)\). Then: from one hand \(|V(P^*) \cap S''_d| \ge 1\), since \(G[T'']\) is \(P_4\)-free; from the other hand \(|V(P^*) \cap S''_d| \le 2\), since \(S''_d\) is an independent set.

The occurrence \(|V(P^*) \cap S''_d| = 1\) is not possible by Observation 3 and by Fact 2 with respect to the vertex of \(V(P^*) \cap S''_d\).

The occurrence \(|V(P^*) \cap S''_d| = 2\) is not possible as shown in the following sub-occurrences.

Assume that \(V(P^*) = \{u,x,v,y\}\), with \(u,v \in S''_d\) and \(x,y \in T''\), with edges uxxvvy. Then, since v is adjacent to both x and y, by Fact 2 vertices xy belong to the same component-set of \(G[T']\). But this contradicts the assumption of Case B.1 with respect to u.

Assume that \(V(P^*) = \{u,x,y,v\}\), with \(u,v \in S''_d\) and \(x,y \in T''\), with edges uxxyvy. Then, since vertices xy are adjacent, vertices xy belong to the same component-set of \(G[T'']\) (= \(G[T' \setminus N(v')]\)), say Z, and to different sides of Z respectively. Then let H be the component-set of \(G[T']\) such that \(Z \subseteq H\). By Fact 1, vertex \(v'\) contacts \(H \setminus Z\), i.e., vertex \(v'\) contacts one side of \(G[H \setminus Z]\): without loss of generality by symmetry say \(v'\) contacts the side of \(G[H \setminus Z]\) corresponding to the side of Z contacted by u. Then for any neighbors of \(v'\) in \(H \setminus Z\), say h, one has that u is adjacent to h, since otherwise \(s_b,b,v',h\) and \(s_d,d,u,x\) induce a \(P_4+P_4\). That is one has \(N_H(v') \subset N_H(u)\). Then, since \(N_{T'}(v') \not \subset N_{T'}(u)\) (by definition of \(v'\)), there is a vertex \(h' \in T' \setminus H\) such that \(h'\) is adjacent to \(v'\) and non-adjacent to u. Then \(s_b,b,v',h'\) and \(s_d,d,u,x\) induce a \(P_4+P_4\), a contradiction. □

Then WIS can be solved for \(G''\) in polynomial time, since \(\{s_b,s_d,v'\} \cup S''_b \cup S''_{b,d}\) is an independent set and since \(G[S''_d \cup T'']\) is \(P_4\)-free by Fact 3, that is since \(G''\) enjoys Case A.

Case B.2 Some vertex of \(S''_d\) is bi-partial to some member of \({{\mathcal {H}}}'\).

Case B.2.1 Each vertex of \(S''_d\) is bi-partial to at most one member of \({{\mathcal {H}}}'\).

This case can be treated similarly to Case A.2.1, in order to conclude that WIS can be solved for \(G''\) in polynomial time by referring to Case B.1, by the following outline.

Let \(v'' \in S''_d\) be bi-partial to one member of \({{\mathcal {H}}}'\) and be such that \(|{{\mathcal {H}}}'[v'']| \ge |{{\mathcal {H}}}'[v]|\) for all \(v \in S''_d\) which are bi-partial to one member of \({{\mathcal {H}}}'\): in particular let \(H''\) be the member of \({{\mathcal {H}}}'\) such that \(v''\) is bi-partial to \(H''\).

Then let \({{\mathcal {Z}}}'\) be the family of non-trivial component-sets \(Z'\) of \(G[(T' \setminus H'') \setminus N(v'')]\) such that there is a vertex of \(S''_d\) bi-partial to \(Z'\).

Claim 4

\({{\mathcal {Z}}}'\) has at most one member.

Proof

The proof is the same as that of Claim 1 of Case A.2.1, with \(v''\) instead of \(v'\), with \({{\mathcal {Z}}}'\) instead of \({{\mathcal {Z}}}\), with \({{\mathcal {H}}}'\) instead of \({{\mathcal {H}}}\), and with Case B.2.1 instead of Case A.2.1. □

Claim 5

WIS can be solved for \(G''[V(G'') \setminus N(v'')]\) in polynomial time.

Proof

The proof is the same as that of Claim 2 of CASE A.2.1, with \(G''[V(G'') \setminus N(v'')]\) instead of \(G[V(G) \setminus N(v')]\), with Claim 4 instead of Claim 1, with \(v''\) istead of \(v'\), with \({{\mathcal {Z}}}'\) instead of \({{\mathcal {Z}}}\), with \({{\mathcal {H}}}'\) instead of \({{\mathcal {H}}}\), with \(H''\) instead of \(H'\), and with Case B.1 instead of Case A.1. □

Then WIS can be solved for \(G''\) in polynomial time as follows: for \(G''[V(G'') \setminus N(v'')]\) one can refer to Claim 2’, that is, finally to Case B.1; for \(G''[V(G'') \setminus \{v''\}]\) one can iterate the above argument until the graph is reduced to \(G[T']\); for \(G[T']\) one can solve WIS in polynomial time since every component of \(G[T']\) is complete bipartite.

Case B.2.2 Some vertex of \(S''_d\) is bi-partial to more than one member of \({{\mathcal {H}}}'\).

This case can be treated similarly to Case A.2.2, in order to conclude that WIS can be solved for \(G''\) in polynomial time by referring to Case B.2.1, by the following outline.

Let us define a binary relation \(' < '\) on \(S''_d\): let us say that, for any \(u,v \in S''_d\), \(u < v\) if v is bi-partial to two non-trivial component-sets of \(G[T' \setminus N(u)]\).

Then let us define a directed graph \(D=(S,E(D))\) such that for any \(u,v \in S''_d\) one has \((u,v) \in E(D)\) if and only if \(u < v\).

Claim 6

The directed graph \(D=(S,E(D))\) is acyclic. In particular: (i) there exists a vertex \(v^* \in S''_d\) such that no vertex of \(S''_d\) is bi-partial to two non-trivial component-sets of \(G[T' \setminus N(v^*)]\), and (ii) WIS can be solved for \(G''[V(G'') \setminus N(v^*)]\) in polynomial time.

Proof

The proof is the same as that of Claim 3 of Case A.2.2, with \(G''[V(G'') \setminus N(v^*)]\) instead of \(G[V(G) \setminus N(v^*)]\), with \(T'\) instead of T, with \({{\mathcal {H}}}'\) instead of \({{\mathcal {H}}}\), and with Case B.2.1 instead of Case A.2.1. □

Then WIS can be solved for \(G''\) in polynomial time as follows: construct the directed graph \(D = (S,E(D))\) as above and solve WIS for \(G''[V(G'') \setminus N(v^*)]\) according to Claim 6, that is, by finally referring to Case B.2.1; iterate this procedure for \(G''[V(G'') \setminus \{v^*\}]\) until the graph is reduced to \(G[T']\); solve WIS for \(G[T']\) in polynomial time since every component of \(G[T']\) is complete bipartite.

Summarizing Cases B.1 and B.2 one has that: WIS can be solved for \(G''\) in polynomial time.

Then WIS can be solved for \(G'\) \((= G[\{s_b,s_d\} \cup S'_b \cup S'_d \cup S'_{b,d} \cup T'])\) in polynomial time as follows: for \(G'[V(G') \setminus N(v')]\) (\(= G''\)) one can proceed as above; for \(G'[V(G') \setminus \{v'\}]\) one can iterate the above argument until the graph is reduced to \(G'[\{s_b,s_d\} \cup S'_{bd} \cup T']\); for \(G'[\{s_b,s_d\} \cup S'_{b,d} \cup T']\) one can refer to Case A. Then, as remarked above, this implies that WIS can be solved for G in polynomial time.

This completes the solution for Case B.

3 Concluding Remarks

Let us list some possible concluding remarks.

  1. 1.

    In [34], it is shown that every connected Paw-free graph is either Triangle-free or complete multipartite [a Paw has vertices abcd, and edges abacadbc]. This result and Theorem 2 directly imply that the WIS problem can be solved for (\(P_4+P_4\), Paw)-free graphs in polynomial time. Furthermore in [35], it is shown that if a prime graph contains a Triangle then it contains a House, or a Bull, or a Double-Gem [a House has vertices abcde, and edges abacbcbecdde; a Bull has vertices abcde, and edges abacbcbecd; a Double-Gem has vertices abcdef, and edges acadaebdbebfcddeef]. This result and Theorem 2, by well known results on prime graphs (see e.g. [26]), imply that the WIS problem can be solved for (\(P_4+P_4\), House, Bull, Double-Gem)-free graphs in polynomial time.

  2. 2.

    The proof of Theorem 2 is based on the anti-neighborhood approach by finally reducing the problem to instances of complete bipartite graphs for which the problem can be solved in linear time. Then the time bound of Theorem 2, i.e., of Algorithm Last, may be estimated as \(O(n^{15})\) time.

Then one can derive the following result, which is similar to the corresponding results obtained for (\(P_7\),Triangle)-free graphs [7] and for (\(S_{1,2,4}\),Triangle)-free graphs [9], and which seems to be harmonic [together with such results] with respect to the result of Prömel et al. [39] showing that with “high probability” removing a single vertex in a Triangle-free graph leads to a bipartite graph.

Theorem 3

For every (\(P_4 + P_4\),Triangle)-free graph G there is a family \({{\mathcal {S}}}\) of subsets of V(G) inducing (complete) bipartite subgraphs of G, which contains polynomially many members and can be computed in polynomial time, such that every maximal independent set of G is contained in some member of \({{\mathcal {S}}}\). □

An outline of the proof: concerning Lemma 2 the above result can be derived with no difficult (for every maximal independent sets of G containing vertices ac) by the proof scheme; concerning Theorem 2, in particular concerning Algorithm Last, the above result can be derived by considering the following alternative step (1.3) of Algorithm Last [in fact Algorithm Last is given in a version which directly aims to solve the WIS problem] according to Case 1.3 of the proof of Theorem 2:

(1.3) compute [by Lemma 1] a maximum weight independent set of \(G[\{a,d\} \cup L \cup A(V(P))]\) where L is the set of those vertices in \(S_b \cup S_c\) which are isolated in \(G[S_b \cup S_c \cup A(V(P))]\): denote it as \(Q'_3\); compute [by Lemma 2] a maximum weight independent set of G containing \(\{a,b'\}\) [which are vertices of an induced \(P_4\)] and containing \(\{d\}\), for every \(b' \in L' \cap S_{b}\), where \(L' = (S_b \cup S_c) \setminus L\): denote it as denote it as \(Q''_3\); compute [by Lemma 2] a maximum weight independent set of G containing \(\{d,c'\}\) [which are vertices of an induced \(P_4\)] and containing \(\{a\}\), for every \(c' \in L' \cap S_{c}\), where \(L' = (S_b \cup S_c) \setminus L\): denote it as denote it as \(Q'''_3\); finally select a best maximum weight independent set over \(\{Q'_3,Q''_3,Q'''_3\}\): denote it as \(Q_3\).

3. Finally let us point out the following possible open problem.

Open Problem. What is the complexity of (W)IS for \(P_4+P_4\)-free graphs?