Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  no solution is available, what is wrong

    Posted 11/29/10 11:48 AM

    Originally posted by: QINGQINGQING


    dear all

    I am now using cplex to handle MIP with java, and I get a problem

    IloCplex cplex = new IloCplex();
    int D=2;
    IloNumVar[] x=new IloNumVar[D];//x[i]
    for(int i=0;i<D;i++){
    x[i]=cplex.numVar(0, 1, ilog.concert.IloNumVarType.Bool);//bool variables
    }
    IloLinearNumExpr expr= cplex.linearNumExpr();
    for(int i=0;i<D;i++){
    expr.addTerm(x[i], 1.0);//x[1]+x[2]
    }
    cplex.addLe(expr, 1);//x[1]+x[2]=1
    IloLinearNumExpr obj = cplex.linearNumExpr();
    for(int i=0;i<D;i++){
    obj.addTerm(x[i], 3.0);//3 * (x[1]+x[2])
    }
    System.out.println(expr);
    cplex.addMaximize(obj);//max{3 * (x[1]+x[2])}
    cplex.solve();
    for(int i=0;i<D;i++){
    if(x[i].equals(0)){
    System.out.println(x[i]);
    }
    if(x[i].equals(1)){
    System.out.println(x[i]);
    }
    }

    the result is

    1.0*http://0..1 + 1.0*http://0..1
    Tried aggregator 1 time.
    MIP Presolve eliminated 1 rows and 2 columns.
    All rows and columns eliminated.
    Presolve time = 0.00 sec.

    and I would like to know the reason to why no solution is available, would you help me?

    Thank you
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  ps: no solution is available, what is wrong

    Posted 11/29/10 12:14 PM

    Originally posted by: QINGQINGQING


    I check out the variable x[i], and it always http://0..1
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  ps: no solution is available, what is wrong

    Posted 11/29/10 12:15 PM

    Originally posted by: QINGQINGQING


    I check out the variable x[i], and it always [0..1]
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: no solution is available, what is wrong

    Posted 11/29/10 02:09 PM

    Originally posted by: SystemAdmin


    Please see the section

    IBM ILOG CPLEX Optimization Studio V12.2 > CPLEX > User's Manual for CPLEX > Languages and APIs > Concert Technology for Java users > Accessing solution information

    in the CPLEX documentation.

    /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