Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Relaxation issue in cplex when infeasible solution exists

    Posted Wed March 23, 2022 09:12 AM
    Hello everyone, 
    When I solve my MIP model by cplex solver, I face a behaviour that I can not understand. When the instances are ran by opl flow control, in .dat file I write "Files={"Ins_1.dat","Ins_2.dat","Ins_3.dat","Ins_4.dat","Ins_5.dat"}; and cplex produce "No solution for each. When I test the instances one by one, cplex says that :Row 'const3(1)' infeasible, all entries at implied bounds for any instance and it relaxes some constraints and goes on to solve the problem instead of stopping as it did in flow control. My first question: "why it happens when I test the instances one by one and why it does not relax the model when they are tested successively in flow control ? 

    Second question (which disturbs me  a lot). When the model is relaxed in the second (one by one version) it relaxes s variable to the negativity, which must not be the case. The sum of the s[d][a] must be 1. and we define it as dvar float s[t][l] in 0..1. How it can relax it and solve the problem when s[d][a]=-1,2.. ou -4 . I do not understand what is happening and how can I get rid of it ? 

    forall(a in t)
    {
    const1: sum(d in t:d<=a)s[d][a]==1.0;
    }

    forall(a in t)
    {
    const3: (( sum(d in t:d>=a )s[a][d]*D[d])) <=cap[a];
    }

    Thank you in adcance.

    ------------------------------
    milena kafka
    ------------------------------

    #DecisionOptimization


  • 2.  RE: Relaxation issue in cplex when infeasible solution exists

    Posted Wed March 23, 2022 11:24 AM
    How do you test the instances individually? If you are using FeasOpt, it will find a "minimum cost" relaxation of constraints (and bounds) to make the model feasible, which sounds like what is happening.

    ------------------------------
    Paul Rubin
    Professor Emeritus
    Michigan State University
    ------------------------------



  • 3.  RE: Relaxation issue in cplex when infeasible solution exists

    Posted Wed March 23, 2022 11:44 AM
    Thank you so much Prof.Rubin, 
    No, I do not use FeasOpt, I mean , I guess.. because I do not do anything in the model itself to use Feasopt. Basically, the .mod file is as follows:
    // I define variables here
    // the objective function 
    // constraints 
    But maybe in the settings I changed something to use FeasOpt without being aware of it ?
    Can I check it somewhere in the settings ? Otherwise there is nothing in the code to use Feasopt.
    Thank you so much

    ------------------------------
    milena kafka
    ------------------------------



  • 4.  RE: Relaxation issue in cplex when infeasible solution exists

    Posted Wed March 23, 2022 11:54 AM
    I'm not an OPL user, but I am pretty sure that FeasOpt would be a different command than the usual command to solve a model. On the other hand, I cannot think of any reason why CPLEX would relax constraints or bounds other than by being explicitly told to.

    By the way, I noticed that the order of subscripts of s[][] in constraint 3 was the reverse of the order in constraint 1. That was deliberate, yes?

    ------------------------------
    Paul Rubin
    Professor Emeritus
    Michigan State University
    ------------------------------



  • 5.  RE: Relaxation issue in cplex when infeasible solution exists

    Posted Wed March 23, 2022 12:17 PM
    Thank you so much Prof. Rubin. Yes, that was deliberate and you made me think that can cause this problem. Let me check the model and try to remodel it. Thank you drawing my attention to that part.

    ------------------------------
    milena kafka
    ------------------------------



  • 6.  RE: Relaxation issue in cplex when infeasible solution exists

    Posted Fri March 25, 2022 06:50 AM
    Indeed, launching a single model within the ide triggers the feasopt algorithm automatically while running in a main control will by default call the cplex.solve that stops if the model is infeasible
    The way feasopt handle infeasibillities is by default having all variables  and named constraints candidates for relaxations. This is something you can configure (in a setting file or through opl script in your code)
    If you want to handle relaxations and repair within a flow control, you should have a look at examples in the distribution or also check the https://www.linkedin.com/pulse/how-opl-alex-fleischer/

    David

    ------------------------------
    David Gravot
    ------------------------------