# What's the difference between prim and dijkstra's algorithm?

Letâ€™s learn what's the difference between prim and dijkstra's algorithm. The most accurate or helpful solution is served by Stack Overflow.

There are ten answers to this question.

Best solution

Difference between Prim and Dijkstra graph algorithm

I'm reading graph algorithms from Cormen book. Below is pseudocode from that book Prim algorithm for MST MST-PRIM (G, w, r) for each u in G.V u.key = infinity u.p = NIL r.key = 0 Q = G.V while Q neq null u = EXTRACT-MIN(Q) for each v in G.Adj[u] if (v in Q) and (w(u,v) < v.key) v.p = u v.key = w(u,v) Dijkstra algorithm to find single source shortest path. INITIALIZE-SINGLE-SOURCE (G,s) for each vertex v in G.V v.d = infinity v.par = NIL s.d = 0 DIJKSTRA (G, w, s) INITIALIZE-SINGLE-SOURCE...

The algorithms called Prim and Dijkstra solve different problems in the first place. 'Prim' finds a...

venkysmarty at Stack Overflow

Other solutions

Both Prim's and Dijkstra's algorithm are manipulating with graphs but they have different roles. Dijkstra...

I need help connecting to the internet with ubuntu 8.10?

hello i am new to ubuntu and i am trying to connect to the internet. i have ubuntu 8.10 and a linskys wireless router, with a wireless card in my desktop. i can see my network name available but then it wants my key, i type it in then it keeps wanting...

The key that is it is trying to convert is the issue, when you set it up you should have used a password...

What is the difference between what's and whats?

I have been wondering what is the difference between What's and Whats for a while. I always thought that What's that meant "what is that". While whats meant on something your not describing. How about there's and theres.... What's the difference...

What's is the contraction of 'what is'.....the other, whats.....does NOT exist in the dictionary......

Whats the difference between the jetta?

I was wondering whats the difference between some volkswagen jettas. I was wondering the difference between the TDI, GTI, Wolfsburg Edition, California Edition, i feel like im missing one more. Whats faster? whats the difference inside? which one cost...

Volkswagen has many different options and packages available under each catagory of Jetta. However,...

What is the difference between a polynomial and a pseudo-polynomial algorithm?

The difference between P and NP is clear. But the dynamic programming algorithm for knapsack is pseudo-polynomial. At the same time, knapsack is NP-complete. What's going on? What is an example of a problem that is NP but no pseudo-polynomial algorithm...

If [math]\Pi[/math] is a problem, and [math]I[/math] is an instance of the problem, then a polynomial...

Itai David Hass at Quora

Dijkstra's algorithm is almost identical to that of Prim's. The algorithm begins at a specific vertex...

When to use each of these algorithms? Answer: Use Prim's algorithm when you have a graph with lots of...

Prabhakar Bikkaneti at Quora

Whats the difference between the Lexus is 250 and the is 350? Also, whats the difference with the is-f?

Im looking to buy a 06/07 Lexus IS but i cant decide which one to go for, i really don't know much about the difference between the 250/ 350/ IS-F. I need help. Any recommendation?

IS 250 - 2.5 L 4GR-FSE V6, 204 hp (153 kW), rear wheel drive # IS 350 - 3.5 L 2GR-FSE V6, 306 hp (2...

What is the difference between machine learning model and ML algorithm?

I have often come across texts/lectures where it is used interchangeably. But at some places, usually in the introductory lectures, it says that the learning algorithm gives the model as its output. So when we say, for example, linear regression model...

I think the first Lecture of the MOOC Learning from Data clarifies this. See Learning From Data MOOC...