It seems I've read through all of the questions about finding cycles in graphs on stackoverflow and more, so I'll try to be as clear as possible:
- I am new to all these algorithms, so please try to be as specific as possible in your answers. Thanks!
- Complexity and performance does not matter to me
- I have a directed graph and a starting vertex
- I need only negative-weight cycles starting and ending in that vertex (e.g. A-B-C-A, A-G-M-A etc.)
- I need only simple cycles (i.e. A-B-A-B-A will not work for me).
- Elementary cycles (i.e. A-B-A) also need to be included
- I need to print all of these cycles (not count or just tell if they exist)
- I tried Bellman-Ford algorithm, but it seems to find only the most negative cycle. Even changing the starting vertex does not guarantee all cycles.
The only solution I found to that problem is finding all cycles and choosing negative-weight cycles from them. The thing is the solution COUNTS (not prints) ALL (not the ones that start and end in a given vertex). I'm stuck here. Any help would be greatly appreciated. Thanks in advance!