Finding Cycles in a Graph

Can anybody help me with an algorithm to detect cycles within a graph? or at least give me some direction on how to write a program to find all cycles in a graph. I have been stuggling to find something in vain. Thanks,Rexland
[247 byte] By [rexlanda] at [2007-10-3 3:35:49]
# 1

> or at least give me some direction on how to write a program to find all

> cycles in a graph.

Have a look at this:

http://www.cs.berkeley.edu/~kamil/sp03/041403.pdf

It describes how Kruskal's algorithm (finding cycles in trees) can be modified to find cycles in graphs.

prometheuzza at 2007-7-14 21:30:38 > top of Java-index,Other Topics,Algorithms...
# 2

> Can anybody help me with an algorithm to detect

> cycles within a graph? or at least give me some

> direction on how to write a program to find all

> cycles in a graph. I have been stuggling to find

> something in vain.

There's probably good reason for that, in general, this is an intractable problem. For dense graphs, the number of cycles increases faster than the factorial of the number of vertices. More details of your problem will probably result in better answers.

RadcliffePikea at 2007-7-14 21:30:38 > top of Java-index,Other Topics,Algorithms...