Decision Optimization

Decision Optimization

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

 View Only
  • 1.  conflict of constraints in cplex matlab

    Posted Tue August 18, 2015 03:08 PM

    Originally posted by: Firouz


    Hi,

    I am using Cplex within Matlab for optimization (mixed integer and quadratic programming).

    which code or function can I use to find out the conflict between the constraints in case of infeasibility?

    Thanks


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: conflict of constraints in cplex matlab

    Posted Wed August 19, 2015 01:52 AM

    Function refineConflict in class Cplex is what you are looking for.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: conflict of constraints in cplex matlab

    Posted Wed August 19, 2015 02:23 AM

    Originally posted by: Firouz


    Thank you Daniel.

    I had seen that function in the help but I don't know how to use it! what should I write in my code and where (after or before the cplexmilp(...) function)?

    and what is the "index"?

    can you please give me a simple example with the related functions (cplexmilp, refineConflict,...)?

    Thank you for your help.


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: conflict of constraints in cplex matlab

    Posted Wed August 19, 2015 04:11 AM

    refineConflict() is only available with the class API. So there are no toolbox functions to invoke the conflict refiner.

    You will have to rewrite your code to use the class API (see for example mipex1.m shipped with CPLEX). It should not be too hard to put the arguments passed to cplexmilp() into structures that fit the class API. If you have trouble with that, feel free to come back here.

    Once you have the data in an instance of the Cplex class, you can just invoke refineConflict() on this instance. This method does not take any arguments (the 'index' argument is only for the refineMIPStartConflict() function).


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: conflict of constraints in cplex matlab

    Posted Wed August 19, 2015 12:17 PM

    Originally posted by: Firouz


    Thanks Daniel,

    I didn't get it! What do you mean by " rewrite your code to use the class API " ?

    I have my solver function like this: 

    [x, fval, exitflag, output] = cplexmilp(f,Aineq,bineq,Aeq,beq,[],[],[],lb,ub,ctype,[],options);

    and I have already defined these mitrices: f,Aineq,bineq,Aeq,beq. lb,ub.

    So what should I do?


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: conflict of constraints in cplex matlab

    Posted Thu August 20, 2015 01:15 AM

    Like I said, you cannot use toolbox functions but must use the class API, see the user manual, especially this chapter.

    If you have your data in a format that fits the cplexmilp function then it is pretty simple to create an instance of the Cplex class from this:

      cplex = Cplex();
      cplex.addCols(f, [], lb, ub, ctype);
      cplex.addRows(-inf * ones(size(bineq, 1), 1), Aineq, bineq);
      cplex.addRows(beq, Aeq, beq);
    

    With this you can then invoke the conflict refiner

    conflict = cplex.refineConflict();
    

    See here for an explanation of the structure returned by refineConflict(). Also see here for a general introduction to the conflict refiner.


    #CPLEXOptimizers
    #DecisionOptimization