Maximum Clique Conformance Measure for Graph Algorithms Abdulmutaleb Alzubi Jadarah University Dept. of Computer Science Irbid, Jordan alzoubi3@yahoo.com Mohammad Al-Haj Hassan Zarqa University Dept. of Computer Science Zarqa, Jordan hajhasan5@hotmail.com Mohammad Malkawi Jordan University for Science and Technology, Dept. of Software Engineering, Irbid, Jordan mmalkawi@aimws.com ABSTRACT The Graph Problem (GCP) is an essential problem in graph ory, and it has many applications such as exam scheduling problem, register allocation problem, timetabling, and frequency assignment. The maximum problem is also anor important problem in graph ory and it arises in many real life applications like managing social networks. These two problems have received a lot of attention by scientists, not only for ir importance in real life applications, but also for ir oretical aspect. Solving se problems however remains a challenge, and proposed algorithms for this purpose apply to rar small graphs, whereas many real life application graphs encompass hundreds or thousands of nodes. This paper presents a new measure for evaluating efficiency of graph coloring algorithms. The new measure computes conformance index (CCI) of a graph coloring algorithm. CCI measures rate of deviation of a coloring algorithm from maximum during process of coloring a graph. The paper presents empirical measurement for two coloring algorithms proposed by authors. General Terms Algorithms, Graph. Keywords Algorithms, Clique conformance Index, Convergence Rate, Rate, Graph, Maximum Clique. 1. INTRODUCTION An undirected graph G is an ordered pair (N, E) where N is a set and E is a set of non-directed Edges between nodes. Two nodes are said to be adjacent if re is an edge between m. An edge can carry a weight in weighted graphs; for example in a graph used for exam scheduling, weight of an edge can be used to specify number of students registered in two adjacent classes. The importance of studying graphs comes from ir ability to model many real life problems, such as computer and telecomm networks, social networks, resource allocation problems, and many more [1, 4, 12]. Graph coloring is process of labeling graph's nodes (or edges) with special labels (colors) such that no two adjacent nodes (or edges) have same color. An interesting coloring problem is four colors orem, which colors certain planar graphs with exactly four colors. Anor interesting problem is problem of Clique coloring, which is a variation of classical vertex coloring graph coloring. Clique coloring requires that only every inclusion-wise maximal (not extendable) contains at least two different colors [2], instead of requiring that two end points of each edge have two different colors. Clique in an undirected graph G is a subset of nodes N such that for every two nodes in N, re exists an edge connecting both nodes. The maximum is that one which has maximum number of nodes. Finding minimum number of colors for a given graph or finding maximum in a graph is considered NP-complete, i.e., y run in a nonpolynomial time. Detecting maximum of a graph can be very useful for finding a minimal coloring for a graph, where a k--colorable graph has a k chromatic number [2]. Although, this may not hold for all graphs, e.g., 2- and 3--colorable graphs, k--colorable can be a reasonable bound for chromatic number of a graph [2]. Hence, if a coloring heuristic algorithm manages to first color nodes in a with k colors (k--colorable) before moving to or nodes, n algorithm is more likely to find a minimal coloring of graph. The problem of finding maximum in an undirected graph is considered one of NP-complete problems. This means that re is no known algorithm for solving this problem in a polynomial time, except for those which have been developed for specialized graphs such as planer graphs or perfect graphs where problem can be solved in a polynomial time [2, 6, 7, 8, 14, 15]. Solving this problem can also be done in polynomial time if k is constant, where k is number of nodes in ; in this case all subgraphs of at least k nodes will be checked wher y form a or not. This method is called brute force algorithm. The main objective of this paper is to develop a measure to evaluate level of proximity of coloring algorithms to maximum detection algorithm. The measure will show if coloring algorithm colors nodes of maximum first, and if not, it will show level of deviation from. This measure will be used to evaluate efficiency of two coloring algorithms. The coloring algorithms have been tested against special graphs such as 4-colorable graphs, triangle free girth graphs and ors [12]. Test graphs are generated randomly, using a tool developed by researchers to generate random graphs with varying densities. Section 2 will describe conformance index measure (CCI). Section 3 will describe two coloring algorithms used in this study for evaluation under CCI measure. Section 4 will present experiment environment and results. Conclusions will be presented in section 5.
2. CLIQUE CONFORMANCE INDEX In order to evaluate efficiency of graph coloring algorithms a new measure is proposed, which measures ability of coloring algorithm to assign colors to nodes of a before it moves to or nodes in graph, starting with largest first. This measure is called conformance index (CCI). The purpose of this new measure is not to detect s in each subgraph; rar its purpose is to analyze efficiency of coloring algorithms in terms of how closely each algorithm follows maximum based coloring of a graph. The definition and computation of CCI is given below. The of each subgraph will be fully recognized and detected using a brute force algorithm. Then, coloring path taken by coloring algorithm is traced and tested against s of graph. A complete matching exists if algorithm colors all nodes of before it moves to anor subgraph. In this case algorithm will consume k colors for a k-colorable. A partial matching exists when algorithm colors nodes from and n moves to anor set of nodes before it returns back to color rest of nodes. In this case, algorithm is not guaranteed to use only k colors. The efficiency of algorithm will be determined by rate of convergence between set of colored nodes and nodes of and by distance between nodes colored outside and nodes of. The rate of convergence ( ) is defined as follows. Let number of nodes in a be k and let coloring algorithm colors l nodes, where l k and all l nodes are included in set of k nodes. The algorithm will use l colors to color l nodes. Then algorithm begins to color nodes outside. The rate of convergence is given by = l/k, which measures ability of algorithm to color nodes first. In order to account for number of extra colors consumed due to moving away from nodes, deviation rate of each node colored outside to which node belongs is computed. The deviation rate of node N i in graph G is defined as follows. Let N i be part of nodes, i.e., (N i k). Define order of coloring a node R(N i ) to be sequence order of coloring node N i ; so if node N i is assigned a color after coloring R-1 nodes, n order of coloring N i is R(N i ). The deviation rate of node N i is given by = (R(N i )-k)/ R(N i ), where k is size of and R(N i ) is order of coloring node (N i ). is set to zero if R(N i ) < k. For example, assume that size of a is 4 in a 7 nodes graph (k=4); nodes are {1, 2, 3, 4}. Assume that coloring algorithm colors graph in following sequence (1, 2, 5, 6, 3, 7, 4). Two nodes (1 and 2) are assigned colors before algorithm skips to node 5 which does not belong to. Hence, convergence rate = 2/4 =.5. The deviation rate for nodes 1 and 2 is zero since order of se nodes is smaller than size. And deviation rate for node 3 (colored outside sequence) is given by = (5-4)/6 =.17. The deviation rate of node 4 is = (7-4)/7 =.43. The average deviation rate for nodes is: k i / k (.17.43) / 4.15 (1) i 1 If order of coloring for nodes {1, 2, 3, 4} was less than or equal to four, n convergence rate will be 4/4 = 1 and average deviation rate will be zero. The Clique Conformance Index (CCI) combines both convergence and deviation rates into one index. CCI measures overall efficiency of algorithm and is defined as follows: /. CCI measures ability of algorithm to stick to nodes and how quickly it returns to if it wanders away from it. Note that CCI increases when more nodes are colored from within nodes (larger values of ) and when algorithm does not move far before it returns to (smaller values of ). In above example,.5/.15 = 3.6. The larger value of CCI, better is algorithm. CCI is set to N when =. CCI easily accounts for odd cases, such as when convergence rate is very high say.9 and deviation rate of this node is very large, say.9 (CCI is.9/.9 =1). This gives a very low conformance index. However, if node distance is small, say.1, n CCI is.9/.1 = 9, which means that algorithm had returned to quickly and now it can resume coloring of nodes in. Next, CCI measure is applied to two algorithms, namely largest degree algorithm and largest degree with saturation algorithm. 3. EVALUATION of TWO GRAPH COLORING ALGORITHMS in [12], authors introduced what y called "largest Degree () Algorithm for Exam Scheduling using Graph ". That algorithm depends on an approach that employs notion of Largest Degree to perform required task. It is given here for completeness, and For purpose of comparison between it and new algorithm prosed in this research: 3.1 Largest Degree () Algorithm 1. Sort nodes based on degree in descending order. 2. Select first node in list; Color node with smallest available color 3. List neighbors of selected node 4. Sort neighbors of selected node in descending order based on degree, if two or more nodes have same degree, n one with largest ID is ordered first. 5. Color neighbors of selected node, starting with first node in list, for each node; check all its neighbors which have already been colored. Color node with smallest available color 6. When all neighbors of selected node have been colored; go to next node in main list of nodes 7. Go to step 3 Stop when all nodes have been colored. The has been shown to succeed in coloring some special graphs with minimum number of colors [12]. The algorithm colors one of famous 5-coloring graphs with 4 colors. The algorithm also colors all 4-coloring planer graphs with exactly 4-colors. 6-triangulation graphs (known to be 5- colorables) will be colored by with exactly 5 colors. Triangle free girth graphs are colored by with smallest possible number of colors, i.e., chromatic number.
The performance of for randomly generated large graphs is yet to be investigated. One of driving motives for proposing algorithm was to derive exam schedules with minimal conflicts. The intuition was to detect a class whose students are registered in many or classes such that conflicts arise when scheduling classes to same time slot (or color). The was shown to produce efficient exam schedules [12]. However, it is not possible to generalize this result for very large graphs with varying densities. Therefore, performance of this algorithm will be tested using CCI measure. It has been shown that complexity of is O(n 2 ) [12]. When two or more nodes have same degree, largest degree algorithm uses node ID to resolve conflict. This is a simple solution, but has no relevance to strength or weakness of algorithm. A more efficient criterion is to select node with maximum saturation degree [11]. The term saturation degree (SD) refers to number of differently colored nodes adjacent to a particular node. For example, if node N i has 5 neighbors of which two are colored with two different colors, SD(N i )=2. Now if SD(N j ) = 3, n N j is said to have a larger saturation degree. Intuitively N j should be colored first because it has fewer choices than N i. The algorithm described above is modified and maximum saturation degree criterion is used to choose between two nodes having same degree. This algorithm is called Largest Degree with Saturation (). 3.2 Largest Degree with Saturation () Algorithm 1. Sort nodes based on degree in descending order. 2. Select first node in list; Color node with smallest available color. 3. List neighbors of selected node. 4. Sort neighbors of selected node in descending order based on degree, if two nodes have same degree, choose node with greater saturation degree. 5. Color neighbors of selected node, starting with first node in list. For each node; check all its neighbors which have already been colored. Color node with smallest available color 6. When all neighbors of selected node have been colored; go to next node in main list of nodes 7. Go to step 3 8. Stop when all nodes have been colored. In terms of complexity, requires one more iteration per node in order to find saturation degree, thus increasing complexity of to O(n 3 ). In next section, experiments used for evaluation of coloring algorithms using CCI measure with heavy, medium, and low densities respectively are described. 4. Performance Evaluation A JAVA program has been developed to generate random graphs with varying sizes and densities. The size of a graph, i.e., number of nodes in a graph is selected by user. Three densities are provided for each graph (heavy, medium, and low). The density of graph is determined by probability of two nodes being connected by a link. The probabilities used in this program are.75,.5, and.25 for The JAVA program implements and coloring algorithms besides brute force method used for detection and enumeration of nodes of maximal in graphs. The program will compute convergence rate, deviation rates for each node of, and conformance index CCI for each run. The results of test are shown in Table 1a and Table 1b. The results in Table 1a and Table 1b are average of several runs for and, where: 1. The number of nodes (input by user). 2. largest : generated by brute force method. 3. of colors: number of colors used to color graph. 4., and CCI: computed by program Both tables has three sections for low, medium and high densities. Low Density P=.25 Algorithm Convergence Rate / 25 4 5.92.11 3.41 5 4 7.75.3 2.37 1 4 12.68.67 1.2 2 5 2.58.73.78 5 5 39.59.76.53 1 6 66.31.72.44 Mediumr Density Algorithm P=.5 Converge nce Rate / 25 5 7..87.26 3.69 5 5 11.67.81.41 2.54 1 7 21.33.49.57.86 2 8 36..61.77.78 5 9 73.33.44.8.51 1 11 129..28.72.38 High Density P=.75 Converge nce Rate / 25 9 11.92.14 6.29 5 12 19.67.44 1.53 1 14 32.71.51 1.39 2 16 56.7.59 1.6 5 2 123.39.66.72 1 21 218.38.67.56 Table 1a: Summary of results of Algorithm Figures 1, 2 and 3 show conformance index for and for low, medium and high density graphs respectively. For lower number of nodes, both algorithms conform more closely to maximum in graphs. from maximum. The performs slightly better than algorithm for low and medium density graphs. The performance improvement of is more visible for heavy density graphs. Although, both algorithms perform poorly when number of nodes exceeds 1 nodes.
CCI of Colors CCI of Colors of Colors CCI Low Density P=.25 of Nodes Algorithm Convergence Rate / 25 4 5. 1.. 4. 5 4 7..75.28 2.41 1 4 11..68.67 1.1 2 5 19..58.71.8 5 5 37..4.74.54 1 6 64.67.31.74.4 Mediumr Density Algorithm P=.5 of Nodes Converge nce Rate / 25 5 4.79.93.21 3.75 5 5 9.7.81.38 2.63 1 7 15.1.49.55.9 2 8 34.33.61.73.82 5 9 39.42.44.79.55 1 11 126..28.72.41 High Density Algorithm P=.75 Converge of nce Rate / Nodes 25 9 11 1.. 9.33 5 12 18.7.41 3.62 1 14 31.76.57 3.41 2 16 55.65.61 1.6 5 2 118.38.61.59 1 21 214.4.69.57 Table 1b: Summary of results of Algorithm 1 8 6 4 2 7 6 5 4 3 2 1 Figure 3: CCI for and - Heavy Density 1 1 1 Figure 4: Minimum of Colors - Low Density Graphs 1 1 1 Figure 5: Minimum of Colors - Medium Density Graphs 14 Figure 1: CCI for and - Low Density Graphs 12 1 5 4 8 6 3 2 4 2 1 1 1 1 1 1 1 Figure 6: Minimum of Colors - Heavy Density Graphs Figure 2: CCI for and - Medium Density 25 4 2 3 2 1 15 1 5 1 1 1 Similar behavior is observed for number of colors consumed by and algorithms. The results are demonstrated in Figures 4, 5 and 6. In general, consumes less number of colors than. This is consistent with observation that has a better CCI. 1 1 1 Figure 7 shows number of colors consumed by and for 1 nodes and for low, medium and heavy density graphs. Table 2 ((a), (b), (c)) shows chromatic number for small graphs (less than 5 nodes) computed using exhaustive search method, and coloring provided by and. Both
of Colors 25 2 15 1 5 Figure 7: of Colors for 1 Nodes Low Medium High and achieved minimal coloring as chromatic number provided by exhaustive search method. The CCI index for both and for se small graphs is relatively large (3, 4 and 6 for low, medium and heavy density graphs). This result supports premise that a large CCI index is likely to produce minimal coloring schema by algorithms. (a) Densit y of Colors Time in Seconds 15 L 4 Less than 1 16 L 4 Less than 1 17 L 3 Less than 1 18 L 3 Less than 1 19 L 4 Less than 1 2 L 4 Less than 1 25 L 4 Less than 1 3 L 4 Less than 1 4 L 5 Less than 1 (b) Densit y of Colors Time in Seconds 15 L 4 Less than 1 16 L 4 Less than 1 17 L 3 Less than 1 18 L 3 Less than 1 19 L 4 Less than 1 2 L 4 Less than 1 25 L 4 Less than 1 3 L 4 Less than 1 4 L 5 Less than 1 (c) BackTracking Density of Colors Time in Seconds 15 L 4 2 Seconds 16 L 4 4 Seconds 17 L 3 26 Seconds 18 L 3 1.14 minutes 19 L 4 11.38 minutes 2 L 4 4 minutes 25 L 4 1 Hour 3 L 4 1.3 Hour 4 L 5 3 Hours Table 2: Comparing Between (a) Algorithm and (b) Algorithm with (c) Backtracking Unfortunately, and in this current research, coloring schema for larger graphs could not be compared since time complexity for exhaustive search method increases exponentially as number of nodes increases. Notice that Table 2 shows coloring time for and less than 1 second for 4 nodes or smaller graphs. 5. CONCLUSION This paper presented conformance index (CCI) as a new measure for efficiency of coloring algorithms. CCI is used to measure efficiency of two coloring algorithms, largest degree () and largest degree with saturation () algorithms. Both algorithms perform well for small graphs; y produce large CCI and use minimal number of colors. For larger graphs, both algorithms conform poorly to maximum. The coloring numbers with minimal (chromatic number) colors were not be compared due to time complexity associated with exhaustive coloring method. However, low CCI suggests that both and use more colors than minimal coloring. Furr investigation of CCI is required to establish more accurate correlation between CCI and minimal coloring of a graph. This is very useful since time complexity for finding minimal number of colors for large graphs is prohibitive. Therefore, a promising future work is to develop more efficient version of algorithm and develop it to deal with large graphs. 6. REFERENCES 1. Allen, M., Kumaran, G., & Liu, T. (22). A combined algorithm for graph-coloring in register allocation, Proceedings of Computational Symposium on Graph and its Generalizations, pp. 1 111. 2. Bacs o, G. S., et al, maximal s of graphs. SIAM J. Discrete Math., Vol. 17, No. 3, pp. 361 376, 24. 3. Balas, E., & Yu, C. S. (1986). Finding a maximum in an arbitrary graph. SIAM J. Comput, Vol 15, No. 4, pp 154-168. 4. Balasundaram, B., and Butenko, S., (211), Clique relaxations in social network analysis: The maximum k- plex problem, Operations Research, Vol. 59, Issue 1, pp. 133 142. 5. Caramia, M., & Dell Olmo, P. (21). Iterative Extension of a Maximum Clique. Naval Research Logistics (NRL), Vol. 48, Issue 6, pp. 518 55. 6. D efossez, D., (26), Clique-coloring some classes of odd-hole-free graphs. Journal of Graph Theory, Vol. 53, Issue 3, pp. 233 249. 7. Duffus, D., et al, (1991), Two-colouring all two-element maximal anti-chains. J. Combinatorial Theory Ser. A, Vol. 57, Issue 1, pp. 19 116. 8. Gravier, S., Ho`ang, C. T., and Maffray, F., (23), hypergraph of maximal s of a graph with no long path, Discrete Math., Vol. 272, No. (2-3), pp. 285 29. 9. Hosseini, S.H., et al., (199). Analysis of a Graph Based Distributed Load Balancing Algorithm. Journal of Parallel & Distributed Systems, Vol. 1., Issue 2, pp. 16 166
1. Jensen, T. R., & Toft, B. (1994). Graph Problems, John Wiley & Sons, USA. 11. Magnus, M. H. (1991). Frugal methods for independent set and graph coloring problems. PhD sis, The State University of New Jersey, New Brunswick, New Jersey. 12. Malkawi, M., Hajhassan, M., & Hajhasan, O. (28). New exam scheduling algorithm using graph coloring. International Arab Journal for IT (IAJIT)Vol. 5, No. 1, pp 8-86. 13. Robson, J. M. (1986). Algorithms for maximum independent set. J. Algorithms, Vol. 7, pp 425-44. 14. Tomita, A., Tanaka, A., & Takahashi, H. (26). The worst-case time complexity for generating all maximal s and computational experiments, Theoretical Computer Science 363 (26), pp 28 42. 15. Xiao, M., (21), A Simple and Fast Algorithm for Maximum Independent Set in 3-Degree Graphs, Proceedings of 4 th International Workshop, WALCOM: Algorithms and Computations, pp. 281-292.