Hi,
I am using Google ORtools to solve a vehicle routing problem. However, I am getting premature solution when the order of the input changes. Specifically, I have two vehicle types electric and diesel, and the service time of the two vehicle types are different. This is achieved by assigning factors for each vehicle types for instance, veh_factors = [1, 10] and veh_types = ['EV', 'DV'] meaning DV's service time is 10 times higher than EV. the goal is to let the model choose the vehicle types while finding the optimal route.
I am testing this with a toy problem with 3 requests and 5 vehicles. Suppose if there are 3 DVs and 2 EVs, and vehicle ids are 0, 1, 2 for DVs and 3, 4 for EVs and the order of vehicle factor input is veh_factors = [1, 100] (for veh_types = ['DV', 'EV']) I am getting a better solution. One vehicle is serving all requests. However, when I change the order such that veh_factors = [100, 1] and veh_types = ['DV', 'EV'], I am getting a premature solution; each vehicle is serving only one request.
The search parameters I have used are:
search_parameters = pywrapcp.DefaultRoutingSearchParameters()
#to get an initial solution
search_parameters.first_solution_strategy = (
routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC)
#to find a better solution
search_parameters.local_search_metaheuristic = (
routing_enums_pb2.LocalSearchMetaheuristic.AUTOMATIC)
search_parameters.time_limit.seconds = 90
I have attached the code here and can provide more details if that helps. I would greatly appreciate any assistance.
Thank you,
Bhavya