GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 28-Dec-2008, 10:11
blackslither blackslither is offline
New Member
 
Join Date: Oct 2008
Posts: 3
blackslither is on a distinguished road

Shortest path algorithm with a maximum number of edges limit


Hi

I'm looking for a "shortest path algorithm" in a graph, but with a maximum number of edges limit . So the path has to contain at most N edges .

10x

Happy Holiday
  #2  
Old 28-Dec-2008, 11:39
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 5,200
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: Shortest path algorithm with a maximum number of edges limit


Quote:
Originally Posted by blackslither
I'm looking for...

If your search of the literature and the web doesn't yield an exact match for your assignment, then you might consider the following:


1. Implement (or find an implementation for) your favorite shortest-path algorithm. Look in class notes or text or other reference material. Maybe try something like NIST shortest path for starters.

2. Make sure your implementation works for connected and unconnected graphs. In other words if there is no path to the target, make sure there isn't some kind of infinite loop or infinite recursion looking for a non-existent path.

3. In the path-finding part of the code, change the function(s) to take a parameter that designates the maximum acceptable path length. If the next part of the current path would be longer than the maximum, return whatever value is appropriate for an unconnected graph (in other words short-circuit the search at that point to make it appear as though there is no path to the target).

Regards,

Dave
 
 

Recent GIDBlogProgramming ebook direct download available by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help - Shortest Path Problem mas287 C Programming Language 5 18-Jun-2008 03:59
shortest path algorithm and file saving Pandiani C++ Forum 10 17-Jul-2006 11:46
Converting a number amount to text Godzilla C++ Forum 5 31-Mar-2006 12:38
Anyone can write a program code for this??? chriskan76 C Programming Language 1 19-Oct-2004 21:25
Apache2 config issues monev Apache Web Server Forum 2 28-Jun-2004 07:19

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 01:02.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.