Method and device for solving combinatorial optimization problem, electronic equipment and storage medium

By serializing the combination optimization problem and using the trained combination optimization problem to solve the model, the problem of poor applicability of the model in the existing technology is solved, and generalized solutions across multiple problem types are realized, which improves the solution efficiency and accuracy.

CN120562901APending Publication Date: 2025-08-29TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510493624.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2025-08-29

AI Technical Summary

Technical Problem

The prior art is difficult to construct a single model for a variety of combination optimization problems for general solutions, resulting in poor applicability.

Method used

By obtaining the target combination optimization problem and serializing it, the trained combination optimization problem solving model is used for solving. The model is trained based on the sequence trajectory data of multiple sample combination optimization problems, including forward dynamic prediction unit and strategy generation unit, to realize general solution across multiple problem types.

Benefits of technology

It realizes efficient and accurate solution of different types of combination optimization problems, and improves the scope of application and solution efficiency of the solution model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120562901A_ABST
    Figure CN120562901A_ABST
Patent Text Reader

Abstract

The invention provides a solution method and device for a combinatorial optimization problem, electronic equipment and a storage medium, and the method comprises the steps: obtaining a target combinatorial optimization problem, and carrying out the serialization of the target combinatorial optimization problem, and obtaining a problem prefix sequence; the problem prefix sequence is input into a trained combinatorial optimization problem solving model to be solved, a solving result of a target combinatorial optimization problem is obtained, and the combinatorial optimization problem solving model is obtained based on sequence trajectory data training of a plurality of sample combinatorial optimization problems. The plurality of sample combinatorial optimization problems comprise at least one specified combinatorial optimization problem, and the type of the specified combinatorial optimization problem is the same as that of the target combinatorial optimization problem. According to the method, a combinatorial optimization problem solving model of a single model structure and parameters can be used, universal solving across multiple problem types is achieved, and the application range of the combinatorial optimization problem solving model is widened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for solving a combinatorial optimization problem. Background Art

[0002] Combinatorial optimization problems (COPs) are crucial in many real-world scenarios, including logistics and industrial management. To solve these non-deterministic polynomial (NP)-hard problems, which are often polynomial in complexity, traditional integer programming and heuristic algorithms have been extensively studied over the past few decades to obtain exact or near-optimal solutions. With the rapid development of deep learning, learning-based approaches to solving COPs have gained increasing attention, leading to the development of a variety of deep learning-based combinatorial optimization methods.

[0003] However, COPs encompass a wide variety of specific subproblems, each with distinct problem descriptions, objectives, and constraint scenarios. Previous solutions were designed to address only a specific subproblem. As the problem changes, the algorithm design, structure, and parameters also change, making it difficult to construct a single, universal solution for multiple problems, resulting in poor applicability. Therefore, an effective solution is urgently needed to address these issues. Summary of the Invention

[0004] In order to solve the defects of the prior art, the present invention provides a method, device, electronic device and storage medium for solving combinatorial optimization problems.

[0005] The present invention provides a method for solving a combinatorial optimization problem, comprising: Obtaining a target combination optimization problem, and serializing the target combination optimization problem to obtain a problem prefix sequence; The problem prefix sequence is input into a trained combinatorial optimization problem solving model for solving, to obtain a solution result of the target combinatorial optimization problem, wherein the combinatorial optimization problem solving model is trained based on sequence trajectory data of multiple sample combinatorial optimization problems, wherein the multiple sample combinatorial optimization problems include at least one specified combinatorial optimization problem, and the type of the specified combinatorial optimization problem is the same as the type of the target combinatorial optimization problem.

[0006] According to a method for solving a combinatorial optimization problem provided by the present invention, the combinatorial optimization problem solving model includes a forward dynamic prediction unit and a strategy generation unit; The problem prefix sequence is input into a trained combinatorial optimization problem solving model for solving the problem, and a solution result of the target combinatorial optimization problem is obtained, including: Using the question prefix sequence as a state prediction sequence; Determining whether the solution is completed according to the state prediction sequence; If so, then obtaining a solution to the target combination optimization problem based on the state prediction sequence; If not, the state prediction sequence is input into the forward dynamic prediction unit for state prediction to obtain a single-step state; the single-step state is spliced ​​at the back end of the state prediction sequence to obtain an action prediction sequence; the action prediction sequence is input into the strategy generation unit for action prediction to obtain a single-step action; the single-step action is spliced ​​at the back end of the action prediction sequence to obtain an updated state prediction sequence; and the step of determining whether the solution is completed according to the state prediction sequence is continued.

[0007] According to a method for solving a combinatorial optimization problem provided by the present invention, obtaining a solution to the target combinatorial optimization problem based on the state prediction sequence includes: The single-step actions in the state prediction sequence are extracted in order from front to back to obtain a solution to the target combination optimization problem.

[0008] According to a method for solving a combinatorial optimization problem provided by the present invention, the training process of the combinatorial optimization problem solving model includes: Obtain sequence trajectory data of multiple sample combinatorial optimization problems and an untrained combinatorial optimization problem-solving model; Based on the sequence trajectory data of the plurality of sample combinatorial optimization problems, a forward dynamic prediction unit in the combinatorial optimization problem solving model is trained to obtain a trained forward dynamic prediction unit; Based on the sequence trajectory data of the plurality of sample combinatorial optimization problems, a strategy generation unit in the combinatorial optimization problem solving model is trained to obtain a trained strategy generation unit.

[0009] According to a method for solving a combinatorial optimization problem provided by the present invention, the forward dynamic prediction unit in the combinatorial optimization problem solving model is trained based on the sequence trajectory data of the plurality of sample combinatorial optimization problems to obtain a trained forward dynamic prediction unit, comprising: Selecting at least one sequence trajectory data of a sample combination optimization problem from the sequence trajectory data of the plurality of sample combination optimization problems; For each selected sequence trajectory data of the sample combination optimization problem, extracting each single-step state in the sequence trajectory data in order from front to back to obtain a first sample label, and performing masking on each single-step state in the sequence trajectory data to obtain a first training sample; Inputting each of the first training samples into the forward dynamic prediction unit for state prediction, and obtaining a predicted single-step state sequence corresponding to each of the first training samples, wherein the predicted single-step state sequence is a sequence of the predicted single-step states arranged in a prediction order; Calculating a first loss value based on the predicted single-step state sequence corresponding to each of the first training samples and the first sample label; Adjusting parameters of the forward motion prediction unit based on the first loss value; Continue to execute the steps of selecting at least one sequence trajectory data of the sample combination optimization problem from the sequence trajectory data of the multiple sample combination optimization problems and subsequent steps until the first training stop condition is reached, thereby obtaining a trained forward dynamic prediction unit.

[0010] According to a method for solving a combinatorial optimization problem provided by the present invention, the strategy generation unit in the combinatorial optimization problem solving model is trained based on the sequence trajectory data of the plurality of sample combinatorial optimization problems to obtain a trained strategy generation unit, comprising: Selecting at least one sequence trajectory data of a sample combination optimization problem from the sequence trajectory data of the plurality of sample combination optimization problems; For each selected sequence trajectory data of the sample combination optimization problem, extracting each single-step action in the sequence trajectory data in order from front to back to obtain a second sample label, and performing masking processing on each single-step action in the sequence trajectory data to obtain a second training sample; Inputting each second training sample into the strategy generation unit for action prediction, obtaining a predicted single-step action sequence corresponding to each second training sample, wherein the predicted single-step action sequence is a sequence of the predicted single-step actions arranged in a predicted order; Calculating a second loss value based on the predicted single-step action sequence corresponding to each second training sample and the second sample label; adjusting parameters of the strategy generation unit based on the second loss value; Continue to execute the steps of selecting at least one sequence trajectory data of the sample combination optimization problem from the sequence trajectory data of the multiple sample combination optimization problems and subsequent steps until the second training stop condition is reached, thereby obtaining a trained strategy generation unit.

[0011] According to a method for solving a combinatorial optimization problem provided by the present invention, obtaining sequence trajectory data of a plurality of sample combinatorial optimization problems includes: Obtain multiple sample combination optimization problems; For each sample combination optimization problem, based on a dedicated solver corresponding to the sample combination optimization problem, obtain expert solution trajectory data corresponding to the sample combination optimization problem; The expert solution trajectory data is serialized to obtain sequence trajectory data of the sample combination optimization problem.

[0012] The present invention also provides a device for solving combinatorial optimization problems, comprising: an acquisition module configured to acquire a target combinatorial optimization problem and serialize the target combinatorial optimization problem to obtain a problem prefix sequence; The solution module is configured to input the problem prefix sequence into a trained combinatorial optimization problem-solving model for solution to obtain a solution result of the target combinatorial optimization problem, wherein the combinatorial optimization problem-solving model is trained based on sequence trajectory data of multiple sample combinatorial optimization problems, wherein the multiple sample combinatorial optimization problems include at least one specified combinatorial optimization problem, and the type of the specified combinatorial optimization problem is the same as the type of the target combinatorial optimization problem.

[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for solving the combinatorial optimization problem as described above is implemented.

[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for solving any of the above-mentioned combinatorial optimization problems.

[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned methods for solving the combinatorial optimization problem.

[0016] The method, device, electronic device, and storage medium for solving combinatorial optimization problems provided by the present invention obtain a target combinatorial optimization problem and serialize the target combinatorial optimization problem to obtain a problem prefix sequence; the problem prefix sequence is input into a trained combinatorial optimization problem-solving model for solving the problem to obtain a solution result for the target combinatorial optimization problem. The combinatorial optimization problem-solving model is trained based on sequence trajectory data of multiple sample combinatorial optimization problems, and the multiple sample combinatorial optimization problems include at least one specified combinatorial optimization problem, and the type of the specified combinatorial optimization problem is the same as the type of the target combinatorial optimization problem. By using a combinatorial optimization problem-solving model with a single model structure and parameters, different types of combinatorial optimization problems are solved, that is, a universal solution across multiple problem types is achieved, thereby improving the scope of application of the combinatorial optimization problem-solving model. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 This is one of the flow charts of the method for solving the combinatorial optimization problem provided by the present invention.

[0019] Figure 2 It is a flow chart of solving multiple combinatorial optimization problems provided by the present invention.

[0020] Figure 3 This is one of the flow charts of the training combination optimization problem solving model provided by the present invention.

[0021] Figure 4 This is the second flow chart of the method for solving the combinatorial optimization problem provided by the present invention.

[0022] Figure 5 This is the second flow chart of the training combination optimization problem solving model provided by the present invention.

[0023] Figure 6 It is a structural diagram of the device for solving combinatorial optimization problems provided by the present invention.

[0024] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0025] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0026] The following combination Figure 1-Figure 7 The present invention describes a method, device, electronic device and storage medium for solving combinatorial optimization problems.

[0027] First, the relevant issues involved in the present invention are briefly described.

[0028] A combinatorial optimization problem (COP) is an optimization problem that seeks to find the optimal solution from a finite set of possible solutions. The goal of a combinatorial optimization problem is to find the optimal solution from the set of feasible solutions to the combinatorial problem.

[0029] Common COPs include the Traveling Salesman Problem (TSP), Knapsack Problem, Vehicle Routing Problem (VRP), Job-Shop Scheduling Problem (JSS), Minimum Dominating Set Problem (MDP), and Minimum Vertex Cover Problem (MVC).

[0030] In recent years, with the development of large language models and basic models, it has become possible to build a general basic model for solving combinatorial optimization.

[0031] Figure 1 This is one of the flow charts of the method for solving the combinatorial optimization problem provided by the present invention, such as Figure 1 As shown, the method includes step 101 and step 102.

[0032] Step 101: Obtain a target combination optimization problem, and serialize the target combination optimization problem to obtain a problem prefix sequence.

[0033] Specifically, the target combinatorial optimization problem refers to a combinatorial optimization problem to be solved, and the type of the target combinatorial optimization problem can be any one of TSP, Knapsack, VRP, JSS, MDP and MVC.

[0034] The problem prefix sequence is used to describe the static structure of the target combinatorial optimization problem and provide a problem environment for the combinatorial optimization problem solution model. The problem prefix sequence only contains static feature description information related to the target combinatorial optimization problem and does not contain any dynamic decision information related to the action.

[0035] In practical applications, we first obtain the combinatorial optimization problem to be solved, that is, the target combinatorial optimization problem. Then, we extract information that can be used to generate the problem prefix sequence from the target combinatorial optimization problem, sort this information, and thus obtain the problem prefix sequence of the target combinatorial optimization problem. .

[0036] Step 102: Input the problem prefix sequence into a trained combinatorial optimization problem-solving model for solving, and obtain a solution result of the target combinatorial optimization problem. The combinatorial optimization problem-solving model is trained based on sequence trajectory data of multiple sample combinatorial optimization problems, and the multiple sample combinatorial optimization problems include at least one specified combinatorial optimization problem, and the type of the specified combinatorial optimization problem is the same as the type of the target combinatorial optimization problem.

[0037] Specifically, a combinatorial optimization problem-solving model refers to a trained, general-purpose model used to solve combinatorial optimization problems. A sample combinatorial optimization problem refers to a combinatorial optimization problem used for training. Sequential trajectory data refers to the expert solution trajectory corresponding to the sample combinatorial optimization problem after serialization.

[0038] In practical applications, an untrained combinatorial optimization problem-solving model can be trained based on the sequence trajectory data of sample combinatorial optimization problems to obtain a combinatorial optimization problem-solving model. In order for the combinatorial optimization problem-solving model to be able to handle the target combinatorial optimization problem, it is necessary to train the untrained combinatorial optimization problem-solving model using the sequence trajectory data of sample combinatorial optimization problems of the same type as the target combinatorial optimization problem. Therefore, the multiple sample combinatorial optimization problems include at least one specified combinatorial optimization problem of the same type as the target combinatorial optimization problem.

[0039] Furthermore, the problem prefix sequence corresponding to the target combinatorial optimization problem is input into the trained combinatorial optimization problem solving model for solving, and the combinatorial optimization problem solving model can output the answer to the target combinatorial optimization problem, that is, the solution result.

[0040] The method for solving a combinatorial optimization problem provided by the present invention obtains a target combinatorial optimization problem and serializes the target combinatorial optimization problem to obtain a problem prefix sequence; the problem prefix sequence is input into a trained combinatorial optimization problem-solving model for solving the problem to obtain a solution result for the target combinatorial optimization problem. The combinatorial optimization problem-solving model is trained based on sequence trajectory data of multiple sample combinatorial optimization problems, wherein the multiple sample combinatorial optimization problems include at least one specified combinatorial optimization problem, and the type of the specified combinatorial optimization problem is the same as the type of the target combinatorial optimization problem. By using a combinatorial optimization problem-solving model with a single model structure and parameters, different types of combinatorial optimization problems are solved, that is, a universal solution across multiple problem types is achieved, thereby improving the applicability of the combinatorial optimization problem-solving model.

[0041] In one or more optional embodiments of the present invention, the combinatorial optimization problem solving model includes a forward dynamic prediction unit and a strategy generation unit; The problem prefix sequence is input into a trained combinatorial optimization problem solving model for solving the problem, and a solution result of the target combinatorial optimization problem is obtained, including: Using the question prefix sequence as a state prediction sequence; Determining whether the solution is completed according to the state prediction sequence; If so, then obtaining a solution to the target combination optimization problem based on the state prediction sequence; If not, the state prediction sequence is input into the forward dynamic prediction unit for state prediction to obtain a single-step state; the single-step state is spliced ​​at the back end of the state prediction sequence to obtain an action prediction sequence; the action prediction sequence is input into the strategy generation unit for action prediction to obtain a single-step action; the single-step action is spliced ​​at the back end of the action prediction sequence to obtain an updated state prediction sequence; and the step of determining whether the solution is completed according to the state prediction sequence is continued.

[0042] In practical applications, after obtaining the problem prefix sequence, it is input into the combinatorial optimization problem-solving model for autoregressive continuous prediction. The forward dynamic prediction unit generates a new state token (the smallest semantic unit), or single-step state, based on the problem context (problem prefix sequence) and the current action. This token is then connected to the backend of the current partial solution sequence (state prediction sequence) to generate an action prediction sequence. The action prediction sequence is then input into the strategy generation unit to predict the next action, or single-step action. The generated single-step action is then connected to the backend of the current action prediction sequence and passed to the forward dynamic prediction unit to generate the next single-step state based on the problem context. This process is iterated continuously until a complete solution is generated. This improves solution efficiency and accuracy.

[0043] In one or more optional embodiments of the present invention, obtaining a solution to the target combination optimization problem based on the state prediction sequence includes: The single-step actions in the state prediction sequence are extracted in order from front to back to obtain a solution to the target combination optimization problem.

[0044] In practical applications, when the solution is completed, each single-step action in the state prediction sequence is taken out in the order of prediction, that is, from front to back, to obtain the solution to the target combination optimization problem.

[0045] It should be noted that, in order to avoid confusion between the problem prefix sequence and the predicted single-step state and single-step action, before inputting the problem prefix sequence into the trained combinatorial optimization problem-solving model for solving, the following steps are also included: A first separator is added to the rear end of the question prefix sequence to obtain an updated question prefix sequence.

[0046] In this way, after adding the first separator to the back end of the problem prefix sequence, when adding single-step state and single-step action to the back end of the problem prefix sequence and completing the solution, the problem prefix sequence and the predicted content can be better distinguished, further improving the solution efficiency.

[0047] In one or more optional embodiments of the present invention, to avoid confusion between predicted single-step states and single-step actions, after each single-step state is obtained and added to the end of the state prediction sequence, a second separator can be added after the single-step state to separate the single-step state from the single-step action. In this way, when extracting the single-step action after the solution is completed, the second separator can be used to quickly locate the single-step action after the second separator, thereby improving the efficiency and accuracy of single-step action extraction.

[0048] See also Figure 2 , Figure 2 It is a flow chart of solving multiple combinatorial optimization problems provided by the present invention.

[0049] 1. Solve a single TSP: During reasoning based on a trained combinatorial optimization problem-solving model, let's assume the problem to be solved is a TSP with the following content (Problem Date): a vehicle must be dispatched from the first city of n cities with coordinates (x1, y1), visit all cities, and then return to the starting city, minimizing the total path length. The relevant input information for algorithm design is shown in Table 1: Table 1 See also Figure 2 First, a prefix sequence of questions is generated based on the question content. The prefix sequence of questions contains the coordinate sets of all cities: (x1, y1), (x2, y2), … , (x n , y n ). The length of the problem prefix sequence is 2n, and then the first separator is added after the problem prefix sequence , at this time the length of the updated sequence is 2n+1.

[0050] The updated sequence is then fed into the combinatorial optimization problem solving model for solution, resulting in the solution: an iterative loop is entered, where state tokens (single-step actions) in the sequence are continuously generated and the model predicts dynamic tokens (single-step states). In the first loop, since the traveling salesman's initial state is in city 1, the first state token is (x1, y1), a sequence of length 2. This is then connected to the end of the current total sequence and a second separator is added. , the total sequence length is now 2n+4. Next, this sequence is fed into the combinatorial optimization problem solving model to provide a prediction of the entire action space. Since there are n cities in total, the size of the entire action space is n. Since the traveling salesman has already visited city 1, the probability of selecting city 1 is 0. Sampling is performed, and based on the probability, an action is selected from cities 2-n, and the sequence number of this city is recorded as k1. Connected to the current sequence backend, the length of the sequence is now 2n+5; In the second cycle, since the current state of the traveling salesman is in city k1, the state token is ( ), is a sequence of length 2, which is connected to the end of the current total sequence and supplemented with the second separator , the total sequence length is now 2n+8. Next, this sequence is fed into the model to generate predictions for the entire action space. Since there are n cities in total, the size of the entire action space is n. Since the traveling salesman has already visited cities 1 and k1, the probability of selecting cities 1 and k1 is 0. Sampling continues, and based on the probability, one of the remaining n-1 cities is selected as an action. This city is recorded as k2.

[0051] After a total of n-1 cycles, all cities have been visited, and n actions have been generated. Collecting all n ordered actions gives us the final solution to the traveling salesman problem.

[0052] 2. Solving a single VRP: During inference based on the trained combinatorial optimization problem-solving model, let's assume the problem to be solved is a Vehicle Replication Plan (VRP). The problem (Problem Date) requires dispatching a vehicle from the original warehouse (at coordinates (x0, y0)) to visit all cities and return to the original warehouse, minimizing the total path length. The vehicle's load must not exceed the maximum capacity during travel, and unloading at the warehouse is permitted. The relevant input information for algorithm design is shown in Table 2: Table 2 See also Figure 2First, a prefix sequence is generated based on the problem content. The prefix sequence contains the coordinate sets of all cities and the relative cargo volume sets: (x0, y0, 0), (x1, y1, c1 / V), (x2, y2, c2 / V), …, (x n , y n , c n / V). The length of the problem prefix sequence is 3n, and then the first separator is added after the problem prefix sequence. , at this time the length of the updated sequence is 3n+1.

[0053] The updated sequence is then fed into the combinatorial optimization problem solving model for solution, resulting in the solution: an iterative loop is entered, continuously generating state tokens (single-step actions) in the sequence and predicting dynamic tokens (single-step states) from the model. In the first loop, since the vehicle's initial state is at coordinate 0, the first state token is (x0, y0, 0), a sequence of length 3. This is connected to the end of the current total sequence, and a second separator is added. , the total sequence length is now 3n+5. Next, this sequence is input into the combinatorial optimization problem-solving model to generate predictions for the entire action space. Since there are n cities in total, the size of the total action space is n. Since the vehicle has just left the original warehouse, the probability of selecting the first city is 0. Sampling is performed, and based on the probability, an action is selected from cities 2 through n. This city is recorded as k1 and added to the end of the sequence, resulting in a total length of 3n+6.

[0054] In the second cycle, since the vehicle is currently in city k1, the state token is ( ), is a sequence of length 3, which is connected to the end of the current total sequence and supplemented with a second separator , the total sequence length is now 3n + 10. Next, this sequence is input into the model to generate predictions for the entire action space. Since there are n cities in total, the size of the entire action space is n. Since the vehicle has already passed through city k1, the probability of selecting city k1 is 0, and the probabilities of cities that do not meet the load constraint are also set to 0. Sampling continues, and based on the probability, one of the remaining cities is selected as an action, recording the coordinates of that city as k2.

[0055] After multiple cycles, when all cities have been visited, the vehicle returns to the original warehouse. At this point, all ordered actions are collected, which is the final VRP solution.

[0056] 3. Solve for a single Knapsack: During reasoning based on a trained combinatorial optimization problem-solving model, let's assume the problem to be solved is a Knapsack problem. The problem (Problem Date) is to select a subset of items from a set of items so that the total value is maximized without exceeding an upper weight limit. The relevant input information for algorithm design is shown in Table 3: Table 3 See also Figure 2 First, a prefix sequence of questions is generated according to the question content. The prefix sequence of questions contains the weight and value set of all items, (w1 / W, v1), (w2 / W, v2), …, (w n / W, v n ). The length of the problem prefix sequence is 2n, and then the first separator is added after the problem prefix sequence , at this time the length of the updated sequence is 2n+1.

[0057] Then the updated sequence is input into the combinatorial optimization problem solving model for solution, and the solution result is obtained: that is, it enters the iterative loop, continuously generates state tokens in the sequence and the model predicts dynamic tokens. In the first round of the loop, the first state token has the current total weight of 0, which is added to the end of the current total sequence, and the second separator is further added. , the total length of the sequence is now 2n+3. Next, this sequence is fed into the combinatorial optimization problem solving model to generate predictions for the entire action space. Since there are n items in total, the size of the total action space is n. Samples are taken from all items, and one of the n items is chosen as an action based on probability. This item is recorded as k1. This sequence is then connected to the current sequence backend, where its length is now 2n+4.

[0058] In the second cycle, the status token is the current total weight , adding it to the end of the current prefix sequence and further adding the second delimiter , the total length of the sequence is now 2n+6. Next, this sequence is fed into the model to generate predictions for the entire action space. All potential choices that would exceed the upper limit if added are eliminated, and sampling is performed. Based on the probability, one of the available items is selected as an action, and the item number is recorded as k2.

[0059] After multiple selection cycles, no new items can be added to the selection set. Collecting all item selection actions gives us the final solution to the Knapsack problem.

[0060] 4. Continuous solution of multiple problems, namely, solving TSP, VRP and Knapsack problems: For a set of problems constructed by combining multiple different types, the combinatorial optimization problem solving model can solve them continuously and sequentially.

[0061] See also Figure 2 For problems that appear consecutively in the same set of problems, such as TSP, VRP, and Knapsack, the same trained combinatorial optimization problem-solving model can be used for sequential, step-by-step solutions. Specifically, first, solve the problem using the method described above for a single TSP to obtain the TSP solution. Then, clear the sequence and solve the problem using the method described above for a single VRP to obtain the VRP solution. Then, clear the current sequence and solve the problem using the method described above for a single Knapsack to obtain the Knapsack solution.

[0062] In one or more optional embodiments of the present invention, the training process of the combinatorial optimization problem solving model includes: Obtain sequence trajectory data of multiple sample combinatorial optimization problems and an untrained combinatorial optimization problem-solving model; Based on the sequence trajectory data of the plurality of sample combinatorial optimization problems, a forward dynamic prediction unit in the combinatorial optimization problem solving model is trained to obtain a trained forward dynamic prediction unit; Based on the sequence trajectory data of the plurality of sample combinatorial optimization problems, a strategy generation unit in the combinatorial optimization problem solving model is trained to obtain a trained strategy generation unit.

[0063] Specifically, the untrained combinatorial optimization problem-solving model may be a network model.

[0064] In practical applications, see Figure 3 , Figure 3 This is one of the flow charts of the training combination optimization problem solving model provided by the present invention: first, a training set required for model training is constructed, that is, multiple sample combination optimization problems (problems 1 to 3) are serialized (data serialization) to obtain sequence trajectory data of multiple sample combination optimization problems.

[0065] In the specific training phase, it is divided into two sub-training processes.

[0066] In sub-process 1, the network model is first trained with the goal of forward dynamic prediction. That is, based on the training set, the forward dynamic prediction unit in the combinatorial optimization problem solving model is trained. In this process, the goal is only to predict the state of each step (single-step state), such as and , that is, the loss function is only calculated at the location of the single-step state.

[0067] In sub-process 2, the network model is trained with strategy generation as the goal, that is, based on the training set, the strategy generation unit in the combinatorial optimization problem solving model is trained. In this process, the goal is only to predict the state of each step (single-step state), such as and , the loss function is only calculated at the location of the single-step action.

[0068] In this embodiment, through phased training, the trained combinatorial optimization problem solving model can be made more accurate.

[0069] In one or more optional embodiments of the present invention, obtaining sequence trajectory data of a plurality of sample combination optimization problems includes: Obtain multiple sample combination optimization problems; For each sample combination optimization problem, based on a dedicated solver corresponding to the sample combination optimization problem, obtain expert solution trajectory data corresponding to the sample combination optimization problem; The expert solution trajectory data is serialized to obtain sequence trajectory data of the sample combination optimization problem.

[0070] In practical applications, the cross-task Markov Decision Process (MDP) dataset required for model training, or the training set, is first constructed. For each specific problem to be trained (multiple sample combinatorial optimization problems), a dedicated solver is selected to collect expert solution trajectory data. By representing the acquired expert solution trajectory data as an MDP and serializing it, the data from all different problems can be integrated into a uniformly represented sequence modeling data. Each sequence trajectory data can be expressed as follows: in, is the sequence trajectory data, to Respectively represent T trajectory data in the sequence trajectory data, Indicates the Trajectory data, Indicates the single-step state of the problem after serialization, that is, The single-step state in the trajectory data, Indicates the single-step action after serialization of the problem, that is, A single-step action in trajectory data, Indicates the second segmentation indicator, that is, the second segmentation symbol.

[0071] like Figure 3As shown, in the sequence trajectory data, the solid box is the single-step state , each single-step state can contain multiple tokens; the dotted box is a single-step action , and the black rectangle represents the second separator Furthermore, the sequence trajectory data sequence will be prepended with a combination optimization prefix, which is also the problem prefix sequence. , which is used to describe the static structure of the combinatorial optimization problem. The prefix sequence only contains the static feature description information related to the original problem, and does not contain any dynamic decision information related to the action. The complete sequence trajectory data finally formed is ,in, The first separator.

[0072] In this way, serializing the sample combination optimization problem in a unified form can improve the training efficiency and robustness of the model.

[0073] In one or more optional embodiments of the present invention, the training of the forward dynamic prediction unit in the combinatorial optimization problem solving model based on the sequence trajectory data of the plurality of sample combinatorial optimization problems to obtain the trained forward dynamic prediction unit includes: Selecting at least one sequence trajectory data of a sample combination optimization problem from the sequence trajectory data of the plurality of sample combination optimization problems; For each selected sequence trajectory data of the sample combination optimization problem, extracting each single-step state in the sequence trajectory data in order from front to back to obtain a first sample label, and performing masking on each single-step state in the sequence trajectory data to obtain a first training sample; Inputting each of the first training samples into the forward dynamic prediction unit for state prediction, and obtaining a predicted single-step state sequence corresponding to each of the first training samples, wherein the predicted single-step state sequence is a sequence of the predicted single-step states arranged in a prediction order; Calculating a first loss value based on the predicted single-step state sequence corresponding to each of the first training samples and the first sample label; Adjusting parameters of the forward motion prediction unit based on the first loss value; Continue to execute the steps of selecting at least one sequence trajectory data of the sample combination optimization problem from the sequence trajectory data of the multiple sample combination optimization problems and subsequent steps until the first training stop condition is reached, thereby obtaining a trained forward dynamic prediction unit.

[0074] Specifically, the first training stop condition is at least one of the following: the first loss value is less than the first set value, the rate of change of the first loss value is less than the first rate of change, the performance of the validation set has not increased for N consecutive times, and the number of iterations reaches an iteration threshold, where N is a positive integer.

[0075] In practical applications, the network model is first trained with the goal of forward dynamic prediction. In this process, the goal is only to predict the single-step state. , that is, only in The loss function is calculated at the location.

[0076] like Figure 3 As shown in the upper left part: During the training process, the state token ( ) is masked and the rest is retained, that is, the first training sample is obtained; only the state token ( ), and masking the rest to predict the single-step state sequence. The entire training process uses autoregressive prediction, using the non-causal Transformer as its basic model architecture. The boxes in the non-causal Transformer represent neurons.

[0077] In addition, the state tokens in the sequence trajectory data can be ) are extracted in order from front to back to obtain the sample label of the first training sample, that is, the first sample label.

[0078] In this stage, the model will be based on the current single-step state and single-step actions in data sequence trajectories , to predict the next single-step state after the action .

[0079] Based on the current partial trajectory sequence, the loss function for predicting the next state is as follows: in, is the first loss value, are the parameters of the forward motion prediction unit, is at least one sample combination optimization problem currently selected, or sequence trajectory data of at least one sample combination optimization problem, The number of at least one sample combination optimization problem currently input, or the number of sequence trajectory data of at least one sample combination optimization problem, Represents the probability of the predicted state.

[0080] In this step, the model obtained through forward dynamic prediction training is provided as a pre-trained model for the next stage of model training to fine-tune the policy generation model, thereby improving training accuracy.

[0081] In one or more optional embodiments of the present invention, the strategy generation unit in the combinatorial optimization problem solving model is trained based on the sequence trajectory data of the plurality of sample combinatorial optimization problems to obtain a trained strategy generation unit, including: Selecting at least one sequence trajectory data of a sample combination optimization problem from the sequence trajectory data of the plurality of sample combination optimization problems; For each selected sequence trajectory data of the sample combination optimization problem, extracting each single-step action in the sequence trajectory data in order from front to back to obtain a second sample label, and performing masking processing on each single-step action in the sequence trajectory data to obtain a second training sample; Inputting each second training sample into the strategy generation unit for action prediction, obtaining a predicted single-step action sequence corresponding to each second training sample, wherein the predicted single-step action sequence is a sequence of the predicted single-step actions arranged in a predicted order; Calculating a second loss value based on the predicted single-step action sequence corresponding to each second training sample and the second sample label; adjusting parameters of the strategy generation unit based on the second loss value; Continue to execute the steps of selecting at least one sequence trajectory data of the sample combination optimization problem from the sequence trajectory data of the multiple sample combination optimization problems and subsequent steps until the second training stop condition is reached, thereby obtaining a trained strategy generation unit.

[0082] Specifically, the second training stop condition is at least one of the following: the second loss value is less than the second set value, the rate of change of the second loss value is less than the second rate of change, the performance of the validation set has not increased for M consecutive times, and the number of iterations reaches the iteration threshold, where M is a positive integer.

[0083] In practical applications, based on the training in the previous stage, the strategy generation unit is trained with strategy generation as the goal. In this process, the goal is to predict single-step actions. , that is, only in The loss function is calculated at the location.

[0084] like Figure 3 As shown in the upper right part, during the training process, the action token ( ) is masked and the rest is retained to obtain the second training sample; only the action token ( ), and masking the rest to predict the single-step action sequence. The entire training process uses autoregressive prediction, using the non-causal Transformer as its basic model architecture.

[0085] In addition, the action tokens in the sequence trajectory data can be ) are extracted from the front to back order to obtain the sample label of the second training sample, that is, the second sample label. This training process is based on the additional training of the pre-trained forward dynamic prediction unit.

[0086] In this stage, the model will be based on the current single-step state To predict the optimal action that should be given at this time Based on the current partial trajectory sequence, the loss function for predicting the next action is as follows: in, is the first loss value.

[0087] In this step, the model is further trained to acquire the ability to generate action strategies, so it can be called to generate actions in the inference phase and provide optimized solutions to combinatorial optimization problems.

[0088] The following combination Figure 4 and Figure 5 The solution to the combinatorial optimization problem provided by the present invention is further explained.

[0089] See also Figure 4 , Figure 4 This is the second flow chart of the method for solving the combinatorial optimization problem provided by the present invention.

[0090] Model training phase: training the combinatorial optimization problem solving model.

[0091] See also Figure 5 , Figure 5 This is the second flow diagram of the training combinatorial optimization problem-solving model provided by the present invention: Different types of sample combinatorial optimization problems are obtained, and then a dedicated solver corresponding to each sample combinatorial optimization problem is selected to collect expert solution trajectories (solution results). This is done by using the dedicated solver to collect expert solution trajectories. The obtained expert solution trajectories are represented as initial sequence trajectory data in the form of an MDP, thereby constructing an MDP trajectory dataset. Furthermore, the problem prefix sequence is added to each initial sequence trajectory data to obtain the target sequence trajectory data.

[0092] Afterwards, it is determined whether a first training stop condition is met, wherein the first training condition is that the validation set performance of the forward dynamic prediction unit does not increase for five consecutive times.

[0093] If not, training data is collected from each target sequence trajectory data to train the forward dynamic prediction unit; the output action is masked on the output result, and a first loss value is calculated for the output state; the parameters of the forward dynamic prediction unit are updated; the validation set performance of the forward dynamic prediction unit is calculated, and the step of determining whether the first training stop condition is met is returned.

[0094] If so, a trained forward dynamic prediction unit is obtained.

[0095] Furthermore, it is determined whether a second training stop condition is met, wherein the second training condition is that the validation set performance of the strategy generation unit has not increased for five consecutive times.

[0096] If not, then collect training data from each target sequence trajectory data to train the strategy generation unit; mask the output state of the output result and calculate the second loss value for the output action; update the parameters of the strategy generation unit; calculate the validation set performance of the strategy generation unit, and return to the step of determining whether the first training stop condition is met.

[0097] If yes, then the trained strategy generation unit is obtained. At this point, the training is completed.

[0098] Model reasoning stage: solving the target combination optimization problem.

[0099] See also Figure 5 For a trained combinatorial optimization problem-solving model, it can be used to reason and solve new instances of the trained problem type (combinatorial optimization problems). For a new combinatorial optimization problem, it is first serialized and represented as a problem prefix sequence. The first separator is added to the end to form an updated problem prefix sequence, that is, a problem prefix sequence is generated.

[0100] Afterwards, the problem prefix sequence is input into the combinatorial optimization problem solving model for solving, and it is determined whether the solution has been completed.

[0101] If not, the current state token is generated based on the problem environment and added to the end of the current sequence. The model then performs inference to generate a token prediction for the next action. Based on the mask, an action token is sampled from the action space. The generated action token is then added to the end of the current sequence to determine whether the solution has been completed. If so, merge all action results and output the solution result.

[0102] The embodiment of the present invention constructs a general combinatorial optimization problem-solving model, which can use a single model structure and parameters to achieve universal solutions across multiple problem types.

[0103] The following describes a device for solving the combinatorial optimization problem provided by the present invention. The device for solving the combinatorial optimization problem described below and the method for solving the combinatorial optimization problem described above can be referenced to each other.

[0104] Figure 6 This is a schematic diagram of the structure of the device for solving the combinatorial optimization problem provided by the present invention. Figure 6 As shown, the device includes: An acquisition module 601 is configured to acquire a target combination optimization problem and serialize the target combination optimization problem to obtain a problem prefix sequence; The solution module 602 is configured to input the problem prefix sequence into a trained combinatorial optimization problem-solving model for solution to obtain a solution result of the target combinatorial optimization problem. The combinatorial optimization problem-solving model is trained based on sequence trajectory data of multiple sample combinatorial optimization problems. The multiple sample combinatorial optimization problems include at least one specified combinatorial optimization problem, and the type of the specified combinatorial optimization problem is the same as the type of the target combinatorial optimization problem.

