scieee AI-readable full text Open interactive document viewer

Improving bounds on large instances of graph coloring

Sardà, David

Abstract

This thesis explores new methods, using both vertex cover and exact graph coloring algorithms in addition to our implementation of the state of the art, to develop a hybrid algorithm that on most instances is able to tighten the bounds or determine the optimal number of colors outright.

Full text

MASTER IN INNOVATION AND RESEARCH IN INFORMATICS SPECIALIZATION IN ADVANCED COMPUTING FACULTAT D’INFORMÀTICA DE BARCELONA (FIB) UNIVERSTIAT POLITÈCNICA DE CATALUNYA (UPC) – BARCELONATECH IMPROVING BOUNDS ON LARGE INSTANCES OF GRAPH COLORING Defense date: October 22, 2019 Author: David Sardà Thesis supervisor: Ken-ichi Kawarabayashi [NII JST ERATO] Tutor: Javier Larrosa [FIB CS] Abstract Graph coloring is one of the most widely known NP hard problems in the field of computer science. Due to its numerous applications, a high variety of solutions to the problem have been explored through the years. Despite this, research on large instances of the problem has been scarce, mainly due to its practical complexity. These solutions deal mainly with heuristics, and in most cases are only able to determine an upper bound on the optimal number of colors, or an interval in which it is contained within. This thesis explores new methods, using both vertex cover and exact graph coloring algorithms in addition to our implementation of the state of the art, to develop a hybrid algorithm that on most instances is able to tighten the bounds or determine the optimal number of colors outright. In addition, we show that given a good enough vertex cover algorithm, a much simpler large graph coloring heuristic algorithm with an efficiency close or better than the state of the art is possible. Contents 1 Introduction and state of the art . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 HybridColoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.1 Main Core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.2 ExactCoreLb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.3 VertexCoverColoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.4 SaturationColoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3 Experimental Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.1 First experiment set . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.2 Second experiment set . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4 Summary and future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2 Improving bounds on large instances of graph coloring 1 Introduction and state of the art Graph coloring (GC) is a fundamental problem in computer science, explored extensively through the years due to its many practical applications. Some of these are frequency assignment [ 1 ], timetabling [ 2 ], printed circuit testing [ 3 ], crew scheduling [ 4 ] and manufacturing [5], among many others. Graph coloring is defined as, given a graph G= ( V,E ), being V the set of its vertices, and E the set of its edges, we require to assign for each v∈V a color in { 1 ,...,c} , in such a way that the endpoints of every edge get different colors, or technically ∀v1,v2∈V,v16= v2 , given the color assignments ( v1,ci ) and ( v2,cj ) , if ∃e∈E such that e= ( v1,v2 ) , then for a valid color assignment, ci6= cj. The objective of the problem is to minimize the number of colors used, as obviously it’s trivial to find a solution in any graph if c= |V| , as we can just assign a different color to every vertex. Despite its usefulness, the dificulty of graph coloring is of NP-hardness [ 10 ], even to approximate within n1−² [ 9 ]. Because of this, a variety of solutions have been proposed, mostly dealing with small, manageable cases [18] [17] [8]. However, as information technology is improving on recent years, high quantities of large data networks, such as social, biological and information networks, have been appearing more frequently than ever. These real-world networks are larger everyday, and they are commonly sparse with complex structural patterns [11] [12] [13]. Despite this, research on large graph has been scarce. Rossi et al. [ 19 ] proposed a way of coloring large graphs with a combination which leverages triangles, triangle-cores and other properties and their combinations, including a recoloring tecnique. Peng et al. detailed a method which partitions a graph into connected components using vertex-cut to then color them respectively [ 7 ]. Verma et al. developed an algorithm for GC by successively coloring k-cores with decreasing k values, and also explored clique-finding for large graphs [ 6 ]. Lin, Jinkun, et al. [ 14 ] proposed a heuristic that used a combination of heuristics, clique finding, and reduction rules. Page 3 of 17 Improving bounds on large instances of graph coloring 2 HybridColoring Our goal is to make an scalable, efficient graph coloring algorithm that could process properly both small and large graphs. In this regard, we propose a hybrid algorithm that combines and repurposes previous state of the art algorithms to come with a solution that’s more accurate and works well with any kind of graph. We also believe that the best way to tackle graph coloring in a general way is to use not only one technique but several, to try to rely on each of their strengths. In the following subsections we will describe the main core of the algorithm proposed and all of its components. 2.1 Main Core The algorithm implemented uses a combination of the state of the art large graph coloring algorithm described in [ 14 ], implemented by us fully in C++, and an exact graph coloring algorithm described in [17], used as a blackbox. We also developed different versions of our algorithm to compare the results obtained, and depending of the version described we also makes use of a vertex cover algorithm described in [16] as a blackbox. First of all, let’s begin by describe the core of our hybrid algorithm, as can be seen in the following pseudocode: Algorithm 1 HybridColoring Input: A graph G=(V,E) Output A coloring assignment αand a lower and upper bound lb,ub 1: Gk←G 2: lb ←0,ub ← |V|,ub∗←|V| 3: α← ;,α∗←;,Cores ← ; 4: for i←1 to cdo 5: lb ←max(lb,FindClique(Gk)) 6: [α,Cores,ub]←CoreColorKernel(Gk) 7: [α,lb]←ExactCoreLb(ub,Cores,Gk,α) 8: [α∗,ub∗]←CalculateColoring(ub,lb,Gk) 9: if ub∗ < ub then 10: α←α∗ 11: ub ←ub∗ 12: return [α,lb,ub] As we can see, the core of the algorithm is not too extensive because most of the Page 4 of 17 Improving bounds on large instances of graph coloring calculations are done by different calls throughout the code. Let’s then analyze its functionality. After initialization on lines 1 to 3, we calculate a tentative lower bound on lines 4 to 5 by using the clique finding technique described in [ 14 ]. As this function is a heuristic, we call it an arbitrary number of times c(set to 10 on our experiments). Following that, on line 6 we use part of the graph coloring technique described on the same article to both obtain a first coloring (and hence a new upper bound) and a classification of every node in the graph by different cores (the concept of core decomposition of the nodes in a graph is described in [15]). Afterwards, on line 7, we use that upper bound, and that core classification to call our own procedure in order to search further for a better lower bound, a technique that is detailed on the next pseudocode on this section. We have to note that a coloring is passed and recieved. This is because, if the graph is small enough after calculating the lower bound, we will just use the exact graph coloring algorihtm to search for the optimal coloring. Finally on lines 8 to 12, we obtain a new coloring by either the saturation based algorithm explained in [ 14 ], or a simple vertex cover based algorithm explained on a pseudocode further on this section. It is to note that all the calculations for the lower bound are performed as early as possible to make the upper bound search more efficient. Now, let’s delve into the main functions that constitute this algorithm. First of all, we will discuss the function that we designed to improve the lower bound of the instance processed. It is based on using the core decomposition of a graph to reach the innermost nodes, and then processing them with an exact graph coloring algorithm to get a tentative lower bound. Obviously this is achievable because if we have a lower bound for a subgraph, we have the same lower bound for the whole graph. Page 5 of 17 Improving bounds on large instances of graph coloring (a) FindClique (b) CoreDecomposition (c) ExactCoreLb (d) CalculateColoring Figure 1: HybridColoring example Page 6 of 17 Improving bounds on large instances of graph coloring 2.2 ExactCoreLb Algorithm 2 ExactCoreLb Input: A graph G= ( V,E ), an upper bound ub , a core decomposition Cores , a coloring α Output A new lower bound lb, a new coloring if the resulting graph is small 1: Limi tReached ←f alse 2: CoreSize ←k 3: while not Limi tReached do 4: newLB ←ub 5: MainCore ← ; 6: for i←1 to CoreSize do 7: auxNode ←RandomNode(CoresMaxLevel ) 8: MainCore ←MainCore ∪auxNode 9: Cores ←Cores \auxNode 10: Timeout ←f alse 11: while not LimitReached and not Timeout do 12: newLB ←newLB −1 13: [LimitReached,Timeout]←ExactColoring(s,MainCore,newLB) 14: if Timeout then 15: CoreSize ←CoreSize −nd 16: if LimitReached then 17: newLB ←newLB +1 18: G←FilterTrivialNodes(lb) 19: if |V| < minNodes then 20: LimitReached ←f alse 21: α∗←; 22: while Ub >1 and not LimitReached do 23: ub ←ub −1 24: [α∗,Limi tReached]←ExactColoring(G,ub) 25: α←α∗ 26: return [newLB,α] This algorithm uses the one described in [ 17 ] to search the innermost core of the graph to try and find a better lower bound. We are interested in finding a coloring with as lower number of colors as possible while obviously being a valid coloring to search for the highest lower bound possible using this method. To mitigate how much time an Page 7 of 17 Improving bounds on large instances of graph coloring exact graph coloring algorithm can spend searching, we will have a time limit on every call we make, and if we surpass it we will iterate again through the main loop, where we will create a smaller subgraph to try and make the search process easier. Let’s go quickly through the lines of the algorithm. After the initializations and entering the main loop, on lines 6 through 9 we construct the subgraph. Following that, we will try and search for the coloring using the exact algorithm on the rest of the main loop, on lines 10 through 17. To do so, we will start by a number of colors equal to the upper bound minus one, as we know the upper bound represents a valid coloring. We will keep trying and decreasing the number of colors until either we find a number of colors which it’s not possible to color the subgraph or we time out. If we find this not colorable number of colors we know it increased by one is the new lower bound for the complete graph. If we timeout we just decrease the number of nodes on the subgraph and try again. Nevertheless, lines 19 through 25 have a different function entirely. Basically, we take advantage of the fact that we have a new (probably better) lower bound and access to an exact graph coloring algorithm to make sure that if the graph is small enough, we just process it with the exact algorithm to then know the optimal number of colors for the general graph, and calculate a valid coloring with it. Finally we return the coloring (which is the old one unless we have calculated it because the graph is small), and a new lower bound. It has to be noted that on line 18 we filter all trivial nodes. This is a very useful process to simplify the graph. Basically, we eliminate from the graph all the nodes that have a number of edges lower than the lower bound, as they are sure to be able to be colored properly. Then we search for independent sets from the graph on which all its nodes have a lower number of edges than the lower bound. This last process is explained in [14], based on their reduction rule. 2.3 VertexCoverColoring Let’s delve now into the algorithm used to color the entire graph after finishing the lower bound calculation. There are two versions of this algorithm, and either of them achieves the overall coloring of the graph. In this version, we are using a vertex cover algorithm described in [ 16 ] to achieve the coloring. The algorithm is simple, the pseudocode is as follows: Page 8 of 17 Improving bounds on large instances of graph coloring the execution right away where it wasn’t possible before. Furthermore, using vertex covers this algorithm shows a way to match the state of the art algorithm on most cases experimented with a much more simple approach, though difficulties on its current implementation makes it difficult to determine its full potential. The results displayed in this thesis further demonstrates the importance of having a middle ground between small and large graph coloring algorithms to provide a needed solution that doesn’t rely on any characteristics of the input graphs. Nevertheless it also seems obvious that each technique has its strengths, so we believe that further combining different graph coloring techniques is the way to go. Also, given that the same instance can be explored at the same time by any number of techniques, we believe that parallelizing could lead to further improvements. Page 15 of 17 Bibliography [1] Smith, D. H., Hurley, S., & Thiel, S. U. Improving heuristics for the frequency assignment problem. European Journal of Operational Research, 107(1), 76-86. 1998. [2] Burke, Edmund K., et al. A graph-based hyper heuristic for timetabling problems. Computer Science Technical Report No. NOTTCS-TR-2004-9, University of Nottingham. 2004. [3] Garey, M., Johnson, D., & So, H. An application of graph coloring to printed circuit testing. IEEE Transactions on circuits and systems, 23(10), 591-599. 1976. [4] Gamache, M., Hertz, A., & Ouellet, J. O. A graph coloring model for a feasibility problem in monthly crew scheduling with preferential bidding. Computers & operations research, 34(8), 2384-2395. 2007. [5] Glass, C. A. Bag rationalisation for a food manufacturer. Journal of the Operational Research Society, 53(5), 544-551. 2002. [6] Verma, A., Buchanan, A., & Butenko, S. Solving the maximum clique and vertex coloring problems on very large sparse networks. INFORMS Journal on computing, 27(1), 164-177. 2015. [7] Peng, Y., Choi, B., He, B., Zhou, S., Xu, R., & Yu, X. . Vcolor: A practical vertex-cut based approach for coloring large graphs. In 2016 IEEE 32nd International Conference on Data Engineering (ICDE) (pp. 97-108). IEEE. 2016, May. [8] Campêlo, M., Campos, V. A., & Corrêa, R. C. On the asymmetric representatives formulation for the vertex coloring problem. Discrete Applied Mathematics, 156(7), 1097-1111. 2008. [9] Zuckerman, D. Linear degree extractors and the inapproximability of max clique and chromatic number. In Proceedings of the thirty-eighth annual ACM symposium on Theory of computing (pp. 681-690). ACM. 2006, May. 16 Improving bounds on large instances of graph coloring [10] M. R Garey, & D.S. Johnson, Computers and Intractability: A Guide to the Theory of NP-Completeness, W.H. Freeman and Company, San Francisco. 1979. [11] Barabasi, A. L., & Oltvai, Z. N. Network biology: understanding the cell’s functional organization. Nature reviews genetics, 5(2), 101. 2004. [12] Newman, M. E., & Park, J. Why social networks are different from other types of networks. Physical review E, 68(3), 036122. 2003. [13] Adamic, L. A., Lukose, R. M., Puniyani, A. R., & Huberman, B. A. Search in power-law networks. Physical review E, 64(4), 046135. 2001. [14] Lin, J., Cai, S., Luo, C., & Su, K. A Reduction based Method for Coloring Very Large Graphs. In IJCAI, pp. 517-523. 2017. [15] Batagelj, V., & Zaversnik, M. An O (m) algorithm for cores decomposition of networks. arXiv preprint cs/0310049. 2003. [16] Akiba, T., & Iwata, Y. Branch-and-reduce exponential/FPT algorithms in practice: A case study of vertex cover. Theoretical Computer Science, 609, 211-225. 2016. [17] Zhou, Z., Li, C. M., Huang, C., & Xu, R. An exact algorithm with learning for the graph coloring problem. Computers & Operations Research, 51, 282-301. 2014. [18] Brélaz, D. New methods to color the vertices of a graph. Communications of the ACM, 22(4), 251-256. 1979. [19] Rossi, R. A., & Ahmed, N. K. Coloring large complex networks. Social Network Analysis and Mining 4.1 (2014): 228. 2014. Page 17 of 17