The model Fingerprint is a hash value computed from the model’s data and attributes, designed to distinguish one optimization model from another. See What is the model fingerprint? for more details.
Differences in fingerprints are expected when models vary in their fundamental components, such as variables, constraints, or objectives, or when they are built from different input data (for example, different scheduling periods, such as week 1 versus week 2).
However, even when two models are constructed from the same mathematical formulation and identical input data, they may still produce different fingerprints—an outcome that is sometimes undesirable. This can depend on the tools used to build or export them, as well as any changes in model structure during construction or when writing to different file formats. These differences can, in turn, lead to variations in solver behavior and performance.
Below are common—often non-obvious—factors that can lead to differences in model fingerprints:
- Using different Python versions when building the model with the Gurobi Python API.
- Building the model using a third-party tool or modeling language, such as Pyomo or PuLP.
- Changing the order of variables/constraints, whether intentional or not.
- Providing an initial feasible solution through variable attributes, such as:
- VarHintVal - Variable hint values
- VBasis - Variable basis status
- CBasis - Constraint basis status (applied to constraints, not variables)
- BranchPriority - Variable branching priorities
- Partition - Variable partition information for partition heuristic
- PoolIgnore - Solution pool ignore settings
- Providing LP warm-start information via:
- Providing a MIP start using the Start variable attribute (current MIP start vector) or via a start file (
.mst) or a solution file (.sol). -
Non-deterministic model construction, for example:
- Using unordered Python data structures (e.g.,
set) that do not guarantee iteration order. - Relying on pandas operations without explicit sorting (e.g., DataFrame operations, dictionary-based transformations, or
groupby).
- Using unordered Python data structures (e.g.,
- Additionally, writing the model in LP format may introduce slight numerical rounding or formatting differences, which can affect the model fingerprint compared to MPS and REW formats.