I am currently learning how to use Google OR-Tools, specifically on the CVRP Problem. The code is divided into two stages. The first one is finding the initial/first solution using path-cheapest-arc, savings algorithm, etc. the second stage is finding the solution using local search. `
# Setting first solution heuristic.
search_parameters = pywrapcp.DefaultRoutingSearchParameters()
search_parameters.first_solution_strategy = (
routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC)
search_parameters.local_search_metaheuristic = (
routing_enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH)
search_parameters.time_limit.FromSeconds(1)
The code above contains two searching parameters, the first solution strategy (path cheapest arc) and the local search metaheuristic. My question is, can we only use the first solution strategy and not use the local search metaheuristic?
Thanks!
I'm trying to compare the solution that I obtain from only using the first solution and the metaheuristic one.
YES you can, simply don't set it, aka remove the line.
search_parameters.local_search_metaheuristic = (
routing_enums_pb2.LocalSearchMetaheuristic.GUIDED_LOCAL_SEARCH)