Optimal multi-agent scheduling with constraint programming