What you need to do is define a dictionary for indexing for each face of the puzzle, so that the right edge index can tell you what the index of the corresponding left edge is (for example, a simple dictionary: “convex” and “concave”, “convex” on the face, meaning “concave” on the corresponding opposite side), and then classify each figure according to the indexing vocabulary. The more accurate the vocabulary, the more discriminatory the face matching will be and the faster your algontm will go, but you will realize it. (For example, you might have "flat edge, straight-left-left, left-right-right, concave, convex, pen, pen, ...). We assume that the indexing scheme is the actual shape of the edge and that there is a predicate" exactly matches (piece1, edge 1, piece2, edge 2) ", which is true only if the edges exactly match. We also assume that there is no more than one exact match of a piece with a specific edge.
The goal is to grow a set of regions, for example a set of connected pieces, until it is already impossible to enlarge the regions. First we mark all fragments with unique region names, 1 apiece, and all edges are unsurpassed. Then we list the pieces in any order. For each enumerable part P with edge E, use an indexing scheme to select potentially suitable pairs of pairs / edges. Check for exactly the right predicate; no more than one part of Q, with the edge F, exactly coincides. Combine the areas for P and Q together to make a large area. Reiteration. I think this solves the riddle.
Ira Baxter
source share