Hello.
Currently I am struggling to make the following query for the shortest path to terminate in a reasonable amount of time:
g.V()
.has("name", fromName)
.repeat(__.both().simplePath())
.until(__.has("name", toName))
.limit(1)
.path()
.by("name")
.unfold()
.toList()
On our graph this query runs for minutes.
Limiting path length:
g.V()
.has("name", fromName)
.repeat(__.both().simplePath().or().loops().is(5))
.until(__.has("name", toName))
.limit(1)
.path()
.by("name")
.unfold()
.toList()
It outputs the actual shortest path in less than a second (real path is of length 3).
Can the query be rewritten without explicit path size limit so it will take the same amount of time?
Also, we have a kind of supernode (half of all the edges connected) in the graph through which the path goes, if it is what affects performance of the first query, how can it be determined why the second one completes so much faster?
Graph is stored in JanusGraph-Cassandra, "name" property indexed.
Best regards,
Evgeniy Ignatiev.