This project demonstrates **breadth-first search**, a simple algorithm for searching through a graph.



## Story


A few days ago, someone accidentally dropped a mine in the middle of a lake (hey, The Matrix makes less sense than this and it earned millions). This poses a serious threat to the inhabitants of the surrounding area – especially the ducks – so the local council has tasked us with locating and deactivating the charge. To help with the search, we have a fancy object detector that can scan the whole lake at once. Unfortunately, it can't tell the difference between a mine and an innocent fish, so we have to check each point ourselves.



## How it works


In breadth-first search, we keep track of which nodes to examine next using a queue. Then we proceed as follows:


1. Choose one node from the graph, and add it to the queue. This will be our starting point.

2. Pop a node from the queue and examine it.

* If it's a mine, we're done!

* Otherwise, take the nodes next to it. If we haven't checked that node before, add it to the queue – we'll check it later.

3. If the queue is empty, then we've searched the whole lake without getting a match. There's probably nothing to worry about.

4. If the queue is not empty, repeat from step 2.