My current model considers capacity, distance, and time constraints. All trucks starts from node 0 (I make it 0 distance to all other locations as dummy node), and all trucks ends at an universal location which is the last location index in data["locations"].
I would like to convert the current model into a pickup & delivery model, by making the end node (last location index) as the delivery_index in the data["pickups_deliveries]. i.e. if I have a list of locations: [0, 1, 2, 3, 4, ...50], with 0 as start_node and 50 as end_nodes, I made the data["pickups_deliveries] = [[1,50],[2,50],[3,50].....[49,50]]. Then I changed the manager settings to replace the array of ends as array of starts (dummy end_node) to avoid duplicating the actual end_node:
manager = pywrapcp.RoutingIndexManager(data.num_locations, data.num_vehicles, data.starts, data.ends) to
manager = pywrapcp.RoutingIndexManager(data.num_locations, data.num_vehicles, data.starts, data.starts)
Then I run the model but it's just running with no stop and no solution. Certainly, something is wrong here. Many thanks for your advice
在2021年7月22日星期四 UTC+8 下午11:23:56<Corentin "Mizux" Le Molgat> 写道: