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

Wrong solve_result_num in Gurobi solution pool #219

Open
4er4er4er opened this issue Aug 3, 2023 · 1 comment
Open

Wrong solve_result_num in Gurobi solution pool #219

4er4er4er opened this issue Aug 3, 2023 · 1 comment
Assignees

Comments

@4er4er4er
Copy link
Contributor

4er4er4er commented Aug 3, 2023

The attached run file uses gurobiasl to find 5 MIP solutions. Then it reads the resulting .sol files one at a time. The solve_result and solve_result_num values are all solved and 0 as expected:

ampl: include multmip_pool.run
Gurobi 10.0.2: ams_stub=multmip
ams_mode=2
ams_limit=5
Gurobi 10.0.2: optimal solution; objective 235625
468 simplex iterations
76 branch-and-cut nodes
plus 34 simplex iterations for intbasis
Alternative MIP solution 1, objective = 235625
Alternative MIP solution 2, objective = 237125
Alternative MIP solution 3, objective = 238225
Alternative MIP solution 4, objective = 239900
Alternative MIP solution 5, objective = 242025
5 alternative MIP solutions written to "multmip1.sol"
... "multmip5.sol".
Alternative solutions do not include dual variable values.
Best solution is available in "multmip1.sol".

suffix npool OUT;
solve_result = solved
solve_result_num = 0

Alternative MIP solution 1, objective = 235625
solve_result = solved
solve_result_num = 0

Alternative MIP solution 2, objective = 237125
solve_result = solved
solve_result_num = 0

Alternative MIP solution 3, objective = 238225
solve_result = solved
solve_result_num = 0

Alternative MIP solution 4, objective = 239900
solve_result = solved
solve_result_num = 0

Alternative MIP solution 5, objective = 242025
solve_result = solved
solve_result_num = 0

When option solver gurobiasl; is replaced by option solver gurobi; the solutions are the same, and the solve_result and solve_result_num values reported by the solver are the same. But the values taken from the .sol files are incorrectly reported as solved? and 100:

ampl: include multmip_pool.run
Gurobi 10.0.2: sol:stub=multmip
sol:poolmode=2
sol:poollimit=5
Gurobi 10.0.2: optimal solution; objective 235625
423 simplex iterations
58 branching nodes

suffix nsol OUT;
suffix npool OUT;
solve_result = solved
solve_result_num = 0

Gurobi 10.0.2: Alternative solution; objective 235625
solve_result = 'solved?'
solve_result_num = 100

Gurobi 10.0.2: Alternative solution; objective 237125
solve_result = 'solved?'
solve_result_num = 100

Gurobi 10.0.2: Alternative solution; objective 238225
solve_result = 'solved?'
solve_result_num = 100

Gurobi 10.0.2: Alternative solution; objective 239900
solve_result = 'solved?'
solve_result_num = 100

Gurobi 10.0.2: Alternative solution; objective 242025
solve_result = 'solved?'
solve_result_num = 100

(Note also that the messages about the solution pool from gurobiasl are longer -- but also more informative -- than the messages from gurobi.)

@glebbelov
Copy link
Contributor

Changing as follows:

ampl: include multmip_pool__mp.run
Gurobi 10.0.2:   sol:stub = multmip
  sol:poolmode = 2
  sol:poollimit = 5
Gurobi 10.0.2: optimal solution; objective 235625
331 simplex iterations
68 branching nodes
5 alternative solution(s)
  with objective values 242025..235625
  written to multmip1.sol..multmip5.sol.

suffix nsol OUT;
suffix npool OUT;
solve_result = solved
solve_result_num = 0

Gurobi 10.0.2: Alternative solution 1, objective 235625
solve_result = solved
solve_result_num = 0

Gurobi 10.0.2: Alternative solution 2, objective 237125
solve_result = solved
solve_result_num = 0

Gurobi 10.0.2: Alternative solution 3, objective 238225
solve_result = solved
solve_result_num = 0

Gurobi 10.0.2: Alternative solution 4, objective 239900
solve_result = solved
solve_result_num = 0

Gurobi 10.0.2: Alternative solution 5, objective 242025
solve_result = solved
solve_result_num = 0

The solve status of the alternative solutions is going to be that of the final solution.

glebbelov added a commit that referenced this issue Aug 16, 2023
Their status is reported as that of the final solution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants