Hacker News new | ask | show | jobs
by laarc 3845 days ago
As for an effective A* algorithm, bidirectional A* turns out to be both rugged and efficient.

Basically, grab some graph paper. Put your left index finger on start. Right index finger on end.

Move your fingers towards each other, avoiding obstacles as you go.

Wherever they happen to meet, the path formed by the trail of both your fingers combined is the path to use.

That's the general idea. It's important to trace from both simultaneously, otherwise you run into some degeneracies.

2 comments

Just as a side note: bidir A* is not that straight forward as you need a special finish condition to keep the algorithm optimal. (For games you probably don't need this but for tests and real world road routing it is important IMO)
Here's the visualisation of bidirectional A* http://qiao.github.io/PathFinding.js/visual/