Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Kruskal's algorithm
(section)
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!
== Example == {| class="wikitable" ! Image !! Description |- |[[Image:Kruskal Algorithm 1.svg|200px]] |'''AD''' and '''CE''' are the shortest edges, with length 5, and '''AD''' has been [[Arbitrary|arbitrarily]] chosen, so it is highlighted. |- |[[Image:Kruskal Algorithm 2.svg|200px]] |'''CE''' is now the shortest edge that does not form a cycle, with length 5, so it is highlighted as the second edge. |- |[[Image:Kruskal Algorithm 3.svg|200px]] |The next edge, '''DF''' with length 6, is highlighted using much the same method. |- |[[Image:Kruskal Algorithm 4.svg|200px]] |The next-shortest edges are '''AB''' and '''BE''', both with length 7. '''AB''' is chosen arbitrarily, and is highlighted. The edge '''BD''' has been highlighted in red, because there already exists a path (in green) between '''B''' and '''D''', so it would form a cycle ('''ABD''') if it were chosen. |- |[[Image:Kruskal Algorithm 5.svg|200px]] |The process continues to highlight the next-smallest edge, '''BE''' with length 7. Many more edges are highlighted in red at this stage: '''BC''' because it would form the loop '''BCE''', '''DE''' because it would form the loop '''DEBA''', and '''FE''' because it would form '''FEBAD'''. |- |[[Image:Kruskal Algorithm 6.svg|200px]] |Finally, the process finishes with the edge '''EG''' of length 9, and the minimum spanning tree is found. |}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)