Skip to content

Instantly share code, notes, and snippets.

@danshev
Created May 15, 2022 18:23
Show Gist options
  • Save danshev/07c059c6ffd683c745a4c62ee6ec768e to your computer and use it in GitHub Desktop.
Save danshev/07c059c6ffd683c745a4c62ee6ec768e to your computer and use it in GitHub Desktop.
First Traversal Query
g.withSack(120).V( DEPARTURE_PORT ).
repeat(
(outE().hasLabel('VOYAGES_TO').
sack(sum).by('duration')).
sack(sum).by(constant(45)
).
inV().simplePath()
).
until(
has('code', CANDIDATE_PORT ).
and().sack().is(lte( TOTAL_TRAVEL_TIME_LIMIT ))
).
order().
by(sack()).
local(
union(path().
by('code').by('duration'), sack()).fold()
).
local(unfold().unfold().fold()).
unfold()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment