Skip to content

The goal of this project is to find the quickest way to get n ants across the farm.

Notifications You must be signed in to change notification settings

vkinnune/42-lem-in

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42-lem-in

Lem-in is an algorithmic project focusing on graphs. The goal is to reproduce the behaviours of an ant farm manager.

Our goal is to get the most ants from the source to the sink in the least time possible. Two ants cannot be in the same room simultaneously except for the starting and ending nodes. The input data tells us the number of ants, nodes, and edges.

I use a variation of Edmond-Karp’s with the breadth-first search algorithm. With 4000 nodes and 8000 edges the solution generates in 2-3 seconds. For less than that it's almost instant.

Usage

Run make. Works with Linux and MacOS.

Run with ./lem-in < Filename.

A collection of maps are found in /maps.

For the visualizer you need Raylib installed. To run with visualizer first run the make command inside /lem-in-visualizer folder. After that run ./lem-in < Filename | ./lem-in-visualizer/a.out.

GIF

About

The goal of this project is to find the quickest way to get n ants across the farm.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published