An Algorithm Computing the Core of a K¨ onig-Egerv´ ary Graph Vadim E. Levit1 and Eugen Mandrescu2
arXiv:1102.1141v1 [cs.DM] 6 Feb 2011
1
Ariel University Center of Samaria, ISRAEL
[email protected] 2 Holon Institute of Technology, ISRAEL eugen
[email protected]
Abstract. A set S of vertices is independent (or stable) in a graph G if no two vertices from S are adjacent, and α(G) is the cardinality of a largest (i.e., maximum) independent set of G. G is called a K¨ onig-Egerv´ ary graph if its order equals α(G) + µ(G), where µ(G) denotes the size of a maximum matching. By core(G) we mean the intersection of all maximum independent sets of G. To decide whether core(G) = ∅ is known to be NP-hard [1]. In this paper, we present some polynomial time algorithms finding core(G) of a K¨ onig-Egerv´ ary graph G. Key words: maximum independent set, maximum matching, core
1
Introduction
Throughout this paper G = (V, E) is a finite, undirected, loopless and without multiple edges graph with vertex set V = V (G) of cardinality |V (G)| = n, and edge set E = E(G) of cardinality |E (G)| = m. If X ⊂ V , then G[X] is the subgraph of G spanned by X. By G− W we mean the subgraph G[V − W ], if W ⊂ V (G). The neighborhood of a vertex v ∈ V is the set N (v) = {w : w ∈ V and vw ∈ E}, while N (A) = ∪{N (v) : v ∈ A} and N [A] = A ∪ N (A) for A ⊂ V . A set S ⊆ V (G) is independent if no two vertices from S are adjacent; by Ind(G) we mean the set of all the independent sets of G. An independent set of maximum size will be referred to as a maximum independent set of G, and the independence number of G is α(G) = max{|S| : S ∈ Ind(G)}. In the sequel, the family {S : S is a maximum independent set of G} is denoted by Ω(G). A matching in a graph G = (V, E) is a set M ⊆ E such that no two edges of M share a common vertex. A matching of maximum cardinality µ(G) is a maximum matching, and a perfect matching is one covering all vertices of G. It is known that α(G) + µ(G) ≤ |V (G)|. If α(G) + µ(G) = |V (G)|, then G is called a K¨ onig-Egerv´ ary graph (Deming [4], and Sterboul [24]). It is easy to see that if G is a K¨ onig-Egerv´ary graph, then α(G) ≥ µ(G), and that a graph G having a perfect matching is a K¨onig-Egerv´ary graph if and only if α(G) = µ(G).
2
Levit and Mandrescu
K¨ onig-Egerv´ary graphs were investigated in several papers, among we quote [3,10,13,15,16,19,20,23], and generalized in [2,21]. According to a celebrated result of K¨onig [9], and Egerv´ary [6], every bipartite graph is a K¨ onig-Egerv´ary graph. This class includes non-bipartite graphs as well (see, for instance, the graphs H1 and H2 in Figure 1).
H1
w
w @ @ w @w
w
w
w
w
w
w
H2
w H3
w
w
w @ @ w @w
Fig. 1. Only H3 is not a K¨ onig–Egerv´ary graph, as α(H3 ) + µ(H3 ) = 4 < 5 = |V (H3 )|. A characterization of K¨ onig-Egerv´ary graphs has been found independently by Deming [4] and Sterboul [24]. Recently, it has been presented a forbidden subgraph characterization of K¨onig-Egerv´ary graphs [11]. Other characterizations of K¨ onig-Egerv´ary graphs can be found in [12,17,18]. Theorem 1. [7], [4] Given a graph G and a maximum matching of G, one can test whether G is a K¨ onig-Egerv´ ary graph in time O(m + n). Theorem √ 2. [25] Given a graph G, one can find a maximum matching in time O(m • n). As a consequence of Theorems 1, 2 one can deduce the following. √ Corollary 1. Given a graph G, one can check in time O(m • n) whether G is a K¨ onig-Egerv´ ary graph. Let us recall that core(G) = ∩{S : S ∈ Ω(G)}, [14]. Proposition 1. [14] For a connected bipartite graph G = (A, B, E) of order at least two, the following assertions are true: (i) α(G) > |V (G)|/2 if and only if |core(G)| ≥ 2; (ii) α(G) = |V (G)|/2 if and only if |core(G)| = 0 and A, B ∈ Ω(G). Notice that Proposition 1(i) is not true for non-bipartite K¨onig-Egerv´ary graphs; e.g., the graph G2 from Figure 2. Theorem 3. [14] For a connected K¨ onig-Egerv´ ary graph G = (V, E) of order at least two, the following assertions are true: (i) α(G) > |V (G)|/2 if and only if |core(G)| > |N (core(G))| ≥ 1; (ii) α(G) = |V (G)|/2 if and only if G has a perfect matching. It is known, [1], that if G has no isolated vertices, then α(G) > µ(G) ⇒ |core(G)| > α(G) − µ(G). Moreover, if G is a connected graph satisfying 3µ(G) < |V (G)|, then G has |core(G)| ≥ 2, [1].
Core of a K¨ onig-Egerv´ ary Graph
w
w u w
w
w
G1
a w v
w
3
G2
w
wb wc @ @ @ @ w @w @w
Fig. 2. G1 has α(G1 ) = 4 > |V (G1 )| /2 and core(G1 ) = {u, v}, while the graph G2 has α(G2 ) = 3 = |V (G2 )| /2 and |core(G1 )| = |{a, b, c}| ≥ 2. Theorem 4. [1] The problem of whether there are vertices in a given graph G belonging to core(G) is NP-hard. It has been noticed in [1] that if ̥ is a hereditary (i.e., induced subgraph closed) family of graphs for which computing the independence number α (G) is polynomial, then core(G) can be computed efficiently for G ∈ ̥. For instance, it is true in the case of perfect graphs, line graphs, circular graphs, and circular arc graphs. A sketch of a sequential algorithm computing core(G) for K¨onigEgerv´ary graphs has been presented in [5]. In this paper, we provide both sequential and parallel algorithms finding core(G) in polynomial time, where G is a K¨onig-Egerv´ary graph.
2
Results and Algorithms
The following result plays a key role in building our algorithms. Theorem 5. Let G = (V, E) be a K¨ onig-Egerv´ ary graph of order n, and v ∈ V . 1. If µ(G) = µ(G − v), then G − v is a K¨ onig-Egerv´ ary graph and v ∈ core(G). 2. If µ(G) = µ(G − v) + 1, then G − v is a K¨ onig-Egerv´ ary graph if and only if v ∈ / core(G). Proof. By definition of core : v ∈ core(G) if and only if α(G) = α(G − v) + 1. Clearly α(G − v) + µ(G − v) ≤ n − 1, α(G) − 1 ≤ α(G − v) ≤ α(G) and µ(G) − 1 ≤ µ(G − v) ≤ µ(G) hold for every v ∈ V (G). Case 1. µ(G) = µ(G − v). Assume, to the contrary, that G − v is not a K¨ onig-Egerv´ary graph. Hence G − v satisfies the inequality α(G − v) + µ(G − v) < n − 1 = α(G) + µ(G) − 1, which leads to the following contradiction: α(G−v) < α(G)−1. Therefore, G−v is a K¨ onig-Egerv´ary graph, and, moreover, we infer that α(G − v) = α(G) − 1, i.e., v ∈ core(G). Case 2. µ(G) = µ(G − v) + 1. Then G − v is a K¨onig-Egerv´ary graph if and only if α(G − v) + µ(G − v) = n − 1 = α(G) + µ(G) − 1 ⇐⇒ α(G) = α(G − v), i.e., v ∈ / core(G), and this completes the proof.
4
Levit and Mandrescu
Taking into account that every subgraph of a bipartite graph is bipartite, one can see that Theorem 5 is specified as follows. Corollary 2. Let G = (V, E) be a bipartite graph and v ∈ V . Then v ∈ core(G) if and only if µ(G) = µ(G − v). Let us notice that if G is a K¨onig-Egerv´ary graph and has a perfect matching, then µ(G) = µ(G − v) + 1 holds for every v ∈ V (G). Hence by Theorem 5 we deduce the following. Corollary 3. Let G = (V, E) be a K¨ onig-Egerv´ ary graph with a perfect matching and v ∈ V . Then v ∈ core(G) if and only if G− v is not a K¨ onig-Egerv´ ary graph. Theorem 5 motivates the subsequent algorithm finding core(G) for a general K¨ onig-Egerv´ary graph G. Algorithm 6 Input = a K¨ onig-Egerv´ ary graph G = (V, E) S 1 , if v ∈ core(G) Output = core(G) = {v}, where c (v) = 0 , if v ∈ / core(G) c(v)=1 Sequential Complexity = √ √ √ O(m • n) + O(n ∗ m • n + (m + n) ) = O(m • n • n) Parallel Complexity with n processors = √ √ √ O(m • n) + O(m • n + (m + n)) = O(m • n) 1. compute µ(G) 2. for all v ∈ V do in parallel 3. compute µ(G − v) 4. if µ(G) = µ(G − v) 5. then c(v) := 1 6. else compute ke(v) := G − v is a K¨ onig-Egerv´ ary graph 7. c(v) := ke(v) S 8. core(G) := {v} c(v)=1
For instance, applying Algorithm 6 for the graph G1 from Figure 3, we get the following: – – – – –
µ(G1 ) = 3 µ(G1 − vi ) = 3 = µ(G1 ) for i ∈ {6, 7} µ(G1 − vi ) = 2 < µ(G1 ) for i ∈ {1, ..., 5} c(vi ) := 1 for i ∈ {6, 7} ke(vi ) = 1, i.e., G1 − vi is a K¨onig-Egerv´ary graph for i ∈ {1, 2, 3, 4}
Core of a K¨ onig-Egerv´ ary Graph v2 w G1
v3 v1 w
w
wv7 v5
w
v4
w
v6
w
x2 w
wx4
x1 w
w
G2
x3
5
wx6 x5
w
x7
w
Fig. 3. G1 , G2 are K¨ onig-Egerv´ary graphs without a perfect matching. – – – –
ke(vi ) = 0, i.e., G1 − vi is not a K¨onig-Egerv´ary graph, for i ∈ {5} c(vi ) = 0 for i ∈ {1, ..., 4} c(v5 ) := ke(v5 ) = 1 consequently, core(G1 ) = {v5 , v6 , v7 }.
Proposition 2. Algorithm 6 correctly computes core(G) of a K¨ onig-Egerv´ ary graph G on n vertices and m edges, with √ (i) sequential time complexity O(m • n • n); √ (ii) parallel time complexity with n processors O(m • n). Proof. According to Theorem 5, to decide whether a vertex v ∈ V (G) belongs or not to core(G), one has: √ 1. to compute µ(G), and this requires O(m • n) time, by Theorem 2; 2. to compute µ(G − v)√and a maximum matching M of G − v, which can be performed in O(m • n) time, according to Theorem 2; 3. to check whether G − v that has M as a maximum matching, is a K¨onigEgerv´ary graph or not, and this test can be done in O(m + n) time, in accordance with Theorem 1. Consequently, the sequential time complexity of Algorithm 6 is √ √ √ O(m • n) + O(n ∗ m • n + (m + n) ) = O(m • n • n),
while its parallel time complexity with n processors is √ √ √ O(m • n) + O(m • n + (m + n)) = O(m • n), as claimed.
If the input graph G is bipartite, then ke(v) = 1, for every v ∈ V (G), because G − v is always bipartite, hence a K¨onig-Egerv´ary graph. Consequently, for bipartite graphs we obtain the following simpler algorithm. Algorithm 7 Input = a bipartite graph G = (V, E) S 1 , if v ∈ core(G) {v}, where c (v) = Output = core(G) = 0 , if v ∈ / core(G) c(v)=1 Sequential Complexity = √ √ √ O(m • n) + O(n ∗ m • n ) = O(m • n • n) Parallel Complexity with n processors = √ √ √ O(m • n) + O(m • n) = O(m • n)
6
Levit and Mandrescu
1. compute µ(G) 2. for all v ∈ V do in parallel 3. compute µ(G − v) 4. if µ(G) = µ(G − v) 5. then c(v) := 1 6. elseSc(v) := 0 {v} 7. core(G) := c(v)=1
For example, applying Algorithm 7 to the graph G2 depicted in Figure 3, we obtain the following: – – – – – –
µ(G2 ) = 3 µ(G2 − xi ) = 2 < µ(G2 ) for i ∈ {1, ..., 5} µ(G2 − xi ) = 3 = µ(G2 ) for i ∈ {6, 7} c(xi ) = 0 for i ∈ {1, ..., 5} c(xi ) = 1 for i ∈ {6, 7} consequently, core(G2 ) = {x6 , x7 }.
Let us notice that, unlike bipartite graphs, a K¨onig-Egerv´ary graph G with a perfect matching can have core(G) 6= ∅; e.g., the graphs H1 and H2 from Figure 4 have at least one perfect matching and core(H1 ) = {x}, while core(H2 ) = {u, v}. w H1 x w
w
w @ @ w @w
w H2
wv
w
w
w
u
w
Fig. 4. H1 and H2 are K¨onig-Egerv´ary graphs with perfect matchings. If G is a K¨ onig-Egerv´ary graph having a perfect matching, then clearly, µ(G) = µ(G − v) + 1 holds for every v ∈ V (G). Hence, v ∈ core(G) if and only if G−v is not a K¨ onig-Egerv´ary graph. Consequently, core(G) of a K¨onig-Egerv´ary graph G owning a perfect matching, may be found more efficiently. Algorithm 8 Input = a K¨ onig-Egerv´ ary graph G with a perfect matching S 1 , if v ∈ core(G) Output = core(G) = {v}, where c (v) = 0 , if v ∈ / core(G) c(v)=1 √ √ Sequential Complexity = O(n • (m • n)) = O(m • n • n) √ Parallel Complexity with n processors = O(m • n) 1. for all v ∈ V (G) do in parallel 2. compute ke(v) := G − v is a K¨ onig-Egerv´ ary graph 3. c(v) := ke(v) S {v} 4. core(G) := c(v)=1
Core of a K¨ onig-Egerv´ ary Graph
7
Applying Algorithm 8 for the graph G1 from Figure 5, we get that: ke(v1 ) = 0 and ke(v3 ) = 0, i.e., G1 − v1 and G1 − v3 are not K¨onig-Egerv´ary graphs, while ke(v2 ) = ke(v4 ) = ke(v5 ) = ke(v6 ) = 1, i.e., G1 − vi , i ∈ {2, 4, 5, 6}, are still K¨ onig-Egerv´ary graphs. Consequently, it follows that only c(v1 ) = c(v3 ) = 1, and hence core(G1 ) = {v1 , v3 }. v1 w G1
wv5 v3
v2 w
w
w
w
w
w
w
G2
v4
w
w
wv6
Fig. 5. G1 and G2 are K¨onig-Egerv´ary graphs with perfect matchings. It is worth mentioning that if the input graph G is bipartite having a perfect matching, then Algorithm 8 gives a constructive proof of Proposition 1(ii) claiming that core(G) = ∅. For example, using Algorithm 8 for the bipartite graph G2 from Figure 5, one can see that ke(v) = 1 holds for every v ∈ V (G2 ), and hence, core(G2 ) = ∅.
3
Conclusions 3
In this paper we present a sequential algorithm with time complexity O(m • n 2 ) finding core(G) of a K¨ onig-Egerv´ary graph. Its parallel counterpart solves the 1 same problem in O(m • n 2 ) time complexity. It is known that the unique maximum independent set problem is NP-hard for general graphs [22]. One of applications of our results is a polynomial algorithm recognizing a K¨ onig-Egerv´ary graph with a unique maximum independent set. In fact, the graph G has a unique maximum independent set if and only if core(G) is a maximal independent set [8]. Therefore, whenever there is a polynomial algorithm returning core(G), one can decide in polynomial time whether G has a unique maximum independent set. Consequently, to recognize a K¨onigEgerv´ary graph G with a unique maximum independent set, it is enough to run Algorithm 6, and then to try enlarging its output to an independent set. The enlarging part is handled in O(m) time complexity sequentially, while in parallel it may be implemented with O(1) time complexity.
References 1. Boros, B., Golumbic, M. C., Levit, V. E.: On the number of vertices belonging to all maximum stable sets of a graph, Discrete Applied Mathematics 124 (2002) 17-25. 2. Bourjolly, J. M., Hammer, P. L., Simeone, B.: Node weighted graphs having K¨ onigEgerv´ ary property, Mathematical Programming Study 22 (1984) 44-63. 3. Bourjolly, J. M., Pulleyblank, W. R.: K¨ onig-Egerv´ ary graphs, 2-bicritical graphs and fractional matchings, Discrete Applied Mathematics 24 (1989) 63-82.
8
Levit and Mandrescu
4. Deming, R. W.: Independence numbers of graphs - an extension of the K¨ onigEgerv´ ary theorem, Discrete Mathematics 27 (1979) 23-33. 5. Chleb´ık, M., Chleb´ıkov´ a, J.: Crown reductions for the minimum weighted vertex cover problem, Discrete Applied Mathematics 156 (2008) 292-312. 6. Egerv´ ary, E.: On combinatorial properties of matrices, Matematikai Lapok 38 (1931) 16-28. 7. Gavril, F.: Testing for equality between maximum matching and minimum node covering, Information Processing Letters 6 (1977) 199-202. 8. Fischermann, M., Rautenbach, D., Volkmann, L.: A note on the complexity of graph parameters and the uniqueness of their realizations, J. Comb. Math. Comb. Comput. 47 (2003) 183-188. 9. K¨ onig, D.: Graphen und Matrizen, Matematikai Lapok 38 (1931) 116-119. 10. Korach, E.: On dual integrality, min-max equalities and algorithms in combinatorial programming, University of Waterloo, Department of Combinatorics and Optimization, Ph.D. Thesis, 1982. 11. Korach, E., Nguyen, T., Peis, B.: Subgraph characterization of Red/Blue-Split Graph and K¨ onig-Egerv´ ary graphs, Proceedings of the Seventeenth Annual ACMSIAM Symposium on Discrete Algorithms, ACM Press (2006) 842-850. 12. Larson, C. E.: A new characterization of K¨ onig-Egerv´ ary graphs, The 2nd Canadian Discrete and Algorithmic Mathematics Conference, May 25-28, 2009, CRM Montreal (Canada). 13. Levit, V. E., Mandrescu, E.: Well-covered and K¨ onig-Egerv´ ary graphs, Congressus Numerantium 130 (1998) 209-218. 14. Levit, V. E., Mandrescu, E.: Combinatorial properties of the family of maximum stable sets of a graph, Discrete Applied Mathematics 117 (2002) 149-161. 15. Levit, V. E., Mandrescu, E.: On α+ -stable K¨ onig-Egerv´ ary graphs, Discrete Mathematics 263 (2003) 179-190. 16. Levit, V. E., Mandrescu, E.: On α-critical edges in K¨ onig-Egerv´ ary graphs, Discrete Mathematics 306 (2006) 1684-1693. 17. Levit, V. E., Mandrescu, E.: A characterization of K¨ onig-Egerv´ ary graphs using a common property of all maximum matchings, math.CO.arXiv:0911.4626, 9 pp. 18. Levit, V. E., Mandrescu, E.: Critical independent sets and K¨ onig-Egerv´ ary graphs, math.CO.arXiv:0906.4609, 8 pp. 19. Lov´ asz, L.: Ear decomposition of matching covered graphs, Combinatorica 3 (1983) 105-117. 20. Lov´ asz, L., Plummer, M. D.: Matching Theory, Annals of Discrete Mathematics 29 (1986) North-Holland. 21. Paschos, V. T., Demange, M.: A generalization of K¨ onig-Egerv´ ary graphs and heuristics for the maximum independent set problem with improved approximation ratios, European Journal of Operational Research 97 (1997) 580-592. 22. Pelc, A.: Undirected graph models for system-level fault diagnosis, IEEE Transactions on Computers 40 (1991) 1271-1276. 23. Pulleyblank, W. R.: Matchings and Extensions, in: Handbook of Combinatorics, Volume 1 (eds. R. L. Graham, M. Grotschel and L. Lov´ asz), MIT Press and NorthHolland, Amsterdam (1995) 179-232. 24. Sterboul, F.: A characterization of the graphs in which the transversal number equals the matching number, Journal of Combinatorial Theory Series B 27 (1979) 228-229. 25. Vazirani, V.p V.: A theory of alternating paths and blossoms for proving correctness of the O(|E| |V |) general graph maximum matching algorithm, Combinatorica 14 (1994) 71-109.