scipopt / scip

SCIP - Solving Constraint Integer Programs
Other
392 stars 63 forks source link

Assertion failed at the end of a solve #71

Closed lperron closed 3 months ago

lperron commented 10 months ago

SCIP 8.0.4 Soplex 6.0.4 No papilo, no gmp

Here is the output after the solve:

SCIP Status        : problem is solved [optimal solution found]
Solving Time (sec) : 339.68
Solving Nodes      : 617205
Primal Bound       : -2.95872115235364e+05 (54 solutions)
Dual Bound         : -2.95872115235364e+05
Gap                : 0.00 %
WARNING: Original variable <> not released when freeing SCIP problem <>.
WARNING: Original variable <> not released when freeing SCIP problem <>.
Assertion failed: (! unreleasedvar), function SCIPprobFree, file prob.c, line 506.

Here is the CIP file:

STATISTICS
  Problem name     : 
  Variables        : 13 (0 binary, 4 integer, 0 implicit integer, 9 continuous)
  Constraints      : 0 initial, 7 maximal
OBJECTIVE
  Sense            : minimize
VARIABLES
  [integer] <x0>: obj=0, original bounds=[-inf,+inf]
  [integer] <x1>: obj=0, original bounds=[-inf,+inf]
  [integer] <x2>: obj=0, original bounds=[-inf,+inf]
  [integer] <x3>: obj=0, original bounds=[-inf,+inf]
  [continuous] <x4>: obj=2366976.4609375, original bounds=[-inf,+inf]
  [continuous] <x5>: obj=0, original bounds=[-inf,+inf]
  [continuous] <x6>: obj=0, original bounds=[-inf,+inf]
  [continuous] <x7>: obj=0, original bounds=[-inf,+inf]
  [continuous] <x8>: obj=0, original bounds=[-inf,+inf]
  [continuous] <x9>: obj=0, original bounds=[-inf,+inf]
  [continuous] <x10>: obj=0, original bounds=[-inf,+inf]
  [continuous] <x11>: obj=0, original bounds=[-inf,+inf]
  [continuous] <x12>: obj=1, original bounds=[-inf,+inf]
CONSTRAINTS
  [disjunction] <c0>: disjunction(  [linear] <>: <x4>[C] -<x4>[C] == 0);
  [linear] <c1>: <x4>[C] -<x4>[C] >= 0;
  [disjunction] <c2>: disjunction(  [linear] <>: <x4>[C] -<x4>[C] == 0);
  [linear] <c3>: <x4>[C] -<x4>[C] >= 0;
  [disjunction] <c4>: disjunction(  [linear] <>: <x9>[C] -<x4>[C] == 0);
  [linear] <c5>: <x9>[C] -<x4>[C] >= 0;
  [nonlinear] <c6>: 2.36698e+06*(<x4>)^2+2.36698e+06*<x9>*<x4>-<x12> == 0;
END
matbesancon commented 10 months ago

with presolving on, I get LP errors both with SCIP and HiGHS on this problem, the nonlinear constraint with that scaling seems tricky, although it could just be rescaled no?

matbesancon commented 10 months ago

without presolving on master, I get no error

svigerske commented 10 months ago

I cannot reproduce with the cip file and

SCIP version 8.0.4 [precision: 8 byte] [memory: block] [mode: debug] [LP solver: Soplex 6.0.4] [GitHash: a8e51afd1e]
Copyright (c) 2002-2023 Zuse Institute Berlin (ZIB)

External libraries: 
  Readline 8.2         GNU library for command line editing (gnu.org/s/readline)
  Soplex 6.0.4         Linear Programming Solver developed at Zuse Institute Berlin (soplex.zib.de) [GitHash: 950b1658]
  CppAD 20180000.0     Algorithmic Differentiation of C++ algorithms developed by B. Bell (github.com/coin-or/CppAD)
  ZLIB 1.3             General purpose compression library by J. Gailly and M. Adler (zlib.net)
  AMPL/MP 4e2d45c4     AMPL .nl file reader library (github.com/ampl/mp)

either. It eventually stopped with

SCIP Status        : problem is solved [optimal solution found]
Solving Time (sec) : 984.53
Solving Nodes      : 620438
Primal Bound       : -2.95871615236004e+05 (33 solutions)
Dual Bound         : -2.95871615236004e+05
Gap                : 0.00 %

and no warning.

Since it says "original problem", it could make a big difference if SCIP was not actually run on the .cip file but the problem was input differently.

I guess that the variable name in the warning is empty because of the empty names of constraints given to the disjunction constraint, e.g.,

disjunction(  [linear] <>: <x4>[C] -<x4>[C] == 0);

If you can get some unique names into there and the warning, you could try enabling the code to debug variable capture/release in var.c (https://github.com/scipopt/scip/blob/v804/src/scip/var.c#L82-L92). This would enable printing when a variable of a specific name is captured or released, which may help to see at which place it was forgotten to release a variable, in particular if you have addr2line installed.

You may want to try whether setting, e.g., a nodelimit of 1, can speed things up.

svigerske commented 3 months ago

Not enough information to reproduce or fix.