Optimization, Algorithms, Python, Linear Programming, Operations Research.
four steps. Find the only loop involving the entering variable and some of the basic feasible variables. Count the cells in the loop (starting from 0), label them as odd cells or even cells. Find the odd cell with the smallest value. Call this value θ. This cell corresponds to the leaving variable.