Testing the Optimality: After obtaining the initial basic feasible solution the next step is test whether it optimal or not. There are two methods of testing the optimality of a basic feasible solution.
The first of these is called the stepping stone method in which the optimality test is applied by calculating the opportunity cost of each empty cell.
The second method employed for testing optimality is called the modified distribution method ( MODI). The method is easier and more efficient than the stepping stone method. It is based on the concept of the dual variables that are used to evaluate the empty cells. Using these dual variable the opportunity cost of each of the empty cells is determined. The opportunity cost values in both the methods indicate the optimality or otherwise of a given solution.
Improving the Solution: By applying either of these methods if the solution is found to be optimal then the problem is solved. If the solution is not optimal then a new and better basic feasible solution is obtained.. it is done by exchanging a non basic variable for one basic variable. In simple terms rearrangement is made by transferring units from an occupied cell to an empty cell that has the largest opportunity cost and then shifting the units from other related cells so that all the rim requirements are satisfied. This is achieved by first tracing a closed loop.