A method and system for solving linear programming problems
Through the construction of linear programming problem calculation model and augmented matrix based on Kuhntucker conditions, the problem of low resolution efficiency of linear programming problem and difficulty in quickly obtaining optimal solutions in the prior art is solved, and fast and efficient optimal solution calculation is achieved.
Patent Information
- Application Number
- CN202210947671.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-09
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2042-08-09
AI Technical Summary
The existing linear programming problem solving methods have problems such as large calculations, difficult to eliminate cycles, and difficult to quickly obtain optimal solutions. In particular, the rules and low efficiency of selecting base variables in simplex methods are diverse.
The linear programming problem calculation model based on Kuhntucker condition is used to construct an augmented matrix, and the optimal solution to the linear programming problem is quickly obtained through a series of judgment and update steps.
It quickly obtains the optimal solution to linear programming problems, reduces calculation time, improves the solution quality, and is suitable for dealing with large-scale linear programming problems.
Smart Images

Figure CN115795244B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of linear programming problem computing technology, and in particular to a linear programming problem solving method and system. Background Art
[0002] Linear programming is an important branch of operations research that has been studied earlier and has more mature methods. It is widely used in military operations, economic analysis, and business management. The main methods for solving linear programming problems include the simplex method, the dual simplex method, the primal dual method, the interior point method, etc. These methods are mainly based on the standard form of linear programming problems. The standard form of linear programming problems is actually the result of adding slack variables and artificial variables to the inequality constraints. This approach increases the number of variables, resulting in increased calculations and difficulty in eliminating loops.
[0003] All methods for solving linear programming problems have certain limitations. The interior point method is not suitable for dealing with equality constraints. The traditional simplex method is not efficient in solving practical problems by using heuristic methods to select basis variables. When used to solve linear programming problems, the solution that may be obtained is only an approximate solution, and the optimal solution cannot be obtained. The fundamental reason is that the optimal solution to a linear programming problem corresponds to a vertex in the feasible domain. The solution process is actually an iterative search for different vertices on the feasible domain of the linear programming problem. The number of vertices in the feasible domain shows a geometric growth trend as the scale of the problem increases. This is the fundamental reason why linear programming problems are difficult to solve. The current solution methods have certain defects, especially the simplex method has many rules for selecting basis variables, which leads to a long solution time and difficulty in finding the optimal solution. Therefore, a calculation method that can quickly obtain the optimal solution is needed. Summary of the invention
[0004] The purpose of the present invention is to provide a method and system for solving linear programming problems, which can quickly obtain the optimal solution.
[0005] To achieve the above object, the present invention provides the following solutions:
[0006] A method for solving a linear programming problem, comprising:
[0007] Step 101: constructing a linear programming problem calculation model based on Kuhn-Tucker conditions according to the linear programming problem to be solved;
[0008] Step 102: constructing an augmented matrix according to the linear programming problem calculation model; the augmented matrix is a matrix with n+1 rows and m+1 columns;
[0009] Step 103: Determine whether there are positive values in the first m elements of the (n+1)th row of the augmented matrix, and obtain a first determination result;
[0010] Step 104: If the first judgment result is yes, all positive elements in the first m elements of the (n+1)th row of the augmented matrix are determined as a positive number matrix, where the positive number matrix is a matrix with 1 row and s columns;
[0011] Step 105: updating the augmented matrix according to all elements of the target row in the target matrix and the positive matrix, and returning to step 103; the target matrix is composed of the elements of the first n rows of all positive columns of the augmented matrix; the positive columns are the columns where all positive elements in the first m elements of the n+1th row of the augmented matrix are located; the target row is the row with the largest number of positive elements in the target matrix;
[0012] Step 106: If the first judgment result is no, determining the opposite numbers of the first n elements of the n+1th row of the augmented matrix as a feasible solution, and determining the opposite number of the element located in the n+1th row and the m+1th column of the augmented matrix as the objective function value;
[0013] Step 107: Determine whether all elements in the first n rows of the m+1th column in the augmented matrix are greater than or equal to 0, and obtain a second determination result;
[0014] Step 108: If the second judgment result is yes, determine that the opposite numbers of the first n elements in the n+1th row of the augmented matrix are the optimal solution to the linear programming problem to be solved, and determine that the opposite number of the element located in the n+1th row and the m+1th column of the augmented matrix is the optimal objective function value;
[0015] Step 109: If the second judgment result is no, calculate the second row number and the second column number according to the augmented matrix, update the augmented matrix according to the second row number and the second column number, and return to step 107.
[0016] Optionally, before step 105, the step further includes: if all elements in at least one column of the target matrix are non-positive and not all zero, the linear programming problem to be solved has no solution.
[0017] Optionally, step 105 specifically includes:
[0018] Step 501: Determine the first row number and the first column number according to all elements of the target row in the positive matrix and the target matrix;
[0019] Step 502: Update the augmented matrix according to the first row number and the first column number, and return to step 103.
[0020] Optionally, step 109 specifically includes:
[0021] Step 901: Determine whether the second row number and the second column number have a solution, and obtain a third determination result;
[0022] Step 902: If the third judgment result is no, then the linear programming problem to be solved has no optimal solution;
[0023] Step 903 : If the third judgment result is yes, then update the augmented matrix according to the second row number and the second column number, and return to step 107 .
[0024] Optionally, the step 501 specifically includes:
[0025] Determine the first row number according to all elements of the target row in the positive number matrix and the target matrix;
[0026] The first column number is determined according to all elements of the row corresponding to the first row number in the positive number matrix and the target matrix.
[0027] A linear programming problem solving system, comprising:
[0028] A linear programming problem computational model building module is used to build a linear programming problem computational model based on Kuhn-Tucker conditions according to the linear programming problem to be solved;
[0029] An augmented matrix construction module, used to construct an augmented matrix according to the linear programming problem calculation model; the augmented matrix is a matrix with n+1 rows and m+1 columns;
[0030] A first judgment module is used to judge whether there are positive values in the first m elements of the (n+1)th row of the augmented matrix, and obtain a first judgment result;
[0031] A positive matrix determination module, configured to determine, if the first judgment result is yes, all positive elements in the first m elements of the (n+1)th row of the augmented matrix as a positive matrix, wherein the positive matrix is a matrix with 1 row and s columns;
[0032] A first updating module is used to update the augmented matrix according to all elements of the target row in the target matrix and the positive number matrix, and return to the first judgment module; the target matrix is composed of the elements of the first n rows of all positive number columns of the augmented matrix; the positive number column is the column where all positive elements in the first m elements of the n+1th row of the augmented matrix are located; the target row is the row with the largest number of positive elements in the target matrix;
[0033] A result calculation module, configured to determine, if the first judgment result is no, that the opposite numbers of the first n elements of the n+1th row of the augmented matrix are feasible solutions, and determine that the opposite number of the element located in the n+1th row and the m+1th column of the augmented matrix is the objective function value;
[0034] A second judgment module is used to judge whether all elements of the first n rows in the m+1th column in the augmented matrix are greater than or equal to 0, and obtain a second judgment result;
[0035] an optimal result determination module, for determining, if the second judgment result is yes, that the opposite numbers of the first n elements of the n+1th row of the augmented matrix are the optimal solution to the linear programming problem to be solved, and determining that the opposite number of the element located in the n+1th row and the m+1th column of the augmented matrix is the optimal objective function value;
[0036] A second updating module is configured to calculate a second row number and a second column number according to the augmented matrix if the second judgment result is no, update the augmented matrix according to the second row number and the second column number, and return to the second judgment module.
[0037] Optionally, the linear programming problem solving system further includes: a no-solution module, which is used to determine that the linear programming problem to be solved has no solution if all elements in one column of the target matrix are non-positive and not all zero.
[0038] Optionally, the first updating module specifically includes:
[0039] A first row number and a first column number determining unit, used for determining a first row number and a first column number according to all elements of a target row in the positive number matrix and a target matrix;
[0040] A first updating unit is used to update the augmented matrix according to the first row number and the first column number, and return to the first judgment module.
[0041] Optionally, the second updating module specifically includes:
[0042] A judging unit, configured to judge whether there is a solution for the second row number and the second column number, and obtain a third judging result;
[0043] A no optimal solution unit, used for determining that if the third judgment result is no, the linear programming problem to be solved has no optimal solution;
[0044] The second updating unit is configured to update the augmented matrix according to the second row number and the second column number if the third judgment result is yes, and return to the second judgment module.
[0045] Optionally, the first row number and first column number determining unit specifically includes:
[0046] A first row number determination subunit, used to determine the first row number according to all elements of the target row in the positive number matrix and the target matrix;
[0047] The first column number determination subunit is used to determine the first column number according to all elements of the row corresponding to the first row number in the positive number matrix and the target matrix.
[0048] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects: the present invention constructs a linear programming problem calculation model based on the Kuhn-Tucker conditions according to the linear programming problem to be solved, constructs an augmented matrix according to the linear programming problem calculation model, calculates the optimal solution and the optimal objective function value according to the augmented matrix, and can quickly obtain the optimal solution. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0050] Figure 1 A flowchart of a method for solving a linear programming problem provided by an embodiment of the present invention;
[0051] Figure 2 A flowchart of calculating a feasible solution to a linear programming problem provided by an embodiment of the present invention;
[0052] Figure 3 A flowchart for calculating the optimal solution to a linear programming problem provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0055] The purpose of the present invention is to provide a fast calculation method for linear programming problems, so that the calculation time required to obtain the optimal solution is short and the solution quality is high.
[0056] The inventive concept of the present invention is: in view of the current situation that the amount of calculation of linear programming problems is large, for a given linear programming problem, the dimension is reduced by using known equality constraints, and the Kuhn-Tucker conditions satisfied by the optimal solution of the linear programming problem under inequality constraints and the inequality constraints of the original problem are used, starting from any solution of the linear programming problem, elementary transformations are used to obtain the optimal solution of the linear programming problem, and the general steps are: firstly, a linear programming problem calculation model based on the Kuhn-Tucker conditions is established; secondly, a heuristic method for quickly solving feasible solutions of the linear programming problem is established; finally, a heuristic method for quickly calculating the optimal solution of the linear programming problem within the feasible solution range is established; such as Figure 1 As shown, the specific steps include:
[0057] Step 101: construct a linear programming problem calculation model based on Kuhn-Tucker conditions according to the linear programming problem to be solved.
[0058] Step 102: construct an augmented matrix according to the linear programming problem calculation model; the augmented matrix is a matrix with n+1 rows and m+1 columns.
[0059] Step 103: Determine whether there are positive values in the first m elements of the (n+1)th row of the augmented matrix, and obtain a first determination result.
[0060] Step 104: If the first judgment result is yes, all positive elements in the first m elements of the (n+1)th row of the augmented matrix are determined as a positive number matrix, where the positive number matrix is a matrix with 1 row and s columns.
[0061] Step 105: Update the augmented matrix according to all elements of the target row in the target matrix and the positive matrix, and return to step 103; the target matrix is composed of the elements of the first n rows of all positive columns of the augmented matrix; the positive columns are the columns where all positive elements in the first m elements of the n+1th row of the augmented matrix are located; the target row is the row with the largest number of positive elements in the target matrix.
[0062] Step 106: If the first judgment result is no, determine that the opposite numbers of the first n elements of the augmented matrix in the n+1th row are feasible solutions, and determine that the opposite number of the element located in the n+1th row and the m+1th column of the augmented matrix is the objective function value.
[0063] Step 107: Determine whether all elements in the first n rows of the m+1th column in the augmented matrix are greater than or equal to 0, and obtain a second determination result.
[0064] Step 108: If the second judgment result is yes, determine that the opposite numbers of the first n elements in the n+1th row of the augmented matrix are the optimal solution to the linear programming problem to be solved, and determine that the opposite number of the element located in the n+1th row and the m+1th column of the augmented matrix is the optimal objective function value.
[0065] Step 109: If the second judgment result is no, calculate the second row number and the second column number according to the augmented matrix, update the augmented matrix according to the second row number and the second column number, and return to step 107.
[0066] In practical applications, before step 105, the following step is also included: if all elements in at least one column of the target matrix are non-positive and not all zero, then the linear programming problem to be solved has no solution.
[0067] In practical applications, step 105 specifically includes:
[0068] Step 501: Determine the first row number and the first column number according to all elements of the target row in the positive matrix and the target matrix (specifically, calculate according to Formula 19 and Formula 20).
[0069] Step 502: Update the augmented matrix according to the first row number and the first column number (specifically, calculate according to formulas 21 and 22), and return to step 103.
[0070] In practical applications, step 109 specifically includes:
[0071] Step 901: Determine whether there is a solution for the second row number and the second column number, and obtain a third determination result (there is a solution when Formula 26 is satisfied).
[0072] Step 902: If the third judgment result is no, then the linear programming problem to be solved has no optimal solution.
[0073] Step 903: If the third judgment result is yes, the augmented matrix is updated according to the second row number and the second column number (updated according to formula 27), and the process returns to step 107.
[0074] In practical applications, step 501 specifically includes:
[0075] The first row number is determined according to all elements of the target row in the positive number matrix and the target matrix.
[0076] The first column number is determined according to all elements of the row corresponding to the first row number in the positive number matrix and the target matrix.
[0077] In practical applications, step 101 is specifically as follows:
[0078] Step 1.1: Input the consumption coefficient matrix A of the linear programming problem m-n,n , cost coefficient vector c, resource constraint vector b, the mathematical model of the linear programming problem is:
[0079] minz=c T x Formula 1
[0080] st
[0081] Ax≥b Formula 2
[0082] x≥0 Formula 3
[0083] Where n is the number of decision variables, and m is the number of inequality constraints including decision variables greater than or equal to 0. For equality constraints, equality constraint dimensionality reduction can be used to retain only inequality constraints.
[0084] Step 1.2: Set the augmented matrix
[0085]
[0086] The subscripts n+1 and m+1 represent the number of rows and columns of the matrix U, respectively. The linear programming problem calculation model based on the Kuhn-Tucker condition is a constraint satisfaction problem:
[0087] <X,D,C> Formula 5
[0088] Where X is the set of variables, D is the domain of the variables, and C is the set of constraints, that is,
[0089] X={L n+1,n+1 =(l ij ),G n+1,m+1 =(g ij )} Formula 6
[0090] D={L∈R (n+1)×(n+1) ,G=LU∈R (n+1)×(m+1)} Formula 7
[0091] C={|L|≠0,g i,m+1 >0,g n+1,j ≤0,i=1,…,n,j=1,…,m} Formula 8
[0092] L n+1,n+1 Indicated by l ij The matrix composed of variables l ij represents the element in the i-th row and j-th column of the elementary transformation matrix L, G n+1,m+1 Indicated by g ij The matrix composed of ijrepresents the result of multiplying the i-th row of the elementary transformation matrix L by the j-th column of the augmented matrix U, where L represents the unknown elementary transformation matrix, and R m×n Represents m×n dimensional real space.
[0093] The present invention also provides a specific embodiment of applying the above method to the field of machine maintenance. The present invention is further described below with reference to examples:
[0094] The linear programming problem to be solved is a machine maintenance problem: five resources can be used to complete the maintenance task, and the jth resource usage is x j , the unit resource cost is (c j )=(161, 1065, 945, 122, 873, 0, 0). The configuration scheme completed by these five maintenance resources needs to meet the following constraints:
[0095] 7x 1 +48x 2 +43x 3 +5x 4 +39x 5 ≥731
[0096] 45x 1 -35x 2 +20x 3 -35x 4 +39x 5 ≤359
[0097] -43x 1 -28x 2 +21x 3 +16x 4 -48x 5 ≤360
[0098] x 1 +x 6 +2x 7 =30
[0099] x 2 +2x 6 +3x 7 =50
[0100] x≥0
[0101] Determine the lowest-cost resource allocation plan.
[0102] According to the linear programming problem to be solved, the linear programming model of maintenance resource allocation can be established according to the unit cost information of given resources and the constraints satisfied by the resources required to complete the task.
[0103] Step 1: Establish a computational model for linear programming problems based on Kuhn-Tucker conditions.
[0104] Step 1.1: Input the consumption coefficient matrix A of the linear programming problem m-n,n , cost coefficient vector c, resource constraint vector b, the mathematical model of the linear programming problem is:
[0105] minz=161x 1 +1065x 2 +945x 3 +122x 4 +873x 5 Formula 9
[0106] st
[0107]
[0108] x≥0 Formula 11
[0109] For equality constraints, we can use equality constraints to reduce the dimension and only keep inequality constraints.
[0110] Step 1.2: Let the augmented matrix U be
[0111]
[0112] The computational model of linear programming problems based on Kuhn-Tucker conditions is a constraint satisfaction problem.
[0113] <X,D,C> Formula 13
[0114] in
[0115] X={L n+1,n+1 =(l ij ),G n+1,m+1 =(g ij )} Formula 14
[0116] D={L∈R (n+1)×(n+1) ,G=LU∈R (n+1)×(m+1)} Formula 15
[0117] C={|L|≠0,g i,m+1 >0,g n+1,j ≤0,i=1,…,n,j=1,…,m} Formula 16
[0118] Step 2: If Figure 2 As shown, the feasible solution of the computational linear programming problem specifically includes:
[0119] Step 2.1: Let the number of iterations h = 0, the augmented matrix at the hth iteration is
[0120] Step 2.2: If the element of the n+1th row of the augmented matrix at the hth iteration There are positive numbers in (j=1,2,…,m), which are denoted as (j=1,2,…,s); if there is no positive number, output a feasible solution And its objective function value Go to step 3.
[0121] Step 2.3: If it exists For any i, If i=1,2,…,n, then the linear programming problem has no solution and the calculation is exited.
[0122] Step 2.4: Determine the number of positive elements in each row of the target matrix
[0123]
[0124] where s i Indicates the number of positive elements in the i-th row.
[0125] Step 2.5: Calculate the maximum value:
[0126] t=maxs i ,I t ={i|s i =t} Formula 18
[0127] Step 2.6: Determine the first row number i 1 :
[0128]
[0129] Step 2.7: Determine the first column number j 1 :
[0130]
[0131] Step 2.8: Update the augmented matrix to obtain the augmented matrix for the next iteration:
[0132]
[0133]
[0134] Step 2.9: h←h+1, return to step 2.2.
[0135] Follow step 2 and select (i 1 ,j 1 ) is a feasible solution for (4,8) and (1,6), U (h) (h=1,2) is as follows:
[0136]
[0137]
[0138] Step 3: If Figure 3 As shown, calculating the optimal solution of the linear programming problem specifically includes:
[0139] Step 3.1: According to step 2, get the solution of the constraint satisfaction problem corresponding to the linear programming problem, the number of iterations h, and the augmented matrix under the hth iteration number If there is no solution in step 2, then the linear programming problem has no solution and the calculation is exited; otherwise, execute step 3.2.
[0140] Step 3.2: If
[0141]
[0142] Go to step 3.6, otherwise go to step 3.3.
[0143] Step 3.3: If there is i 2 ,j 2 ,satisfy
[0144]
[0145] Then execute step 3.4; otherwise, the problem has no optimal solution and the calculation is exited.
[0146] Step 3.4: Update the augmented matrix to obtain the augmented matrix for the next iteration:
[0147]
[0148]
[0149] Step 3.5: h←h+1, return to step 3.2.
[0150] Step 3.6: The optimal objective function value is The optimal solution is
[0151]
[0152] Output the result and exit the calculation.
[0153] Follow step 3 and select (i 2 ,j 2 ) is the optimal solution for (3,1) and (4,4), U (h) (h=3,4) is as follows:
[0154]
[0155]
[0156]
[0157] Optimal solution (0,0,17,0,0,10,10) T , the optimal target value is 16065. Therefore, the optimal resource allocation scheme is to allocate 17 units of the third resource and not allocate the other four resources, and the minimum cost is 16065 units.
[0158] It can be seen from the process of this embodiment that after five elementary transformations, the optimal solution to the resource allocation problem is obtained. In the above example, if the simplex method is used, three artificial variables and three slack variables need to be added. For the maximization linear programming problem, inequality constraints generally require the addition of slack variables, and equality constraints require the addition of artificial variables. In the present invention, by eliminating some variables using equality constraints, the number of decision variables can be further reduced and the calculation speed can be improved.
[0159] In view of the above method, an embodiment of the present invention provides a linear programming problem solving system, including:
[0160] The linear programming problem computational model construction module is used to construct a linear programming problem computational model based on the Kuhn-Tucker condition according to the linear programming problem to be solved.
[0161] The augmented matrix construction module is used to construct an augmented matrix according to the linear programming problem calculation model; the augmented matrix is a matrix with n+1 rows and m+1 columns.
[0162] The first judgment module is used to judge whether there are positive values in the first m elements of the (n+1)th row of the augmented matrix, and obtain a first judgment result.
[0163] A positive matrix determination module is used to determine all positive elements in the first m elements of the (n+1)th row of the augmented matrix as a positive matrix if the first judgment result is yes, and the positive matrix is a matrix with 1 row and s columns.
[0164] The first updating module is used to update the augmented matrix according to all elements of the target row in the target matrix and the positive number matrix, and return to the first judgment module; the target matrix is composed of the elements of the first n rows of all positive number columns of the augmented matrix; the positive number columns are the columns where all positive elements in the first m elements of the n+1th row of the augmented matrix are located; the target row is the row with the largest number of positive elements in the target matrix.
[0165] A result calculation module is used to determine that the opposite numbers of the first n elements in the n+1th row of the augmented matrix are feasible solutions if the first judgment result is no, and to determine the opposite number of the element located in the n+1th row and the m+1th column of the augmented matrix as the objective function value.
[0166] The second judgment module is used to judge whether all elements of the first n rows in the m+1th column in the augmented matrix are greater than or equal to 0, and obtain a second judgment result.
[0167] The optimal result determination module is used to determine that the opposite numbers of the first n elements in the n+1th row of the augmented matrix are the optimal solution to the linear programming problem to be solved, and to determine that the opposite number of the element located in the n+1th row and the m+1th column of the augmented matrix is the optimal objective function value if the second judgment result is yes.
[0168] A second updating module is configured to calculate a second row number and a second column number according to the augmented matrix if the second judgment result is no, update the augmented matrix according to the second row number and the second column number, and return to the second judgment module.
[0169] As an optional implementation, the linear programming problem solving system further includes: a no-solution module, which is used to determine that if all elements in a column of the target matrix are non-positive and not all zero, the linear programming problem to be solved has no solution.
[0170] As an optional implementation manner, the first updating module specifically includes:
[0171] The first row number and first column number determining unit is used to determine the first row number and the first column number according to all elements of the target row in the positive number matrix and the target matrix.
[0172] A first updating unit is used to update the augmented matrix according to the first row number and the first column number, and return to the first judgment module.
[0173] As an optional implementation manner, the second updating module specifically includes:
[0174] The judging unit is used to judge whether the second row number and the second column number have a solution, and obtain a third judgment result.
[0175] The no optimal solution unit is used to determine that if the third judgment result is no, the linear programming problem to be solved has no optimal solution.
[0176] The second updating unit is configured to update the augmented matrix according to the second row number and the second column number if the third judgment result is yes, and return to the second judgment module.
[0177] As an optional implementation manner, the first row number and the first column number determining unit specifically includes:
[0178] The first row number determination subunit is used to determine the first row number according to all elements of the target row in the positive number matrix and the target matrix.
[0179] The first column number determination subunit is used to determine the first column number according to all elements of the row corresponding to the first row number in the positive number matrix and the target matrix.
[0180] The present invention has the following technical effects:
[0181] The invention realizes fast calculation of linear programming problems and can solve linear programming problems with more than 10000 decision variables. The invention designs a feasible solution calculation method for linear programming problems based on the typical characteristics of feasible solutions and solves the problem that the linear programming problem solving method depends on the initial feasible solution.
[0182] The solving process does not depend on the initial solution. Unlike most linear programming problem solving methods, the linear programming problem solving method of the present invention can start searching from the infeasible solution of the linear programming problem.
[0183] The solution process is highly integrated and can simultaneously obtain the optimal solution of the linear programming problem and its dual linear programming problem. During the solution process, elementary row transformations are performed on the constructed matrix, and the optimal solution of the linear programming problem and its dual linear programming problem is obtained at the same time.
[0184] It uses fewer variables and less storage, and does not require the use of artificial variables or slack variables, making it particularly suitable for use under conditions where computing resources are limited. When implementing elementary transformations, it is not necessary to retain the elementary transformation matrix, and a sparse matrix is used to record data, requiring at most (m-n+2)×(n+1) data in the matrix to be saved.
[0185] Can handle equality constraints. For equality constraints, equality dimensionality reduction can be used to keep only inequality constraints.
[0186] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0187] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A method for solving linear programming problems, It is characterized in that include: Step 101: constructing a linear programming problem calculation model based on Kuhn-Tucker conditions according to the linear programming problem to be solved; The linear programming problem to be solved is a machine maintenance problem, using resources to complete the maintenance task; Specifically: Input the consumption coefficient matrix A of the linear programming problem m-n,n , cost coefficient vector c, resource constraint vector b, the mathematical model of the linear programming problem is: minz=c T x stAx≥b,x≥0 Where n is the number of decision variables, and m is the number of inequality constraints including decision variables greater than or equal to 0; Step 102: constructing an augmented matrix according to the linear programming problem calculation model; the augmented matrix is a matrix with n+1 rows and m+1 columns; Step 103: Determine whether there are positive values in the first m elements of the (n+1)th row of the augmented matrix, and obtain a first determination result; Step 104: If the first judgment result is yes, all positive elements in the first m elements of the (n+1)th row of the augmented matrix are determined as a positive number matrix, where the positive number matrix is a matrix with 1 row and s columns; Step 105: updating the augmented matrix according to all elements of the target row in the target matrix and the positive matrix, and returning to step 103; the target matrix is composed of the elements of the first n rows of all positive columns of the augmented matrix; the positive columns are the columns where all positive elements in the first m elements of the n+1th row of the augmented matrix are located; the target row is the row with the largest number of positive elements in the target matrix; Step 106: If the first judgment result is no, determining the opposite numbers of the first n elements of the n+1th row of the augmented matrix as a feasible solution, and determining the opposite number of the element located in the n+1th row and the m+1th column of the augmented matrix as the objective function value; Step 107: Determine whether all elements in the first n rows of the m+1th column in the augmented matrix are greater than or equal to 0, and obtain a second determination result; Step 108: If the second judgment result is yes, determine that the opposite numbers of the first n elements in the n+1th row of the augmented matrix are the optimal solution to the linear programming problem to be solved, and determine that the opposite number of the element located in the n+1th row and the m+1th column of the augmented matrix is the optimal objective function value; Step 109: If the second judgment result is no, calculate the second row number and the second column number according to the augmented matrix, update the augmented matrix according to the second row number and the second column number, and return to step 107.
2. A method for solving a linear programming problem according to claim 1, It is characterized in that Before step 105, the method further includes: if all elements in at least one column of the target matrix are non-positive and not all zero, the linear programming problem to be solved has no solution.
3. A method for solving a linear programming problem according to claim 1, It is characterized in that The step 105 specifically includes: Step 501: Determine the first row number and the first column number according to all elements of the target row in the positive matrix and the target matrix; Step 502: Update the augmented matrix according to the first row number and the first column number, and return to step 103.
4. A method for solving a linear programming problem according to claim 1, It is characterized in that The step 109 specifically includes: Step 901: Determine whether the second row number and the second column number have a solution, and obtain a third determination result; Step 902: If the third judgment result is no, then the linear programming problem to be solved has no optimal solution; Step 903 : If the third judgment result is yes, then update the augmented matrix according to the second row number and the second column number, and return to step 107 .
5. A method for solving a linear programming problem according to claim 3, It is characterized in that The step 501 specifically includes: Determine the first row number according to all elements of the target row in the positive number matrix and the target matrix; The first column number is determined according to all elements of the row corresponding to the first row number in the positive number matrix and the target matrix.
6. A linear programming problem solving system, It is characterized in that include: The linear programming problem calculation model construction module is used to construct a linear programming problem calculation model based on the Kuhn-Tucker condition according to the linear programming problem to be solved; specifically: input the consumption coefficient matrix A of the linear programming problem m-n,n , cost coefficient vector c, resource constraint vector b, the mathematical model of the linear programming problem is: minz=c T x stAx≥b,x≥0 Where n is the number of decision variables, m is the number of inequality constraints including decision variables greater than or equal to 0; the linear programming problem to be solved is a machine maintenance problem, using resources to complete the maintenance task; An augmented matrix construction module, used to construct an augmented matrix according to the linear programming problem calculation model; the augmented matrix is a matrix with n+1 rows and m+1 columns; A first judgment module is used to judge whether there are positive values in the first m elements of the (n+1)th row of the augmented matrix, and obtain a first judgment result; A positive matrix determination module, configured to determine, if the first judgment result is yes, all positive elements in the first m elements of the (n+1)th row of the augmented matrix as a positive matrix, wherein the positive matrix is a matrix of 1 row and s columns; A first updating module is used to update the augmented matrix according to all elements of the target row in the target matrix and the positive number matrix, and return to the first judgment module; the target matrix is composed of the elements of the first n rows of all positive number columns of the augmented matrix; the positive number column is the column where all positive elements in the first m elements of the n+1th row of the augmented matrix are located; the target row is the row with the largest number of positive elements in the target matrix; A result calculation module, configured to determine, if the first judgment result is no, that the opposite numbers of the first n elements of the n+1th row of the augmented matrix are feasible solutions, and determine that the opposite number of the element located in the n+1th row and the m+1th column of the augmented matrix is the objective function value; A second judgment module is used to judge whether all elements of the first n rows in the m+1th column in the augmented matrix are greater than or equal to 0, and obtain a second judgment result; an optimal result determination module, for determining, if the second judgment result is yes, that the opposite numbers of the first n elements of the n+1th row of the augmented matrix are the optimal solution to the linear programming problem to be solved, and determining that the opposite number of the element located in the n+1th row and the m+1th column of the augmented matrix is the optimal objective function value; A second updating module is configured to calculate a second row number and a second column number according to the augmented matrix if the second judgment result is no, update the augmented matrix according to the second row number and the second column number, and return to the second judgment module.
7. A linear programming problem solving system according to claim 6, It is characterized in that Also includes: The no-solution module is used for determining that if all elements in one column of the target matrix are non-positive and not all zero, the linear programming problem to be solved has no solution.
8. A linear programming problem solving system according to claim 6, It is characterized in that The first update module specifically includes: A first row number and a first column number determining unit, used for determining a first row number and a first column number according to all elements of a target row in the positive number matrix and a target matrix; A first updating unit is used to update the augmented matrix according to the first row number and the first column number, and return to the first judgment module.
9. A linear programming problem solving system according to claim 6, It is characterized in that The second update module specifically includes: A judging unit, configured to judge whether there is a solution for the second row number and the second column number, and obtain a third judging result; A no optimal solution unit, used for determining that if the third judgment result is no, the linear programming problem to be solved has no optimal solution; The second updating unit is configured to update the augmented matrix according to the second row number and the second column number if the third judgment result is yes, and return to the second judgment module.
10. A linear programming problem solving system according to claim 8, It is characterized in that The first row number and first column number determining unit specifically includes: A first row number determination subunit, used to determine the first row number according to all elements of the target row in the positive number matrix and the target matrix; The first column number determination subunit is used to determine the first column number according to all elements of the row corresponding to the first row number in the positive number matrix and the target matrix.
Citation Information
Patent Citations
Method and device for calculating emergent beam intensity of radiotherapy
CN105363139A
Method for solving two-stage linear planning problem once
CN107463530A