The following article is an example of a .NET implementation of
Kruskal’s algorithm for finding the minimum spanning tree of a
connected, undirected graph. The minimum spanning tree for a
graph is the set of edges that connects all nodes and has the
lowest cost. In order to be able to run this solution, you will
need .NET 4.0. The example was constructed using Visual Studio
10, and WPF for the graphical representation. In this article, I
will be using a large portion of the code that I used to
exemplify Dijkstra’s algorithm for finding the minimum distance
path between two nodes in a connected undirected graph. You can
find this example here. Similar to Dijsktra, Kruskal’s algorithm
is also characterized as “greedy.” Even though these algorithms
are quite similar, their approaches are quite different since
their goals are simply not the same. In the case of minimum
spanning tree, there are some additional structures that we will
be using, making the understanding of the algorithm a little bit
more difficult.