graph base class
dfs