Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  slack variable should be positive for constraints "<="

    Posted 11/10/11 01:18 PM

    Originally posted by: MichaelPoss


    Dear all,

    I am solving a LP with CPLEX 12.2 concert technology for JAVA.
    If I understood well, a slack variable for a constraint "c^t x <= b" should always be negative. Hence I don't understand how the following can happen.
    The following code

    IloRange test = cplex.addLe(lin,0);
    cplex.solve();
    System.out.println(test);
    System.out.println("last cut slack: "+cplex.getSlack(test));

    returns

    IloRange : -infinity <= 1.0*pi[0]28 + 1.0*pi[0]46 + 4.0*pi[3]22 + 4.0*pi[3]28 + 3.0*pi2228 + 1.0*pi2246 - 14.0*alpha <= 0.0
    last cut slack: -17.699452416918497

    Thanks in advance,

    Michael.
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: slack variable should be positive for constraints "<="

    Posted 11/10/11 01:20 PM

    Originally posted by: MichaelPoss


    > MichaelPoss wrote:
    > If I understood well, a slack variable for a constraint "c^t x <= b" should always be negative.

    I meant non-negative of course.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: slack variable should be positive for constraints "<="

    Posted 11/11/11 10:30 AM

    Originally posted by: SystemAdmin


    That indeed looks suspicious. What is the return value of cplex.solve()? Does it return true or false?
    Did you change any parameter settings? Is this the first solve you do on the model or did you do other solves before?
    What if you fetch the x vector from cplex and calculate the slack yourself?
    Could you show us the log output of CPLEX?
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: slack variable should be positive for constraints "<="

    Posted 11/14/11 12:05 PM

    Originally posted by: MichaelPoss


    Thank you for your answer.
    The output of cplex.solve() is FALSE.
    Then, cplex.isPrimalFeasible() also returns FALSE, while cplex.isDualFeasible() returns TRUE.
    Hence, I imagine that the "weird" slack values simply arise because the primal is not feasible, isn'it ?

    Michael.
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: slack variable should be positive for constraints "<="

    Posted 11/22/11 09:50 AM

    Originally posted by: SystemAdmin


    Indeed. If the solution is not primal feasible, then rows can be violated and slacks can be negative.

    So, the question is: why is CPLEX not able to solve this problem to optimality?

    Posting a log output could shed some light on this issue. Be sure to enclose the log output in "code" quotes.

    Tobias
    #CPLEXOptimizers
    #DecisionOptimization