Skip to content

Commit

Permalink
fix: slight adjustment to the time determination equation
Browse files Browse the repository at this point in the history
  • Loading branch information
TurtIeSocks committed Nov 22, 2023
1 parent 6806875 commit 269f34e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions or-tools/tsp/tsp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,13 @@ namespace operations_research
searchParameters.set_first_solution_strategy(
FirstSolutionStrategy::PATH_CHEAPEST_ARC);

if (locations.size() > 500)
if (locations.size() > 1000)
{
searchParameters.set_local_search_metaheuristic(
LocalSearchMetaheuristic::GUIDED_LOCAL_SEARCH);
const int64_t time = floor(locations.size() / 100);
const int64_t time = std::min(pow(locations.size() / 1000, 2.75), 3600.0);
searchParameters.mutable_time_limit()->set_seconds(time);
// LOG(INFO) << "Time limit: " << time;
}
// searchParameters.set_log_search(true);

Expand Down

0 comments on commit 269f34e

Please sign in to comment.