Neo4j Graph Database Homework
1
CECS 590 Graph Analytics Project 3, June 21, 2021
100 points
Due: Submit your project report to the Blackboard before July 5 (Monday) midnight.
Readings: PowerPoints, Neo4j_4_Graph Database Implementation and Data Import,
Neo4j_Case Study Yelp_2021 Data Import, and
Chap4_Pathfinding and Search algorithms
1(25 points) Follow the steps given on slides 13-23 in the PowerPoint, Neo4j_4_Graph Database
Implementation and Data Import, to create a GoT graph database.
(1.1) Show the graph output of this cypher query, match (p) return p.
(1.2) Find the length of the shortest path (unidirectional and un-weighted) from the person,
'Tyrion', to any other person. Write a cypher query to list the name of the other person and
the corresponding length of the shortest path.
(1.3) For each person, write a cypher query to list the person’s name together with the max and
average of the lengths of all shortest paths from the person in question to any other
person. List the result in the descending order of the average length.
2(30 points) Follow the steps given in the PowerPoint, Neo4j_Case Study Yelp_2021 Data
Import, to create a Yelp graph database using the business.json dataset.
(2.1) Write a cypher query to get the number of Person nodes, Category nodes, and
IN_CATEGORY relationships in the graph database, respectively.
(2.2) Calculate the distribution of the degree (in IN_CATEGORY relationship) of Business
nodes and plot the distribution as shown in the section, Degree Distribution Exploration,
of the PowerPoint, Neo4j_4_Graph Database Implementation and Data Import. Show the
steps (using R, Python, or any other means) of doing this assignment.
2
3(45 points) Design and implement a StateBorders graph database for information (such as
2-letter state code, state name, latitude, and longitude) of states in USA and the state
neighboring relationships from these three CSV datasets:
states_name.csv Code,State,Abbreviation,AlphaCode 01,Alabama,Ala.,AL 02,Alaska,,AK 04,Arizona,Ariz.,AZ 05,Arkansas,Ark.,AR ...................
states_GPS.csv state latitude longitude name AK 63.588753 -154.493062 Alaska AL 32.318231 -86.902298 Alabama AR 35.20105 -91.831833 Arkansas AZ 34.048928 -111.093731 Arizona CA 36.778261 -119.417932 California CO 39.550051 -105.782067 Colorado ...................
usa_state_neighbors_all.csv code,neighbors CA,"OR,NV" NH,VT OR,WA ND,SD TX,"" PR,"" NV,"OR,UT" OH,"PA,WV" KY,"OH,MO,WV,VA,TN" ...................
(3.1) List the cypher scripts you use to create the StateBorders graph database.
(3.2) Run the cypher script, match (s) return s, and show the graph output in a nice layout.
(3.3) Run the K-1 coloring algorithm from the Graph Data Science Library. Show the result in
graph output with node labeled with its assigned color number.
(3.4) Discuss the result of (3.3), for example, is it possible to use fewer number of colors?