I've started an open-source exercise to learn linear optimization against constraints. It may take some time for me to come up with a solution, so please feel free to put in a PR (or start a new repo or fork) if you know how to build a solution. I'd love to learn how to do this and share it with others. https://github.com/thomasnield/optimized-scheduling-demo/blob/master/README.md