Given 2 Algorithms for a graph G=(V,E):
One:
- Sort edges from lowest to highest weight.
- Set T = {}
- for each edge e in the previous order, check if e Union T doesn't have any cycles. If yes, Add e to T.
- Return T if it's a spanning Tree.
Two:
- Sort edges from highest to lowest weight.
- Set T = E
- for each edge e in the previous order, check if T{e} is connected graph. If yes, Remove e from T.
- Return T if it's a spanning Tree.
Do both algorithms return Minimum Spanning Tree for sure? If not I would like to see a counter example.