dfs search
generalizing graph definition