Method for determining initial solution, and related device
By converting mathematical programming models into tensor codes and calculating similarity, reproducible initial solutions are obtained. Combining deterministic algorithms and offline optimization, the problems of low efficiency of deterministic algorithms and poor reproducibility of non-deterministic algorithms are solved, achieving efficient and reproducible initial solution acquisition and dataset optimization.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
- Filing Date
- 2025-07-31
- Publication Date
- 2026-05-07
AI Technical Summary
Existing deterministic algorithms have low solution efficiency and cannot meet users' requirements for solution time, while uncertain algorithms have high solution efficiency but poor reproducibility and cannot provide reproducible initial solutions.
The mathematical programming model is converted into tensor encoding by an encoder, the similarity with the preset model is calculated, the preset solution that meets the similarity condition is obtained as the target initial solution, and the deterministic algorithm is used to solve it. Combined with offline optimization of the preset dataset, the solution efficiency and reproducibility are improved.
It achieves efficient and reproducible initial solution acquisition, improves the solution efficiency of mathematical programming models, meets users' reproducibility requirements, and optimizes the quality of preset datasets.
Smart Images

Figure CN2025111676_07052026_PF_FP_ABST
Abstract
Description
A method for determining an initial solution and related equipment
[0001] This application claims priority to Chinese Patent Application No. 202411545136.0, filed with the State Intellectual Property Office of China on October 31, 2024, entitled “A Method for Determining an Initial Solution and Related Equipment”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of business processing technology, specifically to a method for determining an initial solution and related equipment. Background Technology
[0003] In application areas such as logistics, supply chain, energy, finance, and engineering, business problems can often be optimized using operations research. For example, business problems can often be abstracted into mathematical programming problems, and solved by constructing mathematical programming models to address practical business issues in the application domain, such as network flow optimization, logistics transportation, and production scheduling.
[0004] Currently, various solution algorithms have been developed to solve mathematical programming models corresponding to business problems. Generally speaking, commonly used solution algorithms can be divided into two types: deterministic algorithms and non-deterministic algorithms.
[0005] Uncertainty algorithms, while more efficient and easier to develop and design, struggle to meet users' reproducibility requirements. Deterministic algorithms, on the other hand, offer better reproducibility and facilitate problem location and repair, but generally suffer from low efficiency, making them less suitable for users' time constraints.
[0006] It is evident that there is an urgent need for a method that can be reproduced and yields a relatively high-quality initial solution. Summary of the Invention
[0007] This application provides a method for determining an initial solution, which can provide a suitable and reproducible initial solution for solving a mathematical programming model corresponding to a business problem, thereby effectively improving the solution efficiency of the mathematical programming model and meeting the user's reproducibility requirements. This application also provides corresponding apparatus, devices, computer-readable storage media, and computer program products.
[0008] The first aspect of this application provides a method for determining an initial solution. The method includes: acquiring information about a first mathematical programming model, the information of which indicates the first mathematical programming model to be solved; calculating the similarity between the first mathematical programming model and at least one preset mathematical programming model, each of which has a preset solution; and acquiring a target initial solution, the target initial solution being a preset solution of one of the preset mathematical programming models whose similarity to the first mathematical programming model satisfies a specified condition. The target initial solution is used to: determine the initial solution of the first mathematical programming model and solve the first mathematical programming model.
[0009] In the first aspect, the better preset solutions of one or more historical mathematical programming models in the business scenarios can be collected in advance by means such as uncertainty algorithms, so as to provide the better initial solutions corresponding to the mathematical programming models in different historical business scenarios, and avoid exposing the uncertainty of the solution results brought about by uncertainty algorithms to the user.
[0010] In this way, in practical applications, preset solutions corresponding to preset mathematical programming models that meet specified conditions in similarity with the first mathematical programming model can be obtained efficiently and quickly as one or more target initial solutions of the first mathematical programming model. This can provide users with reproducible and suitable initial solutions required by the first mathematical programming model corresponding to the current business, thereby effectively improving the solution efficiency of the mathematical programming model and meeting the user's reproducibility requirements.
[0011] In one possible implementation of the first aspect, calculating the similarity between a first mathematical programming model and at least one preset mathematical programming model includes: processing information of the first mathematical programming model through an encoder to obtain a first tensor code; calculating the similarity between the first tensor code and at least one preset tensor code, wherein any preset tensor code is obtained by encoding information of a preset mathematical programming model through an encoder, and any preset tensor code corresponds to a preset solution of a preset data programming model corresponding to the preset tensor code, and the target initial solution is the preset solution corresponding to the preset tensor code among at least one preset tensor code whose similarity with the first tensor code satisfies a specified condition.
[0012] In one possible implementation of the first aspect, the information of the mathematical programming model can be converted into tensor codes that are easy for computers to understand and process through an encoder, thereby effectively reflecting the business scenario corresponding to the mathematical programming model.
[0013] Based on this, information from one or more historical business scenarios' preset mathematical programming models can be pre-collected and converted into preset tensor encodings by an encoder to reflect the scenario feature information of the preset mathematical programming models in one or more historical business scenarios. In addition, better preset solutions of one or more historical business scenarios' preset mathematical programming models can be pre-collected through methods such as uncertainty algorithms to provide deterministic better initial solutions corresponding to mathematical programming models in different historical business scenarios, thereby avoiding the exposure of uncertainty in the solution results brought about by uncertainty algorithms to users.
[0014] In other words, the preset tensor encoding and its corresponding preset solution integrate the solution results of algorithms such as the uncertainty algorithm, avoids exposing the uncertainty of the solution results of the uncertainty algorithm to the user, and shields the inherent disadvantages of the uncertainty algorithm in commercial delivery.
[0015] In practical applications, an encoder can convert the information of the first mathematical programming model in the current business scenario into a first tensor code, which serves as the scenario feature information of the first mathematical programming model. Then, through vector encoding retrieval, a preset tensor code that meets a specified similarity condition (e.g., the highest similarity) can be retrieved from at least one preset tensor code. The preset solution corresponding to the preset tensor code that meets the specified similarity condition with the first tensor code can be efficiently and quickly obtained as the target initial solution of the first mathematical programming model. This provides users with a reproducible and suitable initial solution required by the first mathematical programming model corresponding to the current business, effectively improving the solution efficiency of the mathematical programming model and meeting the user's reproducibility requirements.
[0016] In one possible implementation of the first aspect, at least one preset tensor code is included in one or more preset tensor codes of a preset dataset, and the preset dataset records preset solutions corresponding to each of the one or more preset tensor codes; after obtaining the target initial solution, the method further includes: obtaining a first solution of a first mathematical programming model, the first solution being obtained by solving the first mathematical programming model based on the target initial solution; and updating the preset dataset based on the first solution and the first tensor code.
[0017] In this possible implementation, the preset dataset can be incrementally updated based on the solutions generated in the actual application scenario to optimize the quality of the preset solutions in the preset dataset. This will continuously improve the quality of the obtained initial target solutions in subsequent application scenarios, thereby increasing the solution speed of the mathematical programming model.
[0018] In one possible implementation of the first aspect, updating the preset dataset based on the first solution and the first tensor code includes: using the first tensor code as a new preset tensor code in the preset dataset, and obtaining a preset solution corresponding to the new preset tensor code in the preset dataset based on the first solution or the optimized first solution, wherein the optimized first solution is obtained by solving the first mathematical programming model based on the first solution using a preset algorithm, and the accuracy of the optimized first solution is higher than that of the first solution.
[0019] In this possible implementation, the first solution or the optimized first solution corresponding to the first tensor encoding can be used as the preset solution corresponding to the first tensor encoding, thereby adding this new set of correspondences to the preset dataset and expanding the solution scenarios involved in the preset dataset.
[0020] In some examples, an optimized first solution can be used to update the preset dataset. Specifically, without the user's awareness, the first mathematical programming model can be solved offline on a computing cluster using a preset algorithm. This yields a better optimized first solution than the initial one, which is then used to update the preset dataset, resulting in higher quality solutions in the updated dataset. In other words, in this example, the preset algorithm can be considered an offline algorithm, not affecting the duration of the online process and remaining unnoticed by the user. Therefore, higher-performance algorithms such as uncertain algorithms can be used.
[0021] As can be seen, in this example, an offline preset algorithm (such as an uncertain algorithm unsuitable for direct online use) is used to continuously improve the quality of the solutions to the solved business scenarios and update the corresponding preset dataset. This automatically and continuously improves the quality of the preset dataset and the quality of the provided initial solutions, thereby continuously enhancing the solving capability. Furthermore, in this solution, the preset algorithm can optimize the first solution offline, avoiding impact on the user's online real-time solving process. It also makes reasonable use of the system's idle resources, reducing implementation costs such as time and processing resource costs.
[0022] In one possible implementation of the first aspect, updating the preset dataset based on the first solution and the first tensor code includes: updating the preset solution corresponding to the first preset tensor code in the preset dataset based on the first solution or the optimized first solution, wherein the similarity between the first preset tensor code and the first tensor code is higher than a similarity threshold, and the optimized first solution is obtained by solving the first mathematical programming model based on the first solution using a preset algorithm, and the accuracy of the optimized first solution is higher than that of the first solution.
[0023] In this possible implementation, if the similarity between the first tensor encoding and the first preset tensor encoding in the preset dataset is higher than the similarity threshold (for example, in some examples, the similarity threshold is a value close to 1), then the first tensor encoding can be considered as an existing preset tensor encoding in the preset dataset. In this case, the first solution or the optimized first solution can replace the preset solution corresponding to the existing threshold tensor encoding to update the preset dataset.
[0024] In one possible implementation of the first aspect, there are multiple initial solutions to the objective. After obtaining the initial solutions to the objective, the method further includes: using a deterministic algorithm to take each initial solution to the objective as an initial solution to obtain multiple second solutions to the first mathematical programming model; and taking the solution with the highest accuracy among the multiple second solutions as the first solution to the first mathematical programming model.
[0025] In this possible implementation, since deterministic algorithms typically require relatively small computational resources, a solver can be used to achieve relatively fast online solving based on the deterministic algorithm. Furthermore, in this possible implementation, a deterministic algorithm can be used to solve the problem in parallel with each initial solution to obtain multiple second solutions to the first mathematical programming model. The solution with the highest accuracy is then selected as the first solution from these second solutions, thereby effectively improving the quality of the first solution. In one embodiment, the first solution, as the final solution result of the first mathematical programming model, is displayed on the provided user interface.
[0026] In one possible implementation of the first aspect, after obtaining the initial solution of the objective, the method further includes: using a deterministic algorithm to take the initial solution of the objective as the initial solution to obtain a second solution of the first mathematical programming model; using an uncertain algorithm to solve the first mathematical programming model to obtain a third solution of the first mathematical programming model; and taking the solution with higher accuracy between the second and third solutions as the first solution of the first mathematical programming model.
[0027] In this possible implementation, since the uncertain algorithm typically requires more computational resources but usually yields more accurate results, it can be used in parallel with the deterministic algorithm for online solving, provided that computational resources are sufficient, to provide users with more accurate results. In one embodiment, the first solution, as the final solution result of the first mathematical programming model, is displayed on the provided user interface.
[0028] In one possible implementation of the first aspect, the information of the first mathematical programming model includes the constraints of the first mathematical programming model.
[0029] In some possible implementations, the encoder can be applied to tensor encoding of mathematical programming models within relatively fixed business scenarios. That is, the first mathematical programming model and the preset mathematical programming model involved in the encoder are obtained by modeling business data in relatively fixed and similar business scenarios. The structures of the first mathematical programming model and the preset mathematical programming model involved in the encoder are similar or identical, with differences usually reflected in the constraints, while the objective function is usually the same. In this example, the input of the encoder can include only the constraints of the first mathematical programming model, without including the objective function. Thus, the obtained first tensor encoding can effectively reflect the scenario characteristics corresponding to the first mathematical programming model. Alternatively, in other examples, the input of the encoder can also include the objective function of the first mathematical programming model.
[0030] In one possible implementation of the first aspect, before processing the information of the first mathematical programming model through the encoder to obtain the first tensor code, the method further includes: training a neural network based on training data and the labels of the training data, using a loss function to obtain a trained neural network, the neural network including a first encoder and a first solver network, the training data including information of a second mathematical programming model, the labels of the training data including preset solutions of the second mathematical programming model, the training data being the input of the first encoder, the output of the first encoder being the input of the first solver network, the loss function being used to evaluate the difference between the output of the first solver network and the labels of the training data; and using the first encoder in the trained neural network as the encoder.
[0031] In this possible implementation, the labels of the training data include preset solutions of the second mathematical programming model. During training, a loss function can be used to evaluate the difference between the output of the first solving network and the labels of the training data. Through training, the tensor encoding output by the first encoder can better reflect the features of the input second mathematical programming model, and the more accurate tensor encoding output by the first encoder can be used by the first solving network for feature processing and initial solution prediction to meet the solution requirements of practical solving scenarios.
[0032] In other words, the encoding method of the first encoder after training, which uses the preset solution of the second mathematical programming model as a label to train the neural network, can better reflect the information characteristics of the mathematical programming model. Furthermore, the tensor encoding features obtained by this encoding method can be well used to predict the initial solution of the mathematical programming model. That is to say, the encoding method of this encoder can be effectively applied to the current mathematical programming model solving scenario and is an encoding method suitable for the current solving scenario.
[0033] A second aspect of this application provides an apparatus for determining an initial solution, which has the function of implementing the method described in the first aspect or any possible implementation of the first aspect. This function can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-described function, such as a training module and a processing module.
[0034] A third aspect of this application provides a computing device cluster including at least one computing device, the at least one computing device including a processor and a memory, the memory of the at least one computing device storing computer-executable instructions that can run on the processor, and when the computer-executable instructions are executed by the processor, the processor executes a method as described in the first aspect or any possible implementation of the first aspect.
[0035] The fourth aspect of this application provides a computer-readable storage medium storing one or more computer-executable instructions, wherein when the computer-executable instructions are executed by a processor, the processor performs a method as described in the first aspect or any possible implementation thereof.
[0036] The fifth aspect of this application provides a computer program product that stores one or more computer-executable instructions, wherein when the computer-executable instructions are executed by a processor, the processor executes a method as described in the first aspect or any possible implementation thereof.
[0037] A sixth aspect of this application provides a chip system including a processor for supporting the processor in implementing the functions involved in the first aspect or any possible implementation thereof. In one possible design, the chip system may further include a memory for storing necessary program instructions and data. This chip system may be composed of chips or may include chips and other discrete devices.
[0038] The technical effects of the second to sixth aspects or any of their possible implementations can be found in the first aspect or the technical effects of its related possible implementations, and will not be repeated here. Attached Figure Description
[0039] Figure 1 is an exemplary schematic diagram of a data center provided in an embodiment of this application;
[0040] Figure 2 is a schematic diagram of an exemplary system framework provided in an embodiment of this application;
[0041] Figure 3 is a schematic diagram of an embodiment of the method for determining an initial solution provided in this application;
[0042] Figure 4 is an exemplary schematic diagram of obtaining encoder input data provided in an embodiment of this application;
[0043] Figure 5 is an exemplary flowchart provided in an embodiment of this application;
[0044] Figure 6 is an exemplary flowchart provided in an embodiment of this application;
[0045] Figure 7 is a schematic diagram of an embodiment of the apparatus for determining an initial solution provided in this application;
[0046] Figure 8 is a structural schematic diagram of a computing device provided in an embodiment of this application;
[0047] Figure 9 is a schematic diagram of a computing device cluster provided in an embodiment of this application;
[0048] Figure 10 is a schematic diagram of a computing device cluster provided in an embodiment of this application. Detailed Implementation
[0049] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.
[0050] As will be known to those skilled in the art, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0051] In this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion, such that a process, method, system, product, or apparatus that comprises a series of units is not necessarily limited to those units, but may include other units not expressly listed or inherent to those processes, methods, products, or apparatus.
[0052] 1. Operations Research and Optimization
[0053] Operations research optimization, within the framework of operations research, primarily uses mathematical methods to study optimization approaches and solutions for various business systems, providing decision-makers with a basis for scientific decision-making.
[0054] Mathematical programming is an important branch of operations research optimization.
[0055] 2. Mathematical Programming
[0056] The primary goal of mathematical programming is to find the optimal solution that minimizes or maximizes a certain function within a given region. Mathematical programming can encompass many different branches, such as linear programming, integer programming, nonlinear programming, combinatorial optimization, multi-objective programming, stochastic programming, dynamic programming, and parametric programming.
[0057] 3. Solver
[0058] A solver can be considered as a computer program that solves a specific problem.
[0059] For example, operations research solvers can be considered a general term for software that solves operations research problems encountered in real-world scenarios, including but not limited to mathematical programming solvers.
[0060] A mathematical programming solver is software that solves mathematical programming models, such as linear, integer, mixed integer, and / or nonlinear programming models. By inputting constraints and objective functions, the mathematical programming solver can find the optimal or feasible solution to the mathematical programming model.
[0061] 4. Deterministic and nondeterministic algorithms
[0062] In a solver, a deterministic algorithm is one whose output is always consistent under the same problem input and software operating conditions, and has high reproducibility; in contrast, an uncertain algorithm is one whose output is not always consistent under the same problem input and software operating conditions, and has low reproducibility.
[0063] 5. Hot start
[0064] In operations research and optimization problem-solving scenarios, warm start is a method to accelerate the solution of operations research optimization problems. It refers to starting the optimization algorithm from an informative or relatively good initial point, rather than starting from a random or empty starting point. Specifically, for mathematical programming models, providing a suitable initial solution can accelerate the solution process, thus achieving a warm start. In practical applications, warm start can significantly improve the solver's speed, especially for large and complex problems, saving considerable computation time and resources.
[0065] This application provides a method for determining an initial solution, which can provide a suitable and reproducible initial solution for solving the mathematical programming model corresponding to the business problem, thereby effectively improving the solution efficiency of the mathematical programming model and meeting the user's reproducibility requirements.
[0066] The method described in this application embodiment can be applied to a computing device cluster, which may include one or more computing devices.
[0067] The type of computing device is not limited here. For example, any computing device can be a terminal device, a server, a container, or a virtual machine, etc. Different computing devices can be of the same type or different types.
[0068] In one example, the cluster of computing devices can be used to implement a cloud management platform; in other words, the embodiments of this application can be applied to a cloud management platform.
[0069] A cloud management platform is used to manage the infrastructure that provides cloud services. It can provide computing, networking, and storage capabilities based on hardware and software resources. For example, the cloud management platform and infrastructure can reside in one or more data centers to provide cloud resources through those data centers.
[0070] The following is an exemplary description of a data center, illustrated in Figure 1.
[0071] In Figure 1, the cloud management platform interacts with one or more servers (Server 1 and Server 2 in Figure 1) through the data center's internal network. The servers consist of a hardware layer and a software layer. The hardware layer includes the server's hardware configuration, such as PCI devices like network interface cards (NICs), graphics processing units (GPUs), and offloading cards, which can be plugged into peripheral component interconnect (PCI) or peripheral component interconnect express (PCIe) slots. The software layer includes the operating system installed and running on the server (the operating system relative to the virtual machine can be called the host operating system). The host operating system contains a virtual machine manager (also called a hypervisor), whose role is to implement compute virtualization, network virtualization, and storage virtualization of the virtual machines and to manage them. A virtual machine (VM) refers to a complete computer system simulated by software, possessing full hardware system functionality and running in a completely isolated environment. In the system architecture shown in Figure 1, the infrastructure includes multiple servers, which can be used to run virtual machines. The specifications of the virtual machines can be the same or different. Virtual machines can also be called cloud servers (elastic compute service, ECS), elastic instances, etc., and different cloud service providers may have different names for them.
[0072] In one example of an embodiment of this application, the cloud management platform can be a public cloud platform. In this case, cloud service providers such as individuals or software developers with cloud resource development capabilities can provide cloud services to users. Users obtain cloud services through the Internet but do not own cloud computing resources. In other embodiments of this application, the cloud management platform can be a private cloud platform or a hybrid cloud platform, and this application does not impose any restrictions on this.
[0073] Specifically, in the example shown in Figure 1, the cloud management platform can provide an access interface (such as a user interface or application programming interface (API)). Users of the cloud management platform and cloud service providers can operate the client to remotely access the access interface to register a cloud account and password on the cloud management platform. After the cloud management platform successfully authenticates the cloud account and password, they can log in to the cloud management platform to create, manage, log in to and operate virtual machines in the cloud data center.
[0074] For example, when it is necessary to perform data planning problem solving tasks, some enterprises, organizations or individuals can purchase cloud services to perform relevant data planning problem solving tasks through the cloud resources of the cloud management platform and obtain the corresponding solution results from the cloud management platform; or, they can also perform the task of obtaining the initial solution of the data planning problem through the cloud resources of the cloud management platform and obtain the corresponding initial solution from the cloud management platform, so as to perform subsequent solving tasks based on the initial solution, etc.
[0075] Of course, the cloud management platform can also be other types of cloud management platforms, and this application embodiment does not limit this.
[0076] In some examples, the cloud management platform can provide a method for determining the initial solution by offering services, thereby providing a suitable initial solution for the user. In some examples, the cloud management platform can implement the method for determining the initial solution by serving virtual machines, or it can implement the method for determining the initial solution itself; this application embodiment does not limit this approach.
[0077] As exemplarily shown in Figure 2, this is a schematic diagram of an exemplary system architecture in a cloud management platform.
[0078] In the example shown in Figure 2, a retrieval service may be included; in addition, in some examples, a solution service may also be included.
[0079] The retrieval service may include one or more of the following: a preset dataset, a retrieval engine, and a machine learning module. The preset dataset may include preset solutions corresponding to one or more preset mathematical programming models. For example, in one instance, the information of the preset mathematical programming model is described using preset tensor encodings; therefore, the preset dataset may specifically include preset solutions corresponding to one or more preset tensor encodings. The machine learning module may include an encoder. The solution service may include mathematical modeling services and operations research solvers; additionally, it may include a pool of solution algorithms.
[0080] In practical applications, users can upload business data from actual business scenarios to the solver service, and then call the mathematical modeling service in the solver service through the cloud management platform to build a mathematical programming model according to the optimization requirements of the specified business scenario, and call the operations research optimization solver (e.g., a mathematical programming solver) in the mathematical modeling service to execute the solution task for the mathematical programming model.
[0081] If a user sends a service request to the retrieval service and receives a notification from the retrieval service confirming the provision of the retrieval service, the user can invoke the retrieval service to obtain the initial target solution for the mathematical programming model when executing the solution task. Specifically, the encoder in the machine learning module can generate a tensor code for the current scene, and then a tensor code search can be performed in a preset dataset to match a suitable preset tensor code. Based on the preset solution corresponding to the matched preset tensor code in the preset dataset, the matched preset solution is then fed back to the solution service as the initial target solution. After obtaining the initial target solution through the retrieval service, deterministic algorithms and other solution algorithms in the solution algorithm pool can be invoked to execute the solution task for the mathematical programming model, obtain the solution result, and output the solution result to the user. Furthermore, the solution algorithm pool can also include uncertain algorithms, and the solution result can be optimized using uncertain algorithms and other solution algorithms, and the preset dataset can be updated based on the optimization result. The specific implementation of the functions of the solution service, retrieval service, and their included modules can be referred to in the subsequent method embodiments, and will not be elaborated here.
[0082] The solution and retrieval services can be implemented using resources from development platforms such as operations research platforms (e.g., ModelArts). Furthermore, operations research platforms can connect to storage services (e.g., Object Storage Service (OBS)). After obtaining the solution results through the solution service, users can save some or all of the business data, solution results, data planning models, and intermediate data from the solution process to the operations research platform providing the storage service for management. During storage, the relevant data can be encrypted and anonymized (e.g., by adding noise) to ensure data security. In this example, the solution, retrieval, and storage services can be deployed on the operations research platform, which provides data storage and management.
[0083] It should be noted that the services shown in Figure 2 are only one example of the services provided by the cloud management platform, and not a limitation.
[0084] For example, in another scenario, the cloud management platform does not provide a solution service, but only a retrieval service. In this example, the user constructs a mathematical programming model through a client and sends a request to the cloud management platform's retrieval service to obtain an initial solution to the mathematical programming model. After receiving the request, the cloud management platform can invoke the retrieval service to determine the target initial solution of the mathematical programming model and send it to the user, allowing the user to solve the mathematical programming model using the target initial solution through the client.
[0085] Furthermore, in other examples provided in this application, the aforementioned solution service and / or retrieval service can be deployed as a whole in a server cluster implementing a cloud management platform; and the functional division of each service may differ from that shown in Figure 2, and the deployment methods of each service may also differ. Each service can provide services independently, can be embedded in other services, or can be deployed by combining multiple services; this application does not impose any restrictions on this.
[0086] Based on the aforementioned computing device cluster, referring to the system architecture shown in Figure 2, as shown in Figure 3, the method for determining the initial solution in this application embodiment may include steps 301-303.
[0087] Step 301: Obtain information about the first mathematical programming model.
[0088] The information from the first mathematical programming model is used to indicate the first mathematical programming model to be solved.
[0089] In this embodiment, the information of the first mathematical programming model can be received by the computing device cluster from other devices such as the user's client. For example, the user can generate the first mathematical programming model by performing mathematical modeling based on business data of a specific business scenario through the client, and then transmit the information of the generated first mathematical programming model to the computing device cluster. Alternatively, the information of the first mathematical programming model can also be generated by the computing device cluster after data processing. For example, the user can use the mathematical modeling service shown in Figure 2 through the computing device cluster to perform mathematical modeling based on business data of a specific business scenario, generate the first mathematical programming model, and thus enable the computing device cluster to obtain the information of the first mathematical programming model.
[0090] The information from the first mathematical programming model is used to describe the first mathematical programming model. Specifically, it can describe the first mathematical programming model completely or only describe part of the information in the first mathematical programming model.
[0091] For example, the objective function of the first mathematical programming model is min(x1+x2), and the constraints of the first mathematical programming model (which can be identified by st) may include the following constraints:
[0092] stx1+3x2≥1;x1+x2≥1;
[0093] x1≤3; x2≤5, x2∈Z.
[0094] In this embodiment of the application, the first mathematical programming model may include the objective function of the first mathematical programming model and / or the constraints of the first mathematical programming model.
[0095] For example, in one instance, the information of the first mathematical programming model may include the constraints of the first mathematical programming model.
[0096] Step 302: Calculate the similarity between the first mathematical programming model and at least one preset mathematical programming model.
[0097] At least one pre-defined mathematical programming model has a pre-defined solution.
[0098] In this embodiment of the application, the similarity between the information of the first mathematical programming model and the information of the preset mathematical programming model can be calculated to determine whether the first mathematical programming model and the preset mathematical programming model are the same or similar solution scenarios.
[0099] There are multiple ways to calculate the similarity between the first mathematical programming model and at least one pre-defined mathematical programming model.
[0100] In some embodiments, the information of the first mathematical programming model can be directly compared with the information of the preset mathematical programming model, and the similarity between the first mathematical programming model and at least one preset mathematical programming model can be obtained based on the degree of similarity or identicalness of the key information (such as objective function and / or constraints) in the information of the first mathematical programming model and the information of the preset mathematical programming model.
[0101] In other embodiments, the information of the mathematical programming model can be converted into tensor codes that are easy for machines to understand and process, and then the similarity between different mathematical programming models can be calculated.
[0102] Specifically, in some embodiments, step 302 may include the following steps:
[0103] The information of the first mathematical programming model is processed by the encoder to obtain the first tensor code;
[0104] Calculate the similarity between the first tensor code and at least one preset tensor code.
[0105] In this context, any preset tensor code is obtained by encoding the information of a preset mathematical programming model through an encoder, and any preset tensor code corresponds to a preset solution of the preset data programming model corresponding to the preset tensor code. The target initial solution is the preset solution corresponding to at least one preset tensor code whose similarity with the first tensor code satisfies a specified condition.
[0106] Below, we will first introduce the specific method for obtaining the first tensor code.
[0107] In this example, the encoder can be applied to perform tensor encoding on mathematical programming models in relatively fixed business scenarios. This allows for the determination of initial target solutions for mathematical programming models that may be involved in the relatively fixed business scenario through tensor encoding retrieval. In other words, the first mathematical programming model and the preset mathematical programming model involved in the encoder are obtained by modeling business data in relatively fixed and similar business scenarios. The structures of the first mathematical programming model and the preset mathematical programming model involved in the encoder are similar or the same, and the differences are usually reflected in the constraints, while the objective functions are usually the same.
[0108] In this example, the input to the encoder can include only the constraints of the first mathematical programming model, without including the objective function of the first mathematical programming model. In this way, the obtained first tensor encoding can effectively reflect the scene characteristics corresponding to the first mathematical programming model.
[0109] In another example, the encoder can be applied to tensor encoding mathematical programming models in various different business scenarios. By using tensor encoding retrieval, it can determine the initial target solution for the various types of mathematical programming models that may be involved in these different business scenarios. That is to say, the first mathematical programming model and the preset mathematical programming model involved in the encoder may be obtained by modeling business data in various business scenarios. The first mathematical programming model and the preset mathematical programming model involved in the encoder may include mathematical programming models with different structures. In other words, the differences between the various mathematical programming models involved in the encoder can be reflected not only in the constraints but also in the objective function.
[0110] In this example, the input to the encoder can include the objective function and constraints of the first mathematical programming model. In this way, the obtained first tensor code can effectively reflect the scene characteristics corresponding to the first mathematical programming model.
[0111] In this embodiment, the specific type of encoder is not limited. For example, the encoder can be one or more of graph convolutional networks (GNN), convolutional neural networks (CNN), deep neural networks (DNN), or other algorithms.
[0112] Different types of encoders may have different requirements for the format of the input data. Therefore, in some examples, the information of the mathematical programming model input by the user can be transformed according to the encoder's requirements for the input data format before being input into the encoder. In other words, the specific data format of the first mathematical programming model can have multiple forms, which are not limited here.
[0113] The following example uses a GNN encoder to illustrate the information format of the first mathematical programming model.
[0114] In one example, the information of the first mathematical programming model may include the constraints of the first mathematical programming model, specifically including the following constraints:
[0115] stx1+3x2≥1;x1+x2≥1;
[0116] x1≤3; x2≤5, x2∈Z.
[0117] Therefore, the constraints of the first mathematical programming model can be transformed into a graph structure as shown in Figure 4, and then input into a GNN-type encoder to output the first tensor code.
[0118] In the example shown in Figure 4, the graph structure can include four nodes. Among them, the attributes of node x1 itself... The coefficient of x1 is 1, meaning that the attribute of node x1 itself describes the constraint x1≤3 in the first mathematical programming model, with a value range from negative infinity to 3, and the 0 in the last bit of the attribute indicates that x1 is a continuous variable. The attribute of node x2 itself... The coefficient of x2 is 1, and its value ranges from negative infinity to 5. In other words, the attribute of node x1 itself describes the constraint x2≤5 of the first mathematical programming model, and the 1 in the last bit of the attribute describes x2 as a non-continuous variable (determined based on x2∈Z in the constraint, where Z refers to an integer).
[0119] Furthermore, in the example shown in Figure 4, node v1 is connected to node x1 with a weight of 1, and node v1 is also connected to node x2 with a weight of 3, indicating that v1 = x1 + 3x2. The properties of node v1 itself... The indicator v1 = x1 + 3x2 ≥ 1. Node v2 is connected to node x1 with a weight of 1. Node v1 is also connected to node x2 with a weight of 1. The indicator v2 = x1 + x2. The properties of node v2 itself... The instruction is v1 = x1 + x2 ≥ 1.
[0120] As can be seen in this example, the constraints in the formula form of the first mathematical programming model can be converted into constraints in the form of a graph structure to meet the requirements of the GNN encoder for the form of input data. This allows the GNN encoder to process the information of the first mathematical programming model containing the constraints of the first mathematical programming model and obtain the first tensor code.
[0121] In this embodiment of the application, the specific dimension of the first tensor encoding can be various. For example, the first tensor encoding can be a vector encoding, that is, the first tensor encoding can be in the form of a first-order tensor (that is, a vector), or it can be in the form of a second-order tensor (that is, a matrix) or a tensor of other orders.
[0122] The encoder can be a trained neural network. The training method of the encoder can be referred to in the following description of relevant embodiments on neural network training, which will not be repeated here.
[0123] In this embodiment of the application, the encoder encodes the information of the first mathematical programming model to obtain the first tensor code, which allows the information of the first mathematical programming model to be mapped into the tensor feature space. The tensor code, which is easy for the machine to understand and process, describes the information of the mathematical programming model as the current scene feature.
[0124] After obtaining the first tensor code, the similarity between the first tensor code and at least one preset tensor code can be calculated.
[0125] Each preset tensor code is obtained by processing the information of a preset mathematical programming model through an encoder, and each preset tensor code corresponds to a preset solution of a preset mathematical programming model.
[0126] In this embodiment of the application, a preset dataset can be obtained, and one or more preset tensor codes and their respective preset solutions can be recorded in the preset dataset.
[0127] The following provides an exemplary description of the preset tensor encoding in the preset dataset and the method for obtaining the preset solution corresponding to the preset tensor encoding.
[0128] In some examples, information about a historical mathematical programming model solved in historical business scenarios can be collected in advance, and the solution results of this historical mathematical programming model can be obtained. These results typically include the better solutions of the historical mathematical programming model. In this way, the historical mathematical programming model can be used as a preset mathematical programming model. An encoder can be used to process the information of this historical mathematical programming model to obtain its corresponding tensor code, which can then be used as a preset tensor code. Furthermore, this preset tensor code and the better solutions obtained during the historical mathematical programming model's solution process can be used as the preset solution for the historical mathematical programming model.
[0129] In this embodiment of the application, the encoder can be used to generate a preset tensor code, and can also be used in actual solution scenarios, such as to generate the first tensor code in the solution scenario. In this way, the uniformity of the tensor code generation method can be guaranteed, that is, the uniformity of the encoding method of the information of the mathematical programming model can be guaranteed in multiple scenarios, thereby facilitating similarity matching.
[0130] In some examples, a preset tensor code corresponds to a preset solution, which is the optimal solution obtained in advance for the corresponding preset mathematical programming model, that is, the solution with the highest accuracy. In other examples, a preset tensor code may also correspond to multiple preset solutions, and this application embodiment does not impose any restrictions on this.
[0131] In this way, a pre-built dataset can be constructed to collect accurate numerical solutions of historical mathematical programming models obtained through methods such as uncertain algorithms in historical solution scenarios. These solutions can then be used as pre-defined solutions for the historical mathematical programming models. This allows the optimal solutions obtained by uncertain algorithms in historical solution processes to be reliably preserved and provided to users later. In other words, the optimal solutions obtained by uncertain algorithms in historical solution processes can be reproduced in real-world application scenarios to meet users' reproducibility requirements. In other words, using a pre-built dataset can integrate the results of uncertain algorithm solutions, avoiding the exposure of the uncertainty of the solutions to users and shielding the inherent disadvantages of uncertain algorithms in commercial delivery.
[0132] Thus, after obtaining the first tensor encoding, the similarity between the first tensor encoding and at least one preset tensor encoding can be calculated. The at least one preset tensor encoding can be all tensor encodings from one or more preset tensor encodings in the preset dataset, or it can be a subset of tensor encodings in the preset dataset.
[0133] For example, in one example, the similarity between the first tensor code and each preset tensor code in the preset dataset can be calculated. Alternatively, in another example, the similarity between the first tensor code and the preset tensor codes in the preset dataset can be calculated sequentially according to a preset order (e.g., the order in which the preset tensor codes are arranged in the preset dataset) until a sufficient number of preset tensor codes that meet the specified conditions are obtained, at which point the similarity calculation stops; in this example, in many cases, it is not necessary to traverse all the preset tensor codes in the preset dataset.
[0134] In this application embodiment, there are multiple ways to calculate the similarity between two tensor codes. For example, it can be calculated by existing or future development methods such as cosine similarity, Euclidean distance, Manhattan distance, etc., and is not limited here.
[0135] Step 303: Obtain the initial solution for the target.
[0136] The target initial solution is a preset solution of at least one preset mathematical programming model whose similarity to the first mathematical programming model meets a specified condition. The target initial solution is used to: determine the initial solution of the first mathematical programming model and solve the first mathematical programming model.
[0137] There can be multiple conditions for this specified condition.
[0138] For example, the specified condition could be that the similarity to the first mathematical programming model is higher than a similarity threshold. In other words, among at least one set of preset mathematical programming models, the preset mathematical programming model whose similarity to the first mathematical programming model is higher than the similarity threshold is determined as a preset mathematical programming model whose similarity to the first mathematical programming model satisfies the specified condition. Alternatively, among at least one set of preset mathematical programming models, one or more preset mathematical programming models with the highest similarity to the first mathematical programming model are determined as one or more preset mathematical programming models whose similarity to the first mathematical programming model satisfies the specified condition.
[0139] For example, in some examples, if the similarity between a first tensor code and at least one preset tensor code is calculated as the similarity between a first mathematical programming model and at least one preset mathematical programming model, then the specified condition can be that the similarity with the first tensor code is higher than a similarity threshold. In other words, the preset tensor code among the at least one preset tensor code whose similarity with the first tensor code is higher than the similarity threshold is determined as the preset tensor code whose similarity with the first tensor code satisfies the specified condition. Alternatively, the preset tensor code among the at least one preset tensor code with the highest similarity with the first tensor code is determined as the preset tensor code whose similarity with the first tensor code satisfies the specified condition.
[0140] After determining a preset mathematical programming model whose similarity to the first mathematical programming model meets the specified conditions, the preset solution corresponding to the preset mathematical programming model whose similarity to the first mathematical programming model meets the specified conditions can be used as the target initial solution.
[0141] The number of initial solutions to the objective can be one or more, and is not limited here.
[0142] For example, if the similarity between a first tensor code and at least one preset tensor code is calculated as the similarity between a first mathematical programming model and at least one preset mathematical programming model, then, after determining one or more preset tensor codes whose similarity with the first tensor code satisfies a specified condition, if in the preset dataset, one preset tensor code corresponds to one preset solution, then one or more initial target solutions corresponding to the one or more preset tensor codes whose similarity with the first tensor code satisfies the specified condition can be obtained from the preset dataset and output. The specific number of initial target solutions can be determined according to the actual application scenario; for example, it can be set by the user or relevant R&D personnel according to needs and the solver's capabilities.
[0143] In this embodiment of the application, after obtaining the target initial solution, the computing device cluster executing this embodiment of the application can solve the first mathematical programming model based on the target initial solution, or the computing device cluster can output the target initial solution to other devices (e.g., clients) so that other devices can solve the first mathematical programming model based on the target initial solution.
[0144] For example, in the example shown in Figure 2, the above steps 301-303 can be implemented by the retrieval service shown in Figure 2. After obtaining the target initial solution through the retrieval service, the computing device cluster can transfer the target initial solution to the solution service of the computing device cluster, so that the solution service can solve the first mathematical programming model based on the target initial solution.
[0145] Specifically, in the example shown in Figure 5, the user can input information about the first mathematical programming model. Then, the search engine in the search service shown in Figure 2 can call the encoder in the machine learning module to process the first mathematical programming model to obtain the first tensor code.
[0146] Then, the similarity between the first tensor encoding and at least one preset tensor encoding in the preset dataset can be calculated to retrieve a preset tensor encoding that is relatively similar to the first tensor encoding in the preset dataset. Based on the preset solutions corresponding to the preset tensor encodings that are relatively similar to the first tensor encoding in the preset dataset, a target initial solution is obtained and passed to the operations research and optimization solver (e.g., a mathematical programming solver) in the solution service, so that the operations research and optimization solver can solve based on the target initial solution to obtain the solution result. Specifically, this can be achieved by processing the information of a preset mathematical programming model in the historical business scenario data through an encoder to obtain the preset tensor encoding, and by obtaining the preset solution of the preset tensor encoding corresponding to the preset mathematical programming model based on the better solution corresponding to the preset mathematical programming model in the historical business scenario data, thereby obtaining the preset dataset.
[0147] Alternatively, in other examples, the solution service can be implemented by the user's client. After obtaining the target initial solution through the retrieval service, the computing device cluster outputs the target initial solution to the user's client, so that the client can solve the first mathematical programming model based on the target initial solution.
[0148] In this embodiment, the better preset solutions of one or more historical mathematical programming models in a business scenario can be collected in advance by means such as uncertainty algorithms, so as to provide deterministic better initial solutions corresponding to mathematical programming models in different historical business scenarios, and avoid exposing the uncertainty of the solution results brought about by uncertainty algorithms to the user.
[0149] In this way, in practical applications, preset solutions corresponding to preset mathematical programming models that meet specified conditions in similarity with the first mathematical programming model can be obtained efficiently and quickly as one or more target initial solutions of the first mathematical programming model. This can provide users with reproducible and suitable initial solutions required by the first mathematical programming model corresponding to the current business, thereby effectively improving the solution efficiency of the mathematical programming model and meeting the user's reproducibility requirements.
[0150] For example, in one instance, an encoder can convert the information of a mathematical programming model into tensor codes that are easy for computers to understand and process, thereby effectively reflecting the business scenario corresponding to the mathematical programming model. In this way, information from one or more historical business scenarios' preset mathematical programming models can be pre-collected and converted into preset tensor codes by the encoder to reflect the respective business scenarios of one or more preset mathematical programming models. Furthermore, optimal preset solutions from one or more historical business scenarios' preset mathematical programming models can be pre-collected using methods such as uncertainty algorithms, providing deterministic optimal initial solutions corresponding to mathematical programming models in different historical business scenarios, thus avoiding the exposure of uncertainty in the solution results brought about by uncertainty algorithms to the user.
[0151] In practical applications, an encoder can convert the information of the first mathematical programming model in the current business scenario into a first tensor code, effectively reflecting the business scenario corresponding to the first mathematical programming model. Then, through vector encoding retrieval, a preset tensor code that meets a specified similarity condition (e.g., highest similarity) with the first tensor code can be retrieved from at least one preset tensor code. The preset solutions corresponding to these preset tensor codes that meet the specified similarity condition can be efficiently and quickly obtained as one or more initial solutions for the first mathematical programming model. This provides users with a reproducible and suitable initial solution required by the first mathematical programming model corresponding to the current business, effectively improving the solution efficiency of the mathematical programming model and meeting the user's reproducibility requirements.
[0152] In this embodiment, after obtaining the initial target solution, the computing device cluster executing this embodiment can solve the first mathematical programming model based on the initial target solution, or the computing device cluster can output the initial target solution to other devices (e.g., clients) so that other devices can solve the first mathematical programming model based on the initial target solution. Furthermore, in this embodiment, there can be various specific methods for solving the first mathematical programming model based on the initial target solution, and no limitation is made here.
[0153] The following is an exemplary description of how to solve the first mathematical programming model based on the initial solution of the objective.
[0154] In one embodiment, the number of initial target solutions is multiple, and after obtaining the initial target solutions, the method further includes:
[0155] By using a deterministic algorithm, each initial solution of the objective is taken as the initial solution to obtain multiple second solutions of the first mathematical programming model;
[0156] The solution with the highest accuracy among multiple second solutions is taken as the first solution of the first mathematical programming model.
[0157] The specific type of the deterministic algorithm is not limited here. For example, the deterministic algorithm can be one or more of the following methods: filling function method, hole punching function method, DC programming algorithm, interval method, monotonic programming, branch and bound method, or integral level set method.
[0158] Since deterministic algorithms typically require relatively small computational resources, they can be solved relatively quickly online using a solver. Therefore, in this embodiment, a second solution to the first mathematical programming model can be obtained by solving the first mathematical programming model based on the initial target solution using a deterministic algorithm.
[0159] Furthermore, in this example, there can be multiple initial solutions for the objective. In this case, multiple solvers can be used in parallel to solve the problem. Different solvers can use deterministic algorithms with different initial solutions for the objective. The deterministic algorithms used by different solvers can be the same or different. In this way, multiple solvers can output multiple second solutions. After obtaining multiple second solutions to the first mathematical programming model, the first solution to the first mathematical programming model can be obtained from these multiple second solutions. For example, the solution with the highest accuracy can be obtained from the multiple second solutions as the first solution. This first solution can be considered the final solution result of the first mathematical programming model and can be output to the user.
[0160] Alternatively, in some examples, when there can be multiple initial objective solutions, the solver can also select an optimal initial objective solution from the multiple initial objective solutions as needed to obtain a second solution, and use the second solution as the first solution.
[0161] Alternatively, in some examples, during the online solution process, when there are sufficient processing resources, deterministic and non-deterministic algorithms can be used in parallel to solve the problem, and after obtaining multiple solutions, the solution with higher accuracy can be selected as the first solution.
[0162] Specifically, in one example, after obtaining the initial solution to the objective, the method further includes:
[0163] Using a deterministic algorithm, the initial solution of the objective is taken as the initial solution to obtain the second solution of the first mathematical programming model;
[0164] The third solution to the first mathematical programming model is obtained by solving the uncertainty algorithm.
[0165] The solution with higher accuracy between the second and third solutions is taken as the first solution of the first mathematical programming model.
[0166] The specific type of the uncertainty algorithm is not limited here. For example, the uncertainty algorithm may include one or more of the following methods: interval number optimization, fuzzy programming, or stochastic programming.
[0167] Since uncertain algorithms typically require more computational resources but usually yield more accurate results, they can be used in parallel with deterministic algorithms for online solving when computational resources are sufficient, in order to provide users with more accurate results.
[0168] In this example, a second solution can be obtained through a deterministic algorithm, and a third solution can be obtained through an uncertain algorithm. The solution with higher accuracy between the second and third solutions is taken as the first solution. This first solution can be considered as the final solution result of the first mathematical programming model and can be output to the user.
[0169] When there are multiple second solutions, the solution with the highest accuracy can be selected as the first solution from among the multiple second and third solutions.
[0170] Furthermore, in some embodiments, the preset dataset can be incrementally updated based on the solutions generated in the actual application scenario to optimize the quality of the preset solutions in the preset dataset, thereby continuously improving the quality of the obtained target initial solution in subsequent application scenarios and improving the solution speed of the mathematical programming model.
[0171] Specifically, in some embodiments, at least one preset tensor code is included in one or more preset tensor codes of a preset dataset, and the preset dataset records a preset solution corresponding to each of the one or more preset tensor codes.
[0172] After obtaining the initial solution to the objective, the method also includes:
[0173] Obtain the first solution of the first mathematical programming model. The first solution is obtained by solving the first mathematical programming model based on the initial objective solution.
[0174] Update the preset dataset based on the first solution and the first tensor encoding.
[0175] In this embodiment of the application, for example, the first solution can be obtained based on the second and / or third solutions in the above examples.
[0176] The first solution can be considered the final solution of the first mathematical programming model. Generally speaking, the first solution is a better solution of the first mathematical programming model, and its accuracy is better than the initial solution of the first mathematical programming model. Therefore, the preset dataset can be updated based on the first solution so that the preset dataset can obtain the better solution corresponding to the first mathematical programming model as the subsequent initial solution. In this way, in subsequent solution scenarios that are the same or similar to the first mathematical programming model, a more suitable initial solution can be obtained from the updated preset dataset. That is, the quality of the initial solution of subsequent solution scenarios that are the same or similar to the first mathematical programming model can be improved, thereby improving the solution speed.
[0177] The first solution may be generated by the computing device cluster executing the embodiments of this application, or it may be generated by other devices such as the user's client solving the first mathematical programming model and then sent to the computing device cluster.
[0178] In some examples, after obtaining the first solution, this first solution can be used as the latest optimal solution corresponding to the first tensor encoding, and the first solution can be updated to the preset dataset. Alternatively, in some examples, after obtaining the first solution, it can be further optimized using a preset algorithm to obtain an optimized first solution, and then the optimized first solution can be updated to the preset dataset.
[0179] Furthermore, based on the first solution and the first tensor encoding, there are multiple ways to update the preset dataset. The following sections will introduce different update methods by way of example, taking into account the optimization schemes of the first solution.
[0180] Update method 1: Add a new set of correspondences in the preset dataset.
[0181] In some examples, the preset dataset is updated based on the first solution and the first tensor encoding, including:
[0182] The first tensor code is used as the new preset tensor code in the preset dataset. Furthermore, the preset solution corresponding to the new preset tensor code in the preset dataset is obtained based on the first solution or the optimized first solution. The optimized first solution is obtained by solving the first mathematical programming model based on the first solution using a preset algorithm, and the accuracy of the optimized first solution is higher than that of the first solution.
[0183] In this example, the first solution corresponding to the first tensor encoding or the optimized first solution obtained by optimizing the first solution can be used as the preset solution corresponding to the first tensor encoding, thereby adding this new set of correspondences to the preset dataset and expanding the solution scenarios involved in the preset dataset.
[0184] The optimized first solution can be a better solution than the first solution obtained by further solving the first mathematical programming model using a preset algorithm and offline resources.
[0185] In this embodiment of the application, for example, the preset algorithm can be an uncertain algorithm or a deterministic algorithm, and no limitation is made herein. Optimizing the first solution of the first mathematical programming model using the preset algorithm can be achieved by using the first solution and continuing to solve the first mathematical programming model using the preset algorithm to obtain a more accurate optimized first solution.
[0186] For example, in some cases, the computing device cluster can periodically acquire the actual mathematical programming model and corresponding solution results for the actual solution scenario within a certain period at preset time intervals (e.g., a first mathematical programming model and its corresponding first solution within a certain period). Alternatively, it can acquire the actual mathematical programming model and corresponding solution results for a certain duration when the system is relatively idle. Then, without the user's awareness, the first mathematical programming model can be solved offline within the computing device cluster using a preset algorithm. This allows for the acquisition of a better solution than the first solution as the optimized first solution, and the preset dataset can be updated, resulting in a higher quality preset solution in the updated dataset. In other words, in this example, the preset algorithm can be considered an offline algorithm, which does not affect the duration of the online process and is not perceived by the user. Therefore, higher-performance algorithms such as uncertain algorithms can be used.
[0187] For example, as shown in Figure 6, an operations research optimization solver can obtain the first solution of the first mathematical programming model based on the initial target solution. The information of the first mathematical programming model and the first solution can be collected as data for new historical business scenarios. At appropriate times (such as periodically or when the system is relatively idle), the first mathematical programming model can be solved using preset algorithms such as the uncertainty algorithm to obtain a more accurate optimized first solution compared to the first solution. Then, based on the information of the first preset mathematical programming model and the optimized first solution, the preset dataset can be incrementally updated, so that the quality of the preset dataset can be continuously improved as the business continues to develop.
[0188] As can be seen, in some cases, as business scenarios expand, an incremental data collection method can be adopted to acquire mathematical programming models and corresponding solutions for new business scenarios. Simultaneously, offline pre-defined algorithms (such as uncertainty algorithms unsuitable for direct online use) can be used to continuously improve the quality of solutions for already solved business scenarios and update the corresponding pre-defined dataset. This automatically and continuously improves the quality of the pre-defined dataset and the quality of the provided initial solutions, thereby enhancing the solution-solving capability. Furthermore, in this solution, the pre-defined algorithm can optimize the first solution offline, avoiding impact on the user's online real-time solution process. It also allows for the efficient use of system idle resources, reducing implementation costs such as time and processing resource costs.
[0189] Alternatively, if the accuracy of the new solution obtained by solving the first mathematical programming model using a pre-defined algorithm such as an uncertainty algorithm is no higher than that of the first solution, then the first solution can be used to update the pre-defined dataset. Furthermore, in some other examples, since the first solution is usually the initial solution of the objective, it is also possible to not optimize the first solution and directly use it to update the pre-defined dataset.
[0190] Update method 2: Update the preset solution corresponding to the existing preset tensor encoding in the preset dataset.
[0191] In some examples, the preset dataset is updated based on the first solution and the first tensor encoding, including:
[0192] The preset solution corresponding to the first preset tensor code in the preset dataset is updated based on the first solution or the optimized first solution. The similarity between the first preset tensor code and the first tensor code is higher than the similarity threshold. The optimized first solution is obtained by solving the first mathematical programming model based on the first solution using a preset algorithm, and the accuracy of the optimized first solution is higher than that of the first solution.
[0193] In this example, if the similarity between the first tensor encoding and the first preset tensor encoding in the preset dataset is higher than the similarity threshold (for example, in some examples, the similarity threshold is 98% or higher), then the first tensor encoding can be considered as an existing preset tensor encoding in the preset dataset. In this case, the first solution or the optimized first solution can replace the preset solution corresponding to the existing threshold tensor encoding to update the preset dataset.
[0194] As can be seen, in this embodiment of the application, the solution results of preset algorithms such as the uncertainty algorithm can be integrated with the solution results in the actual application scenario through a preset dataset. The preset dataset provides users with better initial solutions corresponding to each historical solution scenario in a deterministic manner, avoiding the uncertainty of the solution results of preset algorithms such as the uncertainty algorithm. In other words, it avoids the drawback of the non-reproducibility of preset algorithms such as the uncertainty algorithm in commercial delivery, thereby improving the user experience.
[0195] The encoder used in this embodiment can be a trained model. The encoder can be trained in a computing device cluster, or it can be trained on other devices and then transmitted and deployed to the computing device cluster.
[0196] The training process of this encoder is described below as an example.
[0197] In some embodiments, before processing the information of the first mathematical programming model through an encoder to obtain the first tensor code, the method further includes:
[0198] Based on the training data and the labels of the training data, the neural network is trained according to the loss function to obtain the trained neural network. The neural network includes a first encoder and a first solver network. The training data includes information of a second mathematical programming model. The labels of the training data include the preset solutions of the second mathematical programming model. The training data is the input of the first encoder. The output of the first encoder is the input of the first solver network. The loss function is used to evaluate the difference between the output of the first solver network and the labels of the training data.
[0199] The first encoder in the trained neural network is used as the encoder.
[0200] In this embodiment of the application, the first encoder can be regarded as the encoder to be trained, and the first solving network can be regarded as the solving network to be trained. The first encoder and the first solving network can be connected to train the first encoder and the first solving network. After the training is completed, the trained first encoder is obtained as the encoder deployed in the actual application scenario.
[0201] The first solving network can also be considered a generalized decoder, used to perform feature processing on the tensor encoding output by the first encoder to obtain the corresponding output result. The specific structure of the first solving network is not limited here, but for example, it may include convolutional layers and / or classifiers, etc.
[0202] The method of collecting the training data is not limited here. For example, the training data can be obtained from an open-source dataset, or it can be obtained from a pre-set dataset. It is evident that the second mathematical programming model in the training data can be the same as or different from the first mathematical programming model or the pre-set mathematical programming model. Furthermore, the number of training data sets is not limited here; typically, there can be multiple training data sets.
[0203] The labels of the training data include the preset solutions of the second mathematical programming model. During training, a loss function can be used to evaluate the difference between the output of the first solving network and the labels of the training data; for example, this loss function can be mean squared error (MSE) or cross entropy. Then, during the iteration process, the first encoder and the first solving network in the neural network can be iteratively updated based on the loss value of the loss function through backpropagation or other methods.
[0204] In this way, through training, the tensor code output by the first encoder can better reflect the characteristics of the information of the input second mathematical programming model, and the more accurate tensor code output by the first encoder can be used for feature processing and initial solution prediction through the first solving network to meet the solution requirements of actual solving scenarios.
[0205] In other words, the encoding method of the first encoder after training, which uses the preset solution of the second mathematical programming model as a label to train the neural network, can better reflect the information characteristics of the mathematical programming model. Furthermore, the tensor encoding features obtained by this encoding method can be well used to predict the initial solution of the mathematical programming model. That is to say, the encoding method of this encoder can be effectively applied to the current mathematical programming model solving scenario and is an encoding method suitable for the current solving scenario.
[0206] Therefore, the first encoder can be connected to the first solving network to obtain a neural network, which can then be trained. Furthermore, during training, a preset solution of the second mathematical programming model can be used as a label to calculate the loss value. In this way, the encoding method of the encoder obtained after training can better reflect the characteristics of the mathematical programming model and can be effectively applied to current mathematical programming model solving scenarios. That is to say, this training method can result in a encoder with good performance after training.
[0207] Of course, in the embodiments of this application, the encoder may also have other training methods.
[0208] For example, in some other examples, the first solving network can act as a decoder and be trained using an encoder-decoder training approach. For instance, in this example, the loss function is used to evaluate the difference between the output of the first solving network and the input of the first encoder (i.e., the information from the first mathematical programming model). In this example, labels on the training data may not be required.
[0209] After training, the accuracy and generalization performance of the trained neural network can be validated using validation data. For example, in some examples, neural networks with various structures can be constructed. After obtaining trained neural networks with various structures, the trained neural network with better accuracy and generalization performance can be selected from the trained neural networks based on validation data. The first encoder in this trained neural network with better accuracy and generalization performance is then used as the encoder for actual deployment. For example, in the example shown in Figure 6, the above-mentioned neural network training steps can be executed through a training engine to obtain an encoder after training, thereby generating the first tensor code and the preset tensor code in the preset dataset through this encoder.
[0210] The above describes the method for determining the initial solution provided by the embodiments of this application from multiple aspects. The following describes the apparatus for determining the initial solution provided by the embodiments of this application in conjunction with the accompanying drawings.
[0211] As shown in Figure 7, this embodiment of the application provides a device 70 for determining an initial solution, the device 70 for determining an initial solution includes:
[0212] Processing module 701 is used for:
[0213] Obtain information about the first mathematical programming model; the information about the first mathematical programming model is used to indicate the first mathematical programming model to be solved.
[0214] Calculate the similarity between the first mathematical programming model and at least one preset mathematical programming model, where each preset mathematical programming model has a preset solution;
[0215] Obtain the target initial solution, which is a preset solution of at least one preset mathematical programming model whose similarity to the first mathematical programming model meets a specified condition. The target initial solution is used to: determine the initial solution of the first mathematical programming model and solve the first mathematical programming model.
[0216] Optionally, the processing module 701 is used for:
[0217] The information of the first mathematical programming model is processed by the encoder to obtain the first tensor code;
[0218] Calculate the similarity between the first tensor code and at least one preset tensor code, wherein any preset tensor code is obtained by encoding information of a preset mathematical programming model through an encoder, and any preset tensor code corresponds to a preset solution of a preset data programming model corresponding to the preset tensor code, and the target initial solution is the preset solution corresponding to the preset tensor code among at least one preset tensor code whose similarity with the first tensor code satisfies a specified condition.
[0219] Optionally, at least one preset tensor code is included in one or more preset tensor codes of a preset dataset, and the preset dataset records the preset solutions corresponding to each of the one or more preset tensor codes;
[0220] Processing module 701 is used for:
[0221] Obtain the first solution of the first mathematical programming model. The first solution is obtained by solving the first mathematical programming model based on the initial objective solution.
[0222] Update the preset dataset based on the first solution and the first tensor encoding.
[0223] Optionally, the processing module 701 is used to: use the first tensor encoding as a new preset tensor encoding in the preset dataset, and obtain a preset solution corresponding to the new preset tensor encoding in the preset dataset based on the first solution or the optimized first solution, wherein the optimized first solution is obtained by solving the first mathematical programming model based on the first solution using a preset algorithm, and the accuracy of the optimized first solution is higher than that of the first solution.
[0224] Optionally, the processing module 701 is used to: update the preset solution corresponding to the first preset tensor code in the preset dataset according to the first solution or the optimized first solution, wherein the similarity between the first preset tensor code and the first tensor code is higher than the similarity threshold, the optimized first solution is obtained by solving the first mathematical programming model according to the first solution through a preset algorithm, and the accuracy of the optimized first solution is higher than that of the first solution.
[0225] Optionally, the processing module 701 is used for:
[0226] By using a deterministic algorithm, each initial solution of the objective is taken as the initial solution to obtain multiple second solutions of the first mathematical programming model;
[0227] The solution with the highest accuracy among multiple second solutions is taken as the first solution of the first mathematical programming model.
[0228] Optionally, the processing module 701 is used for:
[0229] Using a deterministic algorithm, the initial solution of the objective is taken as the initial solution to obtain the second solution of the first mathematical programming model;
[0230] The third solution to the first mathematical programming model is obtained by solving the uncertainty algorithm.
[0231] The solution with higher accuracy between the second and third solutions is taken as the first solution of the first mathematical programming model.
[0232] Optionally, the information in the first mathematical programming model includes the constraints of the first mathematical programming model.
[0233] Optionally, the device 70 for determining the initial solution further includes a training module 702;
[0234] Training module 702 is used for:
[0235] Based on the training data and the labels of the training data, the neural network is trained according to the loss function to obtain the trained neural network. The neural network includes a first encoder and a first solver network. The training data includes information of a second mathematical programming model. The labels of the training data include the preset solutions of the second mathematical programming model. The training data is the input of the first encoder. The output of the first encoder is the input of the first solver network. The loss function is used to evaluate the difference between the output of the first solver network and the labels of the training data.
[0236] The first encoder in the trained neural network is used as the encoder.
[0237] Both the processing module and the training module can be implemented in software or hardware. For example, the implementation of the processing module will be described below. Similarly, the implementation of the training module can be referenced from that of the processing module.
[0238] As an example of a software functional unit, a processing module may include code running on a computing instance. A computing instance may include at least one of a physical host (computing device), a virtual machine, or a container. Furthermore, the aforementioned computing instance may be one or more. For example, a processing module 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 within the same region or in different regions. Further, the multiple hosts / virtual machines / containers used to run the code may be distributed within the same availability zone (AZ) or in different AZs, each AZ comprising one or more geographically proximate data centers. Typically, a region may include multiple AZs.
[0239] Similarly, multiple hosts / virtual machines / containers used to run this code can be distributed within the same Virtual Private Cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to enable interconnection between VPCs.
[0240] As an example of a hardware functional unit, a processing module may include at least one computing device, such as a server. Alternatively, a processing module may be implemented using a central processing unit (CPU), an application-specific integrated circuit (ASIC), or a programmable logic device (PLD). The aforementioned PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), a data processing unit (DPU), a neural network processing unit (NPU), a system-on-chip (SoC), an offload card, an accelerator card, or any combination thereof.
[0241] The processing module comprises multiple computing devices that can be distributed within the same region or in different regions. Similarly, the processing module can be distributed within the same Availability Zone (AZ) or in different AZs. Likewise, the processing module can be distributed within the same Virtual Private Cloud (VPC) or multiple VPCs. These computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, GALs, DPUs, NPUs, SoCs, offloading cards, and accelerator cards.
[0242] It should be noted that, in other embodiments, the processing module can be used to execute any step in the method for determining the initial solution, and the training module can be used to execute any step in the method for determining the initial solution. The steps that the processing module or the training module is responsible for implementing can be specified as needed. The processing module or the training module can implement different steps in the method for determining the initial solution to realize all the functions of the device for determining the initial solution.
[0243] This application also provides a computing device 80. As shown in FIG8, the computing device 80 includes a bus 82, a processor 84, a memory 86, and a communication interface 88. The processor 84, the memory 86, and the communication interface 88 communicate with each other via the bus 82. The computing device 80 may be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in the computing device 80.
[0244] Bus 82 can be a Peripheral Component Interconnect Express (PCIe) bus, an Extended Industry Standard Architecture (EISA) bus, a Unified Bus (Ubus or UB), a Compute Express Link (CXL), a Cache Coherent Interconnect for Accelerators (CCIX), etc. The Unified Bus is also known as the Lingqu Bus. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, only one line is used in Figure 8, but this does not indicate that there is only one bus or one type of bus. Bus 82 can include pathways for transmitting information between various components of the computing device 80 (e.g., memory 86, processor 84, communication interface 88).
[0245] The processor 84 may include any one or more computing devices such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP) or a digital signal processor (DSP), an ASIC, an FPGA, a CPLD, an NPU, a SoC, an offload card, or an accelerator card.
[0246] Memory 86 may include volatile memory, such as random access memory (RAM). Memory 86 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD) or one or more of these. Furthermore, memory 86 may be implemented using storage class memory (SCM), phase change memory (PCM), or other types of storage media.
[0247] It is worth noting that the same type of storage medium can be configured in the same computing device to realize the function of memory 86, or two or more types of storage media can be configured to realize the function of memory 86. This application does not limit this.
[0248] The memory 86 stores executable program code, and the processor 84 executes the executable program code to implement the functions of the aforementioned training module and processing module, thereby implementing the method for determining the initial solution applied to the computing device cluster in the above embodiments. That is, the memory 86 stores instructions for executing the method for determining the initial solution applied to the computing device cluster in the above embodiments.
[0249] The communication interface 88 uses transceiver modules, such as, but not limited to, network interface cards and transceivers, to enable communication between the computing device 80 and other devices or communication networks.
[0250] This application also provides a computing device cluster. The computing device cluster includes at least one computing device. 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.
[0251] As shown in Figure 9, the computing device cluster includes at least one computing device 80. The memory 86 of one or more computing devices 80 in the computing device cluster may store the same instructions for executing a method to determine an initial solution.
[0252] In some possible implementations, the memory 86 of one or more computing devices 80 in the computing device cluster may also store partial instructions for executing the method of determining the initial solution. In other words, a combination of one or more computing devices 80 can jointly execute the instructions for executing the method of determining the initial solution.
[0253] It should be noted that the memory 86 in different computing devices 80 within the computing device cluster can store different instructions, each used to execute a portion of the function of the method for determining the initial solution. That is, the instructions stored in the memory 86 of different computing devices 80 can implement the functions of one or more modules in the training module and processing module.
[0254] In some possible implementations, one or more computing devices in a computing device cluster can be connected via a network. This network can be a wide area network (WAN) or a local area network (LAN), etc. Figure 10 illustrates one possible implementation. As shown in Figure 10, two computing devices 80A and 80B are connected via a network. Specifically, they are connected to the network through communication interfaces in each computing device. In this type of possible implementation, the memory 86 in computing device 80A can store instructions for executing the functions of the training module. Simultaneously, the memory 86 in computing device 80B can store instructions for executing the functions of the processing module. Alternatively, the memory 86 in computing device 80A can store instructions for executing part of the functions of the processing module. Simultaneously, the memory 86 in computing device 80B can store instructions for executing another part of the functions of the processing module.
[0255] It should be understood that the functions of computing device 80A shown in Figure 10 can also be performed by multiple computing devices 80. Similarly, the functions of computing device 80B can also be performed by multiple computing devices 80.
[0256] This application also provides another computing device cluster. The connection relationship between the computing devices in this computing device cluster can be similarly referred to the connection method of the computing device clusters in Figures 9 and 10. The difference is that the memory 86 of one or more computing devices 80 in this computing device cluster can store the same instructions for executing the method of determining the initial solution.
[0257] In some possible implementations, the memory 86 of one or more computing devices 80 in the computing device cluster may also store partial instructions for executing the method of determining the initial solution. In other words, a combination of one or more computing devices 80 can jointly execute the instructions for executing the method of determining the initial solution.
[0258] It should be noted that the memory 86 in different computing devices 80 within the computing device cluster can store different instructions for executing parts of the function of the method for determining the initial solution. That is, the instructions stored in the memory 86 of different computing devices 80 can implement the functions of one or more modules in the training module and processing module.
[0259] This application also provides a computer program product containing instructions. The computer program product may be a software or program product containing instructions, capable of running on a computing device or stored on any usable medium. When the computer program product is run on at least one computing device, it causes the at least one computing device to perform a method for determining an initial solution.
[0260] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computing device can store, or a data storage device such as a data center that includes one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to perform a method for determining an initial solution.
[0261] This application also provides a chip system including a processor for implementing the steps performed by the aforementioned computing device cluster. In one possible design, the chip system may further include a memory for storing necessary program instructions and data. This chip system may be composed of chips or may include chips and other discrete devices.
[0262] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0263] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0264] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0265] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0266] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A method for determining an initial solution, characterized in that, The method includes: Obtain information about the first mathematical programming model, which is used to indicate the first mathematical programming model to be solved; Calculate the similarity between the first mathematical programming model and at least one preset mathematical programming model, each of which has a preset solution; Obtain a target initial solution, wherein the target initial solution is a preset solution of a preset mathematical programming model whose similarity to the first mathematical programming model satisfies a specified condition among the at least one preset mathematical programming model, and the target initial solution is used to: determine the initial solution of the first mathematical programming model and solve the first mathematical programming model.
2. The method according to claim 1, characterized in that, The calculation of the similarity between the first mathematical programming model and at least one preset mathematical programming model includes: The information of the first mathematical programming model is processed by the encoder to obtain the first tensor code; Calculate the similarity between the first tensor code and at least one preset tensor code, wherein any preset tensor code is obtained by encoding information of a preset mathematical programming model through the encoder, and any preset tensor code corresponds to a preset solution of a preset data programming model corresponding to the preset tensor code, and the target initial solution is the preset solution corresponding to the preset tensor code among the at least one preset tensor code whose similarity with the first tensor code satisfies the specified condition.
3. The method according to claim 2, characterized in that, The at least one preset tensor encoding is included in one or more preset tensor encodings in a preset dataset, and the preset dataset records a preset solution corresponding to each of the one or more preset tensor encodings; After obtaining the initial solution to the objective, the method further includes: Obtain the first solution of the first mathematical programming model, wherein the first solution is obtained by solving the first mathematical programming model based on the target initial solution; Update the preset dataset based on the first solution and the first tensor encoding.
4. The method according to claim 3, characterized in that, The step of updating the preset dataset based on the first solution and the first tensor encoding includes: The first tensor encoding is used as a new preset tensor encoding in the preset dataset. Furthermore, a preset solution corresponding to the new preset tensor encoding in the preset dataset is obtained based on the first solution or the optimized first solution. The optimized first solution is obtained by solving the first mathematical programming model based on the first solution using a preset algorithm, and the accuracy of the optimized first solution is higher than that of the first solution.
5. The method according to claim 3, characterized in that, The step of updating the preset dataset based on the first solution and the first tensor encoding includes: The preset solution corresponding to the first preset tensor code in the preset dataset is updated according to the first solution or the optimized first solution. The similarity between the first preset tensor code and the first tensor code is higher than the similarity threshold. The optimized first solution is obtained by solving the first mathematical programming model according to the first solution through a preset algorithm, and the accuracy of the optimized first solution is higher than that of the first solution.
6. The method according to any one of claims 1-5, characterized in that, The number of initial target solutions is multiple. After obtaining the initial target solutions, the method further includes: Using a deterministic algorithm, each of the target initial solutions is taken as an initial solution to solve the first mathematical programming model, thereby obtaining multiple second solutions to the first mathematical programming model. The solution with the highest accuracy among the multiple second solutions is taken as the first solution of the first mathematical programming model.
7. The method according to any one of claims 1-5, characterized in that, After obtaining the initial solution to the objective, the method further includes: Using a deterministic algorithm, the initial solution of the objective is used as the initial solution to solve the first mathematical programming model, thereby obtaining the second solution of the first mathematical programming model. The first mathematical programming model is solved using an uncertainty algorithm to obtain a third solution to the first mathematical programming model. The solution with higher accuracy between the second solution and the third solution is taken as the first solution of the first mathematical programming model.
8. The method according to any one of claims 1-7, characterized in that, The information in the first mathematical programming model includes the constraints of the first mathematical programming model.
9. The method according to any one of claims 1-8, characterized in that, Before processing the information of the first mathematical programming model through the encoder to obtain the first tensor code, the method further includes: Based on the training data and the labels of the training data, a neural network is trained using a loss function to obtain the trained neural network. The neural network includes a first encoder and a first solver network. The training data includes information about a second mathematical programming model. The labels of the training data include preset solutions of the second mathematical programming model. The training data is the input of the first encoder, and the output of the first encoder is the input of the first solver network. The loss function is used to evaluate the difference between the output of the first solver network and the labels of the training data. The first encoder in the trained neural network is used as the encoder.
10. An apparatus for determining an initial solution, characterized in that, include: Processing module, used for: Obtain information about the first mathematical programming model, which is used to indicate the first mathematical programming model to be solved; Calculate the similarity between the first mathematical programming model and at least one preset mathematical programming model, each of which has a preset solution; Obtain a target initial solution, wherein the target initial solution is a preset solution of a preset mathematical programming model whose similarity to the first mathematical programming model satisfies a specified condition among the at least one preset mathematical programming model, and the target initial solution is used to: determine the initial solution of the first mathematical programming model and solve the first mathematical programming model.
11. The apparatus according to claim 10, characterized in that, The processing module is used for: The information of the first mathematical programming model is processed by the encoder to obtain the first tensor code; Calculate the similarity between the first tensor code and at least one preset tensor code, wherein any preset tensor code is obtained by encoding information of a preset mathematical programming model through the encoder, and any preset tensor code corresponds to a preset solution of a preset data programming model corresponding to the preset tensor code, and the target initial solution is the preset solution corresponding to the preset tensor code among the at least one preset tensor code whose similarity with the first tensor code satisfies the specified condition.
12. The apparatus according to claim 11, characterized in that, The at least one preset tensor encoding is included in one or more preset tensor encodings in a preset dataset, and the preset dataset records a preset solution corresponding to each of the one or more preset tensor encodings; The processing module is used for: Obtain the first solution of the first mathematical programming model, wherein the first solution is obtained by solving the first mathematical programming model based on the target initial solution; Update the preset dataset based on the first solution and the first tensor encoding.
13. The apparatus according to claim 12, characterized in that, The processing module is configured to: use the first tensor encoding as a new preset tensor encoding in the preset dataset, and obtain a preset solution corresponding to the new preset tensor encoding in the preset dataset based on the first solution or the optimized first solution, wherein the optimized first solution is obtained by solving the first mathematical programming model based on the first solution using a preset algorithm, and the accuracy of the optimized first solution is higher than that of the first solution.
14. The apparatus according to claim 12, characterized in that, The processing module is used to: update the preset solution corresponding to the first preset tensor code in the preset dataset according to the first solution or the optimized first solution, wherein the similarity between the first preset tensor code and the first tensor code is higher than the similarity threshold, the optimized first solution is obtained by solving the first mathematical programming model according to the first solution through a preset algorithm, and the accuracy of the optimized first solution is higher than that of the first solution.
15. The apparatus according to any one of claims 10-14, characterized in that, The number of the target initial solutions is multiple; The processing module is used for: By using a deterministic algorithm, each of the target initial solutions is taken as an initial solution to obtain multiple second solutions to the first mathematical programming model; The solution with the highest accuracy among the multiple second solutions is taken as the first solution of the first mathematical programming model.
16. The apparatus according to any one of claims 10-14, characterized in that, The processing module is used for: Using a deterministic algorithm, the initial solution of the objective is taken as the initial solution to obtain the second solution of the first mathematical programming model; The first mathematical programming model is solved using an uncertainty algorithm to obtain a third solution to the first mathematical programming model. The solution with higher accuracy between the second solution and the third solution is taken as the first solution of the first mathematical programming model.
17. The apparatus according to any one of claims 10-16, characterized in that, The information in the first mathematical programming model includes the constraints of the first mathematical programming model.
18. The apparatus according to any one of claims 10-17, characterized in that, It also includes a training module; The training module is used for: Based on the training data and the labels of the training data, a neural network is trained using a loss function to obtain the trained neural network. The neural network includes a first encoder and a first solver network. The training data includes information about a second mathematical programming model. The labels of the training data include preset solutions of the second mathematical programming model. The training data is the input of the first encoder, and the output of the first encoder is the input of the first solver network. The loss function is used to evaluate the difference between the output of the first solver network and the labels of the training data. The first encoder in the trained neural network is used as the encoder.
19. A computing device cluster, characterized in that, It includes at least one computing device, said at least one computing device including a processor and a memory; The processor is configured to execute instructions stored in the memory to cause the computing device cluster to perform the method as described in any one of claims 1-9.
20. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when run on a processor, causes the processor to perform the method as described in any one of claims 1-9.
21. A computer program product containing instructions, characterized in that, When the instructions are executed by the processor, the method described in any one of claims 1-9 is implemented.
Citation Information
Patent Citations
Method for selecting clustering initial points based on user behavior characteristics and related equipment
CN110413854A
Initial solution optimization method based on dynamic programming in variable relation identification of distribution network cable
CN110826776A
Task solving method and device
CN114237835A
Optimization method for a computer system
US20160104066A1
Method for refining the initial conditions for clustering with applications to small and large database clustering
US6115708A