An efficient algorithm for minimum feedback vertex sets in rotator graphs

An efficient algorithm for minimum feedback vertex sets in rotator graphs

Information Processing Letters 109 (2009) 450–453 Contents lists available at ScienceDirect Information Processing Letters www.elsevier.com/locate/i...

153KB Sizes 4 Downloads 93 Views

Information Processing Letters 109 (2009) 450–453

Contents lists available at ScienceDirect

Information Processing Letters www.elsevier.com/locate/ipl

An efficient algorithm for minimum feedback vertex sets in rotator graphs Chi-Jung Kuo a , Chiun-Chieh Hsu a,∗ , Hon-Ren Lin b , Kung-Kuei Lin a a b

Department of Information Management, National Taiwan University of Science and Technology, Taipei, Taiwan, ROC Department of Information Management, National Taipei College of Business, Taipei, Taiwan, ROC

a r t i c l e

i n f o

a b s t r a c t

Article history: Received 12 November 2008 Received in revised form 10 January 2009 Accepted 12 January 2009 Available online 15 January 2009 Communicated by K. Iwama Keywords: Feedback vertex set Rotator graph Generator Cycle Graph algorithms

For a rotator graph with n! nodes, Hsu and Lin [C.C. Hsu, H.R. Lin, H.C. Chang, K.K. Lin, Feedback Vertex Sets in Rotator Graphs, in: Lecture Notes in Comput. Sci., vol. 3984, 2006, pp. 158–164] first proposed an algorithm which constructed a feedback vertex set (FVS) with time complexity O(nn−3 ). In addition, they found that the size of the FVS is n!/3, which was proved to be minimum. In this paper, we present an efficient algorithm which constructs an FVS for a rotator graph in O(n!) time and also obtains the minimum FVS size n!/3. In other words, this algorithm derives the optimal result with linear time complexity in terms of the number of nodes in the rotator graph. © 2009 Elsevier B.V. All rights reserved.

1. Introduction A feedback vertex set (abbreviated to FVS) is a vertex subset of a graph whose removal (including their adjacent edges) induces the remaining graph acyclic. The FVS algorithms can be applied to deadlock prevention in operating systems [12], information security [7], scheduling [4], combinatorial circuit design [9], artificial intelligence [1], and so on. A minimum FVS is an FVS which contains the smallest number of vertices. Published papers [6,14] proved that finding a minimum FVS in general graphs and bipartite graphs is a NP-hard problem. In recent years, FVS algorithms have been developed in mesh and butterfly [2,11], hypercube [5], star graph [13], rotator graph [8], and shuffle-based interconnection networks [10]. Rotator graph, a family of Cayley graph, is first proposed in 1992 [3]. In recent years, many related papers have been published because of the rich topological properties of the rotator graph, such as symmetric structure, recursive construction, low diameter, unique shortest path routing, and so on. A rotator graph of scale n, denoted by n-rotator

*

Corresponding author. E-mail address: [email protected] (C.-C. Hsu).

0020-0190/$ – see front matter doi:10.1016/j.ipl.2009.01.004

©

2009 Elsevier B.V. All rights reserved.

graph, has n! nodes, and each node has a unique permutation of 1, 2, 3, . . . and n. In 2006, Hsu and Lin [8] first proposed an algorithm for finding a minimum FVS in an nrotator graph with time complexity O(nn−3 ). However, we present an efficient algorithm which finds a minimum FVS in an n-rotator graph in O(n!) time. In addition, using a simple symbol exchange mechanism, we can assign an arbitrary node in an n-rotator graph to a newly generated FVS whose size is still minimum (n!/3). 2. Preliminaries Let N = {1, 2, . . . , n} and s1 s2 s3 . . . sn be a permutation, where si ∈ N for all 1  i  n. An n-rotator graph has n! nodes labeled with a unique permutation s1 s2 s3 . . . sn . Let v = s1 s2 s3 . . . sn be a node in an n-rotator graph and si be the ith symbol of v. Generator g i inserts the first symbol of a node to the ith position to form an adjacent node of v. Node v ∗ g i denotes the adjacent node of applying g i to node v. Node v links to adjacent nodes v ∗ g i by the outgoing edges represented as generators g i for 2  i  n. A 3-rotator graph is illustrated in Fig. 1, where all edges except of the g 2 edges are directed. Note that node and vertex are identical in this paper.

C.-J. Kuo et al. / Information Processing Letters 109 (2009) 450–453

451

= π ( v , δ1 ⊕ δ2 ) = π (v , R ) = C1.

2

For example, let v = 1234 and R = ( g 2 g 4 g 3 ) ⊕ ( g 3 g 4 g 2 g 3 ). Suppose directed cycle C 1 = π ( v , R ) = 1234(2) → 2134(4) → 1342(3) → 3412(3) → 4132(4) → 1324(2) → 3124(3) → 1234. Directed cycle C 2 = π ( v ∗ ( g 2 g 4 g 3 ), ( g 3 g 4 g 2 g 3 ) ⊕ ( g 2 g 4 g 3 )) = π (3412, g 3 g 4 g 2 g 3 g 2 g 4 g 3 ) = 3412(3) → 4132(4) → 1324(2) → 3124(3) → 1234(2) → 2134(4) → 1342(3) → 3412. Clearly, C 1 = C 2 because they Fig. 1. A 3-rotator graph.

Definition 1. Node v ∗ δ denotes the resultant of applying δ to node v, where δ can be a single generator or a sequence of generators. Definition 2. Let g i and g j be two generators. If i > j, we call that g i is a higher dimension generator than g j and denoted by g i  g j . Definition 3. Let V i , j of a rotator graph be the set of all nodes whose ith symbol is j. For instance, V 2,1 = {2134, 2143, 3124, 3142, 4123, 4132} for a 4-rotator graph. Definition 4. A node v = s1 s2 s3 . . . sn in an n-rotator graph is an F -permutation if s1 = min{s1 , s2 , s3 }. For example, nodes 1234, 1243, 1324, 1342, 1423, 1432, 2341 and 2431 are all F -permutation’s in a 4-rotator graph, because the first symbol is the smallest one among the first three symbols for each node. Definition 5. A directed cycle C in a rotator graph can be represented as π ( v , R ), where v is a node of C and R is the generator sequence of C starting from v. For instance, π (1234, g 4 g 3 g 4 g 3 g 4 g 3 g 4 g 3 ) is a directed cycle of 1234(4) → 2341(3) → 3421(4) → 4213(3) → 2143(4) → 1432(3) → 4312(4) → 3124(3) → 1234. Clearly, a directed cycle can be represented in different expressions by starting from different nodes. Two directed cycles C 1 and C2 are said to be equivalent, denoted by C 1 = C 2 , if C 1 and C 2 contain the same nodes and the same arcs. Definition 6. Let δ1 and δ2 be two sequences of generators. A generator sequence R = δ1 ⊕ δ2 denotes the concatenation of two subsequences δ1 and δ2 . A generator sequence R ⊗ δ1 = δ2 , denotes removing the leading subsequence δ1 from R. Lemma 1. If directed cycle C 1 = π ( v , R ) where R = δ1 ⊕ δ2 and directed cycle C 2 = π ( v ∗ δ1 , δ2 ⊕ δ1 ), then C 1 = C 2 . Proof. C 2 = π ( v ∗ δ1 , δ2 ⊕ δ1 )

= π ( v ∗ δ1 ∗ δ2 , (δ2 ⊕ δ1 ) ⊗ δ2 ⊕ δ2 )

contain the same nodes and edges. In the rotator graph, we do not consider g 2 g 2 as a generator sequence of a cycle because the edge g 2 is an undirected edge and is repeated twice in this cycle. Hence, there exists at least one generator g j  g 2 in every directed cycle of a rotator graph and the generator sequence of the smallest directed cycle is g 3 g 3 g 3 , whose cycle length is 3. Lemma 2. For a rotator graph, if directed cycle C 1 = π ( v 1 , R 1 ) where v 1 ∈ V i ,β for 1  i  3, then ∃π ( v 2 , R 2 ) = π ( v 1 , R 1 ) where v 2 ∈ V 1,β . Proof. Let g j , gk and gm be the first, the second, and the third generator in R 1 , respectively, and δ be a sequence of generators. Case i = 1. v 1 ∈ V 1,β , so

π ( v 1 , R 1 ) is π ( v 2 , R 2 ).

Case i = 2. Because v 1 ∈ V 2,β , ( v 1 ∗ g j ) ∈ V 1,β . Let R 1 = g j ⊕ δ, v 2 = v 1 ∗ g j , and R 2 = δ ⊕ g j . By Lemma 1, π ( v 1 , R 1 ) = π ( v 1 , g j ⊕ δ) = π ( v 1 ∗ g j , δ ⊕ g j ) = π ( v 2 , R 2 ). Case i = 3. Subcase g j  g 2 . Because v 1 ∈ V 3,β , ( v 1 ∗ g j ∗ gk ) ∈ V 1,β . Let R 1 = ( g j ⊕ gk ) ⊕ δ, v 2 = v 1 ∗ ( g j ⊕ gk ), and R 2 = δ ⊕ ( g j ⊕ gk ). By Lemma 1, π ( v 1 , R 1 ) = π ( v 1 , ( g j ⊕ gk ) ⊕ δ) = π ( v 1 ∗ ( g j ⊕ gk ), δ ⊕ ( g j ⊕ gk )) = π ( v 2 , R 2 ). Subcase g j = g 2 . Since g 2 g 2 is not a generator sequence of a cycle, gk  g 2 . Because v 1 ∈ V 3,β and gk  g 2 , ( v 1 ∗ g j ∗ gk ∗ gm ) ∈ V 1,β . Let R 1 = ( g j ⊕ gk ⊕ gm ) ⊕ δ, v 2 = v 1 ∗ ( g j ⊕ gk ⊕ gm ), and R 2 = δ ⊕ ( g j ⊕ gk ⊕ gm ). By Lemma 1, π ( v 1 , R 1 ) = π ( v 1 , ( g j ⊕ gk ⊕ gm ) ⊕ δ) = π ( v 1 ∗ ( g j ⊕ gk ⊕ gm ), δ ⊕ ( g j ⊕ gk ⊕ gm )) = π ( v 2 , R 2 ). 2 For example, let C 1 = π ( v 1 , R 1 ) where v 1 = 4321 and R 1 = g 2 g 3 g 2 g 3 . For symbol β = 2, we know v 1 ∈ V 3,2 , then ∃π ( v 2 , R 2 ) = π ( v 1 , R 1 ), where v 2 = v 1 ∗ g 2 g 3 g 2 = 2431 ∈ V 1,2 and R 2 = g 3 g 2 g 3 g 2 . 3. Algorithm This section presents an efficient algorithm for finding a minimum feedback vertex set in a rotator graph. First, we discuss how to find the FVS in a rotator graph as follows: Let π ( v , R ), π ( v 1 , R 1 ), and π ( v 2 , R 2 ) be directed cycles in an n-rotator graph, and symbol β ∈ N.

452

C.-J. Kuo et al. / Information Processing Letters 109 (2009) 450–453

Case β = 1. Let v 1 ∈ V i ,1 for 1  i  3. We know from Lemma 2 that there exists π ( v 2 , R 2 ) = π ( v 1 , R 1 ) where v 2 ∈ V 1,1 . Remove V 1,1 and thus all π ( v 1 , R 1 )s are disconnected where v 1 ∈ V i ,1 for 1  i  3. Case β = 2. Let v 1 ∈ V i ,2 for 1  i  3. We know from Lemma 2 that there exists π ( v 2 , R 2 ) = π ( v 1 , R 1 ) where v 2 ∈ V 1,2 . Let v ∈ V = {21s3 . . . sn , 2s2 1 . . . sn }, which is included in case β = 1. By Lemma 1, there exists π ( v , R ) = π ( v 1 , R 1 ) for some π ( v 1 , R 1 )s, and these π ( v , R )s are disconnected according to the above case β = 1. Remove (V 1,2 − V ) and thus all π ( v 1 , R 1 )s are disconnected where v 1 ∈ V i ,2 for 1  i  3.

.. . Case β = n − 2. Let v 1 ∈ V i ,n−2 for 1  i  3. We know from Lemma 2 that there exists π ( v 2 , R 2 ) = π ( v 1 , R 1 ) where v 2 ∈ V 1,n−2 . Let v ∈ V = {(n − 2)1s3 . . . sn , (n − 2)s2 1 . . . sn , (n − 2)2s3 . . . sn , (n − 2)s2 2 . . . sn , . . . , (n − 2)(n − 3)s3 . . . sn , (n − 2)s2 (n − 3) . . . sn }. By Lemma 1, there exists π ( v , R ) = π ( v 1 , R 1 ) for some π ( v 1 , R 1 )s, and these π ( v , R )s are disconnected according to the above cases β = 1, 2, . . . , n − 3. Remove (V 1,n−2 − V ) and thus all π ( v 1 , R 1 )s are disconnected where v 1 ∈ V i ,n−2 for 1  i  3. Case β = n − 1. Let v 1 ∈ V i ,n−1 for 1  i  3. We know from Lemma 2 that there exits π ( v 2 , R 2 ) = π ( v 1 , R 1 ), where v 2 ∈ V 1,n−1 . Let V = {(n − 1)1s3 . . . sn , (n − 1)s2 1 . . . sn , (n − 1)2s3 . . . sn , (n − 1)s2 2 . . . sn , . . . , (n − 1)(n − 2)s3 . . . sn , (n − 1)s2 (n − 2) . . . sn }, and then V = V 1,n−1 . Because V = V 1,n−1 and all π ( v , R )s for v ∈ V are disconnected according to the above cases β = 1, 2, . . . , n − 2, we do not remove V 1,n−1 . Thus all π ( v 1 , R 1 )s are disconnected where v 1 ∈ V i ,n−1 for 1  i  3. Case β = n. Although we do not remove V 1,n , all π ( v 1 , R 1 )s are disconnected where v 1 ∈ V i ,n for 1  i  3. (The same as the case β = n − 1.) In summary, we remove the nodes given above, which result in all directed cycles in an n-rotator graph disconnected. The efficient algorithm for finding FVS in rotator graphs is as follows: Algorithm FVS_Rotator For each node v in an n-rotator graph do If v is an F -permutation then add v to FVS Enddo For example, our algorithm generates the FVS in a 4rotator graph = {1234, 1243, 1324, 1342, 1423, 1432, 2341, 2431} and the FVS in a 5-rotator graph = {12345, 12354, 12435, 12453, 12534, 12543, 13245, 13254, 13425, 13452, 13524, 13542, 14235, 14253, 14325, 14352, 14523, 14532, 15234, 15243, 15324, 15342, 15423, 15432, 23415, 23451, 23514, 23541, 24315, 24351, 24513, 24531, 25314, 25341, 25413, 25431, 34512, 34521, 35412, 35421}. Since there are n! nodes in an n-rotator graph, Algorithm FVS_Rotator checks every node only once and thus

the time complexity is O(n!). In other words, the algorithm has linear time complexity in terms of the number of nodes in the rotator graph. Theorem 1. Any directed cycle in an n-rotator graph contains at least one F -permutation, where n > 2. Proof. Let C 1 = π ( v 1 , R 1 ) be a directed cycle in an nrotator graph. By Lemma 1, there exists a directed cycle C 2 = π ( v 2 , R 2 ) = C 1 where the first generator of R 2 is the highest dimension generator among R 2 . Let the first generator of R 2 be gk and v 2 = s1 s2 . . . sn . Because there is no generator in C 2 whose dimension is higher than that of gk , symbols s1 , s2 , . . . and sk must be the first k symbols of all nodes in C 2 . Since we do not consider g 2 g 2 as a directed cycle, k must be greater than or equal to 3. Directed cycle C 2 starts from and ends with the node v 2 , and the next node of v 2 in C 2 is v 2 ∗ gk , which is s2 s3 . . . sk s1 sk+1 . . . sn , so all symbols of s2 , s3 , . . . , and sk must be shifted to the first position in at least one of the nodes in C 2 . Let si be the smallest symbol among s1 , s2 , . . . and sk . As mentioned previously, si must be shifted to the first position in at least one of the nodes, say P , in directed cycle C 2 . Clearly, si is the smallest symbol among the first k symbols of P for k  3, so we conclude that P is an F -permutation. 2 Theorem 2. Algorithm FVS_Rotator can correctly find an FVS in an n-rotator graph. Proof. By Theorem 1, every directed cycle in an n-rotator graph contains at least one F -permutation. Algorithm FVS_Rotator adds all F -permutation’s to FVS. Therefore, if we remove the FVS from the n-rotator graph, all directed cycles become disconnected. 2 Theorem 3. The size of the FVS for an n-rotator graph generated by Algorithm FVS_Rotator is n!/3, which is minimum. Proof. Algorithm FVS_Rotator selects all F -permutation’s of a rotator graph and adds them to the FVS. An F -permutation is a node whose first symbol is smaller than both of its 2nd and 3rd symbols. In an n-rotator graph, there are (n − 1) ∗ (n − 2) ∗ (n − 3)! F -permutation’s with leading symbol 1 because (n − 1) symbols and (n − 2) symbols can be arranged in the 2nd position and 3rd position of a node, respectively. As to the symbols 2, 3, . . . , and (n − 2) in the leading position, the amount of F -permutation’s are (n − 2) ∗ (n − 3) ∗ (n − 3)!, (n − 3) ∗ (n − 4) ∗ (n − 3)!, . . . , and 2 ∗ 1 ∗ (n − 3)!, respectively. The total number of F permutation’s is:

(n − 1) ∗ (n − 2) ∗ (n − 3)! + (n − 2) ∗ (n − 3) ∗ (n − 3)! + · · · + 2 ∗ 1 ∗ (n − 3)!  = (n − 1) ∗ (n − 2) + (n − 2) ∗ (n − 3)  + · · · + 2 ∗ 1 ∗ (n − 3)!   = n ∗ (n − 1) ∗ (n − 2)/3 ∗ (n − 3)! = n!/3.

C.-J. Kuo et al. / Information Processing Letters 109 (2009) 450–453

In addition, since there are n!/3 disjoint directed cycles of length 3 in an n-rotator graph, whose generator sequence is g 3 g 3 g 3 . Thus, the minimum size of the FVS for an n-rotator graph is n!/3 [8], which is the same as our result. 2 Corollary 1. Let v = s1 s2 s3 . . . sn be a node in an n-rotator graph and s j = min{s1 , s2 , s3 }. If j = 1, exchanging symbol s1 with symbol s j for every node in the original FVS will obtain a new FVS including node v, and the size of the new FVS is still n!/3. Proof. Let RGn be an n-rotator graph, and F n be an FVS of RGn generated by Algorithm FVS_Rotator. There exists no directed cycle in the (RGn − F n ), which is denoted by NCn . Since rotator graphs are vertex-symmetric, there exists no directed cycle in the NCn , which is generated by exchanging symbol si with s j for all nodes in the NCn for 1  i, j  n. Let RGn and F n be generated by exchanging symbol si with s j for all nodes in the RGn and F n , respectively. The NCn equals (RGn − F n ). So, the F n is still a minimum FVS in the n-rotator graph. Let v = s1 s2 s3 . . . sn be a node in RGn and s j = min{s1 , s2 , s3 }. If j = 1, then F n is the FVS including node v. If j = 1, let F n be the FVS generated by exchanging symbol s1 with s j for every node in F n . Therefore, F n is the FVS including node v. In addition, | F n | = | F n | = n!/3. 2 4. Conclusions This paper presents an efficient algorithm for finding a minimum FVS in an n-rotator graph in O(n!) time. In other words, the proposed algorithm obtains the optimal result with linear time complexity in terms of the number of nodes in the rotator graph. In addition, using a simple symbol exchange mechanism for the original FVS, we can assign an arbitrary node in an n-rotator graph to a new FVS, where the size of the newly generated FVS is still minimum.

453

Acknowledgement This work was partly supported by the National Science Council of the Republic of China under Grants NSC94-2213E-011-053 and NSC95-2221-E-011-017. References [1] R. Bar-Yehuda, D. Geiger, J.S. Naor, R.M. Roth, Approximation algorithms for the feedback vertex set problem with applications to constraint satisfaction and Bayesian inference, SIAM J. Comput. 27 (4) (1998) 942–959. [2] I. Caragiannis, C. Kaklamanis, P. Kanellopoulos, New bounds on the size of the feedback vertex set on meshes and butterflies, Inform. Process. Lett. 83 (5) (2002) 275–280. [3] P.F. Corbett, Rotator graphs: An efficient topology for point-to-point multiprocessor networks, IEEE Trans. Parallel Distrib. Syst. 3 (5) (1992) 622–626. [4] M.M. Flood, Exact and heuristic algorithms for the weighted feedback arc set problem: A special case of the skew-symmetric quadratic assignment problem, Networks 20 (1990) 1–23. [5] R. Focardi, F.L. Luccio, D. Peleg, Feedback vertex set in hypercubes, Inform. Process. Lett. 76 (1–2) (2000) 1–5. [6] M.R. Garey, D.S. Johnson, Computers and Intractability, Freeman, San Francisco, CA, 1979. [7] D. Gusfield, A graph theoretic approach to statistical data security, SIAM J. Comput. 17 (3) (1998) 552–571. [8] C.C. Hsu, H.R. Lin, H.C. Chang, K.K. Lin, Feedback Vertex Sets in Rotator Graphs, in: Lecture Notes in Comput. Sci., vol. 3984, 2006, pp. 158–164. [9] D.S. Johnson, Approximation algorithms for combinatorial problems, J. Comput. System Sci. 9 (1974) 256–278. [10] R. Kralovic, P. Ruzicka, Minimum feedback vertex sets in shufflebased interconnection networks, Inform. Process. Lett. 86 (4) (2003) 191–196. [11] F.L. Luccio, Exact minimum feedback vertex set in meshes and butterflies, Inform. Process. Lett. 66 (2) (1998) 59–64. [12] A. Silberschatz, P.B. Galvin, G. Gagne, Operating Systems Concepts, 6th ed., John Wiley and Sons, Inc., New York, 2003. [13] F.H. Wang, Y.L. Wang, J.M. Chang, Feedback vertex sets in star graphs, Inform. Process. Lett. 89 (4) (2004) 203–208. [14] M. Yannakakis, Node-deletion problem on bipartite graphs, SIAM J. Comput. 10 (1981) 310–327.