From 0ac7c575a8c8b3f21934b3b8e00671f60abc2029 Mon Sep 17 00:00:00 2001 From: Vinay Varma Date: Fri, 2 Mar 2018 22:34:26 +0530 Subject: [PATCH] Removed a repeating cell --- search.ipynb | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/search.ipynb b/search.ipynb index 2ac393ea0..a45a30ea6 100644 --- a/search.ipynb +++ b/search.ipynb @@ -803,52 +803,6 @@ " edge_labels[(node, connection)] = distance" ] }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "# initialise a graph\n", - "G = nx.Graph()\n", - "\n", - "# use this while labeling nodes in the map\n", - "node_labels = dict()\n", - "# use this to modify colors of nodes while exploring the graph.\n", - "# This is the only dict we send to `show_map(node_colors)` while drawing the map\n", - "node_colors = dict()\n", - "\n", - "for n, p in romania_locations.items():\n", - " # add nodes from romania_locations\n", - " G.add_node(n)\n", - " # add nodes to node_labels\n", - " node_labels[n] = n\n", - " # node_colors to color nodes while exploring romania map\n", - " node_colors[n] = \"white\"\n", - "\n", - "# we'll save the initial node colors to a dict to use later\n", - "initial_node_colors = dict(node_colors)\n", - " \n", - "# positions for node labels\n", - "node_label_pos = { k:[v[0],v[1]-10] for k,v in romania_locations.items() }\n", - "\n", - "# use this while labeling edges\n", - "edge_labels = dict()\n", - "\n", - "# add edges between cities in romania map - UndirectedGraph defined in search.py\n", - "for node in romania_map.nodes():\n", - " connections = romania_map.get(node)\n", - " for connection in connections.keys():\n", - " distance = connections[connection]\n", - "\n", - " # add edges to the graph\n", - " G.add_edge(node, connection)\n", - " # add distances to edge_labels\n", - " edge_labels[(node, connection)] = distance" - ] - }, { "cell_type": "markdown", "metadata": {},