...

/

Challenge: Minimum Spanning Trees

Challenge: Minimum Spanning Trees

Challenge your knowledge about minimum spanning trees in this lesson.

Let's practice what we've learned so far.

Task

Suppose we’re given both an undirected graph GG with weighted edges and a minimum spanning tree TT of GG. Provide code to update the minimum spanning tree when the weight of a single edge ee is decreased. We can follow the algorithm described below.

Logic building

Here’s the algorithm to update the minimum spanning tree TT when the weight of a single edge ee is decreased:

Algorithm


  • Identify the two nodes uu and
...