I have a big TinkerGraph (~80.000 vertices, ~160.000 edges) and I need to detect if there is a cycle in it using the Apache TinkerPop/Gremlin query language. If any, I would like to obtain the vertices of one of the cycles.
Is there a way to write a O(|V| + |E|)
gremlin query to find a cyclic path in a graph?
I tried using the queries from here and here, but they are too slow and they time out. I suspect that they are not O(|V| + |E|)
, but I am still learning TinkerPop and I can not evaluate the memory/time complexity of the TinkerGraph implementation.