The idea is that it's bad for a piece to overlap the island, but neither curvature nor edge color are very effective at avoiding overlap.
For each shifted position and match length in the edge solver, draw the two pieces onto an image and compute the overlap (absolute value of the difference in sums of pixel alpha values between the original two and the combine image). Then, add the overlap term to the error function with a proper weight value (0 to 1).
The idea is that it's bad for a piece to overlap the island, but neither curvature nor edge color are very effective at avoiding overlap.
For each shifted position and match length in the edge solver, draw the two pieces onto an image and compute the overlap (absolute value of the difference in sums of pixel alpha values between the original two and the combine image). Then, add the overlap term to the error function with a proper weight value (0 to 1).