How can I find all paths between two groups of vertexes?

1,017 views
Skip to first unread message

אלה וייס

unread,
Apr 10, 2016, 7:08:58 AM4/10/16
to Gremlin-users
 ?I know how to find all paths between two vertexes but how can I find all paths between two groups of vertexes 

Daniel Kuppitz

unread,
Apr 11, 2016, 3:20:47 AM4/11/16
to gremli...@googlegroups.com
It's not much different from finding  all paths between 2 vertices.

gremlin> g = TinkerFactory.createModern().traversal()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
gremlin> // find all paths between v[1], v[2] and v[5], v[6]
gremlin> g.V(1,2).repeat(both().simplePath()).until(hasId(within(5,6))).path()
==>[v[1], v[3], v[6]]
==>[v[1], v[4], v[5]]
==>[v[1], v[3], v[4], v[5]]
==>[v[1], v[4], v[3], v[6]]
==>[v[2], v[1], v[3], v[6]]
==>[v[2], v[1], v[4], v[5]]
==>[v[2], v[1], v[3], v[4], v[5]]
==>[v[2], v[1], v[4], v[3], v[6]]

Cheers,
Daniel


On Sun, Apr 10, 2016 at 1:08 PM, אלה וייס <ellavs...@gmail.com> wrote:
 ?I know how to find all paths between two vertexes but how can I find all paths between two groups of vertexes 

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/3931a5b8-d4c4-4f2c-87f2-d0db9f798c96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

אלה וייס

unread,
Apr 17, 2016, 1:21:06 AM4/17/16
to Gremlin-users
thanks,but the query has an infinite loop while I would like to end the query in case there us no result after 5 steps

בתאריך יום ראשון, 10 באפריל 2016 בשעה 14:08:58 UTC+3, מאת אלה וייס:

Daniel Kuppitz

unread,
Apr 17, 2016, 3:46:46 AM4/17/16
to gremli...@googlegroups.com
Answered in another thread.

Cheers,
Daniel


--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages