graph icon indicating copy to clipboard operation
graph copied to clipboard

Add more examples to the longest path search section (5.10.2)

Open krlawrence opened this issue 5 years ago • 0 comments

Should add notes showing some alternative approaches that use shorter queries if all you want is to find the path.

gremlin> g.V('3').repeat(out().where(without('a')).store('a')).times(7).path().by('code')
==>[AUS,ATL,YUL,YGL,YPX,AKV,YIK,YZG]
==>[AUS,BOS,CPH,SFJ,JAV,JUV,NAQ,THU]
==>[AUS,YYZ,YTS,YMO,YFA,ZKE,YAT,YPO]

gremlin> g.V('3').repeat(out().dedup()).times(7).path().by('code')
==>[AUS,ATL,YUL,YGL,YPX,AKV,YIK,YZG]
==>[AUS,BOS,CPH,SFJ,JAV,JUV,NAQ,THU]
==>[AUS,YYZ,YTS,YMO,YFA,ZKE,YAT,YPO]     

krlawrence avatar May 27 '20 17:05 krlawrence