HeadlinesBriefing favicon HeadlinesBriefing.com

Circular Obstacle Pathfinding with A* (2017)

Hacker News •
×

The A* algorithm isn’t limited to grid maps; it can navigate any graph, including a forest of circular obstacles. A* expands partial paths kept in a priority queue, ordered by actual length plus a heuristic—usually the straight‑line distance, which must never overestimate. The graph is built from two edge types: surfing edges (bitangents that just kiss two circles) and hugging edges that follow an obstacle’s circumference.

For each pair of circles there are four bitangents: two internal and two external, found with \(\theta = \arccos\frac{r_A+r_B}{d}\) for internal and \(\theta = \arccos\frac{|r_A-r_B|}{d}\) for external. Any surfing edge intersected by a third circle is discarded using a point‑to‑line distance test (if the distance is less than the circle’s radius, the edge is blocked). Hugging edges are created by linking the endpoints of all surfing edges that touch the same circle.

Once the tangent visibility graph—nodes, surfing edges, and hugging edges—is assembled, A* can compute the optimal path. Enhancements include handling touching or overlapping circles, which removes internal bitangents when \(\frac{r_A+r_B}{d}>1\).