function klee_minty_n2()
% Solution to Klee-Minty problem in 2 variables.
% Michael Floater, 5 Feb 2024.

disp('Initial dictionary.');

dict0 = [0,10,1;1,-1,0;100,-20,-1]

disp('Largest coefficient rule.');
disp('Initially x1 goes into the basis.');
disp('We need 3 pivots.');

dict1 = pivot(dict0,1,1)
dict2 = pivot(dict1,2,2)
dict3 = pivot(dict2,1,1)

disp('With the benefit of hindsight we would put x2 into the basis.');
disp('Then we only need 1 pivot.');

dict1 = pivot(dict0,2,2)

