Skip to content

Conversion from the standard form to range form#1445

Draft
nguidotti wants to merge 1 commit into
NVIDIA:mainfrom
nguidotti:form-conversion
Draft

Conversion from the standard form to range form#1445
nguidotti wants to merge 1 commit into
NVIDIA:mainfrom
nguidotti:form-conversion

Conversation

@nguidotti

Copy link
Copy Markdown
Contributor

Added routine for converting from the standard form (B&B, dual simplex)
$\min \mathbf{c}^T \mathbf{x}$
$\mathbf{A}\mathbf{x} = \mathbf{b}$
$\mathbf{l} \leq \mathbf{x} \leq \mathbf{u}$

to the range form (heuristics, presolve)

$\min \mathbf{c}^T \mathbf{x}$
$\mathbf{w} \leq \mathbf{A}\mathbf{x} \leq \mathbf{v}$
$\mathbf{l} \leq \mathbf{x} \leq \mathbf{u}$

This is needed for propagating the reduced problem via reduced cost fixing as well as the cuts from one restart to the next.

Checklist

  • I am familiar with the Contributing Guidelines.
  • Testing
    • New or existing tests cover these changes
    • Added tests
    • Created an issue to follow-up
    • NA
  • Documentation
    • The documentation is up to date with these changes
    • Added new documentation
    • NA

Signed-off-by: Nicolas L. Guidotti <nguidotti@nvidia.com>
@nguidotti nguidotti self-assigned this Jun 19, 2026
@nguidotti nguidotti requested a review from a team as a code owner June 19, 2026 13:21
@nguidotti nguidotti requested review from mlubin and yuwenchen95 June 19, 2026 13:21
@nguidotti nguidotti added non-breaking Introduces a non-breaking change improvement Improves an existing functionality mip labels Jun 19, 2026
@nguidotti nguidotti added this to the 26.08 milestone Jun 19, 2026
@nguidotti nguidotti requested a review from chris-maes June 19, 2026 13:21
@nguidotti nguidotti marked this pull request as draft June 19, 2026 13:21
@copy-pr-bot

copy-pr-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 696bd8b4-fef5-47e7-9b8a-3a6a8e2776c1

📥 Commits

Reviewing files that changed from the base of the PR and between 8c79892 and 465d6e2.

📒 Files selected for processing (3)
  • cpp/src/dual_simplex/presolve.cpp
  • cpp/src/dual_simplex/presolve.hpp
  • cpp/tests/dual_simplex/unit_tests/solve.cpp

📝 Walkthrough

Walkthrough

Adds convert_simplex_problem, an inverse of the existing convert_user_problem routine, which reconstructs a user_problem_t (range-row form) from a simplex-standard-form lp_problem_t. The implementation maps slack/artificial column bounds back to row senses and RHS values, rebuilds the constraint matrix from structural columns only, copies objective and variable data, and clears cone fields. A new unit test verifies a full round-trip for a mixed-integer problem covering all row sense types.

Changes

Inverse simplex-to-user problem conversion

Layer / File(s) Summary
Header declaration of convert_simplex_problem
cpp/src/dual_simplex/presolve.hpp
Adds the templated convert_simplex_problem declaration with documentation describing new_slacks-based slack/artificial filtering and var_types coverage over the full simplex problem.
Implementation and explicit instantiation
cpp/src/dual_simplex/presolve.cpp
Implements convert_simplex_problem: resets user_problem metadata, derives each row's sense and RHS/range from its slack column's bounds and single nonzero, rebuilds the constraint matrix dropping slack/artificial columns, copies structural variable bounds and objective, filters var_types, clears cone fields, and asserts the primal path. Adds the <int, double> explicit instantiation in DUAL_SIMPLEX_INSTANTIATE_DOUBLE.
Round-trip MIP unit test
cpp/tests/dual_simplex/unit_tests/solve.cpp
Adds convert_simplex_problem_mip_round_trip which converts a mixed-integer problem with all row senses to simplex form, recovers it via convert_simplex_problem, asserts recovered fields, then re-converts and asserts exact equality of the standard-form representation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Conversion from the standard form to range form' directly and clearly describes the main change in the changeset: a new conversion routine that transforms LP problems from standard form to range form.
Description check ✅ Passed The description is directly related to the changeset, providing mathematical context for the standard and range forms, explaining the conversion routine's purpose, and referencing the specific use cases (reduced cost fixing and cut propagation).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality mip non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant