Skip to content

Fix bugs on empty problem and pre_process assignment#18

Merged
rapids-bot[bot] merged 8 commits intoNVIDIA:branch-25.05from
akifcorduk:nv-branch-25.05
May 20, 2025
Merged

Fix bugs on empty problem and pre_process assignment#18
rapids-bot[bot] merged 8 commits intoNVIDIA:branch-25.05from
akifcorduk:nv-branch-25.05

Conversation

@akifcorduk
Copy link
Copy Markdown
Contributor

@akifcorduk akifcorduk commented May 19, 2025

There was a bug in pre_process_assignment function. During initial solve() we are doing preprocess and then trivial_presolve. That means, the free var replacements are added first then the variable eliminations are done. For that reason the user solution preprocessing should follow the same order.

The bug of set_solution is called multiple times in the tests if fixed: we should to pop the back solution after solution is being set, otherwise it will always be set.

The bug of he assignment resize is fixed: it should be called before the gather, if not the resize will enlarge it and it will have junk values, causing mismatch in objective costs and sometimes infeasible solutions.

This also changes a slight issue where we assign 2x for y and x for z when x is positive, for large initial values this might cause numerical issues, that's why we now assign x for y and 0 for z.

This PR also fixes the bug of empty solutions not being handled correctly after a presolve (previously we handled it only for trivial presolve).

@akifcorduk akifcorduk requested a review from a team as a code owner May 19, 2025 20:24
@akifcorduk akifcorduk requested review from chris-maes and kaatish May 19, 2025 20:24
@akifcorduk akifcorduk added bug Something isn't working improvement Improves an existing functionality non-breaking Introduces a non-breaking change and removed improvement Improves an existing functionality labels May 19, 2025
@rgsl888prabhu
Copy link
Copy Markdown
Collaborator

@akifcorduk Does this also cover @hlinsen bug fix?

@akifcorduk
Copy link
Copy Markdown
Contributor Author

Yes, it should cover that. But i think @hlinsen should also review. Maybe there is some conflicts.

@chris-maes chris-maes added this to the 25.05 milestone May 19, 2025
Copy link
Copy Markdown
Contributor

@hlinsen hlinsen left a comment

Choose a reason for hiding this comment

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

lgtm. One small coding style comment.

Comment thread cpp/src/mip/problem/problem.cu
Comment thread cpp/include/cuopt/semantic_version.hpp Outdated
@akifcorduk
Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 036dde8 into NVIDIA:branch-25.05 May 20, 2025
82 checks passed
jieyibi pushed a commit to yining043/cuopt that referenced this pull request Mar 26, 2026
There was a bug in pre_process_assignment function. During initial solve() we are doing preprocess and then trivial_presolve. That means, the free var replacements are added first then the variable eliminations are done. For that reason the user solution preprocessing should follow the same order.

The bug of set_solution is called multiple times in the tests if fixed: we should to pop the back solution after solution is being set, otherwise it will always be set.

The bug of he assignment resize is fixed: it should be called before the gather, if not the resize will enlarge it and it will have junk values, causing mismatch in objective costs and sometimes infeasible solutions.

This also changes a slight issue where we assign 2x for y and x for z when x is positive, for large initial values this might cause numerical issues, that's why we now assign x for y and 0 for z.

This PR also fixes the bug of empty solutions not being handled correctly after a presolve (previously we handled it only for trivial presolve).

Authors:
  - Akif ÇÖRDÜK (https://github.com/akifcorduk)

Approvers:
  - Hugo Linsenmaier (https://github.com/hlinsen)

URL: NVIDIA#18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants