tf_graph_shortest_paths_distances
Given a distance-weighted directed graph, consisting of a queryCURSOR
input consisting of the starting and ending node for each edge and a distance, and a specified origin node, tf_graph_shortest_paths_distances
computes the shortest distance-weighted path distance between the origin_node
and every other node in the graph. It returns a row for each node in the graph, with output columns consisting of the input origin_node
, the given destination_node
, the distance for the shortest path between the two nodes, and the number of edges or graph "hops" between the two nodes. If origin_node
does not exist in the node1
column of the edge_list
CURSOR
, an error is returned.
Input Arguments
Parameter | Description | Data Types |
---|---|---|
| Origin node column in directed edge list CURSOR | Column<INT | BIGINT | TEXT ENCODED DICT> |
| Destination node column in directed edge list CURSOR | Column<INT | BIGINT | TEXT ENCODED DICT> (must be the same type as |
| Distance between origin and destination node in directed edge list CURSOR | Column INT | BIGINT | FLOAT | DOUBLE> |
| The origin node to start graph traversal from. If not a value present in | BIGINT | TEXT ENCODED DICT |
Output Columns
Name | Description | Data Types |
---|---|---|
| Starting node in graph traversal. Always equal to input | Column <INT | BIGINT | TEXT ENCODED DICT> (same type as the |
| Final node in graph traversal. Will be equal to one of values of | Column <INT | BIGINT | TEXT ENCODED DICT> (same type as the |
| Cumulative distance between origin and destination node for shortest path graph traversal. | Column<INT | BIGINT | FLOAT | DOUBLE> (same type as the |
| Number of edges (or "hops") traversed in the graph to arrive at | Column <INT> |
Example A
Example B
Last updated