Try our new documentation site (beta).
HNT format
A MIP hint (HNT) file is used to provide hints for the values of the variables in a mixed integer programming model (typically obtained from a solution to a related model). The file lists values for variables in the model, and priorities for those hints. When MIP hints are imported into a MIP model before optimization begins (using GRBread, for example), the MIP search is guided towards the values captured in those hints. Good hints often allow the MIP solver to find high-quality solutions much more quickly.
A MIP hint file consists of variable-value-priority triples, each on its own line. Any line that begins with the hash sign (#) is a comment line and is ignored. The following is a simple example:
# MIP hints x1 1 2 x2 0 1 x3 1 1
Importing hints into a model is equivalent to setting the
VarHintVal
and VarHintPri
attributes for each listed
variable to the associated values. If the same variable appears more
than once in a hint file, the last assignment is used. Importing
multiple hint files is equivalent to reading the concatenation of the
imported files.
Note that hint files don't need to specify values for all variables. When values are left unspecified, the Gurobi MIP solver won't attempt to adjust the search strategy for those variables.
Please refer to the VarHintVal discussion for more details on the role of variable hints.