Topic
  • 9 replies
  • Latest Post - ‏2010-09-23T21:32:27Z by SystemAdmin
jpolako
jpolako
7 Posts

Pinned topic Differents solutions between Java Concert Thechnology - CPLEX command line

‏2010-09-21T18:50:30Z |
I'm solving the VRP problem using a cutting plane algorithm and I've implemented that on Java using the CPLEX Concert Technology. The main problem occures when I add some cuts to the problem, the result obtained consider the a subset of nodes that was prohibited by the cut restriction.

When I solve the exported model with the problem mentioned using the CPLEX command line tool, the solution isn't the same provided by the Java Concert library.

Some days ago I found a problem with a numerical truncation and I configure the IloCplex object whit this line:
cplex.setParam(IloCplex.BooleanParam.NumericalEmphasis, true);

but now the problem persists.

What can I do to solve this problem?? please help me.....
Updated on 2010-09-23T21:32:27Z at 2010-09-23T21:32:27Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: Differents solutions between Java Concert Thechnology - CPLEX command line

    ‏2010-09-21T19:09:01Z  
    Are you exporting the model in .sav format? Other formats (such as .lp format) will truncate floating point data, which can result in changes to the set of solutions to a model.

    Philip Starhill
    CPLEX Research Engineer
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: Differents solutions between Java Concert Thechnology - CPLEX command line

    ‏2010-09-21T19:17:34Z  
    > jpolako wrote:
    > I'm solving the VRP problem using a cutting plane algorithm and I've implemented that on Java using the CPLEX Concert Technology. The main problem occures when I add some cuts to the problem, the result obtained consider the a subset of nodes that was prohibited by the cut restriction.

    Are these cuts of the form f(x) >= 1, where x contains binary variables (only) and f is linear with coefficients +/- 1 (and 0)? Are you adding the cuts as global cuts? (Local cuts would not apply outside the subtree where they were added.)

    /Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
  • jpolako
    jpolako
    7 Posts

    Re: Differents solutions between Java Concert Thechnology - CPLEX command line

    ‏2010-09-21T23:17:53Z  
    I'm saving the models in a lp format because is a integer problem (all the parameter are integer values) and the cuts are added as global cuts, I suppose so. In order to add a new cut I use the method addCut of the IloCplex object.

    http://yalma.fime.uanl.mx/cplex11-manual/refjavacplex/html/ilog/cplex/IloCplex.html#addCut%28ilog.concert.IloConstraint%29
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: Differents solutions between Java Concert Thechnology - CPLEX command line

    ‏2010-09-22T18:47:18Z  
    • jpolako
    • ‏2010-09-21T23:17:53Z
    I'm saving the models in a lp format because is a integer problem (all the parameter are integer values) and the cuts are added as global cuts, I suppose so. In order to add a new cut I use the method addCut of the IloCplex object.

    http://yalma.fime.uanl.mx/cplex11-manual/refjavacplex/html/ilog/cplex/IloCplex.html#addCut%28ilog.concert.IloConstraint%29
    > jpolako wrote:
    > I'm saving the models in a lp format because is a integer problem (all the parameter are integer values) and the cuts are added as global cuts, I suppose so. In order to add a new cut I use the method addCut of the IloCplex object.

    Am I correct in interpreting this to mean that you are not adding the cuts in a callback? In otherwords, you are using a sequence like the following:
    {code}
    IloCplex cplex;
    // ...
    cplex.solve();
    cplex.addCut(...);
    cplex.solve();
    cplex.addCut(...);
    // ...

    Using addCut this way does not add the cuts to the model; so if you export the model, I believe the .lp file will not contain the cuts.

    /Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
  • jpolako
    jpolako
    7 Posts

    Re: Differents solutions between Java Concert Thechnology - CPLEX command line

    ‏2010-09-22T20:58:56Z  
    Paul, you are right, I'm don't adding the cuts using callbacks because I'm solving VRP with intervalar uncertainty in travel costs using the min-max regret criterion.

    The exported the model in a .lp format contains all the cuts added, as a Lazy Constraints.

    When I solve the model using the command line interface the solution obtained isn't equals to the solution obtained with the Java Concert plugin.

    I think, maybe, the set of parameters used in the cplex command line interface is different to the set of parameter used in the Java Concert plugin.

    But I don know what is the problem. I've configured the cplex object with
    cplex.setParam(IloCplex.BooleanParam.NumericalEmphasis, true);

    but in some cases works....
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: Differents solutions between Java Concert Thechnology - CPLEX command line

    ‏2010-09-22T22:45:33Z  
    • jpolako
    • ‏2010-09-22T20:58:56Z
    Paul, you are right, I'm don't adding the cuts using callbacks because I'm solving VRP with intervalar uncertainty in travel costs using the min-max regret criterion.

    The exported the model in a .lp format contains all the cuts added, as a Lazy Constraints.

    When I solve the model using the command line interface the solution obtained isn't equals to the solution obtained with the Java Concert plugin.

    I think, maybe, the set of parameters used in the cplex command line interface is different to the set of parameter used in the Java Concert plugin.

    But I don know what is the problem. I've configured the cplex object with
    cplex.setParam(IloCplex.BooleanParam.NumericalEmphasis, true);

    but in some cases works....
    The default parameter settings for CPLEX interactive and CPLEX APIs are the same, as far as I know. Obviously, if you change parameter settings in your code, you'll need to make the same parameter changes in the interactive optimizer if you hope to replicate behavior.

    The second point, which Philip Starhill was driving at, is that using the LP file format raises the likelihood that the interactive optimizer will behave differently from your code. This gets discussed repeatedly in this forum, but I have not kept links to the discussions, so I decided to make a blog entry that I can point to in the future (and save myself some typing).

    Now, if I understand where we're at here, you have cuts you add between calls to solve, and the solution your code generates sometimes violates one or more of those cuts; but if you write the file out (LP format) and solve it interactively, the solution does not violate any cuts. Did I summarize that correctly? If so, the most likely culprit would be numerical instability, even if you have numerical emphasis on. What do you get for basis kappa values? (The other explanation would be that the cuts are not being applied correctly, but if they show up in the LP file, that seems less likely.)

    /Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
  • jpolako
    jpolako
    7 Posts

    Re: Differents solutions between Java Concert Thechnology - CPLEX command line

    ‏2010-09-23T15:11:31Z  
    Thanks for your help Paul, I'm a Masters Student, working in Metaheuristic to solve the Robust Vehicle Routing Problem with Interval Data using Min-Max Regret Criteria.

    This kind of Robust problems using the min-max regret criteria are a NP-Hard problem, due to the nature of the criteria. In order to solve the Robust problem you must solve many of classical problem, in this case many of VRP. Once you have solved a classical problem, you must add a new cut to the Robust model (acording to the Benders Decomposition applying to this case).

    There are no literature for this problem, for that reason I'm solving this problems, only to use this results to compare it with the results obtained with Simulated Annealing and other Metaheuristics.

    I think that is a numerical problem, I will configure the kappa basis parameter (when I will first understand the meaning of that) and then I will tell you about the solution.

    Again thank you Paul for your help...
  • jpolako
    jpolako
    7 Posts

    Re: Differents solutions between Java Concert Thechnology - CPLEX command line

    ‏2010-09-23T18:05:59Z  
    There are no parameters to configure the basis kappa values in CPLEX 12.1...

    What other parameter can I configure to fix this problem?
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: Differents solutions between Java Concert Thechnology - CPLEX command line

    ‏2010-09-23T21:32:27Z  
    • jpolako
    • ‏2010-09-23T18:05:59Z
    There are no parameters to configure the basis kappa values in CPLEX 12.1...

    What other parameter can I configure to fix this problem?
    > jpolako wrote:
    > There are no parameters to configure the basis kappa values in CPLEX 12.1...
    >
    > What other parameter can I configure to fix this problem?

    I saw that you posted a comment on my blog and answered there. Just to complete the thread here, MIPKappa was new in CPLEX 12.2. In 12.1, I would either relax the problem to an LP, solve it and check the basis kappa value, or solve the MIP, fix the integer variables, solve the fixed problem as a MIP and check the final basis kapp there. (Actually, I'd probably do both.)

    /Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)