How would I find a minimum weight spanning tree for W?

156 Views Asked by At

If I were to let $W$ be the weighted graph formed by taking a complete graph $K_5$ on five vertices 1, 2, 3, 4, 5 with the weight of each edge $\{x,y\}$ given by $(\{x,y\}) = x + y$, how would I find a minimum weight spanning tree for $W$?

1

There are 1 best solutions below

0
On

You have two options: Kruskal's algorithm or Prim's algorithm. Both are greedy, and since $K_5$ is not particularly large, you can use whichever.

See this thread for which situation calls for which algorithm.

There's not much left but to execute them, unless you have a particular concern with the steps of them?