File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1639
1639
" problem=romania_problem)"
1640
1640
]
1641
1641
},
1642
+ {
1643
+ "cell_type": "markdown",
1644
+ "metadata": {},
1645
+ "source": [
1646
+ "## 8. Iterative deepening search\n",
1647
+ "\n",
1648
+ "Let's change all the 'node_colors' to starting position and define a different problem statement. "
1649
+ ]
1650
+ },
1651
+ {
1652
+ "cell_type": "code",
1653
+ "execution_count": 9,
1654
+ "metadata": {},
1655
+ "outputs": [],
1656
+ "source": [
1657
+ "def iterative_deepening_search_for_vis(problem):\n",
1658
+ " for depth in range(sys.maxsize):\n",
1659
+ " iterations, all_node_colors, node=depth_limited_search_for_vis(problem)\n",
1660
+ " if iterations:\n",
1661
+ " return (iterations, all_node_colors, node)"
1662
+ ]
1663
+ },
1664
+ {
1665
+ "cell_type": "code",
1666
+ "execution_count": null,
1667
+ "metadata": {},
1668
+ "outputs": [],
1669
+ "source": [
1670
+ "all_node_colors = []\n",
1671
+ "romania_problem = GraphProblem('Arad', 'Bucharest', romania_map)\n",
1672
+ "display_visual(romania_graph_data, user_input=False, \n",
1673
+ " algorithm=iterative_deepening_search_for_vis, \n",
1674
+ " problem=romania_problem)"
1675
+ ]
1676
+ },
1642
1677
{
1643
1678
"cell_type": "markdown",
1644
1679
"metadata": {},
You can’t perform that action at this time.
0 commit comments