Shift Organization algorithms (Constraint Programming + Marriage problem)
Turns out this problem is pretty hard to solve and is still under active research. This paper (2004) describes the state of the art.