Create a route optimization algorithm with zero costs using google's OR-tools and OSRM Part 4
We continue with our series and we create a function that takes care of reading the output of the algorithm, converting it to a readable form and plotting the routes on the map. def print_solution(data, manager, routing, assignment): Route = [] for vehicle_id in range(data['num_vehicles']: index = routing.Start(vehicle_id) idx = manager.IndexToNode(index) plan_output = 'Route for vehicle {} with ID {} and capacity {}:\n'.format(vehicle_id, data['IDs'][idx], data['capacity'][vehicle_id]) Route[Iter].append([data['locations'][idx], data['IDs'][idx]]) prev_ind...