Coder Social home page Coder Social logo

8-puzzle's Introduction

Welcome to 8-puzzle πŸ‘‹

Solve 8-puzzle using search algorithms, including BFS, DFS, A*, IDA* in python. The output of results will be written into a csv file.
bfs (Breadth-First Search)
dfs (Depth-First Search)
ast (A-Star Search)
ida (Iterative-Deepening-Ξ‘Star Search)

Usage

Run the main function in the ipynb or the py to test. You can change the dir of the puzzles in .src/SlidingBlocks/examples/

You change the algorithms and heuristic functions (0,1,2)

Part of the output:

----------------------------------
Implementing BFS
----------------------------------
Read the file 3x3_7
----------------------------------
It is a 3 X 3 sliding-tile puzzle
----------------------------------
The initial state is  [2, 5, 4, 0, 3, 1, 6, 8, 7]
----------------------------------
Starting time is  2021-09-26 17:58:59
----------------------------------
Ending time is  2021-09-26 17:58:59
----------------------------------
A puzzle effectively solved
----------------------------------

Puzzle file example:

3
1 2 5
3 4 8
6 7 0
AStar steps: 4

Document

writeup

References

Author

πŸ‘€ Yuchi Chen

Show your support

Give a ⭐️ if this project helped you!


This README was generated with ❀️ by readme-md-generator

8-puzzle's People

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.