-
Notifications
You must be signed in to change notification settings - Fork 43
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
Pickup and Delivery Problem #116
Comments
Thanks @frozeniceblue for reaching out! In this case you can create as many copies of node v as necessary. For example, if node v as two requests, create v1 and v2 so that you can have |
Thanks for your reply. the result that G.nodes[2]["request"] =1 will cover the result G.nodes[2]["request"] = 4 before, so that we print G.nodes[2] |
Here is how I would do it:
So instead of working with node 2, duplicate it into 2a and 2b. |
Thank you for your reply again. G.nodes[a]["request"] = 4 G.nodes[b]["request"] = 1 But it still means G.nodes[2] and G.nodes[a]["request"] = 4 will be covered. |
Yes you have to "physically" duplicate the nodes, and adapt the distance matrix accordingly. Consider that node 2 is in a set of two buildings (2a and 2b) that have the same location, but that must be separate in the network.
I am not sure I understand this statement. |
Thank you. I understood that I need to change the distance matrix first. Just like this below: |
Another question is about open vrp. The definition is below: |
Yes indeed, that is a good point. It is a good idea to use 0.1 in this case. It looks like you got it right, although I cannot validate it 100% without having more knowledge of the problem and data. But it looks correct. For the open vrp, what you wrote is correct ! But you might need to use the same trick : use 0.1 and not 0 otherwise the edge might not be created at all. |
Thank you for your great project!
I have a small question and I would like to know that if I want to set up the constraints that
for example
pickups_deliveries = {(2, 4): 1, (2, 1): 2, (3, 1): 3}
we pick up from node 2,3 and deliveries to node 1,4 and we go to every node only once.
But now we only setup G.nodes[u]["request"] = v for one node has one request.
So I want to know that how to setup that one node has more than one request?
Thank you very much!
The text was updated successfully, but these errors were encountered: