Tarjan cycle detection help C#

后端 未结 3 1312
深忆病人
深忆病人 2020-12-28 13:21

Here is a working C# implementation of tarjan\'s cycle detection.

The algorithm is found here: http://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_

3条回答
  •  暖寄归人
    2020-12-28 14:20

    The above is actually correct, I did not understand what a strongly connected component was. I was expecting the function to return an empty List of strongly connected components, yet it was returning a list of single nodes.

    I believe the above is working. Feel free to use if you need it!

提交回复
热议问题