Skip to content

Instantly share code, notes, and snippets.

@erajabzadeh
Last active August 4, 2021 13:30
Show Gist options
  • Save erajabzadeh/d39e41a64d3e40dbab2f9aeeecd4d02c to your computer and use it in GitHub Desktop.
Save erajabzadeh/d39e41a64d3e40dbab2f9aeeecd4d02c to your computer and use it in GitHub Desktop.
Gremlin Topological Sort
g.V()
.not(__.inE())
.store("x")
.repeat(
outE()
.store("e")
.inV()
.not(inE().where(without("e")))
.store("x")
)
.cap("x");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment