A hybrid heuristic graph coloring method

Through the hybrid heuristic graph coloring method, combined with the greedy crossover algorithm and the conditional grouping strategy, the coloring probability matrix is ​​dynamically adjusted to solve the problem of convergence and diversity balance in the graph coloring problem, and improve the solution accuracy and efficiency, especially on sparse graphs. performance.

CN114202609BActive Publication Date: 2024-09-06CHONGQING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111546250.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-16
Publication Date
2024-09-06
Estimated Expiration
2041-12-16

AI Technical Summary

Technical Problem

It is difficult for existing technologies to find a balance between rapid convergence and maintaining population diversity in graph coloring problems, resulting in poor solution accuracy and efficiency, and it is easy to fall into local optimal solutions, especially on sparse graphs.

Method used

A hybrid heuristic graph coloring method is adopted, by randomly generating initial solutions, using a greedy crossover algorithm and a conditional grouping strategy combined with a probabilistic learning strategy, and dynamically adjusting the coloring probability matrix to balance convergence and diversity, ensuring efficient solution of the graph coloring grouping scheme.

Benefits of technology

It improves the accuracy and efficiency of solving graph coloring problems, avoids local optimal traps, and significantly improves the success rate and efficiency of solving sparse graphs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114202609B
    Figure CN114202609B
Patent Text Reader

Abstract

The present invention discloses a hybrid heuristic graph coloring method, which integrates a probabilistic learning strategy with a hybrid evolutionary algorithm, performs hybrid evolution based on two coloring grouping schemes, and introduces a probabilistic learning strategy according to the similarity of the coloring distributions of the two coloring grouping schemes before hybrid purification to perform dynamic coloring adjustment, so that a better balance can be achieved between rapid convergence and maintaining population diversity, so as to further improve the solution accuracy while maintaining a high graph coloring grouping scheme solution efficiency, so that the solution accuracy and solution efficiency of the graph coloring problem are better balanced and taken into account.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of graph data processing, and in particular to a hybrid heuristic graph coloring method. Background Art

[0002] As an important branch of computer science, graph (G) is one of the frameworks in data structure and algorithm. Graph can be used to represent almost all types of structures or systems, such as transportation networks, communication networks, circuit board wiring, path planning, chess, games, optimal processes, task allocation, and interpersonal interaction networks, etc. In the field of academic or engineering practice, graphs are generally regarded as an abstract network composed of "vertices". The vertices in the network can be connected to each other through "edges", indicating that the two vertices are related. Therefore, a random unweighted and undirected Figure 1 It can be generally abbreviated as G=(V,E), where V={ν1,ν2,...ν n} is the set of vertices, is a set of edges. If there exists an edge e with two vertices e=<v1,v2> ∈E, and two vertices v1 and v2 have the same color, the edge e is called a conflict edge, and the adjacent vertices v1 and v2 are called conflict vertices. Furthermore, the solution to the graph coloring problem is to find a coloring grouping scheme that uses the least number of colors and avoids conflicting vertices. The minimum number of colors used by the coloring grouping scheme is called the color number of the graph.

[0003] With the development of reinforcement learning in recent years, its combination with heuristic algorithms has gradually attracted attention in academia. The STAGE algorithm proposed by Boyan and Moore predicts the results of local search algorithms by learning evaluation functions. By combining statistical learning strategies and clustering techniques with memory algorithms, Wang and Tang proposed their algorithm to solve multi-objective process shop scheduling problems. Hutter et al. used machine learning techniques (random forests and approximate Gaussian processes) to establish a prediction model for algorithm running time as a function of specific problem instance features. In 2016, Zhou et al. introduced a reinforcement learning-based local search (RLS) for solving grouping problems. RLS uses a dynamically updated coloring probability matrix to generate initial solutions for the descent-based local search algorithm. And Zhou et al. proposed an improved version of the reinforcement learning-based local search algorithm (PLSCOL) based on RLS. PLSCOL also uses a dynamically updated coloring probability matrix to provide an initial solution for the taboo local search algorithm.

[0004] There are also a lot of research results in the academic community on the use of evolutionary algorithms to solve graph coloring problems. Population-based evolutionary algorithms are also relatively effective and popular methods. In 1991, Davis used genetic algorithms to solve graph coloring problems. In 2013, Marappan et al. proposed single-parent conflict gene crossover and conflict gene mutation operators to make the algorithm converge faster. On the other hand, as early as 1999, Galinier and Hao embedded the taboo search algorithm into the evolutionary algorithm framework and introduced the hybrid evolutionary algorithm (HEA), which achieved good experimental results and provided a new idea for subsequent research. In 2008, Galinier and Hertz proposed an adaptive memory algorithm (AMACOL) based on a recombination operator, which can achieve the same results as the hybrid evolutionary algorithm and has the characteristics of simplicity and flexibility. In 2010, Lü and Hao et al. proposed an adaptive multi-parent crossover operator and a pool update replacement criterion based on distance and quality. The combination of these two strategies achieved good results. For large graphs with high density and a large number of vertices, Wu, Hao and others first used a preprocessing method to extract larger independent sets, and then used a memetic algorithm to color the residual graph, resulting in improved results on 11 large-scale graphs. In 2015, Moalic and Alexandre proposed a hybrid evolutionary algorithm (HEAD) based on two individuals and used the method of reintroducing elite individuals at a certain number of iterations to provide population diversity, making a great breakthrough in reducing the solution time. In 2018, Moalic and Alexandre introduced a random crossover operator in (HEAD) for improvement.

[0005] The hybrid evolutionary algorithm HEAD proposed by Moalic and Alexandre has a great advantage in solution time, mainly by using the taboo search algorithm and a population of two individuals, which allows the algorithm to avoid complex selection and replacement strategies. The advantage of HEAD is that it allows the population to converge quickly; the disadvantage is that there are only two individuals, which makes the population less diverse and difficult to escape from the local optimum. Although HEAD introduces elite individuals in the iterative process, for sparse graphs such as le450_15c and le450_15d, the algorithm easily reaches the convergence threshold during the iteration process, and the solution accuracy is insufficient, resulting in the obtained graph coloring grouping scheme not being a very ideal solution, thus reaching a deadlock.

[0006] Therefore, how to find a graph coloring method that has a better balance between fast convergence and maintaining population diversity, and to better balance the accuracy and efficiency of solving the graph coloring problem, is an urgent problem to be solved in this field. Summary of the invention

[0007] In view of the above-mentioned deficiencies in the prior art, the present invention provides a hybrid heuristic graph coloring method to further improve the solution accuracy while maintaining a high solution efficiency of the graph coloring grouping scheme, so that the solution accuracy and solution efficiency of the graph coloring problem are better balanced.

[0008] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0009] A hybrid heuristic graph coloring method comprises the following steps:

[0010] S1: randomly generate two initial solutions for vertex coloring of the graph, and obtain two coloring grouping schemes; execute step S2;

[0011] S2: According to the preset conditional grouping strategy, when the two coloring grouping schemes meet the conditional grouping strategy, color is assigned to each group in each coloring grouping scheme according to the corresponding coloring probability matrix, and the vertices in each group are recolored respectively; each coloring probability matrix is ​​used to indicate the probability of color assignment to each group in a coloring grouping scheme; if the conditional grouping strategy is not met, the two coloring grouping schemes are kept unchanged; and then step S3 is executed;

[0012] S3: Use the greedy crossover algorithm to perform greedy crossover iteration on the two coloring grouping schemes after coloring, and if the iteration termination condition is met after the iteration, execute step S5; otherwise, execute step S4;

[0013] S4: Update the coloring probability matrix, and then return to step S2 for the two iterated coloring grouping schemes;

[0014] S5: The optimal solution of the two coloring grouping schemes after greedy crossover iteration is used as the final vertex coloring grouping scheme of the graph.

[0015] As a preferred solution, in step S2, the preset conditional grouping strategy is specifically:

[0016] Calculate the coloring layout similarity proxi between two coloring grouping schemes:

[0017] proxi=q / n;

[0018] Where q represents the sum of the weights of the maximum weight matching results of the number of shared vertices between two coloring grouping schemes; n represents the total number of vertices in the graph;

[0019] If the coloring layout similarity proxi between the two coloring grouping schemes is greater than or equal to the preset coloring layout similarity threshold proxi0, it is determined that the conditional grouping strategy is met; otherwise, it is determined that the conditional grouping strategy is not met.

[0020] As a preferred solution, the value range of the coloring layout similarity threshold proxi0 is 0.8 to 0.95.

[0021] As a preferred solution, in the greedy crossover iteration of step S3, the two coloring grouping schemes are marked as the first parent and the second parent respectively; in step S3, the greedy crossover iteration is specifically as follows:

[0022] S301: Select a group with the largest number of vertices from the first parent as the first group of the child parent for coloring, and remove the corresponding vertices in the first parent and the second parent; then, let the child determine the number of groups k=1, and execute step S302;

[0023] S302: Select a group with the largest number of vertices from the current second parent as the k+1th group of the child parent for coloring, and remove the corresponding vertices in the first parent and the second parent; then, determine whether k+1=K is satisfied, K is the total number of groups in the coloring grouping scheme; if so, execute step S304; if not, let the number of groups k determined by the child be incremented by 1, and then execute step S303;

[0024] S303: Select a group with the largest number of vertices from the current first parent as the k+1th group of the child parent for coloring, and remove the corresponding vertices in the first parent and the second parent; then, determine whether k+1=K; if so, execute step S304; if not, let the number of child-determined groups k increase by 1, and then return to execute step S302;

[0025] S304: Determine whether there are any remaining vertices in the first parent and the second parent at this time; if so, randomly assign the remaining vertices to a group of the child parent and execute step S305; if not, directly execute step S305;

[0026] S305: Let the first parent before this iteration be the new second parent, and let the currently obtained offspring parent be the new first parent, to complete this greedy crossover iteration.

[0027] As a preferred solution, in step S301 and step S303, if there are multiple groups with the largest number of vertices in the first parent, one of them is randomly selected as the group with the largest number of vertices in the first parent.

[0028] As a preferred solution, in step S302, if there are multiple groups with the largest number of vertices in the second parent, one of them is randomly selected as the group with the largest number of vertices in the second parent.

[0029] As a preferred solution, the iteration termination condition is that the number of greedy crossover iterations has reached a preset upper limit of the number of iterations, or the obtained new first parent is a compliant coloring grouping solution.

[0030] As a preferred solution, in step S5, the optimal solution of the two coloring grouping schemes after greedy crossover iteration is the first parent of the two coloring grouping schemes.

[0031] As a preferred solution, in step S4, the coloring probability matrix is ​​updated in the following manner:

[0032] For a vertex in a group in the coloring grouping scheme:

[0033] If the color group of the vertex changes before and after the iteration, the coloring probability corresponding to the vertex in the coloring probability matrix is ​​updated according to the following formula based on whether the maximum weight matching strategy is satisfied between the two color groups of the vertex before and after the iteration:

[0034]

[0035] If the color group of the vertex does not change before and after the iteration, the coloring probability corresponding to the vertex in the coloring probability matrix is ​​updated according to the following formula based on whether the color group of the vertex satisfies the maximum weight matching strategy before and after the iteration:

[0036]

[0037] Among them, P′ ij is the i-th vertex v in the graph i The corresponding updated coloring probability represents the updated vertex v i The probability of being assigned to the jth color; P ij is the i-th vertex v in the graph i The corresponding coloring probability before the update indicates the vertex v before the update i The probability of being assigned to the jth color; K is the total number of groups in the coloring grouping scheme; α, β, and γ are all coloring probability coefficients, and their values ​​are all greater than 0 and less than 1.

[0038] Compared with the prior art, the hybrid heuristic graph coloring method of the present invention integrates the probabilistic learning strategy with the hybrid evolutionary algorithm, performs hybrid evolution based on two coloring grouping schemes, and introduces the probabilistic learning strategy according to the similarity of the coloring distribution of the two coloring grouping schemes before hybrid purification to perform dynamic coloring adjustment, so that there is a better balance between rapid convergence and maintaining population diversity, so as to further improve the solution accuracy while maintaining a high graph coloring grouping scheme solution efficiency, so that the solution accuracy and solution efficiency of the graph coloring problem are better balanced. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a flow chart of the hybrid heuristic graph coloring method of the present invention.

[0040] Figure 2 This is the maximum weight matching result between two coloring grouping schemes and an example diagram of coloring layout similarity calculation.

[0041] Figure 3 An example of a greedy crossover iteration of two coloring grouping schemes. DETAILED DESCRIPTION

[0042] The present invention first introduces the dual hybrid evolutionary algorithm (HEAD) and the local search algorithm based on reinforcement learning (PLSCOL) which are currently commonly used for solving graph coloring problems. They have excellent performance on most DIMACS benchmark instances and are also the algorithms compared with the method of the present invention in the experiment.

[0043] 1 Double Hybrid Evolutionary Algorithm (HEAD)

[0044] The Hybrid Evolutionary Algorithm (HEA) is an excellent hybrid evolutionary algorithm that combines the tabu search coloring algorithm TabuCol and the greedy crossover algorithm GPX. It was proposed by Moalic et al. in 2015. Since the tabu search algorithm is a very strong algorithm, it will lead to rapid convergence in population iteration. GPX provides a diverse population, which slows down the overall convergence of the algorithm without destroying the original solution structure, so that HEA can better balance intensiveness and diversification and obtain better experimental results. In 2018, Moalic et al. made further improvements to HEA by introducing elite individuals to further increase population diversity and achieve better experimental results.

[0045] Use g i represents the grouping of vertices of color i, then a legal K-coloring S can also be seen as a partition of the vertex set V into K groups (also called independent sets), S = {g1, g2, ..., g K}, so that adjacent vertices are not in the same group. For two solutions S = {g1, g2, ..., g K} and S'={g'1,g'2,...,g' K}, if for There is always one and only one g′ j ∈S′, so that g i =g′ j That is, if there is a one-to-one correspondence between the two groups, then S and S' are equivalent, and are written as: S = S'. In other words, whether one solution is equivalent to another solution depends only on the relationship between the vertices in the group, and has nothing to do with the color of the vertex itself.

[0046] Now let's briefly describe the execution steps of Greedy Crossover (GPX). Consider two parents, S1 = {G1 1 ,G2 1 ,...,G K 1} and S2={G1 2 ,G2 2 ,...,G K 2}, divide the vertices into K groups according to color class, and for Indicates that the vertex V belongs to parent 1, and i represents color i. The first step is to select the group with the largest number of vertices from parent 1, and color the corresponding vertices in the offspring with the color to which the group belongs. When the largest group is not unique (that is, multiple groups have the same number of colors), randomly select one of the groups. While processing parent 1, the corresponding vertices in parent 2 are eliminated (considering that these vertices have been inherited to the offspring through parent 1). It can be seen that parent 2 may lose the group with the largest number of colors as a result. At this time, the second step is carried out, and the group with the largest number of colors is selected from parent 2, and the corresponding vertices in the offspring are colored. At the same time, the corresponding colors in parent 1 will also be eliminated. At this time, a round of iteration is completed, that is, some vertices are selected from the two parents and their colors are inherited to the offspring. This process will end with all the colors of the offspring being colored. It should be noted that when the iteration reaches the last step, there are still some uncolored vertices in the offspring. At this time, they will be randomly assigned colors. The result is that when the structures of the two parents are very different, the last step of GPX will generate many vertices that need to be randomly colored, which will cause many conflicts in the offspring. This is also the reason for the variants of GPX mentioned by the author Moalic in the article. At the same time, the order of parent selection also affects the generation of offspring.

[0047] Algorithm 1 is the pseudo code of the HEAD algorithm.

[0048]

[0049] Algorithm 1 can be seen as two parallel TabuCol algorithms that iterate repeatedly through regular crossover operations. After randomly generating two initial solutions, the algorithm enters an iterative state until the termination condition is reached. First, some diversity is introduced into the population through the crossover operator GPX, and the two offspring generated are mainly solved by the TabuCol algorithm. Secondly, elite individuals are introduced to participate in the solution, with the aim of injecting diversity into the population again, because the similarity of the coloring layout of the two solutions will increase during the iteration. It can be seen that in the iteration of a cycle, solution elite1 is the best solution in the current cycle, while solution elite2 is the best solution in the previous cycle, and after a cycle, elite2 will replace one of the individuals. Indeed, the introduction of elite individuals not only preserves the best solution, but also reintroduces diversity into the population during iteration.

[0050] 2 Probabilistic Learning-Based Local Search Algorithm (PLSCOL)

[0051] The PLSCOL algorithm is a local search algorithm based on probabilistic learning, proposed by Zhou et al. in 2018. In the process of the local search algorithm TabuCol iteration, a probabilistic learning strategy is introduced, that is, before each local search, the vertex selection corresponding color grouping is made through the coloring probability matrix, and the vertex coloring is adjusted globally. The color matching relationship is calculated by the change of vertex color between solutions, and the coloring probability matrix is ​​updated to provide a grouping basis for the next iteration.

[0052]

[0053] Algorithm 2 uses the coloring probability matrix to generate an initial solution for local search. The generated local optimal solution will establish a matching relationship between groups with the initial solution, obtain the matching relationship through the maximum weight matching algorithm, and update the coloring probability matrix according to the change of vertex color. It should be noted that for each P ij , which represents the i-th vertex v in the graph i The probability of being assigned to the jth color. ij The update strategy is to find the color correspondence through the maximum weight matching on the one hand, and to change P through the probability update strategy on the other hand. ij At the same time, for each probability update, a probability smoothing strategy will be used to smooth P ij .

[0054] 3 Hybrid heuristic graph coloring method proposed in this paper

[0055] Based on the hybrid evolutionary algorithm HEAD of Moalic et al. and the PLSCOL algorithm of Zhou et al., the present invention combines the reinforcement learning strategy with the evolutionary algorithm and proposes a new hybrid heuristic graph coloring method, which can be denoted as PLHEAD.

[0056] 3.1 Hybrid Heuristic Graph Coloring Method PLHEAD

[0057] HEAD proposed by Moalic and Alexandre has a great advantage in solution time, mainly by using the taboo search algorithm and a population of two individuals, which makes the algorithm not need to use a complex selection and replacement strategy. The advantage of HEAD is that it can make the population converge quickly; the disadvantage is that there are only two individuals, which makes the diversity of the population insufficient, and it is difficult to jump out of the local optimum. Although HEAD introduces elite individuals in the iterative process, for sparse graphs such as le450_15c and le450_15d, the algorithm can easily reach the convergence threshold during the iteration process, and the solution accuracy is insufficient, resulting in the obtained graph coloring grouping scheme not being a very ideal solution, thus reaching a deadlock.

[0058] The present invention combines the probabilistic learning strategy with the hybrid evolutionary algorithm, seeks a balance between fast convergence and maintaining population diversity, and proposes a hybrid heuristic graph coloring method PLHEAD. The algorithm framework pseudo code can be shown in Table 3.

[0059]

[0060]

[0061] Algorithm 3 uses the hybrid evolutionary algorithm as the framework. Before performing the GPX crossover operation, the conditional grouping strategy is first used (row 4). After the grouping condition is met, the group selection algorithm is used for each parent. The coloring probability matrix is ​​used to select a color for each color in each parent according to probability (rows 5 and 6). The coloring probability matrix, as a property of the solution, will be inherited to the offspring along with the GPX crossover operation (rows 8 and 9). The specific coloring probability matrix of which parent is selected depends on the first input parent of the GPX crossover operation. After the taboo search algorithm, two offspring are obtained (rows 10 and 11). The coloring probability matrix P is continuously updated in the iteration according to the ProbabilityUpdating strategy. p1 and P p2(Lines 12 and 13). The elite individuals are then saved and introduced into the population when a certain iteration cycle is met (Lines 14-19). Although the addition of such a grouping strategy may destroy the original solution structure, the update of the coloring probability matrix has a certain degree of randomness, and it may easily break the structure that will converge to the final solution, but not every round of iteration will introduce a strategy based on probability grouping, but a dynamic adjustment is made based on the similarity of the coloring distribution of the two parents. This strategy of adjusting according to the conditions is less likely to break the original solution structure than the fixed period adjustment method, and can reduce the time loss caused by repeated calculations.

[0062] Therefore, the hybrid heuristic graph coloring method process of the present invention is summarized as follows: Figure 1 As shown, the following steps are included:

[0063] S1: randomly generate two initial solutions for vertex coloring of the graph, and obtain two coloring grouping schemes; execute step S2;

[0064] S2: according to the preset conditional grouping strategy, when the conditional grouping strategy is met, color is assigned to each group in each coloring grouping scheme according to the corresponding coloring probability matrix, and the vertices in each group are recolored respectively; each coloring probability matrix is ​​used to indicate the probability of color assignment to each group in a coloring grouping scheme; if the conditional grouping strategy is not met, the two coloring grouping schemes are kept unchanged; then step S3 is executed;

[0065] S3: Use the greedy crossover algorithm to perform greedy crossover iteration on the two coloring grouping schemes after coloring, and if the iteration termination condition is met after the iteration, execute step S5; otherwise, execute step S4;

[0066] S4: Update the coloring probability matrix, and then return to step S2 for the two iterated coloring grouping schemes;

[0067] S5: The optimal solution of the two coloring grouping schemes after greedy crossover iteration is used as the final vertex coloring grouping scheme of the graph.

[0068] 3.2 Conditional Grouping Strategy

[0069] For each round of iteration, if the probability grouping strategy is used without restriction, the originally gradually converging solution structure will be destroyed, thereby reducing the efficiency and quality of the solution. Corresponding experimental data will be given later to illustrate this situation. At the same time, a conditional grouping strategy is proposed in view of this.

[0070] For two parents, there is a certain relationship between them. According to the coloring layout of the two (parent) solutions, the degree of similarity of the color layout is taken as the coloring layout similarity (the parameter is recorded as proxi), which is calculated as shown in formula (1).

[0071] proxi=q / n; (1)

[0072] Among them, q represents the sum of the weights of the maximum weighted matching results of the number of shared vertices between two coloring grouping schemes, that is, the total number of shared vertices between the two parents for each color; n represents the total number of vertices in the graph.

[0073] Examples include Figure 2 As shown, there are coloring grouping schemes S1 and S2 for a graph with 10 vertices (A, B, C, D, E, F, G, H, I, J). Figure 2 (a) gives an example of coloring layout similarity calculation: the coloring number is known to be 3; 3 groups are obtained on each of the two solutions, and the two solutions are matched with the maximum weight (where the edge weight represents the intersection of the two groups). At this time, we get The corresponding relationship, and the sum of the weights is 3+2+1=6. Figure 2 (b) The bipartite graph form is abstracted.

[0074] The sum of the weights of the maximum weight matching result of the above example is 6, and the total number of vertices in the graph is 10, so the coloring layout similarity can be expressed as 6 / 10=0.6, that is, the coloring layout similarity between the two solutions is 60%. It can be seen that although the color layout of each solution is very different, a more reasonable answer can still be obtained by calculating the coloring layout similarity, which is also a key parameter in the method of the present invention. When it is iterated to the point where the current coloring layout similarity is greater than or equal to the coloring layout similarity threshold, the condition for probability grouping is met, and the group selection strategy is started, bringing some changes to the population.

[0075] Therefore, the preset conditional grouping strategy in the hybrid heuristic graph coloring method of the present invention can be summarized as follows:

[0076] Calculate the coloring layout similarity proxi between two coloring grouping schemes:

[0077] proxi=q / n;

[0078] Where q represents the sum of the weights of the maximum weight matching results of the number of shared vertices between two coloring grouping schemes; n represents the total number of vertices in the graph;

[0079] If the coloring layout similarity proxi between the two coloring grouping schemes is greater than or equal to the preset coloring layout similarity threshold proxi0, it is determined that the conditional grouping strategy is met; otherwise, it is determined that the conditional grouping strategy is not met.

[0080] 3.3 Greedy Crossover Iteration Strategy

[0081] In the hybrid heuristic graph coloring method of the present invention, when the two coloring grouping schemes after coloring are subjected to greedy crossover iteration processing in step S3, in order to facilitate the distinction between the two coloring grouping schemes, the two coloring grouping schemes are respectively marked as the first parent and the second parent; the greedy crossover iteration method is specifically as follows:

[0082] S301: Select a group with the largest number of vertices from the first parent as the first group of the child parent for coloring, and remove the corresponding vertices in the first parent and the second parent; then, let the child determine the number of groups k=1, and execute step S302;

[0083] Among them, if there are multiple groups with the largest number of vertices in the first parent, one of them is randomly selected as the group with the largest number of vertices in the first parent.

[0084] S302: Select a group with the largest number of vertices from the current second parent as the k+1th group of the child parent for coloring, and remove the corresponding vertices in the first parent and the second parent; then, determine whether k+1=K is satisfied, K is the total number of groups in the coloring grouping scheme; if so, execute step S304; if not, let the number of groups k determined by the child be incremented by 1, and then execute step S303;

[0085] Among them, if there are multiple groups with the largest number of vertices in the second parent, one of them is randomly selected as the group with the largest number of vertices in the second parent.

[0086] S303: Select a group with the largest number of vertices from the current first parent as the k+1th group of the child parent for coloring, and remove the corresponding vertices in the first parent and the second parent; then, determine whether k+1=K; if so, execute step S304; if not, let the number of child-determined groups k increase by 1, and then return to execute step S302;

[0087] Among them, if there are multiple groups with the largest number of vertices in the first parent, one of them is randomly selected as the group with the largest number of vertices in the first parent.

[0088] S304: Determine whether there are any remaining vertices in the first parent and the second parent at this time; if so, randomly assign the remaining vertices to a group of the child parent and execute step S305; if not, directly execute step S305.

[0089] S305: Let the first parent before this iteration be the new second parent, and let the currently obtained offspring parent be the new first parent, to complete this greedy crossover iteration.

[0090] The greedy crossover iterative process is to extract groups between the first parent and the second parent for coloring in turn until the number of extracted groups reaches the total number of groups in the coloring grouping scheme. If there are still uncolored vertices, they are randomly assigned to a group of the descendant parent for coloring to form a complete sub-band parent.

[0091] An example of this greedy crossover iteration process can be found in Figure 3 , take the coloring grouping schemes S1 and S2 of a graph with 10 vertices (A,B,C,D,E,F,G,H,I,J), and the coloring book has 3 kinds of colors, namely red, blue and green; the final offspring parents are [(D,E,F,G) red grouping, (B,H,J) blue grouping, (A,C,I) green grouping].

[0092] The iteration termination condition of the greedy crossover iteration process is that the number of greedy crossover iterations has reached the preset upper limit of the number of iterations, or the new first parent obtained is already a compliant coloring grouping scheme.

[0093] From the above iterative process, we can see that the crossover operator GPX is used to introduce some diversity into the population, and elite individuals are introduced to participate in the solution. The purpose is to inject diversity into the population again, because the coloring layout similarity of the two solutions will increase during the iteration. At the same time, after each iteration, the new first parent is the best coloring grouping solution in the current iteration cycle, and the new second parent is the best coloring grouping solution in the previous iteration cycle. The introduction of elite individuals not only preserves the best solution, but also reintroduces diversity into the population during the iteration.

[0094] Therefore, if the greedy crossover iteration process is terminated, the optimal solution in the two coloring grouping schemes after the greedy crossover iteration in step S5 is jumped to, then it is the first parent in the two coloring grouping schemes.

[0095] 3.4 Coloring Probability Matrix Update Strategy

[0096] After each iteration, in step S4, the coloring probability matrix is ​​updated. As the simplest update scheme, the coloring probability matrix can be updated by random update. However, in order to better meet the maximum weight matching principle between the iterative parent and offspring, the scheme of the present invention preferably uses the following algorithm 4 to update the coloring probability matrix.

[0097]

[0098]

[0099] This update scheme has two main modes for updating the coloring probability matrix:

[0100] For a vertex in a group in the coloring grouping scheme:

[0101] Mode 1: If the color group of the vertex changes before and after the iteration, the coloring probability corresponding to the vertex in the coloring probability matrix is ​​updated according to the following formula based on whether the maximum weight matching strategy is satisfied between the two color groups of the vertex before and after the iteration:

[0102]

[0103] Mode 2: If the color group of the vertex does not change before and after the iteration, the coloring probability corresponding to the vertex in the coloring probability matrix is ​​updated according to the following formula based on whether the color group of the vertex satisfies the maximum weight matching strategy before and after the iteration:

[0104]

[0105] Among them, P ij ′ is the i-th vertex v in the graph i The corresponding updated coloring probability represents the updated vertex v i The probability of being assigned to the jth color; P ij is the i-th vertex v in the graph i The corresponding coloring probability before the update indicates the vertex v before the update i The probability of being assigned to the jth color; K is the total number of groups in the coloring grouping scheme; α, β, and γ are all coloring probability coefficients, and their values ​​are all greater than 0 and less than 1.

