Added depth-first-search algorithm, simple and advanced version with
special DFS edge types detection.