From: Damian Yerrick Newsgroups: comp.os.msdos.djgpp Subject: Re: OT: Which newsgroup to ask an algorithm related programming question Organization: Pin Eight Software http://pineight.8m.com/ Message-ID: References: <3A5AA913 DOT 77858383 AT home DOT com> X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 36 X-Trace: /bCCZGSqUYXuOTabapMnZ4PbMB4/pDYFg9Ccf+Xw4q4SfUCrr4sY5uO7mctWgKnBP/AhhF9uGURq!Gk/jFB7xp2hOq3NJCGlHx+vNy38baC7LujQyo6rfGYBfpiqwuB+LfhRhQufw1GIoiGDobpBFYubY!jmgjFA== X-Complaints-To: abuse AT gte DOT net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly NNTP-Posting-Date: Thu, 11 Jan 2001 01:50:51 GMT Distribution: world Date: Thu, 11 Jan 2001 01:50:51 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com please stand up: http://slashdot.org/articles/00/09/22/0243231.shtml#41 On Tue, 09 Jan 2001 06:00:46 GMT, Robin Johnson wrote: >I haven't had any luck finding the right newsgroup to ask my question, >so i'll ask it here in the hopes that some of the regulars can redirect me to >the proper place, (or provide an answer anyway). You might want to search Deja News for similar topics. >I'm looking into writing a piece of software to aid with the local transit >system, but I have hit a problem, I need a good algorithm (or easily >modifiable) implementation of a shortest path algorithm for a one-pair set, >in a system that will have many edges, and all positive weights, and it >MUST record the path. > >I've look at both Dijkstra's & Bellman-Ford's algorithms, but I don't see >how they can be modified to record the path. They record the path implicitly. The version of Dijkstra's algorithm that I learned stores with each node the length of the shortest path to that node and the node you just came from. Tracing back from the destination to the source to get the path is as easy as traversing a linked list. --