Kuifje02 / vrpy

A python framework for solving the VRP and its variants with column generation.
MIT License
173 stars 42 forks source link

Question # How to use it for normal pickup and drop for employee routing #109

Closed jignesh1010 closed 3 years ago

jignesh1010 commented 3 years ago

Hi I am trying to solve employee pick up and drop not on same request but independently so when we consider optimization for pickup we dont consider the cost of vehical to first pickup location in optmization and for drop cost of last empoyees location to facility should be zero or ignore in optimization

For below data ( can we make source to node A and B zero for pickup and for drop sink to node A and B zero) can you just help updating data formation if you got my question.

consider one way pick or drop where in case of pickup the vehical from source to first node cost doesnt matter, and for drop the last node to sink node cost doesnt matter or should be zero to optimization algortihm

how below data should be changed where S is source and T is sink and A and B are the nodes.

S A B T S 0 A 0 0 B 0 0 * T 0 0 0 0

Thanks

Kuifje02 commented 3 years ago

If I understand correctly, you want the cost from S to A,B to be 0, and the cost from A,B to T to be 0 as well. In this case, the matrix is:

  S A B T
S 0 0 0 *
A 0 0 * 0
B 0 * 0 0
T 0 0 0 0

The stars indicate where you have positive costs: from S to T, from A to B, and from B to A.

jignesh1010 commented 3 years ago

@Kuifje02 hi yes i am utilizing CVRP in isolation say if its pickup of employess from home to office then cost of vehical to first empoyee pickup should be zero as vehical location doesnt matter for current problem vice versa fro dropping employee from office to home then cost of last empoyee drop to vehical coming back to office doesnt matter or should be zero for optimization hence the matrix will look like this pick up request:

S A B T S 0 0 0 0 A 0 0 B 0 0 T 0 0 0 0

drop request dataset:

S A B T S 0 0 A 0 0 0 B 0 0 0 T 0 0 0 0

will it be ok for VRPY library this kind of input i am running this but its taking longer time for 30 nodes also logically does it make sense to you?

Kuifje02 commented 3 years ago

VRPy's default version relies on shortest paths with resource constraints (with the cspy library).

However, VRPy can also use pure linear programming to solve its shortest paths (cspy=False), but at the cost of lower performances. The reason why both options are available is because we wanted to make sure that cspy was returning the correct outputs, which it does.

Unfortunately, the pick up and delivery option requires specific features that cspy does not currently handle (see #15), therefore, pick ups and deliveries can only be solved by pure linear programming, which is why you observe poor computation times. I suggest the excellent ortools library for your problem. Although the API is not that user friendly, performances are very good, and there is large community using the software already.