BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DanHouston
Obsidian | Level 7

I am working through the example on the vehicle routing problem:

https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.5&docsetId=casmopt&docsetTarget=casm...

 

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?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RobPratt
SAS Super FREQ

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.

View solution in original post

2 REPLIES 2
RobPratt
SAS Super FREQ

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.

DanHouston
Obsidian | Level 7

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). 

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

Discussion stats
  • 2 replies
  • 980 views
  • 0 likes
  • 2 in conversation