• + 2 comments

    With Python 3, I'm using Kruskal's algorithm to find the minimum spanning tree and then summing the edges as described by other posts here. This times out on test cases 11+, so I tried the Floyd-Warshall algorithm and that timed out even earlier. What can I do to optimize my solution enough to pass more cases?