in reply to Sorting hashes...
This sounds like a "clustering" problem to me... a google search on clustering techniques might do you some good.
--[ e d @ h a l l e y . c c ]