File tree 1 file changed +15
-4
lines changed
1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 1623
1623
" elif limit >= 0:\n",
1624
1624
" cutoff_occurred = True\n",
1625
1625
" limit += 1\n",
1626
- " all_node_color .pop()\n",
1626
+ " all_node_colors .pop()\n",
1627
1627
" iterations -= 1\n",
1628
1628
" node_colors[node.state] = \"gray\"\n",
1629
1629
"\n",
2162
2162
"outputs": [],
2163
2163
"source": [
2164
2164
"# Heuristics for 8 Puzzle Problem\n",
2165
+ "import math\n",
2166
+ "\n",
2165
2167
"def linear(node):\n",
2166
2168
" return sum([1 if node.state[i] != goal[i] else 0 for i in range(8)])\n",
2167
2169
"\n",
2853
2855
" neighbor = argmax_random_tie(neighbors,\n",
2854
2856
" key=lambda node: problem.value(node.state))\n",
2855
2857
" if problem.value(neighbor.state) <= problem.value(current.state):\n",
2856
- " \"\"\"Note that it is based on negative path cost method\"\"\"\n",
2858
+ " \"\"\"Note that it is based on negative path cost method\"\"\"\n",
2857
2859
" current.state = neighbor.state\n",
2858
2860
" iterations -= 1\n",
2859
2861
" \n",
6527
6529
"name": "python",
6528
6530
"nbconvert_exporter": "python",
6529
6531
"pygments_lexer": "ipython3",
6530
- "version": "3.6.4 "
6532
+ "version": "3.7.6 "
6531
6533
},
6532
6534
"widgets": {
6533
6535
"state": {
6561
6563
}
6562
6564
},
6563
6565
"version": "1.2.0"
6566
+ },
6567
+ "pycharm": {
6568
+ "stem_cell": {
6569
+ "cell_type": "raw",
6570
+ "source": [],
6571
+ "metadata": {
6572
+ "collapsed": false
6573
+ }
6574
+ }
6564
6575
}
6565
6576
},
6566
6577
"nbformat": 4,
6567
6578
"nbformat_minor": 1
6568
- }
6579
+ }
You can’t perform that action at this time.
0 commit comments