Maybe as first step would be to vreak down the spaghetti graph into compartmentalized function to increase readability.
It would also helpy you narrow down where the issues are within the graph.
The “Distance based tesselation” part (lower right) looks like code cduplication which makes maintenanace of such graphs agonizingly laborious.
Apart form that, the captiosn are so small, the screenshot doesnt help much.