complete pivoting
Partial pivoting picks the best pivot from the current column only. Complete pivoting is the more thorough cousin: at each step it searches the ENTIRE remaining sub-matrix for the largest-magnitude entry and brings it to the pivot position by swapping both a row AND a column. It is the maximally careful choice of pivot, used when you want the strongest possible guard against error growth.
When eliminating step k, partial pivoting compares only the n - k + 1 entries below the diagonal in column k; complete pivoting compares all (n - k + 1)^2 entries of the lower-right block, finds the global maximum, and moves it to position (k, k) with a row swap and a column swap. Because a column swap reorders the unknowns, the bookkeeping needs a second permutation: the factorization becomes P A Q = L U, where P records row swaps and Q records column swaps, and you must un-permute the solution at the end. With complete pivoting the growth factor is provably bounded (it grows at most polynomially, far more slowly than the exponential worst case possible for partial pivoting), so it is the most numerically robust dense elimination.
Despite that stronger guarantee, complete pivoting is rarely used. The reason is cost: searching the whole sub-matrix at every step adds O(n^3) comparisons, comparable to the arithmetic itself and far more than partial pivoting's O(n^2), and it disrupts the memory-friendly access patterns that make blocked BLAS fast. Since partial pivoting is already stable enough for essentially all real matrices, the extra safety of complete pivoting almost never justifies the slowdown. A middle option, rook pivoting, searches less than complete pivoting but more than partial. So: complete pivoting is the textbook gold standard for stability and a useful theoretical benchmark, but partial pivoting is what production codes actually run.
At step 1, complete pivoting scans every entry of A, finds the global largest-magnitude one, and swaps its row to row 1 and its column to column 1 before eliminating, recording both in P A Q = L U.
Searching the whole block guarantees a bounded growth factor — at the price of O(n^3) extra comparisons.
Complete pivoting is the safest but is almost never worth its cost in practice; partial pivoting is the universal default. Note it needs a column permutation Q too, so the unknowns are reordered and must be restored.