answersLogoWhite

0


Best Answer

"What are difference between Prim's algorithm and Kruskal's algorithm for finding the minimum spanning tree of a graph?"

Prim's method starts with one vertex of a graph as your tree, and adds the smallest edge that grows your tree by one more vertex. Kruskal starts with all of the vertices of a graph as a forest, and adds the smallest edge that joins two trees in the forest. Prim's method is better when * You can only concentrate on one tree at a time * You can concentrate on only a few edges at a time

Kruskal's method is better when * You can look at all of the edges at once * You can hold all of the vertices at once * You can hold a forest, not just one tree

Basically, Kruskal's method is more time-saving (you can order the edges by weight and burn through them fast), while Prim's method is more space-saving (you only hold one tree, and only look at edges that connect to vertices in your tree).

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

Prims And Kruskal Algorithms are some how the same and both are greedy algorithms, but Prims insiste that the next edge to be chosen must be an edge with minimum weight connected to the current fringe whereas kruskal says that the next edge to be chosen dosent have to be connected to the set of vertices's Already Chosen.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

Kruska's builds a minimum spanning tree by adding one edge at a time. The next line is always the shortest (minimum weight) ONLY if it does NOT create a cycle.

Prims builds a mimimum spanning tree by adding one vertexat a time. The next vertex to be added is always the one nearest to a vertex already on the graph.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Both Prim's and Dijkstra's algorithm are manipulating with graphs but they have different roles. Dijkstra's algorithm is used to find the shortest path between any two nodes in a weighted graph while the Prim's algorithm finds the minimum spanning tree of a graph.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

Well, Dijkstra algorithm is a way to find a path with minimum weight between 2 vertices's in a weighted graph.

Prims And Kruskal algorithms are algorithms used to find the a path with minimum weight in a way that you can go from any vertex to another. Prims And Kruskal Algorithms are some how the same and both are greedy algorithms, but Prims insiste that the next edge to be chosen must be an edge with minimum weight connected to the current fringe whereas kruskal says that the next edge to be chosen dosent have to be connected to the current set of edges.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

Prims select vertex to build minimum spanning tree....kruskal's select edge at a time....

Prims work perfect when lot of edges in graph .........whereas kruskal's want sorted edges...

Prims O(E+VlogV)

Kruskal O(ElogV)

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

prim's

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why prims algorithm is better than kruskals algorithm?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Advantages of Secure hash algorithm?

because it is more secure than any other algorithm.


Why time complexity is better than actual running time?

Finding a time complexity for an algorithm is better than measuring the actual running time for a few reasons: # Time complexity is unaffected by outside factors; running time is determined as much by other running processes as by algorithm efficiency. # Time complexity describes how an algorithm will scale; running time can only describe how one particular set of inputs will cause the algorithm to perform. Note that there are downsides to time complexity measurements: # Users/clients do not care about how efficient your algorithm is, only how fast it seems to run. # Time complexity is ambiguous; two different O(n2) sort algorithms can have vastly different run times for the same data. # Time complexity ignores any constant-time parts of an algorithm. A O(n) algorithm could, in theory, have a constant ten second section, which isn't normally shown in big-o notation.


What is polynomail time algorithm?

That means, roughly speaking, that for any input of size "x", the algorithm will take no longer than xn for some constant "n".


Why does a multiplication algorithm work the way it does?

The answer to this question depends on the multiplication algorithm you are working with. If you are working with an algorithm for multiplying fractions, the answer of why it works the way it does is going to be different than if you are multiplying whole numbers. If you are looking to explain multiplication algorithms to young children (and even to explain algorithms to older children or to better understand them yourself), it is useful to use physical objects and play with multiplication. Once you work out a few of the type of problem you are doing (or a scaled down version if you are working with large numbers) it will likely become clearer to you why it works the way it does.


What is c plus plus program use to convert algorithm in to c plus plus program?

You can't convert an algorithm into code. That is the job of the programmer, not the language. Algorithm's are expressed in plain-English and typically use pseudocode to broadly demonstrate the implementation of the algorithm. However, it is the programmer's job to convert these algorithms into working code. Pseudocode isn't a programming language as such, but it uses structures and statements that are familiar to any programmer and can be easily translated into any language. However, pseudocode is not a standard so there are many different ways to present pseudocode to the programmer. Moreover, pseudocode is generalised and is far too generic to be converted directly into any one language, never mind C++, which can take advantage of the underlying hardware to produce more efficient algorithms than would otherwise be implied by the pseudocode alone. Hence the need for plain-English algorithms in conjunction with the pseudocode. Programmer's can process all this information far more easily than any computer can. Even if you could program a converter for one algorithm, there's no guarantee it would work for any other algorithm. The time spent programming an algorithm converter would be far better spent simply translating the algorithm yourself.

Related questions

Is 51 prims or composite?

51 is a composite number because it has more than 2 factors


What is the algorithm of canny detector?

In case of canny detector, we may say that it is too complex to have its algorithm. It is more than minimax AI algorithm.


Advantages of Secure hash algorithm?

because it is more secure than any other algorithm.


What makes fasta faster than needleman wunsch algorithm?

Hash loookup table in FASTA makes it faster than Needleman Wunsch algorithm.


How many more vertices does a triangular prims have than a triangular pyramid?

Triangular prism has 6. Triangular pyramid has 4. Answer: 2 more vertices.


Why time complexity is better than actual running time?

Finding a time complexity for an algorithm is better than measuring the actual running time for a few reasons: # Time complexity is unaffected by outside factors; running time is determined as much by other running processes as by algorithm efficiency. # Time complexity describes how an algorithm will scale; running time can only describe how one particular set of inputs will cause the algorithm to perform. Note that there are downsides to time complexity measurements: # Users/clients do not care about how efficient your algorithm is, only how fast it seems to run. # Time complexity is ambiguous; two different O(n2) sort algorithms can have vastly different run times for the same data. # Time complexity ignores any constant-time parts of an algorithm. A O(n) algorithm could, in theory, have a constant ten second section, which isn't normally shown in big-o notation.


Need of fft?

FT is needed for spectrum analysis, FFT is fast FT meaning it is used to obtain spectrum of a signal quickly, the FFT algorithm inherently is fast algorithm than the conventional FT algorithm


What is polynomail time algorithm?

That means, roughly speaking, that for any input of size "x", the algorithm will take no longer than xn for some constant "n".


How do you create an algorithm that will read the values of A and B and will determine which has the higher value?

The algorithm can be easily stated as follows: if A is greater than B then return A, otherwise return B.


What is worst fit algorithm?

The worst fit algorithm is a means by which an operating system can choose which space in memory to store information (this algorithm can also be used for allocating hard disk space). The algorithm searches for free-space in memory in which it can store the desired information. The algorithm selects the largest possible free space that the information can be stored on (i.e., that is bigger than the information needing to be stored) and stores it there. This is directly opposed to the best fit algorithm which searches the memory in much the same way as before, only instead chooses the open memory space which is the smallest available which the information can be stored in (i.e., that is bigger than the information needing to be stored).


What is standard algorithm?

Standard algorithm is when you take two digits or decimals and you put the digit or decimal with the greater value on top and the digit or decimal with the least value on the bottom and you contrast the digits/decimals to see if it greater than, less than,or equal to.


Can there are more than one safe sequence in banker's algorithm in os?

yes,it's possible.