Skip to content

Conversation

@emma58
Copy link
Contributor

@emma58 emma58 commented Oct 27, 2025

Fixes # .

Summary/Motivation:

The only Gurobi interface in the solver rewrite that was supporting warm starting was gurobi_persistent. This PR changes the option name to warm_start (from use_mipstart) and changes the behavior to pass any variable with non-None value as part of the warm start. It then adds an implementation of this option in gurobi_direct and gurobi_direct_minlp. I'm open to being argued with--my thinking is that this is simple and allows the user control over integer/not warm starting since they can change variable values. But maybe that isn't the best for persistent since that comes with some overhead?

Changes proposed in this PR:

  • Adds warm start support in the regular and MINLP direct interfaces
  • Adds testing for warm starts by capturing the log and making sure Gurobi took it
  • Fixes bugs in Gurobi MINLP with tee ignoring being given a logger

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@emma58 emma58 requested a review from michaelbynum October 27, 2025 17:20
Comment on lines +314 to +321
# elif config.warm_start_integer_vars:
# for (
# pyomo_var_id,
# gurobi_var,
# ) in self._pyomo_var_to_solver_var_map.items():
# pyomo_var = self._vars[pyomo_var_id][0]
# if pyomo_var.is_integer() and pyomo_var.value is not None:
# self.set_var_attr(pyomo_var, 'Start', pyomo_var.value)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking we could do this in all the interfaces if we want a separate option for just warm starting integer vars, but dunno if we need to add the complexity?

@emma58
Copy link
Contributor Author

emma58 commented Oct 28, 2025

This is a duplicate of #3698, so I'm closing it. We can steal tests from here though.

@emma58 emma58 closed this Oct 28, 2025
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

Successfully merging this pull request may close these issues.

1 participant