diff --git a/search.ipynb b/search.ipynb index 7f4fe7473..523f50ee7 100644 --- a/search.ipynb +++ b/search.ipynb @@ -30,7 +30,7 @@ "\n", "Here, we learn about problem solving. Building goal-based agents that can plan ahead to solve problems, in particular navigation problem / route finding problem. First, we will start the problem solving by precisely defining **problems** and their **solutions**. We will look at several general-purpose search algorithms. Broadly, search algorithms are classified into two types:\n", "\n", - "* **Uninformed search algorithms**: Search algorithms which explores the search space without having any information about the problem other than its definition.\n", + "* **Uninformed search algorithms**: Search algorithms which explore the search space without having any information about the problem other than its definition.\n", "* Examples:\n", " 1. Breadth First Search\n", " 2. Depth First Search\n", @@ -273,9 +273,9 @@ "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", + "node_label_pos = { k:[v[0],v[1]-10] for k,v in romania_locations.items() }\n", "\n", - "# use thi whiel labeling edges\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", @@ -283,6 +283,7 @@ " 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", @@ -293,7 +294,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "We have completed building our graph based on romania_map and its locations. It's time to display it here in the notebook. This function `show_map(node_colors)` helps us do that. We will be calling this function later on to display the map at each and every interval step while searching using variety of algorithms from the book." + "We have completed building our graph based on romania_map and its locations. It's time to display it here in the notebook. This function `show_map(node_colors)` helps us do that. We will be calling this function later on to display the map at each and every interval step while searching, using variety of algorithms from the book." ] }, { @@ -437,7 +438,7 @@ " \n", " for i in range(slider.max + 1):\n", " slider.value = i\n", - " # time.sleep(.5)\n", + " #time.sleep(.5)\n", " \n", " slider = widgets.IntSlider(min=0, max=1, step=1, value=0)\n", " slider_visual = widgets.interactive(slider_callback, iteration = slider)\n", @@ -529,6 +530,7 @@ " all_node_colors = []\n", " node_colors = dict(initial_node_colors)\n", " \n", + " #Adding first node to the queue\n", " frontier.append(Node(problem.initial))\n", " \n", " node_colors[Node(problem.initial).state] = \"orange\"\n", @@ -536,6 +538,7 @@ " all_node_colors.append(dict(node_colors))\n", " \n", " while frontier:\n", + " #Popping first node of queue\n", " node = frontier.pop()\n", " \n", " # modify the currently searching node to red\n",