# Detect and Return Cycles in a given directed graph

**URL:** <https://discourse.julialang.org/t/detect-and-return-cycles-in-a-given-directed-graph/80493>\
**Category:** Graphs\
**Tags:** lightgraphs, graphs\
**Created:** [May 4, 2022, 3:56pm UTC](https://discourse.julialang.org/t/detect-and-return-cycles-in-a-given-directed-graph/80493 "2022-05-04T15:56:28Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![Temi-Tory](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/temi-tory/32/29716_2.png) [@Temi-Tory](https://discourse.julialang.org/u/Temi-Tory)\
**Post date:** [May 9, 2022, 9:20am UTC](https://discourse.julialang.org/t/detect-and-return-cycles-in-a-given-directed-graph/80493/23 "2022-05-09T09:20:17Z")

</div>

Hello again guys,  
Thanks for the helps and suggestions so far especially @etienne_dg and @Henrique_Becker.  
Ultimately, after trying a bunch of different ways, I realise now that trying to detect shared ancestors wasn’t quite what I should’ve done.  
On a higher level, the method I was trying to use on these graphs only works on tree structured graphs. So instead of trying to detect cycles, I am now going to find a way to convert the original graph J first into joint/clique tree by moralization and then triangulation to form cliques.

Thanks again for the helps.

[Previous page](https://discourse.julialang.org/t/detect-and-return-cycles-in-a-given-directed-graph/80493.md?page=1)
