<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kruskal&#8217;s algorithm &#8211; stoimen&#039;s web log</title>
	<atom:link href="/tag/kruskals-algorithm/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>on web development</description>
	<lastBuildDate>Tue, 13 Feb 2018 08:18:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>Computer Algorithms: Kruskal&#8217;s Minimum Spanning Tree</title>
		<link>/2012/11/12/computer-algorithms-kruskals-minimum-spanning-tree/</link>
		<comments>/2012/11/12/computer-algorithms-kruskals-minimum-spanning-tree/#comments</comments>
		<pubDate>Mon, 12 Nov 2012 12:01:47 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[algorithms]]></category>
		<category><![CDATA[data structures]]></category>
		<category><![CDATA[Graphs]]></category>
		<category><![CDATA[Bridge]]></category>
		<category><![CDATA[Distributed minimum spanning tree]]></category>
		<category><![CDATA[Environment]]></category>
		<category><![CDATA[Graph theory]]></category>
		<category><![CDATA[Joseph Kruskal]]></category>
		<category><![CDATA[Kruskal's algorithm]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Minimum spanning tree]]></category>
		<category><![CDATA[minimum spanning tree algorithms]]></category>
		<category><![CDATA[Prim's algorithm]]></category>
		<category><![CDATA[Reverse-delete algorithm]]></category>
		<category><![CDATA[Spanning tree]]></category>
		<category><![CDATA[statistician]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[The algorithm]]></category>
		<category><![CDATA[Theoretical computer science]]></category>
		<category><![CDATA[Tree]]></category>
		<category><![CDATA[two main algorithms]]></category>

		<guid isPermaLink="false">/?p=3439</guid>
		<description><![CDATA[Introduction One of the two main algorithms in finding the minimum spanning tree algorithms is the algorithm of Kruskal. Before getting into the details, let’s get back to the principles of the minimum spanning tree. We have a weighted graph and of all spanning trees we’d like to find the one with minimal weight. As &#8230; <a href="/2012/11/12/computer-algorithms-kruskals-minimum-spanning-tree/" class="more-link">Continue reading <span class="screen-reader-text">Computer Algorithms: Kruskal&#8217;s Minimum Spanning Tree</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2012/11/19/computer-algorithms-prims-minimum-spanning-tree/" rel="bookmark" title="Computer Algorithms: Prim&#8217;s Minimum Spanning Tree">Computer Algorithms: Prim&#8217;s Minimum Spanning Tree </a></li>
<li><a href="/2012/11/05/computer-algorithms-minimum-spanning-tree/" rel="bookmark" title="Computer Algorithms: Minimum Spanning Tree">Computer Algorithms: Minimum Spanning Tree </a></li>
<li><a href="/2012/06/22/computer-algorithms-binary-search-tree-data-structure/" rel="bookmark" title="Computer Algorithms: Binary Search Tree">Computer Algorithms: Binary Search Tree </a></li>
<li><a href="/2012/07/03/computer-algorithms-balancing-a-binary-search-tree/" rel="bookmark" title="Computer Algorithms: Balancing a Binary Search Tree">Computer Algorithms: Balancing a Binary Search Tree </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Introduction</h2>
<p>One of the two main algorithms in <a href="/2012/11/05/computer-algorithms-minimum-spanning-tree/" title="Computer Algorithms: Minimum Spanning Tree">finding the minimum spanning tree</a> algorithms is the algorithm of Kruskal. Before getting into the details, let’s get back to the principles of the minimum spanning tree. </p>
<p>We have a weighted graph and of all spanning trees we’d like to find the one with minimal weight. As an example on the picture above you see a spanning tree (T) on the graph (G), but that isn&#8217;t the minimum weight spanning tree!</p>
<p><figure id="attachment_3459" style="width: 620px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/11/1.-A-graph-and-a-possible-spanning-tree.png"><img src="/wp-content/uploads/2012/11/1.-A-graph-and-a-possible-spanning-tree.png" alt="A graph and a possible spanning tree" title="A graph and a possible spanning tree" width="620" height="399" class="size-full wp-image-3459" srcset="/wp-content/uploads/2012/11/1.-A-graph-and-a-possible-spanning-tree.png 620w, /wp-content/uploads/2012/11/1.-A-graph-and-a-possible-spanning-tree-300x193.png 300w" sizes="(max-width: 620px) 100vw, 620px" /></a><figcaption class="wp-caption-text">&nbsp;</figcaption></figure><span id="more-3439"></span></p>
<p>We can think of a group of islands and the possible connections of bridges connecting them. Of course building bridges is expensive and time consuming, so we must be aware of what kind of bridges we want to build. Nevertheless there is an important question, what’s the minimum price we’d like to pay to build such set of bridges connecting all the islands. </p>
<figure id="attachment_3457" style="width: 620px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/11/2.-Islands-and-bridges.png"><img src="/wp-content/uploads/2012/11/2.-Islands-and-bridges.png" alt="Islands and bridges" title="Islands and bridges" width="620" height="399" class="size-full wp-image-3457" srcset="/wp-content/uploads/2012/11/2.-Islands-and-bridges.png 620w, /wp-content/uploads/2012/11/2.-Islands-and-bridges-300x193.png 300w" sizes="(max-width: 620px) 100vw, 620px" /></a><figcaption class="wp-caption-text">&nbsp;</figcaption></figure>
<p>Thus we practically need to build a minimum spanning tree, where the vertices will be the islands, while the edges will be the possible bridges between them. Every possible bridge has a weight (the price or the time we need to build it, etc.).</p>
<p>This scenario is only one of possible use cases of where minimum spanning trees can be used in practice.  </p>
<p>The two main approaches – the Kruskal’s and the Prim’s algorithms however differ. </p>
<h2>Overview</h2>
<p>The algorithm of Kruskal starts by initializing a set of |V| trees. </p>
<figure id="attachment_3458" style="width: 620px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/11/3.-A-set-of-V-trees.png"><img src="/wp-content/uploads/2012/11/3.-A-set-of-V-trees.png" alt="A set of V trees" title="A set of V trees" width="620" height="399" class="size-full wp-image-3458" srcset="/wp-content/uploads/2012/11/3.-A-set-of-V-trees.png 620w, /wp-content/uploads/2012/11/3.-A-set-of-V-trees-300x193.png 300w" sizes="(max-width: 620px) 100vw, 620px" /></a><figcaption class="wp-caption-text">&nbsp;</figcaption></figure>
<p>During the process of building the final spanning tree we keep a forest. Obviously we start with a forest with |V| trees, where each tree is a single node tree.</p>
<figure id="attachment_3456" style="width: 620px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/11/4.-A-single-node-tree.png"><img src="/wp-content/uploads/2012/11/4.-A-single-node-tree.png" alt="A single node tree" title="A single node tree" width="620" height="399" class="size-full wp-image-3456" srcset="/wp-content/uploads/2012/11/4.-A-single-node-tree.png 620w, /wp-content/uploads/2012/11/4.-A-single-node-tree-300x193.png 300w" sizes="(max-width: 620px) 100vw, 620px" /></a><figcaption class="wp-caption-text">&nbsp;</figcaption></figure>
<p>On some point we have a forest of “k” trees which are all a sub-trees of the minimum spanning tree. </p>
<figure id="attachment_3455" style="width: 620px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/11/5.-A-forest-out-of-K-sub-trees.png"><img src="/wp-content/uploads/2012/11/5.-A-forest-out-of-K-sub-trees.png" alt="Growing forest" title="Growing forest" width="620" height="399" class="size-full wp-image-3455" srcset="/wp-content/uploads/2012/11/5.-A-forest-out-of-K-sub-trees.png 620w, /wp-content/uploads/2012/11/5.-A-forest-out-of-K-sub-trees-300x193.png 300w" sizes="(max-width: 620px) 100vw, 620px" /></a><figcaption class="wp-caption-text">&nbsp;</figcaption></figure>
<p>Finally one step before building the final MST we have two trees and we connect them with the less weighted edge left that connects them.</p>
<p>It’s important to note that during the process of building the tree we sort the edges in ascending order by their weight.</p>
<figure id="attachment_3454" style="width: 620px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/11/6.-Sorted-Edges.png"><img src="/wp-content/uploads/2012/11/6.-Sorted-Edges.png" alt="Sorted edges" title="Sorted edges" width="620" height="399" class="size-full wp-image-3454" srcset="/wp-content/uploads/2012/11/6.-Sorted-Edges.png 620w, /wp-content/uploads/2012/11/6.-Sorted-Edges-300x193.png 300w" sizes="(max-width: 620px) 100vw, 620px" /></a><figcaption class="wp-caption-text">&nbsp;</figcaption></figure>
<p>Than we start getting edges and check whether their ends (the two vertices making the edge) belong to a different sub-trees.</p>
<figure id="attachment_3453" style="width: 620px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/11/7.-Check-edges.png"><img src="/wp-content/uploads/2012/11/7.-Check-edges.png" alt="Check edges" title="Check edges" width="620" height="399" class="size-full wp-image-3453" srcset="/wp-content/uploads/2012/11/7.-Check-edges.png 620w, /wp-content/uploads/2012/11/7.-Check-edges-300x193.png 300w" sizes="(max-width: 620px) 100vw, 620px" /></a><figcaption class="wp-caption-text">&nbsp;</figcaption></figure>
<h2>Pseudo Code</h2>
<pre>
1. T (the final spanning tree) is defined to be the empty set;
2. For each vertex v of G, make the empty set out of v;
3. Sort the edges of G in ascending (non-decreasing) order;
4. For each edge (u, v) from the sored list of step 3.
      If u and v belong to different sets
         Add (u,v) to T;
         Get together u and v in one single set;
5. Return T
</pre>
<p>A great feature about the Kruskal&#8217;s algorithm is that it also work on disconnected graphs.</p>
<h2>History</h2>
<p>Kruskal’s algorithm is named after <a href="http://en.wikipedia.org/wiki/Joseph_Kruskal" title="Joseph Kruskal" target="_blank">Joseph Kruskal</a>, who wasn’t only computer scientist, but also prominent mathematician and statistician. Although he is best known for its algorithm for computing the minimum spanning tree, described in this post, he’s also known with his work as a statistician and his contribution to the formulation of multidimensional scaling. </p>
<p>Kruskal also explored the Indo-European languages contributing the studies of the linguistics along with other scientists. His “Indo-European Lexicographical List” (http://www.wordgumbo.com/ie/cmp/) is still widely used.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2012/11/19/computer-algorithms-prims-minimum-spanning-tree/" rel="bookmark" title="Computer Algorithms: Prim&#8217;s Minimum Spanning Tree">Computer Algorithms: Prim&#8217;s Minimum Spanning Tree </a></li>
<li><a href="/2012/11/05/computer-algorithms-minimum-spanning-tree/" rel="bookmark" title="Computer Algorithms: Minimum Spanning Tree">Computer Algorithms: Minimum Spanning Tree </a></li>
<li><a href="/2012/06/22/computer-algorithms-binary-search-tree-data-structure/" rel="bookmark" title="Computer Algorithms: Binary Search Tree">Computer Algorithms: Binary Search Tree </a></li>
<li><a href="/2012/07/03/computer-algorithms-balancing-a-binary-search-tree/" rel="bookmark" title="Computer Algorithms: Balancing a Binary Search Tree">Computer Algorithms: Balancing a Binary Search Tree </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2012/11/12/computer-algorithms-kruskals-minimum-spanning-tree/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Computer Algorithms: Minimum Spanning Tree</title>
		<link>/2012/11/05/computer-algorithms-minimum-spanning-tree/</link>
		<comments>/2012/11/05/computer-algorithms-minimum-spanning-tree/#respond</comments>
		<pubDate>Mon, 05 Nov 2012 12:23:42 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[algorithms]]></category>
		<category><![CDATA[data structures]]></category>
		<category><![CDATA[Graphs]]></category>
		<category><![CDATA[electricity]]></category>
		<category><![CDATA[final solution]]></category>
		<category><![CDATA[Graph theory]]></category>
		<category><![CDATA[greedy algorithms]]></category>
		<category><![CDATA[However greedy algorithms]]></category>
		<category><![CDATA[Kruskal algorithm]]></category>
		<category><![CDATA[Kruskal's algorithm]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Minimum spanning tree]]></category>
		<category><![CDATA[minimum weight solution]]></category>
		<category><![CDATA[Prim algorithm]]></category>
		<category><![CDATA[Prim's algorithm]]></category>
		<category><![CDATA[Spanning tree]]></category>
		<category><![CDATA[Steiner tree problem]]></category>
		<category><![CDATA[Theoretical computer science]]></category>
		<category><![CDATA[two main algorithms]]></category>
		<category><![CDATA[Widest path problem]]></category>

		<guid isPermaLink="false">/?p=3428</guid>
		<description><![CDATA[Introduction Here’s a classical task on graphs. We have a group of cities and we must wire them to provide them all with electricity. Out of all possible connections we can make, which one is using minimum amount of wire. To wire N cities, it’s clear that, you need to use at least N-1 wires &#8230; <a href="/2012/11/05/computer-algorithms-minimum-spanning-tree/" class="more-link">Continue reading <span class="screen-reader-text">Computer Algorithms: Minimum Spanning Tree</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2012/11/12/computer-algorithms-kruskals-minimum-spanning-tree/" rel="bookmark" title="Computer Algorithms: Kruskal&#8217;s Minimum Spanning Tree">Computer Algorithms: Kruskal&#8217;s Minimum Spanning Tree </a></li>
<li><a href="/2012/11/19/computer-algorithms-prims-minimum-spanning-tree/" rel="bookmark" title="Computer Algorithms: Prim&#8217;s Minimum Spanning Tree">Computer Algorithms: Prim&#8217;s Minimum Spanning Tree </a></li>
<li><a href="/2012/10/08/computer-algorithms-shortest-path-in-a-graph/" rel="bookmark" title="Computer Algorithms: Shortest Path in a Graph">Computer Algorithms: Shortest Path in a Graph </a></li>
<li><a href="/2012/07/03/computer-algorithms-balancing-a-binary-search-tree/" rel="bookmark" title="Computer Algorithms: Balancing a Binary Search Tree">Computer Algorithms: Balancing a Binary Search Tree </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Introduction</h2>
<p>Here’s a classical task on graphs. We have a group of cities and we must wire them to provide them all with electricity. Out of all possible connections we can make, which one is using minimum amount of wire. </p>
<p>To wire N cities, it’s clear that, you need to use at least N-1 wires connecting a pair of cities. The problem is that sometimes you have more than one choice to do it. Even for small number of cities there must be more than one solution as shown on the image bellow. </p>
<figure id="attachment_3440" style="width: 620px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/11/1.-General-Wiring-Problem.png"><img src="/wp-content/uploads/2012/11/1.-General-Wiring-Problem.png" alt="General Wiring Problem" title="General Wiring Problem" width="620" height="399" class="size-full wp-image-3440" srcset="/wp-content/uploads/2012/11/1.-General-Wiring-Problem.png 620w, /wp-content/uploads/2012/11/1.-General-Wiring-Problem-300x193.png 300w" sizes="(max-width: 620px) 100vw, 620px" /></a><figcaption class="wp-caption-text">&nbsp;</figcaption></figure>
<p>Here we can wire these four nodes in several ways, but the question is, which one is the best one. By the way defining the term “best one” is also tricky. Most often this means which uses least wire, but it can be anything else depending on the circumstances.</p>
<p>As we talk on weighted graphs we can generally speak of a minimum weight solution through all the vertices of the graph. </p>
<p>By the way there might be more the one equally optimal (minimal) solutions. <span id="more-3428"></span></p>
<h2>Overview</h2>
<p>Obviously we must choose those edges that are enough to connect all the vertices of the graph and whose sum of weights is minimal. Since we can’t have cycles in our final solution it must form a tree. Thus we’re speaking on a minimum weight spanning tree, as the tree spans over the whole graph.</p>
<p>Does each connected and weighted graph have a minimum spanning tree? The answer is yes! By removing the cycles from the graph G we get a spanning tree, since it’s connected. From all possible spanning trees one or more are minimal. </p>
<figure id="attachment_3445" style="width: 620px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/11/2.-General-Wiring-Problem.png"><img src="/wp-content/uploads/2012/11/2.-General-Wiring-Problem.png" alt="MST on General Wiring Problem" title="MST on General Wiring Problem" width="620" height="399" class="size-full wp-image-3445" srcset="/wp-content/uploads/2012/11/2.-General-Wiring-Problem.png 620w, /wp-content/uploads/2012/11/2.-General-Wiring-Problem-300x193.png 300w" sizes="(max-width: 620px) 100vw, 620px" /></a><figcaption class="wp-caption-text">&nbsp;</figcaption></figure>
<p>If w(u, v) is the weight of the edge (u, v),  we can speak of weight of any spanning tree T – w(T) which is the sum of all the edges forming that tree. </p>
<p>Thus the weight of the minimum spanning tree is less than the weight of whatever other spanning tree of G.</p>
<p>After we’re sure that there is at least one minimum spanning tree for all connected and weighted graphs we only need to find it somehow.</p>
<p>We can go with an incremental approach. At the end we’ll have the minimum spanning tree (MST), but before that on each step of our algorithm we’ll have a sub-set of this final tree, which will grow and grow until it becomes the real MST. This subset of edges we’ll keep in one additional set A.</p>
<figure id="attachment_3444" style="width: 620px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/11/3.-Growing-the-MST.png"><img src="/wp-content/uploads/2012/11/3.-Growing-the-MST.png" alt="Growing the MST" title="Growing the MST" width="620" height="399" class="size-full wp-image-3444" srcset="/wp-content/uploads/2012/11/3.-Growing-the-MST.png 620w, /wp-content/uploads/2012/11/3.-Growing-the-MST-300x193.png 300w" sizes="(max-width: 620px) 100vw, 620px" /></a><figcaption class="wp-caption-text">&nbsp;</figcaption></figure>
<p>So far we know that on each step we have a subset of the final MST, but first we need to answer a couple of questions. </p>
<h3>How do we start?</h3>
<p>Well, we’ll start with the empty set of edges. Clearly the empty set is a subset of any other set, thus it will be also a subset of the MST.</p>
<figure id="attachment_3443" style="width: 620px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/11/4.-Start-with-the-empty-set.png"><img src="/wp-content/uploads/2012/11/4.-Start-with-the-empty-set.png" alt="Start with the empty set" title="Start with the empty set" width="620" height="399" class="size-full wp-image-3443" srcset="/wp-content/uploads/2012/11/4.-Start-with-the-empty-set.png 620w, /wp-content/uploads/2012/11/4.-Start-with-the-empty-set-300x193.png 300w" sizes="(max-width: 620px) 100vw, 620px" /></a><figcaption class="wp-caption-text">&nbsp;</figcaption></figure>
<h3>How do we grow the tree?</h3>
<p>Another question we must answer is how to grow the tree. Since we have a MST sub-set (A) on each step how do we add an edge to this set in order to get another (bigger than the previous one) subset of edges, which will be again a subset of the minimum spanning tree?</p>
<p>Clearly we must make a decision which edge to add to the growing subset and this is the tricky part of this algorithm. </p>
<h3>Chose the lowest weight edge!</h3>
<p>To find the minimum spanning tree on each step we must get the lowest weighted edge that connects our subset (A) with the rest of the vertices.</p>
<figure id="attachment_3442" style="width: 620px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/11/5.-Chose-the-lowest-weighted-edge.png"><img src="/wp-content/uploads/2012/11/5.-Chose-the-lowest-weighted-edge.png" alt="Chose the lowest weighted edge" title="Chose the lowest weighted edge" width="620" height="399" class="size-full wp-image-3442" srcset="/wp-content/uploads/2012/11/5.-Chose-the-lowest-weighted-edge.png 620w, /wp-content/uploads/2012/11/5.-Chose-the-lowest-weighted-edge-300x193.png 300w" sizes="(max-width: 620px) 100vw, 620px" /></a><figcaption class="wp-caption-text">&nbsp;</figcaption></figure>
<p>However can we be sure that by choosing the less weighted edge we’ll get the MST? Well, let’s assume that isn’t right in order to prove that wrong!</p>
<p>OK so on some step of our growing sub-tree we don’t get the lightest edge (u, v), because we somehow doubt this rule, and we get another edge – let’s say (x, y). Mind that w(x, y) >= w(u, v). </p>
<figure id="attachment_3441" style="width: 620px" class="wp-caption alignnone"><a href="/wp-content/uploads/2012/11/6.-Weights-of-edges.png"><img src="/wp-content/uploads/2012/11/6.-Weights-of-edges.png" alt="Weights of edges" title="Weights of edges" width="620" height="399" class="size-full wp-image-3441" srcset="/wp-content/uploads/2012/11/6.-Weights-of-edges.png 620w, /wp-content/uploads/2012/11/6.-Weights-of-edges-300x193.png 300w" sizes="(max-width: 620px) 100vw, 620px" /></a><figcaption class="wp-caption-text">&nbsp;</figcaption></figure>
<p>Thus our final MST will contain somewhere in its set of edges the edge (x, y), but the weight of MST w(T) is minimal, and if we get another spanning tree that contains the exact same edges as T but instead of (x, y) contains (u, v) we’ll get a smaller weight!</p>
<p>That isn’t possible! Thus we proved that on each step we must get the less weighted edge. </p>
<p>This particular approach is called “greedy”, because on each step we get the best possible choice. However greedy algorithms don’t always get the right or optimal solution. Fortunately for MST this isn’t true so we can be greedy as much as we can!</p>
<p>OK let’s make a summary of our algorithm in the following pseudo code.</p>
<h2>Pseudo Code</h2>
<pre lang="PHP">
1. We start with an  empty set (A) subset of the final MST;
2. Until A does not form T:
      a. Get the less weighted edge u from G;	
      b. Add u to A;
3. Return A
</pre>
<h2>Application</h2>
<p>Actually this algorithm is used firstly by Borůvka which started to wire Moravia in 1926. Even without knowing that the “greedy” approach will lead him to the right solution he optimally covered Moravia with electricity. </p>
<p>However this algorithm is too general and there are two main algorithms – the Prim&#8217;s algorithm and the Kruskal&#8217;s algorithm that we shall see in future posts. </p>
<p>The thing is that on each step we must get the less weighted edge and both algorithms use different approaches to do that.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2012/11/12/computer-algorithms-kruskals-minimum-spanning-tree/" rel="bookmark" title="Computer Algorithms: Kruskal&#8217;s Minimum Spanning Tree">Computer Algorithms: Kruskal&#8217;s Minimum Spanning Tree </a></li>
<li><a href="/2012/11/19/computer-algorithms-prims-minimum-spanning-tree/" rel="bookmark" title="Computer Algorithms: Prim&#8217;s Minimum Spanning Tree">Computer Algorithms: Prim&#8217;s Minimum Spanning Tree </a></li>
<li><a href="/2012/10/08/computer-algorithms-shortest-path-in-a-graph/" rel="bookmark" title="Computer Algorithms: Shortest Path in a Graph">Computer Algorithms: Shortest Path in a Graph </a></li>
<li><a href="/2012/07/03/computer-algorithms-balancing-a-binary-search-tree/" rel="bookmark" title="Computer Algorithms: Balancing a Binary Search Tree">Computer Algorithms: Balancing a Binary Search Tree </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2012/11/05/computer-algorithms-minimum-spanning-tree/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
