Giter VIP home page Giter VIP logo

shot's Introduction

CMake License

The Supporting Hyperplane Optimization Toolkit

SHOT is a software for solving mathematical optimization problems of the mixed-integer nonlinear programming (MINLP) class. In addition to MINLP problems, SHOT can also be used for subclasses such as NLP and MI(QC)QP.

Originally SHOT was intended for convex MINLP problems only, but as of version 1.0 it also has functionality to solve nonconvex MINLP problems as a heuristic method without providing any guarantees of global optimality. SHOT can solve certain nonconvex problem types to global optimality as well, and the bounds for the objective function value are guaranteed for nonconvex problems as well.

SHOT can be used

SHOT requires a MILP solver: Cplex, Gurobi or Cbc. In addition an NLP solver is required; currently only Ipopt is supported. If SHOT is interfaced with GAMS, any licensed NLP solver can be used.

The documentation is provided at the project website at https://www.shotsolver.dev.

SHOT is a COIN-OR project, and won the COIN-OR Cup 2018. Project manager is Andreas Lundell. A full list of contributors is available on the project website.

Dual bound through polyhedral (outer) approximation

SHOT is based on iteratively creating a tighter polyhedral approximation of the nonlinear feasible set by generating supporting hyperplanes or cutting planes. These linearized problems are then solved with an mixed-integer linear programming (MILP) solver such as CPLEX, Gurobi or Cbc. If CPLEX or Gurobi is used, the subproblems can also include quadratic and bilinear nonlinearities directly; then MIQP or MIQCQP subproblems are solved.

Primal bound using heuristics

The solution to the outer approximation problem provides a lower (dual) bound (when solving a minimization problem) to the original problem if the problem is convex. If the problem is nonconvex, convergence to the global optimal solution cannot be guaranteed (but might be achieved for certain classes of problems, cf. this paper.

To get an upper (primal) bound (when solving a minimization problem) on the optimal solution SHOT utilizes the following heuristics:

  • Solving nonlinear programming (NLP) problems where the integer variables have been fixed to valid values. This is done by calling an external NLP solver (e.g. Ipopt).
  • By checking solutions from the MIP solver's solution pool for points that fulfill also the nonlinearities in the original MINLP problem.
  • By performing root searches.

Termination

When the relative or absolute difference (objective gap) between the primal and dual bounds is less than a user-specified value, SHOT terminates with the current primal solution. If the original problem is convex, this is a global solution to the problem. If it is nonconvex, there is normally no guarantee that such a solution can be found, however SHOT will always in addition to the primal solution give a valid lower bound on the solution.

Compilation instructions

Instructions for compiling SHOT is available at the project website.

Solver manual

Instructions for how to use SHOT, e.g. call it from different environments, are provided on the project website.

Publications

SHOT is best described in the paper:

Lundell, A. Kronqvist, J. and Westerlund, T. The supporting hyperplane optimization toolkit for convex MINLP. Journal of Global Optimization (2022). https://link.springer.com/article/10.1007/s10898-022-01128-0

The features for solving nonconvex MINLP problems are described in the papers:

Lundell, A. and Kronqvist, J., Polyhedral approximation strategies for nonconvex mixed-integer nonlinear programming in SHOT. Journal of Global Optimization (2021). https://doi.org/10.1007/s10898-021-01006-1

Lundell, A. and Kronqvist, J. On Solving Nonconvex MINLP Problems with SHOT (2019). In: Le Thi H., Le H., Pham Dinh T. (editors) Optimization of Complex Systems: Theory, Models, Algorithms and Applications. WCGO 2019. Advances in Intelligent Systems and Computing, vol 991. Springer, Cham.

shot's People

Contributors

andreaslundell avatar giordano avatar mapgccv avatar maxemiliang avatar odow avatar svigerske avatar torressa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shot's Issues

Constants in objective is not passed on from CoinModel to OsiClpSolverInterface

A constant to the coinModel object at

coinModel->setObjectiveOffset(-constant);

does not seem to get passed on to the osiInterface object at

osiInterface->loadFromCoinModel(*coinModel);

I am unsure if this is a bug, or that the OsiClpSolverInterface class does not support constants in the objective (I cannot seem to find a way to manually set a constant in the OsiClpSolverInterface class).

I can work around this by manually adding the constant here and there in the MIPSolverCbc class, but if there is an easier way I would prefer it... Any suggestions @svigerske?

building SHOT with CMAKE and MSVC

Hello
I am trying to build SHOT with CMAKE GUI and MSVC
First I build CBC and the dependencies, brought a compiled version of IPOPT (MSVC 2019)
in CMAKE GUI I get the following errors

Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.19042.
CMake Error at CMakeLists.txt:88 (file):
file FILE([TO_CMAKE_PATH|TO_NATIVE_PATH] path result) must be called with
exactly three arguments.

CMake Error at CMakeLists.txt:89 (file):
file FILE([TO_CMAKE_PATH|TO_NATIVE_PATH] path result) must be called with
exactly three arguments.

Git hash: n/a
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Searching for Cbc libraries and its dependencies, e.g. in C:\MINLP\CBC/lib/
Cbc library found at: C:/MINLP/CBC/MSVisualStudio/v16/x64/Debug/libCbc.lib
CbcSolver library found at: C:/MINLP/CBC/MSVisualStudio/v16/x64/Debug/libCbcSolver.lib
OsiClp library found at: C:/MINLP/CBC/MSVisualStudio/v16/x64/Debug/libOsiClp.lib
Clp library found at: C:/MINLP/CLP/MSVisualStudio/v16/x64/Debug/libClp.lib
Osi library found at: C:/MINLP/CBC/MSVisualStudio/v16/x64/Debug/libOsi.lib
CoinUtils library found at: C:/MINLP/COINUTILS/MSVisualStudio/v16/libCoinUtils/x64/Debug/libCoinUtils.lib
Cgl library found at: C:/MINLP/CGL/MSVisualStudio/v16/x64/Debug/libCgl.lib

Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Checking for one of the modules 'ipopt'
CMake Error at C:/Program Files/CMake/share/cmake-3.21/Modules/FindPkgConfig.cmake:849 (message):
None of the required 'ipopt' found
Call Stack (most recent call first):
CMakeLists.txt:251 (pkg_search_module)

-- Cbc include files will be used from: C:\MINLP\CBC\src
-- The following Cbc libraries will be used from:
C:/MINLP/CBC/MSVisualStudio/v16/x64/Debug/libCbc.lib;C:/MINLP/CBC/MSVisualStudio/v16/x64/Debug/libCbcSolver.lib;C:/MINLP/CBC/MSVisualStudio/v16/x64/Debug/libOsiClp.lib;C:/MINLP/CLP/MSVisualStudio/v16/x64/Debug/libClp.lib;C:/MINLP/CBC/MSVisualStudio/v16/x64/Debug/libOsi.lib;C:/MINLP/COINUTILS/MSVisualStudio/v16/libCoinUtils/x64/Debug/libCoinUtils.lib;C:/MINLP/CGL/MSVisualStudio/v16/x64/Debug/libCgl.lib
-- Ipopt include files will be used from: C:\MINLP\IPOPT\bin/include/coin
-- The following Ipopt libraries will be used from:

CMake Error at CMakeLists.txt:664 (install):
install TARGETS given target "SHOT" which does not exist.

Configuring incomplete, errors occurred!
See also "C:/MINLP/SHOT/build/CMakeFiles/CMakeOutput.log".

It seems that it does not find ipopt (there is no directory for the lib or any other input form) and
also this error that appears twice:

file FILE([TO_CMAKE_PATH|TO_NATIVE_PATH] path result) must be called with
exactly three arguments.

any help would really be appreciated
thanks
jac

failing assert at MIPSolverCbc.cpp:1271

On GAMS model library model pump, when running SHOT with asserts enabled and Cbc as MIP solver, I get

    Iteration     │  Time  │  Dual cuts  │     Objective value     │   Objective gap   │     Current solution
     #: type      │  tot.  │   + | tot.  │       dual | primal     │    abs. | rel.    │    obj.fn. | max.err.
╶─────────────────┴────────┴─────────────┴─────────────────────────┴───────────────────┴───────────────────────────╴)

     1: MILP-O       0.09                           0 | inf.            inf. | 1.0e+00            0 | 9: 1.00e+00      
     1: NLPNEWDB-O   0.16                           0 | inf.            inf. | 1.0e+00            0 | 43: 1.72e-25     
gmsgenux.out: MIPSolverCbc.cpp:1271: virtual bool SHOT::MIPSolverCbc::createIntegerCut(SHOT::IntegerCut&): Assertion `variableValue >= VAR->lowerBound' failed.

(gdb) print variableValue
$1 = 0
(gdb) print VAR->lowerBound
$2 = 1

SHOT incorrectly claims to find global optimal solution when problem is unbounded

I'm going to open a few issues to track some correctness bugs in SHOT. Some of them may be issues in Cbc, but it'd be nice to confirm.

JuMP reproducer

model = Model(bridge_constraints=false) do
    AmplNLWriter.Optimizer(SHOT_jll.amplexe, ["Output.Debug.Enable=true"])
end
@variable(model, x)
@objective(model, Min, x)
@NLconstraint(model, x^2 >= 1)
optimize!(model)

julia> objective_value(model)
1.0

julia> value(x)
1.0

This problem is unbounded because any x <= -1 is feasible.

Pure SHOT reproducer

g3 1 1 0
 1 1 1 0 0 0
 1 1
 0 0
 1 0 0
 0 0 0 1
 0 0 0 0 0
 1 1
 0 0
 0 0 0 0 0
C0
o1
o5
v0
n2
n1
O0 0
n0
x1
0 0
r
2 0
b
3
k0
J0 1
0 0
G0 1
0 1
julia> SHOT_jll.amplexe() do exe
           run(`$(exe) bug.nl -AMPL`)
       end

╶ Supporting Hyperplane Optimization Toolkit (SHOT) ──────────────────────────────────────────────────────────────────╴

 Andreas Lundell and Jan Kronqvist, Åbo Akademi University, Finland.
 See documentation for full list of contributors and utilized software libraries.

 Version: 1.1.0. Git hash: edbff51d-dirty. Released: Jul 12 2021.

 For more information visit https://shotsolver.dev

╶ Modeling system ────────────────────────────────────────────────────────────────────────────────────────────────────╴

 Modeling system:            AMPL
 Problem read from file:     bug.nl

 Performing bound tightening on original problem.
  - Bounds for 1 variables tightened in 0.00 s and 2 passes.
 Performing bound tightening on reformulated problem.
  - Bounds for 0 variables tightened in 0.00 s and 1 passes.

╶ Problem instance ───────────────────────────────────────────────────────────────────────────────────────────────────╴

                                    Original             Reformulated

 Problem classification:            QCQP, nonconvex      NLP, nonconvex

 Objective function direction:      minimize             minimize
 Objective function type:           nonlinear            linear

 Number of constraints:             1                    1
  - nonconvex quadratic:            1                    0
  - nonconvex nonlinear:            0                    1

 Number of variables:               1                    1
  - real:                           1                    1
  - nonlinear:                      1                    1

╶ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────╴

 No options file specified.

 Options specified:

  - Dual.ESH.InteriorPoint.CuttingPlane.IterationLimit = 50
  - Dual.HyperplaneCuts.ConstraintSelectionFactor = 1
  - Dual.HyperplaneCuts.UseIntegerCuts = true
  - Dual.MIP.Presolve.UpdateObtainedBounds = false
  - Dual.MIP.SolutionLimit.Initial = 2147483647
  - Dual.Relaxation.Use = false
  - Dual.TreeStrategy = 0
  - Model.BoundTightening.FeasibilityBased.TimeLimit = 5
  - Model.Reformulation.Quadratics.Strategy = 0
  - Output.OutputDirectory = 0
  - Primal.FixedInteger.CallStrategy = 0
  - Primal.FixedInteger.OnlyUniqueIntegerCombinations = false
  - Primal.FixedInteger.Source = 0
  - Primal.Tolerance.TrustLinearConstraintValues = false

 Dual strategy:              NLP version
  - cut algorithm:           ESH
  - solver:                  Cbc 2.10.5

 Primal NLP solver:          none


╶ Interior point search ──────────────────────────────────────────────────────────────────────────────────────────────╴

 Strategy selected:          cutting plane minimax

    Iteration     │  Time  │    Cuts     │     Objective value     │  Objective diff.   
     #: type      │  tot.  │   + | tot.  │    problem | line srch  │    abs. | rel.    
╶─────────────────┴────────┴─────────────┴─────────────────────────┴──────────────────╴
     1: LP           0.01                      -1e+12 | -1e+12          inf. | inf.    
     2: LP           0.01      1 | 1           -1e+12 | -inf.           inf. | 2.5e+11 
        Large values found in RHS of cut, you might want to consider reducing the bounds of the nonlinear variables.
     3: LP           0.01      1 | 2           -1e+12 | -inf.           inf. | 2.5e+11 
     4: LP           0.02      1 | 3           -1e+12 | -inf.           inf. | 2.5e+11 
     5: LP           0.02      1 | 4           -1e+12 | -inf.           inf. | 2.5e+11 
     6: LP           0.02      1 | 5           -1e+12 | -inf.           inf. | 2.5e+11 
     7: LP           0.02      1 | 6           -1e+12 | -inf.           inf. | 2.5e+11 
     8: LP           0.02      1 | 7           -1e+12 | -inf.           inf. | 2.5e+11 
     9: LP           0.02      1 | 8           -1e+12 | -inf.           inf. | 2.5e+11 
    10: LP           0.02      1 | 9           -1e+12 | -inf.           inf. | 2.5e+11 
    11: LP           0.02      1 | 10          -1e+12 | -inf.           inf. | 2.5e+11 
    12: LP           0.02      1 | 11          -1e+12 | -inf.           inf. | 2.5e+11 
    13: LP           0.03      1 | 12          -1e+12 | -inf.           inf. | 2.5e+11 
    14: LP           0.03      1 | 13          -1e+12 | -inf.           inf. | 2.5e+11 
    15: LP           0.03      1 | 14          -1e+12 | -inf.           inf. | 2.5e+11 
    16: LP           0.03      1 | 15          -1e+12 | -inf.           inf. | 2.5e+11 
    17: LP           0.03      1 | 16          -1e+12 | -inf.           inf. | 2.5e+11 
    18: LP           0.03      1 | 17          -1e+12 | -inf.           inf. | 2.5e+11 
    19: LP           0.03      1 | 18          -1e+12 | -inf.           inf. | 2.5e+11 
    20: LP           0.03      1 | 19          -1e+12 | -inf.           inf. | 2.5e+11 
    21: LP           0.03      1 | 20          -1e+12 | -inf.           inf. | 2.5e+11 
    22: LP           0.03      1 | 21          -1e+12 | -inf.           inf. | 2.5e+11 
    23: LP           0.03      1 | 22          -1e+12 | -inf.           inf. | 2.5e+11 
    24: LP           0.03      1 | 23          -1e+12 | -inf.           inf. | 2.5e+11 
    25: LP           0.03      1 | 24          -1e+12 | -inf.           inf. | 2.5e+11 
    26: LP           0.04      1 | 25          -1e+12 | -inf.           inf. | 2.5e+11 
    27: LP           0.04      1 | 26          -1e+12 | -inf.           inf. | 2.5e+11 
    28: LP           0.04      1 | 27          -1e+12 | -inf.           inf. | 2.5e+11 
    29: LP           0.04      1 | 28          -1e+12 | -inf.           inf. | 2.5e+11 
    30: LP           0.04      1 | 29          -1e+12 | -inf.           inf. | 2.5e+11 
    31: LP           0.04      1 | 30          -1e+12 | -inf.           inf. | 2.5e+11 
    32: LP           0.04      1 | 31          -1e+12 | -inf.           inf. | 2.5e+11 
    33: LP           0.04      1 | 32          -1e+12 | -inf.           inf. | 2.5e+11 
    34: LP           0.04      1 | 33          -1e+12 | -inf.           inf. | 2.5e+11 
    35: LP           0.04      1 | 34          -1e+12 | -inf.           inf. | 2.5e+11 
    36: LP           0.04      1 | 35          -1e+12 | -inf.           inf. | 2.5e+11 
    37: LP           0.05      1 | 36          -1e+12 | -inf.           inf. | 2.5e+11 
    38: LP           0.05      1 | 37          -1e+12 | -inf.           inf. | 2.5e+11 
    39: LP           0.05      1 | 38          -1e+12 | -inf.           inf. | 2.5e+11 
    40: LP           0.05      1 | 39          -1e+12 | -inf.           inf. | 2.5e+11 
    41: LP           0.05      1 | 40          -1e+12 | -inf.           inf. | 2.5e+11 
    42: LP           0.05      1 | 41          -1e+12 | -inf.           inf. | 2.5e+11 
    43: LP           0.05      1 | 42          -1e+12 | -inf.           inf. | 2.5e+11 
    44: LP           0.05      1 | 43          -1e+12 | -inf.           inf. | 2.5e+11 
    45: LP           0.05      1 | 44          -1e+12 | -inf.           inf. | 2.5e+11 
    46: LP           0.05      1 | 45          -1e+12 | -inf.           inf. | 2.5e+11 
    47: LP           0.05      1 | 46          -1e+12 | -inf.           inf. | 2.5e+11 
    48: LP           0.06      1 | 47          -1e+12 | -inf.           inf. | 2.5e+11 
    49: LP           0.06      1 | 48          -1e+12 | -inf.           inf. | 2.5e+11 
    50: LP           0.06      1 | 49          -1e+12 | -inf.           inf. | 2.5e+11 

 Valid interior point with constraint deviation -inf. found.

╶ Main iteration step ────────────────────────────────────────────────────────────────────────────────────────────────╴

    Iteration     │  Time  │  Dual cuts  │     Objective value     │   Objective gap   │     Current solution
     #: type      │  tot.  │   + | tot.  │       dual | primal     │    abs. | rel.    │    obj.fn. | max.err.
╶─────────────────┴────────┴─────────────┴─────────────────────────┴───────────────────┴──────────────────────────────╴

     1: LP-O         0.06                           1 | 1            0.0e+00 | 0.0e+00            1 | 0: 0.00e+00      

╶ Solution report ────────────────────────────────────────────────────────────────────────────────────────────────────╴

 Terminated since absolute gap met requirements.

 Globally optimal primal solution found.

 Objective bound (minimization) [dual, primal]:  [1, 1].
 Objective gap absolute / relative:              0 / 0.

 Fulfilled termination criteria: 
  - absolute objective gap tolerance             0 <= 0.001
  - relative objective gap tolerance             0 <= 0.001
  - maximal constraint tolerance                 0 <= 1e-08

 Unfulfilled termination criteria:
  - iteration limit                              1 <= 200000
  - solution time limit (s)                      0.0587402 <= 1.79769e+308

 Dual problems solved in main step:              1
  - LP problems                                  1

 Problems solved during interior point search:
 - LP problems:                                  50

 Number of primal solutions found:               2
 - MILP solution pool:                           1
 - Interior point search:                        1

 Total solution time:                            0.0587802
 - problem reformulation:                        0.000100006
 - bound tightening:                             0.000434332
   - feasibility based (original problem):       0.00037559
   - feasibility based (reformulated problem):   1.4072e-05
 - interior point search:                        0.0463386
 - dual strategy:                                0.00348978
   - root search for constraint cuts:            4.046e-06
 - primal strategy:                              3.7453e-05
   - performing root searches:                   3.51e-06
╶─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╴

 Results written to: bug.osrl
                     bug.sol
 Log written to:     /Users/oscar/.julia/dev/AmplNLWriter/SHOT.log
Process(`/Users/oscar/.julia/artifacts/ba28f802a877e8af0827b2e084f1f7a8cef590c1/bin/SHOT bug.nl -AMPL`, ProcessExited(0))

Replace isnan(double)

In several places in the code the function isnan(double) or std::isnan(double) are used. This should be replaced with UtilityFunctions::isnan().

This gives error with some (older) compilers.

SHOT crashes with Termination.TimeLimit

We are using SHOT for a MIQCQP on Linux (Debian). Sometimes, but not always, SHOT crashes with Segmentation fault (core dumped) when using the time limit flag Termination.TimeLimit (see below). Nevertheless, running SHOT again with exactly the same configuration may or may not succeed. One the other hand, after removing the Termination.TimeLimit, SHOT has run perfectly fine for now. Interestingly, the time limit is apparently not considered, meaning that a limit of e.g. 2 seconds has long been exceeded when SHOT crashes.

Call: SHOT 160139061642117510802438150482602.osil Model.BoundTightening.FeasibilityBased.TimeLimit=0 Termination.TimeLimit=2 Dual.MIP.Solver=2 --osrl 160121502130516382784313271567890.osrl --log shot.log

╶ Supporting Hyperplane Optimization Toolkit (SHOT) ──────────────────────────────────────────────────────────────────╴

 Andreas Lundell and Jan Kronqvist, Åbo Akademi University, Finland.
 See documentation for full list of contributors and utilized software libraries.

 Version: 1.0.1. Git hash: 9306c402. Released: Jul  1 2020.

 For more information visit https://shotsolver.dev

╶ Modeling system ────────────────────────────────────────────────────────────────────────────────────────────────────╴

 Modeling system:            OSiL
 Problem read from file:     160139061642117510802438150482602.osil

 Performing bound tightening on original problem.
  - Bounds for 0 variables tightened in 0.00 s.
 Performing bound tightening on reformulated problem.
  - Bounds for 0 variables tightened in 0.00 s.

╶ Problem instance ───────────────────────────────────────────────────────────────────────────────────────────────────╴

                                    Original             Reformulated

 Problem classification:            MIQCQP, nonconvex    MINLP, nonconvex

 Objective function direction:      maximize             maximize
 Objective function type:           linear               linear

 Number of constraints:             845                  845
  - linear:                         844                  844
  - nonconvex quadratic:            1                    0
  - nonconvex nonlinear:            0                    1

 Number of variables:               452                  452
  - real:                           226                  226
  - binary:                         226                  226
  - nonlinear:                      226                  226

╶ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────╴

 No options file specified.

 Nondefault options used:

  - Dual.ESH.InteriorPoint.CuttingPlane.IterationLimit = 50
  - Dual.HyperplaneCuts.ConstraintSelectionFactor = 1.0
  - Dual.HyperplaneCuts.UseIntegerCuts = true
  - Dual.MIP.Presolve.UpdateObtainedBounds = false
  - Dual.MIP.SolutionLimit.Initial = 2147483647
  - Dual.MIP.Solver = 2
  - Dual.Relaxation.Use = false
  - Dual.TreeStrategy = 0
  - Model.BoundTightening.FeasibilityBased.TimeLimit = 5.0
  - Model.Reformulation.Constraint.PartitionNonlinearTerms = 1
  - Model.Reformulation.Constraint.PartitionQuadraticTerms = 0
  - Model.Reformulation.ObjectiveFunction.PartitionNonlinearTerms = 1
  - Model.Reformulation.ObjectiveFunction.PartitionQuadraticTerms = 0
  - Model.Reformulation.Quadratics.Strategy = 0
  - Primal.FixedInteger.CallStrategy = 0
  - Primal.FixedInteger.OnlyUniqueIntegerCombinations = false
  - Primal.FixedInteger.Source = 0
  - Primal.Tolerance.TrustLinearConstraintValues = false
  - Termination.TimeLimit = 2.0

 Dual strategy:              Multi-tree
  - cut algorithm:           ESH
  - solver:                  Cbc 2.10.4

 Primal NLP solver:          Ipopt 3.13.3 (with default linear solver)


╶ Interior point search ──────────────────────────────────────────────────────────────────────────────────────────────╴

 Strategy selected:          cutting plane minimax


    Iteration     │  Time  │    Cuts     │     Objective value     │  Objective diff.
     #: type      │  tot.  │   + | tot.  │    problem | line srch  │    abs. | rel.
╶─────────────────┴────────┴─────────────┴─────────────────────────┴──────────────────╴
     1: LP           0.14                      -1e+12 | -1e+12          inf. | inf.
     2: LP           0.17      1 | 1      -0.00748551 | -0.00228258  5.2e-03 | 7.0e-01

 Valid interior point with constraint deviation -0.002 found.


    Iteration     │  Time  │  Dual cuts  │     Objective value     │   Objective gap   │     Current solution
     #: type      │  tot.  │   + | tot.  │     primal | dual       │    abs. | rel.    │    obj.fn. | max.err.)
╶─────────────────┴────────┴─────────────┴─────────────────────────┴───────────────────┴───────────────────────────╴)

     1: MILP-O       0.20                       -inf. | -0.703175       inf. | 1.0e+00    -0.703175 | 0: 4.80e-04
     1: NLPNEWDB-O   1.38                       -inf. | -0.703175       inf. | 1.0e+00              | inf.
        Solution is no longer global since integer cut has been added.
     2: MILP-O       1.44      2 | 2            -inf. |*-0.705359       inf. | 1.0e+00    -0.705359 | 0: 1.73e-05
     2: NLPNEWDB-O   2.12      2 | 2         -1.22593 |*-0.705359    5.2e-01 | 4.3e-01     -1.22593 | 0: -1.70e-03
     3: MILP-TL      2.16      5 | 7        -0.705445 |*-0.705359    8.6e-05 | 1.2e-04    -0.705445 | 0: 3.38e-08
     1: REDCUT-1     2.79   Obj.cut: -0.704739                                                                          
        Forced optimal iteration since difference between MIP solution and primal is small
     4: MILP-I       2.81                   -0.705445 |*inf.            inf. | inf.                 | inf.
     1: REP-SUCC     2.82   Repairs: 5
     5: MILP-I       2.84      2 | 9        -0.705445 |*inf.            inf. | inf.                 | inf.
     2: REP-SUCC     2.86   Repairs: 2
Segmentation fault (core dumped)

API documentation

Document the API, e.g. how to create and solve a model from an external program:

  • create an example in the model tests.
  • document this on the project web site.
  • example on how to use the termination callback.

Anti epigraph reformulation

GAMS is sometimes not able to extract the objective function from an epigraph constraint (e.g. smallinvSN*).

SHOT should then extract this itself.

failing assert at MIPSolverCbc.cpp:1464

When I run GAMS test library model miqcp01 with SHOT compiled without -DNDEBUG and use Cbc as MIP solver, this assert fails:

        osiInterface->setColBounds(varIndex, lowerBound, upperBound);
        assert(osiInterface->getColLower()[varIndex] == lowerBound);

gdb doesn't want to tell me osiInterface->getColLower()[varIndex] , but lowerBound is -1e50.

I usually don't build solver source without -DNDEBUG, so I don't really need a fix, but is that something to worry about or easy to fix? (or first question: can you reproduce?)

spaces in problem filename doesn't work

$ ./SHOT "spaaa  aa ce.osil"

╶ Supporting Hyperplane Optimization Toolkit (SHOT) ──────────────────────────────────────────────────────────────────╴

  Andreas Lundell and Jan Kronqvist, Åbo Akademi University, Finland.
  See documentation for full list of contributors and utilized software libraries.

  Version: 1.0.alpha 1. Git hash: 222ecf2. Released Jan 18 2020. 

  For more information visit https://shotsolver.dev

   Problem file spaaa not found!

large memory requirement on GAMS modellib model jit

On jit, the memory usage of SHOT seems to be huge on one of the longer running instances.

For me, this was for c = case6:

--- jit.gms(112) 3 Mb
--- Generating MINLP model jit
--- jit.gms(119) 5 Mb
--- LOOPS c = case6
---   33 rows  26 columns  112 non-zeroes
---   50 nl-code  12 nl-non-zeroes
---   4 discrete-columns
***
***   4 Integer +INF Bounds have been reset to 100 (see Option IntVarUp)
***
--- jit.gms(119) 3 Mb
--- Executing SHOT: elapsed 0:00:01.304

SHOT             31.0.0 rb9ce796 ALFA Released  6Apr20 LEG x86 64bit/Linux    

╶ Supporting Hyperplane Optimization Toolkit (SHOT) ──────────────────────────────────────────────────────────────────╴

 Andreas Lundell and Jan Kronqvist, Åbo Akademi University, Finland.
 See documentation for full list of contributors and utilized software libraries.

 Version: 1.0.alpha 1. Git hash: fe4ddfe5. Released Apr  8 2020. 

 For more information visit https://shotsolver.dev

 Performing bound tightening on original problem.
  - Bounds for 16 variables tightened in 0.00 s.
 Performing bound tightening on reformulated problem.
  - Bounds for 37 variables tightened in 0.00 s.

╶ Problem instance ───────────────────────────────────────────────────────────────────────────────────────────────────╴

                                    Original             Reformulated

 Problem classification:            MINLP, convex        MINLP, convex

 Objective function direction:      minimize             minimize
 Objective function type:           nonlinear, convex    linear

 Number of constraints:             32                   44
  - linear:                         32                   32
  - convex nonlinear:               0                    12

 Number of variables:               25                   37
  - real:                           21                   33
  - integer:                        4                    4
  - nonlinear:                      12                   12

 Number of transformations performed:                    12
 - nonlinear expression partitioning:                    12


╶ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────╴

 No options file specified.

 Nondefault options used:

  - Dual.MIP.NumberOfThreads = 1
  - Model.Variables.Continuous.MaximumUpperBound = 1e+20
  - Model.Variables.Continuous.MinimumLowerBound = -1e+20
  - Subsolver.Ipopt.LinearSolver = 1
  - Termination.IterationLimit = 2147483647
  - Termination.ObjectiveGap.Absolute = 1e-10
  - Termination.ObjectiveGap.Relative = 1e-10
  - Termination.TimeLimit = 1000.0

 Dual strategy:              Single-tree
  - cut algorithm:           ESH
  - solver:                  CPLEX 12.10

 Primal NLP solver:          Ipopt 3.13.1 (with HSL MA27)


╶ Interior point search ──────────────────────────────────────────────────────────────────────────────────────────────╴

 Strategy selected:          cutting plane minimax
                                                                                     
    Iteration     │  Time  │    Cuts     │     Objective value     │  Objective diff.   
     #: type      │  tot.  │   + | tot.  │    problem | line srch  │    abs. | rel.    
╶─────────────────┴────────┴─────────────┴─────────────────────────┴──────────────────╴

     1: LP           0.01                      -1e+12 | -1e+12          inf. | inf.    
     2: LP           0.01      3 | 3          -686267 | 25758.3      7.1e+05 | 1.0e+00 
     3: LP           0.01      3 | 6          -303458 | 1542.13      3.1e+05 | 1.0e+00 
     4: LP           0.01      3 | 9         -11715.8 | 614.968      1.2e+04 | 1.1e+00 
     5: LP           0.02      3 | 12        -8339.16 | 413.795      8.8e+03 | 1.0e+00 
     6: LP           0.02      3 | 15        -8027.39 | -5351.59     2.7e+03 | 3.3e-01 

 Valid interior point with constraint deviation -5351.589 found.

                                                                                     
    Iteration     │  Time  │  Dual cuts  │     Objective value     │   Objective gap   │     Current solution
     #: type      │  tot.  │   + | tot.  │       dual | primal     │    abs. | rel.    │    obj.fn. | max.err.
╶─────────────────┴────────┴─────────────┴─────────────────────────┴───────────────────┴───────────────────────────╴

     1: LP-O         0.02                     46923.4 | inf.            inf. | 1.0e+00      46923.4 | 40: 3.88e+04     
     2: LP-O         0.02      6 | 6           143185 | inf.            inf. | 1.0e+00       143185 | 42: 2.67e+04     
     3: LP-O         0.02      6 | 12          188475 | inf.            inf. | 1.0e+00       188475 | 40: 9.16e+03     
     4: LP-O         0.02      4 | 16          195632 | inf.            inf. | 1.0e+00       195632 | 42: 2.90e+03     
     5: LP-O         0.03      6 | 22          198898 | inf.            inf. | 1.0e+00       198898 | 36: 6.31e+02     
     6: LP-O         0.03      6 | 28          200351 | inf.            inf. | 1.0e+00       200351 | 39: 2.79e+02     
     7: LP-O         0.03      6 | 34          200690 | inf.            inf. | 1.0e+00       200690 | 39: 6.86e+01     
     8: LP-O         0.03      6 | 40          200767 | inf.            inf. | 1.0e+00       200767 | 41: 2.26e+01     
     9: LP-O         0.04      6 | 46          200831 | inf.            inf. | 1.0e+00       200831 | 42: 4.46e+00     
    10: LP-O         0.04      6 | 52          200845 | inf.            inf. | 1.0e+00       200845 | 42: 6.37e-01     
    11: LP-O         0.04      6 | 58          200847 | inf.            inf. | 1.0e+00       200847 | 43: 6.02e-01     
    12: LP-O         0.04      6 | 64          200848 | inf.            inf. | 1.0e+00       200848 | 34: 1.59e-01     
    13: CB (th: 0)   0.05                      200849 | inf.            inf. | 1.0e+00       203454 | 37: 1.50e+02     
     1: NLPSOLPT-O   0.08      6 | 70          200849 | 204396       3.5e+03 | 1.7e-02       204396 | -1: 0.00e+00     
    20: CB (th: 0)   0.09                      201966 | 204396       2.4e+03 | 1.2e-02       204359 | 41: 2.41e+02     
...
 36078: MIP-O       166.71                     204359 | 204396       3.8e+01 | 1.9e-04       204198 | 41: 2.41e+02     
 36146: MIP-O       167.05                     204359 | 204396       3.8e+01 | 1.9e-04       204198 | 41: 2.41e+02     
 36214: MIP-O       167.45                     204359 | 204396       3.8e+01 | 1.9e-04       204198 | 41: 2.41e+02     
 36282: MIP-O       167.74                     204359 | 204396       3.8e+01 | 1.9e-04       204198 | 41: 2.41e+02     
 36350: MIP-O       168.08                     204359 | 204396       3.8e+01 | 1.9e-04       204198 | 41: 2.41e+02     
 36418: MIP-O       168.43                     204359 | 204396       3.8e+01 | 1.9e-04       204198 | 41: 2.41e+02     
^C        Terminated due to termination by user.


╶ Solution report ────────────────────────────────────────────────────────────────────────────────────────────────────╴

 Terminated by user.

 Feasible primal solution found to convex problem. Can not guarantee optimality to the given termination criteria.

 Objective bound (minimization) [dual, primal]:  [204359, 204396]
 Objective gap absolute / relative:              37.8156 / 0.000185011

 Fulfilled termination criteria: 

 Unfulfilled termination criteria: 
  - absolute objective gap tolerance             37.8156 > 1e-10
  - relative objective gap tolerance             0.000185011 > 1e-10
  - iteration limit                              36427 <= 2147483647
  - solution time limit (s)                      168.469 <= 1000

 Dual problems solved in main step:              18213
  - LP problems                                  12
  - MILP problems, optimal                       18201

 Problems solved during interior point search: 
 - LP problems:                                  6

 Fixed primal NLP problems solved:               3

 Number of primal solutions found:               1
 - NLP problem with fixed integers:              1

 Total solution time:                            168.469
  - problem initialization:                      0.00212419
  - problem reformulation:                       0.00180914
  - bound tightening:                            0.00182063
    - feasibility based (original problem:       0.000704119
    - feasibility based (reformulated problem:   0.00108138
  - interior point search:                       1.08863
    - solving relaxed problems:                  0.0273926
  - dual strategy:                               148.277
    - solving MIP problems:                      168.425
    - root search for constraint cuts:           28.6154
  - primal strategy:                             33.4185
    - solving NLP problems:                      16.3668
    - performing root searches:                  3.05559

It probably used about 3GB of memory when I interrupted it, and kept increasing.

Is something just growing that big intentionally, or may there be some memory leak?

Fix issues with the GAMS integration

  • Add functionality to communicate the number of threads, tolerances and termination criteria from GAMS to SHOT without specifying an options-file.
  • Also some additional pieces of information could still be communicated between GAMS and SHOT. See TODOs in ModelingSystemGAMS.cpp.
  • The console output does currently not mention when an options file has been used.

Compilation error

Hi, I am trying to compile SHOT in Windows10 (64bit) by following the instructions on https://shotsolver.dev/shot/about-shot/compiling. But things are not going well, so ask if anyone can let me know a solution for this.

(base) PS C:\Users\Damdae\OneDrive - SNU\Installation Files\solvers\shot\SHOT\build> cmake .. -DCMAKE-BUILD_TYPE=Release -DHAS_IPOPT=on -DHAS_CPLEX_=on -DHAS_GUROBI=on

-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.19044.
-- Git hash: 7f2b2af7
-- Found Gurobi folder: C:/Users/Damdae/OneDrive - SNU/Installation Files/solvers/gurobi/win64
-- Using Gurobi include folder: C:/Users/Damdae/OneDrive - SNU/Installation Files/solvers/gurobi/win64/include
-- Using Gurobi library folder: C:/Users/Damdae/OneDrive - SNU/Installation Files/solvers/gurobi/win64/lib
-- Found Gurobi library: C:/Users/Damdae/OneDrive - SNU/Installation Files/solvers/gurobi/win64/lib/gurobi_c++md2017.lib
-- Found Gurobi C++ library: C:/Users/Damdae/OneDrive - SNU/Installation Files/solvers/gurobi/win64/lib/gurobi95.lib
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (GUROBI)
  does not match the name of the calling package (Gurobi).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  misc/FindGurobi.cmake:114 (find_package_handle_standard_args)
  CMakeLists.txt:229 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Checking for one of the modules 'ipopt'
CMake Error at C:/Program Files/CMake/share/cmake-3.22/Modules/FindPkgConfig.cmake:890 (message):
  None of the required 'ipopt' found
Call Stack (most recent call first):
  CMakeLists.txt:251 (pkg_search_module)


-- Gurobi include files will be used from: C:/Users/Damdae/OneDrive - SNU/Installation Files/solvers/gurobi/win64/include
-- The following Gurobi libraries will be used:
   C:/Users/Damdae/OneDrive - SNU/Installation Files/solvers/gurobi/win64/lib/gurobi_c++md2017.lib
   C:/Users/Damdae/OneDrive - SNU/Installation Files/solvers/gurobi/win64/lib/gurobi95.lib
-- Ipopt include files will be used from: C:\Users\Damdae\OneDrive - SNU\Installation Files\solvers\ipopt\bin\ipopt.exe/include/coin
-- The following Ipopt libraries will be used from:

-- Configuring incomplete, errors occurred!
See also "C:/Users/Damdae/OneDrive - SNU/Installation Files/solvers/shot/SHOT/build/CMakeFiles/CMakeOutput.log".

It's weird because Gurobi is detected while IPOPT is not. They are all in the PATH environment variable and reachable, as you can see below.

(base) PS C:\Users\Damdae\OneDrive - SNU\Installation Files\solvers\shot\SHOT\build> gcm ipopt

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     ipopt.exe                                          0.0.0.0    C:\Users\Damdae\OneDrive - SNU\Installation Files\solvers\ipopt\bin\ipopt.exe

Constant Objective Function Cause ASL Error

Hi, I have a problem with SHOT. I created sample code for generation of this error:

from pyomo.environ import *
m = ConcreteModel()
m.x = Var(bounds=(-5, 5))
m.y = Var(bounds=(-5, 5))
m.cons1 = Constraint(expr=2 * m.x+3 * m.y<=3)
m.cons2 = Constraint(expr=m.x-m.y==1)
m.obj = Objective(expr=1)
solver = SolverFactory("SHOT")
results = solver.solve(m, tee=True)

When I run with constant objective, I get:

╶ Supporting Hyperplane Optimization Toolkit (SHOT) ──────────────────────────────────────────────────────────────────╴

Andreas Lundell and Jan Kronqvist, Åbo Akademi University, Finland.
See documentation for full list of contributors and utilized software libraries.

Version: 1.1. Git hash: 62f31ee. Released: Jan 13 2022.

For more information visit https://shotsolver.dev

╶ Modeling system ────────────────────────────────────────────────────────────────────────────────────────────────────╴

Modeling system: AMPL
Problem read from file: /tmp/tmp0rm5p_ub.pyomo.nl

ERROR: Solver (asl) returned non-zero return code (-11)
ERROR: See the solver log above for diagnostic information.

Same problem can be solved IPOPT without any problem.

creating a optimization problem with SHOT

Hello
I managed to build SHOT with (IPOPT, CBC) under windows MSVC and Intel Fortran.
I ran the examples with the OSIL format and it seems that it works.
I would like now to create a real problem and I see that doing so with OSIL is challenging because of the syntax and the apparent lack of documentation.
What could be the simplest way to create a problem ? using AMPL ?
Is there a way to create an OSIL file with a suitable programming (with expressions and a suitable parser) ?
thanks
jac

CPLEX output goes to stdout/stderr

I updated to the most recent version and now get CPLEX output on stdout/stderr, even though I pass my own output sink when constructing SHOT::Solver.

Could be that I just didn't notice this before because CPLEX output was always disabled, but this one in MIPSolverCplex::checkParameters() is new:

    if(env->reformulatedProblem->properties.numberOfNonlinearConstraints == 0)
        env->settings->updateSetting("Console.DualSolver.Show", "Output", true);

?

I haven't checked with Gurobi and Cbc.

GAMS with Ipopt fail

If Ipopt or Ipopth is selected as the NLP solver in GAMS, the NLP call fails with:

*** gevCallSolver: Solve failed (ipopth,RMINLP,sl=5)
*** gevCallSolver: rc=2 msg=ipoReadyAPI failed

For example:

./SHOT ~/Research/minlplib/gms/tls4.gms --mip=cbc Subsolver.GAMS.NLP.Solver=ipopth --nlp=gams

gives:

╶ Supporting Hyperplane Optimization Toolkit (SHOT) ──────────────────────────────────────────────────────────────────╴

 Andreas Lundell and Jan Kronqvist, Åbo Akademi University, Finland.
 See documentation for full list of contributors and utilized software libraries.

 Version: 1.1.0. Git hash: d77d9bab. Released: Aug 20 2021.

 For more information visit https://shotsolver.dev

╶ Modeling system ────────────────────────────────────────────────────────────────────────────────────────────────────╴

 Modeling system:            GAMS
 Problem read from file:     /home/andreas/Research/minlplib/gms/tls4.gms

 Time to extract information on quadratics: 0.000000
 Performing bound tightening on original problem.
  - Bounds for 18 variables tightened in 0.00 s and 2 passes.
 Performing bound tightening on reformulated problem.
  - Bounds for 8 variables tightened in 0.00 s and 2 passes.

╶ Problem instance ───────────────────────────────────────────────────────────────────────────────────────────────────╴

                                    Original             Reformulated

 Problem classification:            MINLP, nonconvex     MINLP, convex

 Objective function direction:      minimize             minimize
 Objective function type:           linear               linear

 Number of constraints:             64                   72
  - linear:                         60                   60
  - convex nonlinear:               0                    12
  - nonconvex nonlinear:            4                    0

 Number of variables:               105                  113
  - real:                           16                   24
  - binary:                         85                   85
  - integer:                        4                    4
  - nonlinear:                      20                   20

 Number of transformations performed:                    8
  - signomial terms partitioning:                        8

╶ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────╴

 No options file specified.

 Options specified:

  - Dual.MIP.Solver = 2
  - Dual.TreeStrategy = 0
  - Model.Reformulation.Quadratics.Strategy = 0
  - Primal.FixedInteger.Solver = 1
  - Primal.Tolerance.TrustLinearConstraintValues = false
  - Subsolver.GAMS.NLP.Solver = ipopth

 Dual strategy:              Multi-tree
  - cut algorithm:           ESH
  - solver:                  Cbc 2.10

 Primal NLP solver:          IPOPTH in GAMS 36.1


╶ Interior point search ──────────────────────────────────────────────────────────────────────────────────────────────╴

 Strategy selected:          cutting plane minimax

    Iteration     │  Time  │    Cuts     │     Objective value     │  Objective diff.
     #: type      │  tot.  │   + | tot.  │    problem | line srch  │    abs. | rel.
╶─────────────────┴────────┴─────────────┴─────────────────────────┴──────────────────╴
     1: LP           0.05                      -1e+12 | -1e+12          inf. | inf.
     2: LP           0.05      3 | 3              -24 | 29.8059      5.4e+01 | 2.2e+00
     3: LP           0.05      3 | 6           -12.78 | 17.8589      3.1e+01 | 2.4e+00
     4: LP           0.06      3 | 9         -9.43449 | 8.2712       1.8e+01 | 1.9e+00
     5: LP           0.06      3 | 12          -7.973 | 3.41603      1.1e+01 | 1.4e+00
     6: LP           0.07      3 | 15        -7.77878 | 2.98475      1.1e+01 | 1.4e+00
     7: LP           0.07      3 | 18        -7.76863 | 2.7315       1.1e+01 | 1.4e+00
     8: LP           0.08      3 | 21        -7.74951 | 0.440303     8.2e+00 | 1.1e+00
     9: LP           0.08      3 | 24        -7.72154 | -0.126149    7.6e+00 | 9.8e-01

 Valid interior point with constraint deviation -0.126 found.

╶ Main iteration step ────────────────────────────────────────────────────────────────────────────────────────────────╴

    Iteration     │  Time  │  Dual cuts  │     Objective value     │   Objective gap   │     Current solution
     #: type      │  tot.  │   + | tot.  │       dual | primal     │    abs. | rel.    │    obj.fn. | max.err.
╶─────────────────┴────────┴─────────────┴─────────────────────────┴───────────────────┴──────────────────────────────╴

     1: LP-O         0.08                           0 | inf.            inf. | 1.0e+00            0 | 63: 6.34e+01
     4: LP-O         0.09      5 | 16        0.677373 | inf.            inf. | 1.0e+00     0.677373 | 62: 7.42e+00
     5: LP-O         0.10      6 | 22         1.30029 | inf.            inf. | 1.0e+00      1.30029 | 61: 3.47e+00
     6: LP-O         0.10      6 | 28         1.59129 | inf.            inf. | 1.0e+00      1.59129 | 64: 3.82e+00
     7: LP-O         0.11      4 | 32         1.64324 | inf.            inf. | 1.0e+00      1.64324 | 65: 1.73e+00
     8: LP-O         0.12      5 | 37         1.68228 | inf.            inf. | 1.0e+00      1.68228 | 60: 2.38e+00
    11: LP-O         0.13      4 | 48         1.68228 | inf.            inf. | 1.0e+00      1.68228 | 62: 2.89e-01
    12: MILP-SL1     0.16      5 | 53         1.74656 | inf.            inf. | 1.0e+00          6.1 | 68: 1.30e+01
*** gevCallSolver: Solve failed (ipopth,RMINLP,sl=5)
*** gevCallSolver: rc=2 msg=ipoReadyAPI failed
terminate called after throwing an instance of 'std::logic_error'
  what():  Calling GAMS NLP solver failed: Solve failed (ipopth,RMINLP,sl=5)
[1]    31037 abort      ./SHOT ~/Research/minlplib/gms/tls4.gms --mip=cbc  --nlp=gams

Can you verify @svigerske?

Compiling on Arch Linux

Hi, I am compiling SHOT with CBC and IPOPT on Manjaro ARM Linux aarch64 distro. I installed CBC from arch repository and works fine. I compiled and installed IPOPT from github. What can I do for this problem?
cmake version 3.22.0
GNU Make 4.3
gcc (GCC) 10.2.0
IPOPT 3.14.5 with ASL(20211109)
CBC Version: 2.10.5

Description of Model.Reformulation.Constraint.PartitionNonlinearTerms option

On the SHOT homepage, the description of Model.Reformulation.Constraint.PartitionNonlinearTerms and Model.Reformulation.ObjectiveFunction.PartitionNonlinearTerms are both

When to partition nonlinear sums in objective function

This also happens to Model.Reformulation.Constraint.PartitionQuadraticTerms and Model.Reformulation.ObjectiveFunction.PartitionQuadraticTerms. Is this correct? I thought Model.Reformulation.Constraint.PartitionNonlinearTerms means When to partition nonlinear sums in constraints.

MIPSolver initializeProblem return ignored in constructor

If the MIP solver could not be initialized, initializeProblem returns false, but this bool is not checked in the constructor of the MIP solver classes. At least for Cplex and Gurobi this seems to be the case.
So when not having a Gurobi license, I get a decent error message, but then a segfault:

        Error when initializing problem:: "No Gurobi license found (...)"

Program received signal SIGSEGV, Segmentation fault.
0x00007fffefca8186 in GRBModel::addVar(double, double, double, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) ()

Robustness of Cbc when "no additional dual cuts can be added"

This one may be a bug in Cbc (jump-dev/AmplNLWriter.jl#142 (comment))?

This goes away if x has a finite upper bound.

JuMP reproducer

model = Model(bridge_constraints=false) do
    AmplNLWriter.Optimizer(SHOT_jll.amplexe, ["Output.Debug.Enable=true"])
end
@variable(model, x)
@objective(model, Max, x)
@NLconstraint(model, x^2 <= 1)
optimize!(model)
julia> objective_value(model)
0.0

julia> value(x)
0.0

Pure SHOT reproducer

g3 1 1 0
 1 1 1 0 0 0
 1 1
 0 0
 1 0 0
 0 0 0 1
 0 0 0 0 0
 1 1
 0 0
 0 0 0 0 0
C0
o1
o5
v0
n2
n1
O0 1
n0
x1
0 0
r
1 0
b
3
k0
J0 1
0 0
G0 1
0 1
julia> SHOT_jll.amplexe() do exe
           run(`$(exe) bug.nl -AMPL`)
       end

╶ Supporting Hyperplane Optimization Toolkit (SHOT) ──────────────────────────────────────────────────────────────────╴

 Andreas Lundell and Jan Kronqvist, Åbo Akademi University, Finland.
 See documentation for full list of contributors and utilized software libraries.

 Version: 1.1.0. Git hash: edbff51d-dirty. Released: Jul 12 2021.

 For more information visit https://shotsolver.dev

╶ Modeling system ────────────────────────────────────────────────────────────────────────────────────────────────────╴

 Modeling system:            AMPL
 Problem read from file:     bug.nl

 Performing bound tightening on original problem.
  - Bounds for 0 variables tightened in 0.00 s and 1 passes.
 Performing bound tightening on reformulated problem.
  - Bounds for 0 variables tightened in 0.00 s and 1 passes.

╶ Problem instance ───────────────────────────────────────────────────────────────────────────────────────────────────╴

                                    Original             Reformulated

 Problem classification:            QCQP, convex         NLP, convex

 Objective function direction:      maximize             maximize
 Objective function type:           nonlinear            linear

 Number of constraints:             1                    1
  - convex quadratic:               1                    0
  - convex nonlinear:               0                    1

 Number of variables:               1                    1
  - real:                           1                    1
  - nonlinear:                      1                    1

╶ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────╴

 No options file specified.

 Options specified:

  - Dual.TreeStrategy = 0
  - Model.Reformulation.Quadratics.Strategy = 0
  - Model.Reformulation.Quadratics.UseEigenValueDecomposition = true
  - Output.OutputDirectory = 0
  - Primal.Tolerance.TrustLinearConstraintValues = false

 Dual strategy:              NLP version
  - cut algorithm:           ESH
  - solver:                  Cbc 2.10.5

 Primal NLP solver:          none


╶ Interior point search ──────────────────────────────────────────────────────────────────────────────────────────────╴

 Strategy selected:          cutting plane minimax

    Iteration     │  Time  │    Cuts     │     Objective value     │  Objective diff.   
     #: type      │  tot.  │   + | tot.  │    problem | line srch  │    abs. | rel.    
╶─────────────────┴────────┴─────────────┴─────────────────────────┴──────────────────╴
     1: LP           0.01                      -1e+12 | -1e+12          inf. | inf.    
     2: LP           0.01      1 | 1               -1 | -1           0.0e+00 | 0.0e+00 

 Valid interior point with constraint deviation -1.000 found.

╶ Main iteration step ────────────────────────────────────────────────────────────────────────────────────────────────╴

    Iteration     │  Time  │  Dual cuts  │     Objective value     │   Objective gap   │     Current solution
     #: type      │  tot.  │   + | tot.  │     primal | dual       │    abs. | rel.    │    obj.fn. | max.err.)
╶─────────────────┴────────┴─────────────┴─────────────────────────┴───────────────────┴──────────────────────────────╴

     1: LP-F         0.01                           0 | inf.            inf. | inf.               0 | 0: -1.00e+00     

╶ Solution report ────────────────────────────────────────────────────────────────────────────────────────────────────╴

 Terminated since no additional dual cuts can be added.

 Feasible primal solution found to convex problem. Can not guarantee optimality to the given termination criteria.

 Objective bound (maximization) [primal, dual]:  [0, 1.79769e+308].
 Objective gap absolute / relative:              1.79769e+308 / inf.

 Fulfilled termination criteria: 
  - maximal constraint tolerance                 -1 <= 1e-08

 Unfulfilled termination criteria:
  - absolute objective gap tolerance             1.79769e+308 > 0.001
  - relative objective gap tolerance             inf > 0.001
  - iteration limit                              3 <= 200000
  - solution time limit (s)                      0.0178754 <= 1.79769e+308

 Dual problems solved in main step:              3
  - LP problems                                  3

 Problems solved during interior point search:
 - LP problems:                                  2

 Number of primal solutions found:               1
 - Interior point search:                        1

 Total solution time:                            0.0179136
 - problem reformulation:                        6.5952e-05
 - bound tightening:                             5.7271e-05
   - feasibility based (original problem):       2.71e-05
   - feasibility based (reformulated problem):   6.401e-06
 - interior point search:                        0.00313878
 - dual strategy:                                0.00795445
   - root search for constraint cuts:            3.1161e-05
 - primal strategy:                              7.143e-05
   - performing root searches:                   9.85e-06
╶─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╴

 Results written to: bug.osrl
                     bug.sol
 Log written to:     /Users/oscar/.julia/dev/AmplNLWriter/SHOT.log

debug facility when not running from problem file

Two things.

I do not set Input.ProblemFile in my use of the SHOT library. This makes the code in Solver::initializeDebugMode() that tries to copy the problem file into the debug dir fail:

       fs::filesystem::path source(
          fs::filesystem::canonical(env->settings->getSetting<std::string>("ProblemFile", "Input")));

       fs::filesystem::copy_file(
          source.string(), (debugDir / source.filename()).string(), fs::filesystem::copy_options::overwrite_existing);

Can one do this only if Input.ProblemFile has been set? Or give a warning if the input file is not found an continue?

In bool Solver::setProblem(SHOT::ProblemPtr problem, SHOT::ModelingSystemPtr modelingSystem), the debug path that I can set via option Debug.Path is overwritten:

    if(static_cast<ES_OutputDirectory>(env->settings->getSetting<int>("OutputDirectory", "Output"))
        == ES_OutputDirectory::Program)
    {
        fs::filesystem::path debugPath(fs::filesystem::current_path());
        debugPath /= problem->name;

        env->settings->updateSetting("Debug.Path", "Output", debugPath.string());
        env->settings->updateSetting("ResultPath", "Output", fs::filesystem::current_path().string());
    }

If I already have a regular file with name problem->name in my directory, then the debug facitility will just fail, I guess. If I already have a directory with name problem->name in my directory, files in there may be overwritten.

It would be good if SHOT would not just overwrite my setting and maybe also choose a more unique name for the debug output directory than problem->name by default. Maybe add something like ".shot.debug" as suffix?

change enumerate-like integer option to enumerated integer option

There are a number of options like

    env->settings->createSetting("Cplex.OptimalityTarget", "Subsolver", 0,
        "Specifies how CPLEX treats nonconvex quadratics: 0. Automatic. 1. Searches for a globally optimal solution to "
        "a convex model. 2. Searches for a solution that satisfies first-order optimality "
        "conditions, but is not necessarily globally optimal. 3. Searches for a globally "
        "optimal solution to a nonconvex model; changes problem type to MIQP if necessary.",
        0, 3);

Can this be changed to be a proper enumeration option, like this one:

    VectorString enumLogLevel;
    enumLogLevel.push_back("Trace");
    enumLogLevel.push_back("Debug");
    enumLogLevel.push_back("Info");
    enumLogLevel.push_back("Warning");
    enumLogLevel.push_back("Error");
    enumLogLevel.push_back("Critical");
    enumLogLevel.push_back("Off");
    env->settings->createSetting(
        "Console.LogLevel", "Output", static_cast<int>(E_LogLevel::Info), "Log level for console output", enumLogLevel);

?

crash in Cbc on miqcp

On the problem

Variables  x1,x2,x3,b4,b5;
Binary Variables  b4,b5;
Equations  e1,e2,e3,e4;

e1.. -(sqr((-1.9) + x1) + sqr((-1.15) + x2)) + x3 =E= 0;
e2..    x1 + x2 - 2*b4 =L= 2.8;
e3..    x1 + x2 - 2*b4 =G= 1.2;
e4..    x1 - b5 =E= 1;

Model m / all /;
m.optcr      = 1E-6;
Solve m using MIQCP minimizing x3;

I get a segmentation fault of SHOT within CBC:

SHOT             31.0.0 re4be038 ALFA Released 19Dec19 LEG x86 64bit/Linux    

╶ Supporting Hyperplane Optimization Toolkit (SHOT) ──────────────────────────────────────────────────────────────────╴

  Andreas Lundell and Jan Kronqvist, Åbo Akademi University, Finland.
  See documentation for full list of contributors and utilized software libraries.

  Version: 1.0.alpha 1. Git hash: be1dabb. Released Jan 17 2020. 

  For more information visit https://shotsolver.dev

 Reading options from shot.opt

╶ Problem instance ───────────────────────────────────────────────────────────────────────────────────────────────────╴

                             Original             Reformulated

 Problem classification:     MIQP, convex         MIQP, convex
 Objective function type:    quadratic            quadratic

 Number of constraints:      3                    3
  - linear:                  3                    3

 Number of variables:        4                    4
  - real:                    2                    2
  - binary:                  2                    2


╶ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────╴

 No options file specified.

 Nondefault options used:

  - Dual.MIP.NumberOfThreads = 1
  - Dual.MIP.Solver = 2
  - Dual.TreeStrategy = 0
  - Model.Reformulation.Quadratics.Strategy = 0
  - Primal.Tolerance.TrustLinearConstraintValues = false
  - Subsolver.Ipopt.LinearSolver = 1
  - Termination.IterationLimit = 2147483647
  - Termination.ObjectiveGap.Absolute = 1e-10
  - Termination.ObjectiveGap.Relative = 1e-06
  - Termination.TimeLimit = 1000

  - solver:                  Cbc

 Primal NLP solver:          Ipopt with HSL MA27 linear solver


free(): invalid pointer

Program received signal SIGABRT, Aborted.
0x00007ffff7a89f25 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff7a89f25 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff7a73897 in abort () from /usr/lib/libc.so.6
#2  0x00007ffff7acd258 in __libc_message () from /usr/lib/libc.so.6
#3  0x00007ffff7ad477a in malloc_printerr () from /usr/lib/libc.so.6
#4  0x00007ffff7ad614c in _int_free () from /usr/lib/libc.so.6
#5  0x00007fffeff32c07 in ClpSimplexDual::dual(int, int) () from 
#6  0x00007fffeff0fbd9 in ClpSimplex::dual(int, int) () from 
#7  0x00007fffefe7c55f in OsiClpSolverInterface::resolve() () from 
#8  0x00007fffefd5276a in CbcModel::initialSolve() () from 
#9  0x00007fffefc8593d in CbcMain1(int, char const**, CbcModel&, int (*)(CbcModel*, int), CbcSolverUsefulData&) () from 
#10 0x00007fffefcb0655 in CbcMain1(int, char const**, CbcModel&) () from 
#11 0x00007fffef6f3447 in SHOT::MIPSolverCbc::solveProblem (this=0x55555565b8d0) at MIPSolverCbc.cpp:440
#12 0x00007fffef7622a2 in SHOT::TaskSolveIteration::run (this=0x55555568f6d0) at TaskSolveIteration.cpp:128
#13 0x00007fffef6d29f2 in SHOT::SolutionStrategyMultiTree::solveProblem (this=0x555555673ca0) at SolutionStrategyMultiTree.cpp:305
#14 0x00007fffef67084b in SHOT::Solver::solveProblem (this=0x7fffffffc840) at Solver.cpp:552
#15 0x00007fffef7df565 in shtCallSolver (Cptr=0x555555623530) at EntryPointsGAMS.cpp:201
#16 0x00007fffef7dfa64 in C__shtCallSolver (Cptr=0x555555623530) at EntryPointsGAMS.cpp:252

valgrind indicates that somethings has gone wrong earlier, though:


 Primal NLP solver:          Ipopt with HSL MA27 linear solver


Invalid read of size 1
   at 0x6046E67: CbcMain1(int, char const**, CbcModel&, int (*)(CbcModel*, int), CbcSolverUsefulData&) (in )
   by 0x6079654: CbcMain1(int, char const**, CbcModel&) (in )
   by 0x5ABC446: SHOT::MIPSolverCbc::solveProblem() (MIPSolverCbc.cpp:440)
   by 0x5B2B2A1: SHOT::TaskSolveIteration::run() (TaskSolveIteration.cpp:128)
   by 0x5A9B9F1: SHOT::SolutionStrategyMultiTree::solveProblem() (SolutionStrategyMultiTree.cpp:305)
   by 0x5A3984A: SHOT::Solver::solveProblem() (Solver.cpp:552)
   by 0x5BA8564: shtCallSolver (EntryPointsGAMS.cpp:201)
   by 0x5BA8A63: C__shtCallSolver (EntryPointsGAMS.cpp:252)
   by 0x52AFFEE: GMSCONF_tgmsconf_DOT_sccallsolver(GMSCONF_tgmsconf_OD_S*, int, void*, void*) (gmsconf.c:2443)
   by 0x52A4B6D: libsolver(unsigned char*, unsigned char*, unsigned char const*, GMOMDODEFEX_tgmomodel_OD_S**, GEVDOORG_tgmsenvironment_OD_S**) (gevdoorg.c:3042)
   by 0x52A61A3: GEVDOORG_tgmsenvironment_DOT_gevcallsolver(GEVDOORG_tgmsenvironment_OD_S*, void*, unsigned char const*, unsigned char const*, int, int, unsigned char const*, unsigned char const*, double, int, int, double, double, void**, unsigned char*) (gevdoorg.c:3427)
   by 0x5241786: gevcallsolver (joatdclib.c:5854)
 Address 0x5158ab0 is 0 bytes inside a block of size 31 free'd
   at 0x4839EAB: operator delete(void*) (vg_replace_malloc.c:586)
   by 0x5ABBBB2: SHOT::MIPSolverCbc::solveProblem() (MIPSolverCbc.cpp:390)
   by 0x5B2B2A1: SHOT::TaskSolveIteration::run() (TaskSolveIteration.cpp:128)
   by 0x5A9B9F1: SHOT::SolutionStrategyMultiTree::solveProblem() (SolutionStrategyMultiTree.cpp:305)
   by 0x5A3984A: SHOT::Solver::solveProblem() (Solver.cpp:552)
   by 0x5BA8564: shtCallSolver (EntryPointsGAMS.cpp:201)
   by 0x5BA8A63: C__shtCallSolver (EntryPointsGAMS.cpp:252)
   by 0x52AFFEE: GMSCONF_tgmsconf_DOT_sccallsolver(GMSCONF_tgmsconf_OD_S*, int, void*, void*) (gmsconf.c:2443)
   by 0x52A4B6D: libsolver(unsigned char*, unsigned char*, unsigned char const*, GMOMDODEFEX_tgmomodel_OD_S**, GEVDOORG_tgmsenvironment_OD_S**) (gevdoorg.c:3042)
   by 0x52A61A3: GEVDOORG_tgmsenvironment_DOT_gevcallsolver(GEVDOORG_tgmsenvironment_OD_S*, void*, unsigned char const*, unsigned char const*, int, int, unsigned char const*, unsigned char const*, double, int, int, double, double, void**, unsigned char*) (gevdoorg.c:3427)
   by 0x5241786: gevcallsolver (joatdclib.c:5854)
   by 0x11ECE9: GEVMDODEF_tgmsenvironment_DOT_gevcallsolver(GEVMDODEF_tgmsenvironment_OD_S*, void*, unsigned char const*, unsigned char const*, int, int, unsigned char const*, unsigned char const*, double, int, int, double, double, void**, unsigned char*) (gevmdodef.c:848)
 Block was alloc'd at
   at 0x4838DEF: operator new(unsigned long) (vg_replace_malloc.c:344)
   by 0x49D5631: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_mutate(unsigned long, unsigned long, char const*, unsigned long) (basic_string.tcc:317)
   by 0x49D6581: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long) (basic_string.tcc:466)
   by 0x59D7489: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&) (basic_string.h:6111)
   by 0x5ABBB90: SHOT::MIPSolverCbc::solveProblem() (MIPSolverCbc.cpp:390)
   by 0x5B2B2A1: SHOT::TaskSolveIteration::run() (TaskSolveIteration.cpp:128)
   by 0x5A9B9F1: SHOT::SolutionStrategyMultiTree::solveProblem() (SolutionStrategyMultiTree.cpp:305)
   by 0x5A3984A: SHOT::Solver::solveProblem() (Solver.cpp:552)
   by 0x5BA8564: shtCallSolver (EntryPointsGAMS.cpp:201)
   by 0x5BA8A63: C__shtCallSolver (EntryPointsGAMS.cpp:252)
   by 0x52AFFEE: GMSCONF_tgmsconf_DOT_sccallsolver(GMSCONF_tgmsconf_OD_S*, int, void*, void*) (gmsconf.c:2443)
   by 0x52A4B6D: libsolver(unsigned char*, unsigned char*, unsigned char const*, GMOMDODEFEX_tgmomodel_OD_S**, GEVDOORG_tgmsenvironment_OD_S**) (gevdoorg.c:3042)

Invalid read of size 1
   at 0x6046E3B: CbcMain1(int, char const**, CbcModel&, int (*)(CbcModel*, int), CbcSolverUsefulData&) (in )
   by 0x6079654: CbcMain1(int, char const**, CbcModel&) (in )
   by 0x5ABC446: SHOT::MIPSolverCbc::solveProblem() (MIPSolverCbc.cpp:440)
   by 0x5B2B2A1: SHOT::TaskSolveIteration::run() (TaskSolveIteration.cpp:128)
   by 0x5A9B9F1: SHOT::SolutionStrategyMultiTree::solveProblem() (SolutionStrategyMultiTree.cpp:305)
   by 0x5A3984A: SHOT::Solver::solveProblem() (Solver.cpp:552)
   by 0x5BA8564: shtCallSolver (EntryPointsGAMS.cpp:201)
   by 0x5BA8A63: C__shtCallSolver (EntryPointsGAMS.cpp:252)
   by 0x52AFFEE: GMSCONF_tgmsconf_DOT_sccallsolver(GMSCONF_tgmsconf_OD_S*, int, void*, void*) (gmsconf.c:2443)
   by 0x52A4B6D: libsolver(unsigned char*, unsigned char*, unsigned char const*, GMOMDODEFEX_tgmomodel_OD_S**, GEVDOORG_tgmsenvironment_OD_S**) (gevdoorg.c:3042)
   by 0x52A61A3: GEVDOORG_tgmsenvironment_DOT_gevcallsolver(GEVDOORG_tgmsenvironment_OD_S*, void*, unsigned char const*, unsigned char const*, int, int, unsigned char const*, unsigned char const*, double, int, int, double, double, void**, unsigned char*) (gevdoorg.c:3427)
   by 0x5241786: gevcallsolver (joatdclib.c:5854)
 Address 0x5158ab0 is 0 bytes inside a block of size 31 free'd
   at 0x4839EAB: operator delete(void*) (vg_replace_malloc.c:586)
   by 0x5ABBBB2: SHOT::MIPSolverCbc::solveProblem() (MIPSolverCbc.cpp:390)
   by 0x5B2B2A1: SHOT::TaskSolveIteration::run() (TaskSolveIteration.cpp:128)
   by 0x5A9B9F1: SHOT::SolutionStrategyMultiTree::solveProblem() (SolutionStrategyMultiTree.cpp:305)
   by 0x5A3984A: SHOT::Solver::solveProblem() (Solver.cpp:552)
   by 0x5BA8564: shtCallSolver (EntryPointsGAMS.cpp:201)
   by 0x5BA8A63: C__shtCallSolver (EntryPointsGAMS.cpp:252)
   by 0x52AFFEE: GMSCONF_tgmsconf_DOT_sccallsolver(GMSCONF_tgmsconf_OD_S*, int, void*, void*) (gmsconf.c:2443)
   by 0x52A4B6D: libsolver(unsigned char*, unsigned char*, unsigned char const*, GMOMDODEFEX_tgmomodel_OD_S**, GEVDOORG_tgmsenvironment_OD_S**) (gevdoorg.c:3042)
   by 0x52A61A3: GEVDOORG_tgmsenvironment_DOT_gevcallsolver(GEVDOORG_tgmsenvironment_OD_S*, void*, unsigned char const*, unsigned char const*, int, int, unsigned char const*, unsigned char const*, double, int, int, double, double, void**, unsigned char*) (gevdoorg.c:3427)
   by 0x5241786: gevcallsolver (joatdclib.c:5854)
   by 0x11ECE9: GEVMDODEF_tgmsenvironment_DOT_gevcallsolver(GEVMDODEF_tgmsenvironment_OD_S*, void*, unsigned char const*, unsigned char const*, int, int, unsigned char const*, unsigned char const*, double, int, int, double, double, void**, unsigned char*) (gevmdodef.c:848)
 Block was alloc'd at
   at 0x4838DEF: operator new(unsigned long) (vg_replace_malloc.c:344)
   by 0x49D5631: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_mutate(unsigned long, unsigned long, char const*, unsigned long) (basic_string.tcc:317)
   by 0x49D6581: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long) (basic_string.tcc:466)
   by 0x59D7489: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&) (basic_string.h:6111)
   by 0x5ABBB90: SHOT::MIPSolverCbc::solveProblem() (MIPSolverCbc.cpp:390)
   by 0x5B2B2A1: SHOT::TaskSolveIteration::run() (TaskSolveIteration.cpp:128)
   by 0x5A9B9F1: SHOT::SolutionStrategyMultiTree::solveProblem() (SolutionStrategyMultiTree.cpp:305)
   by 0x5A3984A: SHOT::Solver::solveProblem() (Solver.cpp:552)
   by 0x5BA8564: shtCallSolver (EntryPointsGAMS.cpp:201)
   by 0x5BA8A63: C__shtCallSolver (EntryPointsGAMS.cpp:252)
   by 0x52AFFEE: GMSCONF_tgmsconf_DOT_sccallsolver(GMSCONF_tgmsconf_OD_S*, int, void*, void*) (gmsconf.c:2443)
   by 0x52A4B6D: libsolver(unsigned char*, unsigned char*, unsigned char const*, GMOMDODEFEX_tgmomodel_OD_S**, GEVDOORG_tgmsenvironment_OD_S**) (gevdoorg.c:3042)

Invalid write of size 8
   at 0x6284FB7: ClpModel::emptyProblem(int*, double*, bool) (in )
   by 0x62E62A0: ClpSimplex::startup(int, int) (in )
   by 0x62F9690: ClpSimplexDual::startupSolve(int, double*, int) (in )
   by 0x62FBCDD: ClpSimplexDual::dual(int, int) (in )
   by 0x62D8BD8: ClpSimplex::dual(int, int) (in )
   by 0x633F07D: ClpSimplex::initialSolve(ClpSolve&) (in )
   by 0x624255C: OsiClpSolverInterface::initialSolve() (in )
   by 0x611B738: CbcModel::initialSolve() (in )
   by 0x604E93C: CbcMain1(int, char const**, CbcModel&, int (*)(CbcModel*, int), CbcSolverUsefulData&) (in )
   by 0x6079654: CbcMain1(int, char const**, CbcModel&) (in )
   by 0x5ABC446: SHOT::MIPSolverCbc::solveProblem() (MIPSolverCbc.cpp:440)
   by 0x5B2B2A1: SHOT::TaskSolveIteration::run() (TaskSolveIteration.cpp:128)
 Address 0x101f9be8 is 8 bytes before a block of size 32 alloc'd
   at 0x483950F: operator new[](unsigned long) (vg_replace_malloc.c:433)
   by 0x6284EF2: ClpModel::emptyProblem(int*, double*, bool) (in )
   by 0x62E62A0: ClpSimplex::startup(int, int) (in )
   by 0x62F9690: ClpSimplexDual::startupSolve(int, double*, int) (in )
   by 0x62FBCDD: ClpSimplexDual::dual(int, int) (in )
   by 0x62D8BD8: ClpSimplex::dual(int, int) (in )
   by 0x633F07D: ClpSimplex::initialSolve(ClpSolve&) (in )
   by 0x624255C: OsiClpSolverInterface::initialSolve() (in )
   by 0x611B738: CbcModel::initialSolve() (in )
   by 0x604E93C: CbcMain1(int, char const**, CbcModel&, int (*)(CbcModel*, int), CbcSolverUsefulData&) (in )
   by 0x6079654: CbcMain1(int, char const**, CbcModel&) (in )
   by 0x5ABC446: SHOT::MIPSolverCbc::solveProblem() (MIPSolverCbc.cpp:440)

Let me know if you cannot reproduce and I'll dig deeper.

Strange Cbc behavior

When solving e.g. autocorr_bern25-13 from MINLPLib, which SHOT can reformulate into an MILP problem, Cbc has some strange behavior.

If calling SHOT with --mip=cbc --timelimit=70 Dual.Relaxation.Use=false Subsolver.Cbc.DeterministicParallelMode=true --threads=1 --debug (on the stability branch), the first and only SHOT iteration produces the following output:

release git:(stability) ./SHOT ~/Research/minlplib2/21122018/minlplib/gms/autocorr_bern25-13.gms --mip=cbc --timelimit=70 Dual.Relaxation.Use=false Subsolver.Cbc.DeterministicParallelMode=true --threads=1 --debug

╶ Supporting Hyperplane Optimization Toolkit (SHOT) ──────────────────────────────────────────────────────────────────╴

 Andreas Lundell and Jan Kronqvist, Åbo Akademi University, Finland.
 See documentation for full list of contributors and utilized software libraries.

 Version: 1.0.alpha 1. Git hash: 4be53ff4. Released Mar  7 2020.

 For more information visit https://shotsolver.dev

╶ Modeling system ────────────────────────────────────────────────────────────────────────────────────────────────────╴

 Modeling system:            GAMS
 Problem read from file:     /home/aton3/alundell/Research/minlplib2/21122018/minlplib/gms/autocorr_bern25-13.gms

 Performing bound tightening on original problem.
  - Bounds for 1 variables tightened in 0.36 s.

╶ Problem instance ───────────────────────────────────────────────────────────────────────────────────────────────────╴

                                    Original             Reformulated

 Problem classification:            MINLP, nonconvex     MILP, convex

 Objective function direction:      minimize             minimize
 Objective function type:           linear               linear

 Number of constraints:             1                    3737
  - linear:                         0                    3737
  - nonconvex nonlinear:            1                    0

 Number of variables:               26                   1783
  - real:                           1                    223
  - binary:                         25                   1560
  - nonlinear:                      25                   0


╶ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────╴

 No options file specified.

 Nondefault options used:

  - Dual.MIP.NumberOfThreads = 1
  - Dual.MIP.Solver = 2
  - Dual.Relaxation.Use = false
  - Dual.TreeStrategy = 0
  - Model.Reformulation.Quadratics.Strategy = 0
  - Output.Console.DualSolver.Show = true
  - Primal.Tolerance.TrustLinearConstraintValues = false
  - Subsolver.Cbc.DeterministicParallelMode = true
  - Termination.TimeLimit = 70.0

 Dual strategy:              Multi-tree
  - cut algorithm:           ESH
  - solver:                  Cbc 2.10.4

 Primal NLP solver:          Ipopt 3.13.0 with Ipopt default linear solver




    Iteration     │  Time  │  Dual cuts  │     Objective value     │   Objective gap   │     Current solution
     #: type      │  tot.  │   + | tot.  │       dual | primal     │    abs. | rel.    │    obj.fn. | max.err.
╶─────────────────┴────────┴─────────────┴─────────────────────────┴───────────────────┴───────────────────────────╴

Welcome to the CBC MILP Solver
Version: 2.10.4
Build Date: Feb 17 2020

command line -  -autoscale off -nodestrategy fewest -scaling automatic -strategy 1 -cutoff 1e+100 -sec 69.478272985 -threads 101 -solve -quit
Option for nodeStrategy changed from hybrid to fewest
cutoff was changed from 1e+100 to 1e+100
seconds was changed from 1e+100 to 69.4783
threads was changed from 0 to 101
Continuous objective value is -131872 - 0.19 seconds
Cgl0004I processed model has 3737 rows, 1783 columns (1560 integer (1560 of which binary)) and 16587 elements
Cbc0031I 1342 added rows had average density of 9.7242921
Cbc0013I At root node, 1342 cuts changed objective from -131872 to -70095.095 in 85 passes
Cbc0014I Cut generator 0 (Probing) - 14259 row cuts average 2.0 elements, 0 column cuts (739 active)  in 3.506 seconds - new frequency is 1
Cbc0014I Cut generator 1 (Gomory) - 21638 row cuts average 42.2 elements, 0 column cuts (0 active)  in 3.766 seconds - new frequency is 1
Cbc0014I Cut generator 2 (Knapsack) - 336 row cuts average 2.0 elements, 0 column cuts (0 active)  in 0.787 seconds - new frequency is 1
Cbc0014I Cut generator 3 (Clique) - 0 row cuts average 0.0 elements, 0 column cuts (0 active)  in 0.286 seconds - new frequency is -100
Cbc0014I Cut generator 4 (MixedIntegerRounding2) - 18 row cuts average 32.1 elements, 0 column cuts (0 active)  in 2.082 seconds - new frequency is -100
Cbc0014I Cut generator 5 (FlowCover) - 1 row cuts average 9.0 elements, 0 column cuts (0 active)  in 0.080 seconds - new frequency is -100
Cbc0014I Cut generator 6 (TwoMirCuts) - 2658 row cuts average 30.9 elements, 0 column cuts (0 active)  in 0.665 seconds - new frequency is 1
Cbc0010I After 0 nodes, 1 on tree, 1e+50 best solution, best possible -70095.095 (31.98 seconds)
Cbc0016I Integer solution of -7636 found by strong branching after 94997 iterations and 21 nodes (61.21 seconds)
Cbc0012I Integer solution of -7916 found by heuristic after 94589 iterations and 18 nodes (65.26 seconds)
Cbc0030I Thread 0 used 5 times,  waiting to start 20.832898, 16.763806 cpu time, 0 locks, 0 locked, 0 waiting for locks
Cbc0030I Main thread 16.856859 waiting for threads,  0 locks, 0 locked, 0 waiting for locks
Cbc0020I Exiting on maximum time
Cbc0005I Partial search - best objective -7916 (best possible -66530.32), took 106525 iterations and 39 nodes (69.54 seconds)
Cbc0032I Strong branching done 606 times (47018 iterations), fathomed 2 nodes and fixed 0 variables
Cbc0035I Maximum depth 7, 8 variables fixed on reduced cost
Cuts at root node changed objective from -131872 to -70095.1
Probing was tried 292 times and created 56631 cuts of which 1478 were active after adding rounds of cuts (5.380 seconds)
Gomory was tried 291 times and created 56774 cuts of which 0 were active after adding rounds of cuts (5.212 seconds)
Knapsack was tried 291 times and created 2076 cuts of which 0 were active after adding rounds of cuts (1.098 seconds)
Clique was tried 170 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.286 seconds)
MixedIntegerRounding2 was tried 170 times and created 36 cuts of which 0 were active after adding rounds of cuts (2.082 seconds)
FlowCover was tried 170 times and created 2 cuts of which 0 were active after adding rounds of cuts (0.080 seconds)
TwoMirCuts was tried 291 times and created 10239 cuts of which 0 were active after adding rounds of cuts (1.762 seconds)
ZeroHalf was tried 2 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.065 seconds)
ImplicationCuts was tried 93 times and created 2223 cuts of which 0 were active after adding rounds of cuts (0.595 seconds)

Result - Stopped on time limit

Objective value:                100000000000000007629769841091887003294964970946560.00000000
Lower bound:                    -66530.320
Gap:                            1503074085339087925432970472628447629652525056.00
Enumerated nodes:               39
Total iterations:               106525
Time (CPU seconds):             69.63
Time (Wallclock seconds):       70.05

Total time (CPU seconds):       69.63   (Wallclock seconds):       70.05

     1: MIP-TL      70.58                       -inf. | inf.            inf. | inf.                 | inf.


╶ Solution report ────────────────────────────────────────────────────────────────────────────────────────────────────╴

 Terminated since time limit was reached.

 No solution found. Try modifying the termination criteria.

 Objective bound (minimization) [dual, primal]:  [-inf., inf.]
 Objective gap absolute / relative:              inf. / inf.

 Fulfilled termination criteria:
  - solution time limit (s)                      70.5761 > 70

 Unfulfilled termination criteria:
  - absolute objective gap tolerance             inf > 0.001
  - relative objective gap tolerance             inf > 0.001
  - maximal constraint tolerance                 1.79769e+308 > 1e-08
  - iteration limit                              1 <= 200000

 Dual problems solved in main step:              1
  - MILP problems, feasible                      1

 Number of explored nodes:                       39

 Total solution time:                            70.5761
  - problem reformulation:                       0.00574987
  - bound tightening:                            0.364141
    - feasibility based (original problem):      0.364127
  - dual strategy:                               70.0614
    - root search for constraint cuts:           8.351e-06
  - primal strategy:                             0.000580469
    - solving NLP problems:                      0.000495661

╶─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╴

 Results written to: /home/aton3/alundell/Research/SHOT/SHOT-COINOR/build/release/autocorr_bern25-13.osrl
 Log written to:     /home/aton3/alundell/Research/SHOT/SHOT-COINOR/build/release/SHOT.log

So although it has found an integer solution, it claims the problem is infeasible. Also the return status should not be infeasible, but that a time limit has occured.

Well if I then run it with standalone Cbc (and the LP-file produced by Cbc in the same run), I get the following output:


Welcome to the CBC MILP Solver
Version: 2.10.4
Build Date: Feb 17 2020

command line - /opt/cbc-2.10.4/bin/cbc lp0.lp -autoscale off -nodestrategy fewest -scaling automatic -strategy 1 -cutoff 1e+100 -sec 69.478272985 -threads 101 -solve -quit
cutoff was changed from 1e+100 to 1e+100
seconds was changed from 1e+100 to 69.4783
threads was changed from 0 to 101
Continuous objective value is -131872 - 0.20 seconds
Cgl0004I processed model has 3737 rows, 1783 columns (1560 integer (1560 of which binary)) and 16587 elements
Cbc0038I Initial state - 1075 integers unsatisfied sum - 537.5
Cbc0038I Pass   1: (0.35 seconds) suminf.  118.51282 (449) obj. -39926.9 iterations 1380
Cbc0038I Pass   2: (0.36 seconds) suminf.  118.25000 (419) obj. -38690 iterations 37
Cbc0038I Pass   3: (0.37 seconds) suminf.  118.25000 (419) obj. -38690 iterations 31
Cbc0038I Pass   4: (0.38 seconds) suminf.  112.16667 (396) obj. -36811.7 iterations 91
Cbc0038I Pass   5: (0.39 seconds) suminf.  111.95833 (403) obj. -36430 iterations 35
Cbc0038I Pass   6: (0.39 seconds) suminf.  111.95833 (403) obj. -36430 iterations 31
Cbc0038I Pass   7: (0.40 seconds) suminf.  111.95833 (403) obj. -36430 iterations 13
Cbc0038I Pass   8: (0.41 seconds) suminf.  108.45455 (418) obj. -37136.1 iterations 85
Cbc0038I Pass   9: (0.42 seconds) suminf.  108.16667 (384) obj. -34832.2 iterations 41
Cbc0038I Pass  10: (0.43 seconds) suminf.  103.44444 (386) obj. -34836.8 iterations 70
Cbc0038I Pass  11: (0.44 seconds) suminf.  103.25000 (366) obj. -34295 iterations 52
Cbc0038I Pass  12: (0.45 seconds) suminf.  103.25000 (366) obj. -34295 iterations 18
Cbc0038I Pass  13: (0.46 seconds) suminf.  103.25000 (366) obj. -34295 iterations 15
Cbc0038I Pass  14: (0.51 seconds) suminf.   96.66667 (290) obj. -8682.67 iterations 620
Cbc0038I Pass  15: (0.52 seconds) suminf.   96.66667 (290) obj. -8682.67 iterations 26
Cbc0038I Pass  16: (0.53 seconds) suminf.   93.66667 (281) obj. -7786.67 iterations 58
Cbc0038I Pass  17: (0.54 seconds) suminf.   93.66667 (281) obj. -7786.67 iterations 27
Cbc0038I Pass  18: (0.55 seconds) suminf.   88.00000 (264) obj. -6954.67 iterations 98
Cbc0038I Pass  19: (0.56 seconds) suminf.   88.00000 (264) obj. -6954.67 iterations 34
Cbc0038I Pass  20: (0.57 seconds) suminf.   86.66667 (260) obj. -6677.33 iterations 50
Cbc0038I Pass  21: (0.57 seconds) suminf.   86.66667 (260) obj. -6677.33 iterations 25
Cbc0038I Pass  22: (0.58 seconds) suminf.   82.66667 (248) obj. -5717.33 iterations 57
Cbc0038I Pass  23: (0.59 seconds) suminf.   82.66667 (248) obj. -5717.33 iterations 18
Cbc0038I Pass  24: (0.60 seconds) suminf.   75.61111 (226) obj. -5761.78 iterations 105
Cbc0038I Pass  25: (0.61 seconds) suminf.   75.16667 (225) obj. -5690.67 iterations 22
Cbc0038I Pass  26: (0.61 seconds) suminf.   74.66667 (224) obj. -5754.67 iterations 2
Cbc0038I Pass  27: (0.62 seconds) suminf.   71.33333 (214) obj. -5882.67 iterations 55
Cbc0038I Pass  28: (0.62 seconds) suminf.   71.33333 (214) obj. -5882.67 iterations 17
Cbc0038I Pass  29: (0.63 seconds) suminf.   68.66667 (206) obj. -5221.33 iterations 59
Cbc0038I Pass  30: (0.64 seconds) suminf.   68.66667 (206) obj. -5221.33 iterations 32
Cbc0038I Rounding solution of 5889.33 is better than previous of 1e+50

Cbc0038I Before mini branch and bound, 430 integers at bound fixed and 0 continuous
Cbc0038I Full problem 3737 rows 1783 columns, reduced to 3307 rows 1353 columns - too large
Cbc0038I Mini branch and bound did not improve solution (0.66 seconds)
Cbc0038I Round again with cutoff of -7886.8
Cbc0038I Pass  30: (0.66 seconds) suminf.  118.51282 (449) obj. -39926.9 iterations 0
Cbc0038I Pass  31: (0.67 seconds) suminf.  118.25000 (419) obj. -38690 iterations 70
Cbc0038I Pass  32: (0.68 seconds) suminf.  110.08333 (398) obj. -34710 iterations 66
Cbc0038I Pass  33: (0.69 seconds) suminf.  110.08333 (398) obj. -34710 iterations 22
Cbc0038I Pass  34: (0.69 seconds) suminf.  110.08333 (398) obj. -34710 iterations 16
Cbc0038I Pass  35: (0.74 seconds) suminf.  102.66667 (308) obj. -7886.8 iterations 579
Cbc0038I Pass  36: (0.74 seconds) suminf.  102.66667 (308) obj. -7886.8 iterations 31
Cbc0038I Pass  37: (0.77 seconds) suminf.   98.66667 (296) obj. -7886.8 iterations 141
Cbc0038I Pass  38: (0.77 seconds) suminf.   98.66667 (296) obj. -7886.8 iterations 26
Cbc0038I Pass  39: (0.80 seconds) suminf.   95.82796 (287) obj. -7886.8 iterations 213
Cbc0038I Pass  40: (0.81 seconds) suminf.   95.80786 (287) obj. -7886.8 iterations 30
Cbc0038I Pass  41: (0.82 seconds) suminf.   87.33333 (262) obj. -9930.67 iterations 106
Cbc0038I Pass  42: (0.83 seconds) suminf.   87.33333 (262) obj. -9930.67 iterations 30
Cbc0038I Pass  43: (0.84 seconds) suminf.   82.00000 (246) obj. -8032 iterations 57
Cbc0038I Pass  44: (0.85 seconds) suminf.   82.00000 (246) obj. -8032 iterations 20
Cbc0038I Pass  45: (0.87 seconds) suminf.   76.20080 (228) obj. -7886.8 iterations 197
Cbc0038I Pass  46: (0.88 seconds) suminf.   76.07585 (228) obj. -7886.8 iterations 24
Cbc0038I Pass  47: (0.88 seconds) suminf.   73.25126 (218) obj. -7886.8 iterations 42
Cbc0038I Pass  48: (0.89 seconds) suminf.   73.25126 (218) obj. -7886.8 iterations 25
Cbc0038I Pass  49: (0.90 seconds) suminf.   68.33333 (205) obj. -10712 iterations 68
Cbc0038I Pass  50: (0.91 seconds) suminf.   68.33333 (205) obj. -10712 iterations 15
Cbc0038I Pass  51: (0.92 seconds) suminf.   64.72222 (193) obj. -10098.7 iterations 75
Cbc0038I Pass  52: (0.92 seconds) suminf.   63.33333 (190) obj. -10088 iterations 25
Cbc0038I Pass  53: (0.93 seconds) suminf.   59.33333 (178) obj. -8530.67 iterations 59
Cbc0038I Pass  54: (0.94 seconds) suminf.   59.33333 (178) obj. -8530.67 iterations 28
Cbc0038I Pass  55: (0.95 seconds) suminf.   54.05556 (161) obj. -8152 iterations 105
Cbc0038I Pass  56: (0.96 seconds) suminf.   53.16667 (159) obj. -7896 iterations 31
Cbc0038I Pass  57: (0.97 seconds) suminf.   50.44663 (150) obj. -7886.8 iterations 64
Cbc0038I Pass  58: (0.97 seconds) suminf.   50.44663 (150) obj. -7886.8 iterations 20
Cbc0038I Pass  59: (0.99 seconds) suminf.   45.60220 (136) obj. -7886.8 iterations 127
Cbc0038I Rounding solution of -3525.33 is better than previous of 5889.33

Cbc0038I Before mini branch and bound, 431 integers at bound fixed and 0 continuous
Cbc0038I Full problem 3737 rows 1783 columns, reduced to 3306 rows 1352 columns - too large
Cbc0038I Mini branch and bound did not improve solution (1.00 seconds)
Cbc0038I Round again with cutoff of -32683.8
Cbc0038I Pass  59: (1.01 seconds) suminf.  118.51282 (449) obj. -39926.9 iterations 0
Cbc0038I Pass  60: (1.02 seconds) suminf.  118.25000 (419) obj. -38690 iterations 70
Cbc0038I Pass  61: (1.02 seconds) suminf.  118.25000 (419) obj. -38690 iterations 10
Cbc0038I Pass  62: (1.04 seconds) suminf.  112.25926 (420) obj. -38372.6 iterations 93
Cbc0038I Pass  63: (1.05 seconds) suminf.  112.25926 (420) obj. -38372.6 iterations 59
Cbc0038I Pass  64: (1.06 seconds) suminf.  111.92593 (426) obj. -36912 iterations 49
Cbc0038I Pass  65: (1.07 seconds) suminf.  111.91667 (394) obj. -36832.2 iterations 57
Cbc0038I Pass  66: (1.07 seconds) suminf.  110.00000 (414) obj. -36852 iterations 59
Cbc0038I Pass  67: (1.08 seconds) suminf.  110.00000 (414) obj. -36852 iterations 52
Cbc0038I Pass  68: (1.10 seconds) suminf.  105.11111 (407) obj. -36018.9 iterations 119
Cbc0038I Pass  69: (1.11 seconds) suminf.  104.37037 (399) obj. -34869.2 iterations 87
Cbc0038I Pass  70: (1.12 seconds) suminf.  104.37037 (399) obj. -34869.2 iterations 9
Cbc0038I Pass  71: (1.13 seconds) suminf.   98.18519 (381) obj. -32850.6 iterations 122
Cbc0038I Pass  72: (1.15 seconds) suminf.   96.80000 (335) obj. -36657.6 iterations 85
Cbc0038I Pass  73: (1.15 seconds) suminf.   96.33333 (334) obj. -36642.7 iterations 6
Cbc0038I Pass  74: (1.16 seconds) suminf.   93.91667 (344) obj. -35420.2 iterations 51
Cbc0038I Pass  75: (1.17 seconds) suminf.   93.92500 (343) obj. -35451.5 iterations 43
Cbc0038I Pass  76: (1.18 seconds) suminf.   90.96795 (358) obj. -33252.5 iterations 70
Cbc0038I Pass  77: (1.18 seconds) suminf.   90.58333 (349) obj. -33897.2 iterations 40
Cbc0038I Pass  78: (1.19 seconds) suminf.   81.83333 (322) obj. -32683.8 iterations 71
Cbc0038I Pass  79: (1.20 seconds) suminf.   81.56061 (325) obj. -32683.8 iterations 24
Cbc0038I Pass  80: (1.21 seconds) suminf.   81.31818 (326) obj. -32683.8 iterations 37
Cbc0038I Pass  81: (1.22 seconds) suminf.   74.81004 (311) obj. -32683.8 iterations 54
Cbc0038I Pass  82: (1.22 seconds) suminf.   74.80133 (310) obj. -32683.8 iterations 27
Cbc0038I Pass  83: (1.24 seconds) suminf.   69.10270 (265) obj. -32683.8 iterations 132
Cbc0038I Pass  84: (1.24 seconds) suminf.   69.10270 (265) obj. -32683.8 iterations 22
Cbc0038I Pass  85: (1.25 seconds) suminf.   68.98541 (265) obj. -32683.8 iterations 35
Cbc0038I Pass  86: (1.26 seconds) suminf.   68.98541 (265) obj. -32683.8 iterations 25
Cbc0038I Pass  87: (1.26 seconds) suminf.   67.51870 (261) obj. -32683.8 iterations 49
Cbc0038I Pass  88: (1.27 seconds) suminf.   67.20352 (261) obj. -32683.8 iterations 15
Cbc0038I No solution found this major pass
Cbc0038I Before mini branch and bound, 450 integers at bound fixed and 19 continuous
Cbc0038I Full problem 3737 rows 1783 columns, reduced to 3249 rows 1314 columns - too large
Cbc0038I Mini branch and bound did not improve solution (1.29 seconds)
Cbc0038I After 1.29 seconds - Feasibility pump exiting with objective of -3525.33 - took 1.02 seconds
Cbc0012I Integer solution of -7520 found by feasibility pump after 0 iterations and 0 nodes (1.29 seconds)
Cbc0031I 1344 added rows had average density of 11.306548
Cbc0013I At root node, 1344 cuts changed objective from -131872 to -69829.321 in 91 passes
Cbc0014I Cut generator 0 (Probing) - 12737 row cuts average 2.0 elements, 0 column cuts (377 active)  in 7.849 seconds - new frequency is 1
Cbc0014I Cut generator 1 (Gomory) - 17555 row cuts average 44.3 elements, 0 column cuts (0 active)  in 5.412 seconds - new frequency is 1
Cbc0014I Cut generator 2 (Knapsack) - 989 row cuts average 2.0 elements, 0 column cuts (0 active)  in 0.818 seconds - new frequency is 1
Cbc0014I Cut generator 3 (Clique) - 0 row cuts average 0.0 elements, 0 column cuts (0 active)  in 0.298 seconds - new frequency is -100
Cbc0014I Cut generator 4 (MixedIntegerRounding2) - 47 row cuts average 36.0 elements, 0 column cuts (0 active)  in 2.428 seconds - new frequency is -100
Cbc0014I Cut generator 5 (FlowCover) - 3 row cuts average 2.0 elements, 0 column cuts (0 active)  in 0.107 seconds - new frequency is -100
Cbc0014I Cut generator 6 (TwoMirCuts) - 2614 row cuts average 31.3 elements, 0 column cuts (0 active)  in 0.784 seconds - new frequency is 1
Cbc0010I After 0 nodes, 1 on tree, -7520 best solution, best possible -69829.321 (40.70 seconds)
Cbc0016I Integer solution of -7832 found by strong branching after 98191 iterations and 28 nodes (69.15 seconds)
Clp0006I 0  Obj -7840.0005 Primal inf 0.20250189 (1)
Cbc0012I Integer solution of -7832 found by heuristic after 98148 iterations and 27 nodes (69.49 seconds)
Cbc0030I Thread 0 used 3 times,  waiting to start 14.004904, 14.835831 cpu time, 0 locks, 0 locked, 0 waiting for locks
Cbc0030I Main thread 14.890258 waiting for threads,  0 locks, 0 locked, 0 waiting for locks
Cbc0020I Exiting on maximum time
Cbc0005I Partial search - best objective -7832 (best possible -69829.321), took 98602 iterations and 37 nodes (69.54 seconds)
Cbc0032I Strong branching done 696 times (33924 iterations), fathomed 1 nodes and fixed 0 variables
Cbc0035I Maximum depth 26, 15 variables fixed on reduced cost
Cuts at root node changed objective from -131872 to -69829.3
Probing was tried 301 times and created 56797 cuts of which 754 were active after adding rounds of cuts (9.763 seconds)
Gomory was tried 300 times and created 51105 cuts of which 0 were active after adding rounds of cuts (7.003 seconds)
Knapsack was tried 300 times and created 3547 cuts of which 0 were active after adding rounds of cuts (1.087 seconds)
Clique was tried 182 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.298 seconds)
MixedIntegerRounding2 was tried 182 times and created 94 cuts of which 0 were active after adding rounds of cuts (2.428 seconds)
FlowCover was tried 182 times and created 6 cuts of which 0 were active after adding rounds of cuts (0.107 seconds)
TwoMirCuts was tried 300 times and created 8827 cuts of which 0 were active after adding rounds of cuts (1.604 seconds)
ZeroHalf was tried 2 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.068 seconds)
ImplicationCuts was tried 80 times and created 3007 cuts of which 0 were active after adding rounds of cuts (1.876 seconds)

Result - Stopped on time limit

Objective value:                -7832.00000000
Lower bound:                    -69829.321
Gap:                            0.89
Enumerated nodes:               37
Total iterations:               98602
Time (CPU seconds):             69.67
Time (Wallclock seconds):       69.92

Total time (CPU seconds):       69.67   (Wallclock seconds):       69.93

I do not know if there is something wrong in the Cbc call by SHOT or a bug in Cbc, but there seems to be different behavior when calling Cbc directly. The return status is correct in this case, and the solution is reported. There also seems to be a lot more output lines written to screen when calling Cbc directly.

Can you verify this @svigerske? And do you have any suggestions, or do you believe this is a bug in Cbc?

user termination check not checked during (long) MIP solve

I wanted to try out the MIP reformulation that SHOT can do on models like MINLPLib/tln5 (binarizing integer variables and linearizing products of binary variables). By looking into the SHOT code, I figured out that I needed to set Model.Reformulation.Constraint.PartitionNonlinearTerms = 0 to make this happen.
I then get a MIP which takes CPLEX very long to solve.

I cannot interrupt the solve via SIGINT, which is something that should happen through this callback in the GAMS interface:

            solver.registerCallback(
                E_EventType::UserTerminationCheck, [&env, gev = (gevHandle_t)gmoEnvironment(gs->gmo)] {
                    if(gevTerminateGet(gev))
                        env->tasks->terminate();
                });

It would be nice if this termination check could be executed from time to time during a MIP solver run, too.

GAMS return codes

Is there some way to get a meaningful text out of the GAMS error return codes using the C++ API? For example, when I give an integer variable a noninteger bound it seems to return code 768. But I cannot find the meaning of this code anywhere...

Cbc stability

Cbc is still not as stable as CPLEX/Gurobi for solving MIP problems. It is recommended that either CPLEX or Gurobi is used if these are available.

Convex MINLP problems with issues:

SHOT exits abruptly on Windows

I am using pyomo for a MIQP problem and SHOT just exits abruptly after sometime. I tried using the .nl problem file generated by pyomo directly from SHOT command line but it still exits abruptly. Log is attached. I have been using the same problem with Bonmin solver and it works fine. I am using the SHOT binaries for windows.
SHOT.log

constant not initialized in Simplifications.h:convertSquareToUnivariteQuadraticExpression()

With current master, I get this warning:

Model/Simplifications.h:1061:42: warning: ‘constant’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 1061 |         std::make_shared<LinearTerm>(2.0 * constant * variableCoefficient, variable), constant * constant);
      |                                      ~~~~^~~~~~~~~~

I wouldn't know for sure how to fix this.
The code does

    double constant;

    if(sum->children[0]->getType() == E_NonlinearExpressionTypes::Constant)
    {
        constant = std::dynamic_pointer_cast<ExpressionConstant>(sum->children[0])->constant;
        ...
    }
    else if(sum->children[1]->getType() == E_NonlinearExpressionTypes::Constant)
    {
        constant = std::dynamic_pointer_cast<ExpressionConstant>(sum->children[1])->constant;
        ...
    }

    resultingExpression = std::make_tuple(
        std::make_shared<QuadraticTerm>(variableCoefficient * variableCoefficient, variable, variable),
        std::make_shared<LinearTerm>(2.0 * constant * variableCoefficient, variable), constant * constant);

So should the last be called also if neither term of the sum is a constant, maybe with constant=0?

Or is there a

else
   return resultingExpression;

missing before?

segfault in SHOT::MIPSolverCplex::addMIPStart

With GAMS modellib model gear and current master + changes from #124, I get a deference of a null-pointer inside IloCPLEX from

        cplexInstance.addMIPStart(cplexVars, startVal, IloCplex::MIPStartRepair);

I don't really know where this comes from. cplexVars and startVal seem to be non-null and also cplexInstance.getImpl() isn't null.

╶ Supporting Hyperplane Optimization Toolkit (SHOT) ──────────────────────────────────────────────────────────────────╴

 Andreas Lundell and Jan Kronqvist, Åbo Akademi University, Finland.
 See documentation for full list of contributors and utilized software libraries.

 Version: 1.0.1. Git hash: 2083800b. Released: Jun 30 2021.

 For more information visit https://shotsolver.dev

 Time to extract information on quadratics: 0.033000
 Performing bound tightening on reformulated problem.
  - Bounds for 0 variables tightened in 0.05 s and 1 passes.

╶ Problem instance ───────────────────────────────────────────────────────────────────────────────────────────────────╴

                                    Original             Reformulated

 Problem classification:            MINLP, nonconvex     MINLP, nonconvex

 Objective function direction:      minimize             minimize
 Objective function type:           nonlinear            nonlinear

 Number of constraints:             2                    2
  - linear:                         2                    2

 Number of variables:               4                    4
  - integer:                        4                    4
  - nonlinear:                      4                    4

╶ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────╴

 No options file specified.

 Options specified:

  - Dual.ESH.InteriorPoint.CuttingPlane.IterationLimit = 50
  - Dual.HyperplaneCuts.ConstraintSelectionFactor = 1
  - Dual.HyperplaneCuts.UseIntegerCuts = true
  - Dual.MIP.NumberOfThreads = 1
  - Dual.MIP.Presolve.UpdateObtainedBounds = false
  - Dual.MIP.SolutionLimit.Initial = 2147483647
  - Dual.Relaxation.Use = false
  - Dual.TreeStrategy = 0
  - Model.Variables.Continuous.MaximumUpperBound = 1e+20
  - Model.Variables.Continuous.MinimumLowerBound = -1e+20
  - Primal.FixedInteger.CallStrategy = 0
  - Primal.FixedInteger.OnlyUniqueIntegerCombinations = false
  - Primal.FixedInteger.Solver = 1
  - Primal.FixedInteger.Source = 0
  - Subsolver.Ipopt.LinearSolver = 1
  - Termination.IterationLimit = 2147483647
  - Termination.ObjectiveGap.Absolute = 1e-10
  - Termination.ObjectiveGap.Relative = 1e-05
  - Termination.TimeLimit = 10000000000

 Dual strategy:              Multi-tree
  - cut algorithm:           ESH
  - solver:                  CPLEX 20.1

 Primal NLP solver:          CONOPT (automatically selected) in GAMS 36.0


╶ Main iteration step ────────────────────────────────────────────────────────────────────────────────────────────────╴

    Iteration     │  Time  │  Dual cuts  │     Objective value     │   Objective gap   │     Current solution
     #: type      │  tot.  │   + | tot.  │       dual | primal     │    abs. | rel.    │    obj.fn. | max.err.
╶─────────────────┴────────┴─────────────┴─────────────────────────┴───────────────────┴──────────────────────────────╴

     1: MILP-O       4.11                           0 | 36.1768      3.6e+01 | 1.0e+00            0 | 0                
     1: NLPNEWDB-O   5.60                           0 | 36.1768      3.6e+01 | 1.0e+00      36.1768 | 0                
     2: MILP-O       6.05      2 | 2                0*| 9.10921      9.1e+00 | 1.0e+00            0 | 0                
     3: MILP-O       6.21      2 | 4                0*| 2.31395      2.3e+00 | 1.0e+00            0 | 0                
     4: MILP-O       8.58      2 | 6                0*| 1.00702      1.0e+00 | 1.0e+00            0 | 0                
==1758163== Invalid read of size 8
==1758163==    at 0x5D4E815: IloCplexI::addMIPStart(IloNumVarArray, IloNumArray, IloCplex::MIPStartEffort, char const*) (in /home/stefan/work/gams/build/gms test/libshtcclib64.so)
==1758163==    by 0x58E8920: IloCplex::addMIPStart(IloNumVarArray, IloNumArray, IloCplex::MIPStartEffort, char const*) (ilocplex.h:516)
==1758163==    by 0x58E2354: SHOT::MIPSolverCplex::addMIPStart(std::vector<double, std::allocator<double> >) (MIPSolverCplex.cpp:1275)
==1758163==    by 0x5AF570F: SHOT::TaskPresolve::run() (TaskPresolve.cpp:72)
==1758163==    by 0x5AC2DD2: SHOT::SolutionStrategyMultiTree::solveProblem() (SolutionStrategyMultiTree.cpp:330)
==1758163==    by 0x58786DD: SHOT::Solver::solveProblem() (Solver.cpp:597)
==1758163==    by 0x5983838: shtCallSolver (EntryPointsGAMS.cpp:213)
==1758163==    by 0x5983E90: C__shtCallSolver (EntryPointsGAMS.cpp:270)
==1758163==    by 0x52E03F5: GMSCONF_tgmsconf_DOT_sccallsolver(GMSCONF_tgmsconf_OD_S*, int, void*, void*) (gmsconf.c:2783)
==1758163==    by 0x52D3B61: libsolver(unsigned char*, unsigned char*, unsigned char const*, GMOMDODEFEX_tgmomodel_OD_S**, GEVDOORG_tgmsenvironment_OD_S**) (gevdoorg.c:3068)
==1758163==    by 0x52D5263: GEVDOORG_tgmsenvironment_DOT_gevcallsolver(GEVDOORG_tgmsenvironment_OD_S*, void*, unsigned char const*, unsigned char const*, int, int, unsigned char const*, unsigned char const*, double, int, int, double, double, void**, unsigned char*) (gevdoorg.c:3457)
==1758163==    by 0x52634E7: gevcallsolver (joatdclib.c:5867)
==1758163==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==1758163== 

Do you have some idea what goes wrong?

GAMS installation scripts

Will the GAMS installation scripts work in the future if there is already a solver named SHOT in GAMS? Or is it simply to change "SHOT" in the scripts to something unique?

NaN or inf found in linear terms

On model kport from the GAMS model library, I get plenty of this in the SHOT log:

     1: LP           0.02                      -1e+12 | -1e+12          inf. | inf.    
        Hyperplane for constraint SPP(L10)_rf  not generated,  NaN or inf found in linear terms for f(R1,L10) = 0.400000
        Hyperplane for constraint SPP(L10)_rf  not generated,  NaN or inf found in linear terms for f(R2,L10) = 0.400000
        Hyperplane for constraint SPP(L10)_rf  not generated,  NaN or inf found in linear terms for vR(R1) = 102.140000
        Hyperplane for constraint SPP(L10)_rf  not generated,  NaN or inf found in linear terms for vR(R2) = 176.070000
        Hyperplane for constraint SPP(L10)_rf  not generated,  NaN or inf found in linear terms for nB(R1,L10) = 0.000000
        Hyperplane for constraint SPP(L10)_rf  not generated,  NaN or inf found in linear terms for nB(R2,L10) = 0.000000

and eventually

 Terminated since no additional dual cuts can be added.

 No solution found. Try modifying the termination criteria.

unused CPLEX callback functions

I get this warning:

MIPSolverCplexSingleTreeLegacy.cpp:278:27: warning: ‘IloCplex::Callback SHOT::CtCallback(SHOT::EnvironmentPtr, IloEnv, IloNumVarArray)’ defined but not used [-Wunused-function]
  278 | static IloCplex::Callback CtCallback(EnvironmentPtr envPtr, IloEnv iloEnv, IloNumVarArray cplexVars)
      |                           ^~~~~~~~~~
MIPSolverCplexSingleTreeLegacy.cpp:174:27: warning: ‘IloCplex::Callback SHOT::InfoCallback(SHOT::EnvironmentPtr, IloEnv)’ defined but not used [-Wunused-function]
  174 | static IloCplex::Callback InfoCallback(EnvironmentPtr envPtr, IloEnv iloEnv)
      |                           ^~~~~~~~~~~~
MIPSolverCplexSingleTreeLegacy.cpp:57:27: warning: ‘IloCplex::Callback SHOT::HCallback(SHOT::EnvironmentPtr, IloEnv, IloNumVarArray)’ defined but not used [-Wunused-function]
   57 | static IloCplex::Callback HCallback(EnvironmentPtr envPtr, IloEnv iloEnv, IloNumVarArray cplexVars)
      |                           ^~~~~~~~~

It seems to be right that these are not used. Can one just remove them?

Cbc with multiple threads

Just checking @svigerske, can you run SHOT with Cbc with multiple threads? The standalone binary of Cbc can solve the same problem when read from an LP-file, but when I solve it through SHOT it just runs one thread...

The same seems to happen when I use Cbc using its interactive shell... I would assume Cbc is very picky with how the different arguments are given to it.

Compiling SHOT with GAMS 33.2

When compiling SHOT with the newest GAMS version (33.2) I get the following errors:

libSHOTSolver.so: undefined reference to `GC_mutex_unlock'
libSHOTSolver.so: undefined reference to `GC_mutex_lock'
libSHOTSolver.so: undefined reference to `GC_mutex_delete'
libSHOTSolver.so: undefined reference to `GC_mutex_init'
collect2: error: ld returned 1 exit status

In the release notes I found that: The new files gcmt.c and gcmt.h are now required when compiling/linking C expert level API files (e.g. gdxcc.c/h) to protect critical sections in the interface for multi-threaded applications. On some platforms, this might also require linking against additional libraries, e.g. libpthread on Linux. Adding the define GC_NO_MUTEX when compiling the C expert level API files provides the old behavior.

When updating CMakeLists.txt to include:

set(PRIMAL_SOURCES ${PRIMAL_SOURCES} "${GAMS_DIR}/apifiles/C/api/gcmt.c")
set(PRIMAL_HEADERS ${PRIMAL_HEADERS} "${GAMS_DIR}/apifiles/C/api/gcmt.h")

I get it working again. However, this does of course not work when compiling with an older version of GAMS since these files are not present. So I see that I have the following options

  1. Require a GAMS version >=33.
  2. Make the includes optional by adding an parameter to CMake that specifies the GAMS version.
  3. Somehow automatically figure out the GAMS version in CMake and use this information to optionally include the files.

I would prefer not to do 1 since I would guess there are a lot of people using older GAMS versions. I would also prefer not to do 2 since this introduces yet another CMake parameter.

So do you @svigerske have an idea of how to easiest get the GAMS version in CMake?

getDualAuxiliaryObjectiveVariableIndex uninitialized in Cbc interface

This code in MIPSolverCbc.cpp:518 leads to a segmentation fault on GAMS model library model fuel with Cbc as MIP solver:

    if(MIPSolutionStatus == E_ProblemSolutionStatus::Infeasible)
    {
        if(env->reformulatedProblem->objectiveFunction->properties.classification
            == E_ObjectiveFunctionClassification::QuadraticConsideredAsNonlinear)
        {
            osiInterface->setColBounds(getDualAuxiliaryObjectiveVariableIndex(), -1000000000.0, 1000000000.0);

getDualAuxiliaryObjectiveVariableIndex() returns garbage (uninitialized value).

I'm using SHOT master (6e1409b).

Last lines of the log before:

    Iteration     │  Time  │    Cuts     │     Objective value     │  Objective diff.   
     #: type      │  tot.  │   + | tot.  │    problem | line srch  │    abs. | rel.    
╶─────────────────┴────────┴─────────────┴─────────────────────────┴──────────────────╴

     1: LP           0.05                      -1e+12 | -1e+12          inf. | inf.    
     2: LP           0.05      2 | 2             -550 | 755.127      1.3e+03 | 2.4e+00 
     3: LP           0.08      2 | 4             -550 | 254.386      8.0e+02 | 1.5e+00 
     4: LP           0.08      2 | 6          -307.27 | 204.461      5.1e+02 | 1.7e+00 
     5: LP           0.08      2 | 8         -100.909 | 127.407      2.3e+02 | 2.3e+00 

Redirect GAMS output

Is there some simple way of redirecting also the GAMS output to spdlog when running SHOT directly but using e.g. CONOPT as NLP solver?

Build error due to Clp linking (windows,mingw64)

I'm interested in evaluating this software as emergency/open-source MICQP solver (potentially replacing automatic-differentiation based internals). In regards to my potential use-case, i'm focusing on a mingw-64-based windows build now. Not having binary-releases available maybe indicates all that trouble.

I'm pretty positive, that i solved the preparation of Cbc + Ipopt for now (the tests do). Building SHOT however does not work for me.

I modified some cmake-based scripts (in a rather hacky way) for my case as it will fail to find Cbc + Ipopt otherwise:

FindCBC.cmake

-  set(ENV{PKG_CONFIG_PATH} "${CBC_DIR}/lib/pkgconfig")
+  set(ENV{PKG_CONFIG_PATH} "X:/msys64_coin/usr/local/lib/pkgconfig")

CMakeLists.txt

-  set(ENV{PKG_CONFIG_PATH} "${IPOPT_DIR}/lib/pkgconfig")
+  set(ENV{PKG_CONFIG_PATH} "X:/msys64_coin/usr/local/lib/pkgconfig")

cmake was then started with:

cmake -G "Unix Makefiles" -DHAS_GAMS=False -DHAS_GUROBI=False -DHAS_CPLEX=False -DCMAKE_BUILD_TYPE=Release ..

resulting in:

-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Check for working C compiler: X:/msys64_coin/mingw64/bin/cc.exe
-- Check for working C compiler: X:/msys64_coin/mingw64/bin/cc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: X:/msys64_coin/mingw64/bin/c++.exe
-- Check for working CXX compiler: X:/msys64_coin/mingw64/bin/c++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include filesystem
-- Looking for C++ include filesystem - found
-- Performing Test CAN_COMPILE_FS_WITHOUT_LINK
-- Performing Test CAN_COMPILE_FS_WITHOUT_LINK - Failed
-- Performing Test CAN_COMPILE_FS_WITH_LINK
-- Performing Test CAN_COMPILE_FS_WITH_LINK - Success
-- Git hash: 59178b4-dirty
-- Found PkgConfig: X:/msys64_coin/mingw64/bin/pkg-config.exe (found version "0.29.2")
-- Checking for one of the modules 'cbc'
-- Cbc found using Pkg-config:
   Include directories found: X:/msys64_coin/usr/local/include/coin;X:/msys64_coin/usr/local/include/coin/ThirdParty;X:/msys64_coin/usr/local/include/coin;X:/msys64_coin/usr/local/include/coin/ThirdParty
   Library directories found: X:/msys64_coin/usr/local/lib
-- Found CBC: CbcSolver;Cbc;pthread;Cgl;OsiClp;ClpSolver;Clp;coinasl;m;Osi;CoinUtils;bz2;z;lapack;blas;m;coinglpk;m;gmp
-- Checking for one of the modules 'ipopt'
-- Cbc include files will be used from: X:/msys64_coin/usr/local/include/coin;X:/msys64_coin/usr/local/include/coin/ThirdParty;X:/msys64_coin/usr/local/include/coin;X:/msys64_coin/usr/local/include/coin/ThirdParty
-- The following Cbc libraries will be used from: X:/msys64_coin/usr/local/lib
   CbcSolver;Cbc;pthread;Cgl;OsiClp;ClpSolver;Clp;coinasl;m;Osi;CoinUtils;bz2;z;lapack;blas;m;coinglpk;m;gmp
-- Configuring done
-- Generating done
-- Build files have been written to: X:/COIN_BUILD/2/SHOT/build

(mumps may be missing due to my recent experiments; i'm pretty sure i was there on my first approach)

invoking make then results eventually in:

[ 96%] Building CXX object CMakeFiles/SHOTSolver.dir/ThirdParty/ampl/src/os.cc.obj
[ 97%] Linking CXX shared library libSHOTSolver.dll
X:/msys64_coin/usr/local/lib/libClp.a(ClpCholeskyMumps.o):ClpCholeskyMumps.cpp:(.text+0x68): undefined reference to `dmumps_c'
X:/msys64_coin/usr/local/lib/libClp.a(ClpCholeskyMumps.o):ClpCholeskyMumps.cpp:(.text+0x6d): undefined reference to `MPI_Finalize'

This is only a partial output, as further experiments (see comment about mumps above) induced more linking errors, probably because i forgot to prepare Mumps (so this one should be ignored for now):

X:/msys64_coin/usr/local/lib/libClp.a(ClpCholeskyMumps.o):ClpCholeskyMumps.cpp:(.text+0x68): undefined reference to `dmumps_c'

Above further experiments are building Cbc/Clp --without-mumps

Maybe these lines:

#define MPI_COMM_WORLD CLP_MPI_COMM_WORLD
#define JOB_INIT -1
#define JOB_END -2
#define USE_COMM_WORLD -987654
extern "C" {
#include "dmumps_c.h"
// In newer ThirdParty/Mumps, mpi.h is renamed to mumps_mpi.h.
// We get informed about this by having COIN_USE_MUMPS_MPI_H defined.
#ifdef COIN_USE_MUMPS_MPI_H
#include "mumps_mpi.h"
#else
#include "mpi.h"
#endif
}

are a potential source of trouble.

I'm wondering, why the coinbrew-based installs of Cbc never had those linking errors, which SHOT has.

Not being an expert in regards to any of these build-tools, it's hard to tell how to proceed. As i see it, mingw64 only provides a microsoft-based MPI implementation mingw-w64-x86_64-msmpi, but i don't think this is relevant here. Cbc builds fine without it being available, which also makes me wonder if it's really about MPI-backends or some Mumps-internal mpi-headers.

I'm afraid, that there is a limited amount of people trying to build this software for windows yet, and probably even less reading this opened issue. Maybe @svigerske has tried a windows-based install?

But maybe this problem also translates to Linux? I should try a linux-based install later (although this one is also not much fun due to the experimental::filesystem thingy which excludes vanilla Uubuntu-LTS -> SHOT really asks for a very modern build-system; but well; that is fine as i'm only using VirtualBox-based Linux instances).

Has anyone a hint? How did people succeed in compiling SHOT? I suppose, coinbrew will play a role for most (in regards to dependencies).

Thanks for reading!

  • Sascha

crash in Cbc due to duplicate name

When I run GAMS model library model tanksize with Dual.MIP.Solver=2 (Cbc), I get

╶ Supporting Hyperplane Optimization Toolkit (SHOT) ──────────────────────────────────────────────────────────────────╴

  Andreas Lundell and Jan Kronqvist, Åbo Akademi University, Finland.
  See documentation for full list of contributors and utilized software libraries.

  Version: 1.0.alpha 1. Git hash: 80e02ff. Released Oct 15 2019. 

  For more information visit https://shotsolver.dev

 Reading options from shot.op9
** duplicate name s_bl_d(N1)_omega(P1,N1)

Program received signal SIGABRT, Aborted.
0x00007ffff7a8df25 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff7a8df25 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff7a77897 in abort () from /usr/lib/libc.so.6
#2  0x00007ffff0c2d7cf in CoinModelHash::addHash(int, char const*) ()
#3  0x00007ffff02fa022 in CoinModel::setColName (this=0x5555556c4790, whichColumn=56, columnName=0x5555556ce420 "s_bl_d(N1)_omega(P1,N1)")
    at CoinModel.hpp:337
#4  0x00007ffff02f331c in SHOT::MIPSolverCbc::addVariable (this=0x5555556bfae0, name=..., type=SHOT::E_VariableType::Real, lowerBound=1, upperBound=40) at MIPSolverCbc.cpp:77
#5  0x00007ffff03cf0ff in SHOT::TaskCreateDualProblem::createProblem (this=0x5555556bee80, destination=..., sourceProblem=...) at TaskCreateDualProblem.cpp:82
#6  0x00007ffff03ce1a6 in SHOT::TaskCreateDualProblem::TaskCreateDualProblem (this=0x5555556bee80, envPtr=...) at TaskCreateDualProblem.cpp:29

I'm using fairly recent CoinUtils, etc., versions from their latest stable branches.

miqcp03 infeasible with Cbc

With the changes from #69, GAMS testlib model MIQCP03 is now infeasible when using CBC as MIP solver.

╶ Problem instance ───────────────────────────────────────────────────────────────────────────────────────────────────╴

                                    Original             Reformulated

 Problem classification:            MIQCQP, convex       MINLP, convex

 Objective function direction:      minimize             minimize
 Objective function type:           linear               linear

 Number of constraints:             26                   76
  - linear:                         1                    26
  - convex quadratic:               25                   0
  - convex nonlinear:               0                    50

 Number of variables:               75                   125
  - real:                           50                   100
  - binary:                         25                   25
  - nonlinear:                      50                   0

 Number of transformations performed:                    50

╶ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────╴

 No options file specified.

 Nondefault options used:

  - Dual.MIP.NumberOfThreads = 1
  - Dual.MIP.Solver = 2
  - Dual.TreeStrategy = 0
  - Model.Reformulation.Quadratics.Strategy = 0
  - Primal.FixedInteger.Solver = 1
  - Primal.Tolerance.TrustLinearConstraintValues = false
  - Subsolver.Ipopt.LinearSolver = 1
  - Termination.IterationLimit = 2147483647
  - Termination.ObjectiveGap.Absolute = 1e-10
  - Termination.ObjectiveGap.Relative = 1e-10
  - Termination.TimeLimit = 1000.0

 Dual strategy:              Multi-tree
  - cut algorithm:           ESH
  - solver:                  Cbc 2.10

 Primal NLP solver:          CONOPT (automatically selected) in GAMS 31.0


╶ Interior point search ──────────────────────────────────────────────────────────────────────────────────────────────╴

 Strategy selected:          cutting plane minimax


    Iteration     │  Time  │    Cuts     │     Objective value     │  Objective diff.   
     #: type      │  tot.  │   + | tot.  │    problem | line srch  │    abs. | rel.    
╶─────────────────┴────────┴─────────────┴─────────────────────────┴──────────────────╴
     1: LP           0.02                      -1e+12 | -1e+12          inf. | inf.    
     2: LP           0.02     13 | 13           -4.84 | -2.22045e-16 4.8e+00 | 1.0e+00 

 Valid interior point with constraint deviation -0.000 found.


    Iteration     │  Time  │  Dual cuts  │     Objective value     │   Objective gap   │     Current solution
     #: type      │  tot.  │   + | tot.  │       dual | primal     │    abs. | rel.    │    obj.fn. | max.err.
╶─────────────────┴────────┴─────────────┴─────────────────────────┴───────────────────┴───────────────────────────╴)

     1: LP-O         0.02                    -24.6965 | inf.            inf. | 1.0e+00     -24.6965 | 26: 0.00e+00     
     2: MILP-I       0.02                    -24.6965 | inf.            inf. | 1.0e+00              | inf.             

╶ Solution report ────────────────────────────────────────────────────────────────────────────────────────────────────╴

 Terminated since the dual problem is infeasible.

 Problem is infeasible.

Can you reproduce?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.