Grader allocation algorithm.