Skip to main content
100%

Cypher for determining distance between points using shortest path

✓ Published0🌍 Public
CCliffordAnderson
Last edited Aug 14, 2014
Created on Aug 14, 2014

This example demonstrates how to calculate the distance between two points in a graph using Cypher's shortest path algorithm. The query first matches two nodes by their IDs, then applies `shortestpath` to find the minimal path between them. Using the `reduce` function, it iterates over the relationships in that path, summing the `distance` property of each relationship to return the total distance in meters. The visualization relies on the Neo4j graph database and its Cypher query language, with the underlying graph structure and relationship properties providing the data for the calculation.

AI-generated description

Similar vizzes