[0105] Optionally, the combinatorial optimization problem solving model includes a forward dynamic prediction unit and a strategy generation unit; The solution module 602 is further configured to: Using the question prefix sequence as a state prediction sequence; Determining whether the solution is completed according to the state prediction sequence; If so, then obtaining a solution to the target combination optimization problem based on the state prediction sequence; If not, the state prediction sequence is input into the forward dynamic prediction unit for state prediction to obtain a single-step state; the single-step state is spliced ​​at the back end of the state prediction sequence to obtain an action prediction sequence; the action prediction sequence is input into the strategy generation unit for action prediction to obtain a single-step action; the single-step action is spliced ​​at the back end of the action prediction sequence to obtain an updated state prediction sequence; and the step of determining whether the solution is completed according to the state prediction sequence is continued.

[0106] Optionally, the solution module 602 is further configured to: The single-step actions in the state prediction sequence are extracted in order from front to back to obtain a solution to the target combination optimization problem.

[0107] Optionally, the apparatus further includes a training model configured to: Obtain sequence trajectory data of multiple sample combinatorial optimization problems and an untrained combinatorial optimization problem-solving model; Based on the sequence trajectory data of the plurality of sample combinatorial optimization problems, a forward dynamic prediction unit in the combinatorial optimization problem solving model is trained to obtain a trained forward dynamic prediction unit; Based on the sequence trajectory data of the plurality of sample combinatorial optimization problems, a strategy generation unit in the combinatorial optimization problem solving model is trained to obtain a trained strategy generation unit.

[0108] Optionally, the training model is further configured to: Selecting at least one sequence trajectory data of a sample combination optimization problem from the sequence trajectory data of the plurality of sample combination optimization problems; For each selected sequence trajectory data of the sample combination optimization problem, extracting each single-step state in the sequence trajectory data in order from front to back to obtain a first sample label, and performing masking on each single-step state in the sequence trajectory data to obtain a first training sample; Inputting each of the first training samples into the forward dynamic prediction unit for state prediction, and obtaining a predicted single-step state sequence corresponding to each of the first training samples, wherein the predicted single-step state sequence is a sequence of the predicted single-step states arranged in a prediction order; Calculating a first loss value based on the predicted single-step state sequence corresponding to each of the first training samples and the first sample label; Adjusting parameters of the forward motion prediction unit based on the first loss value; Continue to execute the steps of selecting at least one sequence trajectory data of the sample combination optimization problem from the sequence trajectory data of the multiple sample combination optimization problems and subsequent steps until the first training stop condition is reached, thereby obtaining a trained forward dynamic prediction unit.

[0109] Optionally, the training model is further configured to: Selecting at least one sequence trajectory data of a sample combination optimization problem from the sequence trajectory data of the plurality of sample combination optimization problems; For each selected sequence trajectory data of the sample combination optimization problem, extracting each single-step action in the sequence trajectory data in order from front to back to obtain a second sample label, and performing masking processing on each single-step action in the sequence trajectory data to obtain a second training sample; Inputting each second training sample into the strategy generation unit for action prediction, obtaining a predicted single-step action sequence corresponding to each second training sample, wherein the predicted single-step action sequence is a sequence of the predicted single-step actions arranged in a predicted order; Calculating a second loss value based on the predicted single-step action sequence corresponding to each second training sample and the second sample label; adjusting parameters of the strategy generation unit based on the second loss value; Continue to execute the steps of selecting at least one sequence trajectory data of the sample combination optimization problem from the sequence trajectory data of the multiple sample combination optimization problems and subsequent steps until the second training stop condition is reached, thereby obtaining a trained strategy generation unit.

[0110] Optionally, the training model is further configured to: Obtain multiple sample combination optimization problems; For each sample combination optimization problem, based on a dedicated solver corresponding to the sample combination optimization problem, obtain expert solution trajectory data corresponding to the sample combination optimization problem; The expert solution trajectory data is serialized to obtain sequence trajectory data of the sample combination optimization problem.

[0111] Figure 7 An example of a physical structure diagram of an electronic device is shown below. Figure 7 As shown, the electronic device may include: a processor 710, a communications interface 720, a memory 730, and a communication bus 740, wherein the processor 710, the communications interface 720, and the memory 730 communicate with each other via the communication bus 740. The processor 710 may call logic instructions in the memory 730 to execute a method for solving a combinatorial optimization problem, the method comprising: obtaining a target combinatorial optimization problem, and serializing the target combinatorial optimization problem to obtain a problem prefix sequence; inputting the problem prefix sequence into a trained combinatorial optimization problem-solving model for solving the problem, and obtaining a solution result for the target combinatorial optimization problem, wherein the combinatorial optimization problem-solving model is trained based on sequence trajectory data of multiple sample combinatorial optimization problems, wherein the multiple sample combinatorial optimization problems include at least one specified combinatorial optimization problem, and the type of the specified combinatorial optimization problem is the same as that of the target combinatorial optimization problem.

[0112] Furthermore, the logic instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0113] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the method for solving the combinatorial optimization problem provided by the above methods. The method includes: obtaining a target combinatorial optimization problem, and serializing the target combinatorial optimization problem to obtain a problem prefix sequence; inputting the problem prefix sequence into a trained combinatorial optimization problem solving model for solving, to obtain a solution result of the target combinatorial optimization problem. The combinatorial optimization problem solving model is trained based on sequence trajectory data of multiple sample combinatorial optimization problems. The multiple sample combinatorial optimization problems include at least one specified combinatorial optimization problem, and the type of the specified combinatorial optimization problem is the same as the type of the target combinatorial optimization problem.

[0114] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the method for solving the combinatorial optimization problem provided by the above-mentioned methods, the method comprising: obtaining a target combinatorial optimization problem, and serializing the target combinatorial optimization problem to obtain a problem prefix sequence; inputting the problem prefix sequence into a trained combinatorial optimization problem solving model for solving, to obtain a solution result of the target combinatorial optimization problem, the combinatorial optimization problem solving model is trained based on sequence trajectory data of multiple sample combinatorial optimization problems, the multiple sample combinatorial optimization problems include at least one specified combinatorial optimization problem, and the type of the specified combinatorial optimization problem is the same as the type of the target combinatorial optimization problem.

