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.00e04)
Best objective 1.200000000000e+01, best bound 1.200000000000e+01, gap 0.0000%

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?
Please sign in to leave a comment.
Comments
2 comments