It's not clear to me which API you are using -- "ilocplex" can mean a number of things -- but in broad terms that is the correct way to set a bound on a variable. For instance, if I am using Java and have an array IloNumVar[][] x, to change the upper bound of x[[0][3] to 0 I would use x[0][3].setUB(0). If x is declared as an integer variable, x[0][3].setMax(0) will also work.
Sticking with the Java API, to identify a source of infeasibility I would call one of the overloads of cplex.refineConflict() to get the solver to pin down a conflict, then one of the overloads of cplex.getConflict() to get conflict statuses for the constraints in which I was interested. Note that there is no guarantee, in general, that a single constraint is infeasible by itself. After selecting a constraint that is (or might be) a member of the conflict, I would either get the variables belonging to that constraint from a memory structure that I created when I built the model or iterate over the linear expression in the constraint (assuming the constraint is a linear constraint) to get a list of variables in it.
------------------------------
Paul Rubin
Professor Emeritus
Michigan State University
------------------------------
Original Message:
Sent: Mon March 22, 2021 05:32 PM
From: milena kafka
Subject: Dealing with the Infeasible Solution
Thank you so much Prof.Rubin, Yes, I get the answer, just to be sure about if I am fixing them correctly, isn't it this syntax correct in ilocplex, Variable.setLB=value; Variable.setUB=value? One last thing, do you know is there any way to detect the index of the variable in the infeasible row? In other words, I need to access to period number 3, to change the binary variables of period 3 to generate some feasible solutions? Now, I can see that row is infeasible by looking at the .lp file and reading the found infeasible row , i;e C34; but can I do that autmatically, or with the help of a code in ilocplex ? Thank you so much in advance
------------------------------
milena kafka
Original Message:
Sent: Mon March 22, 2021 11:19 AM
From: Paul Rubin
Subject: Dealing with the Infeasible Solution
If you fixed, for example, X_03 = 0 by setting its upper bound to 0, you can fix it at 1 by changing the upper bound back to 1 and also changing the lower bound to 1. The solver will then have to start fresh from the root node (after presolving). Does that answer your question?
------------------------------
Paul Rubin
Professor Emeritus
Michigan State University
Original Message:
Sent: Mon March 22, 2021 06:42 AM
From: milena kafka
Subject: Dealing with the Infeasible Solution
Thank you so much Prof.Rubin. Maybe I should explain what I am trying to do with a concrete example. Can I do something like this : I use the binary values obtained from the lower bound heuristic and fixed some of them to their values and I solve the original problem with these fixed values via cplex solver. When I solve the original model with cplex solver (with the fixed values), let's think , I get row c:34 is infeasible. Row C:34 includes the constraint X_03+X_13+X_23= 100, since I fix some binary variables in period 3, there is no remaining capacity to satisfy 100. Can I change the binary variable which is related to period 3 (y_3) from 1 to 0 ? If yes, how can I do that in IloCplex?
Thank you so much
------------------------------
milena kafka
Original Message:
Sent: Sun March 21, 2021 03:56 PM
From: Paul Rubin
Subject: Dealing with the Infeasible Solution
You are minimizing in the original problem, and your heuristic finds an infeasible solution that gives a valid lower bound? Without knowing specifics of the MIP model and the heuristic, I don't think there is any way to prescribe how to find a feasible solution based on the heuristic solution, other than by what would amount to full enumeration of all possible roundings of the heuristic solution. If you need a feasible solution to get the solver started, and if the solver cannot find one using its built-in heuristics, I suspect your best bet is to try a new heuristic/metaheuristic.
------------------------------
Paul Rubin
Professor Emeritus
Michigan State University
Original Message:
Sent: Sat March 20, 2021 06:38 PM
From: milena kafka
Subject: Dealing with the Infeasible Solution
Hello Everyone,
I need some ideas about how to overcome obtaining infeasible solutions. I apply an heuristic to obtain a lower bound for my MIP model. For upper bound, firstly I tried to fix the binary values to their values (coming from the heuristic.) However, I get infeasibility in the solution of original model. Is there any way to change the fixed value 1 to 0 when I get infeasibility or reoptimize these binary values in the solution of original model? For example the value x_ij is equal to 1 in the heuristic solution but it may get 0 as well in the upper bound model? How can I bring this flexibility ? (by benefiting from the dual solution)
Thank you so much
------------------------------
milena kafka
------------------------------
#DecisionOptimization