Mixed integer linear programming problem solving model generalization optimization method and system
By converting the mixed integer linear programming problem into a binary graph and generating new problems and optimal solutions, the graph neural network model is optimized, and the problem of insufficient generalization of graph neural network in MILP problem is solved, and the new problem is realized. Accurate solution and applicable scenario expansion.
Patent Information
- Application Number
- CN202411111742.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-12-10
AI Technical Summary
Existing graph neural networks (GNNs) have poor generalization when solving the problem of mixed integer linear programming (MILP), resulting in poor performance of the model in the event of new problems or large gaps in problems, and the accurate solution cannot be obtained.
By converting mixed integer linear programming problems into binary graphs, the graph neural network model is trained, and new problems and optimal solutions are generated through transformations, data samples are added to optimize the graph neural network model and improve its generalization ability. Specific methods include randomly selecting decision variables for addition, decreasing, translation and normalization, adding anti-noise to change constraints, generating new MILP instances, and using optimal solution discriminators and adversarial optimization to improve model robustness.
It significantly improves the generalization ability and applicable scenarios of graph neural networks in mixed integer linear programming problems, can provide accurate solutions in new problems or large gaps, and expands the application scope and performance of the model.
Smart Images

Figure CN119106711A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of machine learning, and in particular to a method and system for optimizing the generalization performance of a mixed integer linear programming problem solving model. Background Art
[0002] Mixed-Integer Linear Programming (MILP) is one of the most widely used techniques for modeling combinatorial optimization problems. Practical applications such as production planning and transportation management may involve MILP problems. In the real world, MILP models from the same application have similar patterns and features, and such models are solved repeatedly without taking advantage of these similarities. Machine Learning (ML) algorithms are known for their ability to recognize patterns, and they help build optimization algorithms. There is great potential in using machine learning techniques to solve MILP problems.
[0003] At present, there are many machine learning methods for mixed integer linear programming (MILP) problems, which use graph neural networks (GNN) to extract problem information and solve mixed integer linear programming (MILP) problems, and then combine solvers to provide accurate solutions. However, the generalization of the graph neural network (GNN) currently used is poor. When the model encounters new problems or the problem gap is large, the model performs poorly, which will lead to the problem solution obtained by the model is not accurate enough. Summary of the invention
[0004] In order to help solve the problem that the generalization of graph neural network (GNN) solutions is poor, and when the model encounters new problems or the problems are very different, the model performs poorly, resulting in inaccurate solutions to the problems obtained by the model, the present application provides a method and system for optimizing the generalization of a mixed integer linear programming problem solving model.
[0005] In a first aspect, the present application provides a method for optimizing the generalization of a mixed integer linear programming problem solving model, which adopts the following technical solution: the method comprises:
[0006] Obtaining a mixed integer linear programming problem, wherein the mixed integer linear programming problem includes an objective function, decision variables, and constraints;
[0007] Converting the mixed integer linear programming problem into a bipartite graph according to the decision variables and the constraints;
[0008] Inputting the bipartite graph into the original graph neural network model, training the original graph neural network model according to the bipartite graph, and generating a trained graph neural network model;
[0009] Transforming the mixed integer linear programming problem and generating a new mixed integer linear programming problem and an optimal solution corresponding to the new problem;
[0010] The new problem and the optimal solution corresponding to the new problem are input into the trained graph neural network model for optimization, and a graph neural network optimization model is generated.
[0011] Through the above technical solution, the original mixed integer linear programming problem is transformed to increase data samples, and the increased data samples are input into the trained graph neural network model to optimize the graph neural network model, thereby improving the generalization ability of the graph neural network model. In the case of new problems or problems with large gaps, the optimized graph neural network model can also be used to obtain accurate solutions, thereby expanding the applicable scenarios and scope of graph neural networks in mixed integer linear programming problems.
[0012] In a specific possible implementation scheme, the objective function corresponds to multiple instances, and the training of the original graph neural network model according to the bipartite graph and generating a trained graph neural network model includes:
[0013] constructing an information transfer function according to the bipartite graph, calculating the information transfer function and outputting a static feature of the mixed integer linear programming problem;
[0014] generating solutions to a plurality of said instances using a general solver;
[0015] Constructing a target optimization function according to the static characteristics;
[0016] When the solutions of the multiple instances satisfy the target optimization function, the optimal solutions of the multiple instances are obtained, and the trained graph neural network model is generated.
[0017] Through the above technical solution, an objective function can correspond to multiple instances, each instance includes multiple solutions, and multiple solutions constitute a solution set of an instance. The solutions in the solution sets of multiple instances are substituted into the objective optimization function. The process of solving the optimal solution of the instance through the objective function is the process of training the graph neural network model. When the optimal solution is obtained, a graph neural network model that can solve the optimal solution is generated. The model is trained in this way to ensure that the graph neural network model can solve the optimal solution for different instances.
[0018] In a specific implementation scheme, the transforming of the mixed integer linear programming problem comprises:
[0019] A preset number of decision variables are randomly selected, the number of the decision variables is increased or decreased, and a coefficient matrix of constraint conditions, a constant matrix of constraint conditions, and a coefficient matrix of the objective function after the decision variables are increased or decreased are generated.
[0020] Through the above technical solution, the scale of the problem can be transformed accordingly by randomly selecting a preset number of decision variables, and the objective function and constraints can be updated accordingly by increasing or decreasing the decision variables, so that the optimal solution of the original problem remains unchanged, thereby improving the generalization ability of the trained model.
[0021] In a specific implementation scheme, the transforming of the mixed integer linear programming problem comprises:
[0022] Parameters are randomly generated, and new constraints are constructed according to the randomly generated parameters.
[0023] Through the above technical solution, the constraints are changed by changing the parameters of the original constraints to generate new constraints. Different constraints will result in different mixed integer linear programming problems to be solved, so new linear programming problems can be generated to achieve problem transformation.
[0024] In a specific implementation scheme, the transforming of the mixed integer linear programming problem comprises:
[0025] The decision variables are translated to obtain translated new decision variables and new constraint conditions and new objective functions corresponding to the new decision variables;
[0026] Normalizing the new constraint conditions to obtain a normalized coefficient matrix of the new constraint conditions, and setting the normalized coefficient matrix of the new constraint conditions as a normalized constraint coefficient matrix;
[0027] Adversarial noise is added to the normalized constraint coefficient matrix.
[0028] Through the above technical solution, the instance is changed by means of variable translation, and the corresponding constraints and objective functions will be transformed accordingly, so that the instance can be expanded while the solution space remains unchanged. After normalization, the scale of the problem changes, thereby realizing the transformation of the mixed integer linear programming problem and generating a new problem; at the same time, adding adversarial noise to the coefficient matrix of the constraint conditions for training can improve the robustness of the model.
[0029] In a specific implementation scheme, inputting the new problem and the optimal solution corresponding to the new problem into the trained graph neural network model for optimization includes:
[0030] Inputting the new problem and the optimal solution corresponding to the new problem into a preset optimal solution discriminator, training and optimizing the optimal solution discriminator according to a preset second objective optimization function, and generating an optimal solution optimization discriminator;
[0031] The new problem and the optimal solution corresponding to the new problem are input into the trained graph neural network model, the optimal solution of the new problem is found by using the optimal solution optimization discriminator, and adversarial optimization is performed on the trained graph neural network model.
[0032] Through the above technical solutions, the optimal solution discriminator can directly discriminate the probability of the optimal solution. Using the optimal solution discriminator to identify the optimality of the solution after adding noise can simplify the difficulty of solving planning problems. The discriminator is based on the statistical characteristics of the bipartite graph information and constraints extracted by the graph neural network (GNN), and can efficiently judge the optimality of the solution. In addition, robust optimization is used to introduce adversarial noise, and the generalization ability of the graph neural network (GNN) is improved by adding noise to the constraint coefficient matrix and the target coefficient vector. The introduction of noise will not change the optimality of the solution, but it can significantly improve the effect of the model.
[0033] In a specific implementation scheme, the adversarial optimization of the trained graph neural network model includes:
[0034] UV decomposition and LoRA structure are used to perform adversarial optimization on the trained graph neural network model.
[0035] Through the above technical solution, the coefficient matrix parameters of the constraint conditions are large, and UV decomposition is used to process large-scale parameters, which shortens the optimization time and can maintain sparsity, further improving the robustness of the model.
[0036] In a second aspect, the present application provides a mixed integer linear programming problem solving model generalization optimization system, which adopts the following technical solution: the system comprises:
[0037] A problem acquisition module, used for acquiring a mixed integer linear programming problem, wherein the mixed integer linear programming problem includes an objective function, decision variables and constraints;
[0038] A problem conversion module, used for converting the mixed integer linear programming problem into a bipartite graph according to the decision variables and the constraint conditions;
[0039] A model training module, used to input the bipartite graph into an original graph neural network model, train the original graph neural network model according to the bipartite graph, and generate a trained graph neural network model;
[0040] A new problem generating module, used for transforming the mixed integer linear programming problem and generating a new mixed integer linear programming problem and an optimal solution corresponding to the new problem;
[0041] The model optimization module is used to input the new problem and the optimal solution corresponding to the new problem into the trained graph neural network model for optimization, and generate a graph neural network optimization model.
[0042] In a third aspect, the present application provides a computer device, which adopts the following technical solution: it includes a memory and a processor, and the memory stores a computer program that can be loaded by the processor and executes any of the above-mentioned generalization optimization methods for solving mixed integer linear programming problems.
[0043] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution: storing a computer program that can be loaded by a processor and execute any of the above-mentioned generalization optimization methods for solving mixed integer linear programming problems.
[0044] In summary, this application has the following beneficial technical effects:
[0045] 1. Use robust optimization to introduce adversarial noise. By adding noise to the correlation matrix and target coefficient vector, the generalization ability of the graph neural network (GNN) is improved. The introduction of noise will not change the optimality of the solution, but can significantly improve the effect of the model.
[0046] 2. The optimal solution discriminator is used to identify the optimality of the solution after noise is added. The discriminator is based on the statistical characteristics of the bipartite graph information and constraints extracted by GNN, and can efficiently judge the optimality of the solution;
[0047] 3. By randomly selecting and copying variables and constraints, the parameter scale and constraint scale of the original problem are changed to generate new MILP instances, enhance the diversity of the data set, and improve the generalization ability of the model;
[0048] 4. When adding adversarial noise to the correlation matrix, UV decomposition is used to process large-scale parameters, which shortens the optimization time and maintains sparsity, further improving the robustness of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a flow chart of a generalization optimization method for solving a mixed integer linear programming problem in an embodiment of the present application;
[0050] Figure 2 is a schematic diagram of a generalization optimization system for solving a mixed integer linear programming problem in an embodiment of the present application;
[0051] Figure 3It is a schematic diagram used to embody a computer device in an embodiment of the present application.
[0052] Figure numerals: 201, question acquisition module; 202, question conversion module; 203, model training module; 204, new question generation module; 205, model optimization module. DETAILED DESCRIPTION
[0053] The following combination Figure 1-Figure 3 This application is described in further detail.
[0054] The embodiment of the present application discloses a method for optimizing the generalization of a mixed integer linear programming problem solution model. The method can be used to optimize the generalization of the mixed integer linear programming problem solution model, improve the performance of the solution model, improve the generalization ability of the solution model, and expand the applicable scenarios and scope of the solution model. Mixed-Integer Linear Programming (MILP) is one of the most widely used techniques for modeling combinatorial optimization problems. Mixed integer linear programming problems may be involved in practical applications such as production planning and transportation management. Machine learning (ML) algorithms are well-known for their ability to recognize patterns. They help to establish optimization algorithms. There is great potential in using machine learning techniques to solve mixed integer linear programming (MILP) problems.
[0055] At present, there are many machine learning methods for mixed integer linear programming (MILP) problems, which use graph neural networks (GNN) to extract problem information and solve mixed integer linear programming (MILP) problems, and then combine with solvers to provide accurate solutions. However, the generalization of the graph neural network (GNN) currently used is poor. When the model encounters new problems or the problem gap is large, the model performs poorly, which will cause the solution to the problem obtained by the model to be inaccurate. In general, it is usually chosen to increase the sample method to improve the generalization ability of the model, but the method of increasing samples is costly and difficult to be generally applicable. In order to help improve the generalization ability of the solution model and reduce costs at the same time, the present application provides a method for optimizing the generalization of the model for solving mixed integer linear programming problems.
[0056] Reference Figure 1 , the method comprises the following steps:
[0057] S10, obtaining a mixed integer linear programming problem, where the mixed integer linear programming problem includes an objective function, decision variables, and constraints.
[0058] Specifically, a mixed integer linear programming problem to be solved is obtained. A linear programming problem generally includes an objective function, decision variables, and constraints. A mixed integer linear programming problem can be understood as a linear programming problem in which the decision variable part is an integer.
[0059] S20, convert the mixed integer linear programming problem into a bipartite graph according to the decision variables and constraints.
[0060] Specifically, according to the decision variables and constraints of the problem, the problem is converted into a bipartite graph representation. The bipartite graph is a special model in graph theory. The bipartite graph constructed by the conversion can be expressed as BG = (V, C, E), where BG represents the constructed bipartite graph, V represents the decision variable node, C represents the constraint node, and E represents the edge between the decision variable node and the constraint node. E can indicate that in the constraint, the coefficient of the decision variable is not 0. The constructed bipartite graph can provide structural information of the problem and provide an effective representation form for solving mixed integer linear programming problems.
[0061] Specifically, the step of converting the planning problem into a bipartite graph includes extracting decision variable features and constraint condition features in the planning problem, using the decision variable features as decision variable nodes, using the constraint condition features as constraint condition nodes, using the association between the decision variable features and the constraint condition features as edges, and constructing a bipartite graph based on the decision variable nodes, constraint condition nodes and edges.
[0062] S30, input the bipartite graph into the original graph neural network model, train the original graph neural network model according to the bipartite graph, and generate a trained graph neural network model.
[0063] Specifically, the constructed bipartite graph is input into the original untrained and unoptimized graph neural network model. The information of the bipartite graph can be extracted through the graph neural network model, so as to obtain the implicit expression of the decision variable nodes and the constraint condition nodes; the bipartite graph is input into the original graph neural network model, and the original graph neural network model is trained and optimized to generate a trained graph neural network model.
[0064] S40, transforming the mixed integer linear programming problem, and generating a new mixed integer linear programming problem and an optimal solution corresponding to the new problem.
[0065] Specifically, transforming the mixed integer linear programming problem can also be understood as changing the original planning problem by expanding or reducing decision variables, or translating decision variables, or changing constraints, etc., to generate a new planning problem. When the original problem is changed to generate a new planning problem, the optimal solution corresponding to the original problem will also change synchronously, so that a new mixed integer linear programming problem and the optimal solution corresponding to the new problem can be obtained. Transforming the original planning problem to increase the data sample can help improve the generalization ability of the solution model.
[0066] S50, input the new problem and the optimal solution corresponding to the new problem into the trained graph neural network model for optimization, and generate a graph neural network optimization model.
[0067] Specifically, by transforming the original problem, we can obtain a new problem and the optimal solution corresponding to the new problem, thereby increasing the data samples. The increased data samples are input into the trained graph neural network model for optimization to generate a graph neural network optimization model, that is, an optimized graph neural network model with improved generalization ability.
[0068] In the present application scheme, the original mixed integer linear programming problem is transformed to increase data samples, and the increased data samples are input into the trained graph neural network model to optimize the graph neural network model, thereby improving the generalization ability of the graph neural network model. In the case of new problems or problems with large gaps, the optimized graph neural network model can also be used to obtain accurate solutions, thereby expanding the applicable scenarios and scope of graph neural networks in mixed integer linear programming problems.
[0069] In one embodiment, the objective function corresponds to multiple instances, and the steps of training the original graph neural network model according to the bipartite graph and generating the trained graph neural network model can be specifically performed as follows:
[0070] First, the information transfer function is constructed according to the bipartite graph, the information transfer function is calculated and the static characteristics of the mixed integer linear programming problem are output; specifically, a mixed integer linear programming problem can be expressed as:
[0071] argmin x {μ T x|Ax≤b; x≥0; x∈Z n}
[0072] Among them, μ T represents the coefficient matrix of the objective function, A represents the coefficient matrix of the constraints, b represents the constant term matrix composed of the constant terms on the right side of the inequality constraints, x∈Z n Indicates that the variable x is an integer.
[0073] The linear programming problem is converted into a bipartite graph. The resulting bipartite graph can be expressed as G = (V, C, A), where G represents the bipartite graph, V represents the decision variable representation in the linear programming problem, and V = {v 1 , v 2 , ...}, V∈R n×d , C represents the constraint condition representation in the linear programming problem, C={c 1 , c 2 , ...}, C∈R m×d , A∈R m×m The coefficient matrix representing the constraints can also be understood as the association matrix between the decision variable representation and the constraint representation. Then, the information transfer function is constructed based on the bipartite graph, and the constructed information transfer function can be expressed as:
[0074]
[0075] in, represents the trainable weight parameters of the k-th layer graph neural network, and They respectively represent the dimensionality-increased features of the decision variables and the dimensionality-increased features of the constraints in the k-th layer of the graph neural network, LN() represents layer normalization, and σ() represents the hyperbolic tangent activation function (Tanh activation function).
[0076] C (k+1) The function represents the information transferred from the decision variable representation to the constraint condition representation, V (k+1) The function represents the information transmission from the constraint representation to the decision variable representation. After multiple transmissions between the decision variable representation and the constraint representation, the constraint and decision variable can perceive the entire bipartite graph, thereby constructing a representation of the entire optimization problem. The final decision variable representation V (k) Represents the final output of the planning problem and represents the static characteristics of the entire optimization problem.
[0077] Each planning problem corresponds to multiple instances, and each instance corresponds to multiple solutions. The general solver can be used to obtain solutions to generate multiple instances. The set generated by the solutions of multiple instances can be expressed as:
[0078]
[0079] Where i represents the serial number of the instance, j represents the serial number of the solution of the instance, and I i represents the i-th instance, x i,j represents the jth solution of the ith instance, and P represents the set of solutions generated by multiple instances.
[0080] The optimal target value of each solution is different, so the weight of each solution is different. The closer the solution is to the optimal solution, the higher the weight. For an instance I i For example, the weight of the jth solution can be expressed as:
[0081]
[0082] in,
[0083] Then, the target optimization function is constructed according to the static features. The constructed target optimization function can be expressed as:
[0084]
[0085] Among them, w i,j represents the weight of the jth solution of the ith instance, D() represents the cross entropy, V j represents the static features finally output by the information transfer function, x i,j represents the jth solution of the ith instance.
[0086] When the solutions of multiple instances satisfy the target optimization function, the optimal solutions of multiple instances are obtained, and a trained graph neural network model is generated.
[0087] In the present application scheme, an objective function can correspond to multiple instances, each instance includes multiple solutions, and multiple solutions constitute a solution set of an instance. The solutions in the solution set of multiple instances are substituted into the objective optimization function. The process of solving the optimal solution of the instance through the objective function is the process of training the graph neural network model. When the optimal solution is obtained, a graph neural network model that can solve the optimal solution is generated. The model is trained in this way to ensure that the graph neural network model can solve the optimal solution for different instances.
[0088] In one embodiment, the step of transforming the mixed integer linear programming problem may be specifically performed as follows:
[0089] Randomly select a preset number of decision variables, increase or decrease the number of decision variables, and generate the coefficient matrix of the constraint conditions after the increase or decrease of the decision variables, the constant matrix of the constraint conditions, and the coefficient matrix of the objective function. Specifically, for an instance of the original problem I = (A, b, μ), the solution of this instance is x j , the way to increase the number of decision variables can include randomly selecting a preset number of decision variables, copying the selected decision variables, combining the original constraints, generating new constraints, the coefficient matrix of the new constraints can be expressed as (A, A′), the coefficient matrix of the new objective function can be expressed as (μ, μ′), selecting a part of the solution x′ of the original instance j ∈x j, then the new problem instance can be expressed as I = ((A, A'), b', (μ, μ')), where b' = b + A'x' j , b′ is the constant term matrix of the new constraint condition, then the optimal solution of the new problem can be expressed as x=(x j , x′ j ). Similarly, the method of reducing the number of decision variables may include randomly selecting a preset number of decision variables, duplicating the selected decision variables, combining the original constraints, generating new constraints, the coefficient matrix of the new constraints can be expressed as A / A′, the coefficient matrix of the new objective function can be expressed as μ / μ′, selecting a part of the solution x′ of the original instance j ∈x j , then the new problem instance can be expressed as I = (A / A′, b′, μ / μ′), where b′ = bA′x′ J , b′ is the constant term matrix of the new constraint condition, then the optimal solution of the new problem can be expressed as x=x j / x′ j .
[0090] In the present application, the scale of the problem can be transformed accordingly by randomly selecting a preset number of decision variables, and the objective function and constraints are updated accordingly by increasing or decreasing the decision variables, so that the optimal solution to the original problem remains unchanged, thereby improving the generalization ability of the trained model.
[0091] In one embodiment, the step of transforming the mixed integer linear programming problem may be specifically performed as follows:
[0092] Randomly generate parameters and construct new constraints based on the randomly generated parameters. Specifically, randomly generate parameter a and select a part of the solution x′ of the original instance j ∈x f , define a new constraint as a T x′≤b′, where b′=a T x′ j When the decision variables are reduced, Ax-b is calculated, and the calculated results are sorted to remove the constraint with the smallest constraint value.
[0093] In the present application scheme, the constraints are changed by changing the parameters of the original constraints to generate new constraints. Different constraints will result in different mixed integer linear programming problems to be solved, so that new linear programming problems can be generated to achieve problem transformation.
[0094] It should be noted that the transformation method of randomly generating parameters and constructing new constraints based on the randomly generated parameters and the method of randomly selecting a certain number of decision variables and increasing or decreasing the number of decision variables are two independent ways of generating new problems. The two methods can be implemented separately or simultaneously. Usually, users can choose to implement both methods simultaneously, which can increase the data samples as much as possible, so that when optimizing the model later, there are a large number of data samples to train and optimize the model, which helps to improve the generalization ability and applicable scenarios of the solution model.
[0095] In one embodiment, the step of transforming the mixed integer linear programming problem may be specifically performed as follows:
[0096] First, the decision variables are shifted. The variable shift method can be expressed as Get the new decision variable after translation As well as the new constraints and new objective functions corresponding to the new decision variables, the coefficient matrix of the original constraints is A. After the decision variables are translated, the coefficient matrix of the new constraints is As. The original solution adds (-μs) to the target value, and the objective function will also be transformed accordingly. After that, the new constraints are normalized. Normalization means that the constant terms of the new constraints are all set to 1, and the coefficient matrix of the new constraints is changed accordingly to achieve the normalization of the new constraints, and the coefficient matrix of the normalized constraints is obtained. The coefficient matrix of the normalized constraints is set as the normalized constraint coefficient matrix; then, adversarial noise is added to the normalized constraint coefficient matrix. Robust learning mainly considers adding adversarial noise to the coefficient matrix of the constraints.
[0097] In the present application scheme, the instance is changed by means of variable translation, and the corresponding constraints and objective functions will be transformed accordingly, so that the instance can be expanded while the solution space remains unchanged. After normalization, the scale of the problem changes, thereby realizing the transformation of the mixed integer linear programming problem and generating a new problem; at the same time, adding adversarial noise to the coefficient matrix of the constraint conditions for training can improve the robustness of the model.
[0098] In one embodiment, the step of inputting the new problem and the optimal solution corresponding to the new problem into the trained graph neural network model for optimization can be specifically performed as follows:
[0099] First, the new problem and the optimal solution corresponding to the new problem are input into the preset optimal solution discriminator, and the optimal solution discriminator is trained and optimized according to the preset second objective optimization function, and the optimal solution optimization discriminator is generated. Specifically, in robust optimization, the optimal solution is identified by a preset optimal solution discriminator, which can be expressed as hθ′ (A, μ, x), θ′ represents the parameters in the graph neural network, and the optimal solution discriminator can determine the probability that the solution is the optimal solution; the optimal solution discriminator h θ′ The input consists of two parts, one is the bipartite graph information extracted by the graph neural network (GNN), and the other is the statistical features of the result of (AX-b), such as the maximum, minimum, mean, etc. Use the original data set P to do label processing. Specifically, for an instance I i , all optimal solutions can be obtained through the optimal solution discriminator Then the ratio of the optimal solution to other solutions can be expressed as: The ratio result y i,j As the solution x i,j The label of is 0 when it is an infeasible solution. For the preset optimal solution discriminator, the objective optimization function that can find the optimal solution can be expressed as:
[0100]
[0101] Among them, D() represents the cross entropy calculation, h θ′ (A, μ, x) represents the optimal solution discriminator, y i,j It represents the ratio of the optimal solution to other solutions. The optimal solution discriminator can find the target optimization function of the optimal solution, which can also be understood as the LOSS function (loss function) of training the θ′ parameter in the graph neural network.
[0102] Since directly using the original data set P to train the optimal discriminator may face the problem of insufficient number of instances, the optimal solution found by the optimal solution discriminator may not be accurate enough. Therefore, it is necessary to update the problem and input the new problem and the solution to the new problem into the original preset optimal solution discriminator for optimization training, so as to generate the optimal solution optimization discriminator; the new problem is generated by translating the decision variables and then normalizing the new constraints. By expanding the number of instances by translating the variables, the linear programming problem can be changed, and the solution space can be kept unchanged, and the label y will not be changed. i,j In addition, after normalization, different constraints will have different scale changes, and this change will not affect the proportional weight relationship of the variables in the same constraint, which can improve the generalization ability of the optimal discriminator.
[0103] The convergence condition of the optimal solution optimization discriminator can be expressed as:
[0104]
[0105] Among them, D() represents the cross entropy calculation, h θ′ (A, μ, x) represents the optimal solution discriminator, y i,jrepresents the ratio of the optimal solution to other solutions, h θ′ (A′, μ, x+s) represents the optimal solution optimization discriminator, and s represents the distance of variable translation.
[0106] After that, the new problem and the optimal solution corresponding to the new problem are input into the trained graph neural network model, and the optimal solution is optimized by using the optimal solution to find the optimal solution of the new problem, and the trained graph neural network model is subjected to adversarial optimization. The adversarial optimization method can be expressed as:
[0107]
[0108] Among them, B represents the set of constraint constant term matrices, ε represents the preset threshold, g θ Represents the graph neural network model. However, since the number of parameters of A is large, the optimization time is long and it will take a long time. Therefore, UV decomposition is performed on B, and it is considered that B should be sparse. The adversarial optimization method can be expressed as:
[0109]
[0110] The LoRA architecture (Low-Rank Adaptation) is used to calculate the gradients of u and v. LoRA (Low-Rank Adaptation) optimization is a technique for adjusting and fine-tuning large neural networks. The core idea is to introduce a low-rank structure into the weight matrix of the model, usually by adding a learnable low-rank matrix. T and v, and update A to get Based on the new A, train a new θ and repeat the iteration until the above convergence conditions are met.
[0111] In the present application, the optimal solution discriminator can directly discriminate the probability of the optimal solution. The optimal solution discriminator is used to identify the optimality of the solution after noise is added, which can simplify the difficulty of solving planning problems. The discriminator is based on the statistical characteristics of the bipartite graph information and constraints extracted by the graph neural network (GNN), and can efficiently judge the optimality of the solution. Secondly, robust optimization is used to introduce adversarial noise, and the generalization ability of the graph neural network (GNN) is improved by adding noise to the constraint coefficient matrix and the target coefficient vector. The introduction of noise will not change the optimality of the solution, but it can significantly improve the effect of the model. In addition, the coefficient matrix of the constraint condition has a large number of parameters. UV decomposition is used to process large-scale parameters, which shortens the optimization time and can maintain sparsity, further improving the robustness of the model.
[0112] It should be noted that the method of translating decision variables to generate new problems and adversarial optimization is independent of the method of increasing or decreasing the number of decision variables and changing constraint parameters to generate new problems, and the method of translating decision variables cannot be performed at the same time as the other two methods.
[0113] Figure 1 FIG. 1 is a flow chart of a method for optimizing the generalization performance of a mixed integer linear programming problem solving model in one embodiment. It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but the steps are not necessarily executed in the order indicated by the arrows; unless otherwise specified in this document, there is no strict order restriction for the execution of the steps, and the steps may be executed in other orders; and Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0114] Based on the above method, an embodiment of the present application also discloses a generalization optimization system for a mixed integer linear programming problem solving model.
[0115] Reference Figure 2 The system includes the following modules:
[0116] A problem acquisition module 201 is used to acquire a mixed integer linear programming problem, where the mixed integer linear programming problem includes an objective function, decision variables, and constraints;
[0117] A problem conversion module 202, for converting a mixed integer linear programming problem into a bipartite graph according to decision variables and constraints;
[0118] A model training module 203 is used to input the bipartite graph into the original graph neural network model, train the original graph neural network model according to the bipartite graph, and generate a trained graph neural network model;
[0119] A new problem generating module 204 is used to transform the mixed integer linear programming problem and generate a new mixed integer linear programming problem and an optimal solution corresponding to the new problem;
[0120] The model optimization module 205 is used to input the new problem and the optimal solution corresponding to the new problem into the trained graph neural network model for optimization, and generate a graph neural network optimization model.
[0121] In one embodiment, the model training module 203 is specifically used to construct an information transfer function based on a bipartite graph, calculate the information transfer function and output the static characteristics of the mixed integer linear programming problem; use a general solver to generate solutions to multiple instances; construct a target optimization function based on the static characteristics; when the solutions of multiple instances satisfy the target optimization function, obtain the optimal solutions for multiple instances and generate a trained graph neural network model.
[0122] In one embodiment, the new problem generation module 204 is specifically used to randomly select a preset number of decision variables, increase or decrease the number of decision variables, and generate a coefficient matrix of constraints after the increase or decrease of decision variables, a constant matrix of constraints, and a coefficient matrix of the objective function.
[0123] In one embodiment, the new question generation module 204 is specifically used to randomly generate parameters and construct new constraints according to the randomly generated parameters.
[0124] In one embodiment, the new problem generation module 204 is specifically used to translate the decision variables to obtain the translated new decision variables and the new constraint conditions and the new objective function corresponding to the new decision variables; normalize the new constraint conditions to obtain the coefficient matrix of the normalized new constraint conditions, set the coefficient matrix of the normalized new constraint conditions as the normalized constraint coefficient matrix; add adversarial noise to the normalized constraint coefficient matrix.
[0125] In one embodiment, the model optimization module 205 is specifically used to input the new problem and the optimal solution corresponding to the new problem into a preset optimal solution discriminator, train and optimize the optimal solution discriminator according to a preset second objective optimization function, and generate an optimal solution optimization discriminator; input the new problem and the optimal solution corresponding to the new problem into the trained graph neural network model, use the optimal solution optimization discriminator to find the optimal solution to the new problem, and perform adversarial optimization on the trained graph neural network model.
[0126] In one embodiment, the model optimization module 205 is also used to perform adversarial optimization on the trained graph neural network model using UV decomposition and LoRA structure.
[0127] The mixed integer linear programming problem solving model generalization optimization system provided in the embodiment of the present application can be applied to the mixed integer linear programming problem solving model generalization optimization method provided in the above embodiment. For relevant details, refer to the above method embodiment. The implementation principle and technical effect are similar and will not be repeated here.
[0128] It should be noted that: the mixed integer linear programming problem solving model generalization optimization system provided in the embodiment of the present application only uses the division of the above-mentioned functional modules / functional units as an example when performing the generalization optimization of the mixed integer linear programming problem solving model. In actual applications, the above-mentioned functions can be assigned to different functional modules / functional units as needed, that is, the internal structure of the mixed integer linear programming problem solving model generalization optimization system is divided into different functional modules / functional units to complete all or part of the functions described above. In addition, the implementation method of the mixed integer linear programming problem solving model generalization optimization method provided in the above method embodiment and the implementation method of the mixed integer linear programming problem solving model generalization optimization system provided in this embodiment belong to the same concept. The specific implementation process of the mixed integer linear programming problem solving model generalization optimization system provided in this embodiment is detailed in the above method embodiment, and will not be repeated here.
[0129] The embodiment of the present application also discloses a computer device.
[0130] Specifically, if Figure 3 As shown, the computer device can be a computer device such as a desktop computer, a laptop computer, a PDA, and a cloud server. The computer device may include, but is not limited to, a processor and a memory. The processor and the memory may be connected via a bus or otherwise. The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, graphics processors (GPU), embedded neural network processors (NPU) or other dedicated deep learning coprocessors, discrete gates or transistor logic devices, discrete hardware components and other chips, or a combination of the above-mentioned various chips.
[0131] As a non-transient computer-readable storage medium, the memory can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the methods in the above-mentioned embodiments of the present application. The processor executes various functional applications and data processing of the processor by running the non-transient software programs, instructions and modules stored in the memory, that is, the method in the above-mentioned method implementation is realized. The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.
[0132] The embodiment of the present application also discloses a computer-readable storage medium.
[0133] Specifically, a computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method in the above-mentioned method implementation is implemented. Those skilled in the art will understand that the implementation of all or part of the process in the above-mentioned implementation method of the present application can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and the program, when executed, may include the process of the implementation of the above-mentioned methods. Among them, the storage medium may be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk (Hard Disk Drive, abbreviated as: HDD) or a solid-state drive (SSD), etc.; the storage medium may also include a combination of the above-mentioned types of memory.
[0134] This specific embodiment is merely an explanation of the present invention and is not a limitation of the present invention. After reading this specification, those skilled in the art may make non-creative modifications to the present embodiment as needed. However, as long as they are within the scope of the claims of the present invention, they are protected by the patent law.
Claims
1. A generalization optimization method for solving mixed integer linear programming problems. Features: The method comprises: Obtaining a mixed integer linear programming problem, wherein the mixed integer linear programming problem includes an objective function, decision variables, and constraints; Converting the mixed integer linear programming problem into a bipartite graph according to the decision variables and the constraints; Inputting the bipartite graph into the original graph neural network model, training the original graph neural network model according to the bipartite graph, and generating a trained graph neural network model; Transforming the mixed integer linear programming problem and generating a new mixed integer linear programming problem and an optimal solution corresponding to the new problem; The new problem and the optimal solution corresponding to the new problem are input into the trained graph neural network model for optimization, and a graph neural network optimization model is generated.
2. The method according to claim 1, Features: The objective function corresponds to a plurality of instances, and the training of the original graph neural network model according to the bipartite graph and generating a trained graph neural network model includes: constructing an information transfer function according to the bipartite graph, calculating the information transfer function and outputting a static feature of the mixed integer linear programming problem; generating solutions to a plurality of said instances using a general solver; Constructing a target optimization function according to the static characteristics; When the solutions of the multiple instances satisfy the target optimization function, the optimal solutions of the multiple instances are obtained, and the trained graph neural network model is generated.
3. The method according to claim 2, Features: The transforming of the mixed integer linear programming problem comprises: A preset number of decision variables are randomly selected, the number of the decision variables is increased or decreased, and a coefficient matrix of constraint conditions, a constant matrix of constraint conditions, and a coefficient matrix of the objective function after the decision variables are increased or decreased are generated.
4. The method according to claim 2, Features: The transforming of the mixed integer linear programming problem comprises: Parameters are randomly generated, and new constraints are constructed according to the randomly generated parameters.
5. The method according to claim 2, Features: The transforming of the mixed integer linear programming problem comprises: The decision variables are translated to obtain translated new decision variables and new constraint conditions and new objective functions corresponding to the new decision variables; Normalizing the new constraint conditions to obtain a normalized coefficient matrix of the new constraint conditions, and setting the normalized coefficient matrix of the new constraint conditions as a normalized constraint coefficient matrix; Adversarial noise is added to the normalized constraint coefficient matrix.
6. The method according to claim 5, Features: The step of inputting the new problem and the optimal solution corresponding to the new problem into the trained graph neural network model for optimization includes: Inputting the new problem and the optimal solution corresponding to the new problem into a preset optimal solution discriminator, training and optimizing the optimal solution discriminator according to a preset second objective optimization function, and generating an optimal solution optimization discriminator; The new problem and the optimal solution corresponding to the new problem are input into the trained graph neural network model, the optimal solution of the new problem is found by using the optimal solution optimization discriminator, and adversarial optimization is performed on the trained graph neural network model.
7. The method according to claim 6, Features: The adversarial optimization of the trained graph neural network model includes: UV decomposition and LoRA structure are used to perform adversarial optimization on the trained graph neural network model.
8. A generalization optimization system for solving mixed integer linear programming problems. Features: The system comprises: A problem acquisition module (201) is used to acquire a mixed integer linear programming problem, wherein the mixed integer linear programming problem includes an objective function, decision variables and constraints; A problem conversion module (202), configured to convert the mixed integer linear programming problem into a bipartite graph according to the decision variables and the constraint conditions; A model training module (203), used to input the bipartite graph into an original graph neural network model, train the original graph neural network model according to the bipartite graph, and generate a trained graph neural network model; A new problem generating module (204) is used to transform the mixed integer linear programming problem and generate a new mixed integer linear programming problem and an optimal solution corresponding to the new problem; The model optimization module (205) is used to input the new problem and the optimal solution corresponding to the new problem into the trained graph neural network model for optimization, and generate a graph neural network optimization model.
9. A computer device, It is characterized in that The method comprises a memory and a processor, wherein the memory stores a computer program which can be loaded by the processor and executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that A computer program is stored which can be loaded by a processor and execute the method according to any one of claims 1 to 7.
Citation Information
Cited By
Method for optimizing industrial scene by using model embedded mixed integer linear programming
CN121121418A
