CAHIER DU LAMSADE 258 Juillet 2007 On the complexity of the exact weighted independent set problem

In this paper, we introduce the exact weighted independent set problem (EWIS), the problem of determining whether a given weighted graph contains an independent set of a given weight. Our motivation comes from the related exact perfect matching problem, whose computational complexity is still unknown. We determine the complexities of the EWIS problem and its restricted version EWISα (where the independent set is required to be of maximum size) for several graph classes. These problems are strongly NP-complete for cubic bipartite graphs; we also extend this result to a more general setting. On the positive side, we show that EWIS and EWISα can be solved in pseudo-polynomial time for chordal graphs, AT-free graphs, distance-hereditary graphs, circle graphs, graphs of bounded clique-width, and several subclasses of P5-free and fork-free graphs. In particular, we show how modular decomposition can be applied to the exact weighted independent set problem.


Introduction
Suppose we have a well-solved optimization problem, such as minimum spanning tree, maximum cut in planar graphs, minimum weight perfect matching, or maximum weight independent set in a bipartite graph. How hard is it to determine whether there exists a solution with a given weight? Papadimitriou and Yannakakis showed in [42] that these so-called exact versions of the above optimization problems are NP-complete when the weights are encoded in binary. The question is then, what happens if the weights are "small," i.e., encoded in unary? Contrary to the binary case, the answer to this question depends on the problem. 1 one is given). 1 Karzanov [30] gives a polynomial-time algorithm for the special case of the exact perfect matching problem, when the graph is either complete or complete bipartite, and the weights are restricted to 0 and 1. Papadimitriou and Yannakakis show in [42] that the problem for general (or bipartite) graphs with weights encoded in unary is polynomially reducible to the one with 0-1 weights. Mulmuley, Vazirani and Vazirani [38] show that the exact perfect matching problem has a randomized pseudo-polynomial-time algorithm. However, the deterministic complexity of this problem remains unsettled, even for bipartite graphs. (Papadimitriou and Yannakakis conjectured that it is NPcomplete [42].) The exact perfect matching problem is of great practical importance. It has applications in such diverse areas as bus-driver scheduling, statistical mechanics (see [31]), DNA sequencing [7], and robust assignment problems [21]. The problem consists of determining whether a given edge weighted graph contains a perfect matching of a given weight. The fact that its complexity is still unknown motivates us to introduce and study the exact weighted independent set problem and a restricted version of it, both closely related to the exact perfect matching problem.
An independent set (sometimes called stable set) in a graph is a set of pairwise non-adjacent vertices. The weighted independent set problem (WIS) asks for an independent set of maximum weight in a given weighted graph (G, w). If all weights are the same, we speak about the independent set problem (IS), which consists in finding an independent set of maximum cardinality. The optimal values of these problems are denoted by α w (G) and α(G), respectively.
The exact weighted independent set problem (EWIS) consists of determining whether a given weighted graph (G, w) with G = (V, E) and w : V → Z contains an independent set whose total weight (i.e., the sum of the weights of its members) equals a given integer M . The exact weighted maximum independent set problem (EWIS α ) is the restriction of EWIS where we require the independent set to be a maximum independent set of the graph. Thus, given a weighted graph (G, w) and an integer M , EWIS α asks about the existence of an independent set I of G with |I| = α(G) and w(I) = M .
The connection between the exact perfect matching problem and the exact weighted independent set problem is best understood through line graphs. The line graph L(G) of a graph G = (V, E) is the graph whose vertex set is E, and whose two vertices are adjacent if and only if they share a common vertex as edges of G. Clearly, there is a one-to-one correspondence between the matchings of a graph and the independent sets of its line graph. Thus, the exact matching problem is precisely the exact weighted independent set problem, restricted to the class of line graphs. Similarly, under the (polynomially verifiable) assumption that the input graph has a perfect matching, the exact perfect matching problem is precisely the exact weighted maximum independent set problem, restricted to the class of the line graphs of graphs with a perfect matching.
Our contributions. We focus on the problem of determining the complexities of EWIS and EWIS α for particular graph classes. On one hand, we present the first nontrivial strong NP-completeness result for these problems. On the other hand, we distinguish several classes of graphs they can be solved in pseudo-polynomial time.
The main results of this paper can be summarized in the spirit of the above list of complexity results on exact problems: problems are strongly NP-complete for cubic bipartite graphs. 2 • The exact weighted independent set and the exact weighted maximum independent set problems are solvable in pseudo-polynomial time for any of the following graph classes: -mK 2 -free graphs, -interval graphs and their generalizations k-thin graphs, -chordal graphs, -AT-free graphs, and -(claw , net)-free graphs, -distance-hereditary graphs, -circle graphs, -graphs of bounded treewidth, -graphs of bounded clique-width, -certain subclasses of P 5 -free and fork-free graphs.
Of independent interest, we show how modular decomposition can be applied to the exact weighted independent set problem.
Note that in view of the relation between the exact perfect matching problem and the exact weighted maximum independent set problem, each of the above polynomial results also gives a polynomial result for the exact perfect matching problem. Whenever EWIS α is (pseudo-)polynomially solvable for a class of graphs G, the exact perfect matching problem is (pseudo-)polynomially solvable for graphs in the set {G : L(G) ∈ G}. For example, • The exact perfect matching problem is solvable in pseudo-polynomial time for graphs of bounded treewidth.
Notation and organization. All graphs considered are finite, simple and undirected. Unless otherwise stated, n and m will denote the number of vertices and edges, respectively, of the graph considered. As usual, P n and C n denote the chordless path and the chordless cycle on n vertices. For a graph G, we will denote by V (G) and E(G) the vertex-set and the edgeset of G, respectively. Individual edges will be denoted by square brackets: an edge with endpoints u and v will be denoted by [u, v]. For a vertex x in a graph G, we denote by N G (x) the neighborhood of x in G, i.e., the set of vertices adjacent to x, and by N G [x] the closed neighborhood of x, i.e., the set N G (x) ∪ {x}. We will write N (x) and N [x] instead of N G (x) and N G [x] if no confusion can arise. For a graph G, we denote by co-G (also G) the edge-complement of G. By K n we denote the complete graph on n vertices, and by K s,t the complete bipartite graph with parts of size s and t. By component we will always mean a connected component. For graph-theoretical terms not defined here, the reader is referred to Berge's book [6]. The triple (G, w, M ) will always represent an instance of EWIS (or EWIS α ), i.e., G = (V, E) is a graph, w : V → Z are vertex weights, and M ∈ Z is the target weight. If H is an induced subgraph of G, we will also consider triples of the form (H, w, M ) as instances of EWIS, with the weights w representing the restriction of w to V (H). We will denote by EWIS(G, w, M ) the solution to the instance (G, w, M ) of EWIS, that is, EWIS(G, w, M ) is yes if there is an independent set I in G with w(I) = M , and no otherwise. Similarly, EWIS α (G, w, M ) is yes if there is a maximum independent set I in G with w(I) = M , and no otherwise. Finally, for a subset of vertices V ′ ⊆ V , we let w(V ′ ) = v∈V ′ w(v). For a positive integer k, we write [k] for the set {1, . . . , k}.
The remainder of the paper is organized as follows. In Section 2, we continue the introductory discussion and present some polynomial preprocessing steps that simplify the input and which we will later on assume performed. We also discuss some relations between the complexities of the problems WIS, EWIS and EWIS α . Section 3 is devoted to the strong NP-completeness results. In Section 4, pseudo-polynomial time solutions to the exact weighted independent set problem are presented. We conclude the paper with a short discussion in Section 5 that places the class of line graphs of bipartite graphs between two graph classes with known complexities of the EWIS α problem.

Preliminary observations
The exact weighted independent set problem is (weakly) NP-complete for any class of graphs containing {K n : n ≥ 0}. There is a direct equivalence between the exact weighted independent set problem on {K n : n ≥ 0} and the subset sum problem, which is known to be NP-complete (see [25]). The subset sum problem is the following: given n integers a 1 , . . . , a n and a bound B, determine whether there is a subset J ⊆ [n] such that j∈J a j = B.
Hence, we will assume from now on that the weights are encoded in unary. Moreover, if (G, w, M ) is an instance of EWIS, we can further assume that 1 ≤ w(v) ≤ M , for all v ∈ V = V (G), as well as M ≤ w(V ). To see this, we first show that the general case polynomially reduces to solving the problem on n instances with positive weights.
Solving the EWIS problem for any particular instance reduces to solving n problems EWIS k , in which the independent sets are restricted to be of size k, for all k ∈ [n] (unless M = 0, in which case the solution is trivial). The weights in EWIS k can be assumed to be positive: otherwise, we can add a suitably large constant N to each vertex weight and replace M by M + kN to get an equivalent EWIS k problem with positive weights only. Finally, applying the same transformation again with N = w(V ) + 1 reduces the problem EWIS k to a single EWIS problem with positive weights. Repeating this for all values of k ∈ [n], the result follows.
Finally, if all vertex weights are positive, we can delete from the graph all vertices whose weight exceeds M , as they will never appear in a solution. Similarly, if M > w(V ), then the problem clearly has a negative answer.
The same assumption on vertex weights as for EWIS can also be made for the instances (G, w, M ) of its restricted counterpart EWIS α . Again, if some of the weights are negative, we can modify the weights and the target value as we did above for EWIS k . Now we only do it for k = α(G). Note that we can compute α(G) as that only p ∈ [n] such that the solution to EWIS α (G, 1, p) is yes, where 1 denotes the unit vertex weights.
We now discuss some relations between the complexities of the problems WIS, EWIS and EWIS α , when restricted to particular graph classes. Lemma 2.1. Let G be a class of graphs. The following statements are true. (i) If EWIS α is solvable in pseudo-polynomial time for graphs in G, then WIS is solvable in pseudo-polynomial time for graphs in G.
(ii) If EWIS is solvable in pseudo-polynomial time for graphs in G, then EWIS α is solvable in pseudo-polynomial time for graphs in G.
is the graph, obtained from a graph G = (V, E) ∈ G, by adding pendant vertices, as follows: If EWIS α is solvable in pseudo-polynomial time for graphs in G ′ , then EWIS is solvable in pseudo-polynomial time for graphs in G.
Proof. (i) Let (G, w, k) be an instance of the decision version of the weighted independent set problem. As we can assume positive weights, G contains an independent set of total weight at least k if and only if G contains a maximum independent set of total weight at least k. By testing values for M from w(V ) down to k and using an algorithm for EWIS α on the instance (G, w, M ), we can decide whether G contains a maximum independent set of total weight at least k.
(ii) Let (G, w, M ) be an instance of the EWIS α problem. It is easy to see that the following algorithm solves EWIS α .
Step 1. Compute α(G), which is equal to the maximum k ∈ [n] such that the solution to EWIS(G, 1, k) is yes, where 1 denotes the unit vertex weights.
Then it is easy to verify that EWIS α (G, w, M ) = EWIS(G, w ′ , M ′ ). The problem EWIS is clearly in NP, and so is EWIS α for any class of graphs G where IS is polynomially solvable. Therefore, Lemma 2.1 implies the following result.
Corollary 2.2. Let G be a class of graphs. The following statements are true. (i) If WIS is strongly NP-complete for graphs in G, then EWIS α is strongly NP-hard for graphs in G. If, in addition, IS is polynomial for graphs in G, then EWIS α is strongly NPcomplete for graphs in G.
(ii) If EWIS α is strongly NP-hard for graphs in G, then EWIS is strongly NP-complete for graphs in G.
(iii) Let G ′ be as in Lemma 2.1. If EWIS is strongly NP-complete for graphs in G, then EWIS α is strongly NP-hard for graphs in G ′ . If, in addition, IS is polynomial for graphs in G ′ , then EWIS α is strongly NP-complete for graphs in G ′ .
Thus, we are mainly interested in determining the complexity (strong NP-complete or pseudo-polynomial results) of the exact weighted independent set problem in those classes of graphs where the weighted independent set problem is solvable in pseudo-polynomial time. Moreover, combining parts (ii) and (iii) of the lemma shows that when G ∈ {forests, bipartite graphs, chordal graphs}, the problems EWIS and EWIS α are equivalent (in the sense that, when restricted to the graphs in G, they are either both solvable in pseudo-polynomial time, or they are both strongly NP-complete). Recall that a graph G is a forest if it is acyclic, bipartite if any cycle of G has even length, and chordal if any cycle of G with size at least 4 has a chord (i.e., an edge connecting two nonconsecutive vertices of the cycle).
We conclude this subsection by showing that this equivalence remains valid for the class of line graphs. More precisely, if L, L(Bip), L(K 2n ) and L(K n,n ) denote the classes of line graphs, line graphs of bipartite graphs, line graphs of complete graphs with an even number of vertices, and line graphs of complete balanced bipartite graphs, respectively, we have the following result. Lemma 2.3. EWIS is strongly NP-complete for graphs in L (resp., L(Bip)) if and only if EWIS α is strongly NP-complete for graphs in L(K 2n ) (resp., L(K n,n )).
Proof. The backward implication is given by part (ii) of Lemma 2.1. The forward implication follows from a reduction of the exact matching problem to the exact perfect matching problem which we show now. Given an instance G = (V, E) with edge weights w and a target M for the exact matching problem, construct an instance (K n ′ , w ′ , M ′ ) for the exact perfect matching problem as follows. If n = |V | is odd, we add a new vertex and we complete the graph G. For an edge e of G, let w ′ (e) = N w(e) where N = w(E) + 1, for an edge e / ∈ E let w ′ (e) = 1. The transformation is clearly polynomial, and G has a matching of weight M if and only if K n ′ has a perfect matching of weight N M + k for some value of k ∈ {0, . . . , n − 1}. Also, it is easy to see that in the case of bipartite graphs G = (L, R; E) with |L| ≤ |R|, we can add |R \ L| vertices to L to balance the bipartition.

Hardness results
The weighted independent set problem is solvable in polynomial time for bipartite graphs by network flow techniques. However, as we show in this section, the exact version of the problem is strongly NP-complete even for cubic bipartite graphs.

Bipartite graphs
A bipartite graph is a graph G = (V, E) whose vertex set admits a partition V = L ∪ R into the left set L and the right set R such that any edge of G links a vertex of L to a vertex of R. In general, a bipartite graph may admit several such partitions. Since we only consider connected bipartite graphs (which have a unique such partition, up to switching the parts), we will also write G = (L, R; E).
The strong NP-completeness of EWIS in bipartite graphs is straightforward since the balanced biclique problem (also called balanced complete bipartite subgraph) is NP-complete [25,20]. This problem consists in deciding, given a bipartite graph G = (L, R; E) and an integer k, if there exist L ′ ⊆ L and R ′ ⊆ R with |L ′ | = |R ′ | = k such that the subgraph induced by L ′ ∪ R ′ is a complete bipartite subgraph (also called biclique of size k). In [20], a variation of this latter problem is introduced where we must have |L ′ | = a and |R ′ | = b (called the biclique problem). From an instance G and k of balanced biclique, we introduce weight 1 on each vertex of L, weight B = max{|L|, |R|} + 1 on each vertex of R, and we set M = k + Bk. It is clear that there exist an independent set in (L, R; (L × R) \ E) with weight M if and only if there exists a balanced biclique in (L, R; E) of size k.
We now strengthen this result by proving that EWIS α is strongly NP-complete even for cubic bipartite graphs. By contrast, it is easy to see that for graphs of maximum degree 2, EWIS and EWIS α are pseudo-polynomially solvable problems. 3 Theorem 3.1. EWIS α is strongly NP-complete in cubic bipartite graphs.
Proof. The problem is clearly in NP, as the IS problem is solvable in polynomial time for bipartite graphs. The hardness reduction is made from the decision version of the clique problem in regular graphs which is known to be NP-complete, see [25]. A clique V * is a subset of vertices of G such that the subgraph induced by V * is complete. Let G = (V, E) be a ∆-regular graph of n vertices and let k be an integer. Without loss of generality, assume that 0 < k < ∆ < n − 1, since otherwise the problem is easy. We build the instance I = (G ′ , w) of EWIS α where G ′ = (L, R; E ′ ) is a bipartite graph as follows: • Figure 1. • We interconnect these gadgets by iteratively applying the following procedure. For each edge e = [u, v] ∈ E, we add two edges [r i,u , l 1,e ] and [l i,u , r 1,e ] where l i,u is a neighbor of r i,u in H(u) between gadgets H(u), H(e) and two edges [r j,v , l 2,e ] and [l j,v , r 2,e ] where l j,v is a neighbor of r j,v in H(v) between gadgets H(v), H(e) such that the vertices r i,u , l i,u , r j,v and l j,v have degree 3.
It is clear that G ′ is bipartite and the weights are polynomially bounded. Moreover, since G is a ∆-regular graph, we conclude that G ′ is 3-regular.
We claim that there exist a clique V * of G with size at least k if and only if EWIS α (G ′ , w, M ) is yes with Let I be a maximum independent set of G ′ with w(I) = M . Since G ′ is cubic and bipartite, G ′ has a perfect matching (for instance, take a perfect matching in each gadget H(v) and H(e)), and we conclude that α(G) = |I| = |R| = |L|. This implies in particular that for any vertex v ∈ V , either L v or R v is a subset of I. Moreover, the same property holds for any e ∈ E (i.e., either L e or R e is a subset of I). Moreover, by construction of the weights, the quantity k∆ of M must come from vertices l i,v , r i,v or l i,e . Since k < n, this quantity cannot come from r i,v . Moreover, since l i,e ∈ I if and only if L e ⊆ I, the contribution of L e in I is n∆. In this case, the contribution of k∆ must come from l i,v . Thus, we obtain: where Thus, using (1) we must obtain: where L E = ∪ e∈E L e and R E = ∪ e∈E R e . Now, we prove that there are exactly k( k−1 2 ) gadgets H(e) with L e ⊆ I. Assume the reverse; then, |I ∩ L E | = k(k − 1) − 2p and |I ∩ R E | = n∆ − k(k − 1) + 2p for some p = 0 (p can be negative). Combining these equalities with equality (2), we deduce that p = 0, contradiction.
Thus, if we set V * = {v ∈ V : L v ⊆ I}, we deduce from previously |V * | = k and we will have necessarily that V * is a clique of G.
One can easily verify that w(I) = M and that I is a maximum independent set of G ′ . Indeed, let us assume the converse; thus, there exist r i,v ∈ I (and thus R v ⊆ I), l j,e ∈ I (with j = 1, 2) and [r i,v , l j,e ] ∈ E ′ . By construction of I, we deduce that e = [u, v] ∈ E(V * ) and then L v ⊆ I, contradiction. The proof is complete.
As corollary of Theorem 3.1, we can derive that the biclique problem remains NP-complete when the minimum degree of G = (L, R; E) is n − 3 where |L| = |R| = n. In this case, we replace any gadget H(e) of Theorem 3.1 by a cycle of length 2n∆ and we delete edges [l i,u , r 1,e ] and [l j,v , r 2,e ].
We also remark that Theorem 3.1 implies the strong NP-completeness of EWIS α for perfect graphs, one of the well-known classes where WIS is solvable in polynomial time.

A more general hardness result
In this section, we are going to strengthen the result of Theorem 3.1 to a more general setting: for hereditary subclasses of bipartite graphs in which no vertex degree exceeds 3. 4 To this end, we first introduce some notations. We will denote the class of graphs containing no induced subgraphs from a set F by Free(F). Any graph in Free(F) will be called F-free. Our hardness results will be expressed in terms of a parameter related to the set of forbidden induced subgraphs F.
For i ≥ 1, let H i denote the graph depicted on Figure 3 and for i ≥ 3, let C i denote the chordless cycle of length i. We associate to every graph G a parameter κ(G). If G has a vertex of degree 4 or more, we define κ(G) to be 0. Otherwise, let κ(G) denote the minimum value of k ≥ 3 such that G contains an induced copy of either C k or H k (or ∞ if no such k exists, and with the obvious convention that no graph contains an induced C 1 or C 2 ). Also, for a (possibly infinite) set of graphs F, we define κ(F) = sup{κ(G) : G ∈ F}.
With these definitions in mind, we can use the strong NP-hardness of EWIS α for bipartite graphs of degree at most 3, and the reduction typically used for the independent set problem (see e.g. [39,43]), to derive the following hardness result. Let G be the class of F-free bipartite graphs of maximum degree at most 3. If κ(F) < ∞, then EWIS α is strongly NP-complete in the class G.
Proof. The problem is clearly in NP. We show completeness in two steps. First, for k ≥ 3, let S k be the class of all bipartite (C 3 , . . . , C k , H 1 , . . . , H k )-free graphs of vertex degree at most 3, and let us show that for any fixed k, the problem is strongly NP-complete for graphs in S k . Let (G, w, M ) be an instance of EWIS α where G is a bipartite graph of maximum degree at most 3. We can transform the graph G in polynomial time to a weighted graph G ′ , as follows. Let k ′ = ⌈ k 2 ⌉. We replace each edge e of G by a path P (e) on 2k ′ + 2 vertices. Let N = w(V ) + 1. We set the weights w ′ of the endpoints of P (e) equal to the weights of the corresponding endpoints of e, while each internal vertex of P (e) gets weight N . It is easy to verify that G ′ belongs to S k .
We claim that the answer to One direction is immediate, as each maximum independent set of G can be extended to a maximum independent set of G ′ , by simply adding k ′ internal vertices of each newly added path. Doing so, the weight increases by mk ′ N .
Suppose now that the answer to EWIS α (G ′ , w ′ , M + mk ′ N ) is yes. Let I ′ be a maximum independent set of G ′ of weight M + mk ′ N . Since I ′ is independent, it can contain at most k ′ internal vertices of each newly added path. Therefore, for each e ∈ E(G), the set I ′ must contain exactly k ′ internal vertices of P (e) -otherwise its weight would be at most W + (mk ′ − 1)N , contradicting our choice of N .
Let I denote the set, obtained from I ′ by deleting the internal vertices of newly added paths. Then, I is an independent set of G. Indeed, if e = [u, v] ∈ E(G) for some u, v ∈ I, then I ′ can contain at most k ′ − 1 internal vertices of P (e), contradicting the above observation. Also, it is easy to see that I is a maximum independent set of G. Finally, as the weight of I is exactly M , we conclude that the answer to EWIS α (G, w, M ) is yes.
This shows that EWIS α is strongly NP-complete in the class S k . To prove strong NPcompleteness of the problem in the class G, we now show that the class G contains all graphs in S k , for k := max{3, κ(F)}. Let G be a graph from S k . Assume that G does not belong to G. Then G contains a graph A ∈ F as an induced subgraph. From the choice of G we know that A belongs to S k , but then k < κ(A) ≤ κ(F) ≤ k, a contradiction. Therefore, G ∈ G and the theorem is proved.

Polynomial results
In this section, we present pseudo-polynomial solutions to the exact weighted independent set problem, when the input graphs are restricted to particular classes. 5 Our algorithms mostly resemble those for the WIS problem in respective graph classes, and are based either on a dynamic programming approach (Section 4.1), or on modular decomposition (Section 4.2). Often, the solutions will be described using the following pseudo-polynomially equivalent version of EWIS: given a weighted graph and a target M , compute all M instances of EWIS with varying target. That is, the output is given by the vector First, we show that without loss of generality, we may restrict our attention to connected graphs. To do so, we recall the subset sum problem, a typical example of an NP-complete problem that can be solved in pseudo-polynomial time by dynamic programming.
It is straightforward to extend the dynamic programming solution for subset sum to one for generalized subset sum. Proof. We are going to show a stronger statement: in the stated time, not only we can verify if there is an S and an a such that i∈S a(i) = b for the given b, but we will generate the set The proof is by induction on n. The statement clearly holds for n = 1, as in this case we Suppose now that n > 1. Let I = (A 1 , . . . , A n ; b) be an instance of the GSS problem. Let B ′ be the inductively constructed set of all possible values of b ′ ∈ [b] such that the solution to the GSS problem on the instance (A 1 , . . . , A n−1 ; b ′ ) is yes. By induction, the set B ′ was constructed in time O((n − 1)b 2 ).
Let β ∈ [b]. Then, β will belong to B, i.e., the solution to the GSS, given (A 1 , . . . , A n ; β), will be yes, if and only if either β ∈ B ′ , or we can write β as β = b ′ + a n for some b ′ ∈ B ′ and a n ∈ A n . In other words, B = B ′ ∪ B ′′ , where B ′′ denotes the set of all such sums: B ′′ = {b ′ + a n : b ′ ∈ B ′ , a n ∈ A n , b ′ + a n ≤ b}.
The set B ′′ can be constructed in time O(b 2 ). Adding this time complexity to the time O((n − 1)b 2 ) needed to construct B ′ proves the lemma.
It now follows immediately that in order to solve EWIS, it suffices to solve the problem for connected graphs.

Dynamic programming solutions
We can summarize the results of this subsection in the following theorem.
Theorem 4.3. The problems EWIS and EWIS α admit pseudo-polynomial-time solutions in each of the following graph classes: mK 2 -free graphs, interval graphs and their generalizations k-thin graphs, chordal graphs, AT-free graphs, (claw , net)-free graphs, distance-hereditary graphs, circle graphs, graphs of treewidth at most k, and graphs of clique-width at most k.
The rest of this subsection is devoted to proving this result. By part (ii) of Lemma 2.1, it suffices to develop pseudo-polynomial solutions for EWIS. All graph classes mentioned in the theorem are defined in the sequel. Most of the algorithms resemble those for the WIS problem and exploit the special structure of graphs in the classes. Thus, we do not present all of the algorithms and their analyses in full detail; for more details, we refer the reader to the technical report [35].

mK 2 -free graphs
Our first example deals with graphs with no large induced matchings. Recall that K 2 denotes the graph consisting of two adjacent vertices. The disjoint union of m copies of K 2 is denoted by mK 2 . Thus, graphs whose largest induced matching consists of less than m edges are precisely the mK 2 -free graphs. Proof. All maximal independent sets I 1 , . . . , I N in an mK 2 -free graph can be found in polynomial time [1,3,44,50]. Since every independent set is contained in a maximal one, EWIS(G, w, k) will take the value yes if and only if there is an i ∈ [N ] such that EWIS(G[I i ], w, k) is yes. Thus, the EWIS problem in mK 2 -free graphs reduces to solving polynomially many instances of the subset sum problem.

Interval graphs
Interval graphs are one of the most natural and well-understood classes of intersection graphs. They are intersection graphs of intervals on the real line, and many optimization problems can be solved by dynamic programming on these graphs. A representation of interval graphs that is particularly suitable for the EWIS problem is the following. It has been shown by Ramalingam and Pandu Rangan [45] that a graph G = (V, E) is interval if and only if it admits a vertex ordering (v 1 , . . . , v n ) such that for all triples (r, s, t) with 1 ≤ r < s < t ≤ n, the following implication is true: Moreover, such an ordering of an interval graph can be found in time O(n + m). Based on this ordering, we can prove the following statement. Proof. Let (v 1 , . . . , v n ) be a vertex ordering such that [v s , v t ] ∈ E, whenever [v r , v t ] ∈ E, for all triples (r, s, t) with 1 ≤ r < s < t ≤ n.
For every i ∈ [n], let G i denote the subgraph of G induced by {v 1 , . . . , v i } (also, let G 0 be the empty graph). Then, for every i ∈ [n], either there is a j = j(i) such that . This observation is the key to the following simple O(M n + m) dynamic programming solution to the EWIS problem on interval graphs.

For k ∈ [M ], do the following:
If If k > w(v i ), set EWIS(G i , w, k) to yes if at least one of the solutions to EWIS(G j(i)−1 , w, k − w(v i )) and EWIS(G i−1 , w, k) is yes, and to no otherwise.
Step 4. Output the solution to EWIS(G n , w, M ).

k-thin graphs
The property used in the above characterization of interval graphs has been generalized by Mannino et al. in [33], where they define the class of k-thin graphs. A graph G = (V, E) is said to be k-thin if there exist an ordering (v 1 , . . . , v n ) of V and a partition of V into k classes such that, for each triple (r, s, t) with 1 ≤ r < s < t ≤ n, if v r , v s belong to the same class and Let us mention at this point that finding a feasible frequency assignment of a given cost can be modeled as the EWIS problem on a k-thin graph, where the parameter k depends on the input to the frequency assignment problem. For further details, we refer the reader to the paper [33].
Based on the same idea as for interval graphs, a dynamic programming solution for k-thin graphs can be obtained, provided we are given an ordering and a partition of the vertex set.
Theorem 4.6. Suppose that for a k-thin graph G = (V, E), k ≥ 2, an ordering (v 1 , . . . , v n ) of V and a partition of V into k classes are given such that, for each triple (r, s, t) with 1 ≤ r < s < t ≤ n, if v r , v s belong to the same class and [v r , v t ] ∈ E, then [v s , v t ] ∈ E. Then, EWIS admits an O(M n k ) algorithm for G.
Proof. The proof is a straightforward extension of the proof of Theorem 4.5. Let V 1 , . . . , V k be the classes of the partition. Instead of the graphs G i , induced by the first i vertices, we now consider all graphs G(i 1 , . . . , i k ), induced by the "first" i r vertices of each class (according to the ordering on V restricted to the class), for all r ∈ {1, . . . , k}, and for all O(n k ) choices of such k-tuples (i 1 , . . . , i k ) ∈ {1, . . . , |V 1 |} × . . . × {1, . . . , |V k |}.

Chordal graphs
Chordal (or triangulated) graphs are graphs in which every cycle of length at least four has a chord. They strictly generalize interval graphs and provide another class where the WIS problem is polynomially solvable. Unfortunately for our purpose, the usual approaches for the WIS problem in chordal graphs ( [23,48]) heavily rely on the maximization nature of the problem, and generally do not preserve the overall structure of independent sets. As such, they do not seem to be directly extendable to the exact version of the problem. Instead, we develop a pseudo-polynomial time solution to the EWIS problem in chordal graphs by using one of the many different characterizations of chordal graphs: their clique tree representation. Proof. Given a chordal graph G, we first compute a clique tree of G. This can be done in time O(n + m) [29]. A clique tree of a chordal graph G is a tree T whose nodes are the maximal cliques of G, such that for every vertex v of G, the subgraph T v of T induced by the maximal cliques containing v is a tree. Furthermore, we fix an arbitrary node K r in the clique tree in order to obtain a rooted clique tree. For a maximal clique K, we denote by G(K) the subgraph of G induced by the vertices of K and all vertices contained in some descendant of K in T .
The algorithm is based on a set of identities developed by Okamoto, Uno and Uehara in [40], where a clique tree representation was used to develop linear-time algorithms to count independent sets in a chordal graph. Let IS(G) be the family of independent sets in G. For a vertex v, let IS(G, v) be the family of independent sets in G that contain v. For a vertex set U , let IS(G, U ) be the family of independent sets in G that contain no vertex of U . Consider a maximal clique K of G, and let K 1 , . . . , K l be the children of K in T . (If K is a leaf of the clique tree, we set l = 0.) Then, as shown in [40], for every distinct i, j ∈ [l], the sets V (G(K i ))\K and V (G(K j ))\K are disjoint. Moreover, if ⊔ denotes the disjoint union, the following relations hold: ; We extend our usual Boolean predicate EWIS(H, w, k) to the following two: for a vertex v of a weighted graph (H, w) and in integer k, let EWIS(H, w, k, v) denote the Boolean predicate that is yes if and only if in H there is an independent set I of total weight k that contains v. Also, for a set of vertices U let EWIS(H, w, k, U ) take the value yes if and only if in H there is an independent set of total weight k that contains no vertex from U . Based on the above equations, we can develop the following recursive relations for EWIS: 13 EWIS(G(K), w, k) = EWIS(G(K), w, k, K) ∨ v∈K:w(v)≤k EWIS(G(K), w, k, v) where ∨ denotes the usual Boolean OR function (with the obvious identification yes ↔ 1, no ↔ 0). That is, its value is yes if at least one of its arguments is yes, and no otherwise.
where GSS(A 1 , . . . , A l , k) denotes the solution to the generalized subset sum problem with the input (A 1 , . . . , A l , k), and the sets A i for i ∈ [l] are given by where, for each i ∈ [l], the set A i is given by and, finally, for each i ∈ [l], we have: Given the above equations, it is now easy to develop a pseudo-polynomial dynamic programming algorithm. Having constructed a rooted tree T of G, we traverse it in a bottom-up manner. For a leaf K, we have EWIS(G(K), w, k, K) = yes, if k = 0; no, otherwise. and For every other node K, we compute the values of EWIS(G(K), w, k, K) and EWIS(G(K), w, k, v) by referring to the recursive relations (6), (5) and (4) in this order. Finally, the value of EWIS(G, w, k) is given by EWIS(G(K r ), w, k), which can be computed using Equation (3). The correctness of the procedure follows immediately from the above discussion. To justify the time complexity, observe that in a node K of the tree with children K 1 , . . . , K l , the number of operations performed is O( l i=1 |K i | + lM 2 + |K|lM 2 ). Summing up over all the nodes of the clique tree, and using the fact that a chordal graph has at most n maximal cliques, which satisfy K∈V (T ) |K| = O(n + m), the claimed complexity bound follows.

AT-free graphs
The class of AT-free graphs is another class that contains the interval graphs. Moreover, AT-free graphs contain other well-known subclasses of perfect graphs, for instance permutation graphs and their superclass, the class of co-comparability graphs.
A triple {x, y, z} of pairwise non-adjacent vertices in a graph G is an asteroidal triple if for every two of these vertices there is a path between them avoiding the closed neighborhood of the third. Our dynamic programming algorithm that solves EWIS for AT-free graphs is based on the dynamic programming approach to the WIS problem in AT-free graphs, developed by Broersma, Kloks, Kratsch and Müller in [16]. Let us start with a definition. Now, we recall some structural results from [16].   Combining this observation with Theorems 4.9 and 4.10, we obtain the following lemma. Similarly, using Theorem 4.8 we obtain the following conclusion.  4.14. EWIS admits a pseudo-polynomial algorithm for AT -free graphs.
Proof. It follows from the above discussion that the following pseudo-polynomial algorithm correctly solves the problem.
Step 1. For every x ∈ V compute all components of G − N [x].
Step 2. For every pair of nonadjacent vertices x, y ∈ V (G) compute the interval I(x, y).
Step 3. Sort all the components and intervals according to nonincreasing number of vertices.
Step 4. In the order of Step 3, compute the solutions to EWIS(C, w, k), for each component C (for all k ∈ {0, 1, . . . , w(C)}) and the solutions to EWIS(I, w, k) for each interval I (for all k ∈ {0, 1, . . . , w(I)}). To compute the solutions to EWIS(C, w, k) for a component C, first compute the solutions to EWIS (C − N (y), w, k), for all y ∈ C, by applying Lemma 4.12 and Corollary 4.2. Similarly, to compute the solutions to EWIS(I, w, k) for an interval I, first compute the solutions to EWIS (I − N (s), w, k), for all s ∈ I, by applying Lemma 4.13 and Corollary 4.2.
Step 5. Compute the solution to EWIS(G, w, k) using Observation 4.11 and Corollary 4.2.
A claw is the graph K 1,3 . A net is the graph obtained from a triangle by attaching one pendant edge to each vertex. In [10], it is shown that for every vertex v of a (claw , net)-free graph G, the non-neighborhood of v in G is AT-free. Thus, Theorem 4.14 immediately implies the following result.

Distance hereditary graphs
A graph is distance-hereditary if the distance between any two connected vertices (that is, vertices in the same connected component) is the same in every induced subgraph in which they remain connected. 7 Bandelt and Mulder provided in [4] a pruning sequence characterization of distance-hereditary graphs: whenever a graph contains a vertex of degree one, or a vertex with a twin (another vertex sharing the same neighbors), remove such a vertex. A graph is distance-hereditary if and only if it the application of such vertex removals results in a single-vertex graph.
A pruning sequence of a distance-hereditary graph can be computed in linear time [19] and can be useful for algorithmic developments on distance-hereditary graphs. A solution to the WIS problem in distance-hereditary graphs based on the pruning sequence characterization has been developed by Cogis and Thierry in [17]. It turns out that their approach can be generalized in order to solve the exact version of the problem (a detailed description can be found in [35]).

Circle graphs
Besides intervals on the real line, chords on a circle provide another popular intersection model. The intersection graphs of chords on a circle are called circle graphs. In this subsection, we present a O(M 2 n 2 ) dynamic-programming algorithm for the EWIS problem in circle graphs. Our algorithm for EWIS on circle graphs is based on the dynamic programming solution for the IS problem, developed by Supowit in [47]. Proof. Consider a finite set of N chords on a circle. We may assume without loss of generality that no two chords share an endpoint. Number the endpoints of the chords from 1 to 2N in the order as they appear as we move clockwise around the circle (from an arbitrary but fixed starting point).
The idea is simple. For 1 ≤ i < j ≤ 2N , let G(i, j) denote the subgraph of G induced by chords whose both endpoints belong to the set {i, i + 1, . . . , j}. Obviously G = G (1, 2N ).
Let 1 ≤ i < j ≤ 2N . If j = i + 1 then the solution to EWIS (G(i, j), w, k) is yes if and only if either k = 0, or (i, i + 1) is a chord and k = w((i, i + 1)).
Otherwise, let r be the other endpoint of the chord whose one endpoint is j. If r < i or r > j, then no independent set of the graph G(i, j) contains the chord (r, j), so the solution to EWIS (G(i, j), w, k) is yes if and only if the solution to EWIS(G(i, j − 1), w, k) is yes. Suppose now that i ≤ r ≤ j − 1 and let I be an independent set of G(i, j). The set I may or may not contain the chord (r, j). If I does not contain (r, j), then I is an independent set of of G(i, j − 1) as well. If I contains (r, j), then no other chord in I can intersect the chord (r, j). In particular, this implies that I is of the form I = {(r, j)} ∪ I 1 ∪ I 2 where I 1 is an independent set of G(i, r − 1) and I 2 is an independent set of G(r + 1, j − 1).
Therefore, the solution to EWIS(G(i, j), w, k) is yes if and only if either the solution to EWIS(G(i, j − 1), w, k) is yes, or the solution to EWIS(G ′ , w, k) is yes, where G ′ is the graph whose connected components are G[{(r, j)}], G(i, r − 1) and G(r + 1, j − 1). Assuming that the solutions for G(i, r − 1) and G(r + 1, j − 1) have already been obtained recursively, we can apply Corollary 4.2 in this case.
The above discussion implies an obvious O(M 2 n 2 ) algorithm that correctly solves the problem.

Graphs of treewidth at most k
Graphs of treewidth at most k, also known as partial k-trees, are very important from an algorithmic viewpoint: many graph problems that are NP-hard for general graphs are solvable in linear time when restricted to graphs of treewidth at most k [2]. 8 A standard dynamic programming approach shows that this is also the case for EWIS. A detailed description of the algorithm and its analysis can be found in [35].

Graphs of clique-width at most k
The clique-width of a graph G is defined as the minimum number of labels needed to construct G, using the following four graph operations: (i) Create a new vertex v with label i (denoted by i(v)).
(ii) Take the disjoint union of two labeled graphs G and H (denoted by G ⊕ H). (iv) Rename label i to j (denoted by ρ i→j ).
An expression built from the above four operations is called a clique-width expression. A clique-width expression using k labels is called a k-expression. Each k-expression t uniquely defines a labeled graph lab(t), where the labels are integers {1, . . . , k} associated with the vertices and each vertex has exactly one label. We say that a k-expression t defines a graph G if G is equal to the graph obtained from the labeled graph lab(t) after removing its labels. The clique-width of a graph G is equal to the minimum k such that there exists a k-expression defining G.
The clique-width of a graph of treewidth k is bounded above by 3 · 2 k−1 . This implies that a class of graphs with uniformly bounded treewidth is also of bounded clique-width. The complete graphs show that converse is generally not true. In this sense, showing that a problem can be efficiently solved for graphs of bounded clique-width is more general than showing the same statement for graphs of bounded treewidth.
Many graph problems that are NP-hard for general graphs are solvable in linear time when restricted to graphs of clique-width at most k, if a k-expression is given as part of the input. 9 EWIS is no exception. Note that the same algorithm runs in pseudo-polynomial time whenever the clique-width of the input graph is of the order O(log n).
Due to the unknown complexity of the exact perfect matching problem, the problem of determining the complexity of EWIS is of particular interest for line graphs of bipartite graphs, and their subclasses and superclasses. Line graphs of bipartite graphs form a hereditary class of graphs. Their characterization in terms of forbidden induced subgraphs has been obtained in [46], as follows. A graph G is the line graph of a bipartite graph if and only G is F-free, where F = {claw , diamond , C 5 , C 7 , . . .}, where a diamond is the graph obtained by deleting a single edge from a complete graph on 4 vertices.
Keeping in mind this characterization of line graphs of bipartite graphs, it is interesting to consider the following immediate consequence of Theorem 4.19.
Also, we can derive from Theorem 4.19 a particular complexity result for the exact perfect matching problem.
Corollary 4.21. For every fixed k, the exact perfect matching problem admits a pseudopolynomial algorithm for graphs of treewidth at most k.
Proof. As shown by Gurski and Wanke [26], a set G of graphs has bounded treewidth if and only if L(G) has bounded clique-width. Since the exact perfect matching problem in G is polynomially equivalent to the problem EWIS α in the set L(G), the statement follows from Theorem 4.19 and part (ii) of Lemma 2.1.

Modular decomposition
The idea of modular decomposition has been first described in the 1960s by Gallai [24], and also appeared in the literature under various other names such as prime tree decomposition [22], Xjoin decomposition [27], or substitution decomposition [36]. This technique allows one to reduce many graph problems from arbitrary graphs to so-called prime graphs. In this subsection, we show how to apply modular decomposition to the EWIS problem.
Let G = (V, E) be a graph, U a subset of V and x a vertex of G outside U . We say that x distinguishes U if x has both a neighbor and a non-neighbor in U . A subset U ⊂ V (G) is called a module in G if it is indistinguishable for the vertices outside U . A module U is nontrivial if 1 < |U | < |V |, otherwise it is trivial. A graph whose every module is trivial is called prime.
An important property of maximal modules is that if G and co-G are both connected, then the maximal modules of G are pairwise disjoint. Moreover, from the above definition it follows that if U and W are maximal modules, then either there are all possible edges between U and W , or there are no edges between them. This property is crucial for the modular decomposition, which provides a reduction of many graph problems from a graph G to the graph G 0 obtained from G by contracting each maximal module to a single vertex.
We formally describe this reduction for the EWIS problem in the recursive procedure Modular ewis(G, W, M ) below. It turns out that in order to apply this decomposition to the EWIS problem, we need to relax the problem so that each vertex of the input graph is equipped with a nonempty set of possible weights (instead of just a single one). For simplicity, we still name this problem EWIS. When all sets are singletons, the problem coincides with the original EWIS problem. 2. If G is disconnected, partition it into connected components M 1 , . . . , M r , and go to step 5.
3. If co-G is disconnected, partition G into co-components M 1 , . . . , M r , and go to step 5. Construct a graph G 0 from G by contracting each M j (for j ∈ [r]) to a single vertex, and assign to that vertex the set of weights and stop.
We remark that for each input graph, at most one of the steps 2-4 is performed. (At most one among {G, co-G} is disconnected; moreover, if G and co-G are both connected, then the maximal modules of G are pairwise disjoint.) Observe that the graph G 0 constructed in step 5 of the algorithm is either an edgeless graph, a complete graph, or a prime graph. Therefore, the modular decomposition approach reduces the problem from a graph to its prime induced subgraphs.
The correctness of the procedure is straightforward: every independent set I of G consists of pairwise disjoint independent sets in the subgraphs of G induced by M 1 , . . . , M r ; moreover, those M i 's that contain a vertex from I form an independent set in G 0 . And conversely, for every independent set I 0 in G 0 and every choice of independent sets {I j : j ∈ I 0 } with I j independent in G[M j ], the set ∪ j∈[r] I j is independent in G.
The following theorem answers the question on the complexity of such a reduction. Proof. Let G be a graph in G with n vertices and m edges. The recursive decomposition of G produced by the algorithm can be implemented in time O(n + m) [34]. This decomposition associates with G a tree T (G) whose leaves correspond to the vertices of G, while the internal nodes of T (G) represent induced subgraphs of G with at least two vertices. If G U is disconnected, then G 0 U is an empty graph, and the problem can be solved for G 0 U in time O(M 2 |V (G 0 U )|), since it is a generalized subset sum problem (cf. Lemma 4.1). If G U is disconnected, then G 0 U is a complete graph, and the problem can be solved trivially for G 0 U in time O(M |V (G 0 U )|). If both G and co-G are connected, then G 0 U is a prime induced subgraph of G, and the problem can be solved for G 0 U in time O(M q |V (G 0 U )| p ) by our assumption. Summing up over all internal nodes of T (G), we conclude that the total time complexity of the problem on G is bounded by O(M q U |V (G 0 U )| p ). It is not difficult to see that the total number of vertices in all graphs G 0 U corresponding to internal nodes U ∈ V (T (G)) equals to the number of edges of T (G), i.e., |V (T (G))| − 1. Since the number of leaves of T (G) is n and the number of internal nodes is at most n − 1, we conclude that Adding the term O(n + m) needed to obtain the decomposition tree, we obtain the desired time complexity. The theorem is proved.
Just like for the weighted independent set problem, modular decomposition is the key to pseudo-polynomial-time solutions to EWIS in several subclasses of P 5 -free and fork-free graphs. The results are summarized in the following theorem; all graphs mentioned in the theorem or its proof are depicted in Figure 4.  • (P 5 , double-gem, co-domino)-free graphs (and their subclass, (P 5 , co-P)-free graphs), • (bull, fork)-free graphs, • (co-P, fork)-free graphs, • (P 5 , fork)-free graphs.
Proof. This theorem essentially follows from Theorem 4.22 and the results in [12] and [28] (see also [11] for some applications of modular decomposition to the WIS problem). We briefly summarize the main ideas.
Every prime (P 5 , double-gem, co-domino)-free graph is 2K 2 -free (the complementary version of this statement is proved in [28]). Since we can easily extend Theorem 4.4 to the extended version of EWIS, this implies the result for (P 5 , double-gem, co-domino)-free graphs.
The (extended) EWIS problem can be solved in pseudo-polynomial time for co-gem-free graphs. Indeed, for every vertex v of a co-gem-free graph G, the non-neighborhood of v in G is P 4 -free. So the problem reduces to solving O(nM ) subproblems in P 4 -free graphs, which can be done by modular decomposition. It is well known (and can be easily shown) that every P 4 -free graph is either disconnected, or its complement is disconnected. Thus, the only prime P 4 -free graph is the graph on a single vertex.
In [12], it is shown that prime graphs that contain a co-gem and are either (bull , fork )free, (co-P, f ork)-free or (P 5 , f ork)-free have a very simple structure. The (extended) EWIS problem can be solved in pseudo-polynomial time for such graphs. Together with the above observation about co-gem-free graphs and Theorem 4.22, this concludes the proof.

Concluding remarks
As we saw in the introduction, the motivation for studying the exact weighted independent set problem comes from the fact that the complexity of the exact matching problem is still unknown, even for bipartite graphs. Hence, the problem of determining the complexity of EWIS is of particular interest for line graphs of bipartite graphs, and their subclasses and superclasses. We will now show that the class L(Bip) of line graphs of bipartite graphs is sandwiched between two graph classes for which the complexity of EWIS is known, and whose (infinite) sets of forbidden induced subgraphs differ only in two graphs.
Recall that the line graphs of bipartite graphs are precisely the (claw , diamond , C 5 , C 7 , . . .)free graphs. Replacing the diamond in the above characterization by its subgraph C 3 results in a smaller class of (claw , C 3 , C 5 , C 7 , . . .)-free graphs. It is easy to see that this is precisely the class of bipartite graphs of maximum degree 2. Every connected graph in this class is either an even cycle or a path, and the treewidth of such graphs is at most 2. By Corollary 4.2 and Theorem 4.18, the problem is solvable in pseudo-polynomial time in this class.
On the other hand, if we replace the claw = K 1,3 with K 1,4 in the above characterization of L(Bip), we obtain a class of graphs that strictly contains line graphs of bipartite graphs. This class of (K 1,4 , diamond , C 5 , C 7 , . . .)-free graphs contains the class of (K 1,4 , C 3 , C 5 , C 7 , . . .)-free graphs, which is precisely the class of bipartite graphs of maximum degree at most 3. The results of Section 3.1 imply that the problem is strongly NP-complete for this class, and hence also for the larger class of (K 1,4 , diamond , C 5 , C 7 , . . .)-free graphs.
To summarize, the class L(Bip) of line graphs of bipartite graphs is sandwiched between two graph classes for which the complexity of EWIS is known, as the following diagram shows.