Code Monkey home page Code Monkey logo

lemin's Introduction

42 Project: Lem_in

The purpose of this project is to find the shortest path on a graph to move 'ants' from start to end. Ants could only move one room per turn, and no more than one ant could occupy a single node at one time.

A text file is given as input, which specifies the number of ants, the rooms, and the links. It would look something like this:

##start
1 23 3
2 16 7
#comment
3 16 3
4 16 5
5 9 3
6 1 5
7 4 8
##end
0 9 5
0-4
0-6
1-3
4-3
5-2
3-5
#another comment
4-2
2-1
7-6
7-2
7-4
6-5

Which corresponds to a graph:

           ______________
         /                \
  ______[5]----[3]----[1] |
/               |    /    |
[6]-----[0]----[4]  /     |
 \    _________/|  /      |
  \ /          [2]/______ /
   [7]_________/

We used a breadth first algorithm to find optimal paths and then remove paths as the number of ants decreased. By using this method we were able to find the least number of turns for all ants to reach to end room.

lemin's People

Contributors

rafazrte avatar kyleamckee avatar

Watchers

James Cloos avatar  avatar

Forkers

rafazrte

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.