I've implemented my problem in IBM ILOG CPLEX Optimization Studio.
Now i would like to modify the objective function to be quadratic and solve the problem. However, it shows an Error 5002:objective is not convex.->problem can be solved to global optimality with solution target 3->.
I have read the user guide and manual and the different topics in stackoverflow, and I beleive version 12.8 can solve mixed-integer quadratic problems.
modify my objective from this
dexpr float overallcost[f in cars] = holdingTime[f];
to this
dexpr float overallcost[f in cars] = holdTime[f]*holdTime[f];
Error 5002:objective is not convex.->problem can be solved to global optimality with solution target 3->.
As suggested by the error message you should try setting the solution target parameter to 3 to force CPLEX to solve your model.
More details about this can be found in this chapter of the user manual and here is the documentation of the respective parameter.
To set this parameter in the IDE create/add a settings file to your project and then go to
Mathematical Programming -> General -> Type of solution to compute
and choose "Global optimal solution".
See
https://www.ibm.com/support/knowledgecenter/SSSA5P_12.9.0/ilog.odms.cplex.help/CPLEX/Parameters/topics/OptimalityTarget.html
In order to set that parameter in order to solve quadratic objectives.
In your model, you may add:
execute
{
cplex.optimalitytarget=3;
}
Related
I've recently moved to Gurobi and we use GAMS.
Have been struggling to implement Gurobi options, is there a way to use Gurobi options directly? With a file or something like that.
For instance, I want to use the following options and have not found a GAMS correspondence:
Scaleflag;
MIPFocus;
Thank you in advance,
I am conducting research on optimization using scipy library, and have a question regarding with default line search method implemented in this library. I would like to write a description of the optimization method including what kind of line search method was applied. I run the optimization code using default options (BFGS) with unconstrained nonlinear objective function. Anyone who knows if scipy minimize function uses wolfe line search as a default? Thanks in advance!
Looking at the source code reveals that they use the _line_search_wolfe12 function. So yes, it uses Wolfe line search.
I have been exploring LLVM Optimizations recently but have a small question:
How do we know that a built-in pass (not LLVM Passes that we write) can be applied at the function level (using a FunctionPassManager), or Module level, etc?
Example - As seen in the KaleidoScope tutorial 4:
TheFPM->add(createCFGSimplificationPass());
This one is fairly obvious that it should be at function level but what about other passes? Are they all meant to work at any level (BasicBlock, Function, Module, etc) correctly?
I think you can find that out by looking at the source code.
For example, here is code for SimplifyCFGPass which inherites FunctionPass and here is the source code for MemoryDependencyAnalysisPass and as you can see it's a function level pass.
I am solving a MIP in IBM ILOG CPLEX Optimization Studio. I would like to first generate a solution where the main decision variables need not be integers, which will then be used as a starting solution to solve the model where the decision variables should be integers.
What should I type in my .mod file to obtain this?
Thank you!
You will probably need to use a main() function to control the sequence of solves. This can be done either all in one .mod file or with the main() in a separate .mod file that controls the process of using/solving the others. This is described in the documentation. There are examples in the OPL samples folder; see mulprod or LangrangianRelaxation. Give it a go, and when you have something concrete that doesn't work, come back and ask again.
Does anyone know how to disable "presolve" in CPLEX? (without using Java, C++, etc.)
My CPLEX Version is 12.4, in case it makes a difference.
Thanks in advance,
Although the question was asked for OPL, it is also useful to know how to do this in Java/CPP/interactive optimizer.
Solution: set parameter preind to false
Java: IloCplex.Param.Preprocessing.Presolve E.g. java: cplex.setParam(IloCplex.BooleanParam.PreInd, false);
CPP: IloCplex::Param::Preprocessing::Presolve
C: CPXPARAM_Preprocessing_Presolve
.net: Cplex.Param.Preprocessing.Presolve
Iteractive optimizer: preprocessing presolve
See: http://www-01.ibm.com/support/knowledgecenter/SSSA5P_12.6.2/ilog.odms.cplex.help/CPLEX/Parameters/topics/PreInd.html
After trying to find how certain parameters can be changed in CPLEX, I have found the answer to my own question.
To change parameters (using CPLEX only) you don't need to type in any code. All you have to do is creating a "Settings" file within your project file.
You can follow these steps:
In the "OPL Projects" window right click and select "New->Settings"
Give a name to your settings file and click OK.
Change the parameters as you wish (to find the related setting you can type in the name of the parameter in the search bar, in my case it worked when i searched for "Preprocessing". From the menu that appeared I unchecked the box called "Presolve indicator")
Add the "Settings" file to your desired Run Configuration file to apply changes. In this case, CPLEX uses the parameters in your Settings file instead of the default values.
And that is all :)