How to use SolFiles option in command line
AnsweredI have an ILP model which I wish to generate multiple solutions. By using ResultFile, I am able to store the parameters for the optimal solution and it works. However, when I tried to use SolFiles, the solutions are not saved at all.
The exact command I have is this:
gurobi_cl SolFiles="./solutions/mymodel" PoolSolutions=5 PoolSearchMode=1 mymodel.lp
The following is the printout:
Reading time = 0.00 seconds
: 1271 rows, 704 columns, 6739 nonzeros
Optimize a model with 1271 rows, 704 columns and 6739 nonzeros
Variable types: 0 continuous, 704 integer (704 binary)
Coefficient statistics:
Matrix range [1e+00, 1e+01]
Objective range [1e+00, 1e+00]
Bounds range [1e+00, 1e+00]
RHS range [1e+00, 1e+01]
Found heuristic solution: objective 172.0000000
Found heuristic solution: objective 22.0000000
Presolve removed 419 rows and 296 columns
Presolve time: 0.01s
Presolved: 852 rows, 408 columns, 4605 nonzeros
Variable types: 0 continuous, 408 integer (408 binary)
Root relaxation: objective 1.200000e+01, 556 iterations, 0.02 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
H 0 0 12.0000000 0.00000 100% - 0s
0 0 - 0 12.00000 12.00000 0.00% - 0s
Optimal solution found at node 0 - now completing solution pool...
0 0 - 0 12.00000 12.00000 0.00% - 0s
0 0 - 0 12.00000 12.00000 0.00% - 0s
0 2 - 0 12.00000 12.00000 0.00% - 0s
Explored 1 nodes (797 simplex iterations) in 0.05 seconds
Thread count was 32 (of 96 available processors)
Solution count 5: 12 22 109 ... 164
Optimal solution found (tolerance 1.00e-04)
Best objective 1.200000000000e+01, best bound 1.200000000000e+01, gap 0.0000%
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
As far as I can tell, this should work. It's worth noting that the SolFiles parameter was introduced in Gurobi version 9.0. What version of Gurobi are you using?
1 -
Hi Alision,
I just checked my version of Gurobi, and it's indeed at 8.1.
I have updated it and tried it out again. Now it's working properly. Thanks!
0
Post is closed for comments.
Comments
3 comments