<?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 Vehicle Routing Problem Solver takes too long and gives Time Out error in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/vehicle-routing-problem-solver-takes-too-long-and/m-p/811501#M2461</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been working on coding a Vehicle Routing Problem Solver, mostly by following ArcGIS Guide online (&lt;A class="link-titled" href="https://developers.arcgis.com/python/guide/part7-vehicle-routing-problem/" title="https://developers.arcgis.com/python/guide/part7-vehicle-routing-problem/" rel="nofollow noopener noreferrer" target="_blank"&gt;Guide to Network Analysis (Part 7 - Vehicle Routing Problem) | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;). My code is as follows:&lt;/P&gt;&lt;DIV class="" style="color: #000000; background-color: #ffffff;"&gt;&lt;DIV class="" style="color: #000000; padding: 0.4em;"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from arcgis.gis import GIS
import pandas as pd
import getpass
from IPython.display import HTML
import arcgis
from arcgis.features import Feature, FeatureSet, GeoAccessor, GeoSeriesAccessor
import networkx as nx
import osmnx as ox
import requests
import matplotlib.cm as cm
import matplotlib.colors as colors
from pathlib import Path
import geopandas as gpd # combines the capabilities of pandas and shapely for geospatial operations
#connect to your GIS
gis = GIS( client_id='Db8G5Jo6FCgLqTLk')
print("Successfully logged in as: " + gis.properties.user.username)
data_path = Path('./data')
if not data_path.exists():
&amp;nbsp;&amp;nbsp;&amp;nbsp;data_path.mkdir()
#read shape file
addresses = gpd.read_file('data/Addresses_in_King_County___address_point-shp/Addresses_in_King_County___address_point.shp')&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="" style="color: #000000; background-color: #ffffff;"&gt;&lt;DIV class="" style="color: #000000; padding: 0.4em;"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;OUTPUT: 
Please sign in to your GIS and paste the code that is obtained below. If a web browser does not automatically open, please navigate to the URL below yourself instead. Opening web browser to navigate to: &lt;A href="https://www.arcgis.com/sharing/rest//oauth2/authorize?response_type=code&amp;amp;client_id=Db8G5Jo6FCgLqTLk&amp;amp;redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&amp;amp;state=jQpTnOHa6SZTus7HYIMTkuNssqgbVk" style="color: #296eaa; background-color: transparent; text-decoration: none;" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.arcgis.com/sharing/rest//oauth2/authorize?response_type=code&amp;amp;client_id=Db8G5Jo6FCgLqTLk&amp;amp;redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&amp;amp;state=jQpTnOHa6SZTus7HYIMTkuNssqgbVk&lt;/A&gt;Enter code obtained on signing in using SAML: ········&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #000000; background-color: #ffffff;"&gt;&lt;DIV class="" style="padding: 0px 0.4em;"&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #000000; background: #ffdddd; padding: 0.4em;"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;/Users/seymagunes/opt/anaconda3/envs/ox/lib/python3.8/site-packages/urllib3/connectionpool.py:981: InsecureRequestWarning: Unverified HTTPS request is being made to host 'www.arcgis.com'. Adding certificate verification is strongly advised. See: &lt;A href="https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings" style="color: #296eaa; background-color: transparent; text-decoration: none;" target="_blank" rel="nofollow noopener noreferrer"&gt;https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings&lt;/A&gt;  warnings.warn(&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #000000; background-color: #ffffff;"&gt;&lt;DIV class="" style="padding: 0px 0.4em;"&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #000000; padding: 0.4em;"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Successfully logged in as: XXXXX
&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;sea = addresses[addresses['CTYNAME']=="SEATTLE"]&lt;BR /&gt;pd.set_option('display.max_columns', None)&lt;BR /&gt;df_o = pd.DataFrame(sea.sample(N), columns = ['LON', 'LAT'])&lt;BR /&gt;#print (df_o)&lt;BR /&gt;orders_sdf = pd.DataFrame.spatial.from_xy(df_o, 'LON', 'LAT')&lt;BR /&gt;orders_sdf = orders_sdf.drop(axis=1, labels=['LON', 'LAT'])&lt;BR /&gt;orders_fset = orders_sdf.spatial.to_featureset()&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;r = {'ObjectID': ['1','2'],&lt;BR /&gt; 'Name': ['Route1', 'Route2'],&lt;BR /&gt; 'StartDepotName': ['Warehouse', 'Warehouse'],&lt;BR /&gt; 'EndDepotName': ['Warehouse', 'Warehouse'],&lt;BR /&gt; #'EarliestStartTime': [1.573546e+12, 1.573546e+12 ],&lt;BR /&gt; # 'LatestStartTime': [8.00, 8.00 ],&lt;BR /&gt; 'Capacities':[200, 50],&lt;BR /&gt; 'CostPerUnitTime': [1,1],&lt;BR /&gt; 'MaxOrderCount':[200,50],&lt;BR /&gt; # 'MaxTotalTime': [8,8],&lt;BR /&gt; 'AssignmentRule': [1,1]&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;df = pd.DataFrame(r, columns = ['ObjectID',&lt;BR /&gt; 'Name',&lt;BR /&gt; 'StartDepotName',&lt;BR /&gt; 'EndDepotName',&lt;BR /&gt; # 'EarliestStartTime',&lt;BR /&gt; # 'LatestStartTime',&lt;BR /&gt; 'Capacities',&lt;BR /&gt; 'CostPerUnitTime',&lt;BR /&gt; 'MaxOrderCount',&lt;BR /&gt; # 'MaxTotalTime',&lt;BR /&gt; 'AssignmentRule'])&lt;BR /&gt;&lt;BR /&gt;#df["LatestStartTime"] = df["LatestStartTime"].astype("int64")/ 10 ** 6&lt;BR /&gt;#df["EarliestStartTime"] = df["EarliestStartTime"].astype("int64")/ 10 ** 6&lt;BR /&gt;&lt;BR /&gt;routes_fset = arcgis.features.FeatureSet.from_dataframe(df)&lt;BR /&gt;&lt;BR /&gt;# 1 depot&lt;BR /&gt;w = {'Latitude': [47.618011],&lt;BR /&gt; 'Longitude': [-122.329422],&lt;BR /&gt; 'Name': ['Warehouse']&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;df_w = pd.DataFrame(w, columns = ['Latitude',&lt;BR /&gt; 'Longitude',&lt;BR /&gt; 'Name'])&lt;BR /&gt;&lt;BR /&gt;depots_sdf = pd.DataFrame.spatial.from_xy(df_w, "Longitude", "Latitude")&lt;BR /&gt;depots_sdf = depots_sdf.drop(axis=1, labels=["Longitude", "Latitude"])&lt;BR /&gt;depots_fset = depots_sdf.spatial.to_featureset()&lt;BR /&gt;&lt;BR /&gt;import datetime as dt&lt;BR /&gt;import arcgis.network as network&lt;BR /&gt;&lt;BR /&gt;if_async = False&lt;BR /&gt;current_date = dt.datetime.now().date()&lt;BR /&gt;&lt;BR /&gt;result1 = network.analysis.solve_vehicle_routing_problem(orders=orders_fset, depots=depots_fset, &lt;BR /&gt; default_date=current_date, &lt;BR /&gt; routes=routes_fset, populate_route_lines=True,&lt;BR /&gt; save_route_data=True,&lt;BR /&gt; populate_directions=True,&lt;BR /&gt; directions_language="es",&lt;BR /&gt; future=if_async)&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;runs for 20+ minutes ends with error
&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;P style="color: #3d3d3d; margin: 0px; padding: 0px;"&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 09:32:15 GMT</pubDate>
    <dc:creator>SeymaGunes</dc:creator>
    <dc:date>2021-12-12T09:32:15Z</dc:date>
    <item>
      <title>Vehicle Routing Problem Solver takes too long and gives Time Out error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/vehicle-routing-problem-solver-takes-too-long-and/m-p/811501#M2461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been working on coding a Vehicle Routing Problem Solver, mostly by following ArcGIS Guide online (&lt;A class="link-titled" href="https://developers.arcgis.com/python/guide/part7-vehicle-routing-problem/" title="https://developers.arcgis.com/python/guide/part7-vehicle-routing-problem/" rel="nofollow noopener noreferrer" target="_blank"&gt;Guide to Network Analysis (Part 7 - Vehicle Routing Problem) | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;). My code is as follows:&lt;/P&gt;&lt;DIV class="" style="color: #000000; background-color: #ffffff;"&gt;&lt;DIV class="" style="color: #000000; padding: 0.4em;"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from arcgis.gis import GIS
import pandas as pd
import getpass
from IPython.display import HTML
import arcgis
from arcgis.features import Feature, FeatureSet, GeoAccessor, GeoSeriesAccessor
import networkx as nx
import osmnx as ox
import requests
import matplotlib.cm as cm
import matplotlib.colors as colors
from pathlib import Path
import geopandas as gpd # combines the capabilities of pandas and shapely for geospatial operations
#connect to your GIS
gis = GIS( client_id='Db8G5Jo6FCgLqTLk')
print("Successfully logged in as: " + gis.properties.user.username)
data_path = Path('./data')
if not data_path.exists():
&amp;nbsp;&amp;nbsp;&amp;nbsp;data_path.mkdir()
#read shape file
addresses = gpd.read_file('data/Addresses_in_King_County___address_point-shp/Addresses_in_King_County___address_point.shp')&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="" style="color: #000000; background-color: #ffffff;"&gt;&lt;DIV class="" style="color: #000000; padding: 0.4em;"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;OUTPUT: 
Please sign in to your GIS and paste the code that is obtained below. If a web browser does not automatically open, please navigate to the URL below yourself instead. Opening web browser to navigate to: &lt;A href="https://www.arcgis.com/sharing/rest//oauth2/authorize?response_type=code&amp;amp;client_id=Db8G5Jo6FCgLqTLk&amp;amp;redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&amp;amp;state=jQpTnOHa6SZTus7HYIMTkuNssqgbVk" style="color: #296eaa; background-color: transparent; text-decoration: none;" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.arcgis.com/sharing/rest//oauth2/authorize?response_type=code&amp;amp;client_id=Db8G5Jo6FCgLqTLk&amp;amp;redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&amp;amp;state=jQpTnOHa6SZTus7HYIMTkuNssqgbVk&lt;/A&gt;Enter code obtained on signing in using SAML: ········&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #000000; background-color: #ffffff;"&gt;&lt;DIV class="" style="padding: 0px 0.4em;"&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #000000; background: #ffdddd; padding: 0.4em;"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;/Users/seymagunes/opt/anaconda3/envs/ox/lib/python3.8/site-packages/urllib3/connectionpool.py:981: InsecureRequestWarning: Unverified HTTPS request is being made to host 'www.arcgis.com'. Adding certificate verification is strongly advised. See: &lt;A href="https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings" style="color: #296eaa; background-color: transparent; text-decoration: none;" target="_blank" rel="nofollow noopener noreferrer"&gt;https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings&lt;/A&gt;  warnings.warn(&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #000000; background-color: #ffffff;"&gt;&lt;DIV class="" style="padding: 0px 0.4em;"&gt;&lt;/DIV&gt;&lt;DIV class="" style="color: #000000; padding: 0.4em;"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Successfully logged in as: XXXXX
&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;sea = addresses[addresses['CTYNAME']=="SEATTLE"]&lt;BR /&gt;pd.set_option('display.max_columns', None)&lt;BR /&gt;df_o = pd.DataFrame(sea.sample(N), columns = ['LON', 'LAT'])&lt;BR /&gt;#print (df_o)&lt;BR /&gt;orders_sdf = pd.DataFrame.spatial.from_xy(df_o, 'LON', 'LAT')&lt;BR /&gt;orders_sdf = orders_sdf.drop(axis=1, labels=['LON', 'LAT'])&lt;BR /&gt;orders_fset = orders_sdf.spatial.to_featureset()&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;r = {'ObjectID': ['1','2'],&lt;BR /&gt; 'Name': ['Route1', 'Route2'],&lt;BR /&gt; 'StartDepotName': ['Warehouse', 'Warehouse'],&lt;BR /&gt; 'EndDepotName': ['Warehouse', 'Warehouse'],&lt;BR /&gt; #'EarliestStartTime': [1.573546e+12, 1.573546e+12 ],&lt;BR /&gt; # 'LatestStartTime': [8.00, 8.00 ],&lt;BR /&gt; 'Capacities':[200, 50],&lt;BR /&gt; 'CostPerUnitTime': [1,1],&lt;BR /&gt; 'MaxOrderCount':[200,50],&lt;BR /&gt; # 'MaxTotalTime': [8,8],&lt;BR /&gt; 'AssignmentRule': [1,1]&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;df = pd.DataFrame(r, columns = ['ObjectID',&lt;BR /&gt; 'Name',&lt;BR /&gt; 'StartDepotName',&lt;BR /&gt; 'EndDepotName',&lt;BR /&gt; # 'EarliestStartTime',&lt;BR /&gt; # 'LatestStartTime',&lt;BR /&gt; 'Capacities',&lt;BR /&gt; 'CostPerUnitTime',&lt;BR /&gt; 'MaxOrderCount',&lt;BR /&gt; # 'MaxTotalTime',&lt;BR /&gt; 'AssignmentRule'])&lt;BR /&gt;&lt;BR /&gt;#df["LatestStartTime"] = df["LatestStartTime"].astype("int64")/ 10 ** 6&lt;BR /&gt;#df["EarliestStartTime"] = df["EarliestStartTime"].astype("int64")/ 10 ** 6&lt;BR /&gt;&lt;BR /&gt;routes_fset = arcgis.features.FeatureSet.from_dataframe(df)&lt;BR /&gt;&lt;BR /&gt;# 1 depot&lt;BR /&gt;w = {'Latitude': [47.618011],&lt;BR /&gt; 'Longitude': [-122.329422],&lt;BR /&gt; 'Name': ['Warehouse']&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;df_w = pd.DataFrame(w, columns = ['Latitude',&lt;BR /&gt; 'Longitude',&lt;BR /&gt; 'Name'])&lt;BR /&gt;&lt;BR /&gt;depots_sdf = pd.DataFrame.spatial.from_xy(df_w, "Longitude", "Latitude")&lt;BR /&gt;depots_sdf = depots_sdf.drop(axis=1, labels=["Longitude", "Latitude"])&lt;BR /&gt;depots_fset = depots_sdf.spatial.to_featureset()&lt;BR /&gt;&lt;BR /&gt;import datetime as dt&lt;BR /&gt;import arcgis.network as network&lt;BR /&gt;&lt;BR /&gt;if_async = False&lt;BR /&gt;current_date = dt.datetime.now().date()&lt;BR /&gt;&lt;BR /&gt;result1 = network.analysis.solve_vehicle_routing_problem(orders=orders_fset, depots=depots_fset, &lt;BR /&gt; default_date=current_date, &lt;BR /&gt; routes=routes_fset, populate_route_lines=True,&lt;BR /&gt; save_route_data=True,&lt;BR /&gt; populate_directions=True,&lt;BR /&gt; directions_language="es",&lt;BR /&gt; future=if_async)&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;runs for 20+ minutes ends with error
&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;P style="color: #3d3d3d; margin: 0px; padding: 0px;"&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:32:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/vehicle-routing-problem-solver-takes-too-long-and/m-p/811501#M2461</guid>
      <dc:creator>SeymaGunes</dc:creator>
      <dc:date>2021-12-12T09:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Vehicle Routing Problem Solver takes too long and gives Time Out error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/vehicle-routing-problem-solver-takes-too-long-and/m-p/811502#M2462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you put print(xxx) statement after  each step so that you single out&lt;/P&gt;&lt;P&gt;what block has an issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Oct 2020 12:11:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/vehicle-routing-problem-solver-takes-too-long-and/m-p/811502#M2462</guid>
      <dc:creator>wwnde</dc:creator>
      <dc:date>2020-10-08T12:11:29Z</dc:date>
    </item>
  </channel>
</rss>

