Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 1.23 KB

readme.md

File metadata and controls

25 lines (20 loc) · 1.23 KB

8 Puzzle problem using A* Search

Group Members

  • Devashri Gadgil
  • Varad Deshpande
  • Akshay Bheda

Problem Statement

The 8-puzzle problem is a puzzle invented by Noyes Palmer Chapman. It is played on a 3-by-3 grid with 8 square blocks labeled 1 through 8 and a blank square. The goal is to rearrange the blocks so that they are in order. We are permitted to slide blocks horizontally or vertically into the blank square.The following shows a sequence of legal moves from an initial board position to the goal position.

Instructions to execute the code:

Prerequisites:

  • Make sure you have python installed.
  • Make sure you have numpy installed.
  • When you import the code in an IDE make sure there are no errors on the imports (numpy and copy).

Steps to run the program:

  • Clone the repository
  • Go to the folder containing the code.
  • Open the terminal and and run command- py A_star.py
  • While inputting the initial and goal state, input them as a matrix. For Example, if you want to input a goal state 1 2 3 4 5 6 7 8 0, you should input as matrix as follows: 123 (3 inputs per line)
  • Select the heuristic of your choice. If you input any value besides 1, Manhattan heuristic will get selected automatically.