Lemme In is an university project which goal is to find the quickest way through an anthill. To do so,each single ant need to take the shortest rout(and not necessarily the easiest), whithout walking on its peers, and avoiding traffic jams.
At the beginning of the game all the ants are in the entrance.
The goal is to lead them to the exit room, in a minimum amount of laps.
Each room could contain a single ant at a time (except ##start and ##end which can contain as many as needed).
Assuming the graph has
To fill every value of the matrix we need to check if there is an edge between every pair
The advantage of such representation is that we can check in
Our approach to solve this project includs a Breadth First Search algorithm over all the rooms in order to know which paths lead from start to end, we then select the shortest one, remove that paths's rooms and query for the next shorter route.
What follows up is moving each ant for the multiple number of routes we find out, but not before checking the efficiency of doing so due to the number of ants we have to move and the opportunity cost of the lenght of some routes over the shortest ones, even if the traffic is higher, what we prioritize is using the minimum amount of laps.
Green for the start, red for the end:
With each lap, you can move each ant only once by following a tunnel (if the receiving room is clear).