6
I need to argue that the solution found after running Prim’s Greedy Algorithm is great. But I don’t know how, someone could help?
6
I need to argue that the solution found after running Prim’s Greedy Algorithm is great. But I don’t know how, someone could help?
2
Prim’s algorithm serves to find the minimum generating tree of a graph, i.e., a tree with the smallest possible weight of its edges. Source: Wikipedia
It starts with any arbitrary node of the graph and puts it in the tree A. At each next step it inserts the lower-weight edge that has exactly one vertex within the tree A and another outside of A, repeating until all nodes are added.
The easiest way to prove it is by contradiction. But for that you have to use the cycle ownership: "For any cycle C of the graph, if the weight of an edge [and] of the cycle is greater than all other edges of the cycle, then [and] does not belong to the minimum generating tree".
Another way to prove it is by induction. The hypothesis is that at each iteration of the algorithm, the tree A is a subgraph of the minimum generating tree T.
Browser other questions tagged algorithm
You are not signed in. Login or sign up in order to post.