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

  • Thread starter Thread starter evinda
  • Start date Start date
  • Tags Tags
    Algorithm
AI Thread 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?
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

Similar threads

Replies
3
Views
2K
Replies
22
Views
5K
Replies
8
Views
2K
Replies
22
Views
2K
Replies
7
Views
2K
Back
Top