Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VRP without demand/capacity #49

Open
tonydavis629 opened this issue Feb 8, 2022 · 4 comments
Open

VRP without demand/capacity #49

tonydavis629 opened this issue Feb 8, 2022 · 4 comments

Comments

@tonydavis629
Copy link

Hello, I'm trying to implement this work to solve a VRP routing problem in my research, but I don't have the demand/capacity requirement. Is there a simple way I could remove this input to have just a standard VRP solver?

@wouterkool
Copy link
Owner

Hi! You could remove it from the code or you could simply set the demand to 0 for all customers (for which I suggest to retrain the model). However, if you don't have a capacity requirement, the shortest solution is to use a single vehicle to serve all customers, which is, in fact, the TSP problem, so it's better to use that version instead. If you have some other requirements (e.g. a maximum route length) these are currently not supported in this repository.

@tonydavis629
Copy link
Author

Wow thank you for the quick response. Yes I considered setting demand to 0, thank you for validating that idea. Yes the maximum route length is the problem, so I'll have to figure that one out. Thanks!

@wouterkool
Copy link
Owner

It should not be difficult to add it, have a look at the orienteering problem which also has a maximum length constraint (but only a single route). You should change the mask representing the feasible actions, such that an action is only feasible if it still allows to return to the depot within the maximum route length and (optionally) add a feature to the context node giving the current or remaining available route length. Good luck!

@tonydavis629
Copy link
Author

tonydavis629 commented Feb 14, 2022

I'm having a little trouble implementing your suggestion to mask the infeasible actions that are greater than the maximum route length. I am not exactly sure how to pull the remaining lengths from each route in the stateCVRP object. I tried setting the demand/capacity to a multiple of the VRP size, but it only seems to work maybe half of the time to have the routes evenly distributed, sometimes the model outputs 1 node for 1 route for dozens of routes.

Would it maybe be simpler if I could just specify the number of vehicles explicitly? Can you point me in that direction?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants