Graphs with equal domination and covering numbers

A dominating set of a graph $G$ is a set $D\subseteq V_G$ such that every vertex in $V_G-D$ is adjacent to at least one vertex in $D$, and the domination number $\gamma(G)$ of $G$ is the minimum cardinality of a dominating set of $G$. A set $C\subseteq V_G$ is a covering set of $G$ if every edge of $G$ has at least one vertex in $C$. The covering number $\beta(G)$ of $G$ is the minimum cardinality of a covering set of $G$. The set of connected graphs $G$ for which $\gamma(G)=\beta(G)$ is denoted by ${\cal C}_{\gamma=\beta}$, while ${\cal B}$ denotes the set of all connected bipartite graphs in which the domination number is equal to the cardinality of the smaller partite set. In this paper, we provide alternative characterizations of graphs belonging to ${\cal C}_{\gamma=\beta}$ and ${\cal B}$. Next, we present a quadratic time algorithm for recognizing bipartite graphs belonging to ${\cal B}$, and, as a side result, we conclude that the algorithm of Arumugam et al. [2] allows to recognize all the graphs belonging to the set ${\cal C}_{\gamma=\beta}$ in quadratic time either. Finally, we consider the related problem of patrolling grids with mobile guards, and show that this problem can be solved in $O(n \log n + m)$ time, where $n$ is the number of line segments of the input grid and $m$ is the number of its intersection points.


Introduction and notation
In this paper, we follow the notation of [6]. Let G = (V G , E G ) be a graph with vertex set V G and edge set E G . For a vertex v of G, its neighborhood , denoted by N G (v), is the set of all vertices adjacent to v, and the cardinality of N G (v), denoted by deg G (v), is called the degree of v. The minimum degree of a vertex in G is denoted by δ(G). A leaf is a vertex of degree one, while a support vertex (or support, for short) is a vertex adjacent to a leaf. A weak support is a vertex adjacent to exactly one leaf. The set of leaves and supports of a graph G is denoted by L G and S G , respectively. The closed neighborhood of v, denoted by N G [v], is the set N G (v) ∪ {v}. In general, the neighborhood of X, denoted by N G (X), 2 Alternative characterization of the set C γ=β In our characterizations of the graphs belonging to the set C γ=β or B we use the following Gallai's theorem which relates the cardinality of the largest independent set and the cardinality of the smallest covering set in a graph. Lemma 1. [11] If G is a graph, then α(G) + β(G) = |V G |.
We now present a characterization of the graphs belonging to the set C γ=β and give a self-contained proof of this characterization. (1) Each support vertex of G belonging to I is a weak support and each of its non-leaf neighbors is a support.
(2) If vu is an edge of the graph G − I, then both vertices v and u are supports in G. To prove this, it suffices to show that every vertex y ∈ V G − J ′′ has a neighbor in J ′′ . This is obvious if y ∈ {v ′ , x} ∪ (I − N G (x)). Thus assume that y ∈ N G (x) ∩ I. In this case we have N G (y) ∩ (J − {v ′ , x}) = ∅ (as N G (y) ⊆ J − {v ′ } and |N G (y)| ≥ 2) and therefore N G (y) ∩ J ′′ = ∅. Consequently, J ′′ is a dominating set of G, but this contradicts the minimality of J as |J ′′ | < |J| = γ(G). This completes the proof of (1). To prove (2), let us consider an edge vu of G−I. From the fact that I is an α-set of G it follows immediately that {v, u} ∩ L G = ∅. It remains to prove that {v, u} ⊆ S G . Suppose to the contrary that v ∈ S G or u ∈ S G , say v ∈ S G . In this case we claim that J − {v} is a dominating set of G. To observe this, it suffices to show that . Thus assume that y ∈ I − N G (v). In this case y ∈ I = V G − J and y ∈ N G (v), and therefore, N G (y) ∩ J = ∅ (since J is a dominating set of G) and v ∈ N G (y). Consequently, N G (y) ∩ (J − {v}) = ∅. Finally assume that y ∈ N G (v) ∩ I. Then N G (y) ⊆ J (since I is independent), |N G (y)| ≥ 2 (as y ∈ L G ), and consequently, N G (y) ∩ (J − {v}) = ∅. This proves that J − {v} is a dominating set of G, contrary to the minimality of J. This finishes the proof of (2).
To prove the condition (3), let x and y be vertices belonging to J − (L G ∪ S G ) and such that deg This proves the condition (3).
Assume now that the conditions (1)-(3) are satisfied. We claim that γ(G) = |J|, where J = V G − I. Suppose to the contrary that γ(G) < |J|. Let D be a γ-set of G with |D ∩ J| as large as possible. We get a contradiction in the three possible cases: Then vu is an edge in G − I and therefore v ∈ S G (by the condition (2)). Thus the set Case 2. If D ⊆ I, then D = I (as I is independent and no proper subset of I dominates all vertices in I). The set J also is independent as otherwise the set S G ∩ J would be non-empty (by the condition (2)) and it would be a subset of D (by the choice of D), which is impossible (as D and J are disjoint). Consequently, G is a bipartite graph and the sets I = D and J form a bipartition of V G into independent sets, and Case 3. Finally assume that D ∩ J = ∅ and D ∩ I = ∅. In this case, from the supposition |J| > γ(G) = |D|, it follows that |J − D| > |I ∩ D| ≥ 1. Now the choice of D, the maximality of I, and the condition (2) imply that each vertex belonging to J − D has a neighbor in I ∩ D. Therefore the pigeonhole principle implies that there are two vertices x and y in J − D which are adjacent to the same vertex in I ∩ D. Since N G (I ∩ L G ) ⊂ D (by the choice of D) as well as J ∩ L G ⊂ D (by (1) and the choice of D), the vertices x and y belong to J − (L G ∪ S G ). Therefore, by (3), there exist vertices x and y in I for which N G (x) = N G (y) = {x, y}. Furthermore, the vertices x and y belong to I ∩ D (as otherwise x and y would not be dominated by D). Now the set D ′ = (D − {x, y}) ∪ {x, y} is a dominating set of G, which is impossible as |D ′ | = |D| and |D ′ ∩ J| > |D ∩ J|. This proves that γ(G) = |J| and implies that γ(G) = β(G) as |J| = |V G | − |I| = |V G | − α(G) = β(G) (by Lemma 1).
From Theorem 2 we have the following two immediate corollaries. Corollary 4. [12,25] If a graph G belongs to the set C γ=β and δ(G) = 2, then G is a bipartite graph. Fig. 1 shows a graph G belonging to the set C γ=β . In this case the solid vertices form an α-set I of G, while V G − I is a γ-and β-set of G. Certainly, I satisfies the conditions (1)-(3) of Theorem 2. On the other hand the graph F shown in Fig. 1 does not belong to the set C γ=β , as γ(F ) = 2, while β(F ) = 3. Thus, no α-set I of F satisfies all three conditions (1)-(3) of Theorem 2. It is easy to check that the sets I 1 = {v 2 , v 4 , v 6 }, Figure 1: Graphs G and F , where G ∈ C γ=β , while F ∈ C γ=β .

Bipartite graphs with the largest domination number
It is obvious that if G = ((A, B), E G ) is a bipartite graph, then each of the sets A and B is dominating in G and therefore γ(G) ≤ min{|A|, |B|}. Here we study graphs G = ((A, B), E G ) for which the equality γ(G) = min{|A|, |B|} holds, that is, we study graphs belonging to the set B of bipartite graphs in which the domination number is equal to the cardinality of the smaller partite set. Such graphs were studied in [12] and [25]. Our characterization given in the next theorem is similar but different from those in [12,25] (see Theorems 3.6 and 4.1 in [12], and Theorems 3.3 and 3.4 in [25]). Recently Miotk et al. [20] observed that the graphs belonging to the set B can also be characterized in terms of some graph operations. (1) γ(G) = |A|.
(3) G has the following two properties: (a) Each support vertex of G belonging to B is a weak support and each of its non-leaf neighbors is a support. Proof. Assume first that γ(G) = |A|. We claim that then α(G) = |B| and β(G) = |A|. It is obvious that α(G) ≥ |B| (as B is independent in G). Thus, it suffices to prove that α(G) ≤ |B|. Suppose to the contrary that α(G) > |B|, and let I be an α-set of G. Then |I| = α(G) > |B|, V G − I is a dominating set of G, and therefore γ(G) ≤ |V G − I| = |V G | − |I| < |V G | − |B| = |A| = γ(G), a contradiction. Thus, α(G) = |B| and B is an α-set of G. From the equality α(G) = |B| and from Lemma 1 it follows that β(G) = |A|.
Assume now that G has the properties (a) and (b) of the statement (3). In a standard way (as in [12,25]), we prove that γ(G) = |A|. Since A is a dominating set of G, we have γ(G) ≤ |A|, and, therefore, it suffices to show that γ(G) ≥ |A|. Suppose to the contrary that γ(G) < |A|. Let D be a γ-set of G with |D ∩ A| as large as possible.
Since |A − D| > |D ∩ B| ≥ 1 and since each vertex in A − D has a neighbor in D ∩ B, the pigeonhole principle implies that there are two vertices x and y in A − D which are adjacent to the same vertex in D ∩ B. Since N G (B ∩ L G ) ⊂ D (by the choice of D) as well as A ∩ L G ⊂ D (by (a) and the choice of D), the vertices x and y belong to The vertices x and y belong to D∩B (as otherwise x and y would not be dominated by D).
As an immediate consequence of Theorem 5 and its proof, we have the following results.
(3) T has the following two properties: The corona F • K 1 of a graph F is the graph formed from F by adding a new vertex v ′ and edge vv ′ for each vertex v of F . A graph G is said to be a corona graph if G = F • K 1 for some graph F . We note that a graph G is a corona graph if and only if each vertex of G is a leaf or it is adjacent to exactly one leaf of G, and consequently every corona graph belongs to the set C γ=β . Payan and Xuong [22], and Fink et al. [10] have proved that for a connected graph G of even order is γ(G) = |V G |/2 if and only if G is the cycle C 4 or the corona F • K 1 for any connected graph F (see also [29] for a short proof). From this (or directly from Theorem 5) we immediately have the following corollary. Simple examples illustrating relations between graphs considered in Theorems 2 and 5, and Corollaries 3, 4, and 6-9 are shown in Fig. 2.
· · · · · · · · · · · · bistars S n,m (n, m ≥ 2) paths P 6 and P n (n ≥ 8) does not exist by Corollary 4 odd cycles C 2n+1 , wheels W n complete graphs K n (n ≥ 3) Let T max denote the set of trees for which the domination number is equal to the size of its smaller partite set. We now provide a constructive characterization of the trees belonging to the set T max . Similar constructive characterizations of trees for different domination related parameters or properties have been presented in e.g. [1,15,16,24]. Our characterization is based on four simple operations. To present one of these operations, we introduce some additional term.
. Such vertices have been intensively studied (see e.g. [14,26,27]). In particular, Sampathkumar and Neeralagi [27] Let T be the family of trees T that can be obtained from a sequence of trees T 0 , . . . , T k , where k ≥ 0, T 0 = K 2 and T = T k . In addition, if k ≥ 1, then for each i = 1, . . . , k, the tree T i can be obtained from the tree T ′ = T i−1 with the bipartition (A ′ , B ′ ) by one of the following four operations O 1 , O 2 , O 3 , and O 4 defined below and illustrated in Fig. 3.
O 3 Add two new vertices a and b to T ′ and join b to a and to an A ′ -vertex a ′ of T ′ that is a support of T ′ .
O 4 Add two new vertices a and b to T ′ and join a to b and to a Each of the vertices a ′ in the above defined operations O 1 and O 3 , and b ′ in the operations O 2 and O 4 , is called the attacher of T ′ . We shall prove that the trees in T are precisely the trees belonging to the family T max . Our first aim is to show that each tree in T belongs to the family T max . For this purpose we prove the following lemma. Proof. Let T 0 , T 1 , T 2 , . . . be a sequence of trees, where T 0 = K 2 (with an arbitrary chosen bipartition (A ′ , B ′ ) of its 2-element vertex set) and every T n can be obtained from the tree T n−1 by one of the operations O 1 , O 2 , O 3 , and O 4 . By induction on n we shall prove that T n ∈ T max for every n ∈ N. If n = 0, then T 0 = K 2 and T 0 ∈ T max (as γ(K 2 ) = β(K 2 ) = 1). Assume that n ≥ 1 and T n−1 = ((A ′ , B ′ ), E) is a tree, where (A ′ , B ′ ) is a bipartition of T n−1 for which |A ′ | ≤ |B ′ |, and γ(T n−1 ) = β(T n−1 ) = |A ′ |. We consider four cases depending on which operation is used to construct the tree T = T n from T ′ = T n−1 . to the contrary that γ(T ) < |A ′ | + 1. Let D be a γ-set of T . Since T is a connected graph of order at least three, it is obvious that we may assume that no leaf of T belongs to D.
is the bipartition of T and, certainly, γ(T ) ≤ |A ′ ∪ {a}| = |A ′ | + 1. It remains to prove that γ(T ) ≥ |A ′ | + 1. Suppose to the contrary that γ(T ) < |A ′ | + 1. Let D be a γ-set of T . Since T is a connected graph of order at least three, it is obvious that we may assume that no leaf of T belongs to D. This implies that b and the attacher a ′ are in D. Now it is easy to observe that D − {b} is a dominating set of T ′ and therefore This proves that T ∈ T max and completes the proof.
We are now ready to provide a constructive characterization of the trees belonging to the family T max .

