group() by default uses a regular old HashMap for it's data structure. If you want an order you would want to specifically specify an order() - for example:LinkedHashMap:V() or with an explicit order() as in the second. I'd say it's possible better to do the explicit order against vertices rather than than my first example where it does a in-memory sort of the Map as it's possible you might get some performance improvement there depending on your graph. Hard to say which is nicer as the withSideEffect() approach isn't quite as readable. (Note that in my Groovy examples above, the [:] will resolve to a LinkedHashMap by default.)Join the Discord to ask follow-up questions and connect with the community
Apache TinkerPop is an open source graph computing framework and the home of the Gremlin graph query language.
1,383 Members
Join