0

Fun question.

Consider we have a race track with cars which need to start from point A to point B without going off track. The track will be a grid with nodes. What best algorithm would be fit for this to find the quickest path and possibly also include acceleration?

So far it seems the A* algorithm might be best. However, how would you include acceleration in the quickest path? https://en.wikipedia.org/wiki/A*_search_algorithm

Any suggestions will be welcome :)

Kevin Vella
  • 1,869
  • 1
  • 16
  • 18

1 Answers1

1

First of all, if the grid for your track is continuous, it's not going to be possible to find the exact quickest path. However, you can make it discrete and use A* to get a pretty good approximation.

A* is a good approach to this problem, although it might become slow for larger tracks unless you break down the problem into several smaller path finding problems. If you want to include accelerating and decelerating as possible actions that your car can take at each step, then one way to allow this is to include the current velocity of the car as part of your definition of a state. Since A* works on discrete state spaces, you'll need to discretise the acceleration/velocity as well.

Jacob Soderlund
  • 345
  • 1
  • 9