I have some heavy calculations that essentially takes a point in the plane as input and gives an integer as output. Points in the same region gives the same integer (think about the regions as pieces in a jigsaw (every point in completed puzzle belongs to a specific jigsaw piece), the boundaries being simple, closed curves). I've made a very simple algorithm that first finds a boundary by finding the integers of two neighboring corners of my search rectangle and divides and conquers its way to find a boundary (to within a predefined accuracy). So I find a random boundary in O(log(width)) time, where width is the width of my search rectangle. Now my naive approach is then to sort of take small steps in a circle around that point until the number changes, record that point and repeat. The problem is checking a points number is really expensive (NP-hard) and even worse my algorithm misses forkings in the boundaries. All I can find online is image processing algorithms like floodfill, where checking a point is cheap. Does algorithms like this exist? Or do you have any good ideas to make one?
closed as unclear what you're asking by D.W.♦, David Richerby, Luke Mathieson, vonbrand, Gilles♦ Jul 24 '15 at 0:59
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.