Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 49dee46

Browse files
nvinayvarma189norvig
authored andcommitted
Removed a repeating cell (aimacode#789)
1 parent 18f3937 commit 49dee46

File tree

1 file changed

+0
-46
lines changed

1 file changed

+0
-46
lines changed

search.ipynb

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -803,52 +803,6 @@
803803
" edge_labels[(node, connection)] = distance"
804804
]
805805
},
806-
{
807-
"cell_type": "code",
808-
"execution_count": 7,
809-
"metadata": {
810-
"collapsed": true
811-
},
812-
"outputs": [],
813-
"source": [
814-
"# initialise a graph\n",
815-
"G = nx.Graph()\n",
816-
"\n",
817-
"# use this while labeling nodes in the map\n",
818-
"node_labels = dict()\n",
819-
"# use this to modify colors of nodes while exploring the graph.\n",
820-
"# This is the only dict we send to `show_map(node_colors)` while drawing the map\n",
821-
"node_colors = dict()\n",
822-
"\n",
823-
"for n, p in romania_locations.items():\n",
824-
" # add nodes from romania_locations\n",
825-
" G.add_node(n)\n",
826-
" # add nodes to node_labels\n",
827-
" node_labels[n] = n\n",
828-
" # node_colors to color nodes while exploring romania map\n",
829-
" node_colors[n] = \"white\"\n",
830-
"\n",
831-
"# we'll save the initial node colors to a dict to use later\n",
832-
"initial_node_colors = dict(node_colors)\n",
833-
" \n",
834-
"# positions for node labels\n",
835-
"node_label_pos = { k:[v[0],v[1]-10] for k,v in romania_locations.items() }\n",
836-
"\n",
837-
"# use this while labeling edges\n",
838-
"edge_labels = dict()\n",
839-
"\n",
840-
"# add edges between cities in romania map - UndirectedGraph defined in search.py\n",
841-
"for node in romania_map.nodes():\n",
842-
" connections = romania_map.get(node)\n",
843-
" for connection in connections.keys():\n",
844-
" distance = connections[connection]\n",
845-
"\n",
846-
" # add edges to the graph\n",
847-
" G.add_edge(node, connection)\n",
848-
" # add distances to edge_labels\n",
849-
" edge_labels[(node, connection)] = distance"
850-
]
851-
},
852806
{
853807
"cell_type": "markdown",
854808
"metadata": {},

0 commit comments

Comments
 (0)