GithubHelp home page GithubHelp logo

abpaudel / 8-puzzle Goto Github PK

View Code? Open in Web Editor NEW
25.0 4.0 21.0 38 KB

8 puzzle solver using BFS, DFS, IDDFS and A-star algorithm

Home Page: https://abpaudel.com/8-puzzle/

License: GNU General Public License v3.0

Python 100.00%
8-puzzle 8-puzzle-solver bfs astar-algorithm dfs iddfs-algorithm

8-puzzle's Introduction

8-puzzle

8 puzzle solver using BFS, DFS, IDDFS and A-star algorithm

It is assumed that goal state is:

 0 1 2
 3 4 5
 6 7 8

Usage

You can run main.py with the name of algorithm - which is ast for A*, bfs, or dfs, or ids for iterative deepening dfs - as the first argument and initial state as the second one:

$ python main.py bfs 1,2,5,3,4,0,6,7,8
$ python main.py dfs 1,2,5,3,4,0,6,7,8
$ python main.py ids 1,2,5,3,4,0,6,7,8
$ python main.py ast 1,2,5,3,4,0,6,7,8

Solution and details will be saved to {alg-name}_output.txt.

8-puzzle's People

Contributors

abpaudel avatar roozmr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

8-puzzle's Issues

Goal state

How do I edit the goal state? I can't find it in the code.

Also it seems you just called existing libraries to solve the puzzle. I never knew this existed for this particular problem. Please could you clarify?

Thanks.

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.