In the canonical test, if the row is canonical after testing all the permutations, the partition is built based on the i th row's entries. After filling the entries of the i th row, i.e., adding λ (𝑖+1) bonds to the i th atom, the atom neighbourhoods are changed. Therefore the partition λ (𝑖+1) is defined based on the partition and the i th row entries. For matrix A and its refined λ (𝑖)