Skip to content

Instantly share code, notes, and snippets.

@Taresin
Created February 3, 2025 11:27
Show Gist options
  • Save Taresin/fbda8c26e88d89d2e5312acd644f1c32 to your computer and use it in GitHub Desktop.
Save Taresin/fbda8c26e88d89d2e5312acd644f1c32 to your computer and use it in GitHub Desktop.
Calculating the betweenness centrality property of Sydney Trains nodes
CALL gds.graph.project.cypher(
'projection_trains',
'MATCH (s:Stop) RETURN id(s) AS id',
'MATCH (s:Stop)-[:NEXT_STOP]->(t:Stop) RETURN id(s) AS source, id(t) AS target, "NEXT_STOP" AS type'
);
CALL gds.betweenness.write('projection_trains', {
writeProperty: 'betweennessCentrality'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment