Skip to content
This repository has been archived by the owner on Mar 2, 2021. It is now read-only.

3. Do graph analysis

agouge edited this page Feb 14, 2013 · 31 revisions

The calculation of betweenness and closeness centrality is currently supported.

Weighted

We do the actual graph analysis on connected component 1 as follows:

EXECUTE ST_GraphAnalysis(routes_1.edges, 'weight', 3, 'routes');

This produces a table routes.graph_analysis containing the id of each node, its betweenness_centrality and its closeness_centrality.

Underneath the hood, this function uses a modified version of Dijkstra's algorithm to calculate, for a given fixed node, this shortest distance to every other node, as well as the number of shortest paths to every other node.