I can imagine how this is done with the standard jigsaw puzzles with four corners on each piece, kind of like hashing the edges such that female and male versions of the edge have hashes that can be related. But pieces that can be any shape at all... I'm not sure.