Madhumita Tripathy
Madhumita Tripathy

Reputation: 11

Google OR-tools- Vehicle Routing with Pickups and Deliveries

I am trying to solve a Vehicle Routing Problem with multiple pickups and deliveries for single vehicle using Google OR tools and python code given in https://developers.google.com/optimization/routing/pickup_delivery. In this example, list of pairs of pickup and delivery locations are given as constrained as

data['pickups_deliveries']= [[1, 6],[2, 10],[4, 3],[5, 9],[7, 8],[15, 11],]

But in my problem I want data['pickups_deliveries_required']= [ [1, 6],[6, 2],[2, 10],[4, 3],[5, 9],[7, 8],[15, 11],]

That means node 6 will be deliver point of 1 and as well as pick up point of 2. If I am giving input data['pickups_deliveries_required'] in python program , no solution is coming. Please anyone can suggest how I can solve this problem?

Upvotes: 1

Views: 1033

Answers (1)

Mizux
Mizux

Reputation: 9281

you need to duplicate the node 6 and 2. one for pickup and one for delivery. Each node can only participate to one p&d pair...

Upvotes: 1

Related Questions