> That's a whole field of wonderful computer science / math that is mostly usable via a couple of extraordinarily expensive closed-source offerings.
Take a look at Google OR-Tools: https://developers.google.com/optimization/
Take a look at Google OR-Tools: https://developers.google.com/optimization/