depth-first traversal with some action for each vertex
depth-first traversal with some action for each vertex