A task scheduling method based on a greedy adaptive ant colony algorithm
By introducing greedy algorithms, adaptive adjustment and ant relay scheduling mechanisms into the ant colony algorithm, the inefficiency and local optimization problems of the ant colony algorithm under large-scale task scheduling and constraints are solved, and more efficient task scheduling and path planning are achieved.
Patent Information
- Application Number
- CN202010666128.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-13
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2040-07-13
AI Technical Summary
The ant colony algorithm is slow to initialize when handling large-scale task scheduling, making it difficult to effectively complete task scheduling under constraints, and is easily trapped in local optimal solutions.
The greedy algorithm is introduced to accelerate initialization, and the optimization speed is improved by adaptively adjusting the pheromone volatility coefficient and introducing efficiency factors, and a relay scheduling mechanism is introduced in the ant colony to solve the task scheduling difficulties under constraints.
It significantly improves the initialization speed and optimization efficiency of the ant colony algorithm, can effectively deal with large-scale task scheduling problems, and realizes a better task scheduling solution under constraints.
Smart Images

Figure CN111967643B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of swarm intelligence algorithms and is mainly used to optimize the execution efficiency and optimization ability of the ant colony algorithm. Background Art
[0002] The ant colony algorithm is a heuristic combinatorial optimization algorithm based on random search that simulates the foraging behavior of ants. Ants in the ant colony communicate through pheromones. During the process of searching for a food source, they will release pheromones that remain on the path they have walked. The shorter the path, the more ants pass through it per unit time, the higher the concentration of the released pheromones, and the stronger the attraction to later ants. Eventually, all ants choose this path, that is, a shortest path is determined between the ant nest and the food source. The advantage of the ant colony algorithm is that it can handle very complex combinatorial optimization problems without the need for complex mathematical models and complicated parameter designs. Therefore, it is usually applied to difficult problems such as the allocation of computing resources in cloud computing under the premise of meeting the SLA agreement, the invocation of pod nodes that meet QoS constraints in a microservices architecture, or the allocation of transportation capacity in a logistics system. We can abstract such difficult problems into the problem of reasonably allocating and executing m tasks among n execution nodes and meeting the constraint conditions. This article will also illustrate the improvement and optimization of the ant colony algorithm based on such a task scheduling model.
[0003] Currently, there are three difficult problems in the research of the ant colony algorithm. First, the initialization speed of the ant colony algorithm is relatively slow when dealing with large-scale task scheduling, especially in the case of no initial pheromone for tasks. This is more obvious when the task scale is larger. Secondly, although there are various methods in the actual application of the ant colony algorithm to avoid the algorithm stagnation caused by local optimality through the adaptive adjustment of algorithm-related parameters, they often only roughly rely on the iteration period of the algorithm operation or a certain set standard, and cannot fully combine the effective information between the previous and subsequent scheduling results. Another problem is that under strong constraint conditions, the iterative result of one ant cannot be used as the final solution. At this time, the results of multiple ants need to be complementarily combined to obtain the final scheduling solution, and the traditional ant colony algorithm is helpless in this regard. These three problems are the main obstacles restricting the application of the ant colony algorithm to task scheduling and path planning of large-scale data and resources under constraint conditions in the actual industrial field.
[0004] The greedy algorithm is an algorithm that always makes the best choice currently when solving a problem. Its advantage is fast solution speed, but since this algorithm does not consider the overall optimality, the obtained is a local optimal solution in a certain sense and is generally not suitable for solving global optimization problems. Summary of the Invention
[0005] The present invention creates a Greedy Self - adapting Ant Colony Optimization algorithm (GSA - ACO). By introducing a greedy algorithm, it accelerates the initialization speed of the ant colony algorithm. An efficiency factor and an adaptable evaporation coefficient are added to speed up the optimization speed of the ant colony algorithm. The concept of relay in the ant colony is introduced to solve the problem that a single - ant path cannot complete task scheduling under constraints.
[0006] By introducing a greedy algorithm to process tasks first to obtain partial feasible solutions, and transforming them into the initial pheromone between paths in the ant colony algorithm through an initialization formula to solve the problem of slow initialization. The basis for this is that according to the results of many experimental simulations, the ant colony algorithm without initial pheromone is only applicable to medium - and small - scale data volumes. After increasing the data scale, the difficulty of path finding increases rapidly. At this time, if only the ant colony algorithm is used for iteration, it is difficult to guarantee the initialization speed, which is an obstacle restricting the practical application of the ant colony algorithm in large - scale resource scheduling problems. The greedy algorithm can find a set of relatively optimal feasible solutions in O(n) time complexity. If these solutions are transformed into the initial pheromone of the paths when selecting nodes in the ant colony algorithm and then iterative optimization is carried out based on the optimal solution of the greedy algorithm, the iterative efficiency of solving the optimal solution is accelerated.
[0007] The self - adaptation in the algorithm refers to the introduction of an adaptive adjustment of the evaporation coefficient in the algorithm parameters and the addition of an efficiency factor to the heuristic factor formula. By introducing an adaptive adjustment mechanism that analyzes the improvement amplitude of the pheromone evaporation coefficient based on the previous and subsequent scheduling results, the problem of optimization stagnation or being trapped in a local optimal solution during operation is solved. When optimization stagnation occurs, the evaporation coefficient is increased to expand the search range to jump out of the current optimum. When the optimization speed is slow, the evaporation coefficient is decreased to quickly find the optimum. The current heuristic factor formula generally only considers the distance factor. Here, this algorithm proposes adding an efficiency factor to the heuristic factor formula to make up for the coarseness of node path selection. The efficiency factor is a factor obtained by combining the execution time of the node, the transmission time, and the current state of the execution carrier when selecting the next node, and is essentially to balance the overall operation efficiency. The two adjustment mechanisms give the ant colony algorithm a clear optimization direction when facing optimization stagnation and solve the problem of unclear iterative direction.
[0008] The present invention also proposes a new method for ant relay scheduling in an ant colony. The traditional ant colony algorithm obtains a feasible final solution based on the simulation result of a single ant. However, for a complex task scheduling problem, under the constraint conditions, a single ant cannot obtain the final solution of the entire task in one iteration. At this time, the results of several ants need to be complemented with each other as a group of feasible solutions. Currently, some people have proposed a method of dividing two ants into a group to simultaneously select paths. However, a group of ants needs to synchronously select the next node, which brings problems of mutual interference in optimization and the need to roll back when a node is repeatedly selected. Moreover, in many cases, two ants may not be able to complete the task. Here, a new method of relay between ants is introduced. If an ant terminates the scheduling due to constraint conditions before clearing the taboo table, another ant is sent to continue to complete the task by sharing the taboo table of the previous ant. If the taboo table is still not cleared, the next ant is sent until the taboo table is cleared. Then, multiple complementary scheduling results are combined into a group of feasible solutions.
[0009] The above three improvements solve the problem that the ant colony algorithm is not applicable to large-scale task scheduling under constraint conditions. For example, in the problem of resource scheduling utilization in large-scale cluster scheduling, the conventional ant colony algorithm is difficult to be applied in practice because of its slow iterative operation speed, strong uncertainty in node selection, and the difficulty for a single ant's path to meet various constraint conditions. In addition, the algorithm has strong generality, and all improvements can be beneficial supplements and optimizations to various variants of the current ant colony algorithms.
[0010] The execution steps of the algorithm are as follows:
[0011] Step 1: Receive task information, process the task information, and establish a problem model.
[0012] Step 2: Call the greedy algorithm to process the task and obtain the information of the feasible solution for the next step.
[0013] Step 3: Call the ant colony algorithm and initialize the parameters of the ant colony algorithm.
[0014] Step 4: Start executing the ant colony algorithm and finally give the optimal solution in combination with the adaptive adjustment mechanism.
[0015] The flow chart of the entire algorithm is given in Figure 4 ... Brief Description of the Drawings
[0016] Figure 1 Schematic diagram of the logistics problem
[0017] Figure 2 Schematic diagram of the feasible solution obtained by the greedy algorithm
[0018] Figure 3 Schematic diagram of the optimal solution obtained by the ant colony algorithm
[0019] Figure 4 For the flowchart of the GSA - ACO algorithm Specific implementation manners
[0020] The present invention will be described in detail below in conjunction with examples and drawings.
[0021] The implementation manner of the present invention only takes solving the problem of logistics resource scheduling as an example, but the algorithm itself is widely applicable to various constrained task scheduling problems. For example Figure 1 As shown, this model sets up a distribution center and several customer nodes to be served (hereinafter referred to as nodes for short). The position coordinates and resource requirements of each node are known. The constraint here is that the load of the vehicle is limited, which is set to 100t in the example. Therefore, it is impossible to complete all distribution tasks with only one vehicle. So a feasible solution must contain multiple paths, and the nodes passed by the paths in these feasible solutions must add up to all the distribution nodes exactly. The ultimate optimization requirement is to complete the goods delivery task with the minimum total vehicle driving mileage. In the model for solving this problem by the improved ant colony algorithm, ants represent vehicles, and the nodes passed by the ants are the scheduling paths of the vehicles. The following is a detailed step description.
[0022] Step 1: Receive and process task information, and establish a problem model.
[0023] First, receive the task request, obtain the orientation information of the nodes and the distribution center, and obtain the schematic diagram as Figure 1 shown. The logistics scheduling problem here can be transformed into the problem of finding a set of shortest path solutions by traversing all nodes in a graph considering the vehicle load. Here, the distance between nodes is regarded as the consumption during the transmission between two nodes. There is a distribution center in the graph. Each feasible path must start from this node, and when the remaining cargo volume of the scheduling vehicle cannot meet the demand of any unserved node or all nodes have been served, it returns to the distribution center.
[0024] Step 2: Call the greedy algorithm to process the task and obtain the information of the feasible solution for the next step.
[0025] Call the greedy algorithm to process the task and find several groups of feasible solutions. This value is equivalent to the initial number of ants in the ant colony, which is set to 10 groups in the example. The selection of nodes in each group of solutions follows the principles of the nearest distance and non - repeated selection, that is, each step of node selection only considers finding the nearest node that can meet the requirements, and the nodes selected in a solution will not be selected again. The several paths formed after traversing all nodes without repetition are a group of feasible solutions. Figure 2It is a schematic diagram of a set of feasible solutions obtained by the greedy algorithm. As shown in the figure, it is difficult for the greedy algorithm to obtain the global optimal solution from an overall perspective, but these solutions provide data and experience for the initialization of the ant colony algorithm and the selection of nodes during iteration.
[0026] In addition, the greedy algorithm will select the nearest node to the current node in each selection process. Such an approach will bring a problem because generally there is only one node closest to the distribution center. By analogy, only one feasible path will be obtained eventually. The solution here is to sequentially specify the remaining nodes except the distribution center as the second necessary node on the starting route of each group of solutions to obtain more feasible path solutions.
[0027] Step 3: Update the relevant parameters of the ant colony algorithm and complete the initialization.
[0028] After obtaining several groups of solutions provided by the greedy algorithm, first calculate the total path distance value of each group of solutions with the aim of finding the optimal group of solutions with the shortest current distance. Then, by combining the ratio of the total path distance between the current optimal solution and other solutions and the physical distance between each path as the weight of the path, set the initial pheromone for the path formed by any two connected nodes in all solutions. From the following two formulas, we can convert the obtained path information into the initial pheromone between the path nodes in the ant colony algorithm.
[0029]
[0030] In formula (1), represents the initial pheromone of the path between any two consecutive nodes i and j included in the optimal solution provided by the greedy algorithm at the initial time f. d ij is the path distance between node i and node j. τ n is the initial pheromone between all node paths set for the ant colony algorithm. The value set here is 0.01 because in the example, the path value between nodes is generally less than 100 km, so the reciprocal of the path is generally greater than 0.01. Setting a low initial pheromone value can make full use of the information obtained by the greedy algorithm. As the path in the current optimal solution, the initial pheromone value does not need to be multiplied by a constant ξ between (0, 1). The purpose is to reward more pheromone for the dominant path, and this operation will increase the selection probability of the dominant path.
[0031] In formula (2), represents the initial pheromone of the path between any two consecutive nodes a and b included in the remaining non-optimal solutions at the initial time f. d ab is the path distance between nodes a and b. The value of ξ is the path length value Len given by the greedy algorithm at the initial time f best(f)and the path length value Len of each of the remaining non-optimal solutions now(f) is obtained by comparison. Therefore, the ξ value of each non-optimal solution varies with the path distance of this solution. The setting of the ξ value is to punish the pheromone content of the inferior path and reduce the probability of its being selected.
[0032] After initialization, the initial pheromone values of the paths between each node will be called by the probability formula when the nodes are selected in the ant colony algorithm. The optimal solution given by the greedy algorithm will be used as the initial current optimal solution of the ant colony algorithm. Since the mathematical mechanism of the ant colony algorithm is not yet mature, the initialization of other parameters of the algorithm here follows the optimal parameters after experimental simulation in the relevant literature on using the ant colony algorithm to solve logistics problems. Set the maximum number of iterations NC max of the ant colony to 50 times, the pheromone evaporation constant ρ to 0.15, the pheromone factor a to 2, the heuristic factor β to 6, the number of ants to 10, and the Q constant to 10. The taboo list of all initial ants consists of all the nodes that need to be served.
[0033] Step 4 starts to execute the ant colony algorithm and finally gives the optimal solution by combining the adaptive adjustment mechanism. 1) Start to execute the ant colony algorithm and place the initial ant colony to construct the path.
[0034] The number of ants has been given by the initialization, which is 10 here. Randomly place the starting points of all ants on each node to be delivered. The reason for not starting directly from the distribution center is that the selection of nodes is based on probability, and starting from the distribution center every time is likely to always select certain nodes, thus requiring the exclusion of a large number of duplicate paths. To meet the requirements, the total path distance value will be added with the distance from the initial node to the distribution center. Next, set the initial taboo list for each ant, and each node that has been delivered will be removed from the taboo list of that ant.
[0035] 2) According to the transition probability of ant k from the current node i to the next node j at time t select the next node in the way of roulette.
[0036]
[0037] Here, ant k refers to all the ants that need to select nodes in this step. Time t is any moment. Node i is the node where ant k is located at the current moment, and node j represents the next node to be selected. In the formula, J k(i) is all the nodes to be delivered on the taboo list of ant k at node i at time t. a is the pheromone factor, and β is the heuristic factor. The two represent the respective relative importance of pheromone and heuristic factor when selecting nodes, and their values have been initialized and defined. Formula (3) converts the pheromone and heuristic factor values of all feasible next nodes into the probability of being selected, and then randomly selects the next node according to the probability value. Before triggering the constraint condition and returning to the distribution center, ant k will continuously select the next node according to formula (3).
[0038] In formula (4) refers to the heuristic factor value of the next node j to be selected at node i at time t, represents the path distance between nodes i and j, W j is the resource demand of node j, Load i is the remaining resource of the ant at node i, so here W j should be less than Load i , otherwise, when the remaining resources cannot meet any undelivered node, the constraint condition is triggered and the ant returns to the distribution center. is composed of the resource demand W j of the next node j, the remaining amount Load i of the resources under the current node, and the distance factor d ij to form an efficiency factor. The larger this value is, the more inclined we are to select nodes with shorter distances and larger resource demands when selecting nodes. Setting the efficiency factor can comprehensively utilize the obtained information to balance the negative effect that only selecting nodes with the shortest path each time may lead to a longer distance to go next, making the selection of the next path node more reasonable. In addition, more parameters can be set here according to more known information and optimization requirements to further guide the selection of the optimization direction.
[0039] 3) Each time a feasible solution is completed, local update of pheromone is performed on the paths in this solution.
[0040] When ant K returns to the distribution center after departure, if the taboo list has not been emptied at this time, a new ant is sent out again. After sharing the taboo list of ant K, a remaining node in the taboo list is randomly selected, and after adding the distance from this point to the distribution center, repeat step 2 until the constraint condition is met and the ant returns to the distribution center. If the taboo list is still not emptied, continue to send out new ants until the taboo list is emptied. Then, the paths of several ants sharing the taboo list are combined to form a feasible solution containing each path, and local update of pheromone is performed on all the paths between two points passed by the just-mentioned solution. For the convenience of formula explanation below, all the feasible solutions that appear in this step are named solution m.
[0041]
[0042] Δτ m (i,j) = (Len m ) -1 , if (i, j) ∈ R m (6)
[0043] The moment t + 1 represents the next moment of any moment t that has appeared above. At this time, the solution m has been constructed, and it is necessary to perform a local update on the pheromone of the paths in the solution m. In equation (5), represents the local pheromone update value between any two nodes i and j in the path of solution m at the moment t + 1. represents the amount of pheromone of these paths at the previous moment t, and R m represents the set of paths formed between all the nodes passed by solution m. ρ(t) is the evaporation coefficient at moment t, and 1 - ρ(t) represents the residual coefficient at moment t. Δτ m(t+1) (i, j) is the pheromone increment between any two connected nodes i and j in the path passed by this solution at the moment t + 1, and its value is the reciprocal of the path distance Len m of the path passed by this solution.
[0044] Since the method of ant indirect force is used to break the solution of a logistics task scheduling problem under constraints (here the vehicle load), the ten ants initially dispatched can all complete the construction of a feasible solution with different paths through the relay method. At this time, after the local update of the pheromone of each solution path is completed, calculate the path distance values of all solutions, and select the optimal solution for this iteration.
[0045] 4) Record the current optimal solution, perform a global update of the pheromone on the path of the optimal solution, then clear the taboo table of all nodes, and start the next iteration again.
[0046]
[0047] Len best(t+2) = min(Len(t + 1), len(t))
[0048] After obtaining each solution at the moment t + 1, we perform a local update on the pheromone between its paths, and finally obtain the path value len(t + 1) of the optimal solution generated in this iteration. At the next moment t + 2, the evaporation coefficient of this global update will be obtained using formula (7), and then the pheromone of the path of this optimal solution will be globally updated using formula (8).
[0049] As shown in formula (7), Len(t) is the global optimal path distance value at moment t, and len(t + 1) is the optimal path distance value of this iteration obtained at moment t + 1. Len best(t+2)It is the minimum value between Len(t + 1) and len(t), representing the new global optimal path distance value updated by the ant colony algorithm after the (t + 2)-th moment in this iteration. The value of the pheromone evaporation coefficient ρ(t + 1) here is adaptively adjusted by comparing the improvement amplitude of the optimal path before and after. The more the current optimal path is improved, the smaller the evaporation coefficient ρ(t + 1) decreases proportionally, because reducing the evaporation coefficient ρ(t + 1) proportionally can better focus on optimizing this path; when the improvement is smaller or even there is no improvement, the evaporation coefficient ρ(t + 1) increases relatively, because increasing the evaporation coefficient can expand the search space of the ant colony. In this way, the problems of excessive iteration times or being trapped in local optimal solutions encountered in applying the ant colony algorithm in actual scheduling are solved.
[0050] τ in Formula 8 ij (t + 2 represents the global update value of the pheromone of any path connecting the front and rear nodes i and j in the optimal solution at the (t + 2)-th moment in this iteration. The value is the product of the residual coefficient 1 - ρ(t + 1) and the pheromone value τ ij (t + 1) and the ratio of the initialized constant Q and Len best(t+2 )'s sum.
[0051] 5) Iterate the ant colony algorithm repeatedly until the set NC max times and then terminate, and give the optimal execution path.
[0052] Repeatedly repeat steps 1 to 4 in the above iterative ant colony algorithm until the iteration times reach the set upper limit NC max that is, after 50 times, output the finally obtained optimal path. The obtained scheduling scheme is as shown Figure 3 and this scheduling scheme can be used to guide the design of scheduling schemes in actual logistics scheduling. From Figure 2 and Figure 3 the comparison of the two schematic diagrams, we can see that whether the scheduling scheme is carefully designed will bring a big gap to the final execution result. If an optimized scheme can be obtained by using the improved ant colony algorithm for final execution, it can not only significantly improve the resource utilization rate in the scheduling process of the logistics company, avoid resource waste, but also enhance the customer experience, and ultimately bring good economic and social benefits to the logistics company.
[0053] The above embodiments are only exemplary embodiments of the present invention and are not used to limit the present invention. The protection scope of the present invention is defined by the claims. Those skilled in the art can make various modifications or equivalent replacements within the essence and protection scope of the present invention, and such modifications or equivalent replacements should also be regarded as falling within the protection scope of the present invention.
Claims
1. A task scheduling method based on a greedy adaptive ant colony algorithm, characterized in that The execution steps are as follows: Step 1: Receive task information, process the task information, and establish a problem model; Step 2: Call the greedy algorithm to process the task and obtain the information of the feasible solution for the next step; Step 3: Call the ant colony algorithm and initialize the parameters of the ant colony algorithm. The implementation process of Step 3 is as follows. After obtaining the solution provided by the greedy algorithm, first calculate the total path distance value of each group of solutions, and find the optimal solution with the shortest current distance. By combining the ratio of the total path distance between the current optimal solution and other solutions and the physical distance between each path as the weight of the path, set the initial pheromone for the paths formed by any two connected nodes in all solutions. The path information obtained is converted into the initial pheromone between path nodes in the ant colony algorithm by the following two formulas; In formula (1), represents the initial pheromone between any two adjacent nodes i and j included in the optimal solution provided by the greedy algorithm at the initial time f; d ij is the path distance between node i and node j; τ n is the initial pheromone between all node paths set by the ant colony algorithm, and the value set here is 0.01; as the path in the current optimal solution, the initial pheromone value does not have to be multiplied by a constant ξ between (0, 1); In formula (2) represents the initial pheromone between any two adjacent nodes a and b included in the remaining non-optimal solutions at the initial moment f, and d ab is the path distance between nodes a and b; the value of ξ is the path distance value Len of the optimal solution given by the greedy algorithm at the initial moment f best(f) and the path distance value Len of each of the remaining non-optimal solutions now(f) compared, so the ξ value of each non-optimal solution is different with the path distance of this solution; the maximum number of iterations NC of the ant colony max is set to 50 times, the pheromone evaporation constant ρ is set to 0.15, the pheromone factor α is 2, the heuristic factor β is 6, the number of ants is determined to be 10, and the Q constant is set to 10; the taboo list of all initial ants consists of all nodes to be served; Step 4: Start executing the ant colony algorithm and finally give the optimal solution by combining the adaptive adjustment mechanism; 1) Execute the ant colony algorithm, place the initial ant colony to start constructing the path; Use the ant colony algorithm to find and give the optimal path; execute the ant colony algorithm, place the initial ant colony to start constructing the path; Randomly place the starting points of all ants at each node to be delivered; the total path distance value will be added with the distance from the initial node to the distribution center; Next, set the initial taboo list for each ant, and each node that has been delivered will be removed from the taboo list of the ant; 2) Calculate the transition probability of ant k from the current node i to the next node j at time t Select the next node in the way of roulette wheel; Here, ant k refers to all the ants that need to select nodes in this step. Time t is any moment. Node i is the node where ant k is located at the current moment, and node j represents the next node to be selected. In formula (3), J k (i) are all the nodes to be delivered on the taboo list of ant k at node i at time t. a is the pheromone factor, and β is the heuristic factor, and their values have been initialized and defined. Formula (3) converts the pheromone and heuristic factor values of all feasible next nodes into the probability of being selected, and then randomly selects the next node according to the probability value. Before triggering the constraint condition and returning to the distribution center, ant k will continuously select the next node according to formula (3). In formula (4) refers to the heuristic factor value of the next node j to be selected by node i at time t, represents the path distance between nodes i and j, W j is the resource demand of node j, Load i is the remaining resource of the ant at node i. Therefore, here W j should be less than Load i , otherwise, when the remaining resources cannot meet any unassigned node, the constraint condition is triggered to return to the distribution center; is the efficiency factor composed of the resource demand W j of the next node j, the remaining amount Load i of the resources under the current node, and the distance factor d ij ; 3) Perform local update of pheromone for the paths in each feasible solution every time a feasible solution is completed; When ant K returns to the distribution center again after departure, if the taboo list has not been emptied at this time, send out a new ant again after sharing the taboo list of ant K, randomly select a remaining node in the taboo list, add the distance from this point to the distribution center, and repeat Step 2 to construct a new path until the constraint conditions are met and return to the distribution center; if the taboo list still has not been emptied, continue to send out new ants until the taboo list is emptied; then combine the paths of several ants sharing the taboo list to form a feasible solution including the above-mentioned paths, and then perform local update of pheromone for all paths between two points passed by the just-mentioned solution. For the convenience of the following formula description, name all feasible solutions that appear in this step as solution m; Δτ m(t+1) =(len m ) -1 , if (i, j) ∈ R m (6) The moment t+1 represents the next moment of any moment t that has appeared above. At this time, ant K has completed node selection and the construction of feasible solutions; in equation (5), represents the local pheromone update value between the paths of any two consecutive nodes i and j in solution m at moment t+1; represents the pheromone amount of these paths at the previous moment t, R m represents the set of paths formed by all the nodes passed by solution m. ρ(t) is the evaporation coefficient at moment t, and 1-ρ(t) represents the residual coefficient at moment t, Δτ m(t+1) (i,j) is the pheromone increment between the paths of any two nodes i and j passed by solution m at moment t+1, and its value is the reciprocal of the path distance len m of the solution; Since the method of ant relay is adopted to break the solution of a logistics task scheduling problem under constraint conditions, the initial ten ants sent out can all complete the construction of a feasible solution with different paths through the relay method; at this time, after performing local update of pheromone for the path information of each group of solutions, calculate the path distance values of all solutions and select the optimal solution for this time; 4) Record the current optimal solution, perform global update of pheromone for the path of the optimal solution, then empty the taboo list of all nodes, and start a new iteration; len best(t+2) = min(len(t + 1), len(t)) After obtaining each solution at time t+1, the pheromone between its paths is locally updated, and finally the optimal solution and path value len(t+1) generated in this iteration are obtained; at the next time t+2, the evaporation coefficient ρ(t+1) of this global update will be obtained using formula (7), and then the pheromone of the optimal path in all solutions in this iteration will be globally updated using formula (8); As shown in formula (7), len(t) is the distance value of the globally optimal path at time t, and len(t + 1) is the optimal path distance value obtained at time t + 1 for this iteration; len best(t+2) is the minimum of len(t + 1) and len(t), representing the new globally optimal path distance value updated by the ant colony algorithm at time t + 2 after this iteration; in formula (8), represents the global update value of the pheromone of the path between the two adjacent nodes i and j in the optimal solution m at time t + 2 for this iteration. This value is the product of the new residual coefficient 1 - ρ(t + 1) and the pheromone value after local update between paths at time t + 1 and the sum of the product and the initialized constant Q and len best(t+2) ratio; 5) Repeat steps 1) to 4) in the above iterative ant colony algorithm until the number of iterations reaches the set upper limit NC max That is, after 50 times, output the finally obtained optimal path.
2. The task scheduling method based on the greedy adaptive ant colony algorithm according to claim 1, wherein The implementation process of step 1 is as follows: Here, the example is logistics resource scheduling. A distribution center and several customer nodes to be served are set up, hereinafter referred to as nodes for short; the location coordinates and resource requirements of each node are known; the constraint is that the vehicle load is limited, so it is impossible to complete all distribution tasks with only one vehicle and one path. Therefore, a feasible solution must contain multiple paths, and the nodes passed by the paths in these feasible solutions must add up to all the distribution nodes exactly; each feasible path must start from this node, and when the remaining cargo volume of the scheduling vehicle cannot meet the requirements of any unserved node or all nodes have been served, it returns to the distribution center; the final optimization requirement is to complete the cargo delivery task with the minimum total vehicle driving mileage.
3. The task scheduling method based on the greedy adaptive ant colony algorithm according to claim 1, wherein : Step 2 will call the greedy algorithm to process the tasks and find several groups of feasible solutions, and the value is the same as the initial number of ants in the ant colony, which is set to 10 groups in the example; the selection of nodes in each group of solutions follows the principles of the nearest distance and non-repetitive selection, that is, each step of node selection only considers finding the nearest node that can meet the requirements, and the nodes selected in a solution will not be selected again. The several paths formed after traversing all nodes without repetition are a group of feasible solutions; in addition, when the greedy algorithm selects the starting route of each group of solutions, it will successively specify the remaining nodes except the distribution center as the second necessary node of this route to obtain more feasible path solutions.
Citation Information
Patent Citations
Method for planning route of unmanned aerial vehicle based on potential field ant colony optimization
CN108563239A