Added functionality to calculate the shortest path between two tables.