Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What mechanism is used to determine the absolute order of vertices in tinkerpop/titan?

When performing the following traversals:

graph.addVertex("a")
graph.addVertex("b")
graph.addVertex("c")

graph.traversal().V().range(0,2)
graph.traversal().V().range(2,3)

What determines the order in which I get these vertices back when using the range functionality? Am I guaranteed to get all three vertices a, b and c back?

like image 560
Sheldon Avatar asked Sep 26 '22 18:09

Sheldon


1 Answers

Without an explicit order().by() you shouldn't expect a guaranteed order.

From the TinkerPop docs:

A Traversal’s result are never ordered unless explicitly by means of order()-step. Thus, never rely on the iteration order between TinkerPop3 releases and even within a release (as traversal optimizations may alter the flow).

like image 108
Daniel Kuppitz Avatar answered Dec 31 '22 21:12

Daniel Kuppitz