the algorithm is much simpler than I thought it would be. It basically takes an image made of tiles (think the levels of an NES game) and it searches for a permutation of those tiles with the property that each tile is immediately surrounded by the same types of tiles as in the original image.