This will be another quick post that’s a follow-up to this previous one. That problem works in a linear program by luck, since the ‘capacity’ of the knapsack (the number of jobs that need to be done) is an integer. For recent versions of SciPy’s linear solver, you have to use revised simplex, and it’s not very straightforward.
I recently learned about Python-MIP, and it is easier to write the problem in that framework, and it’s made for integer linear problems. I’ll show you how to write the problem in that below!
