Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Gaming > Development Programming Algorithms > Re: Finding sho...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 8 Topic 639 of 679
Post > Topic >>

Re: Finding shortest path into unweighted undirected graph

by Miss Elaine Eos <Misc@[EMAIL PROTECTED] > Aug 29, 2007 at 02:01 PM

In article <1188375180.739073.276390@[EMAIL PROTECTED]
>,
 ivanatora@[EMAIL PROTECTED]
 wrote:

> Thank you for your reply.
> I've finally managed to implement BFS in PHP and run it.
> It seems it runs a bit too slow, here are some observations. N-start
> point, SEARCH - end point
   [...]
> N: 1
> SEARCH: 3300
> 1->4->7->11->24->162->236->385->485->1082->1710->2777->3300
> 13 NODES away
> 3582 nodes traversed
> TIME: 5.2510550022125 seconds
> ----------------------------------
> Does this responds to the time complexity?
> If so, I'd better try bidi search.

I believe that what you're seeing is the expanding amount of time that 
it takes to try all possible paths in a growing world.

* You might try profiling, and seeing if you have some obvious 
bottleneck.

* You might try seeing if you can mark links-taken, such that they 
aren't re-traversed (I bet this is where you run into a lot of 
slowdown.)  If I'm right about this, you'll also save much memory.

In a world with < 4000 nodes, 5 seconds is FAR too long to traverse the 
tree.

....Although...

Statistics on the average links per node would be helpful, too.

Actually, rather than marking links as taken, mark nodes as visited.  
Then, when looking for a "next step", skip going toward nodes already 
visited (since you've already been there.)  This should give you great 
speed improvement.

-- 
Please take off your pants or I won't read your e-mail.
I will not, no matter how "good" the deal, patronise any business which
sends
unsolicited commercial e-mail or that advertises in discussion newsgroups.
 




 8 Posts in Topic:
Finding shortest path into unweighted undirected graph
ivanatora@[EMAIL PROTECTE  2007-08-24 14:53:00 
Re: Finding shortest path into unweighted undirected graph
Michael Arens <Michael  2007-08-25 19:52:17 
Re: Finding shortest path into unweighted undirected graph
ivanatora@[EMAIL PROTECTE  2007-08-29 08:13:00 
Re: Finding shortest path into unweighted undirected graph
Miss Elaine Eos <Misc@  2007-08-29 14:01:47 
Re: Finding shortest path into unweighted undirected graph
ivanatora@[EMAIL PROTECTE  2007-08-29 08:29:39 
Re: Finding shortest path into unweighted undirected graph
ivanatora@[EMAIL PROTECTE  2007-08-29 14:40:51 
Re: Finding shortest path into unweighted undirected graph
ivanatora@[EMAIL PROTECTE  2007-08-29 14:41:38 
Re: Finding shortest path into unweighted undirected graph
ivanatora@[EMAIL PROTECTE  2007-08-29 17:02:30 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 18 19:45:20 CDT 2008.