I'm currently working on an algorithm that requires me to come up with unique matrices. Two matrices are considered equivalent if one's rows and columns can be swapped to make it match the other. For example, $\begin{bmatrix} 0 & 0 \\ 1 & 1 \end{bmatrix} \equiv \begin{bmatrix} 1 & 1 \\ 0 & 0 \end{bmatrix} \not\equiv \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} \not\equiv \begin{bmatrix} 0 & 1 \\ 0 & 1 \end{bmatrix}$. I think it would be immensely helpful to find a nice way to represent each matrix so that equivalent matrices have the same representation. The best I could come up with is just making a list of the rows and columns and comparing them. For example, $\begin{bmatrix} 0 & 0 \\ 1 & 1 \end{bmatrix}=>\{R:((0, 0), (1, 1))\}, \{C:((0, 1), (0, 1))\} $ $\begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}=>\{R:((0, 1), (0, 1))\}, \{C:((0, 1), (0, 1))\}$ $\begin{bmatrix} 0 & 1 \\ 0 & 1 \end{bmatrix}=>\{R:((0, 1), (0, 1))\}, \{C:((0, 0), (1, 1))\}$
but I feel like there's a better way because this looks messy. Any suggestions?
Edit: This is not always binary matrix. Numbers can range from 0-19.