Pgrouting- A Practical Guide Online

The workhorse of PgRouting is pgr_dijkstra . It finds the shortest path based on cost.

| Problem | Likely Fix | | :--- | :--- | | pgr_dijkstra returns 0 rows | Your source and target vertices are not connected. Check pgr_connectedComponents . | | Path takes unrealistic shortcuts | Your cost column is wrong. Did you use geographic distance ( ST_Length(geom::geography) )? | | One-way streets ignored | Check directed := true AND ensure reverse_cost is set to INFINITY for against-traffic edges. | | Topology fails silently | Run SELECT pgr_analyzeGraph('roads', 0.00001); to find dangling nodes and zero-length edges. | PgRouting- A Practical Guide

Join the results back to the geometry table: The workhorse of PgRouting is pgr_dijkstra