Johnson's O(n*m*log(n)) alg running perfectly for any n