is there anyway to detect all the cycles in an undirected graph generated with quick graph and print the list of cycles. I "googled" a little bit and I came to know that cycles in a graph can be detected using "Depth First Search Algorithm". I then tried something like this:
var g = new UndirectedGraph<int, TaggedUndirectedEdge<int, int>>();
var e1 = new TaggedUndirectedEdge<int, int>(1, 2, 57);//dem(1, 2, 57).
var e2 = new TaggedUndirectedEdge<int, int>(1, 4, 65);//dem(1, 4, 65).
var e3 = new TaggedUndirectedEdge<int, int>(2, 3, 155);//dem(2, 3, 155).
var e4 = new TaggedUndirectedEdge<int, int>(2, 4, 129);//dem(2, 4, 129).
var e5 = new TaggedUndirectedEdge<int, int>(3, 4, 78);// dem(3, 4, 78).
var e6 = new TaggedUndirectedEdge<int, int>(3, 5, 200);// dem(3, 5, 200).
g.AddVerticesAndEdge(e1);
g.AddVerticesAndEdge(e2);
g.AddVerticesAndEdge(e3);
g.AddVerticesAndEdge(e4);
g.AddVerticesAndEdge(e5);
g.AddVerticesAndEdge(e6);
var dfs = new UndirectedDepthFirstSearchAlgorithm<int, TaggedUndirectedEdge<int, int>>(g);
dfs.Compute();
Now I am looking for a way to print the cycles. (I am not sure if my code is correct this is the first time I deal with quick graph, the first time I even deal with graph in general).
Thank you for your help.