[0106] When the coloring probability matrix is ​​updated to a certain extent, the probability value may cross the boundary. For example, when a probability value keeps rising during iterations and even exceeds 1, and the legal value of the probability is [0,1], it is necessary to make certain corrections to the illegal probability value and adjust the overall probability distribution of the groups with probability values ​​exceeding 1 to ensure the continuity and correctness of the algorithm.

[0107] 3.4 Additional overhead compared to the HEAD algorithm

[0108] From the algorithm, we know that after each iteration of the local search algorithm, there is a probability update, and the probability update algorithm requires each vertex V i Perform grouping judgment, so for each vertex V i , are accompanied by P ij, where j∈[1,K], the time complexity is O(n×K). On the other hand, the update source of the coloring probability matrix is ​​based on the result of the maximum weight matching between the parent and the child, and the time complexity of the maximum weight matching algorithm is O(n 3 ), so each probability update is accompanied by a maximum weight matching algorithm and an update of the P matrix, and the total time complexity is O(n 3 )+O(n×K), which is a polynomial level algorithm.

[0109] On the other hand, when the similarity of the coloring layout of two parents reaches a threshold, GroupSelecting is performed, that is, each vertex V i According to P ij The probability value of the vertices is used to select the group that belongs to it, and some vertices are selected from the group with the largest probability value, and the other part is selected randomly, so that the similarity of the coloring layout of the two parents that were originally converging decreases, thereby avoiding the crossover strategy from losing its effect and terminating. In this process, each vertex V i Perform coloring judgment, so for each vertex V i , are accompanied by the choice of P ij The maximum value or random selection among , where j∈[1,K], can obtain a time complexity of O(n×K).

[0110] 4. Comparative test and results

[0111] First, we will introduce the selected data set, the experimental parameter settings and their meanings, and the detailed results display and analysis. We will also compare with the best results to verify the effectiveness of the improved method of the present invention.

[0112] 4.1 Dataset Introduction

[0113] The data sets for the method test and comparison experiments are mainly the second DIMACS challenge benchmark data sets, in which most of the graphs are random or quasi-random. There are 34 data sets in total, including 6 categories of data sets. The first category has 12 random graphs, and the vertices are randomly distributed in the unit square. Their coloring number is unknown (DSJC125.x, DSJC250.x, DSJC500.x, DSJC1000.x, where 125, 250, 500, 1000 represent the number of vertices, and the values ​​of x are 1, 5, 9, respectively, representing the density of the graph is 0.1, 0.5, 0.9, and the definition of density d is related to the number of vertices and edges (d = 2m / n (n-1), where m is the number of edges and n is the number of vertices). The larger the number, the denser the graph. Conversely, the sparser it is.) The second The first class has 12 Leighton graphs, whose coloring numbers are known (le450_5x, le450_15x, le450_25x, where 450 is the number of vertices of the graph, 5, 15, 25 are known coloring numbers, and x represents a, b, c, d respectively). The third class is 4 planar graphs, whose coloring numbers are also known (flat300_28_0, flat1000_x_0, where x is 50, 60, 76 respectively. Represents the coloring number of the graph, where 300 and 1000 are the number of vertices of the graph). The fourth is a geometric random graph dsjr500.1c, where 500 vertices are randomly distributed in the unit square with a density of 0.1. The suffix c represents the complement graph, so the edge density of this instance is 0.9. The fifth class is also a geometric random graph (r250.5, r1000.1c, r1000.5). The sixth category is two huge random graphs, c2000.5 and c4000.5. 2000 and 4000 represent the number of vertices, and their edge density is 0.5. The main reason for choosing these graphs is that they have been widely studied in the literature and are relatively difficult graphs, so such comparative experiments are more meaningful. The detailed information of the dataset is shown in Table 1, which lists the instance name, number of vertices, number of edges, edge density, and known coloring number of the dataset.

[0114] Table 1 Examples of datasets

[0115]

[0116]

[0117] 4.2 Experimental Results

[0118] The PLHEAD algorithm is implemented in C++ and compiled with GNU g++. The experimental environment is a Linux 64-bit system with a processor Intel Xeon (Skylake) Platinum 8163 2.5GHz and a memory of 4GB. For most instances, the number of solutions is set to 20. The termination condition for each solution is that a single run reaches the upper limit of 2000 iterations or a legal K coloring grouping scheme is found. For the comparison algorithm HEAD, the same experimental environment is used for comparison experiments. Table 2 shows the results of the comparison experiments.

[0119] Table 2 Comparison of experimental results between the PLHEAD method of the present invention and the HEAD algorithm

[0120]

[0121]

[0122] First, the experimental results of PLHEAD and HEAD are compared. The purpose of this set of experiments is to compare the performance of the PLHEAD algorithm based on two strategies with the original HEAD algorithm. Columns 1-2 of Table 2 give the instance name and the number of colorings set (K). For different instances, the number of iterations of the taboo search set in the two algorithms is different (iterTc). For the two algorithms, the running success rate (successRate), the average number of iterations (Iter), the average number of crossovers (Cross), the average running time (Times(s)) and the conditional grouping threshold (proxi0) of PLHEAD are given respectively. The choice of threshold is explained in Table 7. For the experimental results of the same instance, the one that has an advantage in time or success rate is bolded, and the one that has an advantage in the number of iterations is underlined.

[0123] Table 2 shows that PLHEAD outperforms HEAD in most instances, with the success rate of the le450_15c and le450_15d datasets improving significantly by 95% and 90% respectively. Among the 37 instances, 19 outperform HEAD in terms of time, success rate, and number of iterations. This set of experiments proves that PLHEAD's conditional grouping and probability update strategy have a certain improvement over the original HEAD in solving the graph coloring problem.

[0124] Table 3 Comparison of experimental results between PLHEAD and PLSCOL

[0125]

[0126]

