Problem:
An image was divided into a grid of mxm squares and shuffled. Reconstruct the original image
Solution approach:
For each square block in the shuffled image, calculate the root squared difference between it's
borders and all the other blocks borders, considering the 4 possible directions:
left-right
bottom-up
right-left
top-down
Build a graph using the blocks as nodes and these differences as weights.
Get the Minimum Spanning Tree to represent the image.
Examples:
To improve the accuracy rate, post processing might be required.