Generating the shortest paths for all students