Given some minimisation ILP or MILP defined in CPLEX using Concert in C#, I wish to find a lower and upper bound to the model. The lower bound can, of course, be found by solving the linear relaxation (ignore integrality constraints).
The upper bound can be found by running a heuristic. CPLEX has three generalpurpose MIP heuristics that I know of: Node heuristic, RINS heuristic, and Solution polishing. There are parameters in CPLEX for how often to run these heuristic, i.e. every I am having some difficulty just getting an upper and lower bound. Even if I set the What is the process for obtaining these values in CPLEX using Concert in C#? Thank you. asked 05 Aug '15, 00:02 Ozzah 
When you solve the problem as a MIP with root node bound equal to 0, CPLEX will solve the LP and apply cuts. Although you can disable all these cuts, the easiest way is to replace all integer variables by continues variables. To do this without rewriting your model, I recommend using the IloConversion class. This class allows you to temporarily 'override' the definitions of your variables. CPLEX will not apply any cuts when all variables are continues. As a result, you'll solve a pure LP. Note however that, depending on the size of your problem, just solving an LP may be expensive. Assuming that your problem is a minimization problem, then the upper bound is simply a feasible solution to your problem. Note however that, the decision problem "does there exist at least one feasible solution to my problem" may already be a very hard problem. In fact, this can be as hard as solving your problem to optimality. Furthermore, for certain optimization problems, Mixed Integer Programming is great for calculating bounds, but not particularly good in producing feasible solutions. In contrast, Constraint Programming often produces good primal feasible solutions, but struggles in providing strong bounds on these solutions. So in summary, without knowing what you try to solve, it is rather difficult to make good suggestions. answered 05 Aug '15, 13:50 Joris Kinable The Conversion method works well to find the LB via linear relaxation. I haven't found any way to enumerate all variables in the model, so I have to keep track of them manually in code. Is there a better way? As for the UB, yes I know it can be just as hard as finding an optimal solution. In most practical cases, however, a feasible solution can be found somewhat quickly, at least by my experience. Is there any way to invoke Node Select or RINS Heuristic manually? Right now I just set
(07 Aug '15, 09:25)
Ozzah
You can iterate over the variables, but it's a bit inefficient. See Paul's blog post for details: http://orinanobworld.blogspot.com/2010/08/iteratingovercplexmodelsequel.html Easier to keep track of your variables. I usually do something like this: Map<edge, ilointvar=""> vars=new LinkedHashMap<>(); ... IntVar[] varsArray=vars.values().toArray(new IloIntVar[vars.size()]); double[] values=cplex.getValues(varsArray); List<edge> usedEdges=new ArrayList<>(); int index=0; for(Edge e : vars.keySet()){
}
(07 Aug '15, 18:34)
Joris Kinable
Thanks, I saw that blog post already but the C# API doesn't seem to expose an
(09 Aug '15, 19:05)
Ozzah
