What does it mean though? If you model this network as a graph, it becomes easier to analyse it. Simply by modeling the relationships between the subway stations and adding the distance between them, we can :
- calculate the shortest path between point A and point B ;
- find alternative routes if a given node (a subway station) is removed from the network ;
- find the route from point A to point B that minimizes transfers ;
These are all basic questions that a graph model representing a physical network can answer. Writing and performing these queries is very fast, even if your network is large and complicated.
What’s interesting is that we can enrich our graph model of Paris subway to add more information. We can for example add statistics about the occupancy of subway lines or the position of cultural landmarks. This way we can make sure when we plan a trip that avoids the over-crowded lines while hitting the major cultural landmarks.
On the Neo4j GraphGists website you can find concrete examples of communication networks modeled as graphs. Neo4j GraphGists are a way to share documents including Cypher queries. Here are few interesting examples :
The next time you will travel, think about the graph you are exploring!