We have established time traversal path using below cypher which created edges between the nodes in database.
WITH list ORDER BY list.statetime ASC
WITH COLLECT(list) AS lists
FOREACH (n IN RANGE(0, LENGTH(lists)-2) |
FOREACH (prec IN [lists[n]] |
FOREACH (next IN [lists[n+1]] |
Now we are trying to calculate the distance between any given 2 state nodes using apoc.spatial* functions as nodes have latitude and longitude attributes.
Please let us know your inputs if there are any other recommendations.