Finding Out Looped Graphs

I am trying to identify situations where I have inadvertently created edges that connect to the same vertex, resulting in F -> F and also possibly G -> F -> G scenarios. What are effective Gremlin techniques for detecting and resolving these instances?
2 Replies
kelvinl2816
kelvinl281614mo ago
You most likely want to look at the cyclicPath step. You can then build repeat until type queries that look for cyclicPath happening. You will also want to limit those queries (using loops or something similar) so they don't become long running if the graph is highly connected Here is a very simple example
gremlin> g.V(1,2,3).repeat(out()).until(cyclicPath().or().loops().is(3)).path().limit(3)
==>[v[1],v[47],v[1]]
==>[v[1],v[49],v[1]]
==>[v[1],v[51],v[1]]
gremlin> g.V(1,2,3).repeat(out()).until(cyclicPath().or().loops().is(3)).path().limit(3)
==>[v[1],v[47],v[1]]
==>[v[1],v[49],v[1]]
==>[v[1],v[51],v[1]]
ManabuBeach
ManabuBeach14mo ago
🏁
Want results from more Discord servers?
Add your server
More Posts
Simple production database alternatives for small Gremlin.Net applicationsHi! **What production database alternatives are there out there for small DotNet applications withDefault Sort Order in Gremlin QueryIs there any Default sort order in Gremlin Query if we do not provide any explicit order? Whenever IWhy does properties().dedup() return duplicates?When I run the query V().both().properties().dedup() on the TinkerFactory modern graph, I see duplicIs is ok to generate GraphTraversalSource on demand by using TinkerVertex.getGraph().traversal() ?Is is ok to generate GraphTraversalSource on demand by using TinkerVertex.getGraph().traversal() ? How to to get total count for pagination with gremlin query using java Apache thinker popI need to implement pagination in my application. I'm unable to get the total count. can someone helIncomplete questionsIn the interest of keeping #questions easy to scan through for unanswered questions, I have it in myNeed help to implement a generic gremlin query with Apache thinkerPop Java.Hi Everyone, From the UI I will get one DSL query, I'm converting that into a Gremlin query. and IEdge TTL not working for Janusgraph with BigtableI'm creating edges with TTL of 30 seconds but I can see those edges aren't getting deleted. I'm using.V(1).property() on 1 item fails in 1.18.49It seems 'anything property' on single item fails in gdotv 1.18.49: g.V(1).properties() -> [] g.V(1)Setup and Configuration of SPARQL-Gremlin plugin (with ArcadeDB)Dear All, I would like to use the SPARQL-Gremlin ( https://tinkerpop.apache.org/docs/current/refere