Goal
How to encode the data that describes how to re-order a static list from a one order to another order using the minimum amount of data possible?
What you want is the permutation required to sort the list. You can get this by constructing a list of indices from 0 to n, then sorting that list with a custom comparison function that compares the items at the corresponding indices. For example, in Python:
perm = sorted(range(len(l)), key=lambda x:l[x])
You can then send 'perm' over the connection, and use it to get the sorted list:
for x in perm:
print perm[x]
As a further optimization, if most elements remain unchanged, the permutation will be highly compressible - either by using regular compression or by using transforms like difference (eg, store each element as the difference from the previous element, rather than its absolute value), move to front and run length encoding.