I am trying to get multiple shortest path using A* Algorithm available in PgRouting.
I referred Solution given by UnderDark ( Link of the Stakoverflow Post ) . But it is not giving me proper Output.
MY Query (Simple Query - Without Multiple Path Detection)
SELECT * FROM shortest_path_astar('
SELECT gid as id,
source::integer,
target::integer,
length(the_geom)::double precision as cost,
x1, y1, x2, y2
FROM connectivity',
110, 111, false, false);
Output of this Query:
vetex_id | edge_id | cost
110 | 1 | 0.01235
111 | -1 | 0
Now Query as suggested by Underdark on Given link:
SELECT
source,
target,
(SELECT SUM(cost) FROM
( --- Complete Above Query Here
)
) AS foo
) AS cost
FROM connectivity;
Output of this Query:
source | target | cost
9 | 8 | 0.01235
... |... | ...
(More 211 records )
Note: In my test table (connectivity) I have 212 Records
So this query is giving me all the records as output without any path relativity.
I do not know where I am doing wrong. any help / suggestion will be helpful for me.