Dijkstras for minimum length and minimum path for large number of nodes