MHB Does Max-Kruskal Algorithm Find the Maximum Spanning Tree?

  • Thread starter Thread starter evinda
  • Start date Start date
  • Tags Tags
    Algorithm
Click For Summary
The discussion focuses on an algorithm to find the Maximum Spanning Tree (MST) of a graph using a modified version of Kruskal's algorithm. The proposed algorithm, named Max-KRUSKAL, sorts the edges in decreasing order by weight and constructs the MST by adding edges while ensuring no cycles are formed. To prove that Max-KRUSKAL produces a valid spanning tree, it is necessary to demonstrate two key properties: Spanning Tree Validity and Maximality. Spanning Tree Validity can be established by showing that the algorithm connects all vertices without forming cycles, as it utilizes the union-find structure to manage connected components. Maximality can be proven by arguing that if any edge were to be added that is not included in the resulting tree, it would have a lower weight than the edges already included, contradicting the assumption of maximality. The discussion seeks hints on how to formally prove these properties, indicating a need for a structured approach to validation.
evinda
Gold Member
MHB
Messages
3,741
Reaction score
0
Hello! (Wave)

Give an algorithm that finds the MST (maximum spanning tree) of a graph $G=(V,E)$.
Prove that the algorithm you gave finds the MST.

I tried the following:

I applied the Kruskal algorithm, but instead of ordering the edges by weights in increasing order I ordered them in decreasing order.

Code:
    Max-KRUSKAL(G,w)
    1. A={}
    2. for each vertex v∈ G.V
    3.      MAKE-SET(v)
    4. sort the edges of G.E into decreasing order by weight w
    5. for each edge (u,v) ∈ G.E, taken in decreasing order by weight w
    6.      if FIND-SET(u)!=FIND-SET(v)   
    7.         A=A U {(u,v)}  
    8.         Union(u,v)
    9. return A
To prove that this algorithm finds indeed the MST, we have to prove that the algorithm produces a spanning tree and that the constructed spanning tree is of maximal weight. But could you give me a hint how we could prove the properties Spanning Tree Validity and Maximality ?
 
Technology news on Phys.org
Or do we suppose that the algorithm does not give the maximum spanning tree, in order to get a contradiction?
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 22 ·
Replies
22
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 13 ·
Replies
13
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 22 ·
Replies
22
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K