Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Why does my LP model activate the MIP solver?

    Posted 12/20/11 09:31 AM

    Originally posted by: duyuquan2006


    Hi all,

    I relaxed the 0-1 variables of one of my MIP models to continuous variables between 0,1 (IloNumVarArray(env,N,0,1)),and thus obtain a LP model. After I solved this LP model, I found this LP model triggered the MIP solver, but not the LP solver, according to the log info below.
    Tried aggregator 2 times.
    MIP Presolve eliminated 673 rows and 933 columns.
    Aggregator did 18 substitutions.
    Reduced MIP has 1076 rows, 805 columns, and 3225 nonzeros.
    Reduced MIP has 0 binaries, 0 generals, 0 SOSs, and 0 indicators.
    Probing time =    0.00 sec.
    Tried aggregator 1 time.
    Presolve time =    0.03 sec.
    Probing time =    0.00 sec.
    MIP emphasis: balance optimality and feasibility.
    MIP search method: dynamic search.
    Parallel mode: deterministic, using up to 4 threads.
    Root relaxation solution time =    0.00 sec.
     
            Nodes                                         Cuts/ 
       Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap
     
    *     0     0      integral     0     3179.0000     3179.0000      287    0.00%
    Elapsed real time =   0.09 sec. (tree size =  0.00 MB, solutions = 1)
     
    Root node processing (before b&c):
      Real time             =    0.05
    Parallel b&c, 4 threads:
      Real time             =    0.00
      Sync time (average)   =    0.00
      Wait time (average)   =    0.00
                              -------
    Total (root+branch&cut) =    0.05 sec.
    


    And also I cannot use the "getDuals" method,since it activated the MIP solver.

    Could u pls explain this, and tell me how my LP model can activate the LP solver?

    Thanks a lot.

    Yuquan
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Why does my LP model activate the MIP solver?

    Posted 12/20/11 10:09 AM

    Originally posted by: SystemAdmin


    After the solve, what do functions IloCplex::getNintVars(), IloCplex::getNbinVars(), IloCplex::getNSOS(), IloCplex::getNsemiIntVars(), IloCplex::getNsemiContVars() return? Does any of them return a non-zero value?
    Do you have any callbacks registered with your IloCplex instance?
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Why does my LP model activate the MIP solver?

    Posted 12/20/11 08:38 PM

    Originally posted by: duyuquan2006


    Hi Daniel,

    According to the log info of CPLEX, the number of binaries is 0 (See the following log info). However, the value of "getNbinVars" is 216 (You can also see the info below). I checked my code,I just changed the IloBoolVarMatrix of the MIP model to IloNumVarMatrix objects(see my following code), and did nothing else.

    
    Tried aggregator 2 times. MIP Presolve eliminated 673 rows and 933 columns. Aggregator did 18 substitutions. Reduced MIP has 1076 rows, 805 columns, and 3225 nonzeros. Reduced MIP has 0 binaries, 0 generals, 0 SOSs, and 0 indicators. Probing time =    0.00 sec. Tried aggregator 1 time. Presolve time =    0.05 sec. Probing time =    0.00 sec. MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic, using up to 4 threads. Root relaxation solution time =    0.00 sec.   Nodes                                         Cuts/  Node  Left     Objective  IInf  Best Integer    Best Bound    ItCnt     Gap   *     0     0      integral     0     3179.0000     3179.0000      287    0.00% Elapsed real time =   0.09 sec. (tree size =  0.00 MB, solutions = 1)   Root node processing (before b&c): Real time             =    0.06 Parallel b&c, 4 threads: Real time             =    0.00 Sync time (average)   =    0.00 Wait time (average)   =    0.00 ------- Total (root+branch&cut) =    0.06 sec. Number of integer variables is :0 Number of binary variables is :216 Number of SOS variables is :0 Number of SemiInt variables is :0 Number of SemiCont variables is :0
    

    The code relaxing the 0-1 variables is :
    
    IloNumVarMatrix SIGMA(env,N);
    //IloBoolVarMatrix in the MIP model IloNumVarMatrix DELTA(env,N);
    //IloBoolVarMatrix in the MIP model IloNumVarMatrix PHI(env,N2);
    //IloBoolVarMatrix in the MIP model IloNumVarMatrix PSI(env,N2);
    //IloBoolVarMatrix in the MIP model   
    
    for (
    
    int i=0;i<N;i++) 
    { SIGMA[i]=IloNumVarArray(env,N,0,1); DELTA[i]=IloNumVarArray(env,N,0,1); 
    
    if (i<N2) 
    { PHI[i]=IloNumVarArray(env,maxElem_bigK+EXPANDTW,0,1); PSI[i]=IloNumVarArray(env,maxElem_bigK+EXPANDTW,0,1); 
    } 
    }
    

    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Why does my LP model activate the MIP solver?

    Posted 12/21/11 09:33 AM

    Originally posted by: SystemAdmin


    It looks like your model contains binary variables but MIP presolve is able to eliminate all of them. But as long as your model contains integer/binary variables before presolve CPLEX will consider your model as MIP.
    So in some way you are still creating binary variables in your model. Maybe export your model (IloCplex::exportModel) to an LP file and look at the 'Binary' section in this file. This section lists all binary variables. Maybe this can help you to find the places in which you add binaries.
    Do you have any constraints in your model that are not instances of IloRange ('ifThen', 'or', 'and', ...)? Such constraints may implicitly create binary variables.
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Why does my LP model activate the MIP solver?

    Posted 12/21/11 09:48 AM

    Originally posted by: duyuquan2006


    Thanks, Daniel. I check my code once again and I find no constraint of not IloRange. Could u pls recheck my code (indeed a function)? Could u give me your email address at your convenience? (I don't want to make my code public in the forum.)

    Thanks a million!

    Yuquan
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Why does my LP model activate the MIP solver?

    Posted 12/21/11 10:24 AM

    Originally posted by: SystemAdmin


    Did you also export an LP file and check the 'Binary' section in that file? Maybe first export an LP file. If you don't find anything there then export a SAV file and send it to me daniel(dot)junglas(at)de(dot)ibm(dot)com. Please don't send any code yet!
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Why does my LP model activate the MIP solver?

    Posted 12/22/11 04:08 AM

    Originally posted by: duyuquan2006


    Hi Paul and Daniel,

    I think "I fail miserably in a very easy task" (Paul,are there some idioms in English to express this? I am a Chinese, and cannot employ a suitable English idiom). The fact is: if you want to express the constraint "Y<=X<=Z" in Concert, the code
    mod.add(Y<=X<=Z);
    

    will implicitly add some binaries to the model. However, the code
    mod.add(Y<=X);
    mod.add(X<=Z);
    

    will not,although both the methods will obtain the same solutions (objective).
    (Daniel,do you plan to remove this inconsistency in the future version of CPLEX?)

    Recently, I model my problems both with Concert (C++) and YALMIP (matlab), and mistakenly mixed the syntax together.
    Thanks for your patience and warm helps.

    Merry X'mas!
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Why does my LP model activate the MIP solver?

    Posted 12/25/11 11:33 AM

    Originally posted by: SystemAdmin


    > duyuquan2006 wrote:
    >
    > I think "I fail miserably in a very easy task" (Paul,are there some idioms in English to express this? I am a Chinese, and cannot employ a suitable English idiom).

    The closest I can come is "can't hit the broad side of a barn" (originally used in reference to shooting or throwing something).

    > The fact is: if you want to express the constraint "Y<=X<=Z" in Concert, the code
    >
    
    > mod.add(Y<=X<=Z); >
    

    > will implicitly add some binaries to the model. However, the code
    >
    
    > mod.add(Y<=X); > mod.add(X<=Z); >
    

    > will not,although both the methods will obtain the same solutions (objective).

    Interesting that it finds the same solution. The only reason I can think of for CPLEX to add a binary variable is if it interprets

    
    mod.add(Y<=X<=Z);
    


    to mean that the binary indicator for the condition Y <= Z (1 if true, 0 if not) must be less than or equal to Z -- which would be a vacuous condition for Z >= 1. So I'm probably wrong about why the binary variable is being added.

    > Merry X'mas!

    To you too!

    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)
    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: Why does my LP model activate the MIP solver?

    Posted 12/20/11 05:35 PM

    Originally posted by: SystemAdmin


    I wonder whether (a) you're model contained at least one unrelaxed integer variable, semicontinuous variable, SOS constraint or indicator constraint and, if so, whether (b) eliminating all such beasts during presolve still leaves the model a MIP in the eyes of CPLEX.

    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)
    #CPLEXOptimizers
    #DecisionOptimization


  • 10.  Re: Why does my LP model activate the MIP solver?

    Posted 12/20/11 08:50 PM

    Originally posted by: duyuquan2006


    Hi Pual,

    Some info of my model was been shown just now in my reply to Daniel. I want to ask a question:

    In my original MIP model, there are some big-M constraints like "2*DELTA[i][j]<=X[i]<=Y[i]+M(1-DELTA[i][j])",and the specified constraints on binary variables like "1<=DELTA[i][j]+DELTA[j][i]+SIGMA[i][j]+SIGMA[j][i]<=2". When I relax the 0-1 variables(DELTA,SIGMA), should I do something special else towards these constraints?

    Thanks.

    Yuquan DU
    #CPLEXOptimizers
    #DecisionOptimization


  • 11.  Re: Why does my LP model activate the MIP solver?

    Posted 12/21/11 07:48 PM

    Originally posted by: SystemAdmin


    No, nothing special need be done to those constraints.

    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)
    #CPLEXOptimizers
    #DecisionOptimization