I need to find the path inside a polygon. It should be the equidistant path from the polygon boundaries. Unfortunately I can't rasterize the polygon. I thought it would be possible to construct a visibility graph from various points within the polygon. Then calculate the weight of its edges based on distance from the polygon boundary and apply Dijkstra algorythm to find the path. But I have no idea how to calculate a weight for graph edges. For the shortest path is a distance between the xy coordinates of start and end nodes. But what is it for the equidistant path from the polygon boundaries? I could calculate distance from the graph nodes to the closest point of a polygon boundary by geometry expression but seems the difference of this distances for two points is not the weight of a graph edge. May be somebody can help me?
The target part looks like this:

A created a lot of points inside a polygon and then I connected then with edges (green edges):

I used such geometry expression to calculate the distance of a point from the boundaries of the polygon:
cost = 1/distance($geometry,closest_point (overlay_within('polygon', boundary($geometry))[0], $geometry))
Then I tried to calculate weight of edge like this
weight = abs(G.nodes[node1]['cost'] - G.nodes[node2]['cost'])
