I'm having a hard time understanding Tarjan's algorithm for articulation points. I'm currently following this tutorial here: https://www.hackerearth.com/practice/algorithms/graphs/articulation-points-and-bridges/tutorial/ https://www.hackerearth.com/practice/algorithms/graphs/articulation-points-and-bridges/tutorial/. What I really can't see, and couldn't see in any other tutorial, is what exactly a "back edge" means. Considering the graph given there, I know 3-1 and 4-2 are back edges, but are 2-1, 3-2, and 4-3 back edges too? Thank you.
...后边是将顶点连接到在其父级之前发现的顶点的边。
从你的source https://www.hackerearth.com/practice/algorithms/graphs/articulation-points-and-bridges/tutorial/.
这样想:当您在图上应用 DFS 时,您会修复算法选择的某些路径。现在在给定的情况下:0->1->2->3->4
。正如在文章中提到的,源图包含边4-2
and 3-1
。当 DFS 达到 3 时,它可以选择 1,但 1 已经在您的路径中,因此它是一个back edge
因此,正如消息来源中提到的,这是一条可能的替代路径。
解决第二个问题:2-1、3-2 和 4-3 也是后边缘吗?对于不同的道路,他们可以是。假设你的 DFS 选择0->1->3->2->4
then 2-1
and 4-3
是后边缘。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)