gready + dfs