to find combinations in the matrix
close to a solution to have a serialized version of the grid