From 82b74ca7b49db253bd6c1b856103345ed90fbbc3 Mon Sep 17 00:00:00 2001 From: Donne Martin Date: Sun, 16 Aug 2015 08:23:26 -0400 Subject: [PATCH] Revised path exists challenge algorithm discussion. --- graphs_trees/graph_path_exists/path_exists_solution.ipynb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/graphs_trees/graph_path_exists/path_exists_solution.ipynb b/graphs_trees/graph_path_exists/path_exists_solution.ipynb index c6ac3ed..2610c72 100644 --- a/graphs_trees/graph_path_exists/path_exists_solution.ipynb +++ b/graphs_trees/graph_path_exists/path_exists_solution.ipynb @@ -71,7 +71,11 @@ "source": [ "## Algorithm\n", "\n", - "We use breadth-first search to determine the shortest path. Depth-first search is easier to implement with just straight recursion, but often results in a longer path.\n", + "To determine if there is a path, we can use either breadth-first or depth-first search.\n", + "\n", + "Breadth-first search can also be used to determine the shortest path. Depth-first search is easier to implement with just straight recursion, but often results in a longer path.\n", + "\n", + "We'll use a breadth-first search approach:\n", "\n", "* Add the start node to the queue and mark it as visited\n", "* If the start node is the end node, return True\n",