-
Notifications
You must be signed in to change notification settings - Fork 111
Return Infeasible if the user problem contains crossing bounds #361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
67f293b
ef26750
480c4f1
9154170
81c8553
d614f64
b438170
aa58f62
2eccc32
1e71658
f13ea6f
c2b34c8
90095df
5478578
d4a4e5e
29fae5f
bbdf0e6
738f43c
db1b630
e07f9a7
a1a15d2
7a9e7bf
75f5261
f37631f
dfe4966
49177a4
8d9587e
4609fbd
3d4a42c
5ce1e14
c80d730
e3f90c5
ae659b9
ac08021
98781b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -179,6 +179,13 @@ mip_solution_t<i_t, f_t> solve_mip(optimization_problem_t<i_t, f_t>& op_problem, | |
| problem_checking_t<i_t, f_t>::check_problem_representation(op_problem); | ||
| problem_checking_t<i_t, f_t>::check_initial_solution_representation(op_problem, settings); | ||
|
|
||
| // Check for crossing bounds. Return infeasible if there are any | ||
| if (problem_checking_t<i_t, f_t>::has_crossing_bounds(op_problem)) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There may be some unset vars which we set in problem constructor. I think this should come after the problem cosntructor.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have to do this for LP as well. |
||
| return mip_solution_t<i_t, f_t>(mip_termination_status_t::Infeasible, | ||
| solver_stats_t<i_t, f_t>{}, | ||
| op_problem.get_handle_ptr()->get_stream()); | ||
| } | ||
|
|
||
| auto timer = cuopt::timer_t(time_limit); | ||
|
|
||
| double presolve_time = 0.0; | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A small suggestion: instead of into a separated routine (e.g.,
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That part of the code wasn't written by me, but to be fair it's more of a flavour / personal prerefence kind of thing :) It is a common pattern in C for resource cleanup; and it lets the code have a single exit point
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair enough |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -159,7 +159,7 @@ TEST(ErrorTest, TestError) | |
|
|
||
| // Set constraint bounds | ||
| std::vector<double> lower_bounds = {1.0}; | ||
| std::vector<double> upper_bounds = {0.0}; | ||
| std::vector<double> upper_bounds = {1.0, 1.0}; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The sizes are different for lower and upper bounds?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a test that is meant to catch is a problem is ill-formed (e.g., contains bounds of different sizes) |
||
| problem.set_constraint_lower_bounds(lower_bounds.data(), lower_bounds.size()); | ||
| problem.set_constraint_upper_bounds(upper_bounds.data(), upper_bounds.size()); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| * Optimal solution -28 | ||
| NAME MIP_SAMPLE | ||
| ROWS | ||
| N OBJ | ||
| L C1 | ||
| L C2 | ||
| L C3 | ||
| COLUMNS | ||
| MARK0001 'MARKER' 'INTORG' | ||
| X1 OBJ -7 | ||
| X1 C1 -1 | ||
| X1 C2 5 | ||
| X1 C3 -2 | ||
| X2 OBJ -2 | ||
| X2 C1 2 | ||
| X2 C2 1 | ||
| X2 C3 -2 | ||
| MARK0001 'MARKER' 'INTEND' | ||
| RHS | ||
| RHS C1 4 | ||
| RHS C2 20 | ||
| RHS C3 -7 | ||
| BOUNDS | ||
| UP BOUND X1 10 | ||
| LO BOUNDS X1 20 | ||
| UP BOUND X2 10 | ||
| ENDATA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is logger not suitable here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't link against rapids_logger in libmps_parser iirc