Graph API and DFS with paths