IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • 7 replies
  • Latest Post - ‏2012-12-14T13:40:52Z by SystemAdmin
SystemAdmin
SystemAdmin
7929 Posts

Pinned topic Difference about getIIS and refineConflict

‏2012-12-12T08:36:24Z |
Hi everyone,
I'm using cplex to solve a linear programming problem. Since the time of invoking getIIS is long when the size of the problem is large, I try to use refineConflict method
to find the minimal conflict instead. But the result of invoking getIIS and refineConflict is different. Below is the result of a unsatisfiable linear programming problem.

The result of invoking getIIS
:IloRange 3_4 : 0.0 <= (-1.0*water_t_4 + 1.0*water_v_1_4) <= infinity
IloRange 3_4 : 5.0 <= (2.0*water_t_4 + 1.0*water_v_2_4) <= infinity
IloRange 4_5 : 0.0 <= (-1.0*water_v_2_4 - 1.0*water_t_5 + 1.0*water_v_2_5) <= infinity
IloRange 4_5 : 2.0 <= (1.0*water_v_1_4) <= 2.0
IloRange 5_6 : 0.0 <= (1.0*water_v_2_5) <= 0.0

The result of invoking refineConflict(the first parameter is the whole linear constraints and the second is a array in which the member is set to 1) .
Possible : IloRange 4_5 : 2.0 <= (1.0*water_v_1_4) <= 2.0
Possible : IloRange 5_6 : 0.0 <= (1.0*water_v_2_5) <= 0.0

I feel confused about the results given by the two methods.
Thanks for your help.
Updated on 2012-12-14T13:40:52Z at 2012-12-14T13:40:52Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: Difference about getIIS and refineConflict

    ‏2012-12-13T08:47:59Z  
    Hi Friend
    Can you give me your input linear infeasible CSP ?
    Thanks
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: Difference about getIIS and refineConflict

    ‏2012-12-13T13:37:22Z  
    Hi Friend
    Can you give me your input linear infeasible CSP ?
    Thanks
    > SF1U_mohammed_bekkouche wrote:
    > Hi Friend
    > Can you give me your input linear infeasible CSP ?
    > Thanks
    The version of my cplex is cplex125 and I invoke it through java api.
    Below is the infeasible linear constraints:
    IloRange 0_1 : 0.0 <= (-1.0*water_t_1 + 1.0*water_v_1_1) <= infinity
    IloRange 0_1 : -infinity <= (-1.0*water_t_1 + 1.0*water_v_1_1) <= 0.0
    IloRange 0_1 : 1.0 <= (-1.0*water_t_1 + 1.0*water_v_2_1) <= infinity
    IloRange 0_1 : -infinity <= (-1.0*water_t_1 + 1.0*water_v_2_1) <= 1.0
    IloRange 1 : -infinity <= (1.0*water_v_2_1) <= 10.0
    IloRange 1_2 : 0.0 <= (-1.0*water_t_2 + 1.0*water_v_1_2) <= infinity
    IloRange 1_2 : -infinity <= (-1.0*water_t_2 + 1.0*water_v_1_2) <= 0.0
    IloRange 1_2 : 10.0 <= (-1.0*water_t_2 + 1.0*water_v_2_2) <= infinity
    IloRange 1_2 : -infinity <= (-1.0*water_t_2 + 1.0*water_v_2_2) <= 10.0
    IloRange 2 : -infinity <= (1.0*water_v_1_2) <= 2.0
    IloRange 1_2 : 10.0 <= (1.0*water_v_2_1) <= 10.0
    IloRange 2_3 : 2.0 <= (-1.0*water_t_3 + 1.0*water_v_1_3) <= infinity
    IloRange 2_3 : -infinity <= (-1.0*water_t_3 + 1.0*water_v_1_3) <= 2.0
    IloRange 2_3 : 0.0 <= (-1.0*water_v_2_2 + 2.0*water_t_3 + 1.0*water_v_2_3) <= infinity
    IloRange 2_3 : -infinity <= (-1.0*water_v_2_2 + 2.0*water_t_3 + 1.0*water_v_2_3) <= 0.0
    IloRange 3 : 5.0 <= (1.0*water_v_2_3) <= infinity
    IloRange 2_3 : 5.0 <= (1.0*water_v_2_2) <= infinity
    IloRange 2_3 : 2.0 <= (1.0*water_v_1_2) <= 2.0
    IloRange 3_4 : 0.0 <= (-1.0*water_t_4 + 1.0*water_v_1_4) <= infinity
    IloRange 3_4 : -infinity <= (-1.0*water_t_4 + 1.0*water_v_1_4) <= 0.0
    IloRange 3_4 : 5.0 <= (2.0*water_t_4 + 1.0*water_v_2_4) <= infinity
    IloRange 3_4 : -infinity <= (2.0*water_t_4 + 1.0*water_v_2_4) <= 5.0
    IloRange 4 : -infinity <= (1.0*water_v_1_4) <= 2.0
    IloRange 3_4 : 5.0 <= (1.0*water_v_2_3) <= 5.0
    IloRange 4_5 : 2.0 <= (-1.0*water_t_5 + 1.0*water_v_1_5) <= infinity
    IloRange 4_5 : -infinity <= (-1.0*water_t_5 + 1.0*water_v_1_5) <= 2.0
    IloRange 4_5 : 0.0 <= (-1.0*water_v_2_4 - 1.0*water_t_5 + 1.0*water_v_2_5) <= infinity
    IloRange 4_5 : -infinity <= (-1.0*water_v_2_4 - 1.0*water_t_5 + 1.0*water_v_2_5) <= 0.0
    IloRange 5 : -infinity <= (1.0*water_v_2_5) <= 10.0
    IloRange 4_5 : -infinity <= (1.0*water_v_2_4) <= 10.0
    IloRange 4_5 : 2.0 <= (1.0*water_v_1_4) <= 2.0
    IloRange 5_6 : 0.0 <= (-1.0*water_v_1_5 + 1.0*water_v_1_6) <= infinity
    IloRange 5_6 : -infinity <= (-1.0*water_v_1_5 + 1.0*water_v_1_6) <= 0.0
    IloRange 5_6 : 0.0 <= (1.0*water_v_2_6) <= infinity
    IloRange 5_6 : -infinity <= (1.0*water_v_2_6) <= 0.0
    IloRange 5_6 : 0.0 <= (1.0*water_v_2_5) <= 0.0
    Here is my code:
    
    cplex=
    
    new IloCplex(); cplex.setParam(IloCplex.IntParam.Threads,1); cplex.setParam(IloCplex.IntParam.RootAlg, IloCplex.Algorithm.Concurrent); cplex.addRangel()... 
    
    if(!cplex.solve)
    { IloConstraint[] arr is the whole linear constraints 
    
    double prefs[] = 
    
    new 
    
    double[arr.length]; Arrays.fill(prefs, 1); 
    
    if(cplex.refineConflict(arr, prefs))
    { ConflictStatus[] conflicts = cplex.getConflict(arr); 
    
    for (
    
    int i1 = 0; i1 < conflicts.length;i1++ )
    { 
    
    if(conflicts[i1]== ConflictStatus.Member) System.out.println(
    " Proved : " + arr[i1]); 
    
    else 
    
    if (conflicts[i1]==ConflictStatus.PossibleMember) System.out.println(
    " Possible : " + arr[i1]); 
    } 
    } 
    }
    
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: Difference about getIIS and refineConflict

    ‏2012-12-13T13:43:32Z  
    The version of my cplex is the latest version and I invoke it through java api.
    How can I set IISInd flag to 1? Does there exists some way to make getIIS quicker?
    I found the time of getIIS is still long when I use a hot model and the number of modified constraints is very small.
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: Difference about getIIS and refineConflict

    ‏2012-12-13T15:43:55Z  
    > SF1U_mohammed_bekkouche wrote:
    > Hi Friend
    > Can you give me your input linear infeasible CSP ?
    > Thanks
    The version of my cplex is cplex125 and I invoke it through java api.
    Below is the infeasible linear constraints:
    IloRange 0_1 : 0.0 <= (-1.0*water_t_1 + 1.0*water_v_1_1) <= infinity
    IloRange 0_1 : -infinity <= (-1.0*water_t_1 + 1.0*water_v_1_1) <= 0.0
    IloRange 0_1 : 1.0 <= (-1.0*water_t_1 + 1.0*water_v_2_1) <= infinity
    IloRange 0_1 : -infinity <= (-1.0*water_t_1 + 1.0*water_v_2_1) <= 1.0
    IloRange 1 : -infinity <= (1.0*water_v_2_1) <= 10.0
    IloRange 1_2 : 0.0 <= (-1.0*water_t_2 + 1.0*water_v_1_2) <= infinity
    IloRange 1_2 : -infinity <= (-1.0*water_t_2 + 1.0*water_v_1_2) <= 0.0
    IloRange 1_2 : 10.0 <= (-1.0*water_t_2 + 1.0*water_v_2_2) <= infinity
    IloRange 1_2 : -infinity <= (-1.0*water_t_2 + 1.0*water_v_2_2) <= 10.0
    IloRange 2 : -infinity <= (1.0*water_v_1_2) <= 2.0
    IloRange 1_2 : 10.0 <= (1.0*water_v_2_1) <= 10.0
    IloRange 2_3 : 2.0 <= (-1.0*water_t_3 + 1.0*water_v_1_3) <= infinity
    IloRange 2_3 : -infinity <= (-1.0*water_t_3 + 1.0*water_v_1_3) <= 2.0
    IloRange 2_3 : 0.0 <= (-1.0*water_v_2_2 + 2.0*water_t_3 + 1.0*water_v_2_3) <= infinity
    IloRange 2_3 : -infinity <= (-1.0*water_v_2_2 + 2.0*water_t_3 + 1.0*water_v_2_3) <= 0.0
    IloRange 3 : 5.0 <= (1.0*water_v_2_3) <= infinity
    IloRange 2_3 : 5.0 <= (1.0*water_v_2_2) <= infinity
    IloRange 2_3 : 2.0 <= (1.0*water_v_1_2) <= 2.0
    IloRange 3_4 : 0.0 <= (-1.0*water_t_4 + 1.0*water_v_1_4) <= infinity
    IloRange 3_4 : -infinity <= (-1.0*water_t_4 + 1.0*water_v_1_4) <= 0.0
    IloRange 3_4 : 5.0 <= (2.0*water_t_4 + 1.0*water_v_2_4) <= infinity
    IloRange 3_4 : -infinity <= (2.0*water_t_4 + 1.0*water_v_2_4) <= 5.0
    IloRange 4 : -infinity <= (1.0*water_v_1_4) <= 2.0
    IloRange 3_4 : 5.0 <= (1.0*water_v_2_3) <= 5.0
    IloRange 4_5 : 2.0 <= (-1.0*water_t_5 + 1.0*water_v_1_5) <= infinity
    IloRange 4_5 : -infinity <= (-1.0*water_t_5 + 1.0*water_v_1_5) <= 2.0
    IloRange 4_5 : 0.0 <= (-1.0*water_v_2_4 - 1.0*water_t_5 + 1.0*water_v_2_5) <= infinity
    IloRange 4_5 : -infinity <= (-1.0*water_v_2_4 - 1.0*water_t_5 + 1.0*water_v_2_5) <= 0.0
    IloRange 5 : -infinity <= (1.0*water_v_2_5) <= 10.0
    IloRange 4_5 : -infinity <= (1.0*water_v_2_4) <= 10.0
    IloRange 4_5 : 2.0 <= (1.0*water_v_1_4) <= 2.0
    IloRange 5_6 : 0.0 <= (-1.0*water_v_1_5 + 1.0*water_v_1_6) <= infinity
    IloRange 5_6 : -infinity <= (-1.0*water_v_1_5 + 1.0*water_v_1_6) <= 0.0
    IloRange 5_6 : 0.0 <= (1.0*water_v_2_6) <= infinity
    IloRange 5_6 : -infinity <= (1.0*water_v_2_6) <= 0.0
    IloRange 5_6 : 0.0 <= (1.0*water_v_2_5) <= 0.0
    Here is my code:
    <pre class="jive-pre"> cplex= new IloCplex(); cplex.setParam(IloCplex.IntParam.Threads,1); cplex.setParam(IloCplex.IntParam.RootAlg, IloCplex.Algorithm.Concurrent); cplex.addRangel()... if(!cplex.solve) { IloConstraint[] arr is the whole linear constraints double prefs[] = new double[arr.length]; Arrays.fill(prefs, 1); if(cplex.refineConflict(arr, prefs)) { ConflictStatus[] conflicts = cplex.getConflict(arr); for ( int i1 = 0; i1 < conflicts.length;i1++ ) { if(conflicts[i1]== ConflictStatus.Member) System.out.println( " Proved : " + arr[i1]); else if (conflicts[i1]==ConflictStatus.PossibleMember) System.out.println( " Possible : " + arr[i1]); } } } </pre>
    Did the conflict refiner run to completion or did it hit a time/node/memory limit? Could you show us the log file output of the conflict refiner?
    If the conflict refiner runs to completion then all constraints should be either 'Excluded' or 'Member'. There should be no 'PossibleMember' left.
    I think you also want to add the bounds of the variables to the constraints that are considered by the conflict refiner. See the reference documentation of IloNumVarBound and of IloCplex.upperBound(), IloCplex.lowerBound() and IloCplex.refineConflict() to learn how to do that.
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: Difference about getIIS and refineConflict

    ‏2012-12-14T01:55:14Z  
    Did the conflict refiner run to completion or did it hit a time/node/memory limit? Could you show us the log file output of the conflict refiner?
    If the conflict refiner runs to completion then all constraints should be either 'Excluded' or 'Member'. There should be no 'PossibleMember' left.
    I think you also want to add the bounds of the variables to the constraints that are considered by the conflict refiner. See the reference documentation of IloNumVarBound and of IloCplex.upperBound(), IloCplex.lowerBound() and IloCplex.refineConflict() to learn how to do that.
    I invoke cplex through java API and set no limitation. I don't know how to get the log file.
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: Difference about getIIS and refineConflict

    ‏2012-12-14T04:57:05Z  
    Did the conflict refiner run to completion or did it hit a time/node/memory limit? Could you show us the log file output of the conflict refiner?
    If the conflict refiner runs to completion then all constraints should be either 'Excluded' or 'Member'. There should be no 'PossibleMember' left.
    I think you also want to add the bounds of the variables to the constraints that are considered by the conflict refiner. See the reference documentation of IloNumVarBound and of IloCplex.upperBound(), IloCplex.lowerBound() and IloCplex.refineConflict() to learn how to do that.
    Below is the log cplex outputs when it solves the model.
    Bound infeasibility column 'water_t_5'.
    Presolve time = 0.00 sec. (0.01 ticks)
    
    Updated on 2014-03-24T22:43:38Z at 2014-03-24T22:43:38Z by iron-man
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: Difference about getIIS and refineConflict

    ‏2012-12-14T13:40:52Z  
    Did the conflict refiner run to completion or did it hit a time/node/memory limit? Could you show us the log file output of the conflict refiner?
    If the conflict refiner runs to completion then all constraints should be either 'Excluded' or 'Member'. There should be no 'PossibleMember' left.
    I think you also want to add the bounds of the variables to the constraints that are considered by the conflict refiner. See the reference documentation of IloNumVarBound and of IloCplex.upperBound(), IloCplex.lowerBound() and IloCplex.refineConflict() to learn how to do that.
    Thanks for your suggestion and I add the bound of the variable. Below is the invoking code:
    
    Iterator it=cplex.getModel().iterator(); 
    
    while(it.hasNext())
    { IloAddable adds=(IloAddable)it.next(); 
    
    if(adds 
    
    instanceof IloRange)
    { full.add((IloConstraint)adds); 
    } 
    
    else
    { IloNumVar var=(IloNumVar)adds; 
    
    if(var.getLB()>Double.NEGATIVE_INFINITY) full.add(cplex.lowerBound(var)); 
    
    if(var.getUB()<Double.POSITIVE_INFINITY) full.add(cplex.upperBound(var)); 
    } 
    } IloConstraint[] arr= (IloConstraint[])full.toArray(
    
    new IloConstraint[full.size()]); 
    
    double prefs[] = 
    
    new 
    
    double[arr.length]; Arrays.fill(prefs, 1); 
    
    if(cplex.refineConflict(arr, prefs))
    { System.out.println(
    "find confilicts successfully!"); ConflictStatus[] conflicts = cplex.getConflict(arr); 
    
    for (
    
    int i1 = 0; i1 < conflicts.length;i1++ )
    { 
    
    if (conflicts[i1]== ConflictStatus.Member) System.out.println(
    " Proved : " + arr[i1]); 
    
    else 
    
    if (conflicts[i1]==ConflictStatus.PossibleMember) System.out.println(
    " Possible : " + arr[i1]); 
    } 
    }