Skip to content

Link induced discrete variables to their selected values - #4127

Open
Fabnil wants to merge 1 commit into
Pyomo:mainfrom
Fabnil:fix/induced-linearity-selection
Open

Fabnil wants to merge 1 commit into
Pyomo:mainfrom
Fabnil:fix/induced-linearity-selection

Conversation

@Fabnil

@Fabnil Fabnil commented Dec 3, 2026

Copy link
Copy Markdown

Fixes #4103

Summary/Motivation:

The induced-linearity transformation can choose a value for a product that differs from the discrete variable's value. In the regression model, GLPK reported an optimum of 3.0 at a point that violated the original constraint. The correct optimum is 2.5.

Changes proposed in this PR:

  • Link the discrete variable to the value selected by the existing binaries.
  • Add a GLPK regression test that checks the optimum and the original product constraint.

The preprocessing and GDP suites had 547 passes and 130 skips. Black passed on both changed files. OpenAI Codex generated the patch, regression test, and draft description and ran the local checks.

AI-Use Disclosure

  • AI tools were NOT used during the preparation of this PR

or

  • AI tools contributed to the development of this PR

    • AI tools generated documentation (including the PR description/comments, code comments, and/or Sphinx documentation)
    • AI tools generated tests (baselines, examples, and/or code)
    • AI tools generated code (apart from tests)

    Review process (select ONE):

    • Rewritten: All AI-generated content was rewritten by me before being committed.
    • Reviewed/verified: I retained the AI-generated code and tests and reviewed the changes before submission. Verification included (as applicable):
      • Ran the code and fixed issues
      • Added and ran tests
      • Checked correctness/logic of code and tests
      • Checked for alignment with the contribution guide
      • Considered security implications
    • As-is: AI-generated content was commited directly to the repository

Notes for reviewers (optional):

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.

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.

contrib.preprocessing's induced_linearity omits constraint linking

1 participant