I'm trying to find how the implementation of shortest_path() in pgRouting works.
This is the function definition:
CREATE OR REPLACE FUNCTION shortest_path(sql text, source_id integer,target_id integer, directed boolean, has_reverse_cost boolean)
RETURNS SETOF path_result AS '$libdir/librouting', 'shortest_path'
LANGUAGE c IMMUTABLE STRICT
COST 1
ROWS 1000;
ALTER FUNCTION shortest_path(text, integer, integer, boolean, boolean) OWNER TO postgres;
My questions are:
Here is the source for dijkstra.c. You can read this code to see what the function is doing. The SQL you posted just shows the binding to the native C function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With