the goal is to minimize the average number of inversions in ranking