Implementation of Depth First Search (DFS) to exhaustively search and catalog a map