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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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