Skip to content

Commit

Permalink
Back to updating route bbox in try_job_additions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoupey committed Oct 4, 2023
1 parent 865a010 commit 4dc9671
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 @@ -185,6 +185,8 @@ void LocalSearch<Route,
}
}

std::unordered_set<Index> modified_vehicles;

do {
Priority best_priority = 0;
RouteInsertion best_insertion(_input.get_amount_size());
Expand Down Expand Up @@ -288,6 +290,7 @@ void LocalSearch<Route,
}

// Update best_route data required for consistency.
modified_vehicles.insert(best_route);
_sol_state.update_route_eval(_sol[best_route].route, best_route);
_sol_state.set_insertion_ranks(_sol[best_route], best_route);

Expand All @@ -312,6 +315,10 @@ void LocalSearch<Route,
}
}
} while (job_added);

for (const auto v : modified_vehicles) {
_sol_state.update_route_bbox(_sol[v].route, v);
}
}

template <class Route,
Expand Down

0 comments on commit 4dc9671

Please sign in to comment.