Initial main problem construction method, electronic equipment, storage medium and chip system

Through dynamic programming and neural network prediction methods, a general initial main problem is constructed, which solves the problems of inflexibility in the design of initial main problem and low efficiency of column generation methods in the prior art, and realizes an efficient solution process.

CN119106221APending Publication Date: 2024-12-10HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310673919.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-07
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

The existing technology lacks a general initial main problem construction method, which leads to the need for targeted design in different application scenarios, and the column generation method is iterated many times, has high calculation cost and low efficiency in the solution process.

Method used

The state transfer equation is constructed using dynamic programming method, and the non-basic variables are predicted through deep-first search and neural networks, and the general construction and rapid solution of the initial main problem are realized, reducing the number of iterations and improving efficiency.

Benefits of technology

The initial main problem structure is realized in a variety of application scenarios, reducing the solution time and the consumption of computing resources, and improving the efficiency and convergence speed of the column generation method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119106221A_ABST
    Figure CN119106221A_ABST
Patent Text Reader

Abstract

The invention provides an initial main problem construction method, electronic equipment, a storage medium and a chip system, relates to the technical field of artificial intelligence, and can improve the universality and applicability of the initial main problem construction method. The method comprises the steps of determining a state transition equation based on a problem model; wherein the problem model is constructed according to a to-be-solved problem in the application scene; according to the state transition equation, dynamic planning is executed, and a variable set corresponding to the initial main problem is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to an initial main problem construction method, electronic device, storage medium and chip system. Background Art

[0002] Column Generation is one of the methods used to solve large-scale linear programming problems. It can generally be used to solve the following practical problems: Crew Assignment Problem, Cutting Stock Problem, Vehicle Routing Problem, The single facility location problem, etc.

[0003] The column generation method first needs to construct an initial main problem. However, it is often difficult to find a feasible initial main problem. In some solutions, the construction of the initial main problem is generally designed according to the actual application scenario of the problem. When the application scenario changes, the initial main problem construction method may no longer be applicable. For example, the initial main problem construction method for the cutting problem is likely not suitable for solving the vehicle routing problem. Therefore, there is currently a lack of a relatively more general initial main problem construction method. Summary of the invention

[0004] The present application provides an initial main problem construction method, an electronic device, a storage medium and a chip system, and establishes a more general initial main problem construction method through dynamic programming.

[0005] In the first aspect, the technical solution of the present application provides a method for constructing an initial master problem based on column generation, the method comprising: determining a state transfer equation based on a problem model; wherein the problem model is constructed according to the problem to be solved in the application scenario; and performing dynamic programming according to the state transfer equation to obtain a variable set corresponding to the initial master problem. The method can be applied to a variety of application scenarios. Generally speaking, the application scenario in which the problem model can be constructed can construct the initial master problem according to the method, and it is more versatile.

[0006] As a possible implementation method, the problem model includes a linear programming model, and based on the problem model, a state transfer equation is determined, including: determining the right-hand side term of the constraint condition in the linear programming model and the coefficient vector of each variable, using the right-hand side term as the state vector; and constructing a state transfer equation based on the state vector and the coefficient vector. This method provides a feasible solution for constructing a state transfer equation based on a linear programming model, thereby realizing dynamic programming.

[0007] As a possible implementation, dynamic programming is performed according to the state transfer equation, including: performing dynamic programming according to the state transfer equation by using depth-first search.

[0008] As a possible implementation, a depth-first search is used to perform dynamic programming, including executing the following process based on a depth-first search module: inputting a first value of a state vector, a first set, and a global infeasible state set; wherein the first set is a set of coefficient vectors; the global infeasible state set is used to record the value of a state vector that does not have a feasible solution; determining that the first value of the state vector belongs to the global infeasible state set, returning an empty set; determining that the first value of the state vector does not belong to the global infeasible state set, pruning the first set, removing infeasible coefficient vectors therefrom, and the remaining coefficient vectors form a second set;

[0009] Traverse each coefficient vector in the second set, execute state transfer in sequence, and obtain the second value of the state vector; when the second value is equal to 0, return the first result; the first result is equal to the variable corresponding to the coefficient variable involved in the state transfer; when the second value is not 0, take the second value of the state vector, the second set and the global infeasible state set as input, and recursively call the depth-first search module; when the second result obtained by the depth-first search module is not empty, return the third result; the third result is equal to the union of the second result and the first result; when the second result obtained by the depth-first search module is empty, add the second value to the global infeasible state set.

[0010] As a possible implementation, the state transfer is performed sequentially, including: performing subtraction operations on the first value of the state vector and the pth coefficient vector respectively; wherein 1≤p≤N, N is the total number of coefficient vectors in the second set.

[0011] As a possible implementation manner, after the second result obtained by the depth-first search module is empty, the method further includes: in a third set, recording the p-th coefficient vector that has no feasible solution for the second value.

[0012] As a possible implementation, the first set is pruned to remove infeasible coefficient vectors, including: querying the parent state corresponding to the first value of the state vector; querying the coefficient vector that does not have a feasible solution for the parent state, and determining it as to be pruned; in the first set, the coefficient vector determined to be to be pruned is deleted. If there is no feasible solution for the parent state, then there is no feasible solution for the child state either. Querying the coefficient vector that does not have a feasible solution relative to the parent state can avoid repeated calculations, thereby improving efficiency.

[0013] As a possible implementation method, the parent state corresponding to the first value of the state vector is queried, including: the first value of the state vector is recorded as b2; the second value of the state vector recorded in the third set is recorded as b1; when the values ​​of the elements in b1 are all greater than the values ​​of the elements at the corresponding positions in b2, b1 is determined to be the parent state of b2, and b2 is the child state of b1.

[0014] As a possible implementation method, after obtaining the variable set corresponding to the initial main problem, the method also includes: determining a characteristic matrix corresponding to the initial main problem; the characteristic matrix includes characteristic vectors of multiple variables in the variable set corresponding to the initial main problem; inputting the characteristic matrix into a neural network, and using the neural network to predict non-basic variables added to the restricted main problem end-to-end.

[0015] As a possible implementation method, the neural network includes an encoding module and a decoding module, and the decoding module includes an LSTM network and a pointer attention module; the feature matrix is ​​input into the neural network, and the non-basic variables added to the restricted main problem are predicted through the neural network, including performing at least one encoding and decoding process; wherein one encoding and decoding process includes: inputting the feature matrix corresponding to the current restricted main problem into the encoding module, encoding through the encoding module, and outputting a first vector with a predetermined dimension; inputting the first vector into the LSTM network in the decoding module, and outputting a hidden state vector; through the pointer attention module, at least according to the feature vector and hidden state vector corresponding to each variable, predicting the probability of each non-basic variable entering the basis in this round; based on the probability, determining a non-basic variable and adding it to the variable set corresponding to the current restricted main problem. The neural network architecture based on encoding and decoding can predict the final restricted main problem based on the initial main problem, without executing multiple iterative solution processes, saving the time resources and computing resources occupied by the solution.

[0016] As a possible implementation method, encoding is performed through an encoding module to output a first vector with a predetermined dimension, including: using a trainable vector with a predetermined dimension, performing a dot multiplication operation with a feature matrix to obtain a scalar score; performing a softmax operation on the scalar score to obtain weights corresponding to each variable; and performing weighted summation on multiple feature vectors in the input feature matrix according to the weights to obtain a first vector with a predetermined dimension.

[0017] As a possible implementation method, before executing multiple rounds of loops to perform the encoding and decoding process, the method also includes: adding a virtual variable representing a stop symbol in the non-basic variable set; the non-basic variable set includes multiple non-basic variables; during the execution of multiple rounds of loops to perform the encoding and decoding process, the method also includes: according to the probability predicted by the pointer attention module, when the variable determined to be a virtual variable, stopping the prediction and completing the variable selection.

[0018] In the second aspect, the present application also provides a restricted main problem prediction method based on column generation. After determining the initial main problem, the method includes: determining the characteristic matrix corresponding to the initial main problem; the characteristic matrix includes characteristic vectors of multiple variables in the variable set corresponding to the initial main problem; inputting the characteristic matrix into a neural network, and predicting the non-basic variables added to the restricted main problem through the neural network. Predict the non-basic variables added to the restricted main problem, and then add the predicted variables on the basis of the variable set of the current restricted main problem (the initial main problem is the initial restricted main problem). After at least one prediction process, the final variable set can be obtained, that is, the final restricted main problem is determined.

[0019] As a possible implementation method, the neural network includes an encoding module and a decoding module, and the decoding module includes an LSTM network and a pointer attention module; the feature matrix is ​​input into the neural network, and the non-basic variables added to the restricted main problem are predicted end-to-end through the neural network, including executing multiple rounds of cyclic execution of encoding and decoding processes; wherein one round of encoding and decoding processes includes: inputting the feature matrix corresponding to the current restricted main problem into the encoding module, encoding through the encoding module, and outputting a first vector with a predetermined dimension; inputting the first vector into the LSTM network in the decoding module, and outputting a hidden state vector; through the pointer attention module, at least according to the feature vector and hidden state vector corresponding to each variable, predicting the probability of each non-basic variable entering the basis in this round; based on the probability, determining a non-basic variable and adding it to the variable set corresponding to the current restricted main problem. This neural network-based encoding + decoding prediction method can solve the final restricted main problem after obtaining the final restricted main problem, without having to perform multiple iterative solution processes in the middle, saving the time resources and computing resources occupied by iterative solution.

[0020] As a possible implementation method, encoding is performed through an encoding module to output a first vector with a predetermined dimension, including: using a trainable vector with a predetermined dimension, performing a dot multiplication operation with a feature matrix to obtain a scalar score; performing a softmax operation on the scalar score to obtain weights corresponding to each variable; and performing weighted summation on multiple feature vectors in the input feature matrix according to the weights to obtain a first vector with a predetermined dimension.

[0021] As a possible implementation method, before executing multiple rounds of loops to perform the encoding and decoding process, the method also includes: adding a virtual variable representing a stop symbol in the non-basic variable set; the non-basic variable set includes multiple non-basic variables; during the execution of multiple rounds of loops to perform the encoding and decoding process, the method also includes: according to the probability predicted by the pointer attention module, when the variable determined to be a virtual variable, stopping the prediction and completing the variable selection.

[0022] In a third aspect, the technical solution of the present application also provides an electronic device for sending data through a data transmission interface, the electronic device comprising: one or more processors; a memory; at least one application; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the electronic device, enable the electronic device to execute a method as described in any one of the first aspects above.

[0023] In a fourth aspect, the technical solution of the present application further provides a storage medium, comprising computer instructions, which, when executed on an electronic device, enables the electronic device to execute a method as described in any one of the above-mentioned first aspects.

[0024] In a fifth aspect, the technical solution of the present application also provides a chip system, comprising: a communication interface for inputting and / or outputting data; a processor for executing a computer executable program so that a device equipped with the chip system executes a method as described in any one of the above-mentioned first aspects.

[0025] The initial main problem construction method, electronic device, storage medium and chip system provided in the embodiments of the present application construct a state transfer equation based on the problem model, and then perform dynamic programming to construct the initial main problem. Therefore, in various practical application scenarios where column generation is used to solve problems, the problem to be solved can establish a corresponding problem model and a state transfer equation. The initial main problem can be constructed using the solution provided in the present application without the need for targeted design for specific application scenarios. Therefore, this method of constructing the initial main problem is more general and can be applied to different application scenarios to solve a variety of practical problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is an example diagram of the main process of the column generation method in the related art;

[0027] Figure 2 This is a flowchart of an initial main question construction method provided in some embodiments of the present application;

[0028] Figure 3 This is an example diagram of the process corresponding to the depth-first search in some embodiments of this application;

[0029] Figure 4 This is a diagram showing an example of the system architecture of the initial main problem construction method and the restricted main problem prediction method in some embodiments of the present application;

[0030] Figure 5 is an example diagram of the system architecture of a neural network in some embodiments of the present application;

[0031] Figure 6It is a specific example diagram of the system architecture of the neural network in some embodiments of the present application. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0033] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.

[0034] The initial main problem construction method, electronic device, storage medium and chip system provided in the embodiments of the present application can be applied to multiple application scenarios in multiple technical fields such as industrial production, logistics planning, supply chain, medical and cloud services. For example, it can be used to solve problems such as crew scheduling, cutting problems, vehicle path problems, and single resource factory site selection problems. In addition, the solution can also be applied to multiple application scenarios such as resource allocation, facility site selection, unit scheduling, logistics distribution, circuit design and intelligence retrieval, for example, to solve set cover problems (SCP), especially location set covering problems (LSCP), and linear programming problems (LP).

[0035] Generally speaking, problems solved using the column generation method often require the construction of an initial main problem. The solution provided in the embodiment of the present application can construct an initial main problem for practical problems faced by different application scenarios, and assist in solving corresponding practical problems.

[0036] The following is a brief description of the relevant terms and technologies that may be involved:

[0037] The Set Covering Problem (SCP) is one of the typical combinatorial optimization problems in operations research and has been widely used in resource allocation, facility site selection, unit scheduling, logistics distribution, circuit design, etc. Among them, the problem model of the Location Set Covering Problem (LSCP) aims to determine the number of emergency service facilities or the minimum construction cost under the condition of covering all emergency points, and configure these service facilities so that all emergency points can be covered. It can be used to solve the site selection problem of emergency service facilities such as fire stations and ambulances. For example, in the site selection problem of emergency facilities, the service radius of the service facilities is required to be standardized. The layout of ordinary fire stations in the city should be based on the principle that the fire brigade arrives at the fire scene as soon as possible, that is, arrives at the farthest point in the responsibility area within five minutes from the receipt of the alarm. This constraint is not reflected in the previous problem model, so there is a Location Set Covering Problem (LSCP). Simply put, in a certain area, the minimum number of facilities is set to cover all points in it.

[0038] Linear programming is an important branch of operations research that has been studied earlier, developed faster, been widely used, and has more mature methods. It is a method for studying the extreme value problem of linear objective functions under linear constraints. When the constraints and objectives are linear and all variables are continuous, the planning model is a linear programming model. Linear programming models can be widely used in military operations and engineering technology, providing a scientific basis for making optimal decisions based on the rational use of limited human, material and other resources.

[0039] The simplex method is a method for solving linear programming problems. Its core idea is to take a step-by-step approach to the optimal solution, first find a feasible solution, but it may not be the optimal one, and then gradually improve the feasible solution so that the value of the objective function gradually increases (or decreases) until the objective function reaches an extreme value (maximum or minimum value). The problem has an optimal solution, or it is judged that there is no optimal solution. In the simplex method, variables are divided into basic variables and non-basic variables. In each iteration of the optimization process, a non-basic variable is selected to enter the basis (become a basic variable) to obtain the optimization of the objective function. Generally speaking, the simplex method determines whether each non-basic variable can be entered into the basis by calculating the reduced cost (Reduced Cost) of each non-basic variable.

[0040] Column generation is an effective method based on the simplex method to solve linear programming problems with a large number of variables. In some linear optimization problem models, the number of variables will explode as the problem size grows, so all variables cannot be explicitly expressed in the model. When using the simplex method to solve such linear programming problems, the basic variables are only related to the number of constraints. Only one new non-basic variable is added to the basis in each iteration. Therefore, only a small number of variables are actually involved in the entire solution process. The column generation algorithm solves the pricing problem to find non-basic variables that can be added to the basis. The non-basic variables are not explicitly written in the model. If a non-basic variable that can be added to the basis cannot be found, it means that the test number (i.e., reduced cost) of all non-basic variables meets the optimal solution conditions, that is, the optimal solution of the linear programming has been found, even if many variables are not written in the model.

[0041] It can be understood that column generation is based on the simplex method, which is a method used to solve large-scale linear programming problems and can also be used to solve set covering problems.

[0042] Compared with the simplex method, which requires taking all variables into account, the core idea of ​​column generation is to obtain the optimal solution from a smaller set of variables. Specifically, it iteratively solves the restricted main problem that only contains some variables, and in each iteration, it selects new variables (columns) to add to the restricted main problem by solving the pricing subproblem, and stops the iteration after obtaining the global optimal solution. For example, the process of the column generation method can be as follows Figure 1 Based on the above characteristics, the column generation method is usually used for problems whose structure shows that the number of variables is much larger than the number of constraints (that is, the number of columns is larger than the number of rows). For example, in typical combinatorial optimization problems such as path planning problems and graph coloring problems, the column generation method shows excellent results.

[0043] To solve practical problems using the column generation method, we first need to construct an initial main problem, that is, the initial restricted main problem. However, currently, finding a feasible initial restricted main problem is often a difficult problem. Some related solutions can only customize corresponding exclusive design solutions for different problems, which have poor versatility; or we can obtain the initial restricted main problem with a feasible solution through a heuristic algorithm.

[0044] For example, in the solutions based on the dual vector adjustment mechanism, or in the solutions that use machine learning methods to implement column selection, some solutions use rule-based heuristic construction methods for specific problems in the initial restricted problem construction. The rules are targeted and not universal. When the problem changes or the application scenario changes, the initial main problem construction method may need to be redesigned. There is a lack of a universal initial restricted main problem construction method.

[0045] In addition, the problems faced by the column generation method can sometimes be modeled in the form of a set covering problem. For problems that can be modeled as a set covering model using the column generation method, the construction of the initial restricted master problem is often customized according to the problem background. Different problem backgrounds may require different construction methods. And for each specific problem background, trial and error is required according to the problem background. When the problem background changes, its applicability needs to be verified, which affects the effect of the application.

[0046] It can be seen that there is currently a lack of a relatively more general method for constructing the initial main problem.

[0047] In view of this, the present application embodiment proposes a method for constructing an initial main problem based on a dynamic programming method, see Figure 2 As shown, the method constructs a state transition equation based on a problem model to be solved (e.g., a linear programming problem model, a set covering problem model, etc.), and then, based on the state transition equation, performs corresponding dynamic programming to obtain an initial main problem. In some embodiments, the dynamic programming process can be implemented using a depth-first search algorithm.

[0048] Generally speaking, this scheme can be used to construct the initial main problem for various problems in various application scenarios where a problem model can be constructed and a column generation method can be used to find the optimal solution, so it is more general.

[0049] Specifically, the initial main question construction method based on column generation provided in the embodiment of the present application may include the following process:

[0050] S11, determine the state transfer equation based on the problem model.

[0051] In dynamic programming, it is first necessary to establish a state transition equation. In an embodiment of the present application, the state transition equation can be constructed based on a problem model, and the problem model is used to describe the actual problem to be solved in the application scenario. Exemplarily, the problem model can be a linear programming problem model, a set covering problem model, etc.

[0052] Many of the various problems faced in actual application scenarios can establish corresponding problem models. The embodiments of this application propose to establish a state transition equation based on the problem model. For example, for the convenience of description, the following embodiments are illustrated by taking a linear programming model as the problem model.

[0053] S12, according to the state transfer equation, perform dynamic programming to obtain the variable set corresponding to the initial main problem.

[0054] The core of dynamic programming lies in the construction of the state transfer equation. Once the state transfer equation is determined, the corresponding dynamic programming process can be adaptively obtained.

[0055] In some embodiments, a depth-first search (DFS) is used to implement dynamic programming. Specifically, after the state transfer equation is determined, a depth-first search is used to implement the corresponding dynamic programming process to solve the variable set of the state vector mapping of the kth stage in the state transfer equation. The kth stage is the target stage to be solved, and the variable set of the state vector mapping of the kth stage is the variable set corresponding to the initial main problem.

[0056] Once the variable set corresponding to the initial main problem is determined, the initial main problem is also determined. Therefore, constructing the initial main problem is equivalent to searching for the variable set corresponding to the initial main problem, that is, searching for a finite number of decision variables with feasible solutions from multiple decision variables in the linear programming model to form the initial restricted main problem.

[0057] It should be noted that, unless otherwise specified, the “variables” recorded in various places in the embodiments of the present application refer to decision variables in the linear programming model.

[0058] In some embodiments, the solution proposed in the embodiments of the present application is a dynamic programming method based on a pruning strategy. According to the coefficients corresponding to the variables in the variable set and the right-hand side terms of the linear programming model, a feasible initial main problem is quickly constructed. This method is independent of the problem background. As long as the problem is a set covering modeling method, the initial main problem can be quickly obtained through this method.

[0059] Specifically, in some embodiments, the state transfer equation can be determined in the following manner: determine the right-hand side term of the constraint condition in the linear programming model and the coefficient vector of each variable, and use the right-hand side term as the state vector; and construct the state transfer equation based on the state vector and the coefficient vector. That is, construct the state transfer equation about the state vector and the coefficient vector.

[0060] For example, in one feasible method, a state transfer equation is constructed based on a state vector and a coefficient vector. The state transfer equation can be constructed by taking a variable set mapped by the state vector as the state of the next stage and taking a variable set containing only one variable mapped by a coefficient vector as the state of the initial stage.

[0061] In some embodiments, a depth-first search is used to perform dynamic programming based on a state transition equation, which may be based on a depth-first search module to perform the following process:

[0062] S120, input a first value of a state vector, a first set, and a globally infeasible state set.

[0063] The value of the state vector can be understood as the state of each stage in dynamic programming. Among them, the first value of the state vector can be understood as the value of the state vector when the state vector does not perform state transfer (state deduction) in the current stage. The first set is the set of coefficient vectors.

[0064] The global infeasible state set, that is, the set of states that do not have feasible solutions, is used to record the values ​​of state vectors that do not have feasible solutions. The purpose of recording these values ​​is to record the states that have been calculated before and do not have feasible solutions, so as to avoid repeated calculation of the state in the subsequent search process.

[0065] S121, determining the first value of the state vector, and if it belongs to the global infeasible state set, returning an empty set.

[0066] If the state of the current stage (the first value of the state vector) belongs to an element in the global infeasible state set, it means that the current value of the state vector has been calculated before and has no feasible solution. Therefore, the subsequent search process is abandoned and an empty set is directly returned.

[0067] S122, determining a first value of the state vector, and if it does not belong to the global infeasible state set, pruning the first set to remove infeasible coefficient vectors, and the remaining coefficient vectors form a second set.

[0068] The embodiment of the present application uses a pruning strategy in the depth-first search process, and the coefficient vectors of each variable are used as "branches" to form a first set. In addition to recording states without feasible solutions, recording coefficient vectors that do not have feasible solutions relative to a certain state, the pruning strategy, that is, subtracting coefficient vectors that do not have feasible solutions relative to the parent state of the current state, will be specifically explained later.

[0069] In each stage, the set of coefficient vectors that are pruned is the second set.

[0070] It should be noted that "first", "second", "third", etc. in the embodiments of the present application are only used to distinguish different objects to prevent confusion, and are not used as a limitation on the execution timing or order. The object described can be a class of objects or a specific object.

[0071] S123, traverse each coefficient vector in the second set, perform state transfer in sequence, and obtain a second value of the state vector.

[0072] Exemplarily, the state transfer is performed sequentially by performing subtraction operations on the first value of the state vector and the p-th coefficient vector respectively; wherein 1≤p≤N, and N is the total number of coefficient vectors in the second set.

[0073] For example, the state vector is b and the pth coefficient vector is a p , then the corresponding state transition is ba p .

[0074] S124, when the second value is equal to 0, the first result is returned; the first result is equal to the variable corresponding to the coefficient variable involved in the state transfer.

[0075] For example, if ba p = 0, then the coefficient vector a p The corresponding variable x p Returned as the first result.

[0076] S125, when the second value is not 0, recursively call the depth-first search module with the second value of the state vector, the second set and the global infeasible state set as input.

[0077] If the second value is not 0, the depth-first search module is called to perform a recursive search. When calling, the input of the depth-first search module needs to be updated, and the second value of the state vector, the second set, and the global infeasible state set are used as updated inputs and input into the depth-first search module.

[0078] The depth-first search module is an algorithm flow that can be implemented through code. For example, the overall flow of S121-127 is the flow that can be implemented by the depth-first search module.

[0079] S126, when the second result obtained by the depth-first search module is not empty, return the third result; the third result is equal to the union of the second result and the first result.

[0080] The second result is state ba p The corresponding return result, the second result is not empty, indicating that the status is ba p The mapped variable set has a feasible solution. Then, the second result is compared with x pThe collection of is returned as the third result.

[0081] S127, when the second result obtained by the depth-first search module is empty, the second value is added to the global infeasible state set.

[0082] The second result is empty, indicating that the status is ba p The set of variables mapped does not have a feasible solution. p Add to the global infeasible state set.

[0083] As mentioned above, in some embodiments of the present application, a pruning strategy is also used in the depth-first search. Specifically, the pruning strategy can be implemented based on the following steps:

[0084] After the second result obtained by the depth-first search module is empty, in the third set, the p-th coefficient vector is recorded, which has no feasible solution for the second value.

[0085] The third set is used to record the correspondence between the coefficient vector and the state. For example, when the second result is empty, the coefficient vector a is recorded. p It is not feasible for state b. Then in the third set, the record is a p There is a corresponding relationship between state b.

[0086] The specific recording method can be in the form of a set, an array or a matrix. For example, a p and state b are recorded in the same array, it means that a p It is not feasible for state b. Alternatively, state b and all known coefficient vectors that are not feasible relative to state b are put into the same array or set, indicating that all coefficient vectors in the array or set are not feasible relative to state b.

[0087] In another embodiment, an index may be set for state b, and each index number corresponds to a corresponding array or set, in which all known coefficient vectors that are not feasible for state b are recorded. There are many ways to record that one or more coefficient vectors are not feasible for a certain state, and the embodiments of this application do not list them one by one.

[0088] Next, we will explain the determination of the relationship between parent states and child states between different states:

[0089] Given state vectors b1 and b2, when b1-b2>0, b2 is called the child state of b1, and b1 is the parent state of b2. A coefficient vector that is infeasible for the parent state b1 must also be infeasible for the child state b2.

[0090] It should be noted that, when the values ​​of all elements in b1 are greater than the values ​​of the elements at the corresponding positions in b2, it is considered that b1-b2>0.

[0091] The pruning strategy proposed in the embodiment of the present application can further reduce the search time.

[0092] After the relative relationship between states can be identified, the specific pruning strategy is: first query the parent state of the current state, that is, query the parent state corresponding to the first value of the state vector. If the queried parent state has an infeasible coefficient vector relative to it, then the coefficient vector is also infeasible relative to the child state. Specifically, the first value of the state vector is recorded as b2; the second value of the state vector recorded in the third set is recorded as b1; when the values ​​of the elements in b1 are all greater than the values ​​of the elements at the corresponding positions in b2, b1 is determined to be the parent state of b2, and b2 is the child state of b1.

[0093] Then, the coefficient vectors that do not have feasible solutions for the parent state b1 are searched and determined to be to be pruned; in the first set, the coefficient vectors determined to be to be pruned are deleted. That is, in the first set, the coefficient vectors that are infeasible relative to the parent state of the current state are deleted.

[0094] An example of constructing a state transfer equation based on the current planning model is listed below to illustrate the solution provided by the present application.

[0095] Aiming at the actual problems in the application scenario, a linear programming model is established as follows:

[0096] min∑ p∈P c p x p

[0097] st∑ p∈P a ip x p =b i ,i∈m

[0098] x p ≥0,

[0099] Among them, min∑ p∈P c p x p represents the objective function, st∑ p∈P a ip x p =b i is the constraint condition, x p is the pth decision variable, P represents the index set of decision variables, a ip is the coefficient vector a p The i-th element in the coefficient vector ap is the pth decision variable x p The coefficient vector of .

[0100] For each decision variable x p , with objective function coefficient c p ∈R and the coefficient vector a p ∈R m , R represents the set of real numbers, R m represents a real number set of dimension m, the right hand side term b of vector b i is the i-th element in vector b, b∈R m . Vector b is the state vector.

[0101] a p =(a 1p , a 2p …a ip …a mp ); b=(b1,b2…b i …b m ).

[0102] Considering only part of the variable set P′, we get the restricted main problem:

[0103] min∑ p∈P′ c p x p

[0104] st∑ p∈P 'a ip x p =b i ,i∈m

[0105] x p ≥0,

[0106] Then, construct the initial master problem, that is, select a finite number of variables from all decision variables to form the initial restricted master problem with feasible solutions, that is, determine the initial range of the set P′.

[0107] Exemplarily, the specific process of constructing the initial question in this embodiment is as follows:

[0108] First, the state transfer in the dynamic programming method is defined. For a given linear programming problem, the right-hand side is taken as the state vector b, and the variable set of the feasible initial main problem is f(b). For any variable x p The coefficient vector a p For example, f(a p ) means the variable only contains the variable x p Therefore, the state transfer equation is defined as:

[0109]

[0110] Among them, the calculation of the right-hand side of the linear programming coefficient vector can be expressed as:

[0111] ba=[b i -a i |i={1,2,…,m}]

[0112] Assume that the maximum value of each dimension of vector b is b max , then the total state space size of vector b is b max m However, due to the limitation of the variable set, not all states will be calculated. At the same time, this stage is to quickly find a feasible variable set P′ to construct the initial main problem. Therefore, depth-first search is used to implement dynamic programming. The algorithm stops when any feasible set is found.

[0113] Exemplarily, in this embodiment, see Figure 3 As shown, the specific process of depth-first search is as follows:

[0114] S201, input state vector b, coefficient vector set A to be selected b and the set of infeasible states infeas;

[0115] in, a={a1,a2,…a p …a P}, A represents the set of all coefficient vectors, A b is a subset of a. b | represents the set A b The number of elements in .

[0116] The depth-first search process can be implemented through the depth-first search module. The depth-first search module is a programmable and callable algorithm module. Specifically, input b, A b and infeas, which can be understood as determining the input variables of the module, namely DFS(b,A b ,infeas), and input b, A b The value of and infeas at the current stage, the input at the beginning stage is the initial value. The DFS module can also be a callable function.

[0117] S202, determine whether the current value (first value) of the state vector b belongs to the infeasible state set infeas; if yes, return an empty set, otherwise, proceed to step S203;

[0118] If b∈infeas, it is determined that b is currently in an infeasible state, which means that the current state cannot be mapped to a variable set with a feasible solution, and thus an empty set is returned.

[0119] S203, for the current coefficient vector set (first set) A b Make pruning judgment, remove infeasible coefficient vectors, and obtain a new coefficient vector set A′ b (Second set);

[0120] That is, filter A′ b =FILTER(A b ), where FILTER is the pruning strategy. The core logic of the pruning strategy is to filter out those coefficient vectors that are not feasible for the parent state of b. That is, first find the parent state of b, then query the coefficient vectors that are not feasible for the parent state, and remove these coefficient vectors from the set A. b to avoid double counting.

[0121] S204, traverse the set A′ b The coefficient vector in

[0122] S205, for set A′ b Each coefficient vector a in p , perform state transfer deduction;

[0123] State transfer deduction, i.e. ba p :

[0124] ba p =[b i -a ip |i={1,2,…,m}]

[0125] Assume p≤|A b |.

[0126] For example, the current value (first value) of the state vector b is (2,1,5,6…3,2,1), a p The value of is (1,1,2,3…1,0,1), then ba p =(1,0,3,3…2,2,0). (1,0,3,3…2,2,0) is the second value of the state vector b after the state transfer is executed.

[0127] S206, determine ba p = = 0? Yes, then return (first result) result = {x(a p )},x(a p ) is the coefficient vector a p The corresponding decision variable x p, that is, result = {x p}.

[0128] ba p = = 0, then b = a p , then a p The variable set f(a p )=x p Therefore, the value of b in the current state, the mapped variable set is also x p .

[0129] If not, proceed to step S207.

[0130] S207, update input and recursively call DFS.

[0131] Update the input variable to ba p , A′ b 、infeas, Get (second result)

[0132] Recursively (deep search) new states with feasible solutions. That is, to solve f(b), given f(a p ), we need to solve f(ba p ).

[0133] S208, judging the returned result Is it empty? If not, return the current result. With coefficient vector a p The corresponding decision variable x p Collection of .

[0134] That is, if Not empty, returns the coefficient vector a p The corresponding variable x(a p )and The collection of, that is, return (the third result)

[0135] Return results If it is empty, go to step S209.

[0136] S209, status ba p Infeasible, add it to the infeasible state set infeas.

[0137] Return results Empty, indicating ba p This state has no feasible solution, namely ba p cannot be mapped to a set of variables with a feasible solution, or ba pThe set of mapped variables does not have a feasible solution, that is, f(ba p ) has no feasible solution.

[0138] The state ba p Put it into the infeas set of infeas, infeas→infeas∪ba p .

[0139] S210, record a p This coefficient vector is not feasible for the state space b.

[0140] For example, record a p is infeasible for status b.

[0141] Optionally, the record may be stored in a third set.

[0142] Returning to S203, if a is recorded p is infeasible for status b, then for all sub-states of state vector b, when making pruning decisions, a will be p Remove from the coefficient vector set to avoid a lot of repeated calculations. For example, assuming the value of the state vector b is (2,1,5,6…3,2,1), when the value of all elements of b′ is less than the value of the element at the corresponding position of b, a p It is also not feasible for b′. In the depth-first search with input containing b′, before the state transition is deducted, a p Remove from the set of coefficient vectors.

[0143] In this way, a set of variables with feasible solutions is obtained, and the corresponding initial main problem is determined.

[0144] On the other hand, the inventors also found during the research process that in each iteration of column generation, the selection of non-basis variables to be included in the basis has a crucial impact on the solution speed and convergence efficiency of the column generation method. In the traditional column generation method, after solving the restricted main problem in each iteration, the decreasing cost of each variable not in the restricted main problem is calculated according to its dual variable. Taking the minimization problem as an example, in the minimization problem, it is necessary to select variables with a decreasing cost less than 0 and add them to the restricted main problem. The entire iterative process of column generation continues until the decreasing cost of no variable is less than 0. This selection method usually leads to a degenerate effect of the solution, and not every variable selected in the iteration process will become the basis variable of the optimal solution.

[0145] In addition, some solutions in related technologies cannot get rid of the cyclic iterative solution mode in the method framework, such as the following two solutions:

[0146] Related solution 1:

[0147] In each round of iteration of the column generation method, the optimal solution of the restricted master problem may correspond to multiple different dual variables. The choice of dual variables directly determines the calculation of each non-basic variable decreasing function, thereby affecting the convergence speed of the column generation algorithm. Therefore, in each iteration, the selection of appropriate dual variables has a huge impact on the solution effect. From a dual perspective, adding new variables to the restricted master problem is the process of adding new constraints to its dual problem. As the iteration proceeds, the feasible solution space of the dual problem gradually decreases, approaching the optimal solution of the dual problem of the original problem.

[0148] Therefore, in the iterative process of column generation, selecting the dual solutions of the restricted master problem that are closer to the dual solution of the original problem is conducive to the rapid convergence of column generation. In a feasible solution, the entire column generation algorithm is constructed as a Markov process, and each iteration is independent of the previous iteration. In each iteration, the dual variables obtained by directly solving the restricted subproblems are not used to calculate the decreasing cost. Instead, the relevant features of the restricted master problem are input through machine learning to predict the new dual variables. In the process of constructing the sample, in order to obtain the optimal dual variable of the current restricted master problem, it solves the following problem:

[0149] min||π′-π * ||

[0150] st∑ i∈m b i π′ i =Λ

[0151] st∑ i∈m a ip π i ≤c p ,p∈P′

[0152] It means that we need to obtain the optimal solution of the dual problem of the current restricted subproblem, and ensure that this optimal solution is closest to the optimal solution of the dual problem of the original problem. In this way, the dual problem of the restricted main problem can have the greatest convergence effect in each iteration. In this way, the obtained dual variable will be used as the label of the current sample. After the machine learning model is trained, in each iteration of the column generation algorithm, the dual variable is predicted by the model, and the predicted dual variable is used to calculate the decreasing cost to select which variables to add to the restricted main problem.

[0153] Related solution 2:

[0154] In the iterative process of the column generation algorithm, the variables are selected to be added to the restricted master problem to pursue two goals, namely, to obtain the greatest possible convergence effect using as few variables as possible. Therefore, some solutions use machine learning classification models to determine whether each variable that has not been added to the restricted master problem should be added in each iteration. During the training process, in order to collect samples and set labels, a new problem needs to be solved for each restricted master problem:

[0155] min∑ p∈P′ c p x p +∑ p∈P″ εy p

[0156] st∑ p∈P′∩P″ a ip x p =b i ,i∈m

[0157] x p ≥0,

[0158] x p <y p ,

[0159] y p ∈{0,1}

[0160] Where P″ represents the set of variable indices to be selected. The objective function of this problem is to minimize the objective function after adding new variables. At the same time, in order to minimize the number of newly added variables, a certain penalty function needs to be added to the objective function. At the same time, the variable y p Represents variable x p Whether to be added to the restricted master problem. This method no longer uses the original dual variable calculation decreasing cost method for selection.

[0161] However, the above two technical solutions cannot get rid of the loop iterative solution mode in the algorithm framework. Their purpose is to reduce the number of iterations of the column generation algorithm, rather than directly obtaining the final column that should be selected through the initial restricted master problem end-to-end. Secondly, when constructing samples, both solutions need to solve a combinatorial optimization problem or quadratic programming problem many times, which makes sample collection more difficult.

[0162] At the same time, column generation algorithms often have too many convergence times and slow convergence speed. Each iteration requires a certain computational cost to solve the restricted master problem before variable selection can be performed. Therefore, the computational cost of the column generation method is relatively high and time-consuming.

[0163] In view of this, an embodiment of the present application also proposes a restricted main problem prediction method based on column generation. The method adopts a variable selection mechanism based on a deep learning method. On the basis of the constructed initial main problem, it predicts the final selected column, that is, predicts the final variable set, thereby improving the solution efficiency and convergence speed of the column generation method.

[0164] Therefore, in the method provided in the embodiment of the present application, after constructing the initial main problem, it also supports predicting the final restricted main problem (i.e. predicting the final selected column or variable) based on the initial main problem through a neural network, and then solving the restricted main problem to obtain the optimal solution to the problem. Figure 4 As shown. Figure 4 It can be seen that the method provided in the embodiment of the present application can be divided into two parts: initial main problem construction and learning pricing acceleration. The learning pricing acceleration part is a variable selection mechanism based on a deep learning method, which is used to predict the columns (variables) added to the restricted main problem.

[0165] Specifically, the variable selection mechanism based on deep learning methods can include the following process:

[0166] S13, determining the characteristic matrix corresponding to the initial main problem.

[0167] The characteristic matrix includes characteristic vectors of multiple variables corresponding to the restricted main problem. The initial main problem is the initial restricted main problem. Each restricted main problem corresponds to a variable set, and the above-mentioned initial main problem construction method is equivalent to a method for determining the initial variable set. After obtaining the initial main problem, starting from step S13, a variable selection mechanism based on a deep learning method is adopted. This mechanism can be understood as predicting the final selected column based on the initial main problem, that is, predicting the variable set corresponding to the final restricted main problem. The variable set corresponding to the initial main problem is the initial variable set, and its corresponding characteristic matrix is ​​the initial input of the neural network.

[0168] The initial variable set includes multiple variables. The feature extraction module can be used to extract features from the coefficient vector corresponding to each variable to obtain a new feature vector to represent the corresponding variable.

[0169] For example, assuming that the initial variable set corresponding to the initial main problem is {x1, x2, x3, x4}, then after feature extraction, the corresponding four eigenvectors obtained are m1, m2, m3, and m4, respectively. These four eigenvectors can form a feature matrix with four rows and multiple columns.

[0170] In some embodiments, the feature vector of the variable may be extracted in the following manner:

[0171] First, the initial features are extracted, including obtaining the decreasing cost corresponding to the variable in the initial state; the maximum value, minimum value and average value of each element in the vector corresponding to the right-hand side term of the model; the maximum value, minimum value and average value of the initial state dual variable; the maximum value, minimum value, average value and summation of each element in the coefficient vector corresponding to the variable; the number, minimum value and average value of the non-zero coefficients corresponding to the variable; the maximum value, minimum value, average value and summation of the difference between the elements in the coefficient vector corresponding to the variable and the elements in the vector corresponding to the right-hand side term of the model; the minimum value, maximum value and average value of the product of the elements in the coefficient vector and the initial state dual variable, and combining the above multiple values ​​to obtain the extracted initial features; the initial features are high-dimensional features; the summation value, that is, the corresponding multiple elements are summed.

[0172] Afterwards, the initial features are mapped to a feature vector of a predetermined dimension through a multi-layer fully connected neural network. In an embodiment of the present application, the dimension of the feature vector is higher than the dimension of the initial features. The mapping here is a dimensionality increase process.

[0173] S14, input the feature matrix into the neural network, and predict the non-basic variables that need to be added to the current restricted main problem through the neural network.

[0174] The prediction process is an end-to-end prediction process. End-to-end prediction can be understood as inputting the feature matrix of the initial main problem from the input end, and obtaining the predicted selected columns from the output end. The predicted columns are non-basic variables that need to be added to the variable set corresponding to the current restricted main problem. After at least one prediction process, at least one non-basic variable that can be entered into the basis is predicted and added to the variable set corresponding to the initial main problem. Then, the variable set corresponding to the final restricted main problem can be determined, that is, the final restricted main problem is determined. The final restricted main problem is the restricted main problem with the optimal solution. Solving the final restricted main problem means obtaining the optimal solution to the problem model.

[0175] In the related art, after each restricted main problem is obtained, it is necessary to obtain the optimal solution to the dual problem of the current restricted subproblem, or a new problem needs to be solved for each restricted main problem, that is, a multiple iterative solution mode is adopted.

[0176] The "end-to-end" in the embodiments of the present application means that the prediction result can be obtained directly from the input end to the output end without multiple iterations, and there is no need to solve the restricted main problem or its dual problem after each restricted main problem is obtained. It is only necessary to solve the restricted main problem of the final prediction, that is, to solve it once.

[0177] Specifically, in some embodiments, the network architecture of the neural network refers to Figure 5As shown, it includes an encoding module and a decoding module, wherein the decoding module includes an LSTM (Long Short-Term Memory) network and a pointer attention module.

[0178] In some embodiments, S14 may be implemented through the following process:

[0179] Perform at least one encoding and decoding process, wherein the encoding and decoding process includes: inputting the feature matrix corresponding to the current restricted main problem into the encoding module, encoding through the encoding module, outputting a first vector with a predetermined dimension, inputting the first vector into the LSTM network in the decoding module, and outputting a hidden state vector; through the pointer attention module, predicting the probability of each non-basic variable entering the basis in this round at least according to the feature vector and the hidden state vector corresponding to each variable; based on the probability, determining a non-basic variable and adding it to the variable set corresponding to the current restricted main problem.

[0180] The encoding and decoding process in the prediction method provided in the embodiment of the present application can be performed multiple times, and there may be only one execution process in individual embodiments. In at least one execution process, first, according to the characteristic matrix of the initial main problem, the next variable added to the initial variable set is predicted according to the process of S14 above, and then the predicted next variable is added to the variable set, and the characteristic matrix corresponding to the variable set is updated as the input for the next time, and then after encoding and decoding, the next variable added to the variable set is predicted, and this is performed multiple times. Until the termination condition is reached. Among them, a coding and decoding process is equivalent to a process of a non-basic variable entering a basis.

[0181] It should be noted that in this multiple execution, only the encoding and decoding process is cyclic, and the output of this time may be used as the input of the next time, but this cyclic mechanism does not need to solve the restricted main problem obtained in each round, thus saving the time resources and computing resources occupied by the solution. In comparison, some solutions in the prior art require iterative solution, that is, each time the restricted main problem is obtained, the restricted main problem must be solved. Multiple restricted main problems also need to be solved multiple times, and each solution will occupy more computing resources and consume a certain amount of time.

[0182] The solution provided in the embodiment of the present application takes the initial primary problem as input and can predict the final restricted primary problem, that is, it can achieve direct prediction from the initial primary problem to the final primary problem, and the optimal solution can be obtained by solving the finally predicted restricted primary problem once, thus eliminating the iterative solution process, thereby reducing time consumption and improving solution efficiency.

[0183] In the embodiment of the present application, as a feasible way, the process of multiple cycles needs to have a termination condition. For example, before executing multiple cycles to execute the encoding and decoding process, a dummy variable representing a stop symbol is added to the non-base variable set. Then, in the prediction stage, that is, in the process of executing multiple cycles to execute the encoding and decoding, according to the probability predicted by the pointer attention module, if the variable is determined to be a dummy variable, the prediction is stopped to complete the variable selection.

[0184] The non-basic variable set includes multiple non-basic variables, and the non-basic variables are candidate variables among multiple decision variables of the linear programming model that are not added to the variable set corresponding to the restricted main problem.

[0185] It should be noted that as the number of variables in the variable set increases, the dimension of the feature matrix corresponding to the variable set changes, while the input dimension of the LSTM network is generally fixed. Therefore, the embodiment of the present application also provides a variable dimension processing mechanism, which encodes the feature vectors in the feature matrices of different dimensions through the encoding module, and outputs a first vector with a predetermined dimension, so as to realize the conversion of feature vectors of different dimensions into a comprehensive feature vector with the same dimension to be compatible with the LSTM network. At the same time, the processing mechanism can retain feature details and avoid or reduce feature loss due to dimensionality transformation.

[0186] Specifically, the variable dimension processing mechanism provided in the embodiment of the present application includes: using a trainable vector with a predetermined dimension, performing a dot multiplication operation with a feature matrix to obtain a scalar score; performing a softmax on the scalar score to obtain the weights corresponding to each variable; and according to the weights, performing weighted summation on multiple feature vectors in the input feature matrix to obtain a first vector with a predetermined dimension.

[0187] Combine the following Figure 6 A specific embodiment is given below. Figure 6 An example of the network architecture of the deep learning network provided in an embodiment of the present application is shown.

[0188] See also Figure 6 As shown, Figure 6 Multiple sets of feature matrices are shown in . It should be noted that these feature matrices are input into the encoding module one after another, not all at the same time. One set of feature matrices corresponds to one round of encoding and decoding process. The first feature matrix input is the feature matrix corresponding to the initial main problem.

[0189] In each round of decoding, the feature vectors corresponding to the variables currently determined to have been added to the restricted main problem (including the initial main problem) are combined into a feature matrix and input into the decoding module. Multiple feature vectors are placed in parallel to form a feature matrix. For example, assuming that the initial variable set corresponding to the initial main problem contains five variables, after feature extraction, five feature vectors are obtained, namely m1, m2, m3, m4, and m5. Then these five feature vectors are placed in parallel to form a feature matrix with five rows and multiple columns.

[0190] As mentioned above, as the number of selected variables gradually increases, the input dimension received in each decoding step will change, but the decoding module LSTM network can only process inputs of fixed dimensions. The embodiment of the present application uses a variable dimension processing mechanism, using a trainable vector and each row of the input matrix (the eigenvector of each variable) to perform a dot multiplication to obtain a scalar score. For the scalar score obtained by the dot multiplication, after performing Softmax to obtain the weight of the variable, a weighted sum is taken for all input variables, and after the dimension is fixed, it is input into the decoding module to achieve dimensional compatibility. The variable dimension processing mechanism is the encoding process performed by the encoding module.

[0191] For example, the variable dimension processing mechanism may be: a trainable vector is multiplied with each row of the input matrix (the eigenvector of each variable) to obtain a scalar score Perform Softmax on the scalar score obtained by point multiplication to obtain the weight vector e of the variable t After that, a weighted sum is made for all input variables to achieve dimension compatibility. Then the input of the decoding module can be calculated as

[0192]

[0193] e t =softmax(s t )

[0194]

[0195] Where m p Represents variable x p The feature vector of , f(·) represents the vector dot multiplication operation, H is a trainable vector, and the parameters in the trainable vector can be adjusted during the training process. t+1 It is the comprehensive feature vector output by the encoding module, that is, the first vector with a predetermined dimension.

[0196] Then the first vector is input into the LSTM network in the decoding module, and after LSTM prediction, the hidden state vector is obtained.

[0197] Specifically, for the t-th decoding step, the hidden state of the LSTM output is d t ;

[0198] Then, a pointer attention module is used to calculate the probability of selection for each candidate variable and sample new variables. The specific operations performed by the pointer attention module are as follows:

[0199] Given that the eigenvector corresponding to the pth variable is m p , then the sampling probability τ t It can calculate:

[0200]

[0201] τ t =softmax(u t +I t )

[0202] Where V T , W1, W2 are three trainable parameters, I t It is used to indicate whether each variable is selected in the current decoding step. Indicates that it is not selected. According to the sampling probability, a variable is selected from the variable set to be added to the restricted main problem. Then, the selected variable is added to the main problem variable set.

[0203] Then, the next round of encoding and decoding steps is carried out, and the feature matrix corresponding to the variable set with a new variable added is input into the encoding module, and the dimension change processing is performed again. This cycle is repeated for multiple rounds until the attention module selects a virtual variable representing a stop sign, completing the variable selection.

[0204] It should be noted that the Figure 5 or Figure 6 The network architecture shown is only an example, in which the LSTM network and the like can be replaced by other networks with equivalent functions, such as using the transformer model, BT-LSTM (Block-Term LSTM), etc. to replace LSTM.

[0205] Moreover, it is not ruled out that the softmax function can be replaced by other functions with equivalent functions. For example, in the actual solution of some problems, there is a possibility of replacing the softmax function with a combination of one or more functions such as the logistic function, the sigmoid function, the ReLU function, etc.

[0206] Therefore, the prediction method provided in the embodiment of the present application, through an end-to-end selection of columns that should be added to the main problem based on an "encoding-decoding" learning pricing network, eliminates the iterative process, replaces the process of iteratively solving RMP and pricing sub-problems in the original column generation algorithm, and avoids the computational cost of iteratively solving the main problem and sub-problems multiple times.

[0207] It should also be noted that the column-generated restricted main problem prediction method provided in the embodiment of the present application can be implemented as an independent solution and does not rely on the initial main problem construction method provided in the embodiment of the present application. In other words, no matter which method is used to determine the initial main problem, the prediction method provided in the embodiment of the present application can be used after the initial main problem is determined.

[0208] Accordingly, according to the solution provided in the present application, multiple embodiments can be obtained that only use the initial main problem construction method, multiple embodiments can be obtained that only use the prediction method, and multiple embodiments can be obtained that use both the initial main problem construction method and the prediction method.

[0209] Therefore, the embodiment of the present application actually also provides an independently executable column-generated constrained main problem prediction method, the method comprising: after determining the initial main problem, determining the characteristic matrix corresponding to the initial main problem; inputting the characteristic matrix into the neural network, and predicting the non-basic variables added to the constrained main problem end-to-end through the neural network.

[0210] Among them, the neural network includes an encoding module and a decoding module, and the decoding module includes an LSTM network and a pointer attention module. Please refer to the description in the above embodiment for details, which will not be repeated here.

[0211] In addition, it should be noted that the method provided in the embodiments of the present application, whether it is the initial main problem construction method or the end-to-end prediction method, is not only applicable to solving linear programming problems, but can also be used to solve other problems such as set covering problems.

[0212] The following describes how the method provided in the embodiment of the present application solves the set coverage problem by combining examples in actual application scenarios.

[0213] The solution provided by the embodiment of the present application can be widely used in the supply chain box splitting scenario. In order to meet the order requirements from all over the world, Huawei's supply chain has to handle millions of box splitting tasks every month. Specifically, the box splitting task is to pack all the goods to be packaged into several minimum packaging units (Standard Product Unit, SPU, also known as standardized product unit) to meet transportation needs.

[0214] The binning problem is essentially a three-dimensional loading problem, which needs to consider volume constraints, capacity constraints, overlapping constraints, etc. It has been proven to be NP-Hard (non-deterministic polynomial hard). In actual production environments, there are often some customized requirements: such as specifying the type of SPU, or items with BOM (Bill of Materials) relationships must be packaged in the same SPU, etc. Due to the huge number of orders in the supply chain scenario, slight improvements in the solution algorithm will bring huge benefits.

[0215] The supply chain has accumulated a large amount of historical SPU data during the long-term construction process. Based on this historical data, the box segmentation problem can be modeled as a set covering problem and solved through the column generation method without knowing the specific dimensions and quality of the goods. It can determine which historical SPUs should be combined to complete the packaging of an order, thereby avoiding solving complex three-dimensional loading problems on some orders.

[0216] In the specific application of the box segmentation scenario, the demand state vector of an order containing D types of materials is defined as O = [q1, q2, ..., q D ], where q i represents the demand quantity of the i-th material. For any historical SPU, its material state vector is SPU = [sq1, sq2, ..., sq D ], where sq i Indicates the quantity of the i-th material in the SPU. When SPU < 0 and the SPU can meet the customized requirements of the order, the historical SPU can be considered as the matching SPU for the order. Use MatchSPU O represents the material state vector set of all matching SPUs of the order. Then the state transition equation is

[0217]

[0218] When the solution provided by the embodiment of the present application is used in a binning scenario, the material demand of an order can be represented as a demand state vector and used as the right-hand side term of the linear programming model, and the material quantity of each historical matching SPU can be represented as a material state vector and used as the coefficient vector of the linear programming model, thereby converting the supply chain binning scenario into a problem structure (i.e., problem model) that can be handled by the embodiment of the present application.

[0219] Similarly, for a variety of different application scenarios, they can be first converted into a linear programming model, so that the initial main problem can be constructed and / or the final restricted main problem can be predicted according to the processing flow of the above-mentioned linear programming model, and the present embodiment will not be described one by one.

[0220] On this basis, the dynamic programming algorithm designed in the embodiment of the present application is used to select an SPU that can construct an initial feasible RMP from the matched historical SPUs.

[0221] Based on the initial RMP, the solution provided by the embodiment of the present application is used to calculate the feature vector for each historical candidate SPU and input it into the learning pricing network (e.g. Figure 6 or Figure 5 In the network shown in FIG, the final SPU is selected to construct the complete main problem and solve it.

[0222] The solution provided in the embodiment of the present application has the following effects when implemented in the supply chain scenario:

[0223] For the supply chain binning scenario, compared with the original method, the probability of successful binning using historical data has increased from 5.5% to 9.5%. With 30,000 to 100,000 orders to be processed every day, every 1% increase can save a lot of manpower (already in production environment). In the experimental scenario of randomly selecting 1,000 orders each month, the learning pricing method can effectively reduce the running time of the column generation algorithm, with an average reduction of 18.25%.

[0224] In summary, the embodiment of the present application proposes a dynamic programming method for constructing an initial feasible solution, which realizes the general construction of an initial feasible main problem and can quickly search for variables for constructing a feasible initial main problem;

[0225] The embodiment of the present application also provides a column selection method based on a learning pricing network, which determines which columns should be added to the main problem based on the initial main problem in an end-to-end manner, thereby reducing the computational process of iteratively solving the main problem or sub-problems and improving the solution efficiency.

[0226] The present application also provides an electronic device, which may include: a processor; a memory; at least one application; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions. When the instructions are executed, the electronic device may perform a method as described in any one of the above embodiments.

[0227] An embodiment of the present application further provides a storage medium, comprising computer instructions, which, when executed on an electronic device, enables the electronic device to execute a method as described in any one of the above embodiments.

[0228] An embodiment of the present application also provides a chip system, including: a communication interface for inputting and / or outputting data; a processor for executing a computer executable program so that a device equipped with the chip system executes a method as described in any one of the above embodiments.

[0229] It should be noted that the solution provided in the embodiments of the present application includes any one or more of the method, electronic device, storage medium and chip system, or may also be other forms of software products, hardware products or virtual service products obtained based on the technical concept of the method described in the specification of this application.

[0230] In the description of the device in the embodiment of the present application, various modules for implementing the method flow functions are constructed in the device. The division of modules is merely a division of logical functions. When implementing the embodiment of the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0231] Specifically, each functional module can be fully or partially integrated into one physical entity during actual implementation, or can be physically separated. And these modules can all be implemented in the form of software calling through processing elements; or all can be implemented in the form of hardware; or some modules can be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware. For example, the detection module can be a separately established processing element, or it can be integrated in a chip of an electronic device. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in a processor element or instructions in the form of software.

[0232] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital signal processors (DSP), or one or more field programmable gate arrays (FPGA), etc. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0233] Specifically, in one embodiment of the present application, the above-mentioned one or more computer programs are stored in the above-mentioned memory, and the above-mentioned one or more computer programs include instructions. When the above-mentioned instructions are executed by the above-mentioned device, the above-mentioned device executes the method steps described in the embodiment of the present application.

[0234] Specifically, in one embodiment of the present application, the processor of the electronic device may be a SOC device on a chip, which may include a central processing unit (CPU), and may further include other types of processors. Specifically, in one embodiment of the present application, the processor of the electronic device may be a PWM control chip.

[0235] Specifically, in an embodiment of the present application, the processor involved may include, for example, a CPU, a DSP, a microcontroller or a digital signal processor, and may also include a GPU, an embedded neural network processor (Neural-network Process Units, NPU) and an image signal processor (Image Signal Processing, ISP). The processor may also include necessary hardware accelerators or logic processing hardware circuits, such as ASICs, or one or more integrated circuits for controlling the execution of the program of the technical solution of the present application. In addition, the processor may have the function of operating one or more software programs, and the software programs may be stored in a storage medium.

[0236] Specifically, in one embodiment of the present application, the memory of the electronic device may be a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage devices, or may be any computer-readable medium that can be used to carry or store desired program codes in the form of instructions or data structures and can be accessed by a computer.

[0237] Specifically, in an embodiment of the present application, the processor and the memory can be combined into a processing device, more commonly, they are independent components, and the processor is used to execute the program code stored in the memory to implement the method described in the embodiment of the present application. In specific implementation, the memory can also be integrated into the processor, or independent of the processor.

