Skip to content

Commit 4234bcc

Browse files
committed
addressed PR comments
1 parent 5bbbb46 commit 4234bcc

File tree

1 file changed

+43
-3
lines changed

1 file changed

+43
-3
lines changed

examples/centrality-algorithms.ipynb

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@
109109
"cell_type": "markdown",
110110
"metadata": {},
111111
"source": [
112-
"Next, we load this data (nodes and edges) into a Graph Database and a GDS graph."
112+
"Since this graph is very small, a straight-forward Cypher `UNWIND` query is the simplest way to create our graph in the database.\n",
113+
"\n",
114+
"Larger graphs may need a more sophisticated importing technique like batching, `neo4j-admin import` or Arrow `CREATE DATABASE`."
113115
]
114116
},
115117
{
@@ -145,7 +147,8 @@
145147
"\n",
146148
"# We can use convenience methods on `G` to check if the projection looks correct\n",
147149
"print(f\"Graph '{G.name()}' node count: {G.node_count()}\")\n",
148-
"print(f\"Graph '{G.name()}' node labels: {G.node_labels()}\")"
150+
"print(f\"Graph '{G.name()}' node labels: {G.node_labels()}\")\n",
151+
"print(f\"Graph '{G.name()}' relationship count: {G.relationship_count()}\")"
149152
]
150153
},
151154
{
@@ -215,6 +218,13 @@
215218
"eigenvector_centrality_result.centralityDistribution"
216219
]
217220
},
221+
{
222+
"cell_type": "markdown",
223+
"metadata": {},
224+
"source": [
225+
"We will now write our results back to the database."
226+
]
227+
},
218228
{
219229
"cell_type": "code",
220230
"execution_count": null,
@@ -302,6 +312,13 @@
302312
"betweenness_centrality_result.centralityDistribution"
303313
]
304314
},
315+
{
316+
"cell_type": "markdown",
317+
"metadata": {},
318+
"source": [
319+
"We will now write our results back to the database."
320+
]
321+
},
305322
{
306323
"cell_type": "code",
307324
"execution_count": null,
@@ -373,6 +390,13 @@
373390
"degree_centrality_result.centralityDistribution"
374391
]
375392
},
393+
{
394+
"cell_type": "markdown",
395+
"metadata": {},
396+
"source": [
397+
"We will now write our results back to the database."
398+
]
399+
},
376400
{
377401
"cell_type": "code",
378402
"execution_count": null,
@@ -438,13 +462,29 @@
438462
"- For the city metadata (metropolitan population, latitude, and longitude):\n",
439463
"Austin R. Benson, David F. Gleich, and Jure Leskovec. \"Higher-order Organization of Complex Networks.\" Science, 353.6295 (2016): 163–166.\n",
440464
"\n",
465+
"- Link to the dataset: https://snap.stanford.edu/data/reachability.html\n",
466+
"\n",
441467
"- Notebook contributed by [Kedar Ghule](https://github.com/kedarghule)"
442468
]
443469
}
444470
],
445471
"metadata": {
472+
"kernelspec": {
473+
"display_name": "Python 3 (ipykernel)",
474+
"language": "python",
475+
"name": "python3"
476+
},
446477
"language_info": {
447-
"name": "python"
478+
"codemirror_mode": {
479+
"name": "ipython",
480+
"version": 3
481+
},
482+
"file_extension": ".py",
483+
"mimetype": "text/x-python",
484+
"name": "python",
485+
"nbconvert_exporter": "python",
486+
"pygments_lexer": "ipython3",
487+
"version": "3.10.11"
448488
}
449489
},
450490
"nbformat": 4,

0 commit comments

Comments
 (0)