Data processing method
By constructing multiple sets of initial solutions in the linear programming model for parallel solving and combining the interior point method and matrix decomposition algorithm to optimize the solution path, the problems of slow solution speed and difficulty in convergence caused by the sensitivity of the initial solution in the traditional method are solved, and a more efficient linear programming solution is achieved.
Patent Information
- Application Number
- CN202510712607.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-09-19
AI Technical Summary
When solving linear programming problems, existing technologies, especially in production and distribution scenarios in the supply chain, have the problem of being sensitive to the initial solution selection, resulting in slow solution speed or difficulty in convergence. Especially in the case of large-scale decision variables, traditional interior point methods have the problem of some variables reaching the boundary too early, resulting in a reduced iteration step size and low solution efficiency.
Construct a linear programming model, determine at least two sets of initial solutions, use the interior point method to solve in parallel and iteratively update, optimize the solution path through the neighborhood graph and matrix decomposition algorithm, combine the perturbation coefficient and complementary relaxation coefficient, dynamically adjust the value boundary of the decision variable and the iteration step size, and optimize the solution process.
It effectively avoids the problem of difficult solution convergence caused by some variables reaching the boundary too early, improves the solution efficiency and speed of the linear programming model, and significantly accelerates the solution process, especially in the case of large-scale decision variables.
Smart Images

Figure CN120671966A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to, but is not limited to, the field of computer technology, and in particular to data processing. Background Art
[0002] Linear programming is the study of the extreme value problem of linear objective functions under linear constraints. It is widely used in many fields such as economics, management, and engineering, and can provide a scientific decision-making basis for generating plans and allocating resources. Summary of the Invention
[0003] In view of this, the present application provides at least one data processing method. The technical solution of the present application is implemented as follows:
[0004] The data processing method provided in this application includes:
[0005] Constructing a linear programming model; the decision variables of the linear programming model represent the quantity of products transported from a production location to a sales location; the constraints of the linear programming model include at least a product production quantity constraint for at least one production location and a product demand quantity constraint for at least one sales location; and the objective of the linear programming model is to minimize at least one of product production cost and transportation cost;
[0006] Determine at least two sets of initial solutions corresponding to the linear programming model;
[0007] A linear programming model is solved in parallel using an interior point method based on at least two sets of initial solutions, so as to iteratively update the at least two sets of initial solutions; wherein, for at least one solution process corresponding to each set of initial solutions, an updated solution of the initial solution is determined based on solution information of at least one set of initial solutions other than the initial solutions; the solution information includes at least updated information of the value boundaries of the decision variables;
[0008] In response to an updated solution corresponding to at least one initial solution satisfying a convergence condition, the updated solution satisfying the convergence condition is used as a target solution of the linear programming model.
[0009] In some embodiments, determining at least two initial solutions corresponding to the linear programming model includes:
[0010] Determine the first solution based on the constraints of the linear programming model;
[0011] The first solution is updated respectively by using at least two perturbation coefficients to obtain at least two initial solutions; each initial solution is within the feasible region of the linear programming model.
[0012] In some embodiments, using at least two perturbation coefficients to update the first solution separately to obtain at least two initial solutions includes:
[0013] Determine the dual model corresponding to the linear programming model;
[0014] Based on the linear programming model and the dual model, a perturbation heuristic algorithm is used to generate at least two complementary relaxation coefficients;
[0015] The first solution is updated respectively using at least two complementary relaxation coefficients to obtain at least two initial solutions.
[0016] In some embodiments, for each set of initial solutions, performing a current solution on the linear programming model includes:
[0017] Obtain at least one neighborhood graph corresponding to at least one set of initial solutions other than the initial solution; the neighborhood graph represents a graph structure composed of value boundaries of multiple decision variables;
[0018] Determining an update direction and an update step size of the current solution based on a current solution of the initial solution in the current solution, at least one neighborhood graph, and constraints of the linear programming model;
[0019] Based on the update direction and update step size of the current solution, the current solution is updated to obtain the updated solution corresponding to the target initial solution in the current solution.
[0020] In some embodiments, determining an update direction and an update step size for the current solution based on the current solution of the initial solution in the current solution, at least one neighborhood graph, and constraints of the linear programming model includes:
[0021] Construct iterative equations based on the linear programming model and the dual model of the linear programming model;
[0022] Based on the current solution and at least one neighborhood graph, performing a first calculation using an iterative equation to obtain an update direction and an update step size of the current solution;
[0023] In which, a first matrix decomposition algorithm is used to perform matrix decomposition on the matrix in the first calculation; the first matrix decomposition algorithm is different from the second matrix decomposition algorithm; and the second matrix decomposition algorithm represents the matrix decomposition algorithm used in the process of iterating at least one initial solution other than the initial solution.
[0024] In some embodiments, the current solution represents a solution process after executing a specified number of iterations on the initial solution using the first matrix decomposition algorithm;
[0025] The method further includes:
[0026] In response to an updated solution corresponding to the current solution not satisfying a preset convergence condition, the first matrix decomposition algorithm is updated using a third matrix decomposition algorithm; the third matrix decomposition algorithm is different from the first matrix decomposition algorithm.
[0027] In some embodiments, the linear programming model includes at least one first decision variable; each first decision variable has a value boundary;
[0028] Determining an update direction and an update step size of the current solution based on a current solution of the initial solution in the current solution, at least one neighborhood graph, and constraints of the linear programming model, including:
[0029] Determine an update direction and a maximum step size for the current solution based on the current solution, at least one neighborhood graph, and constraints of the linear programming model;
[0030] For each first decision variable, calculating a first distance between the value of the first decision variable in the current solution and the value boundary of the first decision variable;
[0031] In response to at least one first distance being less than a distance threshold, taking the first step length as an updated step length; the first step length being less than a maximum step length;
[0032] In response to each first distance being not less than the distance threshold, the maximum step length is used as the update step length.
[0033] In some embodiments, the update step size of the current solution is smaller than a preset step size threshold;
[0034] The method further includes:
[0035] Based on the updated solution of the current solution and the constraints of the linear programming model, determine the first step length of the next solution corresponding to the current solution;
[0036] Based on the first step size of the next solution and the first correction coefficient, the update step size of the next solution is determined.
[0037] In some embodiments, the linear programming problem includes a second decision variable; the value of the second decision variable in the updated solution currently solved is within the value boundary of the second decision variable;
[0038] The method further includes:
[0039] determining a second correction coefficient of the second decision variable based on at least one constraint condition including the second decision variable, wherein the second correction coefficient represents a maximum uncorrectable value or a minimum uncorrectable value corresponding to the second decision variable;
[0040] Determining an updated value of the second decision variable based on the value of the second decision variable in the updated solution obtained currently and the second correction coefficient;
[0041] Based on the updated value of the second decision variable, the updated solution of the current solution is updated.
[0042] In some embodiments, the linear programming model includes a third decision variable; the third decision variable has a value boundary;
[0043] The method also includes:
[0044] Based on the updated information of the third decision variable in the multiple solution processes corresponding to the initial solution, updating the value boundary of the third decision variable corresponding to the initial solution;
[0045] Based on the update result of the value boundary of the third decision variable corresponding to the initial solution, the value boundary of the third decision variable corresponding to at least one initial solution is updated.
[0046] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and do not limit the technical solutions of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and, together with the specification, are used to illustrate the technical solutions of the present application.
[0048] Figure 1 Schematic diagram of the search process for finding the optimal solution to a linear programming problem using the simplex method;
[0049] Figure 2 Schematic diagram of the search process for finding the optimal solution to a linear programming problem using the interior point method;
[0050] Figure 3 A schematic diagram of the implementation flow of a data processing method provided in this application;
[0051] Figure 4 A schematic diagram of an implementation flow of an embodiment provided in this application;
[0052] Figure 5 A schematic diagram of the structure of a data processing device provided in this application;
[0053] Figure 6 A schematic diagram of the hardware entity of an electronic device provided in this application. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions of this application are further elaborated in detail below with reference to the accompanying drawings and embodiments. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0055] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0056] The terms "first / second / third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It is understandable that "first / second / third" can be interchanged with a specific order or sequence where permitted so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing this application only and are not intended to limit this application.
[0058] The general form of linear programming is shown in the following formula (1):
[0059]
[0060] Wherein, C represents the coefficient vector of the objective function in the linear programming, A represents the constraint matrix in the constraint conditions of the linear programming, b represents the constraint vector, and x represents the decision variable. Generally, a linear programming includes at least one decision variable.
[0061] According to the optimality theorem, if a linear programming problem has an optimal solution, it must be a vertex in the feasible region. Therefore, the process of finding the optimal solution to a linear programming problem is to continuously approach the optimal vertex of the feasible region. In related technologies, common methods for solving linear programming problems include the simplex method and the interior point method.
[0062] The solution idea of the simplex method is to initialize a feasible domain vertex, and use the algorithm to iterate through different feasible domain vertices, and finally stop the iteration at the vertex where the optimal solution is located. Figure 1 This figure illustrates the search process for the optimal solution to a linear programming problem using the simplex method. The linear programming problem consists of two decision variables, x1 and x1. The area within ring 110 represents the feasible region of the linear programming problem. Point 120 represents an initial solution initialized at a vertex of the feasible region. Point 130 represents the optimal solution to the linear programming problem. When solving the linear programming problem using the simplex method, the optimal solution 130 is reached after multiple searches starting from the initial solution 120 and following the arrows in the figure.
[0063] It can be seen that since the simplex method determines the optimal solution by traversing the vertices of the feasible domain, the simplex method may have the following problems: it is sensitive to the initial solution, that is, if the initial solution is not guessed well, it may lead to a slow solution speed, or even cause the solution time to increase exponentially, or fail to find the optimal solution; in addition, the simplex method may fall into a loop in some cases (for example, the feasible domain of the linear programming problem is concave), and fail to find the optimal solution; and so on.
[0064] The solution idea of the interior point method is to initialize an initial solution within the feasible domain, calculate a better solution direction, continuously move from the interior of the feasible domain to the boundary of the feasible domain, stop optimizing near the optimal solution, and reach the optimal solution through methods such as crossover. Figure 2 Figure 2 is a schematic diagram of the search process for finding the optimal solution to a linear programming problem using the interior point method. The linear programming problem includes two decision variables, x1 and x2. The area inside ring 210 is the feasible region of the linear programming problem. Point 220 is an initial solution initialized within the feasible region. Point 330 is the optimal solution to the linear programming problem. When solving a linear programming problem using the interior point method, starting from initial solution 220 within the feasible region, the solution update direction is determined based on the constraints of the linear programming problem. Finally, after multiple searches along the arrows in the figure, the optimal solution 230 is reached.
[0065] It can be seen that compared with the simplex method, the solution speed of the interior point method is less correlated with the choice of the initial solution. However, during the iterative process of the interior point method, when some decision variables are close to the boundary, in order to prevent these decision variables from crossing the boundary, it is necessary to reduce the iteration step size of all decision variables. This causes the entire iterative process to be almost stagnant, and it takes a long time to complete the solution. Specifically, in the solution process of the traditional interior point method, first, based on the linear programming problem and the dual problem of the linear programming, an initial solution (x0, y0, s0) is initialized, where s and y are the decision variables in the dual problem, and the values of s and x have a one-to-one correspondence; then, an augmented matrix equation system is constructed according to the Lagrangian constraint equation, and the forward direction of the feasible solution (Δx0, Δy0, Δs0) is calculated using the Newton method; then, the initial solution is updated using the following formulas (2) and (3):
[0066]
[0067] in, and represent the update step sizes in the linear programming problem and the dual problem, respectively.
[0068] According to formula (1), the decision variables x and s are both greater than or equal to 0, and the forward direction (Δx i , Δyi , Δs i ) is a fixed value, so in order to make the updated decision variable still satisfy the constraint greater than or equal to 0, the update step size must be limited. The value range of .
[0069] In practical problems, there are usually multiple decision variables, and the size of the update step size often depends on the update step size of the decision variable with the smallest gradient direction. For example, in the example shown in the following formula (4), since the solution x before the update is i There is a decision variable with a value of 0.02. In order to make the values of all decision variables greater than 0 after update, it is necessary to limit the update step size to be less than or equal to 0.02, which causes the update step size of other decision variables to be too small.
[0070]
[0071] In actual industrial production environments, the number of decision variables may be in the tens of thousands, hundreds of thousands, or even millions. When using the interior point method for solving problems, the update step size of the entire problem often becomes smaller because some decision variables reach the boundary too early, ultimately causing the convergence speed of the entire problem to drop significantly.
[0072] Based on this, the present application provides a data processing method, which can be executed by an electronic device, which can be various types of terminals such as laptops, tablet computers, desktop computers, set-top boxes, mobile devices (for example, mobile phones, personal digital assistants, dedicated messaging devices), etc., and can also be implemented as a server. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0073] Below, the technical solution of this application will be clearly and completely described in conjunction with the drawings in this application.
[0074] Figure 3 A schematic diagram of the implementation flow of a data processing method provided in this application, such as Figure 3 As shown, the method includes the following steps S31 to S34:
[0075] Step S31, constructing a linear programming model; the decision variables of the linear programming model represent the quantity of products transported from the production site to the sales site; the constraints of the linear programming model include at least a product production quantity constraint for at least one production site, and a product demand quantity constraint for at least one sales site; the goal of the linear programming model is to minimize at least one of product production cost and transportation cost.
[0076] Here, a linear programming model corresponding to the linear programming problem is constructed for the production and distribution scenarios in the supply chain.
[0077] The decision variable represents the number of products shipped from different production locations to different sales locations. For example, if there are m production locations and n sales locations, the decision variable represents the number of products shipped from each of the m production locations to each of the n sales locations. Thus, the linear programming model includes m × n decision variables.
[0078] The constraints include at least a product production quantity constraint for at least one production site and a product demand quantity constraint for at least one sales site. For example, in the above embodiment, the product production quantity constraint for at least one production site may include a production capacity constraint for each production site; the product demand quantity constraint for at least one sales site may include a maximum product demand quantity constraint for each sales site. In some embodiments, the constraints may also include a cost constraint for producing a unit of product at the production site, a cost constraint for transporting a unit of product from the production site to the sales site, or a constraint that the product supply quantity from any production site to any sales site cannot be negative.
[0079] The objective of the linear programming model is to minimize at least one of product production cost and transportation cost. Here, minimizing product production cost means, while satisfying the aforementioned constraints, minimizing the product production cost. Minimizing transportation cost means, while satisfying the aforementioned constraints, minimizing the product transportation cost.
[0080] Thus, in the following implementation, for the production and distribution scenario in the supply chain, a linear programming model as shown in the following formula (5) can be constructed:
[0081]
[0082] in,
[0083] Z represents the sum of production cost and transportation cost;
[0084] m represents the total number of spawning sites;
[0085] i represents the i-th production site;
[0086] P i represents the production capacity of the i-th production site;
[0087] C i represents the cost of producing a unit of product at the i-th production location;
[0088] n represents the total number of sales locations;
[0089] j represents the jth sales location;
[0090] x ij represents the quantity of products transported from the i-th production location to the j-th sales location;
[0091] D j represents the product demand in the jth sales location;
[0092] T ij It represents the cost of transporting a unit of product from production location i to sales location j.
[0093] By solving the above linear programming model, we can determine the quantity of products shipped from each production location to each sales location when the total production cost and transportation cost are minimized.
[0094] Step S32: determining at least two groups of initial solutions corresponding to the linear programming model.
[0095] Here, the initial solution refers to a set of feasible solutions that initialize the decision variables of the linear programming model based on the constraints and objectives of the linear programming model. The initial solution lies within the feasible region of the linear programming model. The feasible region of a linear programming model is the set of decision variables that satisfies all the constraints of the linear programming model. Geometrically, the feasible region of a linear programming model is typically a convex polygon or polyhedron, where each point in the polygon or polyhedron represents a set of feasible solutions corresponding to the linear programming model.
[0096] In some embodiments, at least two sets of initial solutions can be determined using any suitable method. In some embodiments, any two or more points within the feasible region of the linear programming model can be determined as the at least two sets of initial solutions. In some embodiments, a central point within the feasible region of the linear programming model can be first determined, and then the central point can be perturbed using at least two specified values to obtain the at least two sets of initial solutions.
[0097] Step S33, using the interior point method, the linear programming model is solved in parallel based on the at least two groups of initial solutions, so as to iteratively update the at least two groups of initial solutions; wherein, for at least one solution process corresponding to each group of the initial solutions, the updated solution of the initial solution is determined based on the solution information of at least one group of initial solutions other than the initial solution; the solution information includes at least the update information of the value boundaries of the decision variables.
[0098] Here, using the interior point method, we solve the linear programming model multiple times, starting with at least two sets of initial solutions. During each solution, we iteratively update the corresponding initial solution. This way, for each set of initial solutions, we can generate the iterative path corresponding to that set of initial solutions, as well as the solution information from each iteration.
[0099] In some embodiments, the solution information includes update information for the value boundaries of decision variables. The value boundaries of a decision variable refer to at least one of the maximum and minimum values that the corresponding decision variable can take. The value boundary update information refers to the corresponding change trend or change information presented by each decision variable as the number of decision variable iterations increases during the solution process. Based on this change information, a smaller value range can be determined for the corresponding decision variable, thereby updating the value boundary.
[0100] In some embodiments, the solution information includes information indicating that the values of some decision variables have reached or are close to corresponding value boundaries. The fact that the value of a decision variable has reached a corresponding value boundary means that the value of the decision variable in the current solution is at the boundary value of the decision variable; and the fact that the value of a decision variable is close to a corresponding value boundary means that the distance between the value of the decision variable in the current solution and the corresponding value boundary is less than a preset threshold.
[0101] In at least one solution process corresponding to each group of initial solutions, determining an updated solution of the initial solution based on the solution information of at least one group of initial solutions other than the initial solution means correcting the solution process corresponding to the current initial solution based on the iterative path of the at least one initial solution and the solution information corresponding to the iterative path, for example, correcting the iterative direction and / or iterative step size corresponding to the current initial solution.
[0102] In some embodiments, when the solution information includes updated information about the value boundaries of decision variables, determining an updated solution for the initial solution based on the solution information of at least one set of initial solutions other than the initial solution can involve using the updated information about the value boundaries of the decision variables determined during the iteration of the at least one set of initial solutions to update the constraints in the solution process corresponding to the current initial solution, and solving the linear programming model based on the updated constraints. For example, when the solution information corresponding to the at least one set of initial solutions indicates that the value boundaries of a specified decision variable have been narrowed, based on the solution information, the value boundaries of the specified decision variable will be correspondingly narrowed in the current solution process corresponding to the current initial solution, and the linear programming model will be solved based on the narrowed value boundaries.
[0103] In some embodiments, when the solution information represents that the values of some decision variables have reached the corresponding value boundaries, an updated solution of the initial solution is determined based on the solution information of at least one group of initial solutions other than the initial solution. The solution information can be based on the fact that the values of some decision variables have reached the value boundaries. In the current solution process corresponding to the current initial solution, the iteration step size of the some decision variables is reduced or the iteration direction of the some decision variables is corrected.
[0104] Step S34: In response to an updated solution corresponding to at least one initial solution satisfying a convergence condition, the updated solution satisfying the convergence condition is used as a target solution of the linear programming model.
[0105] Here, when the updated solution corresponding to at least one initial solution satisfies the convergence condition, the updated solution is used as the target solution of the linear programming model. The target solution represents a set of product delivery methods that minimize product production costs and / or transportation costs within a production and distribution scenario within a supply chain, i.e., the number of products shipped from different production locations to different sales locations. In some embodiments, when the duality gap corresponding to the linear programming model is less than a preset threshold, the corresponding updated solution is determined to have satisfied the convergence condition; the duality gap refers to the difference between the linear programming model and the dual model.
[0106] In the data processing method provided in the present application, first, a linear programming model is constructed for the production and distribution scenarios in the supply chain; then, at least two groups of initial solutions corresponding to the linear programming model are determined; thereafter, the linear programming model is solved in parallel based on the at least two groups of initial solutions using the interior point method, so as to iteratively update the at least two groups of initial solutions; wherein, for at least one solution process corresponding to each group of initial solutions, the updated solution of the initial solution is determined based on the solution information of at least one group of initial solutions other than the initial solution, and the solution information includes at least update information of the value boundaries of the decision variables; finally, in response to the updated solution corresponding to at least one initial solution satisfying the convergence condition, the updated solution that satisfies the convergence condition is used as the target solution of the linear programming model. In this way, by initializing at least two sets of initial solutions, the interior point method can be used to iteratively update the corresponding initial solutions under different solution paths, and at the same time, the solution information on different solution paths can be collected to use the solution information to correct and optimize the solution process on this solution path and other solution paths, thereby effectively avoiding the problem in related technologies that the entire solution process is difficult to converge due to some variables reaching the value boundary too early, and thus accelerating the solution process for the entire linear programming model and improving the solution efficiency.
[0107] In some implementations, determining at least two initial solutions corresponding to the linear programming model, i.e., the above step S32, can be implemented as the following steps S321 to S322:
[0108] Step S321: Determine a first solution based on the constraints of the linear programming model.
[0109] Here, the first solution refers to a set of decision variable values determined within the feasible region of the linear programming model.
[0110] In some implementations, a feasible domain is determined based on the constraints of the linear programming model; within the feasible domain, a point is randomly determined, and the values of a set of decision variables corresponding to the point are used as the first solution.
[0111] In some embodiments, a feasible domain is determined based on the constraints of the linear programming model; multiple boundary points of the feasible domain are averaged to obtain the center point of the feasible domain, and the values of a set of decision variables corresponding to the center point are used as the first solution.
[0112] Step S322: using at least two perturbation coefficients, respectively updating the first solution to obtain the at least two initial solutions; each of the initial solutions is within the feasible region of the linear programming model.
[0113] Here, the perturbation coefficient refers to a coefficient used to update the value of each decision variable in the first solution.
[0114] In some embodiments, the perturbation coefficient can be randomly determined based on the problem size of the linear programming model. For example, when the problem size is large, a larger perturbation system can be determined; otherwise, a smaller perturbation system can be determined. For example, when the numerical range of the feasible region corresponding to the linear programming model is greater than 1000, the perturbation coefficient can be determined as 100 or 110, etc.; if the numerical range of the feasible region corresponding to the linear programming model is within 100, the perturbation coefficient can be determined as 10 or 11, etc.
[0115] In some embodiments, a specified perturbation algorithm may be used to determine the perturbation coefficient, wherein the perturbation algorithm may be a genetic algorithm, a perturbation strategy in a local search algorithm, or a perturbation heuristic algorithm.
[0116] Here, any method can be used to update the first solution using the at least two perturbation coefficients. In some embodiments, the at least two perturbation coefficients can be added to the first solution to obtain at least two sets of initial solutions. In some embodiments, the at least two perturbation coefficients can be weighted and the weighted at least two perturbation coefficients can be added to the first solution to obtain at least two sets of initial solutions.
[0117] After updating the first solution using at least two perturbation coefficients and obtaining at least two initial solutions, it is verified whether each set of initial solutions is within the feasible domain of the linear programming model, so that each set of initial solutions meets the constraints of the linear programming and is within the feasible domain.
[0118] In some embodiments, the at least two perturbation coefficients are used to update the initial point respectively to obtain the at least two initial solutions. That is, the above step S322 can be implemented as the following steps S3221 to S3223:
[0119] Step S3221: Determine the dual model corresponding to the linear programming model.
[0120] Here, after the linear programming model is determined, the dual model corresponding to the linear programming model can be determined using any method commonly used in the art.
[0121] For example, for the linear programming model shown in the following formula (1), the dual model corresponding to the linear programming model can be determined as shown in formula (6).
[0122]
[0123] Among them, y and s represent the decision variables in the dual model, and s has a one-to-one correspondence with the decision variable x in the linear programming model.
[0124] Step S3222: Based on the linear programming model and the dual model, at least two complementary relaxation coefficients are generated using a perturbation heuristic algorithm.
[0125] Perturbation heuristics are heuristic methods that explore the solution space by introducing random perturbations, avoiding local optima and ultimately finding a better solution. Here, we use the perturbation heuristic to calculate complementary slack coefficients based on a linear programming model and its dual model. These coefficients are then used to perturb the first solution.
[0126] Here, the specific implementation method of using the perturbation heuristic algorithm to calculate the complementary relaxation system can be shown in the following formulas (7) and (8):
[0127]
[0128] where δ x and δ s represent two complementary relaxation coefficients respectively.
[0129] Step S3223: Use the at least two complementary relaxation coefficients to update the first solution respectively to obtain the at least two initial solutions.
[0130] Here, the specific implementation of updating the first solution using the at least two complementary relaxation coefficients corresponds to the specific implementation in the above step S322 and will not be repeated here.
[0131] In the above-mentioned embodiment provided by the present application, at least two complementary relaxation coefficients are used to update the first solution to obtain at least two initial solutions. In this way, in the subsequent solution process, the linear programming model can be solved starting from different initial solutions, thereby obtaining at least two different iterative paths, and then the solution information on the different iterative paths can be used to accelerate the entire solution process.
[0132] In some implementations, for each set of initial solutions, the linear programming model may be iteratively solved multiple times starting from the initial solutions.
[0133] Thus, in some embodiments, for each set of initial solutions, performing the current solution on the linear programming model includes the following steps S331 to S333:
[0134] Step S331, obtaining at least one neighborhood graph corresponding to at least one group of initial solutions other than the initial solution; the neighborhood graph represents a graph structure composed of value boundaries of multiple decision variables.
[0135] Here, a neighborhood graph refers to a graph structure consisting of the value boundaries of multiple decision variables. In some embodiments, each set of initial solutions corresponds to a domain graph. In some embodiments, for each set of initial solutions, the neighborhood graph corresponding to at least one initial solution other than the initial solution can be used to update the neighborhood graph corresponding to the initial solution, thereby achieving the effect of using the solution information corresponding to the at least one initial solution to optimize the solution process corresponding to the current initial solution.
[0136] In some embodiments, the neighbor graph includes multiple nodes, and there are connections between different nodes; wherein each node represents the value boundary of a corresponding decision variable; and the connection between different nodes represents the conversion relationship between the corresponding two decision variables.
[0137] In some embodiments, the transformation relationship between two decision variables may include a constraint relationship between the two decision variables determined based on a constraint condition involving the two decision variables. For example, for decision variables x1 and x2 in a linear programming model, if the constraint condition involving the two decision variables in the linear programming model is 0≤x1+x2≤10, then the constraint condition may be used as the transformation relationship between decision variables x1 and x2.
[0138] In some embodiments, the conversion relationship between the two decision variables further includes an update condition corresponding to when the value boundary of one of the decision variables is updated. For example, with respect to the above embodiment, after the value boundary of the decision variable x1 is updated, the update condition when updating the value boundary of the decision variable x1 is recorded using the connection between the decision variables x1 and x2 (for example, the value of the decision variable x2 is determined to be a fixed value). In this way, when updating the value boundary of x1 in the neighborhood graph corresponding to the current initial solution with reference to the neighborhood graph, it is necessary to refer to the update condition to determine whether the solution process of the current solution satisfies the update condition (that is, whether the value of the decision variable x2 in the current solution can be determined to be the above-mentioned fixed value or include the above-mentioned fixed value).
[0139] Step S332: determining an update direction and an update step size of the current solution based on the current solution of the initial solution in the current solution, the at least one neighborhood graph, and the constraints of the linear programming model.
[0140] After obtaining at least one neighborhood graph corresponding to at least one group of initial solutions other than the current initial solution, the neighborhood graph corresponding to the current initial solution is updated based on the neighborhood graph, thereby narrowing the value boundary of the decision variable, that is, narrowing the search range of the solution.
[0141] Thus, based on the current solution in the current solution, the constraints of the linear programming model, and the updated neighborhood graph, any suitable algorithm can be used to determine the update direction and update step size of the current solution. In some embodiments, the any suitable algorithm can include Newton's algorithm, primal-dual interior point method, predictor-corrector algorithm, or path tracking algorithm.
[0142] Among them, when using the Newton algorithm to determine the update direction and update step size, first, the Newton algorithm is used to calculate the Newton direction (i.e., update direction) corresponding to the linear programming model; then, in the update direction, the updated neighborhood graph is searched under constraints to determine the update step size.
[0143] Step S333: Based on the update direction and update step size of the current solution, the current solution is updated to obtain an updated solution corresponding to the initial solution in the current solution.
[0144] Here, after determining the update direction and update step size, the current solution of the initial solution can be updated in any suitable manner to obtain an updated solution in the current solution. In some embodiments, the current solution can be updated based on the determined update direction and update step size using the above formulas (2) and (3) to obtain the updated solution corresponding to the initial solution in the current solution. In some embodiments, at least one of the determined update direction and update step size can be corrected based on the historical solution information corresponding to the initial solution, and the corrected update direction and update step size can be used to update the current solution. The historical solution information may include information on changes in the update step size or information on changes in the update direction, etc.
[0145] In the above-mentioned implementation mode provided in the present application, at least one neighborhood graph corresponding to at least one group of initial solutions other than the current initial solution is used to update the neighborhood graph corresponding to the current initial solution. In this way, the value boundary of the decision variable and the search range can be narrowed in the current solution, and by performing a depth-first or breadth-first search on the updated neighborhood graph, a more promising search direction can be found, so that the solution direction (i.e., the update direction and update step size) can be better determined in the current solution.
[0146] In some embodiments, for each solution process of each initial solution, information such as the current solution, update direction, update step, and update solution in the solution process is stored so that this information can be used as solution information for the solution process corresponding to the current initial solution or other initial solutions.
[0147] In some embodiments, the determining of the update direction and update step size of the current solution based on the current solution of the initial solution in the current solution, the at least one neighborhood graph, and the constraints of the linear programming model, that is, the above-mentioned step S332, can be implemented as the following steps S3321 to S3322:
[0148] Step S3321: construct an iterative equation based on the linear programming model and the dual model of the linear programming model.
[0149] Here, the iterative equation refers to the equation used to iteratively solve the linear programming model.
[0150] In some embodiments, the iterative equation can be constructed using any suitable method. In some embodiments, an augmented matrix can be constructed based on the Lagrangian constraint equation based on the linear programming model and the dual model of the linear programming model, and the augmented matrix can be used as the iterative equation. In some embodiments, the gradient and Hessian matrix of the Lagrangian function can be constructed using the augmented Lagrangian function method based on the linear programming model and the dual model of the linear programming model, and the gradient and Hessian matrix of the Lagrangian function can be used as the iterative equation.
[0151] In some implementations, the constructed iterative equation may be linearized using the Newton algorithm to reduce solution complexity.
[0152] Step S3322: Based on the current solution and the at least one neighborhood graph, perform a first calculation using the iterative equation to obtain an update direction and an update step size for the current solution.
[0153] In which, a first matrix decomposition algorithm is used to perform matrix decomposition on the matrix in the first calculation; the first matrix decomposition algorithm is different from the second matrix decomposition algorithm; and the second matrix decomposition algorithm represents the matrix decomposition algorithm used in the process of iterating at least one initial solution other than the initial solution.
[0154] Here, after determining the iterative equation, a first calculation is performed on the iterative equation based on at least one neighborhood graph corresponding to the current solution in the current solution and at least one other initial solution, so as to obtain an update direction corresponding to the current solution, and determine the update step size based on the update direction.
[0155] The iterative equation contains a high-dimensional coefficient matrix, resulting in high computational complexity. Therefore, in the first calculation, a matrix decomposition algorithm is used to decompose the high-dimensional matrix in the iterative equation into a low-dimensional matrix, thereby reducing the computational complexity of the iterative equation and improving computational efficiency.
[0156] Here, in the current solution of the current initial solution, a first matrix decomposition algorithm is used to perform matrix decomposition on the matrix involved in the first calculation (i.e., the matrix in the iterative equation). Correspondingly, in the solution process corresponding to at least one initial solution other than the current initial solution, a second matrix decomposition algorithm is used to perform matrix decomposition on the matrix involved in the first calculation corresponding to the at least one initial solution. The first matrix decomposition algorithm is different from the second decomposition algorithm.
[0157] In some embodiments, the first matrix decomposition algorithm and the second matrix decomposition algorithm may be a diagonal conjugate residual algorithm or a Cholesky conjugate residual algorithm.
[0158] In the above-mentioned embodiments provided in the present application, during the iteration process of different initial solutions, different matrix decomposition algorithms are used to perform matrix decomposition on the matrices involved in the iterative equation, which can achieve perturbation of the calculation results of the iterative equation, and then the iterative paths and corresponding solution information corresponding to different initial solutions can be disturbed and obtained.
[0159] In some embodiments, the current solution represents a solution process after executing a specified number of iterations on the initial solution using the first matrix decomposition algorithm;
[0160] Thus, the method further comprises the following steps S3323:
[0161] Step S3323: In response to the updated solution corresponding to the current solution not satisfying a preset convergence condition, the first matrix decomposition algorithm is updated using a third matrix decomposition algorithm; the third matrix decomposition algorithm is different from the first matrix decomposition algorithm.
[0162] The specified number of iterations refers to information about the number of iterations that is preset. In some embodiments, the specified number of iterations can be determined based on solution experience. For example, the specified number of iterations can be 100, 200, etc.
[0163] Here, after performing a specified number of iterations on the initial solution using the first matrix decomposition algorithm, if the updated solution corresponding to the current solution does not meet the preset convergence conditions, it can be determined that the first matrix decomposition algorithm is not the optimal matrix decomposition algorithm. In this case, the first matrix decomposition algorithm is updated to a third matrix decomposition algorithm, and further iterations are performed on the initial solution based on the third matrix decomposition algorithm. The third matrix decomposition algorithm can be any matrix decomposition algorithm different from the first matrix decomposition algorithm.
[0164] In the above embodiments provided in the present application, by updating the matrix decomposition algorithm, the search direction or the initial solution iterative path can be disturbed to obtain a better solution effect and improve the overall solution efficiency of the linear programming model.
[0165] In some embodiments, the linear programming model includes at least one first decision variable; each of the first decision variables has a value boundary;
[0166] The step of determining the update direction and update step size of the current solution based on the current solution of the initial solution in the current solution, the at least one neighborhood graph, the constraints of the linear programming model, and the constraints of the linear programming model, i.e., the above step S332, may include the following steps S3324 to S3327:
[0167] Step S3324: Determine the update direction and maximum step size of the current solution based on the current solution, the at least one neighborhood graph, and the constraints of the linear programming model.
[0168] Here, the specific implementation method of determining the update direction of the current solution based on the current solution, at least one neighborhood graph and the constraints of the linear programming model corresponds to the specific implementation method in the above-mentioned step S332 or step S3322, and will not be repeated here.
[0169] The maximum step size refers to the maximum step size that the current solution can be updated in the determined update direction. In some embodiments, in the determined update direction, while satisfying the constraints, the neighborhood graph corresponding to the current initial solution is searched to determine the maximum step size that can be updated in the current solution.
[0170] Step S3325: For each first decision variable, calculate a first distance between the value of the first decision variable in the current solution and the value boundary of the first decision variable.
[0171] Here, for each first decision variable, first, the value corresponding to the first decision variable in the current solution and the value boundary corresponding to the first decision variable in the determined update direction are determined. Then, the first distance between the value corresponding to the first decision variable and the value boundary is calculated. In this way, at least one first distance corresponding to at least one first decision variable can be determined.
[0172] Step S3326: In response to at least one first distance being smaller than a distance threshold, taking the first step length as the update step length; the first step length is smaller than the maximum step length.
[0173] The distance threshold refers to the pre-set distance used to correct the update step size.
[0174] Here, each first distance is compared with the distance threshold. When at least one first distance is smaller than the distance threshold, it indicates that at least one first decision variable in the current solution is at a small distance from the corresponding value boundary. If the current solution is updated according to the longest step size, the search for the optimal solution may be skipped.
[0175] Therefore, in this embodiment, in response to at least one first distance being smaller than a distance threshold, a first step length smaller than the maximum step length is used as the update step length in the current solution process, that is, the update speed of the solution is reduced.
[0176] In some embodiments, the first step length is determined based on the maximum step length and a preset step length correction factor. The preset step length correction factor is determined based on experience solving linear programming models. For example, the preset step length correction factor can be any value between 0 and 1.
[0177] Step S3327: In response to each first distance being not less than the distance threshold, use the maximum step length as the update step length.
[0178] Here, when each first distance is not less than the distance threshold, it means that the distance between each first decision variable in the current solution and the corresponding value boundary is large. Therefore, the maximum step size can be used as the update step size in the current solution process to speed up the search for the optimal solution.
[0179] In the above-mentioned embodiment provided by the present application, when the value of the first decision variable is close to the corresponding value boundary, the update speed of the solution is reduced, that is, a smaller step size is used to perform a fine search of the feasible domain to prevent skipping the optimal solution; at the same time, when the value of each first decision variable is far away from the corresponding value boundary, a larger update step size is used to update the solution to speed up the search speed and improve the solution efficiency of the linear programming model.
[0180] In some implementations, the update step size of the current solution is smaller than a preset step size threshold.
[0181] The preset step size threshold is a pre-set step size threshold that needs to be used to correct the update step size in the next solution process.
[0182] The update step size in the current solution is smaller than the preset step size threshold, indicating that the value of at least one decision variable in the current solution is close to the corresponding value boundary, resulting in a smaller overall update step size for the current solution in the current solution process.
[0183] Thus, the method further includes the following steps S3328 to S3329:
[0184] Step S3328: Based on the updated solution of the current solution and the constraints of the linear programming model, determine the first step length of the next solution corresponding to the current solution.
[0185] Here, the first step size refers to the update step size for the next solution, determined based on the updated solution and constraints of the current solution. In some embodiments, the first step size can be determined using the update step size determination method provided in the embodiments described in step S332, steps S3321 to S3322, or steps S3324 to S3327 above.
[0186] Step S3329: Determine the updated step size for the next solution based on the first step size and the first correction coefficient for the next solution.
[0187] The first correction coefficient refers to a correction coefficient for the update step size when some decision variables are close to the value boundary. In some embodiments, the first correction coefficient can be any value in the range of 0 to 1.
[0188] In this way, the first step length is corrected using the first correction coefficient to obtain an updated step length that is smaller than the first step length.
[0189] In the above-mentioned embodiments provided in the present application, when the values of some decision variables in the updated solution are close to the corresponding value boundaries, the update step size of the solution is corrected in the next solution process to reduce the update step size of the solution, or reduce the update speed of the solution, so that the update rate of each decision variable is relatively balanced, avoiding the problem of premature convergence.
[0190] In some implementations, a corresponding first list can be generated for each initial solution's corresponding solution process, and decision variables whose values during the solution process are close to the corresponding value boundary can be added to the first list. Thus, when the number of decision variables in the first list reaches a threshold, the corresponding update step size is modified based on the value of each decision variable in the first list.
[0191] In some embodiments, the linear programming problem includes a second decision variable; and the value of the second decision variable in the updated solution obtained currently is within the value boundary of the second decision variable.
[0192] Here, when the value of the second decision variable is within the value boundary of the second decision variable, the value of the second decision variable needs to be corrected so that the second decision variable can enter the updateable state again.
[0193] Thus, the method further includes the following steps S33210 to S33212:
[0194] Step S33210: Determine a second correction coefficient of the second decision variable based on at least one constraint condition including the second decision variable; the second correction coefficient represents the maximum uncorrectable value or the minimum uncorrectable value corresponding to the second decision variable.
[0195] Here, the second correction coefficient refers to the maximum or minimum uncorrectable value of the second decision variable calculated using the constraints corresponding to the second decision variable. The maximum uncorrectable value means that the correctable range of the second decision variable is smaller than the second correction coefficient; the minimum uncorrectable value means that the correctable range of the second decision variable is larger than the second correction coefficient.
[0196] In this way, when the constraint condition corresponding to the second decision variable is a maximum value constraint, the second correction coefficient represents the minimum uncorrectable value corresponding to the second decision variable; correspondingly, when the constraint condition corresponding to the second decision variable is a minimum value constraint, the second correction coefficient represents the maximum uncorrectable value corresponding to the second decision variable; when the constraint condition corresponding to the second decision variable is both a maximum value constraint and a minimum value constraint, the second correction coefficient represents the minimum uncorrectable value and the maximum uncorrectable value corresponding to the second decision variable.
[0197] In some embodiments, taking the calculation of the minimum uncorrectable coefficient of the second decision variable as an example, the second correction coefficient of the second decision variable can be calculated based on the following formula (9):
[0198]
[0199] Wherein, f represents the second correction system corresponding to the second decision variable;
[0200] p represents the pth constraint in the linear programming model;
[0201] n represents the total number of constraints in the linear programming model;
[0202] b p represents the constraint vector corresponding to the p-th constraint;
[0203] m represents the number of decision variables in the constraints;
[0204] k represents the number of the decision variable, where the value of k can be from 1 to m;
[0205] q represents the number of the second decision variable;
[0206] a pq , represents the decision variable coefficient corresponding to the second decision variable q in the pth constraint;
[0207] a pk , which represents the decision variable coefficient corresponding to the kth decision variable in the pth constraint.
[0208] Step S33211: Determine an updated value of the second decision variable based on the value of the second decision variable in the updated solution obtained currently and the second correction coefficient.
[0209] Here, the value of the second decision variable in the updated solution obtained in the current solution can be updated using the second correction coefficient in any suitable manner to obtain an updated value of the second decision variable. In some embodiments, the sum of the second correction coefficient and the value of the second decision variable can be used as the updated value of the second decision variable. In some embodiments, the second correction coefficient can be weighted, and the sum of the weighted second correction coefficient and the value of the second decision variable can be used as the updated value of the second decision variable.
[0210] Step S33212: Update the updated solution of the current solution based on the updated value of the second decision variable.
[0211] Here, the updated value of the second decision variable is used as the value corresponding to the second decision variable in the current solution, thereby correcting the value of the second decision variable from the boundary value to a value within the feasible region.
[0212] In the above-mentioned embodiments provided in the present application, when the value of a decision variable reaches the corresponding value boundary, the value of the decision variable is corrected using the minimum uncorrectable value or the maximum uncorrectable value corresponding to the decision variable, so that the value of the decision variable is out of the boundary, so that the updated solution can continue to iterate.
[0213] In some embodiments, a corresponding second list can be generated for each solution process corresponding to the initial solution, and decision variables whose values during the solution process reach the corresponding value boundary are added to the second list. In this way, when the number of decision variables in the second list reaches a threshold, the value of each decision variable in the second list is modified to move it out of the boundary.
[0214] In some embodiments, the linear programming model includes a third decision variable; the third decision variable has a value boundary.
[0215] The value boundary of the third decision variable may be at least one of a maximum value boundary and a minimum value boundary corresponding to the third decision variable.
[0216] Thus, the method further comprises the following steps S334 to S335:
[0217] Step S334: Based on the update information of the third decision variable in the multiple solution processes corresponding to the initial solution, the value boundary of the third decision variable corresponding to the initial solution is updated.
[0218] Update information for the third decision variable refers to any update information related to the third decision variable during the iteration process of the initial solution. In some embodiments, the update information for the third decision variable includes update trend information and update direction information for the third decision variable. In some embodiments, the update information for the third decision variable includes update information for other decision variables that are subject to the same constraints as the third decision variable.
[0219] In some embodiments, based on the updated information about the third decision variable, an optimal search range corresponding to the third decision variable can be analyzed, thereby updating the value boundary of the third decision variable corresponding to the initial solution based on the optimal search range. For example, the optimal search range can be used to narrow the value boundary of the third decision variable corresponding to the initial solution.
[0220] In some embodiments, the value range of the third decision variable is updated based on update information of other decision variables in the same constraint as the third decision variable. For example, if the first constraint includes the fourth decision variable and the third decision variable, then after the value range of the fourth decision variable is narrowed by other constraints or other iterative paths, the value range of the third decision variable can be narrowed based on the first constraint.
[0221] Step S335 : Based on the update result of the value boundary of the third decision variable corresponding to the initial solution, update the value boundary of the third decision variable corresponding to the at least one initial solution.
[0222] Here, after updating the value bounds of the third decision variable corresponding to the current initial solution, the updated result is synchronized with, that is, updated to, the value bounds of the third decision variable corresponding to at least one initial solution other than the current initial solution. This allows the solution process of the at least one initial solution to refer to the solution information of the current initial solution, thereby speeding up the solution process of the entire linear programming model.
[0223] Next, combine Figure 4 , the implementation process of an embodiment provided by this application is described. Figure 4 As shown, this embodiment includes the following steps S41 to S45:
[0224] Step S41, constructing a linear programming model and determining the dual model of the linear programming model; then executing step S42;
[0225] Here, the linear programming model corresponds to the linear programming problem corresponding to the production and distribution scenarios in the product supply chain.
[0226] Step S42, randomly initializing a second solution in the feasible region of the linear programming model, and calculating two sets of complementary relaxation coefficients based on the linear programming model and the dual model; thereafter, executing step S43;
[0227] Step S43, using the two sets of complementary relaxation coefficients and the second solution, calculating the first initial solution and the second initial solution of the linear programming model; then, executing step S44;
[0228] Here, the sum of two sets of complementary relaxation coefficients and the second solution is calculated respectively to obtain the corresponding first initial solution and second initial solution.
[0229] Step S44, constructing an iterative equation corresponding to the linear programming model, and using the iterative equation to perform iterative updates on the first initial solution and the second initial solution in parallel; thereafter, executing step S45;
[0230] Here, for the solution process corresponding to the first initial solution, the Diagonal conjugate residual algorithm is used to decompose the high-dimensional matrix in the iterative equation; for the solution process corresponding to the second initial solution, the Diagonal conjugate residual algorithm and the Cholesky conjugate residual algorithm are used to decompose the high-dimensional matrix in the iterative equation.
[0231] For each solution of the first and second initial solutions, the update step size is dynamically adjusted. Specifically, if the value of each decision variable in the current solution is significantly away from the corresponding value boundary, the maximum step size is used to update the solution. If the value of each decision variable in the current solution is significantly away from the corresponding value boundary, the maximum step size is modified to obtain a second step size smaller than the maximum step size, and the solution is then updated using the second step size. The method for determining the maximum step size can be found in the detailed description above and will not be repeated here.
[0232] For the solution process of the first initial solution and the second initial solution, two lists are maintained, namely, a third list and a fourth list; wherein the third list is used to record information about decision variables whose values reach the corresponding value boundary, and the fourth list is used to record information about decision variables whose values are close to the corresponding value boundary. In this way, in response to the number of decision variables in the third list reaching a threshold, the value of each decision variable in the third list is corrected (for example, the corresponding corrected value is calculated using the above formula (9)); in response to the number of decision variables in the fourth list reaching a threshold, the update step size is reduced based on the value of each decision variable in the fourth list.
[0233] At the same time, corresponding neighborhood graphs are generated for the iterative paths corresponding to the first and second initial solutions, respectively. These graphs are used to record information about changes in the decision variable's value boundaries. Furthermore, the first and second initial solutions can share a neighborhood graph, using each other's neighborhood graphs to guide the solution direction along the path. The detailed description of how the neighborhood graphs are generated and updated can be found above and will not be repeated here.
[0234] Step S45 : In response to the updated solution corresponding to the first initial solution or the second initial solution satisfying the convergence condition, the updated solution is used as the optimal solution of the linear programming model.
[0235] Based on the foregoing embodiments, the present application provides a data processing device, which includes the various units included and the various modules included in each unit, and can be implemented by a processor in a computer device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
[0236] Figure 5 A schematic diagram of the structure of a data processing device provided in this application is shown in FIG. Figure 5 As shown, the data processing device 500 includes: a model building module 510, a first determination module 520, an update module 530 and a second determination module 540, wherein:
[0237] Model construction module 510 constructs a linear programming model; the decision variables of the linear programming model represent the quantity of products transported from the production site to the sales site; the constraints of the linear programming model include at least a product production quantity constraint for at least one production site and a product demand quantity constraint for at least one sales site; the objective of the linear programming model is to minimize at least one of product production cost and transportation cost;
[0238] A first determining module 520 is configured to determine at least two groups of initial solutions corresponding to the linear programming model;
[0239] An updating module 530 solves the linear programming model in parallel based on the at least two sets of initial solutions using an interior point method, so as to iteratively update the at least two sets of initial solutions; wherein, for at least one solution process corresponding to each set of initial solutions, an updated solution of the initial solution is determined based on solution information of at least one set of initial solutions other than the initial solution; the solution information at least includes update information of value boundaries of decision variables;
[0240] The second determining module 540 is configured to use the updated solution satisfying the convergence condition as the target solution of the linear programming model in response to the updated solution corresponding to at least one initial solution satisfying the convergence condition.
[0241] In some implementations, the first determining module 520 is configured to:
[0242] Determining a first solution based on the constraints of the linear programming model;
[0243] The first solution is updated respectively using at least two perturbation coefficients to obtain the at least two initial solutions; each of the initial solutions is within the feasible region of the linear programming model.
[0244] In some implementations, the first determining module 520 is configured to:
[0245] Determining a dual model corresponding to the linear programming model;
[0246] Based on the linear programming model and the dual model, using a perturbation heuristic algorithm, generating at least two complementary relaxation coefficients;
[0247] The first solution is updated respectively using the at least two complementary relaxation coefficients to obtain the at least two initial solutions.
[0248] In some implementations, the updating module 530 is configured to:
[0249] Obtaining at least one neighborhood graph corresponding to at least one group of initial solutions other than the initial solution; the neighborhood graph represents a graph structure composed of value boundaries of multiple decision variables;
[0250] Determining an update direction and an update step size of the current solution based on a current solution of the initial solution in the current solution, the at least one neighborhood graph, and constraints of the linear programming model;
[0251] Based on the update direction and update step size of the current solution, the current solution is updated to obtain the updated solution corresponding to the target initial solution in the current solution.
[0252] In some implementations, the update module 530 is configured to:
[0253] constructing an iterative equation based on the linear programming model and a dual model of the linear programming model;
[0254] Based on the current solution and the at least one neighborhood graph, performing a first calculation using the iterative equation to obtain an update direction and an update step size of the current solution;
[0255] In which, a first matrix decomposition algorithm is used to perform matrix decomposition on the matrix in the first calculation; the first matrix decomposition algorithm is different from the second matrix decomposition algorithm; and the second matrix decomposition algorithm represents the matrix decomposition algorithm used in the process of iterating at least one initial solution other than the initial solution.
[0256] In some embodiments, the current solution represents a solution process after executing a specified number of iterations on the initial solution using the first matrix decomposition algorithm;
[0257] The updating module 530 is further configured to:
[0258] In response to the updated solution corresponding to the current solution not satisfying a preset convergence condition, the first matrix decomposition algorithm is updated using a third matrix decomposition algorithm; the third matrix decomposition algorithm is different from the first matrix decomposition algorithm.
[0259] In some embodiments, the linear programming model includes at least one first decision variable; each of the first decision variables has a value boundary;
[0260] The updating module 530 is configured to:
[0261] Determining an update direction and a maximum step size for a current solution based on the current solution, the at least one neighborhood graph, and constraints of the linear programming model;
[0262] For each of the first decision variables, calculating a first distance between the value of the first decision variable in the current solution and a value boundary of the first decision variable;
[0263] In response to at least one first distance being smaller than a distance threshold, taking a first step length as the update step length; the first step length being smaller than the maximum step length;
[0264] In response to each first distance being not less than the distance threshold, the maximum step size is used as the update step size.
[0265] In some embodiments, the update step size of the current solution is smaller than a preset step size threshold;
[0266] The updating module 530 is further configured to:
[0267] Determining the first step length of the next solution corresponding to the current solution based on the updated solution of the current solution and the constraints of the linear programming model;
[0268] Based on the first step size of the next solution and the first correction coefficient, an update step size of the next solution is determined.
[0269] In some embodiments, the linear programming problem includes a second decision variable; the value of the second decision variable in the updated solution obtained in the current solution is within the value boundary of the second decision variable;
[0270] The updating module 530 is further configured to:
[0271] determining a second correction coefficient of the second decision variable based on at least one constraint condition including the second decision variable, wherein the second correction coefficient represents a maximum uncorrectable value or a minimum uncorrectable value corresponding to the second decision variable;
[0272] Determining an updated value of the second decision variable based on the value of the second decision variable in the updated solution obtained currently and the second correction coefficient;
[0273] Based on the updated value of the second decision variable, the updated solution of the current solution is updated.
[0274] In some embodiments, the linear programming model includes a third decision variable; the third decision variable has a value boundary;
[0275] The updating module 530 is further configured to:
[0276] updating the value boundary of the third decision variable corresponding to the initial solution based on the update information of the third decision variable in the multiple solution processes corresponding to the initial solution;
[0277] Based on the update result of the value boundary of the third decision variable corresponding to the initial solution, the value boundary of the third decision variable corresponding to the at least one initial solution is updated.
[0278] The description of the above device embodiment is similar to the description of the above method embodiment and has similar beneficial effects as the method embodiment. In some embodiments, the functions or modules included in the device provided in the embodiments of the present application can be used to perform the methods described in the above method embodiments. For technical details not disclosed in the device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.
[0279] It should be noted that, in the embodiment of the present application, if the above-mentioned data processing method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific hardware, software or firmware, or any combination of hardware, software and firmware.
[0280] An embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.
[0281] The present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements some or all of the steps in the above method. The computer-readable storage medium may be transient or non-transient.
[0282] An embodiment of the present application provides a computer program, including computer-readable code. When the computer-readable code is run in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.
[0283] An embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, implements some or all of the steps in the above method. The computer program product can be implemented specifically by hardware, software, or a combination thereof. In some embodiments, the computer program product is embodied as a computer storage medium. In other embodiments, the computer program product is embodied as a software product, such as a software development kit (SDK), etc.
[0284] It should be noted that the descriptions of the various embodiments above tend to emphasize the differences between the various embodiments, and their similarities or similarities can be referenced to each other. The descriptions of the above device, storage medium, computer program, and computer program product embodiments are similar to the descriptions of the above method embodiments and have similar beneficial effects as the method embodiments. For technical details not disclosed in the embodiments of the device, storage medium, computer program, and computer program product of this application, please refer to the description of the method embodiments of this application for understanding.
[0285] It should be noted that Figure 6 This is a hardware entity diagram of the electronic device in this application, such as Figure 6 As shown, the hardware entity of the electronic device 600 includes: a processor 601, a communication interface 602 and a memory 603, wherein:
[0286] The processor 601 generally controls the overall operations of the electronic device 600 .
[0287] The communication interface 602 enables the electronic device to communicate with other terminals or servers through a network.
[0288] The memory 603 is configured to store instructions and applications executable by the processor 601, and can also cache data to be processed or processed by the processor 601 and various modules in the electronic device 600 (for example, image data, audio data, voice communication data, and video communication data). This can be implemented using flash memory (FLASH) or random access memory (RAM). Data can be transmitted between the processor 601, the communication interface 602, and the memory 603 via a bus 604.
[0289] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned steps / processes does not mean the order of execution, and the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.
[0290] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0291] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0292] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed across multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.
[0293] In addition, all functional units in the embodiments of the present application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above-mentioned integrated units can be implemented in the form of hardware or in the form of hardware plus software functional units.
[0294] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, and other media that can store program codes.
[0295] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0296] The above is only an implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the scope of protection of the present application.
Claims
1. A data processing method, comprising: Construct linear programming models; The decision variables of the linear programming model represent the quantity of products transported from the production site to the sales site; The constraints of the linear programming model include at least a product production quantity constraint for at least one production location and a product demand quantity constraint for at least one sales location; the objective of the linear programming model is to minimize at least one of product production cost and transportation cost; Determining at least two sets of initial solutions corresponding to the linear programming model; The linear programming model is solved in parallel based on the at least two groups of initial solutions using an interior point method, so as to iteratively update the at least two groups of initial solutions; wherein, for at least one solution process corresponding to each group of the initial solutions, an updated solution of the initial solution is determined based on solution information of at least one group of initial solutions other than the initial solutions; the solution information includes at least update information of value boundaries of decision variables; In response to an updated solution corresponding to at least one initial solution satisfying a convergence condition, the updated solution satisfying the convergence condition is used as a target solution of the linear programming model.
2. The method according to claim 1, wherein determining at least two initial solutions corresponding to the linear programming model comprises: Determining a first solution based on the constraints of the linear programming model; Using at least two perturbation coefficients, respectively updating the first solution to obtain the at least two initial solutions; Each of the initial solutions is within the feasible region of the linear programming model.
3. The method according to claim 2, wherein the updating the first solution by using at least two perturbation coefficients to obtain the at least two initial solutions comprises: Determining a dual model corresponding to the linear programming model; Based on the linear programming model and the dual model, using a perturbation heuristic algorithm, generating at least two complementary relaxation coefficients; The first solution is updated respectively using the at least two complementary relaxation coefficients to obtain the at least two initial solutions.
4. The method according to claim 1, wherein for each set of the initial solutions, performing a current solution on the linear programming model comprises: Obtaining at least one neighborhood graph corresponding to at least one group of initial solutions other than the initial solution; the neighborhood graph represents a graph structure composed of value boundaries of multiple decision variables; Determining an update direction and an update step size of the current solution based on a current solution of the initial solution in the current solution, the at least one neighborhood graph, and constraints of the linear programming model; Based on the update direction and update step size of the current solution, the current solution is updated to obtain the updated solution corresponding to the target initial solution in the current solution.
5. The method according to claim 4, wherein determining the update direction and update step size of the current solution based on the current solution of the initial solution in the current solution, the at least one neighborhood graph, and the constraints of the linear programming model comprises: constructing an iterative equation based on the linear programming model and a dual model of the linear programming model; Based on the current solution and the at least one neighborhood graph, performing a first calculation using the iterative equation to obtain an update direction and an update step size of the current solution; wherein, a first matrix decomposition algorithm is used to perform matrix decomposition on the matrix in the first calculation; the first matrix decomposition algorithm is different from the second matrix decomposition algorithm; The second matrix decomposition algorithm represents a matrix decomposition algorithm used in a process of iterating at least one initial solution other than the initial solution.
6. The method according to claim 5, wherein the current solution represents a solution process after executing a specified number of iterations on the initial solution using the first matrix decomposition algorithm; The method further comprises: In response to the updated solution corresponding to the current solution not satisfying a preset convergence condition, updating the first matrix decomposition algorithm using a third matrix decomposition algorithm; The third matrix decomposition algorithm is different from the first matrix decomposition algorithm.
7. The method according to claim 4, wherein the linear programming model comprises at least one first decision variable; each of the first decision variables has a value boundary; The determining, based on the current solution of the initial solution in the current solution, the at least one neighborhood graph, and the constraints of the linear programming model, an update direction and an update step size of the current solution includes: Determining an update direction and a maximum step size for a current solution based on the current solution, the at least one neighborhood graph, and constraints of the linear programming model; For each of the first decision variables, calculating a first distance between the value of the first decision variable in the current solution and a value boundary of the first decision variable; In response to at least one first distance being smaller than a distance threshold, taking a first step length as the update step length; the first step length being smaller than the maximum step length; In response to each first distance being not less than the distance threshold, the maximum step size is used as the update step size.
8. The method according to claim 7, wherein: The update step size of the current solution is smaller than a preset step size threshold; The method further comprises: Determining the first step length of the next solution corresponding to the current solution based on the updated solution of the current solution and the constraints of the linear programming model; Based on the first step size of the next solution and the first correction coefficient, an update step size of the next solution is determined.
9. The method according to claim 7, wherein: The linear programming problem includes a second decision variable; the value of the second decision variable in the updated solution of the current solution is within the value boundary of the second decision variable; The method further comprises: determining a second correction coefficient of the second decision variable based on at least one constraint condition including the second decision variable, wherein the second correction coefficient represents a maximum uncorrectable value or a minimum uncorrectable value corresponding to the second decision variable; Determining an updated value of the second decision variable based on the value of the second decision variable in the updated solution obtained currently and the second correction coefficient; Based on the updated value of the second decision variable, the updated solution of the current solution is updated.
10. The method of claim 4, wherein the linear programming model includes a third decision variable; The third decision variable has a value boundary; The method further comprises: updating the value boundary of the third decision variable corresponding to the initial solution based on the update information of the third decision variable in the multiple solution processes corresponding to the initial solution; Based on the update result of the value boundary of the third decision variable corresponding to the initial solution, the value boundary of the third decision variable corresponding to the at least one initial solution is updated.
Citation Information
Cited By
Power grid metering material verification and distribution collaborative optimization method and device and storage medium
CN121052760A