Skip to content

Conversation

@adityasinghz
Copy link

Description

Added an explicit log message "Optimal solution found during presolve" that is displayed when the problem is fully reduced during presolve (i.e., when the problem is reduced to 0 constraints, 0 variables, and 0 nonzeros). This provides clear feedback to users that the optimal solution was discovered during presolve rather than through the main solving process.

Changes Made:

  • cpp/src/mip/solve.cu: Added log message when problem.empty is true before running the MIP solver
  • cpp/src/mip/solver.cu: Added log message in two locations:
    • When context.problem_ptr->empty is true before running presolve
    • When context.problem_ptr->empty becomes true after running presolve

Example Output:
Before this change, when the optimal solution was found during presolve, users would see:

Presolve status: reduced the problem
Presolve removed: 100 constraints, 200 variables, 560 nonzeros
Presolved problem: 0 constraints, 0 variables, 0 nonzeros
Best feasible: 37.000000

After this change, users will now see:

Presolve status: reduced the problem
Presolve removed: 100 constraints, 200 variables, 560 nonzeros
Presolved problem: 0 constraints, 0 variables, 0 nonzeros
Optimal solution found during presolve
Problem fully reduced in presolve
Best feasible: 37.000000

Issue #524

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

@adityasinghz adityasinghz requested a review from a team as a code owner November 24, 2025 08:04
@copy-pr-bot
Copy link

copy-pr-bot bot commented Nov 24, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Copy link
Contributor

@rg20 rg20 left a comment

Choose a reason for hiding this comment

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

Move the logic of checking if presolver found solution to presolve caller or presolve function itself.

Move the 'Optimal solution found during presolve' message to the
presolve function itself (third_party_presolve.cpp) where we can
accurately detect when presolve finds the optimal solution. This
ensures the message only appears when presolve actually found the
solution, not when the problem is empty for other reasons.

Removed the message from generic empty problem checks in:
- cpp/src/mip/solve.cu (run_mip function)
- cpp/src/mip/solver.cu (run_solver function - both locations)
@adityasinghz adityasinghz requested a review from rg20 November 24, 2025 14:35
@rg20 rg20 added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Nov 24, 2025
@rg20 rg20 modified the milestone: 25.12 Nov 24, 2025
@rg20
Copy link
Contributor

rg20 commented Nov 24, 2025

/ok to test 527cd60

@rgsl888prabhu
Copy link
Collaborator

@adityasinghz Is this meant for 25.12 release or 26.02.

If it is meant for 25.12, may I request you to close this PR and use branch release/25.12 branch as your base and create a PR? And also choose merge branch to be 25.12.

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants