If roots are indeed different, (each Vertex is in a different set), Join() the two Vertices.

internalstaticvoid Join(Vertex root1, Vertex root2)
{
if (root2.Rank < root1.Rank)//is the rank of Root2 less than that of Root1 ?
{
root2.Root = root1;//yes! then Root1 is the parent of Root2 (since it has the higher rank)
}
else//rank of Root2 is greater than or equal to that of Root1
{
root1.Root = root2;//make Root2 the parent
if (root1.Rank == root2.Rank)//both ranks are equal ?
{
root2.Rank++;//increment Root2, we need to reach a single root for the whole tree
}
}
}

Pls make the following bottom,, easy Impletatation Kruskal Algorithm
MST-KRUSKAL(G, w)
1. A ← Ø
2. for each vertex v V[G]
3. do MAKE-SET(v)
4. sort the edges of E into nondecreasing order by weight w
5. for each edge (u, v) E, taken in nondecreasing order by weight
6. do if FIND-SET(u) ≠ FIND-SET(v)
7. then A ← A {(u, v)}
8. UNION(u, v)
9. return A

---------------------------------------------
pls make the above algo DRY RUN & EASY PROGRAM IMPLENTATION ON DEVC++
iam new in programming Hope Umer U will help me As soon as Possible -
thankyou - i also want to make presentation --
Regards: Humza Iqbal
From Pakistan

I think some of the criticisms aimed at Omar's article are a little unfair.

Like Omar says, if you bother to read this, you will at least get the gist of what the article is about: finding Minimal Spanning Trees using Kruskal's Algorithm, by using a fairly intuitive user interface with which to plot the links, link connection strengths and nodes. He DOES describe what the algorithm does and how it works - basically to find the subset of the available edges such that their overall weight is minimised, while avoiding network cycles.

Snortle
"Looked interesting, turned out to be a waste of an article."

That is not a contribution Snortle. Its a chippy little comment, that offers nothing in the way of positive suggestions.

Adrian Pasik
"...i want to see some real life demo where i can use it."

What Omar has done is provide a plausible prototype in C#. Tell you what, why don't YOU take his working version and apply it to whatever real-world application YOU have in mind, be it telecoms networks, pipe networks or whatever. His proof of concept is sound - feed it links, nodes and link connection strengths, press "Solve" and out plops the minimal spanning tree. What more do you want Adrian?

JV9999
1. This article is about Kruskal, not sorting algorithms.
2. "And how do I give those edges values? Those are probably all part of the algorithm I assume."
You insert edge values exactly in the manner Omar described - hold down the control button, select two nodes and enter the value. Omar cannot do these kinds of things for you, my friend.
3. It's clear you are struggling with some of the concepts Omar describes. Don't criticize just because you don't understand them.
4. "I'm not gonna drag with cables just to use this!"
What the heck are you talking about?

Dave Kreskowiak

After removing code snippets and pictures I think you'll you'll find that he does. His brief Wiki entry I would say describes what Kruskal is all about better and more succinctly than most I've ever seen, and so I would say his short inclusion is justified. He at least makes a reference to it and doesn't try to pass it off as his own.

The use of pictures and visuals I also think can be a far more effective key to understanding than lots of dry theory. What appeals to me is his intuitive graphical user interface used to represent nodes and links. I would definitely find this useful.

"You went into no detail at all about how this maps into the real world example"

How about "laying a cable in a new neighborhood" or "An internet cafe is connecting all PCs via network."? You make the same misinterpretation as Adrian Pasik. It doesn't take a huge stretch of the imagination to visualize the link integer values he displays as representing quantities like pipe lengths (miles), network bandwidths (kbit/s), etc.