Inkblot Algorithm


Couldn’t find much online about it, but I think it’s a “populating” algorithm to find a path (A->B).

Maze

inkblot-1

inkblot-2

Recording the Path

Use recursion and an accumulator.

struct path
{
  int x;
  int y;
  struct path *next;
}
struct route *
blot (int x, int y, struct path *route)
{
  struct node *n = (struct node *) malloc (sizeof (*n));
  if (x,y) is destination
  {
    n->x = x, n->y = y, n->route = route;
    return n;
  }
  else
    for (each point (a,b) adjacent to (x,y)
    {
      n->x = x; n.y = y; n->route = route;
      newroute = blot (a, b, n);
      if (newroute)
        return newroute:
    }
  free (n);  /* Failure, give back node */
  return NULL;
}

Contours

Want the intermediate contour.

Inkblot from both sides until meet, may get artefacts but will be optimal.

contours