Skip to content

Commit

Permalink
deploy: Jij-Inc/Jij-Docs-docusaurus@6d64d1f84fb1b8959f3f981170e99297d…
Browse files Browse the repository at this point in the history
…14fed6e
  • Loading branch information
actions-user committed Sep 9, 2024
1 parent c0bb8e4 commit 322506d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tutorial/3-tsp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,20 @@
"metadata": {},
"outputs": [],
"source": [
"import geocoder as gc\n",
"from geopy.geocoders import Nominatim\n",
"import numpy as np\n",
"\n",
"geolocator = Nominatim(user_agent='python')\n",
"\n",
"# set the name list of traveling points\n",
"points = ['茨城県', '栃木県', '群馬県', '埼玉県', '千葉県', '東京都', '神奈川県']\n",
"\n",
"# get the latitude and longitude\n",
"latlng_list = []\n",
"for point in points:\n",
" location = gc.osm(point)\n",
" latlng_list.append(location.latlng)\n",
" location = geolocator.geocode(point)\n",
" if location is not None:\n",
" latlng_list.append([ location.latitude, location.longitude ])\n",
"# make distance matrix\n",
"num_points = len(points)\n",
"inst_d = np.zeros((num_points, num_points))\n",
Expand Down

0 comments on commit 322506d

Please sign in to comment.