Graph represntation and dfs traversal