hasEdge complete. Starting totalEdgeCost