Giter VIP home page Giter VIP logo

puzzle-solver's Introduction

Sliding Puzzle Solver

The goal of the current project is to solve 3-, 8-, and 15-tiled slider puzzles using four different heuristics and to compare the efficiency among them - the number of misplaced tiles, the sum of the Manhattan distance for each tile, the number of swaps used in the Maxsort algorithm, and the sum of the Euclidean distance for each tile. When analyzing the performance of each heuristic, the number of nodes/neighbors visited when solving the puzzle was used as a performance measure.

The goal of the slider puzzle is to rearrange the tiles so that the numbers are in order from left to right and top to bottom. The tiles can be slid either horizontally or vertically into the blank square.

image

Input and Output files

The input file is named "config.txt" and contains the values of each puzzle in one row with each value separated by a space. In place of the blank space, the value 0 is entered. It's important that there are only one puzzle values for each row.

The output file is called "report.txt". After the program is run, it prints the puzzle and then how many nodes were created in the process of solving that puzzle with each heuristic.

Compilation and Execution

A makefile is created for this project, so the user can run make or make clean (if the user run the program before) in the terminal to compile and run java Main to execute the program.

Further analysis of the heuristics can be found here.

puzzle-solver's People

Contributors

oyuntugsgantumur avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.