tf_graph_shortest_paths_distances
SELECT * FROM TABLE(
tf_graph_shortest_paths_distances(
edge_list => CURSOR(
SELECT node1, node2, distance FROM table
),
origin_node => <origin node>
)Parameter
Description
Data Types
Name
Description
Data Types
/* Compute the 10 furthest destination airports as measured by average travel-time
when departing origin airport 'RDU' (Raleigh-Durham, NC) on United Airlines for the
year 2008, adding 60 minutes for each leg to account forboarding/plane change time
costs. */
SELECT
*
FROM
TABLE(
tf_graph_shortest_paths_distances(
edge_list => CURSOR(
SELECT
origin,
dest,
/* Add 60 minutes to each leg to account for boarding/plane change costs */
AVG(airtime) + 60 as avg_airtime
FROM
flights_2008
WHERE
carrier_name = 'United Air Lines'
GROUP by
origin,
dest
),
origin_node => 'RDU'
)
)
ORDER BY
distance DESC
LIMIT
10;
origin_node|destination_node|distance|num_edges_traversed
RDU|JFK|803|3
RDU|LIH|757|2
RDU|KOA|746|2
RDU|HNL|735|2
RDU|OGG|728|2
RDU|EUG|595|3
RDU|ANC|586|2
RDU|SJC|468|2
RDU|SFO|468|2
RDU|OAK|468|2
Last updated
Was this helpful?

