Giter VIP home page Giter VIP logo

state-space-search-ai's Introduction

Solving RGB Puzzle via State Space Search Algortihms

Introduction

State Space Search is a type of search, in Artificial Intelligence, where we apply available set of actions to reach from initial state to the goal state.

There are two main types of State Space Search:

  • Uninformed Search
  • Informed Search

Uninformed Search

In uninformed search, there is no information regarding the location of goal state. This project applies the following uninformed search algorithms:

  • Breadth First Search
  • Depth First Search
  • Iterative Deepening Search

Informed Search

Informed search, on the other hand, consider some information about the goal state via heuristic function. This project applies the following informed search algorithms:

  • Greedy Best First Search
  • A* Search

RGB Puzzle - Problem

Red Green Blank (RGB) Problem is similar (not the same) to 15 Puzzle. (https://en.wikipedia.org/wiki/15_puzzle)

Input

Input for this problem is a 5x5 grid where each cell is a character and the there can only be following characters:

  • R: Red
  • G: Green
  • B: Blank

An example input configuration is given below:

R R R R R
R G G G R
R G G R R
R G G R G
R R R B R

Goal State

The goal state/grid to achieve is:

R R R R R  
R G G G R
R G B G R
R G G G R
R R R R R

Allowed Actions/Operators

One important thing to know is that 'B' can only be moved/swapped with any of the four (max) neighbors around 'B' as the allowed operators are:

  • Up
  • Down
  • Left
  • Right

Output

The code writes the operators, required in succession, in a file which are needed to solve the given input state and outputs the nodes generated and explored on the console. The output file for the above input will look like:

U
R
U
L
L

Note

Each search is regarded as a problem in the code and thus, Problem 1 corresponds to BFS similarly Problem 5 corresponds to A* respectively. The input file format is 'PX-in.txt' where X can be 1-5 and the output file format is 'PX-out.txt' where X can be 1-5 again.

state-space-search-ai's People

Contributors

sahirnoorali avatar

Stargazers

 avatar  avatar  avatar  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.