May 2015
Beginner to intermediate
226 pages
4h 37m
English
The most common operation in any graph database is graph traversal, which includes finding all possible paths between the two nodes, the shortest path, and the shortest weighted path. In this recipe, we will cover them with the help of examples.
Let's create some sample data of airports and routes between them, using the following Cypher queries:
CREATE (ATL:Airport { city:'Atlanta' }),(ORD:Airport { city:'Chicago' }),(LAX:Airport { city:'Los Angeles' }),(DFW:Airport { city:'Dallas/Fort Worth' }),(AUS:Airport { city:'Austin' }) CREATE (ATL)-[:ROUTE { time:22 }]->(AUS),(AUS)-[:ROUTE { time:35 }]->(LAX),(ATL)-[:ROUTE { time:40 }]->(DFW),(DFW)-[:ROUTE { time:34 }]->(LAX),(ORD)-[:ROUTE ...Read now
Unlock full access