[0115] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0116] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.

[0117] 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 various embodiments of the present invention.

Claims

1. A method for solving combinatorial optimization problems, characterized in that: include: Obtaining a target combination optimization problem, and serializing the target combination optimization problem to obtain a problem prefix sequence; The problem prefix sequence is input into a trained combinatorial optimization problem solving model for solving, to obtain a solution result of the target combinatorial optimization problem, wherein the combinatorial optimization problem solving model is trained based on sequence trajectory data of multiple sample combinatorial optimization problems, wherein the multiple sample combinatorial optimization problems include at least one specified combinatorial optimization problem, and the type of the specified combinatorial optimization problem is the same as the type of the target combinatorial optimization problem.

2. The method for solving combinatorial optimization problems according to claim 1, characterized in that: The combinatorial optimization problem solving model includes a forward dynamic prediction unit and a strategy generation unit; The problem prefix sequence is input into a trained combinatorial optimization problem solving model for solving the problem, and a solution result of the target combinatorial optimization problem is obtained, including: Using the question prefix sequence as a state prediction sequence; Determining whether the solution is completed according to the state prediction sequence; If so, then obtaining a solution to the target combination optimization problem based on the state prediction sequence; If not, the state prediction sequence is input into the forward dynamic prediction unit for state prediction to obtain a single-step state; the single-step state is spliced ​​at the back end of the state prediction sequence to obtain an action prediction sequence; the action prediction sequence is input into the strategy generation unit for action prediction to obtain a single-step action; the single-step action is spliced ​​at the back end of the action prediction sequence to obtain an updated state prediction sequence; and the step of determining whether the solution is completed according to the state prediction sequence is continued.

3. The method for solving combinatorial optimization problems according to claim 2, characterized in that: Obtaining a solution to the target combination optimization problem based on the state prediction sequence includes: The single-step actions in the state prediction sequence are extracted in order from front to back to obtain a solution to the target combination optimization problem.

4. The method for solving the combinatorial optimization problem according to any one of claims 1 to 3, characterized in that: The training process of the combinatorial optimization problem solving model includes: Obtain sequence trajectory data of multiple sample combinatorial optimization problems and an untrained combinatorial optimization problem-solving model; Based on the sequence trajectory data of the plurality of sample combinatorial optimization problems, a forward dynamic prediction unit in the combinatorial optimization problem solving model is trained to obtain a trained forward dynamic prediction unit; Based on the sequence trajectory data of the plurality of sample combinatorial optimization problems, a strategy generation unit in the combinatorial optimization problem solving model is trained to obtain a trained strategy generation unit.

5. The method for solving combinatorial optimization problems according to claim 4, characterized in that: The forward dynamic prediction unit in the combinatorial optimization problem solving model is trained based on the sequence trajectory data of the plurality of sample combinatorial optimization problems to obtain a trained forward dynamic prediction unit, including: Selecting at least one sequence trajectory data of a sample combination optimization problem from the sequence trajectory data of the plurality of sample combination optimization problems; For each selected sequence trajectory data of the sample combination optimization problem, extracting each single-step state in the sequence trajectory data in order from front to back to obtain a first sample label, and performing masking on each single-step state in the sequence trajectory data to obtain a first training sample; Inputting each of the first training samples into the forward dynamic prediction unit for state prediction, and obtaining a predicted single-step state sequence corresponding to each of the first training samples, wherein the predicted single-step state sequence is a sequence of the predicted single-step states arranged in a prediction order; Calculating a first loss value based on the predicted single-step state sequence corresponding to each of the first training samples and the first sample label; Adjusting parameters of the forward motion prediction unit based on the first loss value; Continue to execute the steps of selecting at least one sequence trajectory data of the sample combination optimization problem from the sequence trajectory data of the multiple sample combination optimization problems and subsequent steps until the first training stop condition is reached, thereby obtaining a trained forward dynamic prediction unit.

6. The method for solving combinatorial optimization problems according to claim 4, characterized in that: The strategy generation unit in the combinatorial optimization problem solving model is trained based on the sequence trajectory data of the plurality of sample combinatorial optimization problems to obtain a trained strategy generation unit, including: Selecting at least one sequence trajectory data of a sample combination optimization problem from the sequence trajectory data of the plurality of sample combination optimization problems; For each selected sequence trajectory data of the sample combination optimization problem, extracting each single-step action in the sequence trajectory data in order from front to back to obtain a second sample label, and performing masking processing on each single-step action in the sequence trajectory data to obtain a second training sample; Inputting each second training sample into the strategy generation unit for action prediction, obtaining a predicted single-step action sequence corresponding to each second training sample, wherein the predicted single-step action sequence is a sequence of the predicted single-step actions arranged in a predicted order; Calculating a second loss value based on the predicted single-step action sequence corresponding to each second training sample and the second sample label; adjusting parameters of the strategy generation unit based on the second loss value; Continue to execute the steps of selecting at least one sequence trajectory data of the sample combination optimization problem from the sequence trajectory data of the multiple sample combination optimization problems and subsequent steps until the second training stop condition is reached, thereby obtaining a trained strategy generation unit.

7. The method for solving combinatorial optimization problems according to claim 4, characterized in that: The step of obtaining sequence trajectory data for a plurality of sample combination optimization problems includes: Obtain multiple sample combination optimization problems; For each sample combination optimization problem, based on a dedicated solver corresponding to the sample combination optimization problem, obtain expert solution trajectory data corresponding to the sample combination optimization problem; The expert solution trajectory data is serialized to obtain sequence trajectory data of the sample combination optimization problem.

8. A device for solving combinatorial optimization problems, characterized in that: include: an acquisition module configured to acquire a target combinatorial optimization problem and serialize the target combinatorial optimization problem to obtain a problem prefix sequence; The solution module is configured to input the problem prefix sequence into a trained combinatorial optimization problem-solving model for solution to obtain a solution result of the target combinatorial optimization problem, wherein the combinatorial optimization problem-solving model is trained based on sequence trajectory data of multiple sample combinatorial optimization problems, wherein the multiple sample combinatorial optimization problems include at least one specified combinatorial optimization problem, and the type of the specified combinatorial optimization problem is the same as the type of the target combinatorial optimization problem.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the method for solving the combinatorial optimization problem according to any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for solving the combinatorial optimization problem according to any one of claims 1 to 7 is implemented.