Skip to content

Added Iterative deepening search in search.ipynb #879

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions search.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1639,6 +1639,41 @@
" problem=romania_problem)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 8. Iterative deepening search\n",
"\n",
"Let's change all the 'node_colors' to starting position and define a different problem statement. "
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"def iterative_deepening_search_for_vis(problem):\n",
" for depth in range(sys.maxsize):\n",
" iterations, all_node_colors, node=depth_limited_search_for_vis(problem)\n",
" if iterations:\n",
" return (iterations, all_node_colors, node)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"all_node_colors = []\n",
"romania_problem = GraphProblem('Arad', 'Bucharest', romania_map)\n",
"display_visual(romania_graph_data, user_input=False, \n",
" algorithm=iterative_deepening_search_for_vis, \n",
" problem=romania_problem)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down