Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

primal_solution_status is reported as kSolutionStatusFeasible for infeasible model when solver=ipm and presolve=off #1807

Open
odow opened this issue Jun 19, 2024 · 0 comments
Assignees

Comments

@odow
Copy link
Collaborator

odow commented Jun 19, 2024

When the solver is ipm and presolve is disabled, the primal_solution_status is reported as feasible when the model status is infeasible.

julia> using HiGHS

julia> begin
           data = """
           NAME        
           ROWS
           N  NoObj
           L  r0      
           G  r1      
           COLUMNS
               c0        r0        1
               c0        r1        1
           RHS
               RHS_V     r1        1
           BOUNDS
           FR BOUND     c0      
           ENDATA
           """
           write("/tmp/test.mps", data)
       end
177

julia> highs = Highs_create()
Ptr{Nothing} @0x00007fdc22de3200

julia> Highs_readModel(highs, "/tmp/test.mps")
Running HiGHS 1.7.0 (git hash: 50670fd4c): Copyright (c) 2024 HiGHS under MIT licence terms
0

julia> Highs_setStringOptionValue(highs, "presolve", "off")
0

julia> Highs_setStringOptionValue(highs, "solver", "ipm")
0

julia> status = Highs_run(highs)
Coefficient ranges:
  Matrix [1e+00, 1e+00]
  Cost   [0e+00, 0e+00]
  Bound  [0e+00, 0e+00]
  RHS    [1e+00, 1e+00]
Solving LP without presolve, or with basis, or unconstrained
IPX model has 2 rows, 1 columns and 2 nonzeros
Input
    Number of variables:                                1
    Number of free variables:                           1
    Number of constraints:                              2
    Number of equality constraints:                     0
    Number of matrix entries:                           2
    Matrix range:                                       [1e+00, 1e+00]
    RHS range:                                          [1e+00, 1e+00]
    Objective range:                                    [0e+00, 0e+00]
    Bounds range:                                       [0e+00, 0e+00]
Preprocessing
    Dualized model:                                     no
    Number of dense columns:                            0
    Range of scaling factors:                           [1.00e+00, 1.00e+00]
IPX version 1.0
Interior Point Solve
 Iter     P.res    D.res            P.obj           D.obj        mu     Time
   0   2.67e+00 2.17e+00   0.00000000e+00 -6.66666667e-01  3.25e+00       0s
   1   5.00e-01 1.32e-01   0.00000000e+00  2.34465717e+00  4.04e-04       0s
   2   5.00e-01 2.53e-01   0.00000000e+00  2.86284197e+07  4.94e+03       0s
Summary
    Runtime:                                            0.00s
    Status interior point solve:                        primal infeas
    Status crossover:                                   not run
WARNING: Ipx: IPM       primal infeasible
WARNING: Ipx: Crossover not run
Model   status      : Infeasible
IPM       iterations: 2
Objective value     :  0.0000000000e+00
HiGHS run time      :          0.00
0

julia> Highs_getModelStatus(highs) == kHighsModelStatusInfeasible
true

julia> statusP = Ref{Cint}(0)
Base.RefValue{Int32}(0)

julia> Highs_getIntInfoValue(highs, "primal_solution_status", statusP)
0

julia> statusP[] == kHighsSolutionStatusFeasible
true

The last check should clearly not be true.

Bug found by jump-dev/HiGHS.jl#216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants