Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Relaxed solution

    Posted 03/16/16 03:25 AM

    Originally posted by: sandeepsinghchauhan


    How can i resolve relaxed solutions?


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Relaxed solution

    Posted 03/16/16 03:46 AM

    Hi,

    in the documentation

    IDE and OPL > CPLEX Studio IDE > IDE Tutorials

    you should have a look at

    Relaxing infeasible models

    Uses the nurses example to demonstrate how the IDE detects conflicts and searches for relaxations in OPL models that appear infeasible after execution.

    regards

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Relaxed solution

    Posted 08/28/16 03:52 PM

    Originally posted by: khadeejah


    I understood till this step http://www.ibm.com/support/knowledgecenter/en/SSSA5P_12.6.3/ilog.odms.ide.help/OPL_Studio/usroplide/topics/opl_ide_relax_work_suggrelax.html

    but i dont understand why in the data the change happened to the fifth nimber in the first row in the array!!!? i dont get this part


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Relaxed solution

    Posted 09/06/16 06:20 AM

    Originally posted by: Rajasekhar_Kadambur


    Check the note:

     

    Important:

    Be aware, however, that infeasibility may be the consequence of an error in the modeling of another constraint.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Relaxed solution

    Posted 11/19/19 11:59 PM

    Originally posted by: Mathsg


    Hi Alex, 

    I am getting conflicts and relaxation in two constraints of my opl project. i have tried to fix them but i am unable to locate them. i am new to the cplex and are not much familiar with, how to fix the conflicts among different constraints. Kindly help me fix/locate them. I am looking forward to hearing from the team of IBM and my seniors. attached are the files of my conflicts and relaxation window and also i have attached my .data files. thank you


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: Relaxed solution

    Posted 11/20/19 03:52 AM

    Hi

    if you write

    range rf=0..card(flows)-1;

    and then turn constraint1 into

    forall(ir in rf, u in nodes: u==item(flows,ir).src[u])
          Const1:
          sum(v in nodes)(k[item(flows,ir)][u][v]-k[item(flows,ir)][v][u])>=10;

    you ll get a relaxation message that will be easier to understand

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: Relaxed solution

    Posted 11/20/19 04:14 AM

    Originally posted by: Mathsg


    Hi Alex,

    Thank you very much for your prompt response but actually my formulation is like that what i have written in code. the same formulation is working in GLPK but it showes me conflicts in OPL studio of CPLEX. i dont quites getting your points that why should i wrote the code like this. i need your kind advice. Attached are the constraint of my ILP formulation. Kindly have a look and please fix the problems of my conflicts and relaxation. thank you


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 8.  Re: Relaxed solution

    Posted 11/20/19 08:55 AM

    Hi,

    if you simplify your model into


    int nbnodes = ...; //number of nodes
    range nodes = 1..nbnodes;


    int totallc = ...; //total number of linecards (LC)
    int LC_Cost = ...; // Set of Cost of each LC
    int LC_Capacties = ...;  // Set of capacties of each LC
    range r_lc = 1..totallc;
    range rcapacties_lc = 1..LC_Capacties;
    range rcost_lc = 1..LC_Cost;

    tuple lincard{ // Tuple of LCs
      int j_lc[r_lc];
      int k_lc[rcapacties_lc]; //store the set of lC with different capacties [40,100,400]
      int costtype_lc[rcost_lc]; //store the set of lC with different Cost[1,2,4]
    }
    {lincard} Lincards = ...; //Take data from outside fo tuples

    int totalec = ...; //Total number of encryptoion card EC
    int EC_Cost = ...;  
    int EC_Capacties = ...;
    range r_ec = 1..totalec; //store the set of lC with different Cost[1,2,4]
    range rcapacties_ec = 1..EC_Capacties;
    range rcost_ec = 1..EC_Cost;

    tuple eccard{ // Tuple of ECs
      int j_ec[r_ec];
      int k_ec[rcapacties_ec]; //store the set of EC with different capacties [40,100,400]
      int costtype_ec[rcost_ec];  //store the set of EC with different Cost[1,2,4]
    }  
    {eccard} ECcards = ...; // Tuple of ECs

    int nmbr_routes = ...; // total number of routes
    range routes = 1..nmbr_routes;
    int nmberflow = ...; //total number of flows in netwrk
    range rflow = 1..nmberflow;
    //{string} flowtypes = {"Hi"}; //types of flow e.g., important flows and non important

    tuple flow{ //tupel for flows
    //key int id;
    int flow_bw[rflow];
    //string flowtype;
    int src[nodes];
    int dest[nodes];
    }
    {flow} flows = ...;

    int hope_count[routes][nodes][nodes] = ...; //hope count between nodes
    float Duals[nodes] = ...;
    int link [nodes][nodes] = ...;
    dvar boolean lemda[flows][routes][nodes][nodes]; //the boolean variable that equals 1 if flow ri routed over jth lightpaths

    dvar boolean k[nodes][nodes];

    flow f=first(flows);

     


    subject to{

        
    forall( u in nodes: u==f.src[u] )
          Const1:
          sum(v in nodes)(k[u][v]-k[v][u])==1;

    forall( u in nodes: u!=f.src[u] && u!=f.dest[u]  )
          Const3:
          sum(v in nodes)(k[u][v]-k[v][u])==0;

    and generate the lp file you will get an infeasible model but also

     

    Subject To
     Const1(2): k(2)(1) - k(1)(2) + k(2)(3) - k(3)(2) + k(2)(4) - k(4)(2) + k(2)(5)
                - k(5)(2) + k(2)(6) - k(6)(2)  = 1
     Const3(1): - k(2)(1) + k(1)(2) + k(1)(3) - k(3)(1) + k(1)(4) - k(4)(1)
                + k(1)(5) - k(5)(1) + k(1)(6) - k(6)(1)  = 0
     Const3(3): - k(2)(3) + k(3)(2) - k(1)(3) + k(3)(1) + k(3)(4) - k(4)(3)
                + k(3)(5) - k(5)(3) + k(3)(6) - k(6)(3)  = 0
     Const3(4): - k(2)(4) + k(4)(2) - k(1)(4) + k(4)(1) - k(3)(4) + k(4)(3)
                + k(4)(5) - k(5)(4) + k(4)(6) - k(6)(4)  = 0
     Const3(5): - k(2)(5) + k(5)(2) - k(1)(5) + k(5)(1) - k(3)(5) + k(5)(3)
                - k(4)(5) + k(5)(4) + k(5)(6) - k(6)(5)  = 0
     Const3(6): - k(2)(6) + k(6)(2) - k(1)(6) + k(6)(1) - k(3)(6) + k(6)(3)
                - k(4)(6) + k(6)(4) - k(5)(6) + k(6)(5)  = 0

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer