- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I am working through the example on the vehicle routing problem:
The description says the constraints will force the vehicles to start and end at the depot node. In the code it seems to setup a constraint to force the vehicle to start at the depot node, but I don't see anything enforcing it to end at the depot node.
When I look at the solution data there is no ARC back to the depot node to end the graph. Since I am pulling this back into VA do I just have to follow all the flows and artificially add the last arc back to the depot node or is there a constraint that would cause that to happen automatically?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The EnterNode constraints force exactly one arc to enter any node (including the depot node 1) that is visited. The solution_data does contain one arc into the depot for each vehicle that is used (look for the value 1 in the j column), and these arcs appear in the PROC SGPLOT output. I suspect that you were looking at the Flow variables instead of the UseArc variables.
By the way, I will have some news to share about VRP very soon.
Update on 2/17/2021:
See this subsequent post for the news.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The EnterNode constraints force exactly one arc to enter any node (including the depot node 1) that is visited. The solution_data does contain one arc into the depot for each vehicle that is used (look for the value 1 in the j column), and these arcs appear in the PROC SGPLOT output. I suspect that you were looking at the Flow variables instead of the UseArc variables.
By the way, I will have some news to share about VRP very soon.
Update on 2/17/2021:
See this subsequent post for the news.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Rob. I am using FLOW instead of useARC. I did look at both not sure why I settled on Flow. I will take a closer look at useARC (makes perfect sense why that would have it in there rather than FLOW).
Can't wait to hear news on VRP. I already have some additional questions on solving for larger problems (works fine for less than 50 nodes, but as soon as I go over that it is running over 24 hours).