Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Kruskal's algorithm
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Proof of correctness == The proof consists of two parts. First, it is proved that the algorithm produces a [[spanning tree]]. Second, it is proved that the constructed spanning tree is of minimal weight. ===Spanning tree=== Let <math>G</math> be a connected, weighted graph and let <math>Y</math> be the subgraph of <math>G</math> produced by the algorithm. <math>Y</math> cannot have a cycle, as by definition an edge is not added if it results in a cycle. <math>Y</math> cannot be disconnected, since the first encountered edge that joins two components of <math>Y</math> would have been added by the algorithm. Thus, <math>Y</math> is a spanning tree of <math>G</math>. ===Minimality=== We show that the following proposition '''''P''''' is true by [[Mathematical induction|induction]]: If ''F'' is the set of edges chosen at any stage of the algorithm, then there is some minimum spanning tree that contains ''F'' and none of the edges rejected by the algorithm. * Clearly '''''P''''' is true at the beginning, when ''F'' is empty: any minimum spanning tree will do, and there exists one because a weighted connected graph always has a minimum spanning tree. * Now assume '''''P''''' is true for some non-final edge set ''F'' and let ''T'' be a minimum spanning tree that contains ''F''. ** If the next chosen edge ''e'' is also in ''T'', then '''''P''''' is true for ''F'' + ''e''. **Otherwise, if ''e'' is not in ''T'' then ''T'' + ''e'' has a cycle ''C''. The cycle ''C'' contains edges which do not belong to ''F'' + ''e'', since ''e'' does not form a cycle when added to ''F'' but does in ''T''. Let ''f'' be an edge which is in ''C'' but not in ''F'' + ''e''. Note that ''f'' also belongs to ''T'', since ''f'' belongs to ''T'' + ''e'' but not ''F'' + ''e''. By '''''P''''', ''f'' has not been considered by the algorithm. ''f'' must therefore have a weight at least as large as ''e''. Then ''T'' − ''f'' + ''e'' is a tree, and it has the same or less weight as ''T''. However since ''T'' is a minimum spanning tree then ''T'' − ''f'' + ''e'' has the same weight as ''T'', otherwise we get a contradiction and ''T'' would not be a minimum spanning tree. So ''T'' − ''f'' + ''e'' is a minimum spanning tree containing ''F'' + ''e'' and again '''''P''''' holds. * Therefore, by the principle of induction, '''''P''''' holds when ''F'' has become a spanning tree, which is only possible if ''F'' is a minimum spanning tree itself.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Kruskal's algorithm
(section)
Add topic