Skip to content

shakram02/Npuzzle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

N-Puzzle

This library has algorithms for solving the 8-Puzzle problem. It's a defacto problem in AI.

The input of the game is a state of the 8-Puzzle

Algorithm

The library implements

  • DFS
  • BFS
  • A* with heuristics
    • Manhattan Distance
    • Euclidean Distance

The code exists in solvers.kt and it's almost a one to one mapping of the Pseudocode

A*

A*

DFS & BFS

DFS

Building

To build the project run

gradle jar

Adding as a dependency

Step 1. Add the JitPack repository to your build file Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Step 2. Add the dependency

dependencies {
    compile 'com.github.shakram02:Npuzzle:v1.0.0'
}

The code uses Data Structures from the following repos

Queue, Stack

About

N puzzle (8-Puzzle) game solver library

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages