Algorithm for computing optimal third-year medical school rotation schedule.