How to check if MP solution is unique?

  • 28 September 2022
  • 2 replies

Userlevel 2
Badge +3

Is there a parameter that shows if the solution is unique when using CPLEX? 


Best answer by Marcel Hunting 3 October 2022, 10:52

View original

2 replies

Userlevel 5
Badge +4

Hi @Zsolt Mihály. In case of an LP you can use the function GMP::Solution::IsDualDegenerated. If that function returns 1 then the primal solution is not unique.

For MIP it is not easy to check whether there exists another optimal solution, with at least one integer variable having a different value. To check this you would have to resolve the MIP model once again, after forbidding the optimal solution that has been found before. This can be done using the procedure GMP::Instance::AddIntegerEliminationRows as demonstrated in the Dice example. If the objective value of the second solve differs from that of the orginal solve then the optimal solution was unique; if they are equal then the MP has multiple optimal solutions.

Userlevel 2
Badge +3

Thank you @Marcel Hunting. It answers my question.


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator