How to Solve Yagit Puzzles
Yagit is a grid division puzzle. Divide the field with fences to separate sheep and wolves so they don’t share a pen. All pens must contain at least one creature.
Yagit, short for Yagi To Ookami, literally translates to “Wolves and Goats”, although “Wolves and Sheep”, is also valid. The first form of the puzzle, Kaitoranma (Gordic Knot), appeared in the Japanese puzzle magazine Nikoli in September 2008. It was purely abstract, dividing the grid into rectangles containing the same color dots. Later iterations allowed the sections to bend and form irregular areas.
Rules
Place fences (lines) along the lines of the grid to create regions that each contain only sheep, or only wolves.
- Regions may only contain one type of creature. You may not leave a region empty.
- Some regions may be irregular.
- Each fence is a single line that must start and end at the edge of the grid.
- Fence lines must travel in a straight line except at a post (the dots), where they are allowed to turn 90 degrees.
- Posts may not have more then 2 lines attached, essentially 1 fence only.
- Fences may cross each other at any other intersection
- Some posts may be decoys. You are not required to use all (or sometimes any) of them.
Basic Techniques to Solve
- Find different creatures that are orthogonally adjacent.
- Take note of grid lines you can’t use.
- Use the posts for deduction.
- Eliminate potential empty regions.
- Test multiple divisions at once.
- Take note of connected cells.
- Be wary of false positives.
Adjacent Creatures
First, look for sheep and wolves that are right next to each other. There must be a fence between them, and it will extend in both directions until it reaches either the border or a post. These initial fence segments lay the groundwork for solving the remainder of the puzzle.
Each of these sheep and wolf pairs must have a fence between them. After placing the first fences.
Eliminate Grid Lines
As you work through the Yagit puzzle, pay attention to grid lines that can’t possibly be part of a fence. Doing so makes it easier to see where the fences you do need can fit. Look for fence posts that already have two fence segments attached. Also, take note of lines in regions that appear to be complete. Imagine a fence from another area of the puzzle that must include that line. Does that subdivision of the “completed” area create an empty region? If so, you can eliminate that entire length as an option.
We already ran a fence through this post, so we can eliminate the grid lines that cross it. If we separated this wolf and sheep vertically, we’d create an empty, isolated cell, so we must eliminate that option. This fence correctly separates the wolf and sheep. I’ll also remove the X’s above it to declutter.
Use the Posts
Sometimes, the next move won’t be obvious – it wouldn’t be a puzzle otherwise, right? When that happens, try and find partially-used posts, and look at your options for the direction of the other part of the fence attached to it. Ideally, find a small group of cells with several different animals and a cluster of posts. Then, think carefully about how they might be divided. Even if you can’t come to a conclusion for a fence segment, the odds are good you will be able to at least eliminate some possible placements.
Eliminate Potential Empty Regions
Sometimes, you will find it useful to look at fenced in regions you have already created. You can use them to eliminate lines along the grid, because placing a fence along them would subdivide your existing area and create empty regions within it. Remember, knowing where a fence can’t be helps you see where they must be.
If we place a fence along any of these three lines, we would create at least one of these four empty regions. Now we can see that the fence attached to this post must turn to the left side of the grid to be completed. After adding the new fence.
Survey More Than One Fence Line
I’m leaning heavily into the sheep and wolf theme with these headings, but basically what this means is to test multiple divisions that are near each other. Look for a fence that must be placed in two possible positions. Then, find one or more divisions that will cross it. If you create an empty region or some other illegal condition when placing all of them, you can prove that the first line must not contain a fence.
Note Connected Cells
This is more of a visualization tool than a solving technique. Some Yagit solvers draw lines across the eliminated grid lines. While it doesn’t do anything to change the grid, and you may feel it adds clutter, this also aids in seeing the emerging regions. You see, an eliminated grid line means that the cells adjacent to it must be part of the same region.
These are the connected cells we’ve proven so far.
Be Wary of False Positives
Sometimes, you can then experiment with dividing regions of empty cells to prove whether they must be connected, expanding your known regions. You might be able to test unused posts to see if they’re needed in the solution. Be careful when doing this, though – if you think you find a “known” fence, it might be a false positive. A false positive is when you find yourself making an assumption that something is true, and you might not have seen an alternate possibility that would disprove it.
When testing, it is generally safe to prove that something can’t be true and mark it down. Don’t mark something as true unless you are certain that no other configuration is valid.
Solving the Puzzle
Now that we know what to look for and have a basic understanding of technique, we can work on solving the rest of our example Yagit puzzle.
Schrödinger’s Post
We still need to divide these two pairs, and we know one option is invalid if this post continues to the right. Now we see the other option also isolates cells. We haven’t proven anything about the other post yet, but we can now be certain that this fence continues down. Now we can easily see that a fence here would create an empty region, so we may eliminate it.
We know that one of these lines must be used to divide the pairs at the top. We can eliminate the blue line, because either required line isolates cells. Finally, our mysterious post, using its “known” fence. We can eliminate two options to close it, because closing the existing fence would isolate part of these cells. Next, we look at the orange sheep and wolf, which must have at least one of these pink lines between them.
We’ll test the top line first. We know it can’t extend up, and extending to the right isolates these cells. Extending it down turns this single cell into an empty region, so the line is invalid. Let’s test the other one. For this case, we first look at the end-post of our known fence. Extending it either left or down isolates part or all of these cells, so it must continue to the right.
Now we see that the end-post of our pink line can’t be extendeded without creating an empty region. We eliminated the original fence, and we know this configuration doesn’t work. So we’ve definitively proven that this post is not used. Finally, we know how to divide these two pairs, and place the correct fence.
Process of Elimination
Much of the grid is wide open with options, so we’ll look for what we can eliminate for certain. This post, no matter how it’s configured, will isolate cells, so it isn’t used. Now we’ll look at our options for separating these sheep from the wolf above them. We’ll start with this post. This configuration forces the blue fence to separate the second sheep. The isolated cell makes it invalid.
This option does the same in reverse. The third possibility is more subtle. Note how the regions expand around the blue post. We still need to use the second line to divide this wolf and sheep. But the blue line can’t extend from this post in any direction without isolating cells. So we’ve completely eliminated the yellow post.
After placing the correct fence, we can eliminate these two options to extend it, as both create an empty region. The fence must extend upward. This post has only one configuration left. It will isolate cells, so we can eliminate it, and expand our regions.. After marking the eliminations, we must place this fence to divide this pair.
Completing Open Fences
It’s time to start completing open fences. If we extend down from this post, the bottom fence can’t turn without isolating a cell. So this fence must extend left. Similarly, extending the fence from this post downward means the bottom fence will isolate cells. It must also go to the left. This makes it easy to see the placement of the final fence. All of the sheep and wolves are separated, and we’ve completed the Yagit puzzle.