I'm looking for a solution to change the linear relaxation ran by Gurobi 7.02 at each node of a MIP.
I want to replace it with another relaxation I have already coded.
So what I want to do is to say "at each node, instead of running your usual linear relaxation, use mine." Does anyone has a clue do to so ?
Related
I am trying to solve a MIP problem in GAMS by using CPLEX Solver.
The nature of the problem is large which involves large number of constraints, variables and equation.
The model is successfully completed, however, it is not displaying any output result due to infeasible problem in some equations.
this is what I want from my model,
MODEL Stochastic /all/;
OPTION optcr=0;
OPTION mip=CPLEX;
SOLVE Stochastic using mip maximizing z1;
And this is what I got.
MIP status(119): integer infeasible or unbounded
Cplex Time: 0.00sec (det. 2.73 ticks)
Problem is integer infeasible.
No solution returned
I checked through the .lst file to know which equations are causing infeasibility and I found out many of them including infeasibility in my objective function.
I am not sure how can I remove infeasibility from my problem?
I would like to ask for suggestions and recommendations.
I have been to some online posts about the problem such as (https://www.researchgate.net/post/I-am-using-GAMS-in-MINLP-and-it-results-in-an-infeasible-solution-any-help), but it didn't helped though.
Note: I am using GAMS IDE version 24.
There is no general, easy solution for this problem. But since you use Cplex as your solver, you could try its IIS option (see https://www.gams.com/latest/docs/S_CPLEX.html#CPLEXiis) which can help to identify groups of conflicting constraints. That could give you at least a handle for a more detailed analysis of your problem.
I'm solving the VRP with Scip and want to choose the algorithm. In some of my instances, Scip solves the problem without the branch-and-bound tree in the root node; here I think cutting planes are executed. Cplex for example can choose prim Simplex or dual Simplex etc. to solve the Problem in this case.
Is there a possibility in Scip too? I use the parameters lp/initalgorithm=b (barrier) and lp/resolvealgorithm=b to make sure, in the branch-and-bound tree only this algorithm is used. But when Scip solves the problem in the root node, these parameters change nothing.
Thanks for your help!
So if I understand you correctly you want to always use barrier to solve the LP relaxations of your problem?
You need to make sure that the LP solver you are using supports this. If you use SoPlex as the LP solver in SCIP it does not have a barrier algorithm implemented and will fallback to solving with dual Simplex instead.
The LP solvers that support barrier are Cplex, Xpress, Gurobi, Mosek, and CLP
I want to just be sure that I am eligible to use Bonmin and Couenne for solving just the NLP problem (Still I do not have integer variable) and I am eager to obtain global optimum not local. I also read that Ipopt first search for the global answer and if it does not find that it will provide a local answer. How I can understand my answer is a global answer when I using Ipopt. Also, I want to what is the best NLP and MINLP open source pythonic solvers for these issues that can be merged with Pyomo?
The main reason for my question is the following output using Bonmin:
NOTE: You are using Ipopt by default with the MUMPS linear solver.
Other linear solvers might be more efficient (see Ipopt documentation).
Regards
Some notes:
(1) "Ipopt first search for the global answer and if it does not find that it will provide a local answer" This is probably not how I would phrase it. IPOPT finds local solutions. For some problems these will be the global solution. For convex problems, this is always the case (except for numerical issues).
(2) Bonmin is a local MINLP solver, Couenne is a global NLP/MINLP solver. Typically Bonmin can solve larger problems than Couenne, but you get local solutions.
(3) "NOTE: You are using Ipopt by default with the MUMPS linear solver. Other linear solvers might be more efficient (see Ipopt documentation)." This is just a notification that you are using IPOPT with linear algebra routines from MUMPS. There are other linear sub-solvers that IPOPT can use and that may perform better on large problems. Often the HARWELL routines (typically called MAnn) give better performance. MUMPS is free while the Harwell routines require a license.
In a follow-up answer (well it is not answer at all) it is stated:
Regarding Ipopt how I can understand that it is finding the global
solution or local optimum? the code will notify that? Regarding to
Bonmin according to AMPL page AMPL It provides the global solution for
the convex problem " Finds globally optimal solutions to convex
nonlinear problems in continuous and discrete variables, and may be
applied heuristically to nonconvex problems." And you were saying that
it is obtained the local solution, I am a bit confused on this part.
But the general question about all those codes is that how I can find
out that the answer is global optimum?
(a) Ipopt does not know if a solution is a local or a global optimal solution. For convex problems a local optimum is a global optimal solution. You will need to convince yourself the problem you pass on to Ipopt is convex (Ipopt will not do this for you).
(b) Bonmin: the same: if the problem is convex it will find global solutions. Otherwise you will get a local solution. You will get no notification whether a solution is a global solution: Bonmin does not know if a solution is a global optimum.
(c) When looking for guaranteed global solutions you can use a local solver only when the problem is convex. For other problems you need a global solver. Another approach is to use a multi-start algorithm with a local solver. That gives you confidence that you are not ending up with a bad local optimum.
If possible, I suggest to discuss this with your teacher. These concepts are important to understand (and most solver manuals assume you know about them).
As far as i know Gurobi resumes optimizing where it left after calling Model.Terminate() and then calling Model.Optimize() again. So I can terminate and get the best solution so far and then proceed.Now I want to do the same, but since I want to use parts of the suboptimal solution I need to set some variables to fixed values before I call Model.Optimize() again and optimize the rest of the model. How can i do this so that gurobi does not start all over again?
First, it sounds like you're describing a mixed-integer program (MIP); model modification is different for continuous optimization (linear programming, quadratic programming).
When you modify a MIP model, the tree information is no longer helpful. Instead, you must resolve the continuous (LP) relaxation and create a new branch-and-cut tree. However, the prior solution may still be used as a MIP start, which can reduce the solve time for the second model.
However, your method may be redundant with the RINS algorithm, which is an automatic feature of Gurobi MIP. You can control the behavior of RINS via the parameters RINS, SubMIPNodes and Heuristics.
I am using GAMS for solving a MILP problem which includes binary variables. However there is a problem in the solution. Surprisingly, I have seen that one of the binary variables in the solution has a found value of "-1" another one "2". That is not acceptable. I do not know what happened. GAMS gives me the message primal infeasible.