Hub labels

In computer science, hub labels or the hub-labelling algorithm is a speedup technique that consumes much fewer resources than the lookup table but is still extremely fast for finding the shortest paths between nodes in a graph, which may represent, for example, road networks.

[1] This method allows at the most with two SELECT statements and the analysis of two strings to compute the shortest path between two vertices of a graph.

In the end, these two computed tables will have as many rows as nodes present within the graph.

So, for future queries, the search of a shortest path will start from the source on the first table and the destination on the second table, from which it will search within the labels for the common nodes with the associated distance information.

Only the smallest sum of distances will be kept as the shortest path result.