3

I'm implementing the A* pathfinding algorithm into a grid based engine, but I'm wanting to create nodes in polygonal areas rather than just using the grid points.

There will be obstacles in the area, that shouldn't be moved through.

I'm wondering is there some algorithm that can split up a larger area with obstacles into a graph with the smallest possible number of connected convex polygons?

Max Tyler
  • 185
  • 4
  • I see that the question was asked quite some time ago, but I'll still try my luck. Have you been able to find some working solution/algorithm for that case? – Dmitrii Naumov Jan 27 '22 at 22:07

1 Answers1

1

There's a lot of them. Typically you're dealing with your triangulation algorithms. You remove the lines that travel through an obstacle and likely do a shortest path algorithm on it. I'm not sure why you want the smallest number of connected convex polygons though, but that could equally be done. The answer is simply the convex hull of the points. One polygon is by definition the smallest number there.

Tatarize
  • 10,238
  • 4
  • 58
  • 64
  • 1
    Each polygon will be a vertex in a connected graph, which I will use to navigate. I was thinking that having the smallest number of vertexes possible will be the best for optimisation; just splitting the area into triangles won't give me the smallest number of nodes. The Convex hull of the points won't work, as there may be obstacles in the middle which need to be taken into account. – Max Tyler Aug 17 '16 at 07:30
  • I don't think the smallest number of node connections is that helpful. But, in most situations you could well find them all, then pare them away according to some criteria like stuff in the way or *something something*. – Tatarize Aug 17 '16 at 09:18