Graph depth-first and breadth-first searches (+ unit tests).