TransWikia.com

Database based solution for TDSP (Fastest)

Geographic Information Systems Asked by Viswanath Lekshmanan on February 1, 2021

I have tried pgRouting in PostGres for finding shortest path

select d.*, bs.starttime, bs.endtime, bs.trip_id from pgr_dijkstra(
    'select id, source, target, traveltime as cost from my_table',
    19,
    21,
    directed := true
) d JOIN my_table bs on d.edge = bs.id;

The above doesn’t consider time as parameter. Before selecting the next edge, I want to check the time of the transport as well.

Eg:

A ---- > B (03.00PM) (travel time 5)

B ---- > C (3.30PM) (travel time 15)

B ---- > C (11:00AM) (travel time 10)

Current algorithm consider the path with travel time 10 (Without considering the time).

Is there a standard solution for this. I have seen lot of implementations like A* algorithm. I’m talking about half million edges.

Or is there any way to get a hook on previous node or next node while computing pgr algorithms ?

One Answer

Many years ago a function named TDSP (Time-dependent shortest path) was developed. It's probably what you are looking for, and the source code is still available in the Git repository tagged with gsoc/tdsp-lw: https://github.com/pgRouting/pgrouting/tree/gsoc/tdsp-lw

However, it was very experimental that time and has not been updated since then, so it is not available in current releases and I can't tell if it will still work. Someone had to port it and probably put quite some effort into making it work (again).

Answered by dkastl on February 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP