add DFSForest function for Graph