There are libraries for graph algorithms, such as LEDA. In the past, they were never flexible enough to cover everything we want to do (e.g. time dependence). This will eventually change, and there will be options to pass calls to arbitrary cost functions to a graph algorithm. Once that works, writing router code will become considerably simpler.