Prim's algorithm
Algorithm for finding the minimum spanning tree for weighted undirected graphs
In computer science, Prim's algorithm is a greedy algorithm that finds a minimum spanning tree for a weighted undirected graph. This means it finds a subset of the edges that forms a tree that includes every vertex, where the total weight of all the edges in the tree is minimized.
Nº Q470813 ★★
Uncommon · Knowledge
Prim's algorithm
Algorithm for finding the minimum spanning tree for weighted undirected graphs
In computer science, Prim's algorithm is a greedy algorithm that finds a minimum spanning tree for a weighted undirected graph. This means it finds a subset of the edges that forms a tree that includes every vertex, where the total weight of all the edges in the tree is minimized.
Last price
—
Floor price
—
7-day median
—
30-day sales
0
30-day range
—
In circulation
0
Price history
median
low – high
sales
No sales in this period
Show table
| Date | median | Low | High | sales |
|---|
Sales history
- Last sale
- —
- 30-day average
- —
- 30-day low
- —
- 30-day high
- —
- Sales 7d
- 0
- Sales 30d
- 0
No sales yet.
Anonymous sales: no buyer or seller shown. Figures count player-to-player sales only.
From Wikipedia
In computer science, Prim's algorithm is a greedy algorithm that finds a minimum spanning tree for a weighted undirected graph. This means it finds a subset of the edges that forms a tree that includes every vertex, where the total weight of all the edges in the tree is minimized. The algorithm operates by building this tree one vertex at a time, from an arbitrary starting vertex, at each step adding the cheapest possible connection from the tree to another vertex. The algorithm was developed in 1930 by Czech mathematician Vojtěch Jarník and later rediscovered and republished by Joseph Kruskal in 1956, Robert C. Prim in 1957, and Edsger W. Dijkstra in 1959. Therefore, it is also sometimes called Jarník's algorithm, the Prim–Jarník algorithm, the Prim–Dijkstra algorithm or the DJP algorithm. Other well-known algorithms for this problem include Kruskal's algorithm and Borůvka's algorithm. These algorithms find the minimum spanning forest in a possibly disconnected graph; in contrast, the most basic form of Prim's algorithm only finds minimum spanning trees in connected graphs. However, running Prim's algorithm separately for each connected component of the graph, it can also be used to find the minimum spanning forest. In terms of their asymptotic time complexity, these three algorithms are equally fast for sparse graphs, but slower than other more sophisticated algorithms. However, for graphs that are sufficiently dense, Prim's algorithm can be made to run in linear time, meeting or improving the time bounds for other algorithms.
Text: Wikipédia, CC BY-SA 4.0. · Image: Shiyu Ji (CC BY-SA 4.0) ·
Related cards
Dijkstra's algorithm
Graph search algorithm
Nº Q8548 ★★★★
Greedy algorithm
Algorithm that makes locally optimal choices in a sequence of steps with the goal of reaching a global optimum
Nº Q504353 ★★★
Kruskal's algorithm
Minimum spanning forest algorithm that greedily adds edges
Nº Q797860 ★★
AKS primality test
Primality test
Nº Q294284 ★★
Kabsch algorithm
Type of algorithm
Nº Q6344361 ★
Breadth-first search
Algorithm for searching the nodes of a graph in order by their hop count from a starting node
Nº Q325904 ★★★