File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 16231623 " elif limit >= 0:\n",
16241624 " cutoff_occurred = True\n",
16251625 " limit += 1\n",
1626- " all_node_color .pop()\n",
1626+ " all_node_colors .pop()\n",
16271627 " iterations -= 1\n",
16281628 " node_colors[node.state] = \"gray\"\n",
16291629 "\n",
21622162 "outputs": [],
21632163 "source": [
21642164 "# Heuristics for 8 Puzzle Problem\n",
2165+ "import math\n",
2166+ "\n",
21652167 "def linear(node):\n",
21662168 " return sum([1 if node.state[i] != goal[i] else 0 for i in range(8)])\n",
21672169 "\n",
28532855 " neighbor = argmax_random_tie(neighbors,\n",
28542856 " key=lambda node: problem.value(node.state))\n",
28552857 " 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",
28572859 " current.state = neighbor.state\n",
28582860 " iterations -= 1\n",
28592861 " \n",
65276529 "name": "python",
65286530 "nbconvert_exporter": "python",
65296531 "pygments_lexer": "ipython3",
6530- "version": "3.6.4 "
6532+ "version": "3.7.6 "
65316533 },
65326534 "widgets": {
65336535 "state": {
65616563 }
65626564 },
65636565 "version": "1.2.0"
6566+ },
6567+ "pycharm": {
6568+ "stem_cell": {
6569+ "cell_type": "raw",
6570+ "source": [],
6571+ "metadata": {
6572+ "collapsed": false
6573+ }
6574+ }
65646575 }
65656576 },
65666577 "nbformat": 4,
65676578 "nbformat_minor": 1
6568- }
6579+ }
You can’t perform that action at this time.
0 commit comments