This is the sort of problem that genetic algorithms are well suited for (a small, well defined input domain with a binary oracle). You'd simply generate a random path, run a smoothing function over it, see if that works, then iterate.
edit: does anyone know a site that is actually using this new widget? I only seem to be finding the older version... :/