PgRouting is an open source library that provides routing functionality for PostgreSQL and PostGIS. It allows calculating the shortest path between points on a road network. Costs in the network can be made dynamic to model real-world factors like traffic, conditions, restrictions. This allows pgRouting to find alternate routes automatically in response to changes rather than requiring pre-calculated networks.