Skip to content

timzhang642/8-Puzzle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

8-Puzzle

The following searach algorithms are implemented:

  • Breadth-first search
  • Depth-first search
  • Iterative deepening DFS search
  • Uniform-Cost search
  • Best-first search, h = number of tiles that are not it correct position
  • A*1 search, h = number of tiles that are not it correct position
  • A*2 search, h = sum of Manhattan distances between all tiles and their correct positions
  • A*3 search, h = fair Manhattan distance

Example:

Initial state
[1 2 3]
[8 6 4]
[7 5 0]
action= None , depth= 0

step 1
[1 2 3]
[8 6 4]
[7 0 5]
action= move 5 to the right , depth= 1

step 2
[1 2 3]
[8 0 4]
[7 6 5]
action= move 6 down , depth= 2. Goal state found

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published