We study equivalence classes of ternary matrices of size $m\times n$, where equivalence is defined via row permutations, column permutations, and negation of entire columns. Our goal is to define and efficiently compute a canonical representative for each equivalence class.
Let $\mathbb T=\{-1,0,1\}^{m\times n}$ denote the set of ternary matrices with $m$ rows and $n$ columns. Consider the group $\mathcal B$ of transformations acting on $\mathbb T$ generated by:
- $\mathcal R$: permutations of rows
- $\mathcal C$: permutations of columns
- $\mathcal N$: negation of entire columns (e.g. multiplying entire columns by $-1$)
Transformations in $\mathcal R$ and $\mathcal C$ commute; likewise for $\mathcal R$ and $\mathcal N$. Transformations in $\mathcal C$ and $\mathcal N$ do not commute in general, but it can be shown that every transformation $B\in\mathcal B$ can be uniquely expressed as $B=R\circ C\circ N$ with $(R,C,N)\in\mathcal R\times\mathcal C\times\mathcal N$. Hence, the size of the group is: $$|\mathcal B|\,=\,|\mathcal R|\cdot|\mathcal C|\cdot|\mathcal N|\,=\,m!\cdot n!\cdot2^n$$
Is there a polynomial-time algorithm to find a canonical representative $\hat t$ of the equivalence class of a given $t\in\mathbb T$ under action of group $\mathcal B$ ?
Incidentally, how many such equivalence classes are there?
Motivation: when $t$ represents a boolean SATisfiability problem in Conjunctive Normal Form with $m$ clauses and $n$ variables, transformations in $\mathcal B$ do not change satisfiability. Applying a random such transformation is easy and sometime used to randomize a problem.