Skip to content

Visually solves a random game of 8 Puzzle using A* Algorithm and Priority Queue and demonstrate each step.

Notifications You must be signed in to change notification settings

anas40/8PuzzleSolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This project uses A star algorithm to find the solution of famous 3x3 sliding puzzle

First of all a permutation of numbers from [0,8] is generated from Fisher Yates algorithm. It keeps generating new permutations untill a solvable permutations is found, then shuffled state is displayed.

Start

An instance of solver class is generated which uses A star algorithm with manhattan distance as heuristic. A priority queue built with heap data structure gives the best possible solution at each step. At final state it backtract the path and put all those states in the stack. Then it iterates on the states changing only those nodes in the DOM which have been changed(only 2 at each step).

About

Visually solves a random game of 8 Puzzle using A* Algorithm and Priority Queue and demonstrate each step.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages