Closed jessehersch closed 2 years ago
perhaps you should do something with the line mip.maximize(mip.xsum(rewards[i] * variables[i] for i in range(self.count)))
all you have done is create a linear expression, you havent done anything with it
ok so I am not setting the objective function correctly? I guess it should be this:
model.objective = mip.maximize(mip.xsum(rewards[i] * variables[i] for i in range(self.count)))
indeed that's it. i'm an idiot :)
this should be closed as "user error" or similar. don't think I can close it
No problem. Issue closed. :)
Describe the bug I have an optimization problem with boolean variables that appears to produce no solution when it should. It's not overconstrained. If I run the problem with PuLP, it finds a solution.
To Reproduce Here's a unittest that runs the same problem through pulp and mip. The mip test fails.
Maybe I am not setting up the constraints right for mip? In particular I am thinking there could be something wrong with the
constrain_equal_sums
since it's setting two sums equal to each other?In any case the PuLP version works though.
Expected behavior I expect the boolean problem to have a solution
Versions
Additional context can't think of anything. The repro above should be straightforward.