[0238] Furthermore, the devices, apparatuses, and modules described in the embodiments of the present application may be implemented by computer chips or entities, or by products having certain functions.

[0239] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.

[0240] In the several embodiments provided in the present application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.

[0241] Specifically, in one embodiment of the present application, a computer-readable storage medium is further provided, in which a computer program is stored. When the computer program is run on a computer, the computer executes the method provided in the embodiment of the present application.

[0242] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is run on a computer, the computer executes the method provided by the embodiment of the present application.

[0243] The embodiments described in this application are described with reference to the flowcharts and / or block diagrams of the methods, devices (apparatus), and computer program products according to the embodiments of the application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0244] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0245] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0246] It should also be noted that in the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.

[0247] In the embodiments of the present application, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, method, commodity or device including the element.

[0248] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0249] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0250] Those skilled in the art will appreciate that the various units and algorithm steps described in the embodiments of the present application can be implemented by a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0251] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, apparatuses and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0252] The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.

Claims

1. The initial master problem construction method based on column generation is characterized by: The method comprises: Determine a state transition equation based on a problem model; wherein the problem model is constructed according to the problem to be solved in the application scenario; According to the state transfer equation, dynamic programming is performed to obtain a variable set corresponding to the initial main problem.

2. The method according to claim 1, characterized in that The problem model includes a linear programming model; Based on the problem model, determine the state transfer equation, including: Determine the right-hand side term of the constraint condition and the coefficient vector of each variable in the linear programming model, and use the right-hand side term as the state vector; A state transfer equation is constructed based on the state vector and the coefficient vector.

3. The method according to claim 1 or 2, characterized in that According to the state transfer equation, dynamic programming is performed, including: According to the state transfer equation, the dynamic programming is performed using a depth-first search.

4. The method according to claim 3, characterized in that The dynamic programming is performed using a depth-first search, including executing the following process based on a depth-first search module: Inputting a first value of the state vector, a first set and a global infeasible state set; wherein the first set is a set of coefficient vectors; the global infeasible state set is used to record the value of the state vector that does not have a feasible solution; Determine a first value of the state vector, and if it belongs to the global infeasible state set, return an empty set; Determine a first value of the state vector, and if it does not belong to the global infeasible state set, prune the first set to remove infeasible coefficient vectors, and the remaining coefficient vectors form a second set; Traversing each coefficient vector in the second set, performing state transfer in sequence, and obtaining a second value of the state vector; When the second value is equal to 0, a first result is returned; the first result is equal to the variable corresponding to the coefficient variable involved in the state transfer; When the second value is not 0, recursively calling the depth-first search module with the second value of the state vector, the second set and the global infeasible state set as input; If the second result obtained by the depth-first search module is not empty, a third result is returned; the third result is equal to the union of the second result and the first result; When the second result obtained by the depth-first search module is empty, the second value is added to the global infeasible state set.

5. The method according to claim 4, characterized in that Execute state transfer in sequence, including: Subtraction operations are performed on the first value of the state vector and the p-th coefficient vector respectively; wherein 1≤p≤N, and N is the total number of coefficient vectors in the second set.

6. The method according to claim 4, characterized in that After the second result obtained by the depth-first search module is empty, the method further includes: In the third set, the p-th coefficient vector is recorded, which has no feasible solution for the second value.

7. The method according to claim 4, characterized in that Pruning the first set to remove infeasible coefficient vectors includes: Query the parent state corresponding to the first value of the state vector; Querying coefficient vectors that do not have feasible solutions for the parent state and determining them as to be pruned; In the first set, the coefficient vectors determined to be to be pruned are deleted.

8. The method according to claim 7, characterized in that Querying the parent state corresponding to the first value of the state vector includes: The first value of the state vector is denoted as b2; The second value of the state vector recorded in the third set is denoted as b1; When the values ​​of the elements in b1 are all greater than the values ​​of the elements at the corresponding positions in b2, b1 is determined to be the parent state of b2, and b2 is determined to be the child state of b1.

9. The method according to any one of claims 1-2, 4-8, characterized in that: After obtaining the variable set corresponding to the initial main problem, the method further includes: Determine a characteristic matrix corresponding to the initial main problem; the characteristic matrix includes characteristic vectors of multiple variables in the variable set corresponding to the initial main problem; The feature matrix is ​​input into a neural network, through which non-basic variables added to the restricted main problem are predicted.

10. The method according to claim 9, characterized in that The neural network includes an encoding module and a decoding module, and the decoding module includes an LSTM network and a pointer attention module; The feature matrix is ​​input into a neural network, and the non-basic variables added to the restricted main problem are predicted end-to-end through the neural network, including performing multiple rounds of encoding and decoding processes; wherein one round of encoding and decoding process includes: Inputting the feature matrix corresponding to the current restricted main problem into the encoding module, encoding it through the encoding module, and outputting a first vector with a predetermined dimension; Input the first vector into the LSTM network in the decoding module, and output a hidden state vector; Through the pointer attention module, the probability of each non-basic variable entering the basis in this round is predicted at least according to the feature vector corresponding to each variable and the hidden state vector; based on the probability, a non-basic variable is determined and added to the variable set corresponding to the current restricted main problem.

11. The method according to claim 10, characterized in that The encoding module is used to encode and output a first vector having a predetermined dimension, including: Using a trainable vector with a predetermined dimension to perform a dot multiplication operation with the feature matrix to obtain a scalar score; Perform softmax on the scalar scores to obtain the weights corresponding to the variables; According to the weights, a weighted sum is performed on a plurality of feature vectors in the input feature matrix to obtain a first vector with a predetermined dimension.

12. The method according to claim 10, characterized in that Before executing multiple rounds of encoding and decoding processes, the method further includes: In a non-basic variable set, a dummy variable representing a stop sign is added; the non-basic variable set includes a plurality of non-basic variables; During the multiple rounds of encoding and decoding, the method further includes: According to the probability predicted by the pointer attention module, when the variable determined to be the virtual variable is determined, the prediction is stopped and the variable selection is completed.

13. A restricted master problem prediction method based on column generation, characterized in that: After determining the initial main problem, the method includes: Determine a characteristic matrix corresponding to the initial main problem; the characteristic matrix includes characteristic vectors of multiple variables in the variable set corresponding to the initial main problem; The feature matrix is ​​input into a neural network, through which non-basic variables added to the restricted main problem are predicted.

14. The method according to claim 13, characterized in that The neural network includes an encoding module and a decoding module, and the decoding module includes an LSTM network and a pointer attention module; The feature matrix is ​​input into a neural network, and the non-basic variables added to the restricted main problem are predicted through the neural network, including performing at least one encoding and decoding process; wherein one encoding and decoding process includes: Inputting the feature matrix corresponding to the current restricted main problem into the encoding module, encoding it through the encoding module, and outputting a first vector with a predetermined dimension; Input the first vector into the LSTM network in the decoding module, and output a hidden state vector; Through the pointer attention module, the probability of each non-basic variable entering the basis in this round is predicted at least according to the feature vector corresponding to each variable and the hidden state vector; based on the probability, a non-basic variable is determined and added to the variable set corresponding to the current restricted main problem.

15. The method according to claim 14, characterized in that The encoding module is used to encode and output a first vector having a predetermined dimension, including: Using a trainable vector with a predetermined dimension to perform a dot multiplication operation with the feature matrix to obtain a scalar score; Perform softmax on the scalar scores to obtain the weights corresponding to the variables; According to the weights, a weighted sum is performed on a plurality of feature vectors in the input feature matrix to obtain a first vector with a predetermined dimension.

16. The method according to claim 14, characterized in that Before executing multiple rounds of encoding and decoding processes, the method further includes: In a non-basic variable set, a dummy variable representing a stop sign is added; the non-basic variable set includes a plurality of non-basic variables; During the multiple rounds of encoding and decoding, the method further includes: According to the probability predicted by the pointer attention module, when the variable determined to be the virtual variable is determined, the prediction is stopped and the variable selection is completed.

17. An electronic device, characterized in that: The electronic device comprises: One or more processors; a memory; at least one application; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions that, when executed by the electronic device, cause the electronic device to perform a method as described in any one of claims 1-16.

18. A storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 16.

19. A chip system, characterized in that: include: A communication interface for inputting and / or outputting data; A processor, configured to execute a computer executable program so that a device equipped with the chip system executes a method as described in any one of claims 1 to 16.