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
Priority queue
(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!
=== Prim's algorithm for minimum spanning tree === Using [[Binary heap|min heap priority queue]] in [[Prim's algorithm]] to find the [[minimum spanning tree]] of a [[Connected graph|connected]] and [[undirected graph]], one can achieve a good running time. This min heap priority queue uses the min heap data structure which supports operations such as ''insert'', ''minimum'', ''extract-min'', ''decrease-key''.<ref name="CLR">{{Introduction to Algorithms |edition=3 |pages=634}} "In order to implement Prim's algorithm efficiently, we need a fast way to select a new edge to add to the tree formed by the edges in A."</ref> In this implementation, the [[weighted graph|weight]] of the edges is used to decide the priority of the [[Vertex (graph theory)|vertices]]. Lower the weight, higher the priority and higher the weight, lower the priority.<ref name="GEEKS"> {{cite web |url = http://www.geeksforgeeks.org/greedy-algorithms-set-5-prims-minimum-spanning-tree-mst-2/ |title = Prim's Algorithm |date = 18 November 2012 |publisher = Geek for Geeks |access-date = 12 September 2014 |url-status = live |archive-url = https://web.archive.org/web/20140909020508/http://www.geeksforgeeks.org/greedy-algorithms-set-5-prims-minimum-spanning-tree-mst-2/ |archive-date = 9 September 2014 }} </ref>
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)