Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Centrality Algorithms Example Jupyter Notebook #386

Merged
merged 7 commits into from
Jun 20, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 43 additions & 3 deletions examples/centrality-algorithms.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Next, we load this data (nodes and edges) into a Graph Database and a GDS graph."
"Since this graph is very small, a straight-forward Cypher `UNWIND` query is the simplest way to create our graph in the database.\n",
"\n",
"Larger graphs may need a more sophisticated importing technique like batching, `neo4j-admin import` or Arrow `CREATE DATABASE`."
]
},
{
Expand Down Expand Up @@ -145,7 +147,8 @@
"\n",
"# We can use convenience methods on `G` to check if the projection looks correct\n",
"print(f\"Graph '{G.name()}' node count: {G.node_count()}\")\n",
"print(f\"Graph '{G.name()}' node labels: {G.node_labels()}\")"
"print(f\"Graph '{G.name()}' node labels: {G.node_labels()}\")\n",
"print(f\"Graph '{G.name()}' relationship count: {G.relationship_count()}\")"
]
},
{
Expand Down Expand Up @@ -215,6 +218,13 @@
"eigenvector_centrality_result.centralityDistribution"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We will now write our results back to the database."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -302,6 +312,13 @@
"betweenness_centrality_result.centralityDistribution"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We will now write our results back to the database."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -373,6 +390,13 @@
"degree_centrality_result.centralityDistribution"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We will now write our results back to the database."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -438,13 +462,29 @@
"- For the city metadata (metropolitan population, latitude, and longitude):\n",
"Austin R. Benson, David F. Gleich, and Jure Leskovec. \"Higher-order Organization of Complex Networks.\" Science, 353.6295 (2016): 163–166.\n",
"\n",
"- Link to the dataset: https://snap.stanford.edu/data/reachability.html\n",
"\n",
"- Notebook contributed by [Kedar Ghule](https://github.com/kedarghule)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"name": "python"
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This stuff was added back in, which is normal when the notebook is run. I will clear it out again.

}
},
"nbformat": 4,
Expand Down