Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Cplexmiqp give wrong solution

    Posted 05/13/19 04:58 PM

    Originally posted by: Mambo12345


    Good evening,

    it seems that [x,fval,exitflag,output] = cplexmiqp(H, f, A, b', Aeq, beq', [], [], [], [], [], ctype ,[],options);

    gives me a wrong solution. When I turn the iteration on to see what it does I can see that it cuts of so many branches.
    That are my only options:

    options.Display = 'iter';
    Cplex.Param.mip.cuts.bqp = 3;
    Cplex.Param.emphasis.numerical = 1;

     

    But even when I didnt set any option it gave me a wrong solution.
    What could be the mistake ?

    Best regards !


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Cplexmiqp give wrong solution

    Posted 05/14/19 12:50 AM

    Hard to tell without knowing why you thing the solution is wrong. Is it infeasible? Is it sub-optimal?

    Can you also show the log output? Even better, share the actual model?

    Also note that the way you the bqp and numerical emphasis parameters will take no effect: You are trying (in a wrong way) to change parameters for the class API while you use the toolbox API. Can you please check the reference documentation of cplexoptimset() (like I asked you to do in the other thread)? It has an explicit example how to set parameters for the toolbox API:

    To turn on the optimizer output and set a node limit of 400:

     options = cplexoptimset(
    'Display', 
    'on', 
    'MaxNodes', 400);
    

    To set a node limit of 400 and instruct CPLEX to use traditional branch and cut style search, you have two methods:

     opt = cplexoptimset(
    'mip.limits.nodes',
    '400',
    'mip.strategy.search',
    '1');
    

    or

     opt = cplexoptimset(
    'cplex'); 
     opt.mip.limits.nodes=400; 
     opt.mip.strategy.search=1;
    

    If you want to write the model out to a file, then you need to set:

     opt.exportmodel = 
    'myModel.lp';
    

    So to set numerical emphasis you would need something like options.emphasis.numerical = 1;

    This is also explained in detail in the documentation here.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Cplexmiqp give wrong solution

    Posted 05/16/19 06:32 AM

    Originally posted by: Mambo12345


    Thank you for your help !
    I found a little mistake in my implementation and thats why i got a wrong solution.

    That was my mistake but I still have the problem that I think it is very slow, I postet my code in the other thread, maybe you can find what makes it so slow.
    Or maybe it is not possible to make it faster.
     


    #CPLEXOptimizers
    #DecisionOptimization