-
Notifications
You must be signed in to change notification settings - Fork 122
Heuristic Improvements: balance between generation and improvement heuristics #382
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
d1ab4eb
47708f4
17561a2
6276efa
b2ed360
ebbb5e4
90c1696
7e859fb
5363e79
474d170
0690083
6c02547
0a176f1
e2d0d8b
a4c37d6
49584ed
5ea08e8
85820e0
4437481
c0b0a21
ebb4958
54afd53
df34a01
5ebb86c
57b1b9d
ee861a2
f960946
cc21c3d
9821f03
9cd097a
a4b23ae
ed04e4c
dff8e0b
5266f6f
245026c
ced9d56
3476771
24ffb0e
d572c6b
b6e17e3
bfe6954
ac73a18
1c7d597
8dbcc2f
87b095f
6c8c186
e244176
1012dc7
188f971
5fd4cfc
1a6c608
678c66b
364739d
bb807cd
31f1723
a70498d
1fdebd3
ea0e251
611310d
2fee710
594a0c4
d3a9b45
2c849f0
39f4c8b
25a5f6e
bb0cde2
28cbe17
c9d9487
8462883
4c1d801
3318970
79fe7be
13576ae
548c246
cba77bf
9cee0e2
b3d141b
a5bbd8b
346daf7
8225802
5279af8
7005f5a
cd3a3a7
17d08c3
70810b5
692dcef
1c7857b
e463821
c869505
abf162f
a346d8b
5cab9b5
db34e48
b94a40b
85f417f
f996b65
d1b4adc
4c2335c
6ba676f
6348501
e44ce75
7fe82bd
254b728
24f82b1
4b12ed5
6f40f4f
d913a3f
0e67d99
30ff7d2
d8364fe
4fb0591
f46c9f2
8a5ea76
e54d478
4ac5b2b
a90ac9c
c31ae8f
05e37bd
ea3ef61
51cff97
a86503f
0d82a96
21ff255
fa4ed0e
f849e60
7102686
508f1e9
4f91d39
047ce52
2842328
6f11475
bcaa98a
056b5e2
70e174f
23e720c
9186f2c
8e34d06
6556656
96d922b
a743959
88ae1cf
54941ee
3f8b57b
0d644fd
618d550
7f529f5
4748744
153fbb2
aaeb08f
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 |
|---|---|---|
|
|
@@ -78,7 +78,7 @@ inline rapids_logger::logger& default_logger() | |
| logger_.set_pattern(default_pattern()); | ||
| #endif | ||
| logger_.set_level(default_level()); | ||
| logger_.flush_on(rapids_logger::level_enum::info); | ||
| logger_.flush_on(rapids_logger::level_enum::debug); | ||
|
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. Maybe we should keep the flush in the
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. Debug is disabled in production, so there will be no performance penalty. |
||
|
|
||
| return logger_; | ||
| }(); | ||
|
|
@@ -100,7 +100,7 @@ inline void reset_default_logger() | |
| default_logger().set_pattern(default_pattern()); | ||
| #endif | ||
| default_logger().set_level(default_level()); | ||
| default_logger().flush_on(rapids_logger::level_enum::info); | ||
| default_logger().flush_on(rapids_logger::level_enum::debug); | ||
| } | ||
|
|
||
| } // namespace cuopt | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,6 +93,11 @@ i_t bound_flipping_ratio_test_t<i_t, f_t>::single_pass(i_t start, | |
| } | ||
| step_length = min_val; | ||
| nonbasic_entering = candidate; | ||
| // this should be temporary, find root causes where the candidate is not filled | ||
| if (nonbasic_entering == -1) { | ||
| // -1,-2 and -3 are reserved for other things | ||
| return -4; | ||
| } | ||
|
Comment on lines
+97
to
+100
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. This issue is tracked, right?
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. I will create an issue thanks!
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. |
||
| const i_t j = entering_index = nonbasic_list_[nonbasic_entering]; | ||
|
|
||
| constexpr bool verbose = false; | ||
|
|
@@ -137,6 +142,7 @@ i_t bound_flipping_ratio_test_t<i_t, f_t>::compute_step_length(f_t& step_length, | |
|
|
||
| i_t k_idx = single_pass( | ||
| 0, num_breakpoints, indicies, ratios, slope, step_length, nonbasic_entering, entering_index); | ||
| if (k_idx == -4) { return -4; } | ||
| bool continue_search = k_idx >= 0 && num_breakpoints > 1 && slope > 0.0; | ||
| if (!continue_search) { | ||
| if constexpr (0) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -409,9 +409,12 @@ mip_status_t branch_and_bound_t<i_t, f_t>::solve(mip_solution_t<i_t, f_t>& solut | |
| assert(root_vstatus.size() == original_lp.num_cols); | ||
| if (root_status == lp_status_t::INFEASIBLE) { | ||
| settings.log.printf("MIP Infeasible\n"); | ||
| if (settings.heuristic_preemption_callback != nullptr) { | ||
| settings.heuristic_preemption_callback(); | ||
| } | ||
| // FIXME: rarely dual simplex detects infeasible whereas it is feasible. | ||
|
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. So if heuristics has a feasible solution, but branch and bound says it is infeasible, you take the feasible solution?
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. Yes, that's what i wanted to do for now. |
||
| // to add a small safety net, check if there is a primal solution already. | ||
| // Uncomment this if the issue with cost266-UUE is resolved | ||
| // if (settings.heuristic_preemption_callback != nullptr) { | ||
| // settings.heuristic_preemption_callback(); | ||
| // } | ||
| return mip_status_t::INFEASIBLE; | ||
| } | ||
| if (root_status == lp_status_t::UNBOUNDED) { | ||
|
|
@@ -434,8 +437,16 @@ mip_status_t branch_and_bound_t<i_t, f_t>::solve(mip_solution_t<i_t, f_t>& solut | |
| if (settings.set_simplex_solution_callback != nullptr) { | ||
| std::vector<f_t> original_x; | ||
| uncrush_primal_solution(original_problem, original_lp, root_relax_soln.x, original_x); | ||
| settings.set_simplex_solution_callback(original_x, | ||
| compute_user_objective(original_lp, root_objective)); | ||
| std::vector<f_t> original_dual; | ||
| std::vector<f_t> original_z; | ||
| uncrush_dual_solution(original_problem, | ||
| original_lp, | ||
| root_relax_soln.y, | ||
| root_relax_soln.z, | ||
| original_dual, | ||
| original_z); | ||
| settings.set_simplex_solution_callback( | ||
| original_x, original_dual, compute_user_objective(original_lp, root_objective)); | ||
| } | ||
| mutex_lower.lock(); | ||
| f_t lower_bound = lower_bound_ = root_objective; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.