Sheldon
Sheldon

Reputation: 135

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?

Upvotes: 5

Views: 68

Answers (1)

Daniel Kuppitz
Daniel Kuppitz

Reputation: 10904

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).

Upvotes: 4

Related Questions