[pgrouting-users] Algorithym Use in pgRouting

Stephen Woodbridge woodbri at swoodbridge.com
Tue Jul 9 18:01:58 PDT 2013

On 7/9/2013 7:23 AM, Muhammad Iqnaul Haq wrote:
> Hello Mr. Woodbridge
> It's me iqnaul who asked about using pgrouting to build an application
> avoiding any traffic disturbances. My supervisor asked me to build the
> application to avoid any traffic disturbances (e.g road blocked, traffic
> jam, road construction) so that disturbances will defined as a barrier.
> Can you suggest me the suitable algorithym (pgrouting function) that
> match my requirements? Because I found the pgrouting 2.0 now support
> more functions.
> Glad to hear your opinion and suggestion
> best regards
> iqnaul

Hello Ignaul,

My general preference for routing is to use the trsp algorithm even if I 
do not have turn restrictions. The astar algorithm is also a good one to 

The trick to using any of these algorithms to deal with traffic issues 
or road blockages is the following:

If you have historical average traffic speed or access to traffic speed 
senors, then I would set up something like:

1. edge_table with topology, default costs, etc

2. average_speed table that would be include gid, start_time, end_time, 
avg_spd, this can be joined to the edge table to get the average speed 
for any given time window.

3. avoidance_table that contains lines and/or polygons for that 
represent areas that traffic can not cross

Then when you select your edges for the solution, you join that with the 
traffic table and exclude any edges the intersect the avoidances.

If you want some consulting help to set up a system like this please 
contact me off list. I have done this for other clients and it works 
very well when you have access to the data and a road network for your 
area of interest.

Best regards,

More information about the Pgrouting-users mailing list