Skip to content
/ lem-in Public

lem-in solves a multi-agent pathfinding problem. It involves optimisation and graph theory. #42

Notifications You must be signed in to change notification settings

bdibon/lem-in

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lem-in

The goal of this project is to find the quickest way for a colony of N ants to cross any farm.

  1. The farm will have two endpoints : start and end.
  2. All the ants are stacked on start at the beginning.
  3. An ant which is on a room (graph node) can only move to the neighbouring rooms.
  4. An ant can only go through one edge during a turn.
  5. There can be only one ant per room (except for start and end).

Image of an ant farm

Build

Run make in the root folder of the project will produce an executable lem-in.

Help the ants

lem-in will read an ant farm from stdin, the ant farm is a text file which looks like this:

  • number_of_ants
  • the_rooms
  • the_links
2
1 0 2
##start
0 2 0
##end
4 2 6
2 4 2
3 4 4
0-1
0-2
2-3
3-4
4-1

lem-in will then return a formatted answer Lx-y Lz-w Lr-o where x, z and r represent the ant id; y, w, o represent the room id, every line break means the end of a turn. Thus L1-2 means ant 1 moved to room 2.

L1-2
L1-3 L2-2
L1-1 L2-3 L3-2
L2-1 L3-3
L3-1

About

lem-in solves a multi-agent pathfinding problem. It involves optimisation and graph theory. #42

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published