Let there be $n$ stock symbols.
Let each stock symbol have exactly $t$ ticks (with all ticks miraculously aligned.)
We are now searching for potential pairs for pair trading.
A brute-force solution involves looking at all $\frac{n(n-1)}{2}$ pairs and for each pair, doing an $O(t)$ operation.
Can we get an approximate solution in sub $O(n^2 t)$ time? [I.e. something like fourier transforms for pair trading].