The Mathematics of Jigsaw Puzzles