Creating pathfinding with irregular polygons

Godot Version

4.1.1 stable

Question

I have created up this map here in Aseprite.

However, I am having a tough time trying to work out how to determine what a neighbour is.

I have an idea of trying to determine a neighbour by finding out who has either shared vertexes or shared edges. Though I am not sure how to go about finding the shared vertex/edge.

I thought I could potentially iterate over the image and if the pixel colour is black then I can at least determine I’ve hit a border but I’m not sure where to go from there.

I’ve used a red dot in the rough centre on the image for each ‘tile’, so using the above thought process, I can get a list of all the centroids so creating the ‘graph’ aspect is relatively straight forward.

Is this the right idea? Or is there a better/smarter way of handling pathfinding with irregular polygons.

For those that stumble their way here. I ended up just ‘creating’ a circle with a desired radius from the center point. If the center circle intersects with another circle I can be reasonably certain that it’s a neighbour.

I add that to a Dictionary of Center Point Vector2 and an Array of neighbour center points.