Replaced aging algorithm with distance algorithm (Dijkstra)

Implemented Dijkstra's path finding algorithm to compute the shortest
distance between the new node and and every node in the graph. If the
shortest distance is greater than a threshold, the node is removed from
the graph.