Skip to content

Commit

Permalink
Merge branch 'fix/priority-replace-loop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoupey committed Nov 17, 2023
2 parents 830ad8c + 5b5046f commit 8ace3b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/problems/cvrp/operators/priority_replace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ bool PriorityReplace::is_valid() {
// portion is empty or with a single job (that would be an
// UnassignedExchange move).
replace_start_valid =
(s_rank > 0) && (_best_known_priority_gain <= _start_priority_gain) &&
(0 < _start_priority_gain) &&
(_best_known_priority_gain <= _start_priority_gain) && (s_rank > 0) &&
source.is_valid_addition_for_capacity_margins(_input,
j.pickup,
j.delivery,
Expand All @@ -148,8 +149,9 @@ bool PriorityReplace::is_valid() {
// Don't bother if the candidate end portion is empty or with a
// single job (that would be an UnassignedExchange move).
replace_end_valid =
(t_rank < s_route.size() - 1) &&
(0 < _end_priority_gain) &&
(_best_known_priority_gain <= _end_priority_gain) &&
(t_rank < s_route.size() - 1) &&
source.is_valid_addition_for_capacity_margins(_input,
j.pickup,
j.delivery,
Expand Down

0 comments on commit 8ace3b6

Please sign in to comment.