Stable Sets in {ISK4,wheel}-Free Graphs

An ISK4 in a graph G is an induced subgraph of G that is isomorphic to a subdivision of $$K_4$$ K4 (the complete graph on four vertices). A wheel is a graph that consists of a chordless cycle, together with a vertex that has at least three neighbors in the cycle. A graph is {ISK4,wheel}-free if it has no ISK4 and does not contain a wheel as an induced subgraph. We give an $$O(|V(G)|^7)$$ O(|V(G)|7) -time algorithm to compute the maximum weight of a stable set in an input weighted {ISK4,wheel}-free graph G with non-negative integer weights.


Introduction
All graphs in this paper are finite and simple.An ISK4 in a graph G is an induced subgraph of G that is isomorphic to a subdivision of K 4 (the complete graph on four vertices).An ISK4-free graph is a graph G that contains no ISK4 (that is, no induced subgraph of G is isomorphic to a subdivision of K 4 ).The class of ISK4-free graphs contains all series-parallel graphs, and also all line graphs of graphs of maximum degree at most three.
Lévêque, Maffray, and Trotignon [12] proved a decomposition theorem for ISK4-free graphs, but gave no algorithmic applications.In particular, no polynomial-time algorithms and no hardness proofs are known for the following problems in the class of ISK4-free graphs: recognition, maximum stable set, and coloring.(Finding a maximum clique in an ISK4-free graph is of course trivial because every clique in such a graph is of size at most three.) A wheel is a graph that consists of a chordless cycle, together with a vertex (called the center of the wheel) that has at least three neighbors in the cycle.A graph is wheel-free if none of its induced subgraphs is a wheel.Wheel-free graphs have a number of structural properties (see for instance [1,2,8]).However, the maximum stable set problem is easily seen to remain NP-hard even when restricted to the class of wheel-free graphs.To see this, denote by α(G) the stability number (i.e., the maximum size of a stable set) of a graph G, and consider the operation of subdividing every edge of G twice.This yields a graph G ′ that is wheel-free (because every vertex of degree at least three in G ′ has only neighbors of degree two, and so it cannot be the center of a wheel).As observed by Poljak [14], α(G ′ ) = α(G) + |E(G)|, and so computing the stability number of a wheelfree graph is as hard as computing it in a general graph.
A graph is {ISK4,wheel}-free if it is ISK4-free and wheel-free.In [12], a decomposition theorem is given for {ISK4,wheel}-free graphs.(This theorem was obtained as a corollary of the decomposition theorem for ISK4-free graphs from [12].)The theorem for {ISK4,wheel}-free graphs is stronger than the one for ISK4-free graphs in the sense that the former theorem can be used to solve the recognition and the coloring problems for {ISK4,wheel}free graphs in polynomial time.However, no other algorithmic application has previously been reported.
In this paper, we investigate the maximum weight stable set problem restricted to {ISK4,wheel}-free graphs.Let us be precise.First, by a weighted graph, we mean an ordered pair (G, w), where G is a graph and w is a function (called a weight function for G) that assigns to each vertex v of G a non-negative integer weight w(v).The weight of a set of vertices is the sum of the weights of its elements.The stability number of a weighted graph (G, w), denoted by α(G, w), is the maximum weight of a stable set of G, and a maximum weighted stable set of (G, w) is a stable set whose weight is precisely α(G, w).(If (G, w) is a weighted graph and H is an induced subgraph of G, then we will also write α(H, w) for the stability number of the weighted graph (H, w ′ ) where w ′ is the restriction of w to V (H).)The maximum weight stable set problem for a given class G of graphs is the problem of finding a maximum weight stable set in a given weighted graph (G, w) such that G ∈ G.A hereditary class is a class of graphs that is closed under isomorphism and induced subgraphs (clearly, the class of {ISK4,wheel}-free graphs is a hereditary class).The following is well-known.Proposition 1.1 (folklore).Let G be a hereditary class.Suppose that A is an algorithm that computes the stability number of any weighted graph (G, w) such that G ∈ G in O(|V (G)| k ) time.Then there is an algorithm B that computes a maximum weight stable set of any graph (G, w) such that G ∈ G in O(|V (G)| max{k+1,3} ) time.
Proof.Let (G, w) be an input graph with G ∈ G, and set n = |V (G)|.If G is the null graph, then the algorithm returns ∅ and stops.Otherwise, we choose a vertex v ∈ V (G), we compute the graph G N [v] in O(n 2 ) time (where N [v] is the set consisting of v and all its neighbors in G), and using the algorithm A, we compute α(G, w) and α(G N [v], w) in O(n k ) time.Clearly, w(v) + α(G N [v], w) ≤ α(G, w).If w(v) + α(G N [v], w) = α(G, w), then we recursively compute a maximum weight stable set S of (G N [v], w), and the algorithm returns {v} ∪ S and stops.On the other hand, if w(v) + α(G N [v], w) < α(G, w), then we see that no maximum weight stable set of (G, w) contains v.In this case, we compute G v in O(n 2 ) time, we recursively compute a maximum weight stable set S of (G v, w), and the algorithm returns S and stops.
It is clear that the algorithm is correct.We make O(n) recursive calls to the algorithm, and it follows that the total running time of the algorithm is O(n max{k+1,3} ).
In view of Proposition 1.1, from now on, we focus on constructing a polynomial-time algorithm that computes the stability number of weighted {ISK4,wheel}-free graphs.
The decomposition theorem for {ISK4,wheel}-free graphs from [12] states (roughly) that every such graph is either "basic" or admits a "decomposition" (that is, a way to break it up into smaller pieces).The basic classes are all fairly easy to handle and the main difficulty is posed by the decompositions.One of the decompositions, namely the clique-cutset (that is, a clique whose deletion yields a disconnected graph), is easy to handle, but the other one is not: the "proper 2-cutset."A proper 2-cutset of a graph G is a pair of non-adjacent vertices, say a and b, such that V (G) {a, b} can be partitioned into two non-empty sets X and Y so that there is no edge between X and Y , and neither G[X ∪ {a, b}] nor G[Y ∪ {a, b}] is a path between a and b.
The problem with a proper 2-cutset {a, b} of a graph G is that a maximum stable set of G may contain a (but not b), or b (but not a), or neither a nor b, or both a and b.This phenomenon also occurs in any induced subgraph of G that contains a and b, and in particular in any reasonable subgraph built for the purposes of a recursive algorithm.So, any naive attempt to build an algorithm for the maximum stable set problem relying on proper 2-cutsets should lead one to consider an exponential number of cases.In fact, the situation is even worse for proper 2-cutsets as shown by a hardness result that we explain now.Let G be a graph.A 2-extension of G is any graph obtained from G by first deleting a vertex v of degree two, with non-adjacent neighbors a and b, then adding four vertices of degree two forming a path a − x 1 − x 2 − x 3 − x 4 − b, and finally adding a vertex x adjacent to x 1 , x 2 , x 3 and x 4 .An extended bipartite graph is any graph obtained from a bipartite graph by repeatedly applying 2-extensions.Trivially, extended bipartite graphs have a decomposition theorem: if G is an extended bipartite graph, then either G is bipartite, or G was obtained from an even cycle by performing exactly one 2-extension, or G has a proper 2-cutset.It is well-known that one can find the stability number of a (weighted) bipartite graph in polynomial time (see for instance [9]).It is also clear that the stability number of a (weighted) graph obtained from an even cycle by performing exactly one 2-extension can be found in polynomial time (indeed, if G is obtained from an even cycle by performing exactly one 2-extension, and x, x 1 , x 2 , x 3 , x 4 are as in the definition of a 2-extension, then every stable set of G is also a stable set of at least one of G {x 2 , x 3 }, G {x, x 1 }, and G {x, x 2 }, and each of these three induced subgraphs of G is either a path or an even cycle, and is therefore bipartite).So, if proper 2cutsets were a good tool for solving the maximum stable set problem, there should be a polynomial-time algorithm for solving this problem in extended bipartite graphs.However, it was shown in [17] that the maximum stable set problem is NP-hard when restricted to extended bipartite graphs.The result is stated differently in [17], and so we reproduce it here for the sake of completeness.
Proposition 1.2.The problem of computing the stability number of an input extended bipartite graph is NP-hard.
Proof.Suppose there is a polynomial-time algorithm A for our problem.We prove the theorem by using A as a subroutine to solve the problem of computing the stability number of a general graph G in polynomial time.First build B by subdividing every edge of G once.Let X be the set of vertices of degree two in B that arise from the subdivisions.Note that B is bipartite, and (X, V (B) X) is a bipartition of B. Now build a graph H from B by applying a 2-extension to every vertex of X.By construction, H is an extended bipartite graph, and it is easy to check that α(H) = α(G)+ 2|E(G)|.Thus, A indeed allows one to compute the stability number of a general graph in polynomial time.
Despite this negative result, we can use (a variant of) a proper 2-cutset in the special case of {ISK4,wheel}-free graphs, mainly because the basic classes are very restricted.We rely on what is called a "trigraph," which is a graph where some edges are left "undecided" (the notion is from [6,7], and formal definitions are given in Section 2).The idea is as follows.When G is a graph, a and b are non-adjacent vertices of G whose deletion yields a disconnected graph, and V (G) {a, b} is partitioned into non-empty sets X and Y such that there are no edges between X and Y , we build a (tri)graph on the vertex set X ∪ {a, b}by keeping the edges of G, and by leaving the adjacency between a and b undecided.We give weights to a and b, and we also give weights specific to the pair {a, b}.Roughly speaking, the weights associated with the vertices a and b and the pair {a, b} "encode" the maximum weight of a stable set in graphs and G[Y ∪ {a, b}].We therefore need weights, undecided adjacencies, and a way to handle the notion of the weight of a stable set in this context.All this is captured in the notion of weighted trigraph (we postpone the formal definition to Section 3).We remark that a similar idea was previously used in [16] in the context of bull-free graphs.However, the definition of a weighted trigraph was simpler in [16] than in the present paper, as was the definition of the weight of a stable set in a weighted trigraph.The reason for this is that the decompositions that appear in the context of bull-free graphs are more convenient than proper 2-cutsets for the purposes of computing the stability number.
We complete the introduction by giving an outline of the paper.In Section 2, we define trigraphs and introduce some basic trigraph-related terminology that we need.In Section 3, we define weighted trigraphs, explain how to compute the weight of a set of vertices in a weighted trigraph, and prove several results about weighted stable sets in weighted trigraphs.These properties are more complicated than one might expect because of the weights associated with the undecided adjacencies.Because of these weights, the weight of a set is not a monotone function (one could increase the weight of a set by taking a subset).For this reason, all proofs need to be written very carefully.In Section 4, we state a decomposition theorem for {ISK4,wheel}-free trigraphs (see Theorem 4.1).Since the proof of this theorem is very similar to that of the decomposition theorem for ISK4-free graphs from [12], we omit the proof of Theorem 4.1 in the present paper.The interested reader can find a detailed proof in [13].Interestingly, the fact that our theorem concerns trigraphs rather than graphs does not substantially complicate the proof, even though our theorem is formally stronger than the corresponding one for graphs.On the other hand, the fact that we restrict our attention to the wheel-free case significantly simplifies our proof.We complete Section 4 by using Theorem 4.1 to prove an "extreme" decomposition theorem for {ISK4,wheel}-free trigraphs (see Theorem 4.8 and Corollary 4.9).Roughly speaking, our extreme decomposition theorem states that every {ISK4,wheel}-free trigraph is either basic or admits a decomposition such that one block of decomposition is basic.In Section 5, we give a transformation from a weighted trigraph to a weighted graph that preserves the stability number.In Section 6, we use this transformation to compute the stability number in our basic trigraphs.Again, the proofs have to be done carefully, because as proven at the very end of the pa-per (see Theorem 8.1), it is NP-hard to compute the stability number of weighted bipartite trigraphs, and so one should be suspicious of "simple" classes of trigraphs in our context.In Section 7, we prove our main technical result: there is an O(|V (G)| 7 )-time algorithm to compute the stability number of an input weighted {ISK4,wheel}-free trigraph (G, w) (see Theorem 7.1).Since every weighted {ISK4,wheel}-free graph can be seen as a weighted {ISK4,wheel}-free trigraph, the algorithm from Theorem 7.1 can also be applied to {ISK4,wheel}-free graphs.Together with Proposition 1.1, this yields an O(|V (G)| 8 )-time algorithm that finds a maximum weight stable set of an input weighted {ISK4,wheel}-free graph (see Corollary 7.2).In Section 8, we prove the above-mentioned Theorem 8.1, which states that it is NP-hard to compute the stability number of a weighted bipartite trigraph.

Trigraphs
Given a set S, we denote by S 2 the set of all subsets of S of size two.A trigraph is an ordered pair G = (V (G), θ G ), where V (G) is a finite set, called the vertex set of G (members of V (G) are called vertices of G), and The null trigraph is the trigraph whose vertex set is empty; a non-null trigraph is any trigraph whose vertex set is non-empty.If G is a trigraph and u, v ∈ V (G) are distinct, we usually write uv instead of {u, v} (note that this means that uv = vu), and furthermore: • if θ G (uv) = 1, we say that uv is a strongly adjacent pair of G, or that u and v are strongly adjacent in G, or that u is strongly adjacent to v in G, or that v is a strong neighbor of u in G, or that u and v are the endpoints of a strongly adjacent pair of G; • if θ G (uv) = 0, we say that uv is a semi-adjacent pair of G, or that u and v are semi-adjacent in G, or that u is semi-adjacent to v in G, or that v is a weak neighbor of u in G, or that u and v are the endpoints of a semi-adjacent pair of G; • if θ G (uv) = −1, we say that uv is a strongly anti-adjacent pair of G, or that u and v are strongly anti-adjacent in G, or that u is strongly anti-adjacent to v in G, or that v is a strong anti-neighbor of u in G, or that u and v are the endpoints of a strongly anti-adjacent pair of G; • if θ G (uv) ≥ 0, we say that uv is an adjacent pair of G, or that u and v are adjacent in G, or that u is adjacent to v in G, or that v is a neighbor of u in G, or that u and v are the endpoints of an adjacent pair of G; • if θ G (uv) ≤ 0, we say that uv is an anti-adjacent pair of G, or that u and v are anti-adjacent in G, or that u is anti-adjacent to v in G, or that v is an anti-neighbor of u in G, or that u and v are the endpoints of an anti-adjacent pair of G.
Note that a semi-adjacent pair is simultaneously an adjacent pair and an anti-adjacent pair.One can think of strongly adjacent pairs as "edges," of strongly anti-adjacent pairs as "non-edges," and of semi-adjacent pairs as "optional edges."Clearly, any graph can be thought of as a trigraph: a graph is simply a trigraph with no semi-adjacent pairs, that is, the adjacency function of a graph G is a mapping from V (G) 2 to the set {−1, 1}.Given a trigraph G, a vertex u ∈ V (G), and a set X ⊆ V (G) {u}, we say that u is complete (respectively: strongly complete, anti-complete, strongly anti-complete) to X in G provided that u is adjacent (respectively: strongly adjacent, anti-adjacent, strongly anti-adjacent) to every vertex of X in G. Given a trigraph G and disjoint sets X, Y ⊆ V (G), we say that X is complete (respectively: strongly complete, anti-complete, strongly anti-complete) to Y in G provided that every vertex of X is complete (respectively: strongly complete, anti-complete, strongly anti-complete) to Y in G.
Isomorphism between trigraphs is defined in the natural way.The com- Thus, G is obtained from G by turning all strongly adjacent pairs of G into strongly anti-adjacent pairs, and turning all strongly anti-adjacent pairs of G into strongly adjacent pairs; semi-adjacent pairs of G remain semi-adjacent in G.
Given trigraphs G and G, we say that G is a semi-realization of G provided that V ( G) = V (G) and for all distinct u, v ∈ V ( G) = V (G), we have that if θ G (uv) = 1 then θ G (uv) = 1, and if θ G (uv) = −1 then θ G (uv) = −1.Thus, a semi-realization of a trigraph G is any trigraph that can be obtained from G by "deciding" the adjacency of some semi-adjacent pairs of G, that is, by possibly turning some semi-adjacent pairs of G into strongly adjacent or strongly anti-adjacent pairs.(In particular, every trigraph is a semi-realization of itself.)A realization of a trigraph G is a graph that is a semi-realization of G. Thus, a realization of a trigraph G is any graph that can be obtained by "deciding" the adjacency of all semi-adjacent pairs of G, that is, by turning each semi-adjacent pair of G into an edge or a non-edge.Clearly, if a trigraph G has m semi-adjacent pairs, then G has 3 m semi-realizations and 2 m realizations.The full realization of a trigraph G is the graph obtained from G by turning all semi-adjacent pairs of G into strongly adjacent pairs (i.e., edges), and the null realization of G is the graph obtained from G by turning all semi-adjacent pairs of G into strongly anti-adjacent pairs (i.e., non-edges).
A clique (respectively: strong clique, stable set, strongly stable set) of a trigraph G is a set of pairwise adjacent (respectively: strongly adjacent, anti-adjacent, strongly anti-adjacent) vertices of G.Note that any subset of V (G) of size at most one is both a strong clique and a strongly stable set of G.Note also that if S ⊆ V (G), then S is a (strong) clique of G if and only if S is a (strongly) stable set of G.Note furthermore that if K is a strong clique and S is a stable set of G, then |K ∩ S| ≤ 1; similarly, if K is a clique and S is a strongly stable set of G, then |K ∩ S| ≤ 1.However, if K is a clique and S is a stable set of G, then we are only guaranteed that vertices in K ∩ S are pairwise semi-adjacent to each other, and it is possible that |K ∩ S| ≥ 2. A triangle (respectively: strong triangle) is a clique (respectively: strong clique) of size three.
Given a trigraph G and a set X ⊆ V (G), the subtrigraph of G induced by X, denoted by G[X], is the trigraph with vertex set X and adjacency function θ G ↾ X 2 , where for a function f : A → B and a set A ′ ⊆ A, we denote by f ↾ A ′ the restriction of f to A ′ .If H = G[X] for some X ⊆ V (G), we also say that H is an induced subtrigraph of G; when convenient, we relax this definition and say that H is an induced subtrigraph of G provided that there is some set If H is a graph, we say that a trigraph G is an H-trigraph if some realization of G is (isomorphic to) H. Further, if H is a graph and G a trigraph, we say that G is H-free provided that all realizations of G are H-free (equivalently: provided that no induced subtrigraph of G is an Htrigraph).If H is a family of graphs, we say that a trigraph G is H-free provided that G is H-free for all graphs H ∈ H.In particular, a trigraph is ISK4-free (respectively: wheel-free, {ISK4,wheel}-free) if all its realizations are ISK4-free (respectively: wheel-free, {ISK4,wheel}-free).
A trigraph is a path if at least one of its realizations is a path.A trigraph is a narrow path if its full realization is a path.We often denote a path P by , where v 0 , v 1 , . . ., v k are the vertices of P that appear in that order in some realization P of P such that P is a path.The endpoints of a narrow path are the endpoints of its full realization; if a and b are the endpoints of a narrow path P , then we also say that P is a narrow path between a and b.A path (respectively: narrow path) in a trigraph G is an induced subtrigraph P of G such that P is a path (respectively: narrow path).
Note that if G is a connected trigraph, then for all vertices a, b ∈ V (G), there exists a narrow path between a and b in G. (To see this, consider the full realization G of G. G is connected, and so there is a path in G between a and b; let P be a shortest such path in G.The minimality of P guarantees that P is an induced path of G.But now G[V (P )] is a narrow path of G between a and b.) A hole of a trigraph G is an induced subtrigraph C of G such that some realization of C is a chordless cycle of length at least four.We often denote a hole such that A and B are non-empty (C may possibly be empty), and A graph is series-parallel if it does not contain any subdivision of K 4 as a (not necessarily induced) subgraph.A trigraph is series-parallel if its full realization is series-parallel (equivalently: if all its realizations are seriesparallel).
A bipartite trigraph is a trigraph G whose vertex set can be partitioned into two (possibly empty) strongly stable sets, A and B; under these circumstances, (A, B) is said to be a bipartition of the bipartite trigraph G. If, in addition, the two strongly stable sets A and B forming a bipartition are strongly complete to each other, G is said to be a complete bipartite trigraph.Note that non-null complete bipartite trigraphs have precisely two bipartitions: if (A, B) is a bipartition of a complete bipartite trigraph G, then so is (B, A), and G has no other bipartitions.Furthermore, note that bipartite trigraphs may have semi-adjacent pairs, but complete bipartite trigraphs cannot.Thus, complete bipartite trigraphs are in fact complete bipartite graphs.
The line graph of a graph H, denoted by L(H), is the graph whose vertices are the edges of H, and in which two vertices (i.e., edges of H) are adjacent if they share an endpoint in H.A line trigraph of a graph H is a trigraph G whose full realization is (isomorphic to) L(H), and all of whose triangles are strong.A trigraph G is said to be a line trigraph provided there is a graph H such that G is a line trigraph of H.

Stable sets in weighted trigraphs
In what follows, N is the set of non-negative integers.Given a trigraph G, we define A weight function for a trigraph G is any function w : D(G) → N that satisfies the following two properties: A weighted trigraph is an ordered pair (G, w) where G is a trigraph and w is a weight function for G.
Essentially, a weight function w assigns a non-negative integer weight w(u) to each vertex u of the trigraph G, and for each semi-adjacent pair uv, there are three non-negative integer weights associated with it, namely w(u, v), w(v, u), and w(uv), and these weights must satisfy max{w(u, v), w(v, u)} ≤ w(uv).If uv is a strongly adjacent or strongly antiadjacent pair, then we have w(u, v) = w(v, u) = w(uv) = 0. (Zero weights are assigned to strongly adjacent and strongly anti-adjacent pairs for the purposes of making calculations notationally simpler, but only vertices and semi-adjacent pairs actually "count.")Note that if a trigraph G is a semi-realization of a trigraph G ′ , then every weight function for G is also a weight function for G ′ (however, a weight function for G ′ need not be a weight function for G).
If (G, w) is a weighted trigraph, and H is an induced subtrigraph of G, then clearly, (H, w ↾ D(H)) is also a weighted trigraph; to simplify notation, we often write (H, w) instead of (H, w ↾ D(H)).
Given a weighted trigraph (G, w) and a set S ⊆ V (G), the weight of S with respect to (G, w), denoted by S (G,w) , is defined to be Note that if (G, w) is a weighted trigraph such that G has no semi-adjacent pairs (that is, such that G is a graph), then for all S ⊆ V (G), we have that S (G,w) = u∈S w(u).Thus, our definition of a weight of a set of vertices in a weighted trigraph indeed generalizes the usual notion of the weight of a set in a weighted graph.
It is easy to see that for all weighted trigraphs (G, w), all induced subtrigraphs H of G, and all sets S ⊆ V (H), we have that S (H,w) ≤ S (G,w) .
Strict inequality may hold because the weight of a set in a weighted trigraph depends not only on what is in the set, but also on what is outside of it.Furthermore, if (G, w) is a weighted trigraph and S 1 S 2 ⊆ V (G), there is in general no relationship between S 1 (G,w) and S 2 (G,w) , that is, any one of the following is possible: S 1 (G,w) < S 2 (G,w) , S 1 (G,w) = S 2 (G,w) , and S 1 (G,w) > S 2 (G,w) .
The stability number of a weighted trigraph (G, w), denoted by α(G, w), is defined to be Proof.Since w(u) ≥ 0 for all u ∈ V (G), we may assume that Z ⊆ S. Using the definition of S (G,w) and S Z (G,w) , we obtain the following: By the definition of a weight function, we have that w(uv) ≥ w(u, v) ≥ 0 for all distinct u, v ∈ V (G).The calculation above now implies that S (G,w) ≤ S Z (G,w) + u∈Z w(u), which is what we needed.Proposition 3.2.For all weighted trigraphs (G, w), there exists a stable set S of G such that S contains no zero-vertices of (G, w) and S (G,w) = α(G, w).
Proof.Fix a weighted trigraph (G, w) and a stable set S of G such that S (G,w) = α(G, w).Let Z be the set of all zero-vertices of G. Then S Z is a stable set of G that contains no zero vertices of G, and clearly, we have that S Z (G,w) ≤ α(G, w).On the other hand, Proposition 3.
w), and so S Z is the stable set that we needed.
The next two propositions (Propositions 3.3 and 3.4) are easy consequences of the appropriate definitions, and we leave their proofs as exercises for the reader.
(that is, adjacency and weights in (G, w) and (G ′ , w ′ ) are the same except possibly within C).
We now need a couple of definitions.If (G, w) is a weighted trigraph and R ⊆ V (G), the reduction of (G, w) to R, denoted by Red[G, w; R], is defined to be the weighted trigraph (G[R], w ′ ), where w ′ : D(G[R]) → N is given by: We remark that for all weighted trigraphs (G, w), we have that Red[G, w; V (G)] = (G, w) and Ext[G, w; V (G)] = 0, and consequently, 2 ) )) for all u ∈ S), the computation above yields and assume that S is a stable set of G.
Proof.By the definition of S (G,w) , we have that u∈S w(u) ≤ S (G,w) .We now compute: . This completes the argument.
Proposition 3.8.Let (G, w) be a weighted trigraph, and let = S (G,w) by Proposition 3.6 We then have the following: = S (G,w) by Proposition 3.6 w(u).This completes the argument.
Before stating our next proposition, we remind the reader that if G is a semi-realization of a trigraph G ′ , then every weight function for G is also a weight function for G ′ .In particular then, if (G, w) is a weighted trigraph, and G ′ is a trigraph obtained from G by possibly turning some strongly antiadjacent pairs of G into semi-adjacent pairs, then (G ′ , w) is also a weighted trigraph.Proposition 3.9.Let (G, w) be a weighted trigraph, and let (A, B, C) be a cut-partition of G.For each X ∈ {A, B}, let G X be a trigraph obtained from G[X ∪ C] by possibly turning some strongly anti-adjacent pairs of G[X ∪ C] into semi-adjacent pairs.For all Let k ∈ N and let w B be a weight function for G B that satisfies all the following: Proof.We begin by observing that for all X ∈ {A, B} and S ⊆ X ∪ C, we have that S is a stable set of G X if and only if S is a stable set of G[X ∪ C], and furthermore, for all Y ⊆ X ∪ C, we have that and S C = S ∩ C. We then have the following: This proves that α(G, w) .We now have that 0 , and consequently, α A∪S ′ C < α A∪S C , as we had claimed.Now, using Proposition 3.2, we fix a stable set . By Proposition 3.6, we have that Next, note the following: Thus, α A∪S C ≤ α A∪(S A ∩C) .Now, recall that for all S ′ C S C , we have that α A∪S ′ C < α A∪S C ; since (by the construction of S A ) we have that and since (A, B, C) is a cut-partition of G, we readily deduce that S is a stable set of G.We now compute: This completes the argument. Then , we observe that: This proves that w B is indeed a weight function for G B .Now, set k = 0. We see by inspection that w B satisfies the hypotheses of Proposition 3.9, and we deduce that α(G B , w B ) = α(G, w).This completes the argument.

Decomposition theorem
In this section, we state a decomposition theorem for {ISK4,wheel}-free trigraphs (see Theorem 4.1 below), and then we derive an "extreme" decomposition theorem for this class of graphs, which states (roughly) that every {ISK4,wheel}-free trigraph is either "basic" or admits a "decomposition" such that one of the "blocks of decomposition" is basic (see Theorem 4.8 and Corollary 4.9).Here, we state Theorem 4.1 without proof, but the interested reader can find a complete proof in [13].As explained in the Introduction, the proof of Theorem 4.1 closely follows the proof of the decomposition theorem for ISK4-free graphs from [12], but the proof of our theorem is easier because we restrict ourselves to the wheel-free case.Interestingly, the fact that we work with trigraphs rather than graphs does not make the proof significantly harder.Theorem 4.1.[13] Let G be an {ISK4,wheel}-free trigraph.Then at least one of the following holds: • G is a series-parallel trigraph; • G is a complete bipartite trigraph; • G is a line trigraph; • G admits a clique-cutset; • G admits a stable 2-cutset.
We remark that Lévêque, Maffray, and Trotignon [12] proved a graph analogue of Theorem 4.1.Their theorem had an additional outcome, namely, that G is a "long rich square."In fact, long rich squares are not wheel-free, and so this outcome is unnecessary (see [13] for details).Furthermore, the last outcome of the decomposition theorem for {ISK4,wheel}-free graphs from [12] is that the graph admits a proper 2-cutset.In the trigraph context, we work with stable 2-cutsets instead.
Let us say that G is a basic trigraph if G is either a series-parallel trigraph, a complete bipartite trigraph, or a line trigraph.Note that all induced subtrigraphs of a basic trigraph are basic trigraphs.
A good cut-partition of a trigraph G is a cut-partition (A, B, C) of G such that either Our goal for the remainder of the section is to derive an "extreme decomposition theorem" from Corollary 4.3 (see Theorem 4.8 and Corollary 4.9).
Given a good cut-partition (A, B, C) of a trigraph G, and given X ∈ {A, B}, we define the X-block of G with respect to (A, B, C) as follows: ] by making the two vertices of C semi-adjacent.
We remark that G X is well-defined because every good cut-partition is either of type clique or of type stable, but not both.We also remark that if (A, B, C) is of type stable and the two vertices of Proposition 4.4.Let (A, B, C) be a good cut-partition of an {ISK4,wheel}free trigraph G, and for each X ∈ {A, B}, let G X be the X-block of G with respect to (A, B, C).Then G A and G B are {ISK4,wheel}-free.
Proof.By symmetry, it suffices to show that G A is {ISK4,wheel}-free.We may assume that for otherwise, we are done.It now follows from the construction of G A that (A, B, C) is of type stable, and that the two vertices of C (call them c 1 and c 2 ) are strongly anti-adjacent in G.
Furthermore, G A is obtained from G[A ∪ C] by turning the strongly antiadjacent pair c 1 c 2 into a semi-adjacent pair.Let G A be some realization of and since G is {ISK4,wheel}-free, so is G A .So assume that c 1 c 2 is an edge of G A .Since (A, B, C) is a good cut-partition of G of type stable, we know that G[B ∪C] contains a narrow path P between c 1 and c 2 .Then some realization Since G is {ISK4,wheel}-free, so is H.Note that every subdivision of an ISK4 is an ISK4, and that every subdivision of a wheel contains either an induced wheel or an ISK4.Thus, if G A contained an ISK4 or an induced wheel, then all its subdivisions would also contain an ISK4 or an induced wheel.Since the {ISK4,wheel}-free graph H is a subdivision of G A , it follows that G A is an {ISK4,wheel}-free graph.This completes the argument.

Proposition 4.5.
There is an algorithm with the following specifications: • Input: a trigraph G; • Output: exactly one of the following: ).In this case, (V (A 1 ), t j=2 V (A j ), C i ) is a good cut-partition of G type clique, and the algorithm returns this cut-partition and stops.So assume that the algorithm determined that G contains no clique-cutsets of size at most three, and consequently, G admits not good cut-partition of type clique.(In particular then, G is connected and contains no cut-vertices.) We then form a list S 1 , . . ., S ℓ of all (not necessarily strong) stable sets of size two of G.There are at most n 2 such stable sets, and so this list can be formed in O(n 2 ) time.For each i ∈ {1, . . ., ℓ}, we can determine in time O(n 2 ) whether S i is a cutset of G f ; since there are O(n 2 ) sets in our list, testing the whole list takes O(n 4 ) time.If none of S 1 , . . ., S ℓ is a cutset of G f , then G contains no stable 2-cutsets; in this case, the returns the true statement that G admits no good cut-partition and stops.So assume that the algorithm determined that some S i from the list is a cutset of G f (and therefore of G); clearly, S i is a stable 2-cutset of G.We now find the components A 1 , . . ., A t (t ≥ 2) of G f S i , and using the fact that G is connected and admits no cut-vertex, we deduce that (V (A 1 ), t j=2 V (A j ), S i ) is a good cut-partition of G of type stable.The algorithm now returns this cut-partition and stops.
It is clear that the algorithm is correct, and that its running time is O(n 5 ).

Lemma 4.6.
There is an algorithm with the following specifications: • Input: a trigraph G and a good cut-partition (A, B, C) of G; • Output: either the true statement "the A-block of G with respect to (A, B, C) does not admit a good cut-partition," or a good cut-partition • Running time: O(n 5 ), where n = |V (G)|.
Proof.We first form G A , the A-block of G with respect to (A, B, C); this takes O(n 2 ) time.We then apply the algorithm from Proposition 4.5 to G A ; this takes O(n 5 ) time.If the algorithm from Proposition 4.5 returns the answer that G A admits no good cut-partition, then we are done.So assume that the algorithm from Proposition 4.5 returned a good cut-partition (A 1 , B 1 , C 1 ) of G A .By the construction of G A , we know that C is a clique of G A (indeed, C is either a strong clique of size at most three of G A , or a set of two semi-adjacent vertices of G A ), and consequently, either By symmetry, we may assume that The algorithm now returns the cut-partition (A 1 , B ∪ B 1 , C 1 ) and stops.
It is clear that the running time of the algorithm is O(n 5 ).To show that the algorithm is correct, we must show that (A ) is a good cutpartition of G, and furthermore, the good cut-partition (A 1 , B ∪ B 1 , C 1 ) of G is of the same type (type clique or type stable) as the good cut-partition we deduce from the construction of G A that (A, B, C) is a good cut-partition of G of type stable, and furthermore, that the two vertices of C (call them c and c ′ ) are strongly anti-adjacent in G and semi-adjacent in G A .Since (A 1 , B 1 , C 1 ) is a good cut-partition of G A of type stable, we know that C 1 is a stable set of G A (and consequently, a stable set of G) of size two; set C 1 = {c 1 , c ′ 1 }.Furthermore, the specifications of the algorithm from Proposition 4.5 guarantee that G A does not admit a good cut-partition of type clique (for otherwise, the algorithm from Proposition 4.5 would have returned such a cut-partition), and consequently, G A is connected and contains no cut-vertices.We also note that since ) is a good cut-partition of G A of type stable, we know that there is a narrow path P between c 1 and c by turning the strongly anti-adjacent pair cc ′ into a semi-adjacent pair.Thus, if P contains at most one of c and c ′ , then the narrow path P between c and c ′ is an induced subtrigraph of G[B ∪ B 1 ∪ C 1 ], and if P contains both c and is the narrow path obtained from P by replacing the semi-adjacent pair cc ′ by the narrow path Q).This completes the argument.

Lemma 4.7. There exists an algorithm with the following specifications:
• Input: a trigraph G; • Output: exactly one of the following: the true statement "G admits no good cut-partition"; -a good cut-partition (A, B, C) of G, and the true statement "the A-block of G with respect to (A, B, C) admits no good cut-partition"; • Running time: O(n 6 ), where n = |V (G)|. Proof.
Step 1.We first call the algorithm from Proposition 4.5 with input G; the running time of that algorithm is O(n 5 ).If the algorithm from Proposition 4.5 returns the answer that G admits no good cut-partition, then we are done.So assume that the algorithm from Proposition 4.5 returned a good cut-partition (A, B, C) of G.We now go to Step 2.
Step 2. We call the algorithm from Lemma 4.6 with input G and (A, B, C).If the algorithm from Lemma 4.6 returns the answer that the A-block of G with respect to (A, B, C) does not admit a good cut-partition, then we are done.So assume that the algorithm from Lemma 4.6 returned a good cut-partition , and we go back to Step 2.
Since the size of A ∪ C decreases after each call of Step 2, we make at most n recursive calls to Step 2 (and in particular, the algorithm terminates).Since the running time of the algorithm from Lemma 4.6 is O(n 5 ), we conclude that the running time of our algorithm is O(n 6 ).

Theorem 4.8. There exists an algorithm with the following specifications:
• Input: an {ISK4,wheel}-free trigraph G; • Output: exactly one of the following: the true statement "G is a basic trigraph"; -a good cut-partition (A, B, C) of G, and the true statement "the A-block of G with respect to (A, B, C) is a basic trigraph"; • Running time: O(n 6 ), where n = |V (G)|.
Proof.We call the algorithm from Lemma 4.7 with input G.If that algorithm returns the answer that G admits no good cut-partition, then our algorithm returns the answer that G is a basic trigraph and stops.On the other hand, if the algorithm from Lemma 4.7 returns a good cut-partition (A, B, C) of G and the statement that the A-block of G with respect to (A, B, C) admits no good cut-partition, then our algorithm stops and returns the good cut-partition (A, B, C) of G and the statement that the A-block of G with respect to (A, B, C) is a basic trigraph.Since the running time of the algorithm from Lemma 4.7 is O(n 6 ), the running time of our algorithm is also O(n 6 ).The correctness of our algorithm follows immediately from Corollary 4.3 and Proposition 4.4.
The following "extreme decomposition theorem" for {ISK4,wheel}-free trigraphs is an immediate corollary of Theorem 4.8.Corollary 4.9.Let G be an {ISK4,wheel}-free trigraph.Then either G is a basic trigraph, or G admits a good cut-partition (A, B, C) such that the A-block of G with respect to (A, B, C) is a basic trigraph.

A stability preserving transformation
We now describe a transformation on a weighted trigraph that preserves the stability number, while decreasing the number of semi-adjacent pairs.It is based on the gem, a graph G with five vertices such that one of them, say v, is adjacent to all the others and G v is isomorphic to the four-vertex path P 4 .
Let (G, w) be a weighted trigraph and let uv be a semi-adjacent pair in G.The weighted trigraph obtained from (G, w) by replacing uv with a gem is the weighted trigraph (G ′ , w ′ ) defined as follows: are pairwise distinct and do not belong to V (G).
• The adjacency function is , defined as follows: x uv ] is a graph isomorphic to a gem.) • The weight function w ′ : D(G ′ ) → N is defined as follows: - It is immediate to see that (G ′ , w ′ ) is indeed a weighted trigraph, that is, that w ′ is a weight function of G ′ .The importance of the above transformation stems from the fact that it preserves the stability number, a fact which we now prove.Proposition 5.1.Let uv be a semi-adjacent pair in a weighted trigraph (G, w) and let (G ′ , w ′ ) be the weighted trigraph obtained from (G, w) by replacing uv with a gem.Then, α(G ′ , w ′ ) = α(G, w).
Proof.Let x uv , x v,u , x u,v be the three vertices in V (G ′ ) V (G) labeled as in the definition of the operation of replacing a semi-adjacent pair with a gem.
We split the proof of the equality α(G ′ , w ′ ) = α(G, w) into two parts.First, we show that α(G, w) ≤ α(G ′ , w ′ ).Let S ∈ V (G) be a stable set of G such that S (G,w) = α(G, w).We consider three cases depending on the number of vertices in S ∩ {u, v}.In each case, we exhibit a stable set S ′ of G ′ such that S ′ (G ′ ,w ′ ) = S (G,w) .This is enough, for then we obtain that α(G, w) = S (G,w) = S ′ (G ′ ,w ′ ) ≤ α(G ′ , w ′ ), which is what we need.If |S ∩ {u, v}| = 0, then the set S ′ = S ∪ {x uv } is a stable set of G ′ .Its weight with respect to (G ′ , w ′ ) is If |S ∩ {u, v}| = 1, then we may assume without loss of generality that S ∩ {u, v} = {u}.The set Finally, suppose that |S ∩ {u, v}| = 2, that is, {u, v} ⊆ S. In this case, S ′ = S itself is a stable set of G ′ .It is immediate to verify that its weight with respect to (G ′ , w ′ ) is the same as its weight with respect to (G, w).
We now prove the reverse inequality, that is, we show that α(G ′ , w Up to symmetry, it suffices to analyze four cases depending on the intersection of S ′ with the vertex set of the gem, that is, depending on the set X = S ′ ∩ {u, v, x uv , x v,u , x u,v }.These four cases are: Indeed, if X = ∅, then we can replace S ′ with S ′ ∪ {x uv } to obtain a set with . Each of the remaining cases for X either results in a non-stable set, or is symmetric to one of the four cases above.In each case, we exhibit a stable set S of G such that S (G,w) = S ′ (G ′ ,w ′ ) .This is enough because we then obtain which is what we need.Case 1. X = {x uv }.The set S = S ′ {x uv } is a stable set of G. Its weight with respect to (G, w) is Case 2. X = {x v,u }.
In this case, the set S ′′ = (S ′ {x v,u }) ∪ {x uv } is also a stable set of G ′ .Since w(uv) ≥ w(v, u), and since neither x uv nor x v,u is an endpoint of a semi-adjacent pair of G ′ , we have that , and consequently S ′′ (G ′ ,w ′ ) = α(G ′ , w ′ ).Therefore, this case reduces to Case 1. Case 3. X = {u, x u,v }.
The set S = S ′ {x u,v } is a stable set of G. Its weight with respect to (G, w) is Case 4. X = {u, v}.
The set S = S ′ itself is a stable set of G.It is immediate to verify that its weight with respect to (G, w) is the same as its weight with respect to (G ′ , w ′ ).
This completes the argument.

Computing the stability number of basic weighted trigraphs
We remind the reader a basic trigraph is a trigraph G that is either a series-parallel trigraph, a complete bipartite trigraph, or a line trigraph.
Theorem 6.1.There exists an algorithm with the following specifications: • Input: a weighted basic trigraph (G, w); • Output: α(G, w); Proof.Let (G, w) be a weighted basic trigraph.Then, G is either (i) a seriesparallel trigraph, (ii) a complete bipartite trigraph, or (iii) a line trigraph.Testing (i) can be done by computing in O(n 2 ) time the full realization G f of G, and testing whether G f is series-parallel, which can be done in time [18].
Testing (ii) can be done in time O(n 2 ) by first testing if G is a graph (that is, if its adjacency function only takes values 1 and −1), and then testing in O(n 2 ) time (for example, using breadth-first search) if G is a complete bipartite graph.Thus, it can be determined in time O(n 2 ) whether (i), (ii), or neither of these two cases occurs.If neither (i) nor (ii) occurs, then (iii) must occur.
We now discuss how to compute the stability number of (G, w) in each of the three cases.
Case 1. G is a series-parallel trigraph.Let (G ′ , w ′ ) be the weighted trigraph obtained from (G, w) by replacing each semi-adjacent pair of G (in any order) with a gem.Since each replacement of a semi-adjacent pair with a gem removes one semi-adjacent pair and produces no new ones, the resulting trigraph G ′ has no semi-adjacent pairs, that is, it is a graph.Clearly, |V (G ′ )| = O(n 2 ).Moreover, since G ′ has exactly one edge for each strongly adjacent pair of G, exactly seven edges for each semi-adjacent pair of G, and no other edges, we also have that Since G is a series-parallel trigraph, its full realization G f is a seriesparallel graph.Note that G ′ is isomorphic to the graph G ′′ obtained from G f by replacing each edge uv ∈ E(G f ) that forms a semi-adjacent pair in G with a gem with vertex set {u, x v,u , x u,v , v, x uv } and edge set For a graph H, let us denote by tw(H) its treewidth.We claim that the treewidth of G ′′ (and consequently that of G ′ ) is at most three.To this end, it suffices to prove the following.
Claim: Let H be a graph and let H 1 be a graph obtained from H by replacing an edge uv ∈ E(H) with a gem with vertex set {u, x v,u , x u,v , v, x uv } and edge set {ux v,u , x v,u x u,v , x u,v v, x uv u, x uv x v,u , x uv x u,v , x uv v}.Then, tw(H 1 ) ≤ max{tw(H), 3}.This is indeed enough.Since series-parallel graphs are of treewidth at most two [5], G f is of treewidth at most two.Applying the claim repeatedly to each of the graphs in the sequence of graphs transforming G f to G ′′ (by replacing one edge at a time with a gem) implies that tw(G ′ ) ≤ max{tw(G f ), 3} = 3.

Proof of Claim:
Recall that a graph K = (V, E) is chordal if every cycle in it of length at least four has a chord, and that ω(K) denotes the clique number of K, that is, the maximum size of a clique in K.Moreover, the treewidth of K equals the minimum value of ω(K ′ )−1 over all chordal graphs of the form K ′ = (V, E ′ ) where E ⊆ E ′ (see, e.g., [5,Theorem 11.1.4]).
Let H ′ be a chordal supergraph of H such that tw(H) = ω(H ′ )−1.Then, the graph . We have shown that the treewidth of G ′ is at most three.It follows that the stability number of (G ′ , w ′ ), and hence that of (G, w), can be computed ), e.g., by first computing a tree-decomposition of G ′ of width at most three [4] and then applying a dynamic programming algorithm along the tree decomposition [3].Case 3. G is a line trigraph.We apply a transformation similar to the one from Case 1. Namely, let (G ′ , w ′ ) be the weighted trigraph obtained from (G, w) by replacing each semi-adjacent pair of G (in any order) with a gem.Again, we have that the resulting trigraph G ′ has no semi-adjacent pairs, that is, that G ′ is a graph, and that Claim: Let (H, w) be a weighted line trigraph, let uv be a semi-adjacent pair in H, and let (H ′ , w ′ ) be the trigraph obtained from (H, w) by replacing uv with a gem.Then, H ′ is also a line trigraph.
Proof of Claim: Suppose that H is a line trigraph of a graph K.This means that the full realization H f of H is the line graph of K and all the triangles of H are strong.Vertices u and v are adjacent in H f , and so they correspond to a pair of adjacent edges, say ab and bc, respectively, in K. Since every triangle in H is strong, the edge uv ∈ E(H f ) is not part of any triangle in H f .This implies that b is a vertex of degree two in K, and ac ∈ E(K).Let K ′ be the graph defined as follows: V (K ′ ) = (V (K) {b}) ∪ {d, e, f } and E(K ′ ) = (E(K) {ab, bc}) ∪ {ad, de, ec, df, ef }.Then, the line graph of K ′ is isomorphic to the full realization of H ′ .Moreover, all the triangles of H ′ are strong.Therefore, H ′ is a line trigraph.
Applying the above claim repeatedly to each of the trigraphs in the sequence of trigraphs transforming (G, w) to (G ′ , w ′ ) implies that G ′ is a line trigraph.Since G ′ is in fact a graph, it is a line graph.Since the operation of replacing a semi-adjacent pair with a gem preserves the stability number (by Proposition 5.1), we have that α(G, w) = α(G ′ , w ′ ).
It is therefore enough to compute the stability number of the weighted line graph (G ′ , w ′ ).This can be done as follows.First, compute a graph [15].Second, solve the instance of the maximum weight matching problem on H ′ with edge weights corresponding to vertex weights in G ′ .This can be done in time )) using the algorithm by Gabow [10].
The time complexity of the whole algorithm in Case 3 is dominated by the This completes the description of the algorithm for Case 3.
The running time O(n 4 log n) of Case 3 dominates the running time of each of the other steps of the algorithm.This completes the proof.
7 Computing the stability number of {ISK4,wheel}free weighted trigraphs We now derive the main result of the paper: a polynomial-time algorithm that finds the stability number of a weighted {ISK4,wheel}-free trigraph.We remark that since every weighted {ISK4,wheel}-free graph (with nonnegative integer weights) is a weighted {ISK4,wheel}-free trigraph, this algorithm can be used to compute the stability number of a weighted {ISK4,wheel}-free graph (and this is, in fact, the main purpose of our algorithm).
Theorem 7.1.There exists an algorithm with the following specifications: • Input: a weighted {ISK4,wheel}-free trigraph (G, w); Suppose now that the algorithm returned a good cut-partition (A, B, C) of G such that the A-block of G with respect to (A, B, C) is a basic trigraph.For X ∈ {A, B}, let G X be the X-block of G with respect to (A, B, C).Since (A, B, C) is a good cut-partition of G, we know that |C| ≤ 3, and so it can be determined in O(1) time whether (A, B, C) is of type clique or of type stable.We now analyze the two cases.As there are at most n−1 recursive calls and the remaining computations take O(n 6 ) time, the overall running time of the algorithm is O(n 7 ).
As an immediate corollary of Theorem 7.1 and Proposition 1.1, we obtain the following result.

Corollary 7.2. There exists an algorithm with the following specifications:
• Input: a weighted {ISK4,wheel}-free graph (G, w) with non-negative integer weights; • Output: a maximum weight stable set S of (G, w); • Running time: O(n 8 ) where n = |V (G)|.
We remark that the algorithm from Corollary 7.2 cannot readily be generalized to trigraphs.One reason for this is that in the graph case, one can always find a maximum weight stable set that is also an inclusion-wise maximal stable set (and this fact is implicitly used in the proof of Proposition 1.1), whereas this is not the case for trigraphs.We believe that one could use techniques similar to the ones from Section 3 in order to generalize Corollary 7.2 to trigraphs.However, our main interest here is in graphs, and we used trigraphs only as a tool for obtaining algorithms for graphs; for this reason, we did not attempt to construct an algorithm for trigraphs analogous to the one given by Corollary 7.2.

Bipartite trigraphs
As stated in the Introduction, computing the stability number of a weighted bipartite trigraph is NP-hard.We now prove this result.
Theorem 8.1.The problem of computing the stability number of a weighted bipartite trigraph is NP-hard.
Proof.Suppose there is a polynomial-time algorithm A for the problem.We prove the theorem by using A as a subroutine to compute the stability number of a general graph in polynomial time.
Let H be an arbitrary graph, and let n = |V (H)| and m = |E(H)|.The idea is as follows.We build a bipartite trigraph G by first subdividing each edge of H once, and then turning all edges of the resulting graph into semiadjacent pairs.(Thus, |V (G)| = n + m.)We construct a weight function w for G such that α(G, w) = α(H) + 2m.We can use A to find α(G, w), and because α(G, w) = α(H) + 2m, we deduce that α(H) can be found in polynomial time.Now, describing the weight function w is bit complicated because if uv is an edge of H, the weights assigned to the two semi-adjacent pairs of G that correspond to uv are not symmetric between u and v. So, in order to properly define the weight function w, we must first introduce some more notation.
First, let H = (V ( H), A( H )) be any orientation of H (in other words, H is a digraph that satisfies V ( H) = V (H), for each edge uv ∈ E(H), exactly one of the arcs uv and vu belongs to A( H), and A( H) contains no other arcs).For each uv ∈ A( H), we introduce a new vertex x uv , and we set X = {x uv | uv ∈ A( H)}.We now let G be the bipartite trigraph with bipartition (X, V (H)) in which for all uv ∈ A(H), vertex x uv is semi-adjacent to u and v and strongly anti-adjacent to all other vertices of V (H).(Thus, each arc uv of H effectively gets replaced by a narrow path u − x uv − v.) We remark that G contains no strongly adjacent pairs, and so all subsets of V (G) are stable sets of G.
Since S ′ G is a stable set of G (because G contains no strongly adjacent pairs), we deduce that S ′ G (G,w) = α(G, w).Thus, S ′ G indeed contradicts the minimality of S G .This completes the argument.

Proposition 3 . 5 . 2 )
There is an algorithm with the following specifications:• Input: a weighted trigraph (G, w) and a set R ⊆ V (G); • Output: Red[G, w; R] and Ext[G, w; R]; • Running time: O(n 2 ), where n = |V (G)|.Proof.Clearly, the trigraph G[R] can be computed in time O(n 2 ).Similarly, the quantity uv∈( V (G) R w(uv) can be found in time O(n 2 ).Further, for each vertex u ∈ R, the quantities v∈V (G) R w(uv) and max{w(u) − v∈V (G) R (w(uv) − w(u, v)), 0} can be found in O(n) time.Since R contains at most n vertices, the result follows.Proposition 3.6.Let (G, w) be a weighted trigraph, and let w).Using Proposition 3.2, we fix a stable set S B of G B that contains no zero-vertices of G B and satisfies S B (G B ,w B ) = α(G B , w B ); we may assume that S B was chosen inclusionminimal with this property, that is, that for all S ′ B S B , we have that S ′ B (G B ,w B ) < α(G B , w B ). Set S C = S B ∩ C. Let us first check that for all S ′ C S C , we have that α A∪S ′ C < α A∪S C .Fix S ′ C S C , and set S ′ B = (S B C) ∪ S ′ C .By the minimality of S B , we have that S ′ B (G B ,w B ) < S B (G B ,w B ) .Since w B is a weight function for G B , we know that w B (u, v) ≤ w B (uv) for all uv ∈ B∪C 2

Lemma 3 . 10 .
Let (G, w) be a weighted trigraph, let C be a clique-cutset of G, and let (A, B, C) be an associated cut-partition of G.Set G A = G[A ∪ C] and G B = G[B ∪ C].For each C ′ ⊆ C, set α A∪C ′ = α(Red[G A , w; A ∪ C ′ ]) + Ext[G A , w; A∪C ′ ].Define w B : D(G B ) → N by setting w B (c) = α A∪{c} −α A for all c ∈ C, and w B ↾ (D(G B ) C) = w ↾ (D(G B ) C). Then w B is a weight function for G B , and α(G, w) = α A + α(G B , w B ).Proof.By Proposition 3.8, we have that w B (c) ≥ 0 for all c ∈ C, and it follows immediately that w B is a weight function for G B .Now, set k = α A .Using the fact that C is a strong clique of G B , we observe that the weight function w B for G B satisfies the hypotheses of Proposition 3.9, and we deduce that α(G, w) = α A + α(G B , w B ). Lemma 3.11.Let (G, w) be a weighted trigraph and let (A, B, C) be a cutpartition of G such that C is a stable set of size two of G. Set C = {c 1 , c 2 }.For each X ∈ {A, B}, let G X be the trigraph on the vertex set X ∪ C in which c 1 c 2 is a semi-adjacent pair and all other adjacencies are inherited from G[X ∪ C].For each

Case 2 .
G is a complete bipartite trigraph.In this case, G is a graph and all nonzero weights w(p) > 0 for p ∈ D(G) appear on its vertices.Thus, if (A, B) is a bipartition of G, we have that α(G, w) = max a∈A w(a), b∈B w(b) .It follows that in this case the stability number can be computed in time O(n) (to compute A and B, choose v ∈ V (G) arbitrarily, and take A = N (v) and B = V (G) A, where N (v) is the set of all neighbors of v in G).

••
Output: α(G, w); Running time: O(n 7 ) where n = |V (G)|.Proof.Let (G, w) be the input {ISK4,wheel}-free trigraph with n = |V (G)|.We first call the O(n 6 ) time algorithm from Theorem 4.8 with input G.This algorithm either returns the statement that G is a basic trigraph, or returns a good cut-partition (A, B, C) of G such that the A-block of G with respect to (A, B, C) is a basic trigraph.If the algorithm returns the statement that G is a basic trigraph, then we apply Theorem 6.1 and compute α(G, w) in time O(n 4 log n).

Case 1 .
The good cut-partition (A, B, C) of G is of type clique.In this case, we have G X = G[X ∪ C] for X ∈ {A, B}.For each of the 2 |C| = O(1) sets of the form C ′ ⊆ C, compute the weighted trigraph Red[G A , w; A ∪ C ′ ] and the quantity Ext[G A , w; A ∪ C ′ ].By Proposition 3.5, this can be done in time O(n 2 ).Note that each of the reductions Red[G A , w; A∪C ′ ] is a weighted induced subtrigraph of a basic trigraph (namely, G A with an appropriate weight function), and so Red[G A , w; A ∪ C ′ ] is a basic trigraph.Therefore, by Theorem 6.1, for each C ′ ⊆ C, the stability number of Red[G A , w; A ∪ C ′ ] can be computed in time O(n 4 log n).For each C ′ ⊆ C, setα A∪C ′ = α(Red[G A , w; A ∪ C ′ ]) + Ext[G A , w; A ∪ C ′ ].Define w B : D(G B ) → N by setting w B (c) = α A∪{c} − α A for all c ∈ C,and w B ↾ (D(G B ) C) = w ↾ (D(G B ) C).By Lemma 3.10, w B is a weight function for G B .Call the algorithm recursively on the weighted trigraph (G B , w B ) to compute α(G B , w B ).By Lemma 3.10, the stability number (G, w) is given by α(G, w) = α A + α(G B , w B ).

Case 2 .
The good cut-partition (A, B, C) of G is of type stable.In this case, C is a stable set of G of size two, and G X (for X ∈ {A, B}) is the trigraph obtained from G[X ∪C] by making the two vertices of C semiadjacent.We proceed similarly as in Case 1, using Lemma 3.11 instead of Lemma 3.10.For each of the 2 |C| = O(1) sets of the form C ′ ⊆ C, we use Proposition 3.5 and Theorem 6.1 to compute the trigraph Red[G A , w; A ∪ C ′ ] and the value αA∪C ′ = α(Red[G A , w; A ∪ C ′ ]) + Ext[G A , w; A ∪ C ′ ].We then compute in O(n 2 ) time the mapping w B : D(G B ) → N defined as in Lemma 3.11, and we call the algorithm recursively on the weighted trigraph (G B , w B ).By Lemma 3.11, the stability number of (G, w) is given by α(G, w) = α(G B , w B ).This completes the description of the algorithm for Case 2.

Clearly, w
is a weight function for G, and by assumption, we can find α(G, w) in polynomial time.(Since |V (G)| = n + m, the running time is in fact polynomial in n.)We claim that α(G, w) = α(H) + 2m.This is enough, for then we can clearly compute α(H) in polynomial time.We now need some more notation.For each uv ∈ A( H) andS ⊆ V (G), set cont( uv; S) = S ∩ {u, x uv , v} (G[u,x uv ,v],w) − x∈S∩{u,v} w(x).We refer to cont( uv; S) as the contribution of the arc uv to the weight of S with respect to (G, w).Clearly, for all S ⊆ V (G), we have thatS (G,w) = x∈S∩V (H) w(x) +uv∈A( H) cont( uv; S) = |S ∩ V (H)| + uv∈A( H) cont( uv; S).

Furthermore, we see
by inspection that for all uv ∈ A(H) and S ⊆ V (G), we have that cont( uv; S) =                           1 if either S ∩ {u, x uv , v} = {u,x uv , v} or S ∩ {u, x uv , v} = {x uv , v} or S ∩ {u, x uv , v} = {u, v} or S ∩ {u, x uv , v} = {u} 2 if either S ∩ {u, x uv , v} = {u, x uv } or S ∩ {u, x uv , v} = {v} or S ∩ {u, x uv , v} = {x uv } or S ∩ {u, x uv , v} = ∅ In particular then, 1 ≤ cont( uv; S) ≤ 2 for all uv ∈ A( H) and S ⊆ V (H).We can now show that α(H) + 2m ≤ α(G, w).Let S H be a stable set of H such that |S H | = α(H).Since S H is a stable set of H, we know that|S H ∩ {u, v}| ≤ 1 for all uv ∈ A( H).Now, let Y = {x uv | uv ∈ A( H), u ∈ S H },and set S G = S H ∪Y .By construction, for all uv ∈ A( H), we have that S G ∩ {u, x uv , v} ∈ {{u, x uv }, {v}, ∅}, and consequently, cont( uv; S G ) = 2. Since |A( H)| = m, and since S G is a stable set of G (because G contains no strongly adjacent pairs), it now follows that α(H) + 2m = |S H | + uv∈A( H) cont( uv; S G ) = S G (G,w) ≤ α(G, w).
and it follows thatS ′ G (G,w) = |S ′ G ∩ V (H)| + uv∈A( H) cont( uv; S ′ G ) ≥ (|S G ∩ V (H)| − 1) + (1 + uv∈A( H) cont( uv; S G )) = |S G ∩ V (H)| + uv∈A( H) cont( uv; S G ) = S G (G,w) w B is a weight function for G B , and α(G B , w B ) = α(G, w).Proof.We first show that w B is a weight function for G B .It suffices to show that w B (c 1 ), w B (c 1 , c 2 ), w B (c 2 , c 1 ) ≥ 0 and that w B (c 1 , c 2 ), w B (c 2 , c 1 ) ≤ w B (c 1 c 2 ), for w B clearly satisfies all the other conditions from the definition of a weight function.The fact that w B (c 1 ), w B (c 2 , c 1 ) ≥ 0 follows immediately from Proposition 3.7.Next, Proposition 3.8 guarantees that α A∪C ≤ α A∪{c 1 } + w(c 2 ), which immediately implies that w B (c 1 , c 2 ) ≥ 0. Similarly, Proposition 3.8 guarantees that α A∪{c 2 Clearly, (b) implies (a).For the reverse, we suppose that G admits a clique-cutset or a stable 2-cutset, and we show that G admits a good cutpartition.If G admits a clique-cutset, then let C be a clique-cutset of G, and otherwise, let C be a stable 2-cutset of G. Let (A, B, C) be any cut-partition of G induced by C. If C is a clique-cutset, then since G is ISK4-free, we see that |C| ≤ 3, and it follows that (A, B, C) is a good cut-partition of G of type clique.So assume that C is a stable 2-cutset.(Note that this means that G admits no clique-cutset, and in particular, G is connected and contains no cut-vertices.)Set C = {c 1 , c 2 }.We claim that (A, B, C) is a good cut-partition of G of type stable.To prove this, we must only show that each of G[A ∪ C] and G[B ∪ C] contains a narrow path between c 1 and c 2 .By symmetry, it suffices to show that G[A ∪ C] contains a narrow path between c 1 and c 2 .Let A 1 be the vertex set of a component of G[A].
in this case, (A, B, C) is said to be a good cut-partition of type clique), or• C is a stable 2-cutset of G,and each of G[A∪C] and G[B ∪C] contains a narrow path between the two vertices of C (in this case, (A, B, C) is said to be a good cut-partition of type stable).Vertex c 1 must have a neighbor in A 1 , for otherwise, c 2 would be a cutvertex of G; similarly, vertex c 2 has a neighbor in A 1 .Thus, G[A 1 ∪ {c 1 , c 2 }] is connected, and it follows that G[A 1 ∪ {c 1 , c 2 }] (and consequently G[A ∪ C] as well) contains a narrow path between c 1 and c 2 .Thus, (A, B, C) is a good cut-partition of G of type stable.This completes the argument.Theorem 4.1 and Proposition 4.2 immediately imply the following.Corollary 4.3.Let G be an {ISK4,wheel}-free trigraph.Then either G is a basic trigraph, or G admits a good cut-partition.
such cliques, and the list C 1 , . . ., C k can be found in time O(n 3 ).For each i ∈ {1, . . ., k}, we can determine in time O(n 2 ) whether C i is a cutset of G f ; since we are testing O(n 3 ) cliques, we can determine whether G has a clique-cutset of size at most three in O(n 5 ) time.If we determined that some C i from the list is a cutset of G f (and therefore of G), then we can find the components A 1 , . . ., A t (t ≥ 2) of G C i in time O(n 2 type clique, together with the true statement "(A, B, C) is a good cut-partition of G of type clique"; -a good cut-partition (A, B, C) of G of type stable, together with the true statement "(A, B, C) is a good cut-partition of G of type stable, and G does not admit a good cut-partition of type clique"; -the true statement "G does not admit a good cut-partition"; • Running time: O(n 5 ), where n = |V (G)|.Proof.Let G f be the full realization of G; clearly, G f can be constructed in O(n 2 ) time.We first form a list C 1 , . . ., C k of all (possibly empty) strong cliques of G of size at most three; there are at most n