dijkstra algorithm problem in c++

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2006
Posts: 2
Reputation: myleila is an unknown quantity at this point 
Solved Threads: 0
myleila myleila is offline Offline
Newbie Poster

dijkstra algorithm problem in c++

 
0
  #1
Nov 19th, 2006
I have problem with dijkstra algorithm
I want to write it in c++ and can not describe it in c++ //
please help me
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 7
Reputation: johnpeter1989 is an unknown quantity at this point 
Solved Threads: 1
johnpeter1989 johnpeter1989 is offline Offline
Newbie Poster

Re: dijkstra algorithm problem in c++

 
0
  #2
Nov 19th, 2006
what is this dijkstra algorith. (i'm sorry if i am less informed about the topic)
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,433
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1471
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: dijkstra algorithm problem in c++

 
0
  #3
Nov 19th, 2006
Here is some pseudocode code
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 2
Reputation: myleila is an unknown quantity at this point 
Solved Threads: 0
myleila myleila is offline Offline
Newbie Poster

Re: dijkstra algorithm problem in c++

 
0
  #4
Nov 19th, 2006
how I can use stack and queue to find shortest path ?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: dijkstra algorithm problem in c++

 
0
  #5
Nov 19th, 2006
>how I can use stack and queue to find shortest path ?

It's called homework for a reason. You can use the stack and queue as defined in the standard template library. Go google.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 10
Reputation: begueradj is an unknown quantity at this point 
Solved Threads: 0
begueradj begueradj is offline Offline
Newbie Poster

Re: dijkstra algorithm problem in c++

 
0
  #6
May 28th, 2008
Originally Posted by myleila View Post
I have problem with dijkstra algorithm
I want to write it in c++ and can not describe it in c++ //
please help me
I will try to code it for you in the following days and i will post it on your thread hopefully.
Begueradj.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,873
Reputation: niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute 
Solved Threads: 301
Moderator
Featured Poster
niek_e's Avatar
niek_e niek_e is online now Online
Cenosillicaphobiac

Re: dijkstra algorithm problem in c++

 
0
  #7
May 28th, 2008
Originally Posted by begueradj View Post
I will try to code it for you in the following days and i will post it on your thread hopefully.
Begueradj.
You do realize that the question was asked 1,5 years ago right?
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 10
Reputation: begueradj is an unknown quantity at this point 
Solved Threads: 0
begueradj begueradj is offline Offline
Newbie Poster

Re: dijkstra algorithm problem in c++

 
0
  #8
Jun 2nd, 2008
i did not realize that
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 10
Reputation: omeralper is an unknown quantity at this point 
Solved Threads: 1
omeralper omeralper is offline Offline
Newbie Poster

Re: dijkstra algorithm problem in c++

 
0
  #9
Jun 2nd, 2008
shortestPath(in theGraph, in weight:WeightArray) {
// Finds the minimum-cost paths between an origin vertex (vertex 0)
// and all other vertices in a weighted directed graph theGraph;
// theGraph’s weights are nonnegative
Create a set vertexSet that contains only vertex 0;
n = number of vertices in the Graph;
// Step 1
for (v=0 through n-1)
weight[v] = matrix[0][v];
// Steps 2 through n
for (step=2 through n) {
Find the smallest weight[v] such that v is not in vertexSet;
Add v to vertexSet;
for (all vertices u not in vertexSet)
if (weight[u] > weight[v]+matrix[v][u])
weigth[u] = weight[v]+matrix[v][u];
}
}
Algorithm is above if u try to find this algorithm but i think nobody develops a code for u here. Because it seems like it's your homework. right?
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 1,607
Reputation: jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of 
Solved Threads: 120
jephthah's Avatar
jephthah jephthah is offline Offline
Posting Virtuoso

Re: dijkstra algorithm problem in c++

 
0
  #10
Jun 3rd, 2008
Thank the gods you finally arrived to give us the answer to this perplexing problem.

and to think we were just getting ready to close this one out as "unsolved"

*whew*

(next time, please dont wait so long, mmmkay?)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC