Mathematical planning instance generation method and system and electronic equipment

Adaptive generation of mathematical planning instances is solved through the probability generation model, the problem of insufficient number of test instances in the prior art is solved, and the rapid generation of the same-distributed instances is achieved, which improves the generalization and robustness of the solver.

CN119202735APending Publication Date: 2024-12-27HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311211283.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-06-14
Filing Date
2023-09-19
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

During development, existing mathematical planning solvers require a large number of test instances to cover code vulnerabilities and improve generalization and robustness. However, due to relying on industry experts' experience, the number of test instances is insufficient and the construction efficiency is low, making it difficult to generate quickly and at large scale. Examples of mathematical planning with same distribution.

Method used

The probability generation model is used to convert mathematical planning instances into two-part graphs, and the graph structure is adaptively generated through graph convolution network and encoder-decoder. The model is iteratively trained according to the structure and solution difficulty similarity, and a large number of them are generated as the original example. Distributed test instances.

Benefits of technology

It realizes the rapid generation of a large number of test instances with the same distribution, improves the generalization and robustness of the solver, supports offline/online tuning, and improves the performance and stability of the solver.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119202735A_ABST
    Figure CN119202735A_ABST
Patent Text Reader

Abstract

The invention discloses a mathematical planning instance generation method and system and electronic equipment. The method comprises the steps that at least one mathematical planning instance is acquired; converting a first mathematical planning instance in the at least one mathematical planning instance into a first bipartite graph, wherein the first mathematical planning instance comprises a first constraint vector, a first variable coefficient vector and a first relation matrix; generating a second bipartite graph according to the first bipartite graph by using a probability generation model; according to the second bipartite graph, data is filled according to the connection relation, a second mathematical planning instance is generated, and the data comprises data in at least one mathematical planning instance. According to the method, adaptive generation and augmentation are carried out on the mathematical programming problem by adopting the probability generation model, and a test instance set meeting the quantity requirement and the same distribution requirement is provided for adjustment and optimization of a solver.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims the priority of the Chinese patent application filed with the China Patent Office on June 14, 2023, with application number 202310722532.5 and application name “A method, system and electronic device for generating mathematical programming instances”, the entire contents of which are incorporated by reference in this application. Technical Field

[0002] The present application relates to the field of cloud computing, and in particular to a method, system and electronic device for generating a mathematical programming instance. Background Art

[0003] Operations research mainly uses mathematical methods to study the optimization paths and solutions of various systems, and provides decision makers with a basis for scientific decision-making. Mathematical programming is an important branch of operations research. Its main research goal is to find the optimal solution that can minimize or maximize a function in a given area. The application of mathematical programming is extremely common. According to the nature of the problem and the difference in the treatment method, mathematical programming can be divided into many different branches, such as linear programming, integer programming, nonlinear programming, combinatorial optimization, multi-objective programming, stochastic programming, dynamic programming, parameter programming and other problems. These problems have a large number of applications in many fields such as supply chain, finance, transportation, and communications. In order to solve mathematical programming problems, the industry has developed special software systems for linear, integer, mixed integer and various nonlinear programming examples, namely mathematical programming solvers.

[0004] Mixed-integer linear programming (MILP) problem solving is the core of mathematical programming solvers. In many real-world scenarios, problems always have integer constraints, such as production scheduling, supply chain, production scheduling, factory location selection, etc. These problems can usually be modeled as mixed integer programming problems. The essence of solving MILP problems is to solve a series of linear programming problems to obtain the optimal solution. The core steps of MILP solving in commercial solvers are: (1) Presolve: delete redundant constraints and variables; (2) Relaxation: ignore integer conditions, and use the remaining objective function and constraints to form a linear programming problem. Use a linear programming solver to obtain the initial solution of the relaxed MILP problem; (3) Branch: select variables based on the initial solution to solve again; (4) Cut: generate a series of linear constraints based on the solution obtained after relaxation, and select a part of the linear constraints to add to the original problem to narrow the feasible domain of the solution.

[0005] When developing traditional solvers, as many test instances as possible are needed to cover the test code vulnerabilities to improve the stability of the solution. When training the solver's strategy learning (Learn to branch / Learn to cut, etc.), a large number of identically distributed test instances are needed to improve the generalization and robustness of the strategy. However, the current solver development technology has the problems of strong reliance on the experience of industry experts and operations optimization experts to build test instances, a small number of test instance models, and poor construction timeliness. New technologies and methods are needed to quickly and massively generate identically distributed mathematical programming instances. Summary of the invention

[0006] In order to solve the problems in the prior art, the embodiments of the present application provide a method, system and electronic device for generating mathematical programming instances, which can provide a set of test instances that meet the quantity requirements and the same distribution requirements for the tuning of the solver.

[0007] In a first aspect, an embodiment of the present application provides a method for generating a mathematical programming instance, the method for generating a mathematical programming instance comprising: obtaining at least one mathematical programming instance; converting a first mathematical programming instance in at least one mathematical programming instance into a first bipartite graph; the first mathematical programming instance comprises a first constraint vector, a first variable coefficient vector and a first relationship matrix; using a probabilistic generation model, generating a second bipartite graph according to the first bipartite graph; filling data according to the connection relationship according to the second bipartite graph to generate a second mathematical programming instance, the data comprising data in at least one mathematical programming instance.

[0008] In an embodiment of the present application, probability generation is a process of randomly masking the nodes in the first bipartite graph, determining the special value of the bipartite graph, sampling the features of each node through an encoder, predicting the probability of the possible value of each node based on the historical distribution of the value of each node, obtaining the potential value of each node, and generating a second bipartite graph through a decoder based on the potential value of each node and the special value of the bipartite graph.

[0009] In this way, the mathematical programming example of the embodiment of the present application is a mathematical modeling that performs business understanding and abstraction of the actual problem scenario, and has a certain data composition and relationship. In the mathematical programming solver optimization process, the embodiment of the present application adopts a probabilistic generation model to adaptively generate and augment the mathematical programming problem, which can effectively utilize the structural information of the existing mathematical programming instance, quickly generate a large number of instances with the same distribution as the original mathematical programming instance, and provide a test instance set that meets the quantity requirements and the same distribution requirements for the solver tuning.

[0010] In one possible implementation, the method further includes iteratively training a mathematical programming solver based on the first mathematical programming instance, the second mathematical programming instance, or a combination thereof; solving a target mathematical programming instance based on the trained mathematical programming solver, and outputting a solution result of the target mathematical programming instance.

[0011] The target mathematical programming instance can be received or newly input. In a preferred embodiment, it is a problem of the same type as the user. In other embodiments, it can also be a problem of a different type without limitation. In this way, the embodiment of the present application can generate a large number of identically distributed test instances to improve the generalization and robustness of the strategy. In a possible implementation, the method also includes a training step of a probability generation model: calculating the structural similarity between the second mathematical programming instance and the first mathematical programming instance; when the structural similarity is greater than a set first threshold, iteratively training the parameters of the probability generation model until the structural similarity meets the requirements of the first threshold, and obtaining a trained probability generation model.

[0012] In this way, the probability generation model of the embodiment of the present application can perform probability generation model optimization training for mathematical programming instances uploaded in batches by users together with historical mathematical programming instances stored on the platform. By calculating the structural similarity of mathematical programming problems, adaptive generation of test instances and data augmentation are achieved. The generated mathematical programming instance is isomorphic to the given mathematical programming instance, and supports instant tuning of offline / online solvers, which has a strong inspiration for downstream solver performance tuning tasks.

[0013] In a possible implementation, the method also includes a training step of a probability generation model: solving a first mathematical programming instance according to a mathematical programming solver to obtain a first solution difficulty; solving a second mathematical programming instance according to the mathematical programming solver to obtain a second solution difficulty; calculating the solution difficulty similarity between the second mathematical programming instance and the first mathematical programming instance according to the first solution difficulty and the second solution difficulty; when the solution difficulty similarity is greater than a set second threshold, iteratively training the parameters of the probability generation model until the solution difficulty similarity meets the requirements of the second threshold, thereby obtaining a trained probability generation model.

[0014] In this way, the probability generation model of the embodiment of the present application can perform probability generation model optimization training for mathematical programs uploaded in batches by users together with historical mathematical programs stored in the platform. By calculating the similarity of solution difficulty, the parameters in the probability generation model are iteratively adjusted to achieve adaptive generation of test instances and data augmentation. It supports real-time tuning of the probability generation model in offline / online states, which has a strong inspirational significance for downstream solver performance tuning tasks.

[0015] In one possible implementation, obtaining at least one mathematical programming instance specifically includes: receiving at least one mathematical programming instance input by a user; storing at least one mathematical programming instance in a mathematical programming model library; before filling data according to a connection relationship based on the second bipartite graph, the method also includes: obtaining data from the mathematical programming model library.

[0016] In this way, the given mathematical programming example of the embodiment of the present application may be stored in the mathematical model library, with a certain data structure and relationship. The mathematical programming models collected in the mathematical programming model library are augmented.

[0017] In one possible implementation, the first bipartite graph includes multiple constraint nodes in the first part, multiple variable coefficient nodes in the second part, and edges connecting the multiple constraint nodes in the first part and the multiple variable coefficient nodes in the second part. The first mathematical programming instance is converted into the first bipartite graph, including: determining the values ​​of the multiple constraint nodes in the first part according to the first constraint vector; determining the values ​​of the multiple variable coefficient nodes in the second part according to the first variable coefficient vector; and determining the values ​​of the edges connecting the multiple constraint nodes and the multiple variable coefficient nodes according to the first relationship matrix.

[0018] In this way, the embodiment of the present application maps the original mathematical programming instance into a bipartite graph form to facilitate subsequent probabilistic generation prediction and achieve augmentation.

[0019] In one possible implementation, a second bipartite graph is obtained by probabilistically generating the first bipartite graph, including: extracting a feature vector from the first bipartite graph through a graph convolutional network, the feature vector including features of each node in the first bipartite graph; randomly masking the nodes in the first bipartite graph to obtain a special value of the bipartite graph; sampling the features of each node in the feature vector through an encoder to predict the probability of the possible value of each node to obtain a potential value of each node; and probabilistically generating the second bipartite graph based on the potential value of each node and the special value of the bipartite graph through a decoder.

[0020] In this way, the probability generation model of the embodiment of the present application uses a graph convolutional network and an encoder-decoder to perform adaptive probability generation on mathematical programming instances.

[0021] In one possible implementation, a feature vector is extracted from the first bipartite graph through a graph convolutional network, and the feature vector includes features of each node in the first bipartite graph, including: inputting the first bipartite graph into the graph convolutional network to extract features of each node, embedding features of multiple constraint nodes and features of multiple variable coefficient nodes to obtain a feature vector, and outputting the feature vector.

[0022] In this way, the embodiment of the present application extracts feature values ​​of constraints and variables in graph form through a graph convolutional network to obtain a low-dimensional representation.

[0023] In one possible implementation, nodes in a first bipartite graph are randomly masked to obtain a bipartite graph special value, including: randomly selecting one of a plurality of constraint nodes as a mask node, replacing the edge connected to the mask node with a virtual edge, and setting the mask node and the virtual edge to special values ​​to obtain the bipartite graph special value.

[0024] In this way, the embodiment of the present application predicts nodes in the bipartite graph form through random masking to determine the recovery probability.

[0025] In one possible implementation, a decoder performs probability generation based on the potential value, bipartite graph special value and feature vector of each node to obtain a second bipartite graph, including: the decoder predicts a constraint probability value based on the features and potential value of the mask node, and the constraint probability value is used to indicate whether a second constraint node corresponding to the mask node exists.

[0026] In this way, the embodiment of the present application provides a decoder algorithm for predicting whether a second constraint node corresponding to a mask node exists.

[0027] In one possible implementation, a decoder performs probability generation based on the potential value of each node, the bipartite graph special value and the feature vector to obtain a second bipartite graph, including: the decoder predicts the degree based on the features and potential value of the mask node, and the degree is used to indicate the number of second variable coefficient nodes connected to the mask node.

[0028] Thus, embodiments of the present application provide a decoder algorithm that predicts the number of variable coefficient nodes that a mask node may be connected to.

[0029] In one possible implementation, a decoder performs probability generation based on the potential value of each node, the bipartite graph special value and the eigenvector to obtain a second bipartite graph, including: the decoder predicts a connection variable based on the eigenvector of the variable coefficient node and the potential value of each node, and the connection variable is used to indicate whether there is a connection relationship between the second variable coefficient node and the second constraint node corresponding to the mask node.

[0030] In this way, the embodiment of the present application provides a decoder algorithm for predicting whether a connection relationship exists between a variable coefficient node and a second constraint node corresponding to a mask node.

[0031] In one possible implementation, a decoder performs probability generation based on the potential value of each node, the bipartite graph special value and the feature vector to obtain a second bipartite graph, including: the decoder predicts the coefficient value based on the characteristics of the variable coefficient node and the potential value of each node, and the coefficient value is used to indicate the connection strength of the second constraint node corresponding to the second variable coefficient node and the mask node.

[0032] Thus, the embodiment of the present application provides a decoder algorithm for predicting the strength value of the connection relationship corresponding to the variable coefficient node and the mask node.

[0033] In a possible implementation, a decoder performs probability generation according to the potential value of each node, the bipartite graph special value and the eigenvector to obtain a second bipartite graph, including: the decoder performs probability generation according to the constraint probability value, the degree, the connection variable and the coefficient value to obtain the second bipartite graph; the constraint probability value is used to indicate whether the mask node exists; the degree is used to indicate the number of variable coefficient nodes connected to the mask node; the connection variable is used to indicate whether there is a connection relationship between the variable coefficient node and the mask node; the coefficient value is used to indicate the connection strength value between the variable coefficient node and the mask node.

[0034] Therefore, the embodiment of the present application provides a preferred decoder algorithm combination for probabilistically generating a second bipartite graph that is isomorphic and identically distributed to the first bipartite graph using multiple prediction results.

[0035] In one possible implementation, the method also includes: obtaining a solution performance indicator output by a mathematical programming solver, the solution performance indicator including a combination of one or more of the following indicators: solution time, solution result accuracy, number of solution branch nodes, and number of iterations; confirming that the solution performance indicator exceeds the resource limit of the mathematical programming solver, the resource limit of the mathematical programming solver includes time, computing power, and configuration data of user hardware; and stopping training the probability generation model.

[0036] In this way, the method of the embodiment of the present application can also take into account the actual situation of solver resource limitations during the data augmentation service process of solver tuning, and tune the parameters of the probability generation model according to the solver resource limitations.

[0037] In a possible implementation manner, before converting a first mathematical programming instance in at least one mathematical programming instance into a first bipartite graph, the method further includes: receiving a data augmentation request sent by a user.

[0038] In this way, the method of the embodiment of the present application adds a response interface for data augmentation, which can support check boxes, switch buttons, API configuration instructions, etc. to make data augmentation requests.

[0039] In the second aspect, the embodiment of the present application provides a device for generating a mathematical programming instance, and the device for generating a mathematical programming instance includes: a data acquisition module for acquiring at least one mathematical programming instance; a number-to-graph conversion module for converting a first mathematical programming instance in the at least one mathematical programming instance into a first bipartite graph, wherein the first mathematical programming instance includes a first constraint vector, a first variable coefficient vector, and a first relationship matrix. ; a probability generation model for generating a second bipartite graph according to the first bipartite graph; a graph-to-number conversion module for filling data according to the connection relationship according to the second bipartite graph to generate a second mathematical programming instance, wherein the data includes the data in the at least one mathematical programming instance. Its beneficial effects are as described in the first aspect and will not be repeated here.

[0040] In one possible implementation, the device also includes a solving module, which is used to iteratively train a mathematical programming solver based on the first mathematical programming instance, the second mathematical programming instance or a combination; solve a target mathematical programming instance based on the trained mathematical programming solver, and output a solution result of the target mathematical programming instance.

[0041] In a possible implementation, the device also includes a similarity calculation module, which calculates the structural similarity between the second mathematical programming instance and the first mathematical programming instance; when the structural similarity is greater than a set first threshold, iteratively trains the parameters of the probability generation model until the structural similarity of the second mathematical programming instance output by the probability generation model meets the requirements of the first threshold, thereby obtaining a trained probability generation model.

[0042] In a possible implementation, the device also includes a similarity calculation module, which obtains a first solution difficulty according to a solution result of the first mathematical programming instance solved by the solver; obtains a second solution difficulty according to a solution result of the second mathematical programming instance solved by the solver; calculates the similarity of solution difficulty between the second mathematical programming instance and the first mathematical programming instance according to the first solution difficulty and the second solution difficulty; when the solution difficulty similarity is greater than a set second threshold, iteratively trains the parameters of the probability generation model until the solution difficulty similarity of the second mathematical programming instance output by the probability generation model meets the requirements of the second threshold, thereby obtaining a trained probability generation model.

[0043] In a third aspect, an embodiment of the present application provides a system for generating a mathematical programming instance, the system comprising a data enhancement interface, a device for generating a mathematical programming instance, an operations research optimization platform, and a mathematical programming solver; the data enhancement interface is used to send data augmentation requirements for tuning the mathematical programming solver; the device for generating a mathematical programming instance, in response to the data augmentation requirements for tuning the mathematical programming solver, executes a method as described in any one of the first aspects to provide a test instance set that meets the quantity requirements and the same distribution requirements for the tuning of the solver; the operations research optimization platform is used to configure and tune the mathematical programming solver according to the test instance set so that the solution result of the mathematical programming solver converges; the mathematical programming solver is used to solve a target mathematical programming instance and output the solution result of the target mathematical programming instance.

[0044] In one possible implementation, the operations research optimization platform saves the desensitized data of the target mathematical programming instance, the test instance set, and the solution result file.

[0045] In a fourth aspect, an embodiment of the present application provides an electronic device, characterized in that it includes: at least one memory for storing programs; and at least one processor for executing programs stored in the memory, and when the program stored in the memory is executed, the processor is used to execute the method described in any embodiment of the first aspect.

[0046] In a fifth aspect, an embodiment of the present application provides a computer storage medium, in which instructions are stored. When the instructions are executed on a computer, the computer executes the method described in any embodiment of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions of the multiple embodiments disclosed in this specification, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only the multiple embodiments disclosed in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0048] The following is a brief introduction to the drawings required for describing the embodiments or prior art.

[0049] Figure 1 It is a flowchart of the use of the expert experience modeling method provided in the embodiment of the present application in an actual scenario;

[0050] Figure 2 It is a schematic diagram of the deployment and architecture of the mathematical programming example generation system provided in the embodiment of the present application;

[0051] Figure 3 A flowchart of a method for generating a mathematical programming example proposed in an embodiment of the present application;

[0052] Figure 4a It is a schematic diagram of bipartite graph transformation provided in an embodiment of the present application;

[0053] Figure 4b is a schematic diagram of a random mask provided in an embodiment of the present application;

[0054] Figure 4c is a schematic diagram of an encoder provided in an embodiment of the present application;

[0055] Figure 4d is a schematic diagram of a decoder provided in an embodiment of the present application;

[0056] Figure 5 A schematic diagram of an offline training process of a method for generating mathematical programming examples proposed in an embodiment of the present application;

[0057] Figure 6 A schematic diagram of an online training process of a method for generating mathematical programming examples proposed in an embodiment of the present application;

[0058] Figure 7 A flowchart of applying the method provided in Example 1 of the present application to a mathematical programming solver for performance tuning;

[0059] Figure 8 A flowchart of applying the method provided in Example 2 of the present application to a mathematical programming solver for performance tuning;

[0060] Fig. 9 It is a histogram of graph structure similarity results provided in an embodiment of the present application;

[0061] Fig.10 is a histogram of similarity measures of solution difficulty based on the SCIP solver provided in an embodiment of the present application;

[0062] Fig.11 It is a bar chart of similarity measurement of solution difficulty based on Gurobi solver provided in an embodiment of the present application;

[0063] Fig.12 A device for generating a mathematical programming example provided in an embodiment of the present application;

[0064] Fig.13 A computing device provided in an embodiment of the present application;

[0065] Fig.14 A computing device cluster is provided in an embodiment of the present application. DETAILED DESCRIPTION

[0066] In the description of the embodiments of the present application, words such as "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a concrete way.

[0067] In the description of the embodiments of the present application, the term "and / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the term "multiple" means two or more. For example, multiple systems refers to two or more systems, and multiple terminals refers to two or more terminals.

[0068] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprises", "has" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.

[0069] In the description of the embodiments of the present application, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0070] In the description of the embodiments of the present application, the terms "first\second\third, etc." or module A, module B, module C, etc. are only used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that the specific order or sequence can be interchanged where permitted so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0071] Relevant terms involved in the embodiments of this application:

[0072] Operation research and optimization: Operation research is a new interdisciplinary subject developed in the 1930s and 1940s. It mainly studies the use and planning of various resources by human beings, in order to maximize the benefits of limited resources and achieve the overall optimal goal under certain constraints.

[0073] Mathematical programming: Mathematical programming is an important branch of operations research. Its main research goal is to find the optimal solution that can minimize or maximize a function in a given area. Mathematical programming can be divided into many different branches, such as linear programming, integer programming, nonlinear programming, combinatorial optimization, multi-objective programming, stochastic programming, dynamic programming, parameter programming and other problems.

[0074] Linear programming: Linear programming is an important branch of operations research that has been studied earlier, developed faster, and has been widely used and matured. It is a mathematical method that assists people in scientific management. It is a mathematical theory and method for studying the extreme value problem of linear objective functions under linear constraints.

[0075] Mixed integer linear programming: Mixed integer linear programming refers to linear programming problems in which some decision variables are restricted to integers.

[0076] Mathematical programming solver: A software system that solves established linear, integer, mixed integer, and various nonlinear programming models.

[0077] A generative model is a model that can generate observations randomly, especially given some implicit parameters. It assigns a joint probability distribution to the observed and labeled data sequences. In machine learning, generative models can be used to model data directly, such as sampling data based on the probability density function of a variable, or to establish conditional probability distributions between variables. Conditional probability distributions can be formed by generative models according to Bayes' theorem.

[0078] In the description of the embodiments of the present application, the numbers representing the steps, such as S11, S12, etc., do not necessarily mean that the steps will be executed in this manner. If permitted, the order of the previous and next steps can be interchanged, or they can be executed simultaneously.

[0079] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0080] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0081] One of the methods for generating mathematical programming instances is the construction generation method, the core idea of ​​which is to obtain the right-hand side term vector and the target variable coefficient vector of the constraints in the mathematical programming instance through random sampling technology. Based on the obtained right-hand side term vector and the target variable coefficient vector, the constraint coefficients in the mathematical programming instance are obtained by solving the equation to generate a complete mathematical programming instance. The disadvantage of the construction generation method is that it requires solving equations and the construction cost is relatively high; in addition, it is impossible to use the structural information of the existing mathematical programming instance to generate the same source instance; in addition, the difficulty of the generated mathematical programming instance is uncontrollable.

[0082] The second method of generating mathematical programming examples is expert experience modeling, such as Figure 1 As shown in the figure, based on the understanding and abstraction of actual problems by business experts and operations optimization experts, the mathematical programming model is established using modeling language, actual business data is filled in, and a complete mathematical programming instance is generated. Then the solver is called to optimize the mathematical programming model, and the results are obtained to guide the key decision-making process such as generating operations.

[0083] The shortcoming of the expert experience modeling method is that it relies heavily on expert experience and business data. In actual scenarios, it is often limited by factors such as information security and cannot obtain a large amount of business data, resulting in a small number of mathematical programming examples generated by this method.

[0084] In view of the defects of the above two methods, the embodiments of the present application propose a method, device and system for generating mathematical programming instances, which adopt an encoder-decoder to adaptively generate and augment the data of mathematical programming instances to support the tuning of the downstream mathematical programming solver solution service; at the same time, the graph structure similarity and the solution difficulty similarity are calculated to generate mathematical programming instances.

[0085] The method provided in the embodiment of the present application can effectively utilize the structural information of existing mathematical programming instances, quickly generate a large number of instances with the same distribution as the original mathematical programming instances, and achieve great similarity in terms of the two indicators of graph structure similarity and solution difficulty similarity.

[0086] In the mathematical programming solver optimization process, the embodiment of the present application adds a data enhancement interface to support the solver to use the enhanced data for online or offline optimization / configuration, and starts offline / online tuning of the data enhancement method by triggering the corresponding interface switch; based on the mathematical programming instance graph structure and the similarity of the solution difficulty, stronger data enhancement is achieved.

[0087] Figure 2 The schematic diagram of the deployment and architecture of the mathematical programming example generation system provided in the embodiment of the present application. Figure 2As shown, in this system, a mathematical programming solver 21 (hereinafter referred to as the solver) and a device 22 for generating mathematical programming instances are deployed on an operations research and optimization platform 23 (model arts); the operations research and optimization platform 23 provides a data enhancement interface for users.

[0088] Among them, the data enhancement interface can be a digital switch, button, check box or API configuration instruction set for the user. By the user selecting a digital switch, clicking a button or checking a check box or sending an API configuration instruction, the data augmentation service provided by the device 22 for generating mathematical programming instances is called to realize interactive data transmission.

[0089] One of the specific usage scenarios of the system for generating mathematical programming examples proposed in the embodiment of the present application is as follows:

[0090] The solver 21 solves the mathematical programming instance for the business data uploaded by the user, obtains the solution result, and returns it to the user; after receiving the solution result, the user determines whether the solver needs to be tuned based on the solution performance index of the solver 21. The solution performance index includes the accuracy of the solution result, stability, solution time, number of solution branch nodes, number of iterations, etc. When one or more indicators do not meet the requirements, the user can send the data augmentation requirements for solver tuning through the data enhancement interface; the device 22 for generating mathematical programming instances responds to the data augmentation requirements for solver tuning, and the configuration management module 221 configures the various parameters of the probability generation model according to the acquired original mathematical programming instance, executes the mathematical programming instance generation method 222 provided in the embodiment of the present application, generates a new mathematical programming instance, and provides a test instance that meets the quantity requirements and the same distribution requirements for the solver tuning; the operations optimization platform 23 stores and manages the newly generated mathematical programming instances, the original mathematical programming instances, the solution result files and the desensitized business data to form a test instance set, and provides a storage service 24 (OBS). The solver is configured and tuned according to the test instance set, so that the solving performance indicators of the solver 21 meet the requirements of high accuracy, good stability, fast solving speed, small number of branch nodes, and small number of iterations.

[0091] The second specific use scenario of the system for generating mathematical programming examples proposed in the embodiment of the present application is as follows: the solver 21 solves the business problem (mathematical programming example) uploaded each time, obtains the solution result, and returns it to the user; the user predicts similar new problems that the solver 21 may face in the future for the current business problem or historical business problem. In order to improve the computing index of the solver 21 facing these new problems in the future, the data augmentation requirements of the solver tuning are sent through the data enhancement interface; the device 22 for generating mathematical programming examples responds to the data augmentation requirements of the solver tuning, executes the mathematical programming example generation method provided in the embodiment of the present application, generates new mathematical programming examples, and provides test examples that meet the quantity requirements and the same distribution requirements for the tuning of the solver; the operations optimization platform 23 stores and manages the newly generated mathematical programming examples, the original mathematical programming examples, the solution result files and the desensitized mathematical programming examples to form a test instance set. According to the test instance set, the solver is configured and tuned so that the solving performance of the solver 21 when encountering new problems in the future can meet the index requirements.

[0092] The mathematical programming instance generation system provided in the embodiment of the present application adds a data enhancement interface for users in the mathematical programming solver optimization process, supports the solver to use the enhanced instances for online or offline optimization / configuration, and realizes enhanced solution performance.

[0093] The above is the introduction to the system architecture and application scenarios of the mathematical programming example generation provided by the embodiment of the present application. Next, based on the above content, the method for generating the mathematical programming example provided by the embodiment of the present application is introduced. Among them, the relevant introduction of the concepts, units, etc. involved in the following content can be found in the above text.

[0094] The method for generating a mathematical programming instance proposed in an embodiment of the present application includes: obtaining at least one mathematical programming instance; converting a first mathematical programming instance in the at least one mathematical programming instance into a first bipartite graph, wherein the first mathematical programming instance includes a first constraint vector, a first variable coefficient vector, and a first relationship matrix; using a probabilistic generation model to generate a second bipartite graph based on the first bipartite graph; filling data according to the connection relationship based on the second bipartite graph to generate a second mathematical programming instance, wherein the data includes data in the at least one mathematical programming instance.

[0095] The following is a description of the steps of the method for generating a mathematical programming example proposed in the embodiment of the present application in combination with a flowchart and a specific embodiment.

[0096] Figure 3 This is a flowchart of the method for generating a mathematical programming example proposed in the embodiment of the present application. It can be understood that the method can be executed by any model, device, platform, or device cluster with computing and processing capabilities. Figure 3 As shown, the method for generating the mathematical programming instance may include:

[0097] S31, obtaining at least one mathematical programming instance.

[0098] In the embodiment of the present application, the at least one mathematical programming instance may be one or more mathematical programming instances stored and managed by the operations optimization platform 23 .

[0099] The mathematical programming instance (A, b, c) is obtained by the system through the specified modeling language after receiving the business data uploaded by the user and importing the business data into the established mathematical programming model, for example:

[0100] argmin x c T x subject to Ax≤b; l≤x≤u; x∈Z P ×R n-p ; (1)

[0101] This example can be described as: Find the variable c T x has a minimum vector x, and the values ​​of c and x are subject to the constraints "Ax ≤ b; l ≤ x ≤ u; x∈Z P ×R n-p ”, where c∈R n , is the coefficient vector of the target variable; b∈R m , is the right-hand side vector of the constraint; l,u∈R n , are lower and upper variable boundaries; p≤n, is an integer variable; Z is an integer; R is a real number; A∈R m ×n , is the mutual influence (or restriction) relationship matrix between c and b, A = c × b, and A is obtained by solving the equation based on the determined right-hand side term vector b and the target variable coefficient vector c.

[0102] The established mathematical programming model may be a structure stored in the mathematical model library based on the business understanding and abstract modeling of business data by business experts and operations research experts; or it may be a structure of a constructed and generated mathematical programming instance.

[0103] S32, converting a first mathematical programming instance in the at least one mathematical programming instance into a bipartite graph representation (BGR), wherein the first mathematical programming instance includes a first constraint vector, a first variable coefficient vector, and a first relationship matrix.

[0104] A mathematical programming instance (A, b, c) can be recorded as the first mathematical programming instance; the right-hand side term vector b of the constraint is recorded as the first constraint vector, the target variable coefficient vector c is recorded as the first variable coefficient vector, and A is recorded as the first relationship matrix. It can be understood that the first mathematical programming instance includes the first constraint vector, the first variable coefficient vector and the first relationship matrix, and the first relationship matrix is ​​determined according to the mutual influence relationship between the first constraint vector and the first variable coefficient vector; the first constraint vector and the first variable coefficient vector are determined by the business data uploaded by the user.

[0105] The bipartite graph includes a plurality of constraint nodes in the first part, a plurality of variable coefficient nodes in the second part, and edges connecting the plurality of constraint nodes in the first part and the plurality of variable coefficient nodes in the second part. The bipartite graph at this time can be denoted as the first bipartite graph

