An auxiliary function that sorts the entries within each column by ascending order: For ties, the minimum ranking is used, e.g. if there are repeating distance entries, the order is like 1,2,3,3,4,..,n-1.
DistRanks(dis)is a symmetric distance matrix.
disRank is the column rank matrices of X.