# How to shuffle input data using stochastic gradient decent?

Let's say that I have input with size $n\times n$ and after that I operated shuffled operations and get the output with the same dimension. But I don't know if we can do that or not. The idea is to permute all the configuration and find the minimum configuration when given loss. But the operation became very expensive with the growth of $O((n^2)!)$, and with each iteration we need to compute loss separately. So is there an optimization for such problem or it just not feasible?

In other words, is there a gradient correlation between different configuration that will lead to the local minima of the loss function?

Training a model on all permutations might be a way to uncover the correct order of the data, is you know it has an order, but it was already shuffled. Otherwise, this experiment would be as useful as training the same model $(n^2)!$ times, just using a different random seem each time.