A reduction loop connecting unsigned edge matching, signed edge matching, jigsaw puzzles, and polyomino packing, from the paper "Jigsaw Puzzles, Edge Matching, and Polyomino Packing: Connections and Complexity" by Erik D. Demaine and Martin L. Demaine.
Given a 3-partition instance, this code constructs the corresponding edge matching puzzle. Then clicking the button reduces around the loop. Warning: the full loop makes a very big puzzle, which can crash your browser.
Written by Joshua Ani during the 2019 MIT class 6.892: Algorithmic Lower Bounds: Fun with Hardness Proofs.