Given \(n\) datasets having each \(m\) vectors of same size,
say \({x_{11},...,x_{1m}},...,x_{n1},...,x_{nm}\), and permutations
\(\sigma_1,...,\sigma_n\) of \({1,...,m}\), the function calculates
\(1/(n(n-1)) sum_{i,j} sum_{k} || x_{i,sigma_i(k)- x_{j,\sigma_j(k) \|^2}}\) where \(i\) and \(n\) run from 1 to \(n\) and \(k\) runs from 1 to \(m\). This is the objective value (1) of Degras (2021), up to the factor \(1/(n(n-1))\).