Now, there are lots of ordered numeric vectors(about 50 dimension). Each dimension is a integer between 0~200. I want to sort them to ensure the similar vectors in the same bucket, all vectors in adjacent buckets have also a similarity to a certain extent. e.g. <1,24,25,78,9> and <2,24,24,78,9> should be in same bucket(bucket number is 010), but <3,29,26,74,11> and <4,28,29,75,10> (they are also in same bucket)is in adjacent buckets (bucket number is 011)
how to design such a sorting function?