<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Scaling up Vehicle Routing Problem in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Scaling-up-Vehicle-Routing-Problem/m-p/720343#M3318</link>
    <description>&lt;P&gt;Thank you for sending the larger data with 618 nodes and 50 vehicles.&amp;nbsp; The VRP solver quickly (in 12 seconds) found a solution that uses 38 vehicles and has objective value&amp;nbsp;7984.2935718:&lt;/P&gt;
&lt;PRE&gt;NOTE: The number of nodes in the input graph is 618.
NOTE: The number of links in the input graph is 190653.
NOTE: The network solver is called.
NOTE: Processing the vehicle routing problem using 1 threads across 1 machines.
NOTE: The initial VRP heuristics found a solution with cost 7984.2935718 using 11.93 (cpu:
      11.50) seconds.
&lt;/PRE&gt;
&lt;P&gt;The solver then spent a long time trying to prove optimality.&amp;nbsp; In computational experiments with smaller instances, the heuristic solutions are usually within 1% of optimal.&amp;nbsp; Here is the resulting plot:&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV class="c"&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sascommunities021721.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54918iEF15A9B2EA97EF0A/image-size/large?v=v2&amp;amp;px=999" role="button" title="sascommunities021721.png" alt="sascommunities021721.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Is it OK to use fewer than 50 vehicles?&amp;nbsp; The solver allows you to specify lower and upper bounds for that, and I used the upper bound only.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Thu, 18 Feb 2021 22:44:38 GMT</pubDate>
    <dc:creator>RobPratt</dc:creator>
    <dc:date>2021-02-18T22:44:38Z</dc:date>
    <item>
      <title>Scaling up Vehicle Routing Problem</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Scaling-up-Vehicle-Routing-Problem/m-p/719976#M3313</link>
      <description>&lt;P&gt;I have an optimization model that assigns facilities to a distribution center and now I want to begin routing vehicles to serve those assigned facilities. I've worked through the vehicle routing problem, and even adapted it to work with my data. The problem I am having is it seems to work fine for less than 50 nodes and 10 trucks. I need to do something more like 300 nodes and up to 100 trucks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code I have right now is:&lt;/P&gt;
&lt;PRE&gt;proc cas;
	loadactionset "optimization";

	source pgm;
		/* Read in DDU Data */
		set &amp;lt;str&amp;gt; NODES;
		num ddu_longitude {NODES};
		num ddu_latitude {NODES};   
		num demand {NODES};
		read data RDC1_NODES into NODES=[name] ddu_latitude ddu_longitude demand;
	
		num num_vehicles = &amp;amp;num_vehicles;
		num capacity = &amp;amp;capacity;
	
		set ARCS={i in NODES, j in NODES: i ne j};
		set VEHICLES = 1..&amp;amp;num_vehicles;
	
		str depot= 'DDU649';
	
		/* The cost is the geodist between each node */
		num cost {&amp;lt;i,j&amp;gt; in ARCS}
			init geodist(ddu_latitude[i],ddu_longitude[i],ddu_latitude[j],ddu_longitude[j],'M');
	
		var Flow {ARCS,VEHICLES} &amp;gt;= 0 &amp;lt;= capacity;
		var UseNode {NODES,VEHICLES} binary;
		var useArc {ARCS, VEHICLES} binary;
	
		/* each non-depot node must be serviced by at least one vehicle */
		con Assignment {i in NODES diff {depot}}:
			sum {k in VEHICLES} UseNode[i, k] &amp;gt;=1;
		
		/* each vehicle must start at the depot node */
		for{k in VEHICLES} fix UseNode[depot, k]=1;
		
		/* some vehicle k traverses an arc that leaves node i
		if and only if UseNode[i,k] = 1 */
		con LeaveNode {i in NODES, k in VEHICLES}:
			sum {&amp;lt;(i), j&amp;gt; in ARCS} UseArc[i, j, k]=UseNode[i, k];
		
		/* some vehicle k traverses an arc that enters node i
		if and only if UseNode[i,k] = 1 */
		con EnterNode {i in NODES, k in VEHICLES}:
			sum {&amp;lt;j, (i)&amp;gt; in ARCS} UseArc[j, i, k]=UseNode[i, k];
		
		/* the amount of demand supplied by vehicle k to node i must equal demand
		if UseNode[i,k] = 1; otherwise, it must equal 0 */
		con FlowBalance {i in NODES diff {depot}, k in VEHICLES}:
			sum {&amp;lt;j, (i)&amp;gt; in ARCS} Flow[j, i, k] - sum {&amp;lt;(i), j&amp;gt; in ARCS} 
			Flow[i, j, k]=demand[i] * UseNode[i, k];
		
		/* if UseArc[i,j,k] = 1, then the flow on arc (i,j) must be at most capacity
		if UseArc[i,j,k] = 0, then no flow is allowed on arc (i,j) */
		con VehicleCapacity {&amp;lt;i, j&amp;gt; in ARCS, k in VEHICLES}:
			Flow[i, j, k] &amp;lt;=Flow[i, j, k].ub * UseArc[i, j, k];
		
		/* decomp by vehicle */
		for {i in NODES, k in VEHICLES} do;
			LeaveNode[i, k].block=k;
			EnterNode[i, k].block=k;
		end;
		for {i in NODES diff {depot}, k in VEHICLES} FlowBalance[i, k].block=k;
		for {&amp;lt;i, j&amp;gt; in ARCS, k in VEHICLES} VehicleCapacity[i, j, k].block=k;
	
	
	
		/* minimize the total distance traversed */
		min TotalCost = sum {&amp;lt;i,j&amp;gt; in ARCS, k in VEHICLES} cost[i,j] * UseArc[i,j,k];
		save mps rdc_tsp;	
	endsource;

	optimization.runOptmodel/code=pgm;
run;
quit;

proc optmilp data=mycas.rdc_tsp primalout=mycas.rdc_tsp_sol dualout=mycas.rdc_tsp_dual  maxtime=3600 ;
	decomp logfreq=1;
run;&lt;/PRE&gt;
&lt;P&gt;Any ideas would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2021 17:32:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Scaling-up-Vehicle-Routing-Problem/m-p/719976#M3313</guid>
      <dc:creator>DanHouston</dc:creator>
      <dc:date>2021-02-17T17:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: Scaling up Vehicle Routing Problem</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Scaling-up-Vehicle-Routing-Problem/m-p/719992#M3314</link>
      <description>&lt;P&gt;I can now share the news I hinted at yesterday.&amp;nbsp; As of today's release (2020.1.3), the network solver in OPTMODEL has a VRP option that invokes a specialized algorithm to solve the vehicle routing problem:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=v_009&amp;amp;docsetId=casmopt&amp;amp;docsetTarget=casmopt_networksolver_syntax02.htm&amp;amp;locale=en#casmopt.networksolver.syntax_vrp"&gt;SAS Help Center: SOLVE WITH NETWORK Statement&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The same example with 22 nodes now solves in less than one second:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=v_009&amp;amp;docsetId=casmopt&amp;amp;docsetTarget=casmopt_networksolver_examples08.htm&amp;amp;locale=en"&gt;SAS Help Center: Vehicle Routing Problem (CVRPLIB)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The same VRP algorithm is available in PROC OPTNETWORK and the optNetwork action set as of the 2020.1.1 release:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=v_009&amp;amp;docsetId=casnopt&amp;amp;docsetTarget=casnopt_optnet_syntax23.htm&amp;amp;locale=en"&gt;SAS Help Center: VRP Statement&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=v_007&amp;amp;docsetId=casactnopt&amp;amp;docsetTarget=cas-optnetwork-vrp.htm&amp;amp;locale=en"&gt;SAS Help Center: vrp Action&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2021 18:19:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Scaling-up-Vehicle-Routing-Problem/m-p/719992#M3314</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2021-02-17T18:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Scaling up Vehicle Routing Problem</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Scaling-up-Vehicle-Routing-Problem/m-p/720018#M3315</link>
      <description>Want a bigger dataset to try out? &lt;BR /&gt;&lt;BR /&gt;Probably going to take us a bit to upgrade.</description>
      <pubDate>Wed, 17 Feb 2021 20:07:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Scaling-up-Vehicle-Routing-Problem/m-p/720018#M3315</guid>
      <dc:creator>DanHouston</dc:creator>
      <dc:date>2021-02-17T20:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Scaling up Vehicle Routing Problem</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Scaling-up-Vehicle-Routing-Problem/m-p/720035#M3316</link>
      <description>&lt;P&gt;Yes, please.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2021 20:48:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Scaling-up-Vehicle-Routing-Problem/m-p/720035#M3316</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2021-02-17T20:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: Scaling up Vehicle Routing Problem</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Scaling-up-Vehicle-Routing-Problem/m-p/720081#M3317</link>
      <description>&lt;P&gt;Attached is a ZIP file with a CSV and the CODE I am currently running (does not finish, just sits and spins).&lt;/P&gt;
&lt;P&gt;RDC1 is the depot and DDU* are the locations to deliver to.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2021 00:45:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Scaling-up-Vehicle-Routing-Problem/m-p/720081#M3317</guid>
      <dc:creator>DanHouston</dc:creator>
      <dc:date>2021-02-18T00:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Scaling up Vehicle Routing Problem</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Scaling-up-Vehicle-Routing-Problem/m-p/720343#M3318</link>
      <description>&lt;P&gt;Thank you for sending the larger data with 618 nodes and 50 vehicles.&amp;nbsp; The VRP solver quickly (in 12 seconds) found a solution that uses 38 vehicles and has objective value&amp;nbsp;7984.2935718:&lt;/P&gt;
&lt;PRE&gt;NOTE: The number of nodes in the input graph is 618.
NOTE: The number of links in the input graph is 190653.
NOTE: The network solver is called.
NOTE: Processing the vehicle routing problem using 1 threads across 1 machines.
NOTE: The initial VRP heuristics found a solution with cost 7984.2935718 using 11.93 (cpu:
      11.50) seconds.
&lt;/PRE&gt;
&lt;P&gt;The solver then spent a long time trying to prove optimality.&amp;nbsp; In computational experiments with smaller instances, the heuristic solutions are usually within 1% of optimal.&amp;nbsp; Here is the resulting plot:&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV class="c"&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sascommunities021721.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54918iEF15A9B2EA97EF0A/image-size/large?v=v2&amp;amp;px=999" role="button" title="sascommunities021721.png" alt="sascommunities021721.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Is it OK to use fewer than 50 vehicles?&amp;nbsp; The solver allows you to specify lower and upper bounds for that, and I used the upper bound only.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 18 Feb 2021 22:44:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Scaling-up-Vehicle-Routing-Problem/m-p/720343#M3318</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2021-02-18T22:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Scaling up Vehicle Routing Problem</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Scaling-up-Vehicle-Routing-Problem/m-p/720384#M3319</link>
      <description>&lt;P&gt;WOW!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case using less is fine, in the actual case as I continue to build out there will be some time constraints and that may actually drive truck count upwards.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks so much for testing it.....now to figure out the upgrade path to get to this enhancement.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2021 02:31:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Scaling-up-Vehicle-Routing-Problem/m-p/720384#M3319</guid>
      <dc:creator>DanHouston</dc:creator>
      <dc:date>2021-02-19T02:31:31Z</dc:date>
    </item>
  </channel>
</rss>

