coin-or / python-mip

Python-MIP: collection of Python tools for the modeling and solution of Mixed-Integer Linear programs
Eclipse Public License 2.0
516 stars 90 forks source link

Number of solutions #247

Closed ErikLambrechts closed 2 years ago

ErikLambrechts commented 2 years ago

I am working on a problem where I have a feasible solution to a set of constraints. I don't have an objective but I trying to figure out if there are other feasible solutions satisfying this set of constraints.

Is there an efficient why to solution this?

sebheger commented 2 years ago

@ErikLambrechts. Best to my knowledge python-mip doesn't provide you with an efficient way. You can try two approaches (without guarantee):

  1. Perform runs with different artificially generated target functions to see whether you can find a different solution. This approach might "fail" if there is only one feasible solution or you do not find the required target function to produce different output.
  2. If we are talking to integer programming, you can try to add an additional constraint that exactly forbids your feasible (integral) solution. If the new model has no integral solution, you know that there is only one. Otherwise, you get the other one. Depending on your problem if/how this constraint can/must be constructed.