# Multi-depot VRP

I am working on the multidepot-VRP problem an extension of your practical example capacitated VRP. I want to make a model in which vehicles will depart from their depots to serve different customers and turn back to the same depot where it started from. I made a rough model but facing some sort of errors. Kindly check and help me to resolve my model.

I shall be really thankful to you.

Looking forward for your kind response.

Regards

VehicleDepot(Vehicle-1, Depot-1) = 1, VehicleDepot(Vehicle-2, Depot-2) = 1, and so on is required.

After that, your binary variable can be indexed over the vehicle and customer locations (in and out) only as you already know the depot that vehicle belongs to. An additional constraint that the vehicle must leave and must enter the depot it belongs it required.

i have extended my working and add an element parameter which defines the vehicle location that which vehicle is parked at which depot. like you exemplify.

Further i worked in-degree and out-degree constraint as you mentioned but here i am facing issue that when i added these constraints vehicles are routing but only depot to depot location not going at customer location.

what you may suggest to run the model from depot to customer and then back to the same depot.

sum[(truck, location), binary(location, customer, truck)] >= 1

This could be = 1 if you want only a single truck to visit a customer

i am sharing my working file, hope it will help you to understand the error.

Kindly load the data case to run the model

Then the attached model should be sufficient, review it. 2 nodes connected (represented by binary variable bvArc(i,j) ) can be interpreted as a truck leaving node i and going to node j.

Thanks for your support.

I have checked your model, it is satisfying the objective function.

Yes, for each vehicle, capacity is taken 4000.

Yes, your proposed model (represented by binary variable bvArc(i,j) which is two index model while i am working with three index model like it was x(i,j,k).

With that case i want to get my objective function, where almost constraints are same.

each vehicle need to depart and turn back to the same depot. each customer must be served and capacity should not be exceeded.

I don’t understand what you mean by 0 node, can you elaborate please ?

Yes, the model I gave you is 2 index. You don’t need a 3 index model if all the trucks have the same capacity. After solving the 2 index model, count the number of outgoing arcs from each depot - that will give you the number of trucks used in that depot. Each closed loop (starting from a depot and ending at that depot) represents the route of a truck. Eg: Depot 1 - 3 - 5 - 7 - Depot 1 is the route of a truck. BvArc(Depot 1, 3), bvArc(3,5) , bvArc(5,7), bvArc(7, Depot 1) are all equal to 1.

Secondly, as i told i am working with the three index model, i need to add further things in the model but right now i was lacking with the some of my constraints to add in aimms and to run it. which you explained earlier with two index model.

But if the same model run through with the three index model with same constraints so it would be a great favor for me.

I appreciate your help and response you provided me till now.

Regards

I modified the earlier model to work with 3 indices as you asked. Review attached project and let me know if you have any questions. I left comments for all variables and constraints.

Thanks for your response.

i have checked the model. working was good.

Kindly explain the process of post processing.

I am lacking to understand with that Identifier.

Regards

pickup first Definition: sum(P, S(P,K)) <= sum(R, S(R,K)); and second keep things correct along the path Definition: S(i,K)+ servicetime(i) + traveltime(i,j) <= S(j,K);

but getting this error.

Looking forward for your response.

Hi

Hi

Hi

Here I attached my Model. Looking forward to your response..

well,

As per my knowledge it can be linked as:

Set Vehicles {

SubsetOf: Integers;

Index: K;

Definition: {

}

Parameter Numberofvehicles {

Range: integer;

InitialData: 5 (number of vehicles using in the model)

Comment: "total number of vehicles.";

}

Well

otherwise, it will not work properly and violate the constraints (visitallcustomers & demandbalance).

Thanks

Based on the model, I want to create multi-compartment vehicle, do i have to define the demand of each of products..?

Well

Hi

Can you help me how to set this constraint into AIMMS..?

### Reply

## Sign up

Already have an account? Login

**Please use your business or academic e-mail address to register**

## Login to the community

No account yet? Create an account

Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.