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

Check our answers to ‘What's the difference between prim and dijkstra's algorithm?’ - we found 30 replies and comments relevant to this matter. The best answers are submitted by users of Stack Overflow, Wiki.answers.com and Yahoo! Answers.

## 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...

## Other solutions

• ### What is the difference between Prims algorithm and Dijkstras algorithm?

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's the difference between Prim algorithm and Dijkstra algorithm?

TL;DR: Prim's algorithm and Dijkstra's algorithm rely on the same idea but solve two different problems...

• ### What is the difference between Dijkstra and Prim's algorithm?

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

• ### 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 in Kruskal's and Prim's algorithm?

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

• ### 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...

• ### 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...