Passing SoPlex parameters to SCIP - scip

I am using the SCIP solver in AMPL mode, with SoPlex as the LP solver. This is the pre-compiled version available at https://scipopt.org/index.php#download.
I am solving mixed integer programs (MIPs) and would like to tell SoPlex to use the dual simplex algorithm for the LP subproblems. To do this, should I just specify lp/initalgorithm = d and lp/resolvealgorithm = d in scip.set? Or is there some way to send settings to the SoPlex subproblem solver, along the lines shown here?

Setting the parameters as you suggested is exactly correct. That guarantees that SoPlex will start with the dual simplex every time (which it would almost certainly also do by default).

Related

CPLEX warm start with altered objective function coefficient

I am optimizing a MILP model in CPLEX (Python interface) that takes a long time to solve. Sometimes I need to do concurrent runs if my timelimit runs out. In order to continue optimizing with a solution from a previous, unfinished, run I usually provide the .sol file as a warm start.
Now I have a change in the objective function coefficients. The model's constraints and variables stay the same. Is it possible to provide a solution from the 'old', already optimized model to the model with the revised coefficients? Will CPLEX find the optimal solution of the new model faster than just starting fresh, regardless if it is is in the same 'range' as the old solution? And can I provide the .sol file for this as usual or should I use an .mst file?
On a related note, I am finding that when I use a previous solution as a warm start, CPLEX does use the best integer value found previously but often starts with a higher best bound. So the gap initially is higher than what previously has already been reached. Is there a method to overcome this, possibly speeding up the run?
you can warmstart with a .sol file but also with APIS
warm start through API in https://www.linkedin.com/pulse/making-optimization-simple-python-alex-fleischer/
from docplex.mp.model import Model
mdl = Model(name='buses')
nbbus40 = mdl.integer_var(name='nbBus40')
nbbus30 = mdl.integer_var(name='nbBus30')
mdl.add_constraint(nbbus40*40 + nbbus30*30 >= 300, 'kids')
mdl.minimize(nbbus40*500 + nbbus30*400)
warmstart=mdl.new_solution()
warmstart.add_var_value(nbbus40,8)
warmstart.add_var_value(nbbus30,0)
mdl.add_mip_start(warmstart)
sol=mdl.solve(log_output=True)
for v in mdl.iter_integer_vars():
print(v," = ",v.solution_value)
Sometimes warmstart helps, some times it does not. Fixed start helps too sometimes.(The search space is smaller so the search can be faster)
You say you are using ".sol" file as mip start, but there is a dedicated format for mip starts: MST format in ".mst" files. If you are using DOcplex, from a solution produced by Model.solve(), you can export a mst file using export_as_mst, which takes a WriteLevel argument.
This enumerated value controls what is written in the MST file: by default, only discrete values are used in the mip start, which avoids precision issues.
This is one of the reasons you should prefer MST format for mip starts.

Worhp: Local point of infeasibility

I have a problem that is solved successfully with ipopt and fmincon. worhp terminates on local infeasibility. My x0 (init) is feasible.
This may happen with the interior point algorithm, but I expect sqp to always stay in the feasible zone?
Maybe also check the derivatives with WORHP by enabling CheckValuesDF, CheckValuesDG, CheckValuesHM, CheckStructureDF, CheckStructureDG and CheckStructureHM if you provide them. What I am pointing at is that WORHP requires a very special coordinate storage format (in particular for the Hessian). Mistakes here lead to false search directions.
Due to the approximation error of the QP subproblem this is not something you can expect in general. Consider the problem
which will have the QP subproblems
for a current x and Lagrangian multiplier lambda, as can be seen by determining the necessary derivatives. With initial values x_0 = 0 and lambda_0 = 1 we have a feasible initial guess. The first QP to be solved is then
which has the unique solution d = 2. Now, depending on the implemented linesearch, the full step might be taken, i.e. the next iterate is x_1 = x_0 + d. That means x_1 = 2 which is not a feasible point anymore. In fact, WORHP's SQP algorithm will iterate like this if you disable the par.InitialLMest and eventually find the global optimum at x = 1.
Apart from this fundamental property there can also be other effects leading to iterates leaving the feasible set, that will very much be specific to the actual solver implementation. For example numerical inaccuracies, difficulties during the solution of a QP or certain recovery strategies. As to why your problem is not solved successfully using the SQP algorithm of WORHP, I am unable to say much without knowing anything about the problem itself.

Get variable results from failed run in neos using bonmin for a MINLP

I'm using the neos-server to solve a highly constrained MINLP, using the bonmin algorithm. Solving using either a Branch and Bound or the hybrid method. The input code is AMPL
I want to know if it's possible to output variable results for a failed run?
I've tried just about every bonmin option listed here
https://projects.coin-or.org/Bonmin/browser/stable/1.7/Bonmin/doc/BONMIN_UsersManual.pdf?format=raw
I don't know enough about optimization solvers to really understand all of these options.
I've tried different AMPL options but these only work if I have a successful run.
Ultimately, I want to output all the variables in my model with the values from the latest failed run.
This is my commands file
options bonmin_options "bonmin.bb_log_level 4 \
bonmin.algorithm B-BB print_level 6";
solve;
option display_precision 10;
display solve_result_num, solve_result;
display cost.result;
display _varname, _var;
Below is a the header output from a failed run. This provides outputs for all my variables but they are all 0
Solver : minco:Bonmin:AMPL
Start : 2017-08-30 11:20:12
End : 2017-08-30 11:26:34
Host : NEOS HTCondor Pool
Disclaimer:
This information is provided without any express or
implied warranty. In particular, there is no warranty
of any kind concerning the fitness of this
information for any particular purpose.
*************************************************************
File exists
You are using the solver bonmin-ampl.
Executing AMPL.
processing data.
processing commands.
Executing on prod-exec-1.neos-server.org
Presolve eliminates 20629 constraints and 18794 variables.
Substitution eliminates 8664 variables.
Adjusted problem:
12175 variables:
7093 nonlinear variables
5082 linear variables
10647 constraints; 63680 nonzeros
2553 nonlinear constraints
8094 linear constraints
8084 equality constraints
2563 inequality constraints
1 linear objective; 17 nonzeros.
Setting $presolve_fixeps >= 1.41e-14 could change presolve results.
Bonmin 1.8.4 using Cbc 2.9.6 and Ipopt 3.12.4
bonmin: bonmin.bb_log_level 4
bonmin.algorithm B-BB
print_level 6
Start reading options from stream.
Finished reading options from file.
Cbc3007W No integer variables - nothing to do
******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear optimization.
Ipopt is released as open source code under the Eclipse Public License (EPL).
For more information visit http://projects.coin-or.org/Ipopt
******************************************************************************
NLP0012I
Num Status Obj It time Location
NLP0014I 1 INFEAS 2.2729823 1144 178.86781
NLP0014I 2 INFEAS 2.2729823 1144 176.90811
Cbc3007W No integer variables - nothing to do
Cbc0006I The LP relaxation is infeasible or too expensive
"Finished"
bonmin: Infeasible problem
solve_result_num = 220
solve_result = infeasible
cost.result = infeasible

Solving one-zero linear programming

I have a model about one-zero linear programming, when I use AMPL, I declare variables as binary type, but when I solved it, my results have many numbers not is 0,1.
var X{1..7,1..21,1..4} binary;
I think the type of variable: integer, binary not doing in AMPL
When I solved it, my results such as: X[1,5,6]=0.55555.
You should use a mixed-integer programming solver such as CPLEX or Gurobi to get an integer solution. The default AMPL solver is MINOS which relaxes integrality and issues a warning such as:
MINOS 5.51: ignoring integrality of 10 variables

Solving a Mixed Integer Quadratic Program using SCIP

I have a mixed integer quadratic program (MIQP) which I would like to solve using SCIP. The program is in the form such that on fixing the integer variables, the problem turns out to be a linear program. And on fixing the the continuous variables it becomes a Integer Program. A simple example :
max. \Sigma_{i} n_i * f_i(x_i)
such that.
n_1 * x_1 + n2 * x_2 < t
n_3 * x_1 + n2 * x_2 < m
.
.
many random quadratic constraints in n_i's and x_i's
so on
Here f_i is a concave piecewise linear function.
x_i's are continuous variables ( they take real values )
n_i's are integer variables
I am able to solve the problem using SCIP. But on problems with a large number of variables SCIP takes a lot of time to find the solution. I have particularly noticed that it does not find many primal solutions. Thus the rate at which the upper bound reduces is very slow. However, I could get better results by doing set heuristics emphasis aggressive.
It would be great if anyone can guide me on the following questions :
1) Is there any particular algorithm/ Software package which solves problems that fit perfectly into the model as described above ?
2) Suggestions on how to improve the rate at which primal solutions are found.
3) What type of branching can I use to get better results ?
4) Any guidance on improving performance would be really helpful.
I am okay with relaxing the integer constraints as well.
Thanks
1) The algorithm in SCIP should fit your problem. There are other software packages that implement similar algorithms, e.g., BARON and ANTIGONE.
2) Have a look which primal heuristics were successful in your run and change their parameters to run them more frequently.
3) No idea. Default should be ok.
4) Make sure that your variables have good bounds. Tighter bounds allow for a tighter relaxation to be constructed.
If you can post an instance of your problem somewhere, or a log of a SCIP run, including the detailed statistics at the end, maybe someone can give more hints on what to improve.