Method, system and device for searching solutions to parallel integer linear programming problems
By running multiple local search solvers in parallel and sharing high-quality feasible solutions, the problem that local search for integer programming is difficult to break out of local optimal solutions, and the solution quality and efficiency are improved.
Patent Information
- Application Number
- CN202410399883.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-03
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2044-04-03
AI Technical Summary
The existing integer planning local search solvers are difficult to break out of the local optimal solution during parallel search, resulting in low solution quality and difficulty in finding high-quality solutions.
By running multiple local search solvers in parallel, each solver is configured with a different initial solution and shares high-quality feasible solutions in the solution set pool. It is used to restart the solver trapped in the local optimal state, reduce duplicate searches, and improve searches Probability of solution to different regions.
It effectively improves the solution quality of integer linear programming problems, reduces the repeated searches brought about by fixed rules, and increases the probability of finding high-quality solutions.
Smart Images

Figure CN118193930B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer software verification, and in particular to a method, system and device for searching for solutions to parallel integer linear programming problems. Background Art
[0002] The local search integer programming solver is a tool for solving operations optimization problems. It can be used to solve problems in the fields of logistics, production, supply chain, air transportation, etc. For example, in a transportation planning scenario, users model warehouse locations, destination locations, transportation equipment, and road network information in mathematical form, and call the local search solver to obtain the solution of the mathematical model and convert it into a transportation plan output. The solution process of the local search solver is to generate new solutions by constantly modifying the values of variables.
[0003] In the process of parallel local search, as the search time increases, the search may fall into the area of repeated search. Traditionally, there are solutions such as taboo search, restart, and random perturbation, but the effect is limited. In the prior art, the algorithm idea of the taboo search strategy is to mark the local optimal solution or solution process that has been solved, and avoid these local optimal solutions or solution processes in further iterations. It can be seen that the taboo search strategy only prohibits some of the searched areas, which makes it difficult to help the solver find solutions to new areas. The restart strategy can change the starting solution, but because the search strategy is still the same, the ability to find solutions to new areas is limited. Random perturbation can find solutions in different areas, but the range is small, and due to randomness, the quality of the solution may be low.
[0004] In summary, the existing integer programming local search solver has limited ability to jump to different regions to find high-quality solutions, and it is difficult to search for high-quality solutions in different regions, resulting in low solution quality. Summary of the invention
[0005] In view of the above problems, the present invention is proposed to provide a method, system and device for searching solutions to parallel integer linear programming problems that overcome the above problems or at least partially solve the above problems.
[0006] One aspect of the present invention provides a method for searching for a solution to a parallel integer linear programming problem, the method comprising:
[0007] Running multiple local search solvers in parallel, each local search solver is configured with the same integer linear programming problem and different initial solutions;
[0008] Obtain feasible solutions that meet preset solution quality requirements searched by each local search solver, and collect the obtained feasible solutions into a preset solution pool;
[0009] Before reaching a preset solution time threshold, monitoring the running state of each local search solver, and determining whether the corresponding local search solver falls into a local optimal state according to the running state of each local search solver;
[0010] A feasible solution is selected from the solution pool as a shared feasible solution, and the shared feasible solution is used as the target local search solver that is stuck in a local optimal state to restart the initial solution of the local search and restart the local search.
[0011] Optionally, after collecting the obtained feasible solutions into a preset solution pool, the method further includes:
[0012] It is determined whether the number of feasible solutions stored in the solution pool is greater than a preset capacity threshold. If the number of solutions is greater than the capacity threshold, the feasible solution with the worst solution quality in the solution pool is deleted.
[0013] Optionally, monitoring the operating state of each local search solver and determining whether the corresponding local search solver is trapped in a local optimal state according to the operating state of each local search solver includes:
[0014] Monitor whether the feasible solution output by each local search solver has not been updated for a preset time length. If the feasible solution output by a local search solver has not been updated for a preset time length, it is determined that the corresponding local search solver has fallen into a local optimal state.
[0015] Optionally, collecting the obtained feasible solutions into a preset solution pool includes:
[0016] Adding the feasible solution to the solution pool, and recording the constraint weight set corresponding to the feasible solution;
[0017] Accordingly, the step of taking the shared feasible solution as the initial solution of the target local search solver to restart the local search and restarting the local search comprises:
[0018] The shared feasible solution and the constraint weight set corresponding to the shared feasible solution are shared with the target local search solver, so that the target local search solver restarts the local search with the shared feasible solution as the initial solution, and determines the weight corresponding to each constraint in the local search process after the restart according to the corresponding constraint weight set.
[0019] Optionally, selecting a feasible solution from the solution pool as a shared feasible solution includes:
[0020] Randomly select a feasible solution from the solution pool as a shared feasible solution; or
[0021] Selecting a feasible solution with the highest solution quality from the solution pool as a shared feasible solution; or
[0022] A pre-trained high-quality feasible solution generation model is used to generate a generative feasible solution that meets the preset solution quality requirements and a generative constraint weight set of the current solution, and the generative feasible solution is added to the solution set pool and used as a shared feasible solution.
[0023] Optionally, the training step of the high-quality feasible solution generation model includes:
[0024] Classifying the feasible solutions in the solution pool into quality grades to obtain the quality grade of each feasible solution;
[0025] The integer linear programming problem to be solved is used as input data, and each feasible solution in the solution pool and the quality level of each feasible solution are used as labels to construct training data;
[0026] The training data is trained using a machine learning model to obtain a high-quality feasible solution generation model.
[0027] Optionally, the solution search method of each local search solver includes:
[0028] S11, configuring an initial solution to the integer linear programming problem to be solved, and performing a local search with the initial solution;
[0029] S12, before reaching a preset solution time threshold, using tight movement as an operator to generate a neighborhood of the current solution in the local search process; wherein the tight movement includes tight movement that satisfies the constraint and tight movement that does not satisfy the constraint;
[0030] S13, collecting statistics of solution state statistics during the local search process, and calculating the application probability of each tight move operator according to the solution state statistics;
[0031] S14, probabilistically selecting an adjacent solution corresponding to a corresponding compact moving operator from a neighborhood of the current solution as an updated current solution according to the application probability of each compact moving operator;
[0032] Return to step S12, and repeat the local search process of steps S12 to S14 until a preset solution time threshold is reached;
[0033] S15. Using the updated current solution obtained when the preset solution time threshold is reached as a feasible solution to the integer linear programming problem to be solved.
[0034] In a second aspect, the present invention further provides a solution search system for a parallel integer linear programming problem, the system comprising a plurality of local search solvers running in parallel, a solution pool, and an optimization control subsystem, the optimization control subsystem comprising:
[0035] An operation control module is used to run multiple local search solvers in parallel, each local search solver has the same integer linear programming problem to be solved and is configured with different initial solutions;
[0036] A solution collection module is used to obtain feasible solutions that meet preset solution quality requirements searched by each local search solver, and collect the obtained feasible solutions into a preset solution collection pool;
[0037] A state monitoring module is used to monitor the operating state of each local search solver before reaching a preset solution time threshold, and determine whether the corresponding local search solver falls into a local optimal state according to the operating state of each local search solver;
[0038] The optimization restart module is used to select a feasible solution from the solution set pool as a shared feasible solution, use the shared feasible solution as the target local search solver that is stuck in a local optimal state to restart the initial solution of the local search and restart the local search.
[0039] In a third aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the solution search method for the above parallel integer linear programming problem.
[0040] In a fourth aspect, the present invention further provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for searching solutions to parallel integer linear programming problems when executing the computer program.
[0041] The solution search method, system and device for parallel integer linear programming problems provided by the embodiments of the present invention select a feasible solution from the solution set pool as a shared feasible solution and provide it to the local search solver that has fallen into a local optimal state when the local search solver finds it difficult to improve the quality of the solution, so that the local search solver can restart the local search with this solution as the initial solution to continue searching, thereby reducing repeated searches caused by fixed rules, increasing the probability of searching for solutions in different areas, and effectively improving the quality of the solution.
[0042] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0044] Figure 1 A flow chart of a method for searching for solutions to a parallel integer linear programming problem provided by one embodiment of the present invention;
[0045] Figure 2 A system architecture diagram of a method for searching for solutions to parallel integer linear programming problems proposed in another embodiment of the present invention;
[0046] Figure 3 A flow chart of a solution search method for each local search solver running in parallel proposed in an embodiment of the present invention;
[0047] Figure 4 A structural block diagram of a solution search system for a parallel integer linear programming problem is provided for an embodiment of the present invention. DETAILED DESCRIPTION
[0048] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0049] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0050] Those skilled in the art will appreciate that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined.
[0051] Figure 1The flowchart of the method for searching for a solution to a parallel integer linear programming problem according to one embodiment of the present invention is schematically shown. Figure 1 The solution search method for a parallel integer linear programming problem according to an embodiment of the present invention specifically comprises the following steps:
[0052] S1. Running multiple local search solvers in parallel, each local search solver has the same integer linear programming problem to be solved and is configured with a different initial solution.
[0053] Integer linear programming (ILP) problems are linear programming problems whose variables are integers. The present invention can utilize the independence between threads to run multiple local search solvers in parallel to perform calculations on multiple solution tasks simultaneously. The local search solver uses local search to solve, specifically, given an initial solution, it continuously selects operators to edit the current solution until a satisfactory solution is found or the calculation time reaches a preset upper limit.
[0054] In this embodiment, different local search solvers solve the same problem, but their initial solutions may be different. The purpose of setting different initial solutions for different local search solvers is to improve the local search solver's ability to jump to different areas to find high-quality solutions. It is understandable that when configuring the initial solution, the same or different initial solutions may be configured for running multiple local search solvers.
[0055] S2. Obtain feasible solutions that meet preset solution quality requirements searched by each local search solver, and collect the obtained feasible solutions into a preset solution pool.
[0056] In this embodiment, after collecting the obtained feasible solutions into a preset solution pool, the method further includes: determining whether the number of feasible solutions stored in the solution pool is greater than a preset capacity threshold, and if the number of solutions is greater than the capacity threshold, deleting the feasible solution with the worst solution quality in the solution pool to maintain the number of high-quality feasible solutions in the solution pool. Specifically, a feasible solution that meets the preset solution quality requirements is identified as a high-quality feasible solution. A high-quality feasible solution refers to a solution with an ideal target value (better than any existing solution in the solution pool or as good as the best in the pool) and that meets all constraints.
[0057] S3. Before reaching a preset solution time threshold, monitor the operating state of each local search solver, and determine whether the corresponding local search solver falls into a local optimal state according to the operating state of each local search solver.
[0058] Among them, the operating status of each local search solver is monitored, and whether the corresponding local search solver is trapped in a local optimal state is determined according to the operating status of each local search solver, specifically including: monitoring whether the feasible solution output by each local search solver is not updated for a preset time length, if the feasible solution output by a local search solver is not updated for a preset time length, it is determined that the corresponding local search solver is trapped in a local optimal state.
[0059] S4. Select a feasible solution from the solution pool as a shared feasible solution, use the shared feasible solution as the target local search solver that is stuck in a local optimal state to restart the initial solution of the local search and restart the local search.
[0060] Being trapped in a local optimum means that a solver A has found a solution X, and there is no better solution in its neighborhood, but it is not the global optimal solution to the problem. At this time, human intervention is required to jump out of the local optimum. The present invention helps solver A jump out of the local optimum by sharing the high-quality solution X' and the associated weight {w_i} in the solution pool.
[0061] In an embodiment of the present invention, different local search solvers are configured by running multiple parameters (initial solutions) in parallel, and a solution pool is used to collect high-quality feasible solutions searched by each local search solver. When the solution pool is full, that is, the number of feasible solutions stored in the solution pool is greater than the capacity threshold, a high-quality feasible solution entering the solution pool will kick out the last solution, that is, the feasible solution with the worst solution quality in the solution pool, and monitor in real time whether a target local search solver that falls into a local optimal state appears, and share a solution in the solution pool with the target local search solver that falls into a local optimal state (that is, there is no progress for a long enough number of steps), and use this as the initial solution to restart the local search and continue searching, thereby reducing repeated searches caused by fixed rules, increasing the probability of searching solutions in different areas, and effectively improving the quality of the solution.
[0062] Further, in an optional embodiment of the present invention, collecting the obtained feasible solutions into a preset solution pool in step S2 specifically includes: adding the feasible solutions to the solution pool, and recording the constraint weight set corresponding to the feasible solutions.
[0063] Correspondingly, in step S4, using the shared feasible solution as the initial solution for restarting the local search of the target local search solver and restarting the local search specifically includes: sharing the shared feasible solution and the constraint weight set corresponding to the shared feasible solution to the target local search solver, so that the target local search solver restarts the local search using the shared feasible solution as the initial solution, and determining the weight corresponding to each constraint in the local search process after the restart according to the corresponding constraint weight set.
[0064] In the embodiment of the present invention, if a high-quality feasible solution is accepted into the solution pool, the weight of the corresponding constraint is also accepted. That is, when a solution enters the solution pool, the weight set {w_i} corresponding to the solution is recorded for use in subsequent steps. Specifically, during the local search process, each constraint con_i has a corresponding weight w_i. The weight of the constraint represents the importance of the constraint in the integer linear programming problem to be solved. If the weight of the constraint is large, the algorithm is more inclined to select a solution that satisfies the constraint during the search for a solution; on the contrary, if the weight of the constraint is small, its influence during the search will be relatively small. The specific calculation method can be manually set and initialized, for example, using the same weight at the beginning, and then changing it according to certain manually set rules during the search process, increasing the weight of some constraints and reducing the weight of some constraints.
[0065] When a local search solver is detected to be trapped in a local optimum, the solution in the solution pool is shared with the local search solver, and the constraint weight is shared and assigned to the weight of the local search solver.
[0066] Further, in an optional embodiment of the present invention, the step S4 of selecting a feasible solution from the solution pool as a shared feasible solution can be implemented in the following ways, including:
[0067] Randomly select a feasible solution from the solution pool as a shared feasible solution; or
[0068] Selecting a feasible solution with the highest solution quality from the solution pool as a shared feasible solution; or
[0069] A pre-trained high-quality feasible solution generation model is used to generate a generative feasible solution that meets the preset solution quality requirements and a generative constraint weight set of the current solution, and the generative feasible solution is added to the solution set pool and used as a shared feasible solution.
[0070] Specifically, the training steps of the high-quality feasible solution generation model include: dividing the quality levels of the feasible solutions in the solution pool to obtain the quality level of each feasible solution; using the integer linear programming problem to be solved as input data, and using the feasible solutions in the solution pool and the quality level of each feasible solution as labels to construct training data; using a machine learning model to learn and train the training data to obtain a high-quality feasible solution generation model. Among them, the quality of the solution in the present invention refers to the target value f(X) obtained by substituting the solution X into the objective function f(x) corresponding to the integer linear programming problem to be solved. For maximization problems, the larger the target value, the better the quality of the solution. For minimization problems, the smaller the target value, the better the quality of the solution. "Labels" are the outputs of machine learning, including solutions, weights, and objective function values. Input a problem, and use machine learning to solve it.
[0071] In this embodiment, in addition to randomly sharing a solution in a solution pool with the solver that is trapped in the local optimum as the initial solution for restarting the local search, a machine learning method can also be used to generate more high-quality solutions. Specifically, when the local search algorithm in the child thread fails to find a better solution for a certain period of time, the problem is used as input, and a solution is generated using the trained feasible solution generation model, which is returned to the local search algorithm as the starting position to continue searching.
[0072] like Figure 2 As shown, the present invention uses high-quality feasible solutions in the solution pool as training data, and applies machine learning to train a model for generating high-quality feasible solutions to generate more high-quality feasible solutions. Specifically, high-quality feasible solutions and the quality of the solutions are collected during the search process, the integer linear programming problem to be solved is used as input data, the collected solutions and the quality of the solutions are used as labels, training data is constructed, and input into the machine learning model, and the machine learning model is used to train a model for high-quality solutions. The generated high-quality solutions are added to the solution pool and used to share with solvers that are trapped in local optimality. It is understandable that different machine learning models can be used to train and generate new solutions, such as graph neural network models, Transformer models, etc., and the present invention does not specifically limit this.
[0073] The present invention uses a machine learning model to learn high-quality solutions, and when the search algorithm is difficult to improve the quality of the solution, the machine learning model is used to generate a new solution, which is provided to the local search algorithm for continued search. This method reduces repeated searches caused by fixed rules and can increase the probability of searching for solutions in different areas. At the same time, because the machine learning model uses high-quality solutions as training data, it considers the quality of the solution more than random perturbations, which is conducive to helping find high-quality solutions in different areas and improving the overall solution quality.
[0074] Furthermore, if Figure 3 As shown, in the embodiment of the present invention, the solution search method of each local search solver running in parallel includes the following steps:
[0075] S11. configuring an initial solution to the integer linear programming problem to be solved, and performing a local search with the initial solution.
[0076] S12. Before reaching a preset solution time threshold, use tight movement as an operator to generate a neighborhood of the current solution in the local search process; wherein the tight movement includes tight movement that satisfies the constraints and tight movement that does not satisfy the constraints.
[0077] Among them, tight move (Tight Move): reassign the variable x_j in the current solution to make the constraint con_i as tight as possible while ensuring that x_j is within the legal range. It can be seen that the tight move tm(x_j,con_i) is the assignment of x_j that makes con_i as tight as possible. For the current solution X, all tight moves tm(x_j,con_i) consisting of all constraints con_i and the variables x_j contained therein are candidate tight moves. Depending on whether con_i is satisfied, tight moves can be divided into two categories, including tight moves that satisfy the constraints and tight moves that do not satisfy them. Specifically, for tight moves tm(x_j,con_i), if the constraint con_i is satisfied, then tm(x_j,con_i) is a tight move in the satisfied constraints, otherwise it is a tight move in the unsatisfied constraints. In this embodiment, an assignment of all variables x_i is called solution X. Apply any tight move tm(x_j,con_i) to this solution to obtain a new solution X'. For the current solution X, all solutions X' that can be reached by one tight move are called adjacent solutions. The set of adjacent solutions X' is called the neighborhood. The neighborhood serves the local search. At each step of the local search, for the current solution X, an optimal solution is selected from all adjacent solutions X' (that is, the set of these solutions is called the neighborhood) as the new current solution until the time runs out and the best possible historical optimal solution is obtained, or there is no solution.
[0078] It should be noted that the local search may enter a local optimal state, that is, there is no better solution in the neighborhood, but this solution is not the global optimal solution to the problem itself.
[0079] S13, collecting statistics of solution state statistics during the local search process, and calculating the application probability of each compact move operator according to the solution state statistics, wherein the solution state statistics is information used to reflect the performance of the local search in solving the integer linear programming problem to be solved.
[0080] S14. Probabilistically select an adjacent solution corresponding to a corresponding tight moving operator from the neighborhood of the current solution as the updated current solution according to the application probability of each tight moving operator.
[0081] In this embodiment, all tight move operators are composed of two types of tight moves: tight moves that satisfy the constraints and tight moves that do not satisfy the constraints. The probability determines which type is selected (the sum of the two probabilities is equal to 1). In the selected type, according to the local search criterion, an adjacent solution corresponding to an optimal tight move is selected as the solution for the next step.
[0082] Return to step S12, and repeat the local search process of steps S12 to S14 until a preset solution time threshold is reached;
[0083] S15. Using the updated current solution obtained when the preset solution time threshold is reached as a feasible solution to the integer linear programming problem to be solved.
[0084] In this embodiment, the field of using tight moves to generate the current solution specifically includes: applying each tight move to the current solution to obtain each new solution corresponding to the corresponding tight move operator, and using the solution set composed of the new solutions as the neighborhood of the current solution.
[0085] The solution search method for serial integer linear programming problems provided by an embodiment of the present invention calculates the probability of applying each tight move operator according to the solution state statistical information in the local search process, and probabilistically selects the operator to be applied. Since the statistical information reflects the performance of the local search in solving this problem and takes into account the satisfaction of various constraints in the integer programming, it can better adapt to the characteristics of the integer programming problem. Selecting an operator that is more suitable for the current solution state according to the solution state statistical information can improve the adaptability of the search algorithm and improve the solution efficiency.
[0086] In an optional embodiment of the present invention, the solution state statistics refer to the number of currently satisfied constraints (satCons), the number of unsatisfied constraints (unsatCons), and the total number of constraints (nCons). Assuming that the current solution is X, all constraints of the problem to be solved are {cons}, substitute X into any constraint con_i. If the inequality corresponding to this constraint holds, the constraint is satisfied. Otherwise, the constraint is not satisfied. Therefore, substituting X into all con_i and testing once can determine how many constraints are satisfied and how many constraints are not satisfied. Further, the step S13 specifically includes:
[0087] Count the total number of constraints nCons of the integer linear programming problem to be solved, the number of constraints satisfied by the current solution satCons, and the number of unsatCons of constraints not satisfied;
[0088] The ratio of satCons to nCons is taken as the application probability of the tight move operator that satisfies the constraints, and the ratio of unsatCons to nCons is taken as the application probability of the tight move operator that does not satisfy the constraints.
[0089] In the embodiment of the present invention, the tight moves in the satisfied constraints and the tight moves in the unsatisfied constraints can be combined to form the neighborhood of the current solution, and each tight move is an operator used to change the current solution. The probability of applying each operator is calculated based on the statistical information in the local search process, and the operator to be applied is selected probabilistically. Specifically, during the operation, the tight moves in the satisfied constraints are selected with a probability of satCons / nCons, and the unsatisfied tight moves are selected with a probability of unsatCons / nCons. Where nCons = satCons + unsatCons.
[0090] Since the more constraints that are satisfied, the larger the neighborhood generated by the tight movement that satisfies the constraints, the greater the probability of obtaining a good neighbor, so the probability of selecting the tight movement operator that satisfies the constraints should be greater. The same is true for the tight movement that does not satisfy the constraints. Therefore, the present invention can better adapt to the characteristics of integer programming problems, and selecting an operator that is more suitable for the current solution state according to statistical information can improve the ability of the search algorithm to adapt and improve the solution efficiency.
[0091] In another optional embodiment of the present invention, other types of solution status statistical information may also be used, such as the number of times a constraint is satisfied / not satisfied within a period of time and the ratio of the total number of constraints*time length as the probability selection.
[0092] Specifically, the solution status statistics in this embodiment refers to the number of currently satisfied constraints (satCons), the number of times the target constraints are satisfied within a preset time length (yesCons), and the number of times they are not satisfied (noCons). Further, the step S13 specifically includes:
[0093] Count the total number of constraints nCons of the integer linear programming problem to be solved, the number of times the target constraints are satisfied yesCons within the preset time length, and the number of times they are not satisfied noCons;
[0094] Calculate the product of nCons and the time length;
[0095] The ratio of yesCons to the product is used as the application probability of the tight move operator that meets the target constraint, and the ratio of noCons to the product is used as the application probability of the tight move operator that does not meet the target constraint.
[0096] The following is an example of using the solution search method for the parallel integer linear programming problem of the present invention in a specific scenario.
[0097] Take the scheduling problem as an example: the scheduling problem refers to how to reasonably allocate limited resources to complete a series of tasks. This problem has wide applications in production, manufacturing, logistics, education, medical care and other fields. For example, production scheduling in the manufacturing industry, flight scheduling of airlines, teacher and classroom scheduling in educational institutions, and doctor and patient scheduling in hospitals are all scheduling problems. Modeling the scheduling problem as an integer linear programming problem is mainly divided into the following three steps: 1. Determine the decision variables 2. Establish the objective function 3. Establish constraints. Taking production scheduling as an example, possible decision variables include the start time and end time of each task; the objective function may be to minimize the completion time of the last task; the constraints may include that the start time of each task must be later than the end time of its dependent tasks, and the duration of each task cannot exceed the occupancy time of its available resources. After modeling the scheduling problem as an integer linear programming problem, the model file can be passed into the parallel solver of the present invention, and the solution search method of the parallel integer linear programming problem of the present invention can be used to solve it. Finally, the solution is converted into a scheduling scheme and output. However, in real scenarios, the performance of the serial solver may be poor due to the lack of full use of the parallel computing resources and computing power of the hardware. Therefore, if hardware resources permit, using a parallel solver would be a better choice.
[0098] The solution search method for parallel integer linear programming problems provided by the embodiment of the present invention selects a feasible solution from the solution pool as a shared feasible solution and provides it to the local search solver that is trapped in a local optimal state when the local search solver is unable to improve the quality of the solution, so that the local search solver can restart the local search with this solution as the initial solution to continue searching, thereby reducing repeated searches caused by fixed rules, increasing the probability of searching for solutions in different areas, and effectively improving the quality of the solution. Furthermore, when the shared feasible solution is a generative feasible solution generated by a machine learning model, since the machine learning model uses high-quality solutions as training data, it considers the quality of the solution more than random perturbations, which is conducive to helping find high-quality solutions in different areas and improving the overall solution quality.
[0099] For the method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0100] In addition, an embodiment of the present invention further provides a solution search system for a parallel integer linear programming problem. The solution search system for a parallel integer linear programming problem in an embodiment of the present invention includes multiple local search solvers running in parallel, a solution pool, and an optimization control subsystem, wherein the optimization control subsystem includes a functional module for implementing the solution search method for a parallel integer linear programming problem as described in any one of the above items. Figure 4 As shown, the optimization control subsystem includes an operation control module 401, a solution collection module 402, a state monitoring module 403 and an optimization restart module 404, wherein:
[0101] An operation control module 401 is used to run multiple local search solvers in parallel, each local search solver has the same integer linear programming problem to be solved and is configured with different initial solutions;
[0102] A solution collection module 402 is used to obtain feasible solutions that meet preset solution quality requirements searched by each local search solver, and collect the obtained feasible solutions into a preset solution collection pool;
[0103] A state monitoring module 403 is used to monitor the operating state of each local search solver before reaching a preset solution time threshold, and determine whether the corresponding local search solver falls into a local optimal state according to the operating state of each local search solver;
[0104] The optimization restart module 404 is used to select a feasible solution from the solution pool as a shared feasible solution, use the shared feasible solution as the target local search solver that is stuck in a local optimal state to restart the initial solution of the local search and restart the local search.
[0105] In an embodiment of the present invention, the solution collection module 402 is also used to determine whether the number of feasible solutions stored in the solution pool is greater than a preset capacity threshold after the acquired feasible solutions are collected into a preset solution pool. If the number of solutions is greater than the capacity threshold, the feasible solution with the worst solution quality in the solution pool is deleted.
[0106] In the embodiment of the present invention, the state monitoring module 403 is used to monitor whether the feasible solution output by each local search solver has not been updated for a preset time length. If the feasible solution output by a local search solver has not been updated for a preset time length, it is determined that the corresponding local search solver has fallen into a local optimal state.
[0107] In the embodiment of the present invention, the solution collection module 402 is specifically used to add the feasible solution to the solution pool and record the constraint weight set corresponding to the feasible solution;
[0108] Accordingly, the optimization restart module 404 is specifically used to share the shared feasible solution and the constraint weight set corresponding to the shared feasible solution to the target local search solver, so that the target local search solver uses the shared feasible solution as the initial solution to restart the local search, and determines the weight corresponding to each constraint in the local search process after the restart according to the corresponding constraint weight set.
[0109] In an embodiment of the present invention, the optimization restart module 404 is specifically used to randomly select a feasible solution from the solution pool as a shared feasible solution; or, select a feasible solution with the highest solution quality from the solution pool as a shared feasible solution; or, use a pre-trained high-quality feasible solution generation model to generate a generative feasible solution that meets preset solution quality requirements and a generative constraint weight set of the current solution, add the generative feasible solution to the solution pool and use it as a shared feasible solution.
[0110] Furthermore, the solution search system for parallel integer linear programming problems also includes a machine learning subsystem, which implements the training of a high-quality feasible solution generation model in the following ways, specifically including: classifying the feasible solutions in the solution pool into quality levels to obtain the quality level of each feasible solution; using the integer linear programming problem to be solved as input data, and using the feasible solutions in the solution pool and the quality level of each feasible solution as labels to construct training data; and using a machine learning model to learn and train the training data to obtain a high-quality feasible solution generation model.
[0111] In this embodiment, each of the local search solvers is specifically used to execute the solution search method as shown below, specifically including: S11, configuring an initial solution of the integer linear programming problem to be solved, and performing local search with the initial solution; S12, using tight movement as an operator to generate a neighborhood of the current solution in the local search process before reaching a preset solution time threshold; wherein, tight movement includes tight movement that satisfies the constraints and tight movement that does not satisfy the constraints; S13, performing statistics on the solution state statistical information in the local search process, and calculating the application probability of each tight movement operator based on the solution state statistical information; S14, probabilistically selecting the adjacent solution corresponding to the corresponding tight movement operator from the neighborhood of the current solution as the updated current solution based on the application probability of each tight movement operator; returning to step S12, and repeating the local search process of steps S12 to S14 until the preset solution time threshold is reached; S15, using the updated current solution obtained when the preset solution time threshold is reached as a feasible solution to the integer linear programming problem to be solved.
[0112] As for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment, and it has the corresponding technical effects.
[0113] In addition, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the solution search method for the parallel integer linear programming problem are implemented as described above.
[0114] In this embodiment, if the solution search method for the parallel integer linear programming problem is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0115] In addition, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for searching for solutions to parallel integer linear programming problems when executing the computer program. Figure 1 Alternatively, when the processor executes the computer program, the functions of each module / unit in the solution search system embodiment of the parallel integer linear programming problem are realized, such as multiple local search solvers, solution pools, and optimization control subsystems running in parallel, wherein the optimization control subsystem includes Figure 4 The illustrated modules include an operation control module 401 , a solution collection module 402 , a status monitoring module 403 , and an optimization restart module 404 .
[0116] The solution search method, system and device for parallel integer linear programming problems provided by the embodiments of the present invention select a feasible solution from the solution pool as a shared feasible solution and provide it to the local search solver that is trapped in a local optimal state when the local search solver is unable to improve the quality of the solution, so that the local search solver can restart the local search with this solution as the initial solution to continue searching, thereby reducing repeated searches caused by fixed rules, increasing the probability of searching for solutions in different areas, and effectively improving the quality of the solution. Furthermore, when the shared feasible solution is a generative feasible solution generated by a machine learning model, since the machine learning model uses high-quality solutions as training data, it considers the quality of the solution more than random perturbations, which is conducive to helping find high-quality solutions in different areas and improving the overall solution quality.
[0117] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, any one of the claimed embodiments may be used in any combination.
[0118] 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 in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for searching for solutions to parallel integer linear programming problems, characterized in that: The method comprises: Modeling the production scheduling problem as an integer linear programming problem includes: determining decision variables, which include the start time and end time of each task, establishing the objective function corresponding to the integer linear programming problem, which is to minimize the completion time of the last task, establishing constraints, which include that the start time of each task must be later than the end time of its dependent tasks, and the duration of each task cannot exceed the occupation time of its available resources; running multiple local search solvers in parallel, and multiple local search solvers calculate the integer linear programming problem in parallel and configure different initial solutions; Obtain feasible solutions that meet preset solution quality requirements searched by each local search solver, and collect the obtained feasible solutions into a preset solution pool; Before reaching a preset solution time threshold, monitoring the running state of each local search solver, and determining whether the corresponding local search solver falls into a local optimal state according to the running state of each local search solver; Selecting a feasible solution from the solution pool as a shared feasible solution, using the shared feasible solution as the target local search solver that is stuck in a local optimal state to restart the initial solution of the local search and restart the local search; Wherein, the solution search method of each local search solver includes: S11, configuring an initial solution to the integer linear programming problem to be solved, and performing a local search with the initial solution; S12, before reaching a preset solution time threshold, using tight movement as an operator to generate a neighborhood of the current solution in the local search process; wherein the tight movement includes tight movement that satisfies the constraints and tight movement that does not satisfy the constraints; the tight movement specifically reassigns the variables in the current solution while ensuring that the variables are within a legal range; S13, statistics are collected on the solution status statistical information in the local search process, and the application probability of each tight moving operator is calculated based on the solution status statistical information; step S13 specifically includes: counting the total number of constraints nCons of the integer linear programming problem to be solved, the number of constraints satCons satisfied by the current solution, and the number of constraints unsatCons not satisfied, and taking the ratio of satCons to nCons as the application probability of the tight moving operator that satisfies the constraints, and taking the ratio of unsatCons to nCons as the application probability of the tight moving operator that does not satisfy the constraints; or, counting the total number of constraints nCons of the integer linear programming problem to be solved, the number of times yesCons that the target constraint is satisfied and the number of times noCons that the target constraint is not satisfied within a preset time length, calculating the product of nCons and the time length, taking the ratio of yesCons to the product as the application probability of the tight moving operator that satisfies the target constraint, and taking the ratio of noCons to the product as the application probability of the tight moving operator that does not satisfy the target constraint; S14, probabilistically selecting an adjacent solution corresponding to a corresponding compact moving operator from a neighborhood of the current solution as an updated current solution according to the application probability of each compact moving operator; Return to step S12, and repeat the local search process of steps S12 to S14 until the preset solution time threshold is reached; S15. Using the updated current solution obtained when the preset solution time threshold is reached as a feasible solution to the integer linear programming problem to be solved.
2. The method according to claim 1, characterized in that After collecting the obtained feasible solutions into a preset solution pool, the method further includes: It is determined whether the number of feasible solutions stored in the solution pool is greater than a preset capacity threshold. If the number of solutions is greater than the capacity threshold, the feasible solution with the worst solution quality in the solution pool is deleted.
3. The method according to claim 1, characterized in that The monitoring of the running state of each local search solver and determining whether the corresponding local search solver falls into a local optimal state according to the running state of each local search solver include: Monitor whether the feasible solution output by each local search solver has not been updated for a preset time length. If the feasible solution output by a local search solver has not been updated for a preset time length, it is determined that the corresponding local search solver has fallen into a local optimal state.
4. The method according to claim 1, characterized in that The step of collecting the obtained feasible solutions into a preset solution pool includes: Adding the feasible solution to the solution pool, and recording the constraint weight set corresponding to the feasible solution; Accordingly, the step of taking the shared feasible solution as the initial solution of the target local search solver to restart the local search and restarting the local search comprises: The shared feasible solution and the constraint weight set corresponding to the shared feasible solution are shared with the target local search solver, so that the target local search solver restarts the local search with the shared feasible solution as the initial solution, and determines the weight corresponding to each constraint in the local search process after the restart according to the corresponding constraint weight set.
5. The method according to claim 1, characterized in that Selecting a feasible solution from the solution pool as a shared feasible solution includes: Randomly select a feasible solution from the solution pool as a shared feasible solution; or Selecting a feasible solution with the highest solution quality from the solution pool as a shared feasible solution; or A pre-trained high-quality feasible solution generation model is used to generate a generative feasible solution that meets the preset solution quality requirements and a generative constraint weight set of the current solution, and the generative feasible solution is added to the solution set pool and used as a shared feasible solution.
6. The method according to claim 5, characterized in that The training steps of the high-quality feasible solution generation model include: Classifying the feasible solutions in the solution pool into quality grades to obtain the quality grade of each feasible solution; The integer linear programming problem to be solved is used as input data, and each feasible solution in the solution pool and the quality level of each feasible solution are used as labels to construct training data; The training data is trained using a machine learning model to obtain a high-quality feasible solution generation model.
7. A solution search system for parallel integer linear programming problems, characterized in that: The system models the production scheduling problem as an integer linear programming problem. Modeling the production scheduling problem as an integer linear programming problem includes: determining decision variables, the decision variables include the start time and the end time of each task, establishing an objective function corresponding to the integer linear programming problem, the objective function is to minimize the completion time of the last task, and establishing constraints. The constraints include that the start time of each task must be later than the end time of its dependent tasks, and the duration of each task cannot exceed the occupation time of its available resources; the system includes multiple local search solvers running in parallel, a solution pool, and an optimization control subsystem, and the optimization control subsystem includes: An operation control module is used to run multiple local search solvers in parallel, where the multiple local search solvers calculate the integer linear programming problem to be solved in parallel and are configured with different initial solutions; A solution collection module is used to obtain feasible solutions that meet preset solution quality requirements searched by each local search solver, and collect the obtained feasible solutions into a preset solution collection pool; A state monitoring module is used to monitor the operating state of each local search solver before reaching a preset solution time threshold, and determine whether the corresponding local search solver falls into a local optimal state according to the operating state of each local search solver; An optimization restart module, used for selecting a feasible solution from the solution pool as a shared feasible solution, using the shared feasible solution as the target local search solver that is stuck in a local optimal state to restart the initial solution of the local search and restart the local search; Wherein, the solution search method of each local search solver includes: S11, configuring an initial solution of the integer linear programming problem to be solved, and performing local search with the initial solution; S12, using tight movement as an operator to generate a neighborhood of the current solution in the local search process before reaching a preset solution time threshold; wherein, tight movement includes tight movement that satisfies the constraints and tight movement that does not satisfy the constraints; tight movement specifically reassigns the variables in the current solution while ensuring that the variables are within a legal range; S13, counting the solution status statistical information in the local search process, and calculating the application probability of each tight movement operator based on the solution status statistical information; step S13 specifically includes: counting the total number of constraints nCons of the integer linear programming problem to be solved, the number of constraints satCons satisfied by the current solution, and the number of constraints unsatCons not satisfied by the current solution, and calculating the satCons. The ratio of Cons to nCons is used as the application probability of the tight moving operator that meets the constraint, and the ratio of unsatCons to nCons is used as the application probability of the tight moving operator that does not meet the constraint; or, the total number of constraints nCons of the integer linear programming problem to be solved, the number of times yesCons that the target constraint is satisfied and the number of times noCons that the target constraint is not satisfied within a preset time length are counted, the product of nCons and the time length is calculated, the ratio of yesCons to the product is used as the application probability of the tight moving operator that meets the target constraint, and the ratio of noCons to the product is used as the application probability of the tight moving operator that does not meet the target constraint; S14, according to the application probability of each tight moving operator, the adjacent solution corresponding to the corresponding tight moving operator is probabilistically selected from the neighborhood of the current solution as the updated current solution; return to step S12, and repeat the local search process of steps S12~S14 until the preset solution time threshold is reached; S15, the updated current solution obtained when the preset solution time threshold is reached is used as the feasible solution of the integer linear programming problem to be solved.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 6 when executing the computer program.
Citation Information
Patent Citations
Task allocation and path planning method for workshop unmanned transportation system
CN110674978A
Locating and sizing configuration method for distributed wind power
CN114818448A
