Fetching all trees

42 views
Skip to first unread message

Ankur Goel

unread,
Oct 27, 2017, 7:22:17 AM10/27/17
to JanusGraph users
Hi,
i have a graph with following connection ex:

  1. n1--> n2--->n3
  2. n4-->n5
  3. n5
Where n represent node and line between them is edge.

What i am looking janus query should return all connected tree. Does Janus support this?

In above graph it should return 3 trees.

~


 

HadoopMarc

unread,
Oct 27, 2017, 3:50:43 PM10/27/17
to JanusGraph users
Hi Ankur,

You can experiment witth the repeat step:

gremlin>  g=TinkerFactory.createModern().traversal()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
gremlin
> g.V().emit().repeat(out()).times(2).path().by('name')
==>[marko]
==>[marko,lop]
==>[marko,vadas]
==>[marko,josh]
==>[marko,josh,ripple]
==>[marko,josh,lop]
==>[vadas]
==>[lop]
==>[josh]
==>[josh,ripple]
==>[josh,lop]
==>[ripple]
==>[peter]
==>[peter,lop]

Cheers,    Marc

Op vrijdag 27 oktober 2017 13:22:17 UTC+2 schreef Ankur Goel:

Ankur Goel

unread,
Nov 1, 2017, 1:53:59 AM11/1/17
to JanusGraph users
Thnx Marc,

I am also using this, but with this, mentioned query should be aware about all possible connections between vertices in a connected graph. 
Pros: with this approach if any new edge connection happen than for each we have to alter query, time is another dimension also.

I am looking a method that give me all different connected graph by  any vertices without knowing intricacy of the graph: just all connected vertex.

~

Daniel Kuppitz

unread,
Nov 1, 2017, 9:42:42 AM11/1/17
to JanusGraph users
Check out the connected components recipe.

Cheers,
Daniel

--
You received this message because you are subscribed to the Google Groups "JanusGraph users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/janusgraph-users/2b187968-97c0-4bb3-aa8c-770853ae1f8e%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages