Given a start node and a function or code block this performs a depth first search and will exit upon function or code block returning true, or returns :goal_node_not_found when it has visited the whole graph. visited is a set containing all nodes that has been checked. frontier is a queue were new nodes are prepended in reverse order, making this a depth first search.
(start, goal = :goalNode?)