Adds min distance calc using dijkstra's algorithm & nd support