Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Optimal solution not recognized as feasible

    Posted 09/23/19 10:25 AM

    Originally posted by: rocarvaj


    Hello.
    I'm trying to give CPLEX a MIP start solution for the markshare2 problem in MIPLIB 2017, using the C Callable library. In fact, I'm using the optimal solution provided by MIPLIB 2017 (http://miplib.zib.de/downloads/solutions/markshare2/1/markshare2.sol.gz). The problem is that CPLEX (I tried with 12.7.1 and 12.8) is not recognizing the solution as feasible.

    The optimal objective value is 1, but as you can see in this case CPLEX finds a feasible solution way worst.


    Since the solution format used in MIPLIB is a list of variable names and their values (one per line), I have to read them, find the index of the corresponding variable by using the CPXgetcolindex function, and then add the solution by using CPXaddmipstarts
    Naturally, I thought that I had an error when translating the solution from the file to CPLEX, but I tried with another solver (sorry for bringing up the competition) by just changing the CPXgetcolindex and CPXaddmipstarts calls for their equivalents in the other solver. This time the solution is recognized as feasible.
    I'm using markshare2 as an example, but it has happened with other instances from MIPLIB 2017 too.

    Am I missing something?

    I have isolated the code that does the reading and that adds the MIP start solution and it is available in the following repo in case that someone would like to try and replicate this: https://github.com/rocarvaj/mipstart-example

    Thanks in advance,

    Rodolfo


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Optimal solution not recognized as feasible

    Posted 09/23/19 03:05 PM

    Originally posted by: T_O


    I'm currently too lazy to compile it, so I don't know what the real issue is.

    As a first step, I would also assert that the return value of CPXgetcolindex is zero.

    It might also be a good idea to dump the vectors "sortedsolution" and "names" to check if they contain correct and complete data.

    Best regards,
    Thomas


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Optimal solution not recognized as feasible

    Posted 09/23/19 04:16 PM

    You might try fixing all the variables at their values in the mip start and then running the solver. If it says the problem is infeasible, you can try the conflict refiner to see what is bothering CPLEX. It might conceivably be a tolerance issue. If CPLEX is able to solve the problem with the variables fixed, it suggests an error in the code passing in the mip stat, or else that you need to change the parameter that controls how much effort CPLEX devotes to using a mip start.


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Optimal solution not recognized as feasible

    Posted 09/23/19 04:30 PM

    I think I found an off-by-one bug in your code. When you fill the sortedsolution vector, the following loop

        for(int i = 0; i < solution.size()-1; ++i)

    should be replace by:

        for(int i = 0; i < solution.size(); ++i)

    The mip start was not complete (as is required here), so it was not being processed. If you make the minor change from above, then it works as expected:

    CPXPARAM_TimeLimit                               10
    1 of 1 MIP starts provided solutions.
    MIP start 'm1' defined initial solution with objective 1.0000.


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Optimal solution not recognized as feasible

    Posted 09/23/19 05:16 PM

    Originally posted by: rocarvaj


    Thanks a lot! I feel so dumb, but hey... That's why one asks for help.

    It seems that the other solver was just better at finding an optimal solution from the incomplete one than CPLEX was in this particular case, that's why I thought that this was just a CPLEX issue.

    Thanks to Paul and Thomas for their help too.

     

    Best,

    Rodolfo


    #CPLEXOptimizers
    #DecisionOptimization