Successfully reported this slideshow.
Upcoming SlideShare
×

# Foss4g presentation

304 views

Published on

• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

### Foss4g presentation

1. 1. FOSS4G2007 Presentation Shortest path search in real road networks with pgRouting pgRouting Anton Patrushev (Orkney, Inc.)Shortest path search in real road networkswith pgRouting 1
2. 2. IntroductionpgRouting is an extension of PostgreSQL and PostGIS. A predecessor of pgRouting ­ pgDijkstra, written by Sylvain Pasche from Camptocamp, was extended by Orkney (Japan) and renamed to pgRouting.pgRouting includes:* Shortest path search (Dijkstra, A*, Shooting*)* Traveling Salesperson Problem (TSP) solution* Driving distance polygon calculationShortest path search in real road networkswith pgRouting 2
3. 3. How it works Pl/PgSQL SQL query C++ core C wrapper function (data)Shortest path search in real road networkswith pgRouting 3
4. 4. Shortest path algorithms ● Dijkstra ● Well known and fair shortest path algorithm ● Always finds mathematically shortest path ● Good for sparse networks ● A* ● Well known heuristic shortest path algorithm ● Needs vertex geometry information ● Searches through less number of vertexes ● Good for dense networks ● Shooting*Shortest path search in real road networkswith pgRouting 4
5. 5. Shooting*● Edge­based heuristic shortest path algorithm ● Supports maneuver restrictions and traffic lights● Properly processes parallel edges● Good for dense networksPredecessors:● Modified A* ­ Wolfgang Schmid, 2000, Stephan Winter, 2002● C* ­ Ingrid Flinsenberg, 2004Shortest path search in real road networkswith pgRouting 5
6. 6. Comparison with other algorithms Dijkstra cost=cost(vertex1, vertex2) Each vertex can be visited only once A* cost=cost(vertex1, vertex2)+H(vertex1, vertex2) Each vertex can be visited only once Shooting* cost=cost(edge1)+cost(edge1, edge2)+H(edge1) Each edge can be visited only once Parallel edges handling Dijkstra/A* Shooting*Shortest path search in real road networkswith pgRouting 6
7. 7. Real road networks A B CA)Signs (restrict maneuvers)B)Traffic lights (delays)C)Road marking (restrict maneuvers)Shortest path search in real road networkswith pgRouting 7
8. 8. Network representation d d c f d a b c a b c cost(eb,ab)=1min a b cost(eb,bd)=1min cost(eb,bc)=∞ cost(eb,bc)=1min cost(ab,bd,df)=∞ e e ... e B ... A C ...A)Right turn costs too muchB)Driving through vertex b passage costs extraC)Driving from a to f costs too muchShortest path search in real road networkswith pgRouting 8
9. 9. Routing data structure Dijkstra A* Shooting* Edge Edge Edge ● id ● id ● id ● cost ● cost ● cost ● reverse_cost ● reverse_cost ● reverse_cost ● Source vertex ● Source vertex ● Adjacent edge ● id ● id ● rule ● Target vertex ● x ● to_cost ● id ● y ● Source vertex ● Target vertex ● id ● id ● x ● x ● y ● y ● Target vertex ● id ● x ● yShortest path search in real road networkswith pgRouting 9
10. 10. Thank you! pgrouting.postlbs.org orkney.co.jp pgRoutingShortest path search in real road networkswith pgRouting 10