[0106] In an embodiment of the present application, the values ​​of multiple constraint nodes of the first part can be determined according to the first constraint vector; the values ​​of multiple variable coefficient nodes of the second part can be determined according to the first variable coefficient vector; and the values ​​of the edges connecting multiple constraint nodes and multiple variable coefficient nodes can be determined according to the first relationship matrix.

[0107] like Figure 4a As shown, by filling the relationship matrix A of the first mathematical programming instance (A, b, C) according to the connection relationship, the first plurality of nodes v1…v m Corresponding to the first constraint vector b1…b m , multiple nodes w1…w in the second part n Corresponding to the first variable coefficient vector c1…c n The connection relationship between the first part and the second part is determined by the value of A_ij in the first relationship matrix, and the first bipartite graph is obtained. For example, A_ij=0, then v i With w j There is no connecting edge between them; A_ij>0, then v i With w j There are connected edges between them, and the value of A_ij is the connection strength value of the edge.

[0108] S33, using the probability generation model, to generate a second bipartite graph according to the first bipartite graph.

[0109] In the embodiment of the present application, the probability generation model includes a graph convolutional network, an encoder and a decoder, and the probability generation can be performed by following the steps S331-S334:

[0110] S331, extracting a feature vector from the first bipartite graph through a graph convolutional network, where the feature vector includes features of each node in the first bipartite graph.

[0111] In the embodiment of the present application, the first bipartite graph can be input into a graph convolutional network (GNN), and the graph convolutional network (GNN) embeds each node in the first and second parts, and outputs a feature vector The feature vector includes the low-dimensional representation information of each node:

[0112] S332, randomly mask the nodes in the first bipartite graph to obtain special values ​​of the bipartite graph.

[0113] like Figure 4b As shown, the first bipartite graph can be randomly selected One of the multiple nodes in the first part v i As a mask node Mask node v i The connected edge A_ij is replaced with a virtual edge, and the values ​​represented by the mask nodes and virtual edges are set to special values: in is the masked bipartite graph representation, with special values To set the value, the recoverability probability of the masked bipartite graph is given.

[0114] S333, the encoder samples the features of each node in the feature vector, and predicts the probability of the possible value of each node according to the historical distribution of the value of each node, so as to obtain the potential value of each node.

[0115] In one possible implementation, the encoder may be a variational autoencoder.

[0116] like Figure 4c As shown, the encoder encodes the feature vector of each node in the first bipartite graph Perform sampling encoding to predict the probability of possible values ​​for each node Get the potential value Z of each node: The encoder can be expressed as:

[0117]

[0118] S334, performing probability generation according to the potential value of each node and the special value of the bipartite graph through a decoder to obtain a second bipartite graph.

[0119] In one possible implementation, the decoder may be a variational self-decoder.

[0120] Through the decoder according to the special value of the first bipartite graph The potential representation of each node Predict right-hand side vector degree Connection variables and connection weights Generate the second bipartite graph. This decoder can be expressed as:

[0121]

[0122] like Figure 4d As shown, the decoder in step S334 includes the following algorithms S3341-S3345:

[0123] S3341, based on the characteristics of the mask node and potential value Prediction constraint probability value The constraint probability value is used to indicate whether the second constraint node corresponding to the mask node exists. The constraint prediction algorithm is:

[0124]

[0125] The value of is used to predict the possibility of mask node recovery. It indicates that it is irreversible and the constraint node corresponding to the mask node in the second bipartite graph does not exist.

[0126] S3342, based on the characteristics of the mask node and potential representation Prediction degree The degree is used to indicate the number of second variable coefficient nodes connected to the mask node. The algorithm for degree prediction is:

[0127]

[0128] degree The value of indicates how many second variable coefficient nodes are connected to the existing second constraint nodes.

[0129] S3343, according to the characteristic h of the first variable coefficient node w and the potential representation z w , predicting the connection variable The algorithm for link variable prediction is:

[0130]

[0131] Connection variables The value of the first variable coefficient node h w and mask nodes Is there any connection? No connection; There is a connection.

[0132] S3344, based on the characteristic h of the first variable coefficient node w and the potential representation z w, prediction coefficient value The algorithm for coefficient value prediction is:

[0133]

[0134] Coefficient value Node h indicating the second part w Connection strength with mask nodes, coefficient value The larger the value, the stronger the connection strength, and the value of the corresponding edge is the coefficient value

[0135] S3345, based on the predicted constraint probability value degree Connection variables and coefficient values Generate and obtain the second bipartite graph.

[0136] Specifically, the predicted constraint probability value degree Connection variables and coefficient values Generate the second bipartite graph.

[0137] S34, fill in data according to the connection relationship based on the second bipartite graph, determine the second relationship matrix A', the right-hand term vector b' of the second constraint and the second variable coefficient vector c', and obtain the second mathematical programming instance (A', b', c'), and the data includes data in at least one mathematical programming instance.

[0138] It is understandable that, since the values ​​of the second constraint node, the second variable coefficient node, and the edges between multiple second constraint nodes and multiple second variable coefficient nodes of the second bipartite graph have changed, when filling data according to the new connection relationship A', the mathematical programming instance provided by the current business data may not be sufficient to fully fill the second mathematical programming instance. In this case, the mathematical programming instance provided by the historical data stored in the platform can be referenced to fill the second mathematical programming instance, so as to generate instances to cover the test code vulnerabilities as much as possible, thereby improving the stability of the solver. It should be noted that the historical data stored on the platform is desensitized data, so that data filling across professional fields can be achieved.

[0139] In the case where the probability generation model is a pre-trained model, the similarity between the generated second mathematical programming instance and the first mathematical programming instance meets the threshold requirement. The similarity includes structural similarity and solution difficulty similarity.

[0140] The probability generation model training method in the method for generating mathematical programming examples provided in the embodiment of the present application can be learned by methods including but not limited to variational autoencoders, adversarial generation, etc.

[0141] Figure 5 The following is a schematic diagram of the training process of the method for generating mathematical programming examples proposed in the embodiment of the present application. Figure 5 As shown, the probability generation model training process can be performed offline, including the following steps:

[0142] S501, determine the first training model from the mathematical programming model library, fill the training set data into the first training model, and obtain the first training instance. S502, input the first training instance into the probability generation model to generate the second training instance. The generation process can refer to steps S302-S307.

[0143] In some implementations, the filling data of the second training instance includes training set data and historical data.

[0144] S503, calculating the graph structure error of the two instances according to the first training instance and the second training instance to obtain the structural similarity.

[0145] Graph structure errors include clustering errors of graph nodes, connection degree errors, coefficient density errors, etc.

[0146] S504, calling the solver 21 to solve the first training instance to obtain a first training solution result, and calling the solver 21 to solve the second training instance to obtain a second training solution result.

[0147] S505: Calculate the similarity of solution difficulty between the first training instance and the second training instance according to the performance indicators of the solvers corresponding to the first training instance and the second training instance.

[0148] The difficulty similarity can be calculated by the following steps:

[0149] S5051, counting the first performance indicators corresponding to the solver's solution time, the number of branch nodes solved, or the number of iterations in the first training instance solution process; counting the second performance indicators corresponding to the solver's solution time, the number of branch nodes solved, or the number of iterations in the second training instance solution process.

[0150] S5052: Obtain solution difficulty similarity according to the difference between the first performance indicator and the second performance indicator.

[0151] S506: if the structural similarity or solution difficulty similarity between the first training instance and the second training instance does not meet the threshold requirement, execute S507; otherwise, if the structural similarity and / or solution difficulty similarity between the first training instance and the second training instance meets the threshold requirement, execute S508;

[0152] S507, respectively tune the parameters of the graph convolutional network (GNN), encoder, and decoder in the probability generation model, and iteratively execute S502-S506;

[0153] S508, stop training and obtain a trained probability generation model.

