Giter Club home page Giter Club logo

jade-swarm's Introduction

Jade Swarm

Implementation of uninformed and informed AI search algorithms in Rust, using a knock-off "Lights Out" game with an extra color as the problem.

Table of Contents

Introduction

This repository contains the implementation of the following search algorithms in Rust:

  • Breadth First Search
  • Depth First Search
  • Iterative Deepening Search and Depth Limited Search
  • Best First Search
  • Uniform Cost Search
  • A* Search
  • Iterative Deepening A* Search
  • Greedy Best First Search
  • Recursive Best First Search

Problem

Jade Swarm is a game similar to Lights Out, with the deferences being that it has an extra color, and instead of being on a grid, the game is represented using an undirected graph.

The game starts with a graph that has its vertices colored in either Red or Green or Black. The objective of the player is to change the color all the vertices to Green using the following actions:

  • Clicking on a green node causes all the non-black nodes around that node to change their colors from red to green or from green to red (a toggle).
  • Clicking on a red node causes all the non-black nodes around that node to change their colors from red to green or from green to red (a toggle).
  • Clicking on a black node first causes all the non-black nodes around that node to change their colors from red to green or from green to red (a toggle) and then if the number of green nodes around the clicked black node is more than the number of red nodes, the black node turns to green; if the number of red nodes around the clicked black node is more than the number of green nodes, the black node turns to red; otherwise, the black node stays black.

Here is an example: example

Model

The model is available at: Model

Heuristic

The description of the heuristic and the proof for consistency and admissibility is available at: Heuristic

Usage Guide

The tests are available in the main file. You can run them using

cargo run

See Also

The implementation of the algorithms were influenced by the following book by Stuart Russell and Peter Norvig:

jade-swarm's People

Contributors

arashsm79 avatar

Stargazers

 avatar

Watchers

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