The solution to the picture is messy!

What algorithm would you use to use a computer if you want to solve a picture problem?

You can always argue in terms of the effectiveness of the algorithm, but here I really see which approaches follow.

thanks

+3
algorithm image
source share
4 answers

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.

+6
source share

The solution to the puzzle can basically boil down to matching similar edges with similar edges. In this puzzle, only one pair of pieces can be properly locked along a certain edge, and each part will have angles so that you know where a particular side begins and ends.

So, just find the endpoints of each edge and select multiple control points. Then iterate over all parts with loose edges until you find the correct one. When there are no more disconnected ribs, you have solved the riddle.

0
source share

To clarify Ira Baxter’s answer, another way to conceptualize the problem is to think of a puzzle as a graph, where each part is a node and each iteration with another part is an edge.

For example, if you were developing a puzzle game, saving the “answer” in this way would make it “check if this code is suitable” much faster, as it could be reduced to some kind of hash search.

0
source share

.1 Find 2x2 grams to fit all four ribs. Then evaluate how well the image fits together.

   P1 <--> P2
   ^ ^
   |  |
   vv
   P3 <--> P4

.2 Orientation tag (manually or heuristically), but use them only as heuristic estimates (for ranking), and not as final search criteria.

.3 Form Context

0
source share

All Articles