[0154] The method for generating mathematical programming instances provided in the embodiments of the present application trains the probability generation model in a data-driven manner, augments the mathematical programming models collected in the mathematical programming model library, and obtains more mathematical programming instances with similar structures and similar solving difficulties; thereby enabling downstream solver development and (including machine learning) tuning, and further releasing the solver performance potential. In one achievable implementation, the similarity between the second mathematical programming instance generated in step S307 and the first mathematical programming instance may not meet the same distribution requirement, and the probability generation model also needs to perform optimization training of the probability generation model in real time for the mathematical programming instances uploaded in batches by users and the historical mathematical programming instances stored on the platform. Figure 6 As shown, the process can be performed online or offline and includes the following steps:

[0155] S601, calculating the graph structure error of the two instances according to the first mathematical programming instance and the second mathematical programming instance to obtain the structural similarity.

[0156] S602, calling the solver 21 to solve the first mathematical programming instance to obtain a first solution result, and calling the solver 21 to solve the second mathematical programming instance to obtain a second solution result.

[0157] S603: Calculate the similarity of solution difficulty between the first mathematical programming instance and the second mathematical programming instance according to the performance indicators of the solvers corresponding to the first mathematical programming instance and the second mathematical programming instance.

[0158] The difficulty similarity can be calculated by the following steps:

[0159] S6031, counting first performance indicators corresponding to the solver's solution time, the number of solved branch nodes, or the number of iterations in the process of solving the first mathematical programming instance.

[0160] The second performance index corresponding to the solver's solution time, the number of solved branch nodes or the number of iterations in the second mathematical programming instance solution process is counted.

[0161] S6032: Obtain solution difficulty similarity according to the difference between the first performance indicator and the second performance indicator.

[0162] S604: When the structural similarity or solution difficulty similarity between the first mathematical programming instance and the second mathematical programming instance does not meet the threshold requirement, execute S605; otherwise, when the structural similarity and / or solution difficulty similarity between the first performance indicator and the second mathematical programming instance meet the threshold requirement, execute S606.

[0163] S605, respectively adjust the parameters of the graph convolutional network (GNN), encoder and decoder in the probability generation model, and iteratively execute S301-S307, and S601-S604.

[0164] S606, stop training, and obtain a trained probability generation model. The second mathematical programming instance generated based on the trained probability generation model has a similarity with the first mathematical programming instance that meets the threshold requirement.

[0165] The embodiment of the present application provides a method for generating a mathematical programming instance. During the optimization training process of a probability generation model, the method instantly calculates the graph structure similarity and the solution difficulty similarity, and iteratively adjusts the parameters in the probability generation model, so that the generated mathematical programming instance maintains the same structure and distribution as the given mathematical programming instance in real time, which has a strong inspiration for the downstream solver performance tuning task.

[0166] In some achievable implementations, the process of training the probability generation model may also include: obtaining the solution performance index output by the solver; the solution performance index includes a combination of one or more of the following indicators: solution time, solution result accuracy, number of solution branch nodes, and number of iterations; judging whether the solution performance index exceeds the resource limit of the solver; the resource limit of the solver includes time, computing power, and configuration data of the user's hardware; determining that the solution performance index reaches or exceeds the resource limit of the solver to stop training. Computing power refers to computing power, that is, the ability of various processors such as CPU, GPU, TPU, FPGA, ASIC, etc. to perform data operations per second based on computer servers, high-performance computing clusters, various smart terminals, and other carrier devices. The configuration data of the user's hardware includes chip model, memory size, etc.

[0167] Example 1

[0168] Embodiment 1 of the present application provides an application scenario of a method for generating a mathematical programming instance, in which the solver 21 is tuned for its solving performance index. During the solving service process, the user calls the method for generating a mathematical programming instance, and uses the enhanced mathematical programming instance to configure and tune the solver, so that the solver can provide accurate and efficient solving services.

[0169] Figure 7The flowchart of the mathematical programming solver for performance tuning provided in Example 1 of the present application. It can be understood that the method can be executed by any instance, device, platform, or device cluster with computing and processing capabilities. In addition, some or all steps of the mathematical programming generation method can refer to the aforementioned Figure 2-Figure 5 For example, Figure 7 As shown, the following steps are included:

[0170] S71, receiving current business data uploaded by the user.

[0171] S72, the expert understands and abstracts the current business data, uses the modeling language to establish a mathematical programming model, fills in the current business data, and generates an original mathematical programming instance.

[0172] S73, saving the original mathematical programming instance to a mathematical programming model library.

[0173] S74, the user determines whether the original mathematical programming model in the mathematical programming model library needs data augmentation based on the solving performance index of the solver 21; if data augmentation is required, execute steps S75-S76; otherwise, data augmentation is not required, execute step S77.

[0174] Solving performance indicators include solution accuracy, stability, solution time, number of solution branch nodes, number of iterations, etc. If one or more indicators do not meet the requirements, users can send data augmentation requirements for solver tuning through the data augmentation interface.

[0175] The data enhancement interface can be a digital switch, button, check box or API configuration instruction set for the user. The user selects a digital switch, clicks a button, checks a check box or sends an API configuration instruction, and calls the data augmentation service provided by the device 22 for generating mathematical programming instances to realize interactive data transmission.

[0176] S75, calling the method for generating a mathematical programming instance, generating a new mathematical programming instance for the original mathematical programming instance. The method includes an offline training state and an online reasoning state. The training state can refer to all the implementation methods of steps S501-S508, and the reasoning state can refer to all the implementation methods of steps S301-S307, and S601-S606. The original mathematical programming instance is the first mathematical programming instance, and the new mathematical programming instance is the second mathematical programming instance.

[0177] S76, configure and tune the solver 21 according to the first mathematical programming instance and the second mathematical programming instance, call the tuned solver 21 to solve the current business data, and execute S78.

[0178] S77, configuring the solver 21 according to the first mathematical programming instance, and calling the solver 21 to solve the current business data.

[0179] S78, determine whether the solution exceeds the resource limit of the solver based on the solution result and the solution performance index output by the solver 21. If the solution performance index does not exceed the resource limit of the solver, execute S79; otherwise, if the solution performance index exceeds the resource limit of the solver, return to execute S75-S77.

[0180] The resource constraints of the solver include time, computing power, and configuration data of the user's hardware configuration, etc. S79, obtaining a solution result.

[0181] Example 2

[0182] Embodiment 2 of the present application provides an application scenario of a method for generating a mathematical programming instance. In this application scenario, similar new problems that the solver 21 may face in the future are predicted for problems related to current business data or historical business data. In order to improve the computational indicators of the solver 21 facing these new problems in the future, the user adds a data enhancement interface to the optimization process of the mathematical programming solver, calls the method for generating a mathematical programming instance through the data enhancement interface, and uses the enhanced mathematical programming instance to configure and optimize the solver 21 so that the solver can provide accurate and efficient solution services.

[0183] Figure 8 The flowchart of the mathematical programming solver for performance tuning provided in Example 2 of the present application. It can be understood that the method can be executed by any instance, device, platform, or device cluster with computing and processing capabilities. In addition, some or all steps of the mathematical programming generation method can refer to the aforementioned Figure 2-Figure 6 For example, Figure 8 As shown, the following steps are included:

[0184] S81, receiving current business data uploaded by the user.

[0185] S82, experts understand and abstract the current business data, use modeling language to build a mathematical programming model, fill in the actual business data, and generate an original mathematical programming instance.

[0186] S83, saving the original mathematical programming instance to the mathematical programming model library.

[0187] S84, the user predicts the type of approximate problems that may occur in the future based on the problems involved in the current business data or historical business data, and based on this, sends the data augmentation requirements for solver tuning through the data enhancement interface.

[0188] S85, the processor calls the method for generating a mathematical programming instance, and generates a new mathematical programming instance for the original mathematical programming instance. Reference may be made to all implementation methods of steps S301-S307, and S601-S606. The original mathematical programming instance is the first mathematical programming instance, and the new mathematical programming instance is the second mathematical programming instance.

[0189] S86: Configure and tune the solver 21 according to the first mathematical programming instance and the second mathematical programming instance. In the future, call the tuned solver 21 to solve the encountered business data.

[0190] S87, calling solver 21 to solve the new business data.

[0191] S88, judging whether the resource limit of the solver is exceeded according to the solution result and the solution performance index output by the solver 21.

[0192] The resource limits of the solver include time limits, computing power, and user configuration limits, etc. If the solving performance index does not exceed the resource limit of the solver, execute S89; otherwise, if the solving performance index exceeds the resource limit of the solver, return to execute S85-S77.

[0193] S89, obtain the solution result.

[0194] The embodiments of the present application support the solver to use the enhanced data for online or offline optimization / configuration. By using a generation method based on existing mathematical programming instances, the performance indicators of the solver on the specified type of mathematical programming instance problems can be specifically improved.

[0195] The embodiment of the present application selects experimental data sets according to different difficulties, including simple difficulty and medium difficulty.

[0196] Simple difficulty: Use artificially generated set cover (Setcover, 500 constraints, 1000 variables) and maximum independent set (max independent set, MIS,: 4 affinity set, 500 nodes) data sets.

[0197] Medium difficulty: Use open source knapsack problem datasets, such as MIK; real datasets for building grizzly bear wildlife corridors, such as CORLAT.

[0198] Other schemes involved in the comparison include: 1) a generation method based on construction (bowly); 2) a generation method based on random sampling; 3) an embodiment of the present application using different mask ratios.

[0199] The test indicators include structural similarity and solution difficulty similarity, among which the solution difficulty similarity can use Gurobi and SCIP solvers as the solution performance indicator similarity.

[0200] The results of the graph structure similarity test are as follows Fig. 9 As shown, after experimental observation, in terms of graph structure similarity index, the method proposed in the embodiment of the present application exceeds 64% on the three data sets of MIS, SetCover, and MIK, significantly surpassing the construction-based generation method (Bowly) and the random sampling-based generation method.

[0201] Solve the difficulty similarity test as Fig.10 and 11 As shown, after experimental observation, from the perspective of solution difficulty similarity, the instances generated by the method proposed in the embodiment of the present application can obtain the minimum solution difficulty error under both solvers, with the minimum error being 0.2% and the maximum error being 71.3%; while the instances generated by the Bowly and random sampling-based generation methods have a very large error range in solution difficulty similarity, which is very different from the original mathematical programming model instances.

[0202] Fig.12 A device for generating a mathematical programming example is provided for the embodiment of the present application. Fig.12 As shown, in response to the requirements of data augmentation for solver tuning, the device 22 for generating a mathematical programming instance includes: a data acquisition module 121, for acquiring at least one mathematical programming instance; a number-to-graph conversion module 122, for converting a first mathematical programming instance in at least one mathematical programming instance into a first bipartite graph, wherein the first mathematical programming instance includes a first constraint vector, a first variable coefficient vector, and a first relationship matrix; a probability generation model 123, for generating a second bipartite graph based on the first bipartite graph; and a graph-to-number conversion module 124, for filling data according to the connection relationship based on the second bipartite graph to generate a second mathematical programming instance, wherein the data includes data in at least one mathematical programming instance.

[0203] The probability generation model 123 includes a graph convolutional network, which is used to extract a feature vector for the first bipartite graph, and the feature vector includes the features of each node in the first bipartite graph; a masker, which is used to randomly mask the nodes in the first bipartite graph to obtain a special value of the bipartite graph; an encoder, which is used to sample the features of each node in the feature vector, predict the probability of the possible value of each node, and obtain the potential value of each node; and a decoder, which is used to generate according to the potential value of each node and the special value of the bipartite graph to obtain a second bipartite graph.

[0204] In some possible implementations, the device also includes: a solution module, which iteratively trains a mathematical programming solver based on the first mathematical programming instance, the second mathematical programming instance or a combination; solves a target mathematical programming instance based on the trained mathematical programming solver, and outputs a solution result of the target mathematical programming instance.

[0205] In some possible implementations, the device for generating a mathematical programming instance provided in an embodiment of the present application further includes a similarity calculation module, which calculates the structural similarity between the second mathematical programming instance and the first mathematical programming instance; when the structural similarity is greater than a set first threshold, iteratively trains the parameters of the probability generation model until the structural similarity of the second mathematical programming instance output by the probability generation model meets the requirements of the first threshold, thereby obtaining a trained probability generation model.

[0206] In some possible implementations, the similarity calculation module also obtains a first solution difficulty based on a solution result of the first mathematical programming instance solved by the solver; obtains a second solution difficulty based on a solution result of the second mathematical programming instance solved by the solver; calculates the solution difficulty similarity between the second mathematical programming instance and the first mathematical programming instance based on the first solution difficulty and the second solution difficulty; and when the solution difficulty similarity is greater than a set second threshold, iteratively trains the parameters of the probability generation model until the solution difficulty similarity of the second mathematical programming instance output by the probability generation model meets the requirements of the second threshold, thereby obtaining a trained probability generation model.

[0207] It should be understood that the above-mentioned device is used to execute the method for generating mathematical programming instances in the above-mentioned embodiment. The implementation principle and technical effects of the corresponding program modules in the device are similar to those described in the above-mentioned method. The working process of the device can refer to the corresponding process in the above-mentioned method and will not be repeated here.

[0208] In some embodiments, Fig.12 The data acquisition module 121, the digital-to-image conversion module 122, the probability generation model 123, and the image-to-digital conversion module 124 shown in the figure can all be implemented by software or by hardware. Fig.12 Taking the probability generation model 123 shown in as an example, the implementation method of the acquisition module probability generation model 123 is introduced.

[0209] As an example of a software functional unit, the probability generation model 123 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the probability generation model 123 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code can be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code can be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with close geographical locations. Among them, usually a region can include multiple AZs.

[0210] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.

[0211] As an example of a hardware functional unit, the probability generation model 123 may include at least one computing device, such as a server, etc. Alternatively, the probability generation model 123 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0212] The multiple computing devices included in the probability generation model 123 can be distributed in the same region or in different regions. The multiple computing devices included in the probability generation model 123 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the probability generation model 123 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0213] It should be noted that, in other embodiments, Fig.12 The steps implemented by the data acquisition module 121, the digital-to-image conversion module 122, the probability generation model 123, and the image-to-image conversion module 124 shown in the figure can be specified as needed, and the above steps are implemented by the data acquisition module 121, the digital-to-image conversion module 122, the probability generation model 123, and the image-to-image conversion module 124 respectively. Figure 3 The different steps in the method provided in the embodiment can realize the full functions of the device 22 for generating mathematical programming instances.

[0214] The present application also provides a computing device 1000. Fig.13 As shown, computing device 1000 includes: bus 1002, processor 1004, memory 1006 and communication interface 1008. Processor 1004, memory 1006 and communication interface 1008 communicate through bus 1002. Computing device 1000 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in computing device 1000.

[0215] The bus 1002 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.13 The bus 1004 may include a path for transmitting information between various components of the computing device 1000 (eg, the memory 1006, the processor 1004, and the communication interface 1008).

[0216] The processor 1004 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0217] The memory 1006 may include a volatile memory, such as a random access memory (RAM). The processor 104 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0218] The memory 1006 stores executable program codes, and the processor 1004 executes the executable program codes to respectively implement the aforementioned Fig.12 The functions of the probability generation model 123 and the data acquisition module 121 shown in the embodiment are implemented to realize all or part of the steps of the method in the above embodiment. That is, the memory 1006 stores instructions for executing all or part of the steps in the method in the above embodiment.

[0219] Alternatively, the memory 1006 stores executable codes, and the processor 1004 executes the executable codes to respectively implement the functions of the configuration migration device 1000, thereby implementing all or part of the steps in the above embodiment method. That is, the memory 1006 stores instructions for executing all or part of the steps in the above embodiment method.

[0220] The communication interface 1008 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 1000 and other devices or a communication network.

[0221] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device 1000. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.

[0222] like Fig.14As shown, the computing device cluster includes at least one computing device 1000. The memory 1006 in one or more computing devices 1000 in the computing device cluster may store the same instructions for executing all or part of the steps in the above embodiment method.

[0223] In some possible implementations, the memory 1006 of one or more computing devices 1000 in the computing device cluster may also store partial instructions for executing all or part of the steps in the above-mentioned embodiment method. In other words, the combination of one or more computing devices 1000 may jointly execute instructions for executing all or part of the steps in the above-mentioned embodiment method.

[0224] It should be noted that the memory 1006 in different computing devices 1000 in the computing device cluster may store different instructions, which are respectively used to execute part of the functions of the apparatus 22 for generating mathematical programming instances. That is, the instructions stored in the memory 1006 in different computing devices 1000 may implement the aforementioned Fig.12 The functions of one or more modules among the data acquisition module 121, the digital-to-image conversion module 122, the probability generation model 123, and the image-to-digital conversion module 124 shown in FIG.

[0225] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network.

[0226] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.

[0227] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method in the above embodiment.

[0228] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.

Claims

1. A method for generating a mathematical programming instance, characterized in that: The method for generating the mathematical programming instance comprises: Obtain at least one mathematical programming instance; Converting a first mathematical programming instance in the at least one mathematical programming instance into a first bipartite graph; the first mathematical programming instance includes a first constraint vector, a first variable coefficient vector and a first relationship matrix; Using a probabilistic generation model, generating a second bipartite graph according to the first bipartite graph; Filling data according to the connection relationship according to the second bipartite graph to generate a second mathematical programming instance, wherein the data includes data in the at least one mathematical programming instance.

2. The method according to claim 1, characterized in that The method further comprises: Iteratively training a mathematical programming solver based on the first mathematical programming instance, the second mathematical programming instance, or a combination thereof; Based on the trained mathematical programming solver, a target mathematical programming instance is solved, and a solution result of the target mathematical programming instance is output.

3. The method according to claim 1 or 2, characterized in that: The method also includes a step of training the probability generation model: Calculating the structural similarity between the second mathematical programming instance and the first mathematical programming instance; When the structural similarity is greater than a set first threshold, the parameters of the probability generation model are iteratively trained until the structural similarity meets the requirement of the first threshold, thereby obtaining a trained probability generation model.

4. The method according to claim 1 or 2, characterized in that: The method also includes a step of training the probability generation model: Solving the first mathematical programming instance according to the mathematical programming solver to obtain a first solution difficulty; Solving the second mathematical programming instance according to the mathematical programming solver to obtain a second solution difficulty; Calculating the similarity of the solution difficulty of the second mathematical programming instance and the first mathematical programming instance according to the first solution difficulty and the second solution difficulty; When the solution difficulty similarity is greater than a set second threshold, the parameters of the probability generation model are iteratively trained until the solution difficulty similarity meets the requirement of the second threshold, thereby obtaining a trained probability generation model.

5. The method according to any one of claims 1 to 4, characterized in that: The obtaining of at least one mathematical programming instance specifically includes: receiving at least one mathematical programming instance input by a user; Storing the at least one mathematical programming instance in a mathematical programming model library; Before filling data according to the connection relationship according to the second bipartite graph, the method further includes: Acquire the at least one mathematical programming instance from the mathematical programming model library; The data is obtained based on the at least one mathematical programming instance.

6. The method according to claim 5, characterized in that The first bipartite graph includes a plurality of constraint nodes of the first part, a plurality of variable coefficient nodes of the second part, and edges connecting the plurality of constraint nodes of the first part and the plurality of variable coefficient nodes of the second part, and converting the first mathematical programming instance into the first bipartite graph includes: determining values ​​of a plurality of constraint nodes of the first part according to the first constraint vector; Determining values ​​of a plurality of variable coefficient nodes of the second part according to the first variable coefficient vector; The values ​​of the edges connecting the plurality of constraint nodes and the plurality of variable coefficient nodes are determined according to the first relationship matrix.

7. The method according to any one of claims 1 to 6, characterized in that: The step of probabilistically generating a second bipartite graph according to the first bipartite graph includes: A feature vector is extracted from the first bipartite graph through a graph convolutional network, and the feature vector includes features of each node in the first bipartite graph; the nodes in the first bipartite graph are randomly masked to obtain a special value of the bipartite graph; the features of each node in the feature vector are sampled by an encoder to predict the probability of possible values ​​of each node to obtain a potential value of each node; and a decoder is used to generate probabilities based on the potential value of each node and the special value of the bipartite graph to obtain a second bipartite graph.

8. The method according to claim 7, characterized in that The method of performing probability generation according to the potential value of each node, the bipartite graph special value and the feature vector by a decoder to obtain a second bipartite graph includes: The decoder performs probability generation according to the constraint probability value, the degree, the connection variable and the coefficient value to obtain a second bipartite graph; The constraint probability value is used to indicate whether a mask node exists; the degree is used to indicate the number of variable coefficient nodes connected to the mask node; the connection variable is used to indicate whether there is a connection relationship between the variable coefficient node and the mask node; the coefficient value is used to indicate the connection strength between the variable coefficient node and the mask node.

9. The method according to any one of claims 2 to 8, characterized in that: The method further comprises: Obtaining a solution performance index output by the mathematical programming solver, wherein the solution performance index includes a combination of one or more of the following indicators: solution time, solution result accuracy, number of solution branch nodes, and number of iterations; Confirming that the solution performance indicator exceeds the resource limit of the mathematical programming solver, the resource limit of the mathematical programming solver includes time, computing power and configuration data of user hardware; Stop training the probabilistic generative model.

10. The method according to any one of claims 1 to 9, characterized in that: Before converting the first mathematical programming instance in the at least one mathematical programming instance into a first bipartite graph, the method further comprises: Receive data augmentation requests sent by users.

11. A device for generating mathematical programming examples, characterized in that: The device for generating the mathematical programming example comprises: A data acquisition module, used for acquiring at least one mathematical programming instance; A mathematical-graph conversion module, configured to convert a first mathematical programming instance in the at least one mathematical programming instance into a first bipartite graph; the first mathematical programming instance includes a first constraint vector, a first variable coefficient vector and a first relationship matrix; A probabilistic generation model, used for generating a second bipartite graph according to the first bipartite graph; A graph-to-number conversion module is used to fill in data according to the connection relationship of the second bipartite graph to generate a second mathematical programming instance, wherein the data includes data in the at least one mathematical programming instance.

12. The device according to claim 11, characterized in that The device also includes: A solving module, configured to iteratively train a mathematical programming solver based on the first mathematical programming instance, the second mathematical programming instance, or a combination thereof; Based on the trained mathematical programming solver, a target mathematical programming instance is solved, and a solution result of the target mathematical programming instance is output.

13. The device according to claim 11 or 12, characterized in that The device also includes a similarity calculation module, which calculates the structural similarity between the second mathematical programming instance and the first mathematical programming instance; when the structural similarity is greater than a set first threshold, iteratively trains the parameters of the probability generation model until the structural similarity of the second mathematical programming instance output by the probability generation model meets the requirement of the first threshold, thereby obtaining a trained probability generation model.

14. A system for generating mathematical programming examples, characterized in that: The system includes a data enhancement interface, a device for generating mathematical programming examples, an operations research optimization platform and a mathematical programming solver; Data augmentation interface, used to send data augmentation requirements for mathematical programming solver tuning; A device for generating mathematical programming instances, in response to a data augmentation requirement for tuning the mathematical programming solver, executing a method as described in any one of claims 1 to 10 to provide a set of test instances that meet quantity requirements and same distribution requirements for tuning the solver; The operations research optimization platform is used to configure and tune the mathematical programming solver according to the test instance set so that the solution result of the solver converges; The mathematical programming solver is used to solve the target mathematical programming instance and output the solution result of the target mathematical programming instance.

15. The system according to claim 14, characterized in that The operations research optimization platform stores the desensitized data of the target mathematical programming instance, the test instance set and the solution result file.

16. An electronic device, characterized in that: include: at least one memory for storing a program; At least one processor is used to execute the program stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method according to any one of claims 1 to 10.

17. A computer storage medium, wherein instructions are stored in the computer storage medium, and when the instructions are executed on a computer, the computer executes the method according to any one of claims 1 to 10.