[0127] Table 3 shows the experimental results of the comparison between PLHEAD and PLSCOL. The first column of Table 3 gives the instance name. For different instances, different coloring numbers (K) are set in the two algorithms, and the running success rate (#success), average number of iterations (#Iter), and average running time (Times(s)) are given respectively. Similarly, for the experimental results of the same instance, the one that has the advantage in time or success rate is bolded, and the one that has the advantage in iterations is underlined.

[0128] Table 3 shows that PLHEAD performs significantly better than PLSCOL in most instances. Among the 20 instances given, 11 instances have better performance than PLSCOL in terms of time, number of colorings, number of iterations, and running success rate. Among them, the number of colorings of 4 instances, including dsjr500.5, flat1000_76_0, r250.5 and r1000.5, is less than PLSCOL. PLHEAD has a significant advantage in the running time of 7 instances, with the time improvement of dsjc500.5 exceeding 20 times, the solution time of djsc1000.9 exceeding 4 times, and the time improvement of le450_15c and le450_15d exceeding 20 times. This set of experiments proves that PLHEAD has certain advantages over PLSCOL in solving graph coloring problems based on the conditional grouping and probability update strategy of the hybrid evolutionary algorithm framework.

[0129] Table 4 Comparison of experimental results between PLHEAD and PLHEADwithout updating

[0130]

[0131]

[0132] Table 4 is a comparative experiment of PLHEAD and PLHEAD with disabled update strategy. The purpose of this set of experiments is to prove the effectiveness of the update strategy in improving the overall solution of PLHEAD. As can be seen from Table 4, the performance of PLHEAD with disabled update strategy is not as stable as the original PLHEAD. There are 17 experimental results in total. The results of PLHEAD are better than the version with disabled update in terms of time, number of iterations or success rate. Since the update strategy will produce a time complexity of O(n 8 ), making PLHEAD slower than the version with updates disabled for solving simple instances. This set of experiments overall demonstrates the effectiveness of the update strategy for PLHEAD.

[0133] Table 5 Comparison of experimental results between PLHEAD and PLHEAD without proxiSelecting

[0134]

[0135]

[0136] Table 5 is a comparative experiment of PLHEAD and PLHEAD with conditional grouping strategy disabled. For each round of iteration, if the probability grouping strategy is used without restriction, the originally gradually converging solution structure will be destroyed, thereby reducing the efficiency and quality of the solution. The purpose of this set of experiments is to prove the effectiveness of conditional grouping in improving the overall solution of PLHEAD.

[0137] As can be seen from Table 5, the performance of PLHEAD with the conditional grouping strategy disabled is far less stable than the original PLHEAD. The experimental results of 23 instances show that the results of PLHEAD are worse than the version with conditional grouping disabled in terms of time, number of iterations or success rate. For some instances, the algorithm with the conditional grouping strategy disabled cannot complete the solution under the same restriction on the number of coloring K. This set of experiments as a whole proves the importance of the conditional grouping strategy for PLHEAD, while ensuring the stability of the overall iteration.

[0138] Table 6 Comparison of experimental results between PLHEAD and PLHEAD without proxiSelecting and updating

[0139]

[0140] Table 6 is a comparative experiment of PLHEAD and PLHEAD with both conditional grouping strategy and update strategy disabled. The purpose of this set of experiments is to prove the necessity of improving the overall solution of PLHEAD under the joint action of conditional grouping strategy and update strategy.

[0141] As can be seen from Table 6, the performance of PLHEAD when disabling two strategies at the same time is far less stable than the original PLHEAD. The experimental results of a total of 23 instances show that the results of PLHEAD are worse than the version with all strategies disabled in terms of time, number of iterations or success rate. For some instances, the algorithm with disabled strategies cannot complete the solution under the same restriction on the number of colorings K. For some simple graphs, there are situations where the number of iterations is limited and a legal solution is obtained after completing one or two rounds of taboo search. At this time, disabling the update strategy greatly improves the efficiency of the solution, resulting in an advantage in the solution time of these instances. Overall, this set of experiments proves that the conditional grouping strategy and the update strategy are meaningful for improving PLHEAD.

[0142] Table 7 proxi of instances in DIMACS

[0143]

[0144]

[0145] Based on the density of each instance as a reference, the threshold for regroupSelecting of each instance is set. Table 7 gives the conditional grouping threshold parameter proxi0 for each instance. For example, for the djsc500.5 instance, the threshold is set to 0.9, which means that when the coloring layout similarity of the two parents reaches 90%, the condition is met and color grouping is performed. This is set because adding such a strategy may destroy the original solution structure. The update of the coloring probability matrix has a certain degree of randomness, which may easily break the structure that was originally about to converge to the final solution. It is necessary to dynamically adjust the grouping strategy according to the proxi value. The comparative experimental results given in Table 5 can prove the correctness of dynamic grouping according to conditions.

[0146] According to experience, the value range of the coloring layout similarity threshold proxi0 is best between 0.8 and 0.95. If the value of the coloring layout similarity threshold is too low, it is easy to cause the originally gradually converging solution structure to be destroyed, thereby reducing the efficiency and quality of the solution. If the value of the coloring layout similarity threshold is too high, the conditional grouping strategy is difficult to trigger, which is not conducive to maintaining population diversity.

[0147] 4.4 Improvements for le450_15c and le450_15d

[0148] It can be seen that the success rate of the two graphs le450_15c and le450_15d is significantly improved compared with the head algorithm, and an analysis is made here. For such an extremely sparse graph (450 vertices and about 16,000 edges), if the HEAD algorithm is used alone to solve it, the two individuals will converge quickly, that is, the coloring layout similarity quickly reaches the threshold, so that the GPX cross strategy loses its effect and terminates. After the introduction of the probabilistic learning strategy, since the update of the coloring probability matrix has a certain degree of randomness, it moderately breaks the structure that was originally going to converge to the final solution, which makes the coloring layout similarity decrease while continuing to solve on the original solution structure, which is manifested as a significant improvement in the success rate on such instances.

[0149] In summary, the hybrid heuristic graph coloring method proposed in the present invention mainly introduces the strategy of probabilistic learning into the framework of evolutionary algorithms to solve the graph coloring problem. Because there are only two coloring grouping schemes, the population converges quickly while the diversity is sharply reduced. The present invention proposes to adjust individuals according to the coloring probability matrix. Without affecting the convergence speed of the population, the correct diversity can be introduced at the right time, while ensuring the settlement accuracy of the graph coloring grouping scheme. Through data example experiments, it is verified that the improved scheme of the hybrid heuristic graph coloring method of the present invention has better effects on most data instances, so that the solution accuracy and solution efficiency of the graph coloring problem are better balanced.

[0150] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described with reference to the preferred embodiments of the present invention, it should be understood by those skilled in the art that various changes may be made in form and details without departing from the spirit and scope of the present invention as defined in the appended claims.

Claims

1. A hybrid heuristic graph coloring method, characterized in that: The steps include: S1: randomly generate two initial solutions for vertex coloring of the graph, and obtain two coloring grouping schemes; execute step S2; S2: According to the preset conditional grouping strategy, when two coloring grouping schemes meet the conditional grouping strategy, color is assigned to each group in each coloring grouping scheme according to the corresponding coloring probability matrix, and the vertices in each group are recolored respectively; Each coloring probability matrix is ​​used to indicate the probability of color assignment for each group in a coloring grouping scheme; If the conditional grouping strategy is not satisfied, the two coloring grouping schemes are kept unchanged; then step S3 is executed; wherein the preset conditional grouping strategy is specifically: Calculate the coloring layout similarity proxi between two coloring grouping schemes: proxi=q / n; Where q represents the sum of the weights of the maximum weight matching results of the number of shared vertices between two coloring grouping schemes; n represents the total number of vertices in the graph; If the coloring layout similarity proxi between the two coloring grouping schemes is greater than or equal to the preset coloring layout similarity threshold proxi0, it is determined that the conditional grouping strategy is met; otherwise, it is determined that the conditional grouping strategy is not met; S3: Use the greedy crossover algorithm to perform greedy crossover iteration on the two coloring grouping schemes after coloring, and if the iteration termination condition is met after the iteration, execute step S5; otherwise, execute step S4; S4: Update the coloring probability matrix, and then return to step S2 for the two iterated coloring grouping schemes; S5: The optimal solution of the two coloring grouping schemes after greedy crossover iteration is used as the final vertex coloring grouping scheme of the graph.

2. The hybrid heuristic graph coloring method according to claim 1, characterized in that: The value range of the coloring layout similarity threshold proxi0 is 0.8 to 0.

95.

3. The hybrid heuristic graph coloring method according to claim 1, characterized in that: In the greedy crossover iteration of step S3, the two coloring grouping schemes are marked as the first parent and the second parent respectively; in step S3, the greedy crossover iteration is specifically as follows: S301: Select a group with the largest number of vertices from the first parent as the first group of the child parent for coloring, and remove the corresponding vertices in the first parent and the second parent; then, let the child determine the number of groups k=1, and execute step S302; S302: Select a group with the largest number of vertices from the current second parent as the k+1th group of the child parent for coloring, and remove the corresponding vertices in the first parent and the second parent; then, determine whether k+1=K is satisfied, K is the total number of groups in the coloring grouping scheme; if so, execute step S304; if not, let the number of groups k determined by the child be incremented by 1, and then execute step S303; S303: Select a group with the largest number of vertices from the current first parent as the k+1th group of the child parent for coloring, and remove the corresponding vertices in the first parent and the second parent; then, determine whether k+1=K; if so, execute step S304; if not, let the number of child-determined groups k increase by 1, and then return to execute step S302; S304: Determine whether there are any remaining vertices in the first parent and the second parent at this time; if so, randomly assign the remaining vertices to a group of the child parent and execute step S305; if not, directly execute step S305; S305: Let the first parent before this iteration be the new second parent, and let the currently obtained offspring parent be the new first parent, to complete this greedy crossover iteration.

4. The hybrid heuristic graph coloring method according to claim 3, characterized in that: In step S301 and step S303, if there are multiple groups with the largest number of vertices in the first parent, one of them is randomly selected as the group with the largest number of vertices in the first parent.

5. The hybrid heuristic graph coloring method according to claim 3, characterized in that: In step S302, if there are multiple groups with the largest number of vertices in the second parent, one of them is randomly selected as the group with the largest number of vertices in the second parent.

6. The hybrid heuristic graph coloring method according to claim 3, characterized in that: The iteration termination condition is that the number of greedy crossover iterations has reached a preset upper limit of the number of iterations, or the obtained new first parent is a compliant coloring grouping scheme.

7. The hybrid heuristic graph coloring method according to claim 3, characterized in that: In step S5, the optimal solution of the two coloring grouping schemes after greedy crossover iteration is the first parent of the two coloring grouping schemes.

8. The hybrid heuristic graph coloring method according to claim 3, characterized in that: In step S4, the coloring probability matrix is ​​updated in the following manner: For a vertex in a group in the coloring grouping scheme: If the color group of the vertex changes before and after the iteration, the coloring probability corresponding to the vertex in the coloring probability matrix is ​​updated according to the following formula based on whether the maximum weight matching strategy is satisfied between the two color groups of the vertex before and after the iteration: If the color group of the vertex does not change before and after the iteration, the coloring probability corresponding to the vertex in the coloring probability matrix is ​​updated according to the following formula based on whether the color group of the vertex satisfies the maximum weight matching strategy before and after the iteration: Among them, P ij ′ is the i-th vertex v in the graph i The corresponding updated coloring probability represents the updated vertex v i The probability of being assigned to the jth color; P ij is the i-th vertex v in the graph i The corresponding coloring probability before the update indicates the vertex v before the update i The probability of being assigned to the jth color; K is the total number of groups in the coloring grouping scheme; α, β, and γ are all coloring probability coefficients, and their values ​​are all greater than 0 and less than 1.