Method and system for generating mathematical programming instance, and electronic device
Adaptive generation and data augmentation of mathematical planning instances through the probability generation model, solving the problems of insufficient number of test instances and low construction efficiency in the existing technology, and achieving rapid generation of same-distributed instances, improving the performance and stability of the solver sex.
Patent Information
- Application Number
- PCT/CN2024/077498
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-19
- Filing Date
- 2024-02-19
- Publication Date
- 2024-12-19
AI Technical Summary
In the development of existing mathematical planning solvers, there are problems such as insufficient number of test instances, poor construction efficiency and dependence on industry experts' experience, and it is difficult to quickly and large-scale generate mathematical planning instances with the same distribution.
Use probability generation model to convert mathematical planning instances into two-part graphs, predict node features through graph convolution network and encoder-decoder, generate new mathematical planning instances, and use structural similarity and solution difficulty similarity for adaptation. Generate and data augmentation, providing a set of test instances with the same distribution.
It realizes the rapid generation of a large number of mathematical planning examples 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.
Smart Images

Figure CN2024077498_19122024_PF_FP_ABST
Abstract
Description
A method, system and electronic device for generating mathematical programming examples Technical Field
[0001] The present application relates to the field of cloud computing, and in particular to a method, system, and electronic device for generating mathematical programming instances. Background Art
[0002] Operations research primarily uses mathematical methods to study optimization approaches and solutions for various systems, providing decision makers with a basis for scientific decision-making. Mathematical programming is an important branch of operations research, and 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. Depending on the nature of the problem and the difference in the approach, 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, parametric programming, and other problems. These problems have a large number of applications in various fields such as supply chain, finance, transportation, and communications. To solve mathematical programming problems, the industry has developed specialized software systems, namely mathematical programming solvers, for linear, integer, mixed integer, and various nonlinear programming examples.
[0003] Solving mixed-integer linear programming (MILP) problems is the core of mathematical programming solvers. In many real-world scenarios, problems often involve integer constraints, such as production scheduling, supply chain management, production scheduling, and factory location selection. These problems can usually be modeled as mixed-integer programming problems. Solving MILP problems essentially involves solving a series of linear programming problems to obtain the optimal solution. The core steps of MILP solving in commercial solvers are: (1) Presolve: removing redundant constraints and variables; (2) Relaxation: ignoring integer conditions, constructing a linear programming problem based on the remaining objective function and constraints, and using a linear programming solver to obtain the initial solution to the relaxed MILP problem; (3) Branching: selecting variables based on the initial solution and resolving; (4) Cutting: generating a series of linear constraints based on the solution obtained after relaxation, and selecting a portion of these linear constraints to add to the original problem to narrow the feasible domain.
[0004] When developing traditional solvers, as many test cases as possible are required to cover code vulnerabilities and improve solution stability. When training the solver's strategy learning (e.g., learn to branch / learn to cut), a large number of identically distributed test cases are required to improve strategy generalization and robustness. However, current solver development technology relies heavily on the experience of industry experts and operations research experts to construct test cases, resulting in a relatively small number of test case models and poor timeliness. New technologies and methods are needed to rapidly and massively generate identically distributed mathematical programming examples.
[0005] 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 comprising a first constraint vector, a first variable coefficient vector, and a first relationship matrix; using a probabilistic generation model, generating a second bipartite graph based on the first bipartite graph; filling data according to a connection relationship based on the second bipartite graph to generate a second mathematical programming instance, wherein the data comprises 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 based on the potential value of each node and the special value of the bipartite graph through a decoder.
[0009] In this way, the mathematical programming examples of the embodiments of the present application are mathematical models that are completed by business understanding and abstraction of actual problem scenarios, and have a certain data structure and relationship. In the mathematical programming solver optimization process, the embodiments of the present application use a probabilistic generation model to adaptively generate and augment mathematical programming problems. This can effectively utilize the structural information of existing mathematical programming examples and quickly generate a large number of instances with the same distribution as the original mathematical programming examples, providing a test instance set that meets the quantity requirements and the same distribution requirements for 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, thereby 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 instances are isomorphic to the given mathematical programming instances, supporting 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 based on 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 strong inspiration 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 the at least one mathematical programming instance in a mathematical programming model library; before filling data according to the 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 can 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. Converting the first mathematical programming instance into the first bipartite graph includes: determining values of the multiple constraint nodes in the first part according to the first constraint vector; determining values of the multiple variable coefficient nodes in the second part according to the first variable coefficient vector; and determining values of 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, where the feature vector includes features of each node in the first bipartite graph; randomly masking the nodes in the first bipartite graph to obtain a bipartite graph special value; 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 bipartite graph special value 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 characteristic values of constraints and variables in the form of graphs 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 multiple constraint nodes as a mask node, replacing the edges connected to the mask node with virtual edges, and setting the mask node and the virtual edges to special values to obtain the bipartite graph special value.
[0024] In this way, the embodiment of the present application performs node prediction on the bipartite graph through random masking to determine the recovery probability.
[0025] In one possible implementation, a decoder generates a probability 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 the second constraint node corresponding to the mask node exists.
[0026] Thus, 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, bipartite graph special value and feature vector of each node 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, an 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 characteristic 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 variable coefficient node and the second constraint node corresponding to 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 one possible implementation, a decoder performs probability generation based on the potential value, bipartite graph special value and eigenvector of each node to obtain a second bipartite graph, including: the decoder performs probability generation based on the constraint probability value, degree, connection variable and 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 an optimal 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 further 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, before converting the first mathematical programming instance in the at least one mathematical programming instance into the 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 a second aspect, an embodiment of the present application provides a device for generating a mathematical programming instance, comprising: 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, the first mathematical programming instance comprising a first constraint vector, a first variable coefficient vector, and a first relationship matrix; a probability generation model for generating a second bipartite graph based on the first bipartite graph; and a graph-to-number conversion module for populating data according to a connection relationship in the second bipartite graph to generate a second mathematical programming instance, the data comprising the data in the at least one mathematical programming instance. The beneficial effects thereof are as described in the first aspect and are not further elaborated here.
[0040] In one possible implementation, the device also includes a solution module for 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.
[0041] In one 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, the parameters of the probability generation model are iteratively trained 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 one possible implementation, the device also includes a similarity calculation module, which 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 similarity of the solution difficulty of the second mathematical programming instance with that of 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.
[0043] In a third aspect, an embodiment of the present application provides a system for generating mathematical programming instances, the system comprising a data enhancement interface, a device for generating mathematical programming instances, an operations 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 mathematical programming instances, 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 quantity requirements and identical distribution requirements for tuning the solver; the operations 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 the target mathematical programming instance and output the solution result of the target mathematical programming instance.
[0044] In one possible implementation, the operations 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 the programs stored in the memory. 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 following will briefly introduce the drawings required for the description of the embodiments. 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 any creative work.
[0048] The following is a brief introduction to the drawings required for describing the embodiments or prior art.
[0049] FIG1 is a flowchart of the use of the expert experience modeling method provided in an embodiment of the present application in an actual scenario;
[0050] FIG2 is a schematic diagram of the deployment and architecture of a mathematical programming example generation system provided in an embodiment of the present application;
[0051] FIG3 is a flow chart of a method for generating a mathematical programming example according to an embodiment of the present application;
[0052] FIG4a is a schematic diagram of bipartite graph transformation provided by an embodiment of the present application;
[0053] FIG4 b is a schematic diagram of a random mask provided in an embodiment of the present application;
[0054] FIG4c is a schematic diagram of an encoder provided in an embodiment of the present application;
[0055] FIG4 d is a schematic diagram of a decoder provided in an embodiment of the present application;
[0056] FIG5 is 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] FIG6 is 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] FIG7 is a flow chart of the method provided in Example 1 of the present application applied to performance tuning of a mathematical programming solver;
[0059] FIG8 is a flow chart of the method provided in Example 2 of the present application applied to performance tuning of a mathematical programming solver;
[0060] FIG9 is a histogram of graph structure similarity results provided in an embodiment of the present application;
[0061] FIG10 is a histogram of similarity measures of solution difficulty based on the SCIP solver provided in an embodiment of the present application;
[0062] FIG11 is a histogram of similarity measures of solution difficulty based on the Gurobi solver according to an embodiment of the present application;
[0063] FIG12 is a device for generating a mathematical programming example provided in an embodiment of the present application;
[0064] FIG13 is a computing device provided in an embodiment of the present application;
[0065] FIG14 is a computing device cluster 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 construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary," "for example," or "for example" is intended to present the relevant concepts in a concrete manner.
[0067] In the description of the embodiments of this application, the term "and / or" is simply a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent the following three situations: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the term "plurality" means two or more. For example, "multiple systems" refers to two or more systems, and "multiple terminals" refers to two or more terminals.
[0068] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly identifying the technical features being referred to. Thus, features specified as "first" or "second" may explicitly or implicitly include one or more of such features. The terms "include," "comprising," "having," 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] Related terms involved in the embodiments of this application:
[0072] Operations research and optimization: Operations research is an emerging interdisciplinary discipline that developed in the 1930s and 1940s. It primarily studies how humans utilize and manage various resources, aiming to maximize the benefits of limited resources and achieve overall optimization while meeting certain constraints.
[0073] Mathematical programming: Mathematical programming is a key branch of operations research. Its primary goal is to find the optimal solution that minimizes or maximizes a function within a given region. 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, and parametric programming.
[0074] Linear programming: Linear programming is a key branch of operations research that has been studied early, developed rapidly, and is widely used with mature methods. 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 a linear programming problem 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, typically given certain implicit parameters. It assigns a joint probability distribution to a sequence of observations and labeled data. In machine learning, generative models can be used to directly model data, for example, by sampling data based on the probability density function of a variable, or to construct conditional probability distributions across variables. Conditional probability distributions can be formed from generative models using 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 must 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 commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only 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 with reference to the accompanying drawings.
[0081] One method for generating mathematical programming instances is the generation-by-construction method. Its core concept is to obtain the right-hand-side term vectors of the constraints and the target variable coefficient vectors in the mathematical programming instance through random sampling techniques. Based on these right-hand-side term vectors and target variable coefficient vectors, the constraint coefficients in the mathematical programming instance are obtained by solving equations, thus generating a complete mathematical programming instance. However, the generation-by-construction method has the following drawbacks: it requires solving equations, resulting in a high construction cost; it cannot leverage the structural information of existing mathematical programming instances to generate similar instances; and the difficulty of the generated mathematical programming instances is uncontrollable.
[0082] A second method for generating mathematical programming examples is expert experience modeling, as shown in Figure 1. Based on the understanding and abstraction of the actual problem by business experts and operations optimization experts, a mathematical programming model is established using a modeling language, populated with actual business data, and a complete mathematical programming example is generated. A solver is then called to optimize the mathematical programming model, and the results are used to guide key decision-making processes such as operational decisions.
[0083] The drawback 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 response to the shortcomings of the above two methods, the embodiments of the present application propose a method, device and system for generating mathematical programming instances, which uses an encoder-decoder to adaptively generate and augment 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 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 and quickly generate a large number of instances with the same distribution as the original mathematical programming instances; and achieve high similarity in terms of the two indicators of graph structure similarity and solution difficulty similarity.
[0086] In the embodiment of the present application, a data enhancement interface is added to the optimization process of the mathematical programming solver to support the solver to use the enhanced data for online or offline optimization / configuration. By triggering the corresponding interface switch, the data enhancement method is started for offline / online tuning; based on the similarity of the mathematical programming instance graph structure and the solution difficulty, stronger data enhancement is achieved.
[0087] Figure 2 is a schematic diagram of the deployment and architecture of the mathematical programming example generation system provided in an embodiment of the present application. As shown in Figure 2, in this system, a mathematical programming solver 21 (hereinafter referred to as the solver) and a device 22 for generating mathematical programming examples are deployed on an operations optimization platform 23 (model arts); the operations 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 indicators of the solver 21. The solution performance indicators include 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 original mathematical programming instance obtained, 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 instance, the original mathematical programming instance, the solution result file 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 case 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 based on 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 requirement of the solver tuning is sent through the data enhancement interface; the device 22 for generating mathematical programming examples responds to the data augmentation requirement of the solver tuning, executes the mathematical programming example generation method provided in the embodiment of the present application, generates a new mathematical programming example, and provides a test example that meets the quantity requirement and the same distribution requirement for the solver tuning; the operations optimization platform 23 stores and manages the newly generated mathematical programming example, the original mathematical programming example, the solution result file and the desensitized mathematical programming example to form a test example set. The solver is configured and tuned according to the test example set 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, supporting the solver to use the enhanced instances for online or offline optimization / configuration to achieve enhanced solution performance.
[0093] The above is an 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 above.
[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 describes 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 specific embodiments.
[0096] FIG3 is a flow chart of a method for generating a mathematical programming instance according to an embodiment of the present application. It is understood that the method can be executed by any model, device, platform, or device cluster with computing and processing capabilities. As shown in FIG3 , the method for generating a 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: argmin x c T x subject to Ax≤b;l≤x≤u;x∈Z P ×R n-p ; (1)
[0100] This example can be described as: Find the variable c T x has a minimum vector x, and the values of c and x obey 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 number; 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 vector b and the target variable coefficient vector c.
[0101] The established mathematical programming model may be a structure stored in a mathematical model library based on business understanding and abstract modeling of business data by business experts and operations research experts; or it may be a structure of a constructed mathematical programming instance.
[0102] S32: Convert a first mathematical programming instance in the at least one mathematical programming instance into a bipartite graph representation (BGR), where the first mathematical programming instance includes a first constraint vector, a first variable coefficient vector, and a first relationship matrix.
[0103] A mathematical programming instance (A, b, c) can be denoted as the first mathematical programming instance; the right-hand side constraint vector b is denoted as the first constraint vector, the target variable coefficient vector c is denoted as the first variable coefficient vector, and A is denoted 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. The first relationship matrix is determined based on the mutual influence 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.
[0104] The 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 bipartite graph at this time can be denoted as the first bipartite graph
[0105] In an embodiment of the present application, the values of multiple constraint nodes in the first part can be determined based on the first constraint vector; the values of multiple variable coefficient nodes in the second part can be determined based on the first variable coefficient vector; and the values of the edges connecting multiple constraint nodes and multiple variable coefficient nodes can be determined based on the first relationship matrix.
[0106] As shown in FIG4a, by filling the relationship matrix A of the first mathematical programming instance (A, b, C) according to the connection relationship, the multiple 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.
[0107] S33: Using the probabilistic generation model, generate a second bipartite graph based on the first bipartite graph.
[0108] 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 the following steps S331-S334:
[0109] 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.
[0110] 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:
[0111] S332, randomly mask the nodes in the first bipartite graph to obtain a special value of the bipartite graph.
[0112] As shown in Figure 4b, 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 by 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, special value To set the value, the recoverability probability of the masked bipartite graph is given.
[0113] S333, sampling the features of each node in the feature vector through the encoder, predicting the probability of the possible value of each node based on the historical distribution of the value of each node, and obtaining the potential value of each node.
[0114] In one possible implementation, the encoder may be a variational autoencoder.
[0115] As shown in Figure 4c, 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:
[0116] 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.
[0117] In one possible implementation, the decoder may be a variational autodecoder.
[0118] Through the decoder according to the special value of the first bipartite graph The potential representation of each node Predicted right-hand side vector degree Connection variables and connection weights Generate the second bipartite graph. This decoder can be expressed as:
[0119] As shown in FIG4d , the decoder in step S334 includes the following algorithms S3341-S3345:
[0120] 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:
[0121] The value of is used to predict the possibility of mask node recovery. Indicates irrecoverability, the constraint node corresponding to the mask node in the second bipartite graph does not exist.
[0122] 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:
[0123] degree The value of indicates how many second variable coefficient nodes are connected to the existing second constraint nodes.
[0124] S3343, according to the characteristic h of the first variable coefficient node w and the potential representation z w , predicting the connection variable
[0125] 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.
[0126] 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:
[0127] Coefficient value Node h indicating the second part wConnection 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
[0128] S3345, based on the predicted constraint probability value degree Connection variables and coefficient values Generate and obtain the second bipartite graph.
[0129] Specifically, the predicted constraint probability value can be degree Connection variables and coefficient values Generate the second bipartite graph.
[0130] 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.
[0131] 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, which can achieve data filling across professional fields.
[0132] When 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.
[0133] 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 using methods including but not limited to variational autoencoders, adversarial generation, etc.
[0134] Figure 5 is a schematic diagram of the training process of the method for generating mathematical programming examples proposed in an embodiment of the present application. As shown in Figure 5, the probability generation model training process can be performed offline, including the following steps:
[0135] S501: Determine a first training model from a mathematical programming model library and populate the first training model with training data to generate a first training instance. S502: Input the first training instance into a probability generation model to generate a second training instance. The generation process can be found in steps S302-S307.
[0136] In some implementations, the filling data of the second training instance includes training set data and historical data.
[0137] S503 , calculating the graph structure error of the two instances based on the first training instance and the second training instance to obtain the structural similarity.
[0138] Graph structure errors include clustering errors of graph nodes, connection degree errors, coefficient density errors, etc.
[0139] 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.
[0140] S505 : Calculate the similarity of solution difficulty between the first training instance and the second training instance based on the performance indicators of the solvers corresponding to the first training instance and the second training instance.
[0141] The difficulty similarity can be calculated by the following steps:
[0142] S5051, counting the first performance indicators corresponding to the solver's solution time, number of solved branch nodes, or number of iterations in the first training instance solution process; counting the second performance indicators corresponding to the solver's solution time, number of solved branch nodes, or number of iterations in the second training instance solution process.
[0143] S5052: Obtain solution difficulty similarity based on the difference between the first performance indicator and the second performance indicator.
[0144] 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 meet the threshold requirement, execute S508;
[0145] S507, respectively tune the parameters of the graph convolutional network (GNN), encoder, and decoder in the probabilistic generation model, and iteratively execute S502-S506;
[0146] S508, stop training and obtain the trained probability generation model.
[0147] The method for generating mathematical programming instances provided in the embodiment of the present application trains a 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 difficulty in solving; thereby enabling downstream solver development and (including machine learning) tuning, and further releasing the solver performance potential. In a feasible 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. As shown in Figure 6, the process can be performed online or offline, and includes the following steps:
[0148] 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.
[0149] 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.
[0150] S603: Calculate the similarity of solution difficulty between the first mathematical programming instance and the second mathematical programming instance based on the performance indicators of the solvers corresponding to the first mathematical programming instance and the second mathematical programming instance.
[0151] The difficulty similarity can be calculated by the following steps:
[0152] S6031 , counting first performance indicators corresponding to the solver's solution time, the number of solved branch nodes, or the number of iterations during the process of solving the first mathematical programming instance.
[0153] Second performance indicators corresponding to the solver, such as the solution time, the number of solved branch nodes, or the number of iterations, in the process of solving the second mathematical programming instance are counted.
[0154] S6032: Obtain solution difficulty similarity based on the difference between the first performance indicator and the second performance indicator.
[0155] In step S604, if 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, step S605 is executed; otherwise, if the structural similarity and / or solution difficulty similarity between the first performance indicator and the second mathematical programming instance meet the threshold requirement, step S606 is executed.
[0156] S605, adjust the parameters of the graph convolutional network (GNN), encoder and decoder in the probability generation model respectively, and iteratively execute S301-S307, and S601-S604.
[0157] S606: Stop training to 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 a threshold requirement.
[0158] An embodiment of the present application provides a method for generating mathematical programming instances. During the optimization training process of a probability generation model, by instantly calculating the graph structure similarity and the solution difficulty similarity, the parameters in the probability generation model are iteratively adjusted, 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 performance tuning task of the downstream solver.
[0159] In some feasible implementations, the process of training the probability generation model may further 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; determining 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; and stopping training when it is determined that the solution performance index reaches or exceeds the resource limit of the solver. 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 supporting devices. The configuration data of the user's hardware includes chip model, memory size, etc.
[0160] Example 1
[0161] Embodiment 1 of the present application provides an application scenario of a method for generating a mathematical programming instance. In this application scenario, the solver 21 is tuned based on its solution performance indicators. During the solver's solution 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 solution services.
[0162] FIG7 is a flowchart of the performance tuning of the mathematical programming solver provided in Example 1 of the present application. It is 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 relevant descriptions in the aforementioned FIG2-FIG5. As shown in FIG7, the following steps are included:
[0163] S71, receiving current business data uploaded by the user.
[0164] 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.
[0165] S73, saving the original mathematical programming instance to the mathematical programming model library.
[0166] 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.
[0167] Solver 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.
[0168] 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.
[0169] S75: Invoke a method for generating a mathematical programming instance to generate a new mathematical programming instance from the original mathematical programming instance. This method includes an offline training state and an online reasoning state. For the training state, refer to all implementations of steps S501-S508; for the reasoning state, refer to all implementations 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.
[0170] S76 , configuring and optimizing the solver 21 according to the first mathematical programming instance and the second mathematical programming instance, calling the optimized solver 21 to solve the current business data, and executing S78 .
[0171] S77 , configuring the solver 21 according to the first mathematical programming instance, and calling the solver 21 to solve the current business data.
[0172] S78, judge whether the resource limit of the solver is exceeded 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.
[0173] The resource constraints of the solver include time, computing power, and configuration data of the user's hardware configuration, etc. S79: Obtain the solution result.
[0174] Example 2
[0175] Example 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 involving current business data or problems involving 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 mathematical programming solver optimization process, 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.
[0176] FIG8 is a flowchart of the performance tuning of the mathematical programming solver provided in Example 2 of the present application. It is 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 relevant descriptions in the aforementioned FIG2-FIG6. As shown in FIG8, the following steps are included:
[0177] S81, receiving current business data uploaded by the user.
[0178] 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 the original mathematical programming instance.
[0179] S83, saving the original mathematical programming instance to the mathematical programming model library.
[0180] 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 augmentation interface.
[0181] At step S85, the processor invokes a method for generating a mathematical programming instance to generate a new mathematical programming instance from the original mathematical programming instance. For details, see 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.
[0182] S86: Configure and optimize the solver 21 according to the first mathematical programming instance and the second mathematical programming instance. In the future, call the optimized solver 21 to solve the encountered business data.
[0183] S87, calling the solver 21 to solve the new business data.
[0184] S88: Determine whether the resource limit of the solver is exceeded based on the solution result and the solution performance index output by the solver 21.
[0185] The solver's resource constraints include time limits, computing power, and user configuration limits. If the solver's performance index does not exceed the solver's resource constraints, S89 is executed. Otherwise, if the solver's performance index exceeds the solver's resource constraints, the process returns to S85-S77.
[0186] S89, obtain the solution.
[0187] The embodiments of the present application support the solver to use the enhanced data for online or offline optimization / configuration. By generating a method based on existing mathematical programming instances, the performance indicators of the solver on the specified type of mathematical programming instance problems can be improved in a targeted manner.
[0188] The embodiment of the present application selects experimental data sets according to different levels of difficulty, including easy and medium difficulty.
[0189] Simple difficulty: Use artificially generated set cover (Setcover, 500 constraints, 1000 variables) and maximum independent set (MIS, 4 affinity set, 500 nodes) data sets.
[0190] Medium difficulty: Use open source knapsack datasets, such as MIK; real datasets for building grizzly bear wildlife corridors, such as CORLAT.
[0191] Other schemes involved in the comparison include: 1) a construction-based generation method (bowly); 2) a generation method based on random sampling; 3) an embodiment of the present application using different mask ratios.
[0192] 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.
[0193] The results of the graph structure similarity test are shown in Figure 9. After experimental observation, in terms of the graph structure similarity index, the method proposed in the embodiment of the present application exceeds 64% on the three datasets of MIS, SetCover, and MIK, significantly surpassing the construction-based generation method (Bowly) and the random sampling-based generation method.
[0194] The solution difficulty similarity test is shown in Figures 10 and 11. 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.
[0195] FIG12 is an embodiment of the present application providing a device for generating a mathematical programming instance. As shown in FIG12 , in response to the data augmentation requirement of 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-graph conversion module 122 for converting a first mathematical programming instance in at least one mathematical programming instance into a first bipartite graph, the first mathematical programming instance including 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-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, the data including data in at least one mathematical programming instance.
[0196] 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.
[0197] In some possible implementations, the device further includes: a solution module that iteratively trains a mathematical programming solver based on the first mathematical programming instance, the second mathematical programming instance, or a combination thereof; solves a target mathematical programming instance based on the trained mathematical programming solver, and outputs a solution result of the target mathematical programming instance.
[0198] In some possible implementations, the apparatus 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, the parameters of the probability generation model are iteratively trained 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.
[0199] In some possible implementations, the similarity calculation module also obtains a first solution difficulty based on the solution result of the solver solving the first mathematical programming instance; obtains a second solution difficulty based on the solution result of the solver solving the second mathematical programming instance; 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; 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.
[0200] 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.
[0201] In some embodiments, the data acquisition module 121, the data-to-image conversion module 122, the probability generation model 123, and the image-to-data conversion module 124 shown in FIG12 can all be implemented via software or hardware. For example, the implementation of the probability generation model 123 of the acquisition module will be described below using the probability generation model 123 shown in FIG12 as an example.
[0202] As an example of a software functional unit, the probability generation model 123 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the 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 may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.
[0203] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.
[0204] As an example of a hardware functional unit, the probability generation model 123 may include at least one computing device, such as a server. Alternatively, the probability generation model 123 may be 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.
[0205] The multiple computing devices included in probability generation model 123 can be distributed in the same region or in different regions. The multiple computing devices included in probability generation model 123 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in probability generation model 123 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.
[0206] It should be noted that, in other embodiments, the steps implemented by the data acquisition module 121, the number-to-graph conversion module 122, the probability generation model 123, and the graph-to-number conversion module 124 shown in FIG12 can be specified as needed, and the data acquisition module 121, the number-to-graph conversion module 122, the probability generation model 123, and the graph-to-number conversion module 124 respectively implement different steps in the method provided in FIG3 above to realize all the functions of the device 22 for generating mathematical programming instances.
[0207] This application also provides a computing device 1000. As shown in Figure 13, computing device 1000 includes a bus 1002, a processor 1004, a memory 1006, and a communication interface 1008. Processor 1004, memory 1006, and communication interface 1008 communicate with each other via bus 1002. Computing device 1000 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in computing device 1000.
[0208] Bus 1002 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG13 shows only one line, but this does not imply a single bus or type of bus. Bus 1004 may include a path for transmitting information between various components of computing device 1000 (e.g., memory 1006, processor 1004, and communication interface 1008).
[0209] The processor 1004 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0210] The memory 1006 may include volatile memory, such as random access memory (RAM). The processor 104 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0211] Memory 1006 stores executable program code, which processor 1004 executes to implement the functions of probability generation model 123 and data acquisition module 121 shown in FIG. 12 , thereby implementing all or part of the steps of the method in the above-described embodiment. In other words, memory 1006 stores instructions for executing all or part of the steps of the method in the above-described embodiment.
[0212] Alternatively, the memory 1006 stores executable code, and the processor 1004 executes the executable code to respectively implement the functions of the configuration migration apparatus 1000, thereby implementing all or part of the steps in the above-described embodiment method. In other words, the memory 1006 stores instructions for executing all or part of the steps in the above-described embodiment method.
[0213] 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.
[0214] 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 smartphone.
[0215] As shown in Figure 14, 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.
[0216] 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-described method. In other words, the combination of one or more computing devices 1000 can jointly execute instructions for executing all or part of the steps in the above-described method.
[0217] It should be noted that the memory 1006 in different computing devices 1000 in the computing device cluster can store different instructions, each for executing part of the functions of the apparatus 22 for generating mathematical programming instances. In other words, the instructions stored in the memory 1006 in different computing devices 1000 can implement the functions of one or more of 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. 12 .
[0218] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network, which may be a wide area network or a local area network.
[0219] 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.
[0220] 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.
[0221] It will be understood that the various numerical numbers involved in the embodiments of the present application are merely distinctions for the convenience of description and are not intended 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: Get 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.
Citation Information
Patent Citations
Middle and primary school mathematics ability point defect minimum sample high-precision discovery method based on machine learning
CN112001536A
Pre-solving configuration method and device
CN116050522A
Machine learning planner for a physical system
EP3770820A1
Methods and systems for improved entity recognition and insights
US20190303371A1
Cited By
Unmanned aerial vehicle nest site selection planning method and system
CN120633953A
