DFS

来源:互联网 发布:豆瓣怎么做淘宝 编辑:程序博客网 时间:2024/04/30 16:22

(a)     Conduct a DFS for the following graph. Please label each vertex u with the discovery time and the finish time d(u)/f(u). We assume the vertices are alphabetically ordered. So, you should start the traversal from vertex a, and follow the alphabetic order whenever you need to make choices.

(b)   List all edges that belong to each of the following sets:

The set of back edges:

The set of forward edges:

The set of cross edges:

(c)          Identify the strongly connected components and draw the component graph.

 

Solution:

 

(a)

(b)   List all edges that belong to each of the following sets:

The set of back edges:

              (j, a), (s, p), (k, h)

The set of forward edges:

              (a, d), (a, e), (s, h), (e, m), (p, m)

The set of cross edges:

              (g, j), (m, f)

 

(c)    Identify the strongly connected components and draw the component graph.