Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

ljoly/npuzzle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npuzzle

Overview

  • The goal of this project is to solve the N-puzzle using the A* algorithm with admissible heuristics
  • Heuristics used: Manhattan distance, Manhattan distance + Linear conflict, Misplaced tiles
  • Bonus: visualizer => server + front (reactJS)

Usage

client/
npm install && npm start

assets/
python generator.py -s 3 > map

server/
make
./npuzzle -f ../assets/map -greedy -visualizer

./npuzzle:

  • -f string
      File containing the puzzle to solve
  • -greedy
    Use greedy search (if not true, uniform-cost search is used by default)
  • -heuristic string
    Heuristics: Manhattan "m", Misplaced Tiles "mt" or Manhattan + Linear Conflict "mlc" (default "mlc")
  • -visualizer
    Launch a web app to visualize results on your browser

Most effective configurations

  • 3x3: Manhattan distance + Linear conflict in greedy search
  • 4x4 and 5x5: Manhattan distance + Linear conflict in uniform-cost search

About

Solving sliding puzzles using the A* algorithm

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •