uses dijkstra's algorithm to calculate the average path cost for a randomly generated graph