Skip to content

Commit

Permalink
Only apply bbox pruning for homogeneous vehicle pairs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoupey committed Oct 20, 2023
1 parent 5ce4813 commit f093c83
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/algorithms/local_search/local_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ void LocalSearch<Route,
best_priorities[source] > 0 || best_priorities[target] > 0 ||
_sol[source].size() < 2 || _sol[target].size() < 2 ||
(_input.all_locations_have_coords() &&
_input.vehicles[source].has_same_profile(_input.vehicles[target]) &&
!_sol_state.route_bbox[source].intersects(
_sol_state.route_bbox[target]))) {
continue;
Expand Down Expand Up @@ -653,6 +654,8 @@ void LocalSearch<Route,
best_priorities[target] > 0 || _sol[source].size() == 0 ||
_sol[target].size() < 2 ||
(_input.all_locations_have_coords() &&
_input.vehicles[source].has_same_profile(
_input.vehicles[target]) &&
!_sol_state.route_bbox[source].intersects(
_sol_state.route_bbox[target]))) {
continue;
Expand Down Expand Up @@ -766,6 +769,7 @@ void LocalSearch<Route,
if (target <= source || // This operator is symmetric.
best_priorities[source] > 0 || best_priorities[target] > 0 ||
(_input.all_locations_have_coords() &&
_input.vehicles[source].has_same_profile(_input.vehicles[target]) &&
!_sol_state.route_bbox[source].intersects(
_sol_state.route_bbox[target]))) {
continue;
Expand Down Expand Up @@ -875,6 +879,7 @@ void LocalSearch<Route,
if (source == target || best_priorities[source] > 0 ||
best_priorities[target] > 0 ||
(_input.all_locations_have_coords() &&
_input.vehicles[source].has_same_profile(_input.vehicles[target]) &&
!_sol_state.route_bbox[source].intersects(
_sol_state.route_bbox[target]))) {
continue;
Expand Down Expand Up @@ -1633,6 +1638,8 @@ void LocalSearch<Route,
_sol[source].size() == 0 || _sol[target].size() == 0 ||
!_input.vehicle_ok_with_vehicle(source, target) ||
(_input.all_locations_have_coords() &&
_input.vehicles[source].has_same_profile(
_input.vehicles[target]) &&
!_sol_state.route_bbox[source].intersects(
_sol_state.route_bbox[target]))) {
continue;
Expand Down

0 comments on commit f093c83

Please sign in to comment.