无法弄清楚这个DFS之谜

时间:2014-04-11 03:24:31

标签: algorithm graph depth-first-search

one of the df trees consists of only one vertex v though v has both 
incoming and outgoing edges without a self-loop. 
Write G and its df forest.

顶点怎么可能有外边缘,但是树中唯一的顶点?交叉边缘不计算,还是有更聪明的解决方案?

1 个答案:

答案 0 :(得分:0)

DFS树通常被定义为仅包含前沿访问的节点,而不是交叉边。作为提示:如果有一个边缘(v,u)并且在你的dFS上启动,那么你将不会出现在v的DFS树中。

希望这有帮助!