...

/

Challenge: Find the Minimum Spanning Tree of the Given Graph

Challenge: Find the Minimum Spanning Tree of the Given Graph

Given an undirected weighted graph, find its minimum spanning tree.

Problem Statement

Implement a function that returns the Minimum Spanning Tree of the given graph.

Input

An undirected weighted graph

Output

A possible minimum spanning tree

Sample Input

Source Destination Weight
0 1 10
0 2 6
0 3 5
1 3 15
2 3 4
svg viewer

Sample Output

2 -- 3
0
...
svg viewer