User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 392,076 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,053 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser:
Views: 3796 | Replies: 9
Reply
Join Date: Nov 2006
Posts: 2
Reputation: myleila is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
myleila myleila is offline Offline
Newbie Poster

dijkstra algorithm problem in c++

  #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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2006
Posts: 7
Reputation: johnpeter1989 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
johnpeter1989 johnpeter1989 is offline Offline
Newbie Poster

Question Re: dijkstra algorithm problem in c++

  #2  
Nov 19th, 2006
what is this dijkstra algorith. (i'm sorry if i am less informed about the topic)
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 10,562
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 36
Solved Threads: 860
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Most Valuable Poster

Re: dijkstra algorithm problem in c++

  #3  
Nov 19th, 2006
Here is some pseudocode code
I think it's about time we voted for senators with breasts. After all, we've been voting for boobs long enough. ~Clarie Sargent, Arizona senatorial candidate
Those who are too smart to engage in politics are punished by being governed by those who are dumber. ~Plato
Reply With Quote  
Join Date: Nov 2006
Posts: 2
Reputation: myleila is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
myleila myleila is offline Offline
Newbie Poster

Re: dijkstra algorithm problem in c++

  #4  
Nov 19th, 2006
how I can use stack and queue to find shortest path ?
Reply With Quote  
Join Date: Aug 2005
Posts: 4,668
Reputation: iamthwee is just really nice iamthwee is just really nice iamthwee is just really nice iamthwee is just really nice iamthwee is just really nice 
Rep Power: 17
Solved Threads: 298
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Industrious Poster

Re: dijkstra algorithm problem in c++

  #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.
Member of: F-ugly code club

Join today don't delay!
Reply With Quote  
Join Date: Mar 2007
Posts: 7
Reputation: begueradj is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
begueradj begueradj is offline Offline
Newbie Poster

Re: dijkstra algorithm problem in c++

  #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  
Join Date: Oct 2006
Location: the Netherlands
Posts: 1,578
Reputation: niek_e is just really nice niek_e is just really nice niek_e is just really nice niek_e is just really nice 
Rep Power: 8
Solved Threads: 159
niek_e's Avatar
niek_e niek_e is offline Offline
Posting Virtuoso

Re: dijkstra algorithm problem in c++

  #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?
do NOT pm me for help, it makes me angry. You wouldn't like me when I'm angry...
Reply With Quote  
Join Date: Mar 2007
Posts: 7
Reputation: begueradj is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
begueradj begueradj is offline Offline
Newbie Poster

Re: dijkstra algorithm problem in c++

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

Re: dijkstra algorithm problem in c++

  #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  
Join Date: Feb 2008
Location: Seattle
Posts: 699
Reputation: jephthah is a jewel in the rough jephthah is a jewel in the rough jephthah is a jewel in the rough 
Rep Power: 4
Solved Threads: 45
jephthah's Avatar
jephthah jephthah is offline Offline
Practically a Master Poster

Re: dijkstra algorithm problem in c++

  #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?)
Why so serious?
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb C++ Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 12:15 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC