This is a problem I\'ve had on my mind for a long time. Being the son of a teacher and a programmer, it occurred to me early on... but I still haven\'t found a solution for it.<
This is a mapping problem: you need to map to every hour in a week and every teacher an activity (teach to a certain class or free hour ).
Split the problem:
In steps 2 and 3 show each iteration to the user: items left in the list, positions on the map and the next computed move and let the user intervene.
I did not try this, but this would be my initial approach.