Open prince4249 opened 3 years ago
If z=0, you can use the fixed_cost
argument : https://vrpy.readthedocs.io/en/latest/vrp_variants.html#fixed-costs.
ok but in my project z has some positive value. Is it not possible to implement it?
Unfortunately this is not possible generically. But you can obtain an approximation by computing the cost once you have the routes.
What I do is to add the Fixed cost to every node between the Source and the node i.e
for i in N: cost = c[0,i]+ fixed_cost G.add_edge("Source", str(i), time=t[0, i], cost=cost)
Yes, this is equivalent to using the fixed_cost
argument. In fact this is exactly what is done :
https://github.com/Kuifje02/vrpy/blob/fb9adea8d8f89f07e7074c4de3c56d7f05007243/vrpy/vrp.py#L929-L933
I am currently working on a project where we want the cost of the first 'z' Km to be fixed and after that 'x' unit per km for each vehicle. How can we implement this in your library?