Skip to content

[FileFormats] Reader for NL: unsupported mode b #2717

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

Closed
matbesancon opened this issue Apr 9, 2025 · 6 comments · Fixed by #2718
Closed

[FileFormats] Reader for NL: unsupported mode b #2717

matbesancon opened this issue Apr 9, 2025 · 6 comments · Fixed by #2718

Comments

@matbesancon
Copy link
Contributor

An example with an instance from the MINLPLib:

using JuMP

julia> m = read_from_file("portfol_shortfall200_05.nl")
ERROR: Unable to parse NL file : unsupported mode b
@odow
Copy link
Member

odow commented Apr 9, 2025

Link? I think this is the binary format, which did not seem to be documented

@matbesancon
Copy link
Contributor Author

@matbesancon
Copy link
Contributor Author

ping @svigerske

@odow
Copy link
Member

odow commented Apr 9, 2025

Found this: https://ampl.github.io/nlwrite.pdf

Image

I guess I can reverse engineer it...

@odow
Copy link
Member

odow commented Apr 9, 2025

See #2718, it was actually pretty simple

using JuMP, Gurobi
filename = "portfol_shortfall200_05.nl"
model = read_from_file(filename; use_nlp_block = false)
set_optimizer(model, Gurobi.Optimizer)
optimize!(model)

Solve seems to be on the right track

Gurobi Optimizer version 12.0.1 build v12.0.1rc0 (mac64[x86] - Darwin 24.1.0 24B83)

CPU model: Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
Thread count: 4 physical cores, 8 logical processors, using up to 8 threads

Optimize a model with 605 rows, 806 columns and 81608 nonzeros
Model fingerprint: 0x0483491b
Model has 2 general nonlinear constraints (402 nonlinear terms)
Variable types: 605 continuous, 201 integer (201 binary)
Coefficient statistics:
  Matrix range     [4e-07, 8e+00]
  Objective range  [1e+00, 1e+00]
  Bounds range     [1e+00, 1e+00]
  RHS range        [7e-01, 1e+01]

User MIP start did not produce a new incumbent solution
User MIP start violates constraint R0 by 1.000000000

Presolve added 1 rows and 0 columns
Presolve removed 0 rows and 1 columns
Presolve time: 0.09s
Presolved: 608 rows, 1205 columns, 81811 nonzeros
Presolved model has 400 quadratic constraint(s)
Variable types: 1004 continuous, 201 integer (201 binary)

Root relaxation: objective -1.283613e+00, 407 iterations, 0.01 seconds (0.01 work units)

    Nodes    |    Current Node    |     Objective Bounds      |     Work
 Expl Unexpl |  Obj  Depth IntInf | Incumbent    BestBd   Gap | It/Node Time

     0     0   -1.28361    0    -          -   -1.28361      -     -    0s
     0     0   -1.25012    0    -          -   -1.25012      -     -    0s

 20332 11031   -1.13534   34   27   -1.12596   -1.14412  1.61%   162  190s
 20341 11038   -1.13394   36   23   -1.12596   -1.14412  1.61%   162  198s

@matbesancon
Copy link
Contributor Author

Thanks!

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

Successfully merging a pull request may close this issue.

2 participants