Method that find permutation matrix