Exact hull reformulation for quadratic constraints#3874
Open
sergey-gusev94 wants to merge 50 commits intoPyomo:mainfrom
Open
Exact hull reformulation for quadratic constraints#3874sergey-gusev94 wants to merge 50 commits intoPyomo:mainfrom
sergey-gusev94 wants to merge 50 commits intoPyomo:mainfrom
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: sergey-gusev94 <101810399+sergey-gusev94@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Make eigenvalue PSD/NSD tolerance configurable in hull exact quadratic reformulation
Co-authored-by: sergey-gusev94 <101810399+sergey-gusev94@users.noreply.github.com>
…ic feature Co-authored-by: sergey-gusev94 <101810399+sergey-gusev94@users.noreply.github.com>
doc: add `exact_hull_quadratic` to Hull class docstring
…unctions Co-authored-by: sergey-gusev94 <101810399+sergey-gusev94@users.noreply.github.com>
…envalue_tolerance in permissive test Co-authored-by: sergey-gusev94 <101810399+sergey-gusev94@users.noreply.github.com>
Add TestExactHullQuadratic tests and extract models into models.py
Co-authored-by: sergey-gusev94 <101810399+sergey-gusev94@users.noreply.github.com>
Co-authored-by: sergey-gusev94 <101810399+sergey-gusev94@users.noreply.github.com>
Co-authored-by: sergey-gusev94 <101810399+sergey-gusev94@users.noreply.github.com>
Co-authored-by: sergey-gusev94 <101810399+sergey-gusev94@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: sergey-gusev94 <101810399+sergey-gusev94@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Clean up stale "treated as linear" language and inline imports in test_hull.py
Co-authored-by: sergey-gusev94 <101810399+sergey-gusev94@users.noreply.github.com>
Reorder hull CONFIG: declare `exact_hull_quadratic` before `eigenvalue_tolerance`
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
added exact hull reformulations
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3874 +/- ##
========================================
Coverage 89.67% 89.67%
========================================
Files 908 908
Lines 106735 106907 +172
========================================
+ Hits 95717 95872 +155
- Misses 11018 11035 +17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes # .
Summary/Motivation:
This PR adds support for the exact hull reformulation for quadratic constraints in Generalized Disjunctive Programming (GDP).
The current
gdp.hulltransformation applies perspective-function based relaxations for nonlinear constraints. While effective for many nonlinear expressions, this approach can produce weaker relaxations for quadratically constrained disjunctions.This PR implements the exact hull reformulation for quadratic constraints described in:
Gusev, S., & Bernal Neira, D. E. (2025).
Exact Hull Reformulation for Quadratically Constrained Generalized Disjunctive Programs.
https://arxiv.org/abs/2508.16093
The implementation extends the existing hull transformation with an optional configuration flag (which is
Falseby default) that detects quadratic constraints and applies the exact hull formulation when appropriate.For convex quadratic constraints, the reformulation is expressed as a rotated second-order cone (SOC) representable constraint. For nonconvex quadratics and equality constraints, the general exact hull formulation is used.
Convexity is determined automatically through eigenvalue analysis of the Hessian matrix.
This provides a tighter relaxation for quadratic GDP models and maintains the quadratic structure of constraints in hull reformulation.
Changes proposed in this PR:
Extend the
gdp.hulltransformation with a new configuration option:exact_hull_quadratic(default:False)When enabled, quadratic constraints inside disjuncts are reformulated using the exact hull formulation instead of the standard perspective function.
Implement automatic convexity detection via eigenvalue decomposition of the quadratic Hessian matrix.
Apply different reformulations depending on structure:
Convex quadratic inequalities
Reformulated using a rotated second-order cone representation.
Nonconvex quadratics or equalities
Reformulated using the general exact hull formulation.
Add a configuration parameter:
eigenvalue_toleranceControls numerical tolerance when checking positive or negative semidefiniteness of the Hessian.
Extend the implementation in
pyomo.gdp.plugins.hullto support these reformulations.Add unit tests verifying:
The default behavior of
gdp.hullis unchanged unless the new option is enabled.Example usage:
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: