Let $X$ be a finite set, let's say the numbers from 1 to $N$. We consider permutations on $X^3$, which we can also regard as a bijective map $U: X^3\to X^3$. We say that $U$ is factorizable if there exist bijective maps $A,B,C$, all of them $X^2\to X^2$, such that $$U_{123}=C_{23}B_{13}A_{12}$$ Here the notation is such that $U$ acts on the triple product, and 1, 2, 3 stand for the components, and for example $A_{12}$ acts on the first two components only, whereas it leaves the third component invariant. It is clear that not every U is factorizable, because the number of possibilities for $U$ is $(N^3)!$, whereas the number of factorizable maps is limited by $((N^2)!)^3$, which is smaller.
Questions: Are there easy conditions to check, if I want to find out whether $U$ is factorizable? What would be a good algorithm for factorization? Brute force check works of course (we can check all possibilities for $A, B, C$ and see whether their product reproduces $U$), but this is not efficient if $N$ starts to increase.
Motivation: The question comes from physics, this is some simple model for more complicated interactions. We would have three particles on a line, each of them having an internal label with $N$ possibilities. When particles get exchanged, the labels can change, but only for those particles who meet at the same spot. In this interpretation, a factorized permutation corresponds to factorized scattering of particles in a process, where the leftmost and rightmost particles get exchanged, while the middle one stays in place. Factorizability means that there is no true three-particle interaction in the system, just two-particle scattering.
Remark: This question was first posted to math.stackexchange, but there was no reply in a few weeks.