Performance optimization

Cached shortest path trees on topology object to reduce redundant
calculation of Djikstra's algorithm