Optimizing travel with Python and Cypher
With our graph fully loaded into Neo4j, and our methods for querying data using Cypher and Python set up, we are ready to perform some more complex analysis. At the start of this section, we will use Cypher to answer questions and return answers in Python. Later, we will be doing more complex analysis, by sampling graph data from Neo4j and working with the sample in igraph.
Let’s begin by delving into the structure of our graph and asking some questions of our data to understand it better. The following steps will look at finding some relationships in the data:
- The first query we will run will find out the highest population by city and we are going to return the name of the city and the city’s population as the result.
ORDER BY
will order by the population of those nodes(n)
. For those SQL people out there, these commands will look very familiar, and you will find the transition to Cypher much easier than those who...