Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QuickGraph : Cycle Detection

I am currelty working on a application where i need to detect a cycle from a undirectedgraph.I got a implementation in c# for the same but it is very slow.I found Quickgraph Sdk but not able to find any implementation or sample or documentation for the same.

If anyone knows about the implemetation or walkthorughs of quickgraph then please let me know as it very urgent for me.

like image 714
Tjcool Avatar asked Sep 03 '26 14:09

Tjcool


1 Answers

I don't know quickgraph, but finding cycles in an undirected graph should be doable in O(n) by searching depth first and marking each visited node... if you explore a new edge to an already visited node you have a cycle in your graph.

like image 89
gonium Avatar answered Sep 06 '26 03:09

gonium



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!