Theorem 11. A tree T belongs to the family T max if and only if T belongs to the family T .
Proof. It follows from Lemma 10 that T ⊆ T max . Conversely, suppose T is a tree belonging to the family T max . Let (A, B) be a bipartition of T , where 1 ≤ |A| ≤ |B|. By induction on the order of T we shall prove that if γ(T ) = |A|, then T belongs to T , that is, T can be obtained from K 2 (which belongs to T and T max ) by repeated applications of the operations O 1 , O 2 , O 3 , and O 4 . If T is a star on at least three vertices, then T can be obtained from K 2 by repeated applications of operation O 1 (that is, attaching leaves to the only A-vertex of K 2 ), thus implying that T ∈ T . Hence, we may assume that diam(T ) ≥ 3. We consider two cases: |A| = |B|, |A| < |B|.
Case 1. If |A| = |B| and γ(T ) = |A|, then it follows from Corollary 9 that T is the corona of some tree R. Thus T has a vertex, say v, of degree 2. Let v ′ be the only non-leaf neighbor of v. Let l and l ′ be the only leaves adjacent to v and v ′ , respectively. Now, it is obvious that the tree T ′ = T − {v, l} is the corona (of the tree R − v) and therefore γ(T ′ ) = |V T ′ |/2 = |A| − 1 = |B| − 1. Thus, T ′ ∈ T max and the induction hypothesis implies that T ′ ∈ T . Consequently T ∈ T , since T can be rebuilt from T ′ by applying the operation O 3 (resp. O 4 ) if the attacher v ′ is an A-vertex (resp. a B-vertex) in T ′ .
Case 2. If |A| < |B|, then we consider two subcases: Thus T ′ ∈ T max and the induction hypothesis implies that T ′ ∈ T . We now claim that x 2 is not a γ − -critical vertex in T ′ . Suppose, contrary to our claim, that Consequently, since x 2 is not a γ − -critical vertex in T ′ , the tree T can be rebuilt from T ′ by applying the operation O 4 with the attacher x 2 . This completes the proof.

Algorithmic consequences
Our characterization of graphs belonging to the set C γ=β , given in Theorem 2, is nonpractical from algorithmic point of view, since this characterization involves α-sets. However Theorem 5 allows us to propose a quadratic-time algorithm for recognizing bipartite graphs with the domination number equal to the size of the smaller partite set. The idea of our algorithm follows that in [2], with the only difference of a slightly more thorough running time analysis, based upon the following obvious lemma.  Proof. First observe that if |A| = |B|, then by Corollary 9 all we need is to verify whether G is the cycle C 4 or a corona graph, which can be done in O(n + m) time, where m = |E G |. Thus assume |A| < |B|. Then it suffices to verify the properties (3a) and (3b) in Theorem 5. The first property can be easily verified in O(n 2 ) time by identifying and distinctly marking non-leaf and support vertices. To verify the second property, we first determine and distinctly mark the vertices in A ′ = A − (L G ∪ S G ) by using the prior markings. Next, similarly as in [2], by considering vertices in B of degree two whose both neighbors are in A ′ , we create a multigraph M (represented by the adjacency matrix, constructed in O(n 2 ) time) on the vertex set A ′ in which the multiplicity of each edge joining two vertices is equal to the number of their common neighbors of degree two in B. Then, for each vertex b ∈ B, we construct the list L(b) of vertices adjacent to b in A ′ . Since each of these lists is of length at most n, all that can be easily done in O(n 2 ) time. We continue by checking for each b ∈ B and every two vertices a and a ′ belonging to L(b) whether the multiplicity of edge aa ′ in M is at least 2, and we stop whenever checking fails (as then γ(G) = |A|). As observed in [2], this may require Θ( b∈B |L(b)| 2 ) = Θ( v∈V G deg 2 (v)) time. However, since a subset {a, a ′ } can be checked at most n − 2 times, whereas at most n/2 of such subsets can be positively examined (by Corollary 13), the algorithm always stops after O(n 2 ) steps.
Lemma 12 allows to conclude that all the graphs belonging to the set C γ=β can also be recognized in O(n 2 ) time. Namely, Arumugam et al. [2] proposed an algorithm that recognizes whether a given graph G belongs to the set C γ=β in the claimed time complexity of O( v∈V G deg 2 (v)). The most time consuming step in their algorithm, after a preprocessing step for determining the relevant bipartition (A, B) of the subgraph H resulting from G by deleting all edges whose both end-vertices are support vertices, is to check whether for every non-support distinct vertices u, v ∈ A, if u and v have some common neighbor, then they have at least two common neighbors of degree two, which takes O( b∈B deg 2 H (b)) = O( v∈V G deg 2 (v)) time in total. However, similarly as in the proof of Theorem 14, notice that a 2-element subset {u, v} of A can be checked at most n − 2 times, whereas at most n/2 such subsets can 'pass the test' by Lemma 12 and Theorem 1.1 in [2]. Hence, we obtain the following corollary.
Corollary 15. Let G be an n-vertex graph without isolated vertices. Then the equality γ(G) = β(G) can be verified in O(n 2 ) time.
It is a natural question to ask whether the running time analysis of our algorithm (and that in [2]) can be improved, say, to obtain the running time O(n 2−ε ) for some ε > 0. Showing that there exists an infinite class of bipartite graphs G = ((A, B), E G ) in which the most time consuming step of our algorithm being of order b∈B |L(b)| 2 can be Θ(n 2 ), we prove that this question has a negative answer. Let n and p be integers, where n ≥ 16 and p = ⌊ √ n/2⌋. The multigraph of order p in which every two vertices are joined by exactly two multiple edges is denoted by K ′′ p . Now let G be the graph obtained from the join K ′′ p + K n−p 2 by subdividing each of its double edges exactly once (as illustrated in Fig. 4, where S(K ′′ p ) is the subdivision graph of K ′′ p ). It is obvious that G is a leafless bipartite graph in which A = V K ′′ p and B = V G − A are partite sets and 1 < |A| = p < n − p = |B|. Because sets L G and S G are empty, and for every distinct vertices x and y in A there are distinct vertices x and y in B such that N G (x) = N G (y) = {x, y}, it follows from Theorem 5 that γ(G) = |A|. On the other hand, it immediately follows from the construction of G that v∈B deg 2 G (v) = Θ(n 2 ), and so our algorithm (and that in [2]), when executed on G, will stop only after Θ(n 2 ) steps.
Finally, Theorem 14 itself has also a practical application in guarding grids. Let S = {S 1 , S 2 , . . . , S n } be a family of distinct vertical and horizontal closed line segments in the plane, where every two collinear line segments are disjoint. This family is called a grid if n ≥ 2 and the union S = S 1 ∪ S 2 ∪ · · · ∪ S n is a connected subset of R 2 . The intersection graph of the family S is denoted by G S (and it is the graph with vertex-set S and edge-set {S i S j : i = j, S i , S j ∈ S, and S i ∩ S j = ∅}). It is obvious that if S is a grid, then G S is a connected bipartite graph and the pair (V S , H S ) is its bipartition, where V S (H S , resp.) is the set of all vertical (horizontal, resp.) line segments of S [21]. A mobile guard is a guard traveling along a line segment of a grid, and patrolling this line segment and all the intersected line segments. We identify a mobile guard traveling along a line segment x with the same segment x and say that x patrols itself and the line segments intersected by x. A set C ⊆ S of mobile guards is called a patrolling set of the grid S if every line segment x ∈ S is either an element of C or is intersected by an element of C. The problem of mobile guards patrolling a grid is a variant of the traditional art gallery problem and it was formulated by Ntafos [21], and then its next variants were studied in a number of papers, see, for example, [4]- [9], [17,18] and [28]. Katz et al. [17] observed that the decision problem associated with finding the minimum cardinality of a set of mobile guards patrolling a given grid is NP-complete. On the other hand it is obvious that all vertical line segments of a grid S (as well as all horizontal line segments of S) form a patrolling set of S and therefore the smallest number of mobile guards patrolling S is at most min{|V S |, |H S |}. A grid S is said to be extremal if the number of mobile guards required to patrol S is equal to min{|V S |, |H S |}, and we refer to the problem of recognizing extremal grids as the extremal guard cover problem. From the obvious fact that a subset C of a grid S is a set of mobile guards patrolling S if and only if C is a dominating set of the intersection graph G S (see [17]), it follows that S is an extremal grid if and only if G S is a bipartite graph in which the domination number is equal to the cardinality of the smaller of bipartite sets of the graph G S . Thus the extremal guard cover problem for a grid S with n line segments can be solved by considering the intersection graph G S (which can be constructed in O(n log n + m) time, where m = O(n 2 ) is the number of intersection points of line segments of S, see [3]) and then recognizing whether the domination number of G S is equal to min{|V S |, |H S |}, which can be done in O(n 2 ) time (by Theorem 14). However, since here geometry is involved and intersection graphs of grids form a restricted class of bipartite graphs, some significant improvement in the last statement is possible. We begin with the following lemma. Proof. Without loss of generality assume that A = V S , B = H S , and suppose that some horizontal line segment h intersects five vertical line segments v 1 , v 2 , . . . , v 5 , say at points C 1 (x 1 , y 0 ), C 2 (x 2 , y 0 ), . . . , C 5 (x 5 , y 0 ), respectively, with x 1 < x 2 < . . . < x 5 . Let ε be a real number such that 0 < ε ≤ min{x i+1 − x i : i = 1, . . . , 4}/100. Since the line segment h (as a vertex of G S ) is a common neighbor of every two distinct line segments belonging to the set {v 1 , . . . , v 5 }, by assumption for every two indexes i and j (1 ≤ i < j ≤ 5) there exists a horizontal line segment h ij which intersects the line segments v i and v j only. Assume that h ij intersects v i and v j at points L ij (x i , y ij ) and R ij (x j , y ij ), respectively, for some y ij . These points define two new points L + ij (x i + ε, y ij ) and R − ij (x j − ε, y ij ), respectively, which lie between L ij and R ij (see Fig. 6 for an illustration). Now it follows from the choice of ε that the points C 1 , C 2 , . . . , C 5 together with the polygonal chains C i L + ij R − ij C j , where 1 ≤ i < j ≤ 5, form a planar representation of the complete non-planar graph K 5 , a contradiction.
The next corollary is immediate from Lemma 16 and Theorem 5.  ((A, B), E G S ) be the intersection graph of a grid S. In our last theorem we present the announced time complexity upper bound for the extremal guard cover problem.  ((A, B), E G S ) be the intersection graph of S with 1 ≤ |A| ≤ |B|. As already mentioned, the graph G S can be constructed in O(n log n + m) time [3], and thus it remains to show that in the same time we can verify whether γ(G S ) = |A|.
First, similarly as in the proof of Theorem 14, if |A| = |B|, then we verify whether G S is C 4 or a corona graph, which can be done in O(n + m) time. Thus assume |A| < |B|. In this case it suffices to verify the properties (3a) and (3b) in Theorem 5. The first property can be verified in O(n + m) time by identifying and distinctly marking non-leaf and support vertices. To verify the second property, we first determine and distinctly mark the vertices in A ′ = A − (L G S ∪ S G S ) by using the prior markings. Next, in linear time we check if the inequality max b∈B |N(b) − (L G S ∪ S G S )| ≤ 4 holds for every b in B. If max b∈B |N(b) − (L G S ∪ S G S )| ≥ 5 for some b ∈ B, then we stop as γ(G S ) = |A| (by Corollary 17). Otherwise for each vertex in B of degree two whose both neighbors x and y are in A ′ , we list the set {x, y}. Then we sort the resulting list L of 2-element sets lexicographically in order to compute the number of sets on the list that occur exactly once. If there is at least one such set, then we stop, as γ(G S ) = |A| (by the property (5b) in Theorem 5). Otherwise, we continue by truncating the list to store now each set only once. Since the original list is of length at most n, all that can be done in O(n log n) time. Next, similarly as in [2], for each vertex b ∈ B, we construct the list L(b) of vertices adjacent to b in A ′ . Since each of these lists is of length at most 4 (by the stop condition positively verified above), all that can be done in O(n) time. Finally, using a binary search on L, for each b ∈ B and each 2-element subset {x, y} of L(b) we check whether {x, y} is on the (truncated) list L, and we stop whenever checking fails (as then γ(G S ) = |A|). This may require checking as many as Θ( b∈B |L(b)| 2 ) sets, however, since we handle the case |L(b)| ≤ 4, the total running time of our algorithm becomes then O(n log n + m) as required.