Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  feasopt with MIP problem with indicator constraint

    Posted 08/25/15 05:17 PM

    Originally posted by: Uonly


    Hi Cplex community,

     

    I want to use feasopt for checking feasibility of MIP problem. But in the formulation of MIP, it has indicator constraint.

    For the signature of feasopt(rng, NULL, NULL), the first argument seems to require the ranged array of constraints.

    So I have to convert the indicator constraint to linear constraints by myself? or there is some other approach?

    Thanks

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: feasopt with MIP problem with indicator constraint

    Posted 08/26/15 04:53 AM

    I assume by "indicator constraints" you mean instances of IloIfThen? These are constraints are instances of IloConstraint, so you can pass them in the IloConstraintArray of (see also the reference documentation)

    public IloBool feasOpt(const IloConstraintArray cts, const IloNumArray prefs)


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: feasopt with MIP problem with indicator constraint

    Posted 08/26/15 05:48 PM

    Originally posted by: Uonly


    Thanks Daniel for your answer.

    Recently I am trying feasopt for testing feasibility of MIP.

    It is no problem when I was Cplex C API.

    I just set

    status = CPXfeasopt (env, lp, NULL, NULL, NULL, NULL);

    Basically it tells cplex there is nothing to relax. So Cplex will solve the feasibility problem , like phase I for lp.

    It worked perfectly!

    But the problem comes later when I switch to Cplex C++ concert API.

    The usage is essentially the same, I set

    result = solver. feasOpt(NULL, NULL), where solver is an object of IloCplex.

    (I also use feasOpt(NULL, NULL,NULL), neither signatures work)

    It compiles fine but has a run time error as shown in the picture attached.

    I am using Cplex 12.6.0.1 under MS Visual Studio 2010, 32 bit Debug version

    I feel too bold to claim that there is a bug in CPLEX concert API.

    But I could not find an answer to it after investigating for a quite long time.

    Would you please help with this problem?

    Thanks

     

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: feasopt with MIP problem with indicator constraint

    Posted 08/27/15 03:24 AM

    The functions you call in C++ do not support NULL arrays as arguments. Try passing empty arrays (size 0) instead, this should have the same effect. Like so, for example:

    IloConstraintArray cts(cplex.getEnv());
    IloNumArray prefs(cplex.getEnv());
    boolean result = cplex.feasOpt(cts, prefs);
    prefs.end();
    cts.end();
    

     


    #CPLEXOptimizers
    #DecisionOptimization