Skip to content
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