This uses the Ford-Fulkerson max flow algorithm, and it can run on any bipartite graph, not just a grid. Including on an aztec diamond. There's a lot of research on how to count tilings, but not so much on how to randomly sample them. Ford-Fulkerson with randomized depth-first search works great.