Sign in to follow this  

help reqd in path finding algorthms

This topic is 3045 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Following is my problem: Given is a matrix with a label for each vertex saying it is a "danger spot" or a "safe spot". Also the starting and destination vertex are provided at run time. I need to figure out the quickest route possible with this given input. Any suggestions as to which algorithm I should use?

Share this post


Link to post
Share on other sites
By a "matrix", I assume you mean you're pathing on a 2D grid? A* is the most commonly used algorithm for this sort of thing.

Share this post


Link to post
Share on other sites
Quote:
Or you could also try Dijkstra's Shortest Path algorithm
My understanding is that A* is a variation of Dijkstra. A* incorporates a heuristic, which causes it to perform better than Dijkstra in the general case. However, there are cases where a meaningful heuristic may not be available, in which case Dijkstra is the better choice.

So in other words, A* vs. Dijkstra isn't really a 'six of one, half dozen of the other' choice; they have different characteristics and different uses.

Given the information that the OP provided, it seems pretty clear that A* is the better choice in this case (unless I've overlooked something).

Share this post


Link to post
Share on other sites

This topic is 3045 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this