Network reachability with Neo4j
If you have visited any social website, it will show you your network reachability, such as 23,951,064 professionals in your network.
In this recipe, you will learn how to find all the nodes reachable in your network.
Getting ready
Install Neo4j on your machine using steps in the earlier recipes.
Use the following Cypher script to create the dataset for this recipe:
CREATE (bradley:User {name:'Bradley', surname:'Green', age:24, city:'Los Angeles'}), (matthew:User {name:'Matthew', surname:'Cooper', age:36, city:'Los Angeles'}), (lisa:User {name:'Lisa', surname:'Adams', age:15, city:'New York'}), (annie:User {name:'Annie', surname:'Behr', age:25,}) (disjoint:User{name:'Andy', surname:'Leone', age:47, city:'Los Angeles'}), //FRIEND (bradley)-[:FRIEND]->(matthew), (bradley)-[:FRIEND]->(ripley), (bradley)-[:FRIEND]->(john), (matthew)-[:FRIEND]->(bradley)
By performing the preceding steps, we have created a node that is...