Skip to content

Bug in presolve that incorrectly results in infeasibility #2204

@odow

Description

@odow

Reported in jump-dev/HiGHS.jl#267

File

NAME        
ROWS
 N  Obj     
 E  r0      
 E  r1      
 E  r2      
 E  r3      
 E  r4      
 E  r5      
 E  r6      
 E  r7      
 E  r8      
 E  r9      
 E  r10     
 E  r11     
COLUMNS
    MARK0000  'MARKER'                 'INTORG'
    c0        Obj       1
    c0        r8        1
    c1        Obj       1
    c1        r0        1
    c1        r8        1
    c2        Obj       1
    c2        r0        1
    c2        r10       1
    c3        Obj       1
    c3        r1        1
    c3        r10       1
    c4        Obj       1
    c4        r1        1
    c5        Obj       1
    c5        r2        1
    c6        Obj       1
    c6        r0        1
    c6        r2        1
    c7        Obj       1
    c7        r0        1
    c7        r3        1
    c8        Obj       1
    c8        r1        1
    c8        r3        1
    c9        Obj       1
    c9        r1        1
    c10       Obj       1
    c10       r2        1
    c11       Obj       1
    c11       r2        1
    c11       r4        1
    c12       Obj       1
    c12       r3        1
    c12       r4        1
    c13       Obj       1
    c13       r3        1
    c13       r5        1
    c14       Obj       1
    c14       r5        1
    c15       Obj       1
    c15       r6        1
    c16       Obj       1
    c16       r4        1
    c16       r6        1
    c17       Obj       1
    c17       r4        1
    c17       r7        1
    c18       Obj       1
    c18       r5        1
    c18       r7        1
    c19       Obj       1
    c19       r5        1
    c20       Obj       1
    c20       r6        1
    c21       Obj       1
    c21       r6        1
    c21       r9        1
    c22       Obj       1
    c22       r7        1
    c22       r9        1
    c23       Obj       1
    c23       r7        1
    c23       r11       1
    c24       Obj       1
    c24       r11       1
    c25       r0        -2
    c26       r1        -2
    c27       r2        -2
    c28       r3        -2
    c29       r4        -2
    c30       r5        -2
    c31       r6        -2
    c32       r7        -2
    c33       r8        -2
    c34       r9        -2
    c35       r10       -2
    c36       r11       -2
    MARK0001  'MARKER'                 'INTEND'
RHS
    RHS_V     r0        1
    RHS_V     r1        1
    RHS_V     r3        1
    RHS_V     r4        1
    RHS_V     r5        1
    RHS_V     r9        1
    RHS_V     r10       1
    RHS_V     r11       1
BOUNDS
 BV BOUND     c0      
 BV BOUND     c1      
 BV BOUND     c2      
 BV BOUND     c3      
 BV BOUND     c4      
 BV BOUND     c5      
 BV BOUND     c6      
 BV BOUND     c7      
 BV BOUND     c8      
 BV BOUND     c9      
 BV BOUND     c10     
 BV BOUND     c11     
 BV BOUND     c12     
 BV BOUND     c13     
 BV BOUND     c14     
 BV BOUND     c15     
 BV BOUND     c16     
 BV BOUND     c17     
 BV BOUND     c18     
 BV BOUND     c19     
 BV BOUND     c20     
 BV BOUND     c21     
 BV BOUND     c22     
 BV BOUND     c23     
 BV BOUND     c24     
 FR BOUND     c25     
 FR BOUND     c26     
 FR BOUND     c27     
 FR BOUND     c28     
 FR BOUND     c29     
 FR BOUND     c30     
 FR BOUND     c31     
 FR BOUND     c32     
 FR BOUND     c33     
 FR BOUND     c34     
 FR BOUND     c35     
 FR BOUND     c36     
ENDATA

Julia log

julia> using JuMP, HiGHS

julia> function main(presolve)
           H = Bool[
               0 1 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
               0 0 0 1 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
               0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
               0 0 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0
               0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 0 0 0 0
               0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 0 0
               0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0
               0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 0
               1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
               0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0
               0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
               0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
           ]
           s = Bool[1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1]
           m, n = size(H)
           model = Model(HiGHS.Optimizer)
           set_attribute(model, "presolve", presolve)
           @variable(model, z[1:n], Bin)
           @variable(model, k[1:m], Int)
           @constraint(model, [i in 1:m], sum(z[H[i, :]]) == 2 * k[i] + s[i])
           @objective(model, Min, sum(z))
           optimize!(model)
           Highs_writeModel(unsafe_backend(model), "highs_jl_267.mps")
           return solution_summary(model)
       end
main (generic function with 1 method)

julia> main("on")
Running HiGHS 1.9.0 (git hash: 66f735e60): Copyright (c) 2024 HiGHS under MIT licence terms
Coefficient ranges:
  Matrix [1e+00, 2e+00]
  Cost   [1e+00, 1e+00]
  Bound  [1e+00, 1e+00]
  RHS    [1e+00, 1e+00]
Presolving model
11 rows, 33 cols, 47 nonzeros  0s
9 rows, 26 cols, 38 nonzeros  0s
6 rows, 17 cols, 24 nonzeros  0s
5 rows, 14 cols, 18 nonzeros  0s
3 rows, 8 cols, 10 nonzeros  0s
2 rows, 4 cols, 4 nonzeros  0s
1 rows, 4 cols, 4 nonzeros  0s
Objective function is integral with scale 1

Solving MIP model with:
   1 rows
   4 cols (3 binary, 1 integer, 0 implied int., 0 continuous)
   4 nonzeros
WARNING: Solution with objective 6 has untransformed violations: bound = 0; integrality = 0; row = 2 (row 7)

Src: B => Branching; C => Central rounding; F => Feasibility pump; H => Heuristic; L => Sub-MIP;
     P => Empty MIP; R => Randomized rounding; S => Solve LP; T => Evaluate node; U => Unbounded;
     z => Trivial zero; l => Trivial lower; u => Trivial upper; p => Trivial point

        Nodes      |    B&B Tree     |            Objective Bounds              |  Dynamic Constraints |       Work      
Src  Proc. InQueue |  Leaves   Expl. | BestBound       BestSol              Gap |   Cuts   InLp Confl. | LpIters     Time

         0       0         0   0.00%   5               inf                  inf        0      0      0         0     0.0s
WARNING: Solution with objective 6 has untransformed violations: bound = 0; integrality = 0; row = 2 (row 7)
WARNING: Solution with objective 6 has untransformed violations: bound = 0; integrality = 0; row = 2 (row 7)
WARNING: Solution with objective 6 has untransformed violations: bound = 0; integrality = 0; row = 2 (row 7)
         0       0         0   0.00%   6               inf                  inf        0      0      0         0     0.0s
WARNING: Solution with objective 6 has untransformed violations: bound = 0; integrality = 0; row = 2 (row 7)
WARNING: Solution with objective 6 has untransformed violations: bound = 0; integrality = 0; row = 2 (row 7)
WARNING: Solution with objective 6 has untransformed violations: bound = 0; integrality = 0; row = 2 (row 7)
WARNING: Solution with objective 6 has untransformed violations: bound = 0; integrality = 0; row = 2 (row 7)
         0       0         1 100.00%   inf             inf                  inf        0      0      0         0     0.0s

Solving report
  Status            Infeasible
  Primal bound      inf
  Dual bound        inf
  Gap               inf
  P-D integral      0
  Solution status   infeasible
                    6 (objective)
                    0 (bound viol.)
                    0 (int. viol.)
                    2 (row viol.)
  Timing            0.00 (total)
                    0.00 (presolve)
                    0.00 (solve)
                    0.00 (postsolve)
  Max sub-MIP depth 1
  Nodes             0
  Repair LPs        8 (0 feasible; 0 iterations)
  LP iterations     0 (total)
                    0 (strong br.)
                    0 (separation)
                    0 (heuristics)
Solving LP to try to compute dual ray
Coefficient ranges:
  Matrix [1e+00, 2e+00]
  Cost   [0e+00, 0e+00]
  Bound  [1e+00, 1e+00]
  RHS    [1e+00, 1e+00]
Solving LP relaxation since solve_relaxation is true
Solving LP without presolve, or with basis, or unconstrained
Using EKK dual simplex solver - serial
  Iteration        Objective     Infeasibilities num(sum)
          0     0.0000000000e+00 Pr: 8(8); Du: 0(5.77444e-12) 0s
          8     0.0000000000e+00 Pr: 0(0) 0s
Model status        : Optimal
Simplex   iterations: 8
Objective value     :  0.0000000000e+00
Relative P-D gap    :  0.0000000000e+00
HiGHS run time      :          0.00
No dual ray found
Writing the model to highs_jl_267.mps
WARNING: There are empty or excessively-long column names: using constructed names with prefix "c"
WARNING: There are empty or excessively-long row names: using constructed names with prefix "r"
* Solver : HiGHS

* Status
  Result count       : 1
  Termination status : INFEASIBLE
  Message from the solver:
  "kHighsModelStatusInfeasible"

* Candidate solution (result #1)
  Primal status      : FEASIBLE_POINT
  Dual status        : NO_SOLUTION
  Objective value    : 0.00000e+00
  Objective bound    : 0.00000e+00
  Relative gap       : Inf
  Dual objective value : NaN

* Work counters
  Solve time (sec)   : 3.53465e-03
  Simplex iterations : 8
  Barrier iterations : 0
  Node count         : -1


julia> main("off")
Running HiGHS 1.9.0 (git hash: 66f735e60): Copyright (c) 2024 HiGHS under MIT licence terms
Coefficient ranges:
  Matrix [1e+00, 2e+00]
  Cost   [1e+00, 1e+00]
  Bound  [1e+00, 1e+00]
  RHS    [1e+00, 1e+00]

Presolve is switched off
Objective function is integral with scale 1

Solving MIP model with:
   12 rows
   37 cols (25 binary, 9 integer, 0 implied int., 0 continuous)
   52 nonzeros

Src: B => Branching; C => Central rounding; F => Feasibility pump; H => Heuristic; L => Sub-MIP;
     P => Empty MIP; R => Randomized rounding; S => Solve LP; T => Evaluate node; U => Unbounded;
     z => Trivial zero; l => Trivial lower; u => Trivial upper; p => Trivial point

        Nodes      |    B&B Tree     |            Objective Bounds              |  Dynamic Constraints |       Work      
Src  Proc. InQueue |  Leaves   Expl. | BestBound       BestSol              Gap |   Cuts   InLp Confl. | LpIters     Time

         0       0         0   0.00%   0               inf                  inf        0      0      0         0     0.0s
 T       0       0         0   0.00%   0               6                100.00%        0      0      0         0     0.0s
         1       0         1 100.00%   6               6                  0.00%        0      0      0         0     0.0s

Solving report
  Status            Optimal
  Primal bound      6
  Dual bound        6
  Gap               0% (tolerance: 0.01%)
  P-D integral      2.1478976123e-05
  Solution status   feasible
                    6 (objective)
                    0 (bound viol.)
                    0 (int. viol.)
                    0 (row viol.)
  Timing            0.00 (total)
                    0.00 (presolve)
                    0.00 (solve)
                    0.00 (postsolve)
  Max sub-MIP depth 0
  Nodes             1
  Repair LPs        0 (0 feasible; 0 iterations)
  LP iterations     0 (total)
                    0 (strong br.)
                    0 (separation)
                    0 (heuristics)
Writing the model to highs_jl_267.mps
WARNING: There are empty or excessively-long column names: using constructed names with prefix "c"
WARNING: There are empty or excessively-long row names: using constructed names with prefix "r"
* Solver : HiGHS

* Status
  Result count       : 1
  Termination status : OPTIMAL
  Message from the solver:
  "kHighsModelStatusOptimal"

* Candidate solution (result #1)
  Primal status      : FEASIBLE_POINT
  Dual status        : NO_SOLUTION
  Objective value    : 6.00000e+00
  Objective bound    : 6.00000e+00
  Relative gap       : 0.00000e+00
  Dual objective value : NaN

* Work counters
  Solve time (sec)   : 1.24954e-03
  Simplex iterations : 0
  Barrier iterations : -1
  Node count         : 1

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions