Simplex Algorithm for Solving Linear Programming Problems
Solving Linear Programming Problems with the Simplex Algorithm
In 1947, George Dantzig introduced a method for solving linear programming problems, known today as the simplex method. This is a concise and efficient algorithm, hailed as one of the ten algorithms with the greatest impact on scientific development and engineering practice in the 20th century.
As mentioned earlier, the optimal solution to a linear programming problem is always a basic feasible solution. The idea of the simplex method is to find different basic feasible solutions under different basis vectors and then identify the optimal solution. Geometrically, this involves transitioning from one vertex to another until the optimal vertex is found.
Thus, the algorithm can be divided into three subproblems: 1. How to transition from one basic feasible solution to another. 2. How to determine which vertex to transition to. 3. When to stop transitioning, i.e., how to judge if the current basic feasible solution is optimal.
Transitioning Between Vertices
The standard form of a linear programming problem is:
Considering the equation , it can be expanded into the following canonical form:
This system of equations can be transformed into . This form of the equation is called the canonical form. The solutions of the canonical form and the original system are the same. In the canonical expression, the variables corresponding to the basis vectors are basic variables, and the others are non-basic variables. In the equation , are basic variables, while the others are non-basic variables. Considering the augmented matrix in canonical form , the elements in the last column are the coordinates of vector with respect to the basis {}.
Now consider updating the augmented matrix, i.e., replacing a basic variable with a non-basic variable to find a new canonical expression for the basic variables. For example, replace the basic variable with the non-basic variable . In the original matrix, can be expressed as:
Note that only when is the set {} linearly independent, forming a basis. From the above equation, we can solve for:
Using the original augmented matrix, any vector can be expressed as:
Substituting the expression for , we get:
Using to denote the elements in the new augmented matrix, we have:
The transformation of the matrix using the above formulas is called a pivot transformation with respect to the element . This is the formula for transitioning from one vertex to another.
Determining the Transition Vertex
Determining the transition vertex involves converting the set of vectors to another coordinate system. Specifically, it means removing one of the m vectors from the set and adding one of the n-m vectors to form a new basis. We denote this as removing vector (leaving the basis) and adding vector (entering the basis). This problem can be divided into two parts: determining and .
To determine , consider the pivot transformation formula:
Another method to turn a non-basic variable into a basis vector is to express vector using the current basis vectors:
Multiplying both sides of the above equation by gives:
Substituting the basic solution into the equation yields:
Combining the above two equations, we get:
The vector is a solution to the equation . As increases, the first m elements of the vector will eventually have a zero, resulting in a basic feasible solution. The objective function value corresponding to the transformed basic feasible solution is:
Where . Let , then . If , it indicates that the objective function value corresponding to the basic feasible solution has decreased, meaning that adding this vector to the basis is beneficial.
Therefore, for each , calculate . Let , where is the reduced cost coefficient or test number. It can be proven that a basic feasible solution is optimal if and only if all the corresponding test numbers are non-negative.
Thus, by calculating the test numbers, we can determine if the current solution is optimal. If there are negative test numbers, the current solution is not optimal, and the objective function value can be reduced by adding the -th vector to the basis. If there are multiple negative numbers, choose the vector with the smallest test number to add to the basis.
Having determined the method for choosing , let’s discuss how to determine the exiting basis vector . As mentioned earlier, for the vector , as increases, the first m elements will have an element that first equals zero. We choose as the exiting basis vector , i.e., . Note that if there is no , the problem has an unbounded solution, and the computation stops. If multiple zero elements appear simultaneously, a degenerate basic feasible solution is obtained, and the smallest value is chosen.
Determining the Stopping Condition
The method for choosing the transition vertex was introduced earlier. When determining , calculate the test numbers. If all test numbers are non-negative, the current basic feasible solution is optimal, and the computation stops. Additionally, when determining , if as increases, the first m elements of the vector also increase, i.e., for , the problem has an unbounded solution, and the computation stops.
Simplex Algorithm
The methods for handling the subproblems of the simplex algorithm were introduced earlier. Here is a summary of the simplex algorithm:
1. Construct the augmented matrix in canonical form based on the initial basic feasible solution. 2. Calculate the test numbers for the non-basic variables. 3. If for all , stop the computation; the current basic feasible solution is optimal. Otherwise, proceed to the next step. 4. Choose the with the smallest test number among the negative test numbers. 5. If there is no , stop the computation; the problem has an unbounded solution. Otherwise, calculate . If multiple indices satisfy the condition, let be the smallest index. 6. Perform a pivot transformation using element as the pivot element, updating the augmented matrix in canonical form. 7. Return to step 2.
Additionally, for the simplex algorithm, there is a matrix expression. To address the difficulties in finding the initial basic feasible solution, the two-phase simplex method was proposed. To reduce computation, the revised simplex method was also introduced.
To be continued…