How to Solve Heyawake Puzzles

Heyawake (HAY-ah-wah-kay), first appeared in 1992 in Nikoli magazine in Japan. Interestingly, they translate it as Divide Into Rooms, although the rooms are already given, and what you will be doing to solve it is blackening certain cells.

Because the solved puzzle is made up of black and white cells, I decided to start with a colored grid, and turning cells black or white for this tutorial, rather than just marking white cells with an X.

  • The goal is to blacken a number of cells in each region as indicated by the number clues. If a region has no number, it may have any number of black cells, including zero.
  • A straight line of white cells may not cross more than 2 regions. (i.e., it may cross at most one boundary)
  • A black cell may not be directly adjacent to another black cell horizontally or vertically, although diagonally is permitted.
  • When complete, all white cells must form a single area that is orthogonally contiguous.

To start, look for certain areas that are easy to deduce. Here, we have a couple of regions with 0 for a clue, so we know they only contain white cells. Other easy starting regions are:

  • A single-cell region with a clue of 1 – black, obviously.
  • A 3×1 region with a clue of 2 – because of the adjacency rule, it has to be B-W-B.
  • A 5×1 region with a clue of 3 – again, due to black cells not being allowed to be orthogonally adjacent, it has to be B-W-B-W-B.

And here we have a more visual example of an easy starting region, this 3×3 area with a clue of 5. As you can see, there is only one way to fit 5 blackened cells in this region without any of them being horizontally or vertically adjacent.

Also because of that adjacency rule, we know that all of the cells in each of the 4 horizontal and vertical directions around each black cell must be a white square, so we’ll go ahead and fill those in.

Now, notice these white cells. Because all white cells have to form a single orthogonally contiguous area, none of the spaces the arrows point to can be black. To do so would isolate that white cell from all the others.

Essentially, a white cell cannot be completely surrounded by black cells – it must always have a way out along a horizontal or vertical path. So all three of the spaces being pointed to here must be white.

Next, we’ll look at straight lines, or stripes, of white cells. The rules of Heyawake state that a stripe of white cells may not connect more than 2 regions. That is, they may not cross more than one boundary.

Here you see 5 stripes of white, and the arrows all point to a second boundary line. That means that just across that second boundary, the cell the arrows are pointing at must be black.

Also, even if the green arrow hadn’t been pointing to it, the cell just behind the yellow arrow would still have to be black, because otherwise the white stripe would connect to the region that had a clue of 0.

So again, we’ll fill out the black cells, and surround them with white.

In this region, there must be a total of 3 blackened cells. We already have 1, so there must be 2 more filled in out of the cells highlighted yellow. Because no two black spaces can be orthogonally adjacent, they must be the two cells in the upper left and lower right of the highlighted area.

This is another good pattern to remember. In a 2×3 area with a clue of 3, you will always end up with a triangle of black cells pointing to one or the other of the long sides. Once you know any one cell in the area to be black or white, you can fill in the rest of the region.

While we’re at it, there’s only a single unknown cell left in the 2×2 region with a clue of 2 at the bottom of the grid, so it has to be black.

One more tiny step we can be certain of is that this cell can’t be black, because if it were, it would isolate the white cell to its left.

At this point, it may appear that we don’t have a next move without having to start trying options and seeing if we can reach a contradiction to definitively say it must be the other color.

While this type of trial and error work is part of the nature of many logic puzzles, sometimes we can find something by looking elsewhere in the grid, instead of the area we’ve been working in up until now.

Let’s look at thesse two regions in the corner. Each of them is a 2×2 area with a clue of 2, which means they will have to result in a checkerboard-type pattern. Each will blacken either both pink squares, or both green squares.

However, in each case, notice that if you blacken both pink squares, it would mean that one of the green ones (which would have to be white) would then be isolated in the corner, cut off from the rest of the white cells.

This means that in both of these regions, the green spaces are the ones that must be black.

This allows us to move forward a little bit more. None of the pink cells can be black, because they would isolate a white cell.

Then, notice the yellow cell is between two white ones in separate regions. If we made it white, it would form a stripe of white spaces that crossed 2 boundaries to connect 3 regions, which is not allowed.

So we know the yellow cell must be black.

There’s a couple of things to discuss in this diagram. First, at the bottom right, notice the 2-cell long white stripe that also covers 2 regions? This means that the space the purple arrow is pointing at must be black, which will also solve that 3×3 region with the clue of 2.

Over on the left, I’m testing to see where the second black space in the region with a clue of 2 can be. If we place it in the cell I colored dark blue, it would require the light blue cells to be white.

The two cells at the bottom of the column would be white because the region had both black spaces found, and the one immediately above the black space would be because of the adjacency rule forbidding black spaces directly next to each other. The top light blue cell would have to be white because if it were black, it would isolate a group of 5 white cells.

But notice the orange arrow, showing we just created a long stripe of white cells across two regions. This would require that the next cell be colored black, and that would isolate that whole area of white cells.

Therefore, the sequence of colors we just tried isn’t correct, and the space we marked in dark blue must actually be white.

We have a similar situation if we place the black cell here. By necessity, the light blue cell at the top would have to be white in order to create an escape route for the group of white cells that is currently cut off from the rest of the grid at the bottom.

When we do that, however, the orange arrow shows us that we’ve again created a white stripe that crosses two regions, which requires us to blacken the cell in the top corner, and again, that cuts off the entire group from the rest of the white spaces in the puzzle.

So the dark blue cell must be white, and the light blue square below it is the correct second black cell in the region.

When you think you might be stuck, try looking at the grid as a whole. Notice that these yellow cells are our currently contiguous group of orthogonally-connected white cells.

Based on the placement of known black cells, they are very nearly cut off from the rest of the grid. This lets us test whether a cell can be blackened and cut off one path – we use a dark blue cell to show a potential blackened square on the right.

This forces the same escape route in the upper left, which leads to the same problem – the next forced black cell would cut off the entire group. So again, the dark blue cell must be white.

Now we can relax for a couple of easy next steps.

First, we created a white stripe over 2 regions, so the next cell has to be black.
And then the yellow space must be white, to avoid isolating the group below it.

After that, there will only be two possible cells remaining in that large region on the right that had the clue of 2. So we’ll first try blackening the dark blue cell.

It will require the light blue cells to be white, which means the dark green cell would have to be black to satisfy the small region with the clue of 1.

Then that creates a short stripe of white cells across two regions (notice the light green cell would be white), which would force the dark purple space to be black.

This again blocks off that contiguous area of white cells from the left side of the grid, which leads to the pink cell needing to be white to provide an escape, and then again, we run into our old friend, the required black cell that completely isolates half the grid.

So after all that, we know the dark blue cell must be white, which means the cell to its right has to be the black one to complete the region.

Really quickly, we’re going to figure out that region with a clue of 1. First, we’ll try blackening the left cell with dark blue, which makes the light blue cells white.

That gives us a white stripe which forces the dark green cell to be black.

By now you know this dance – the black cells on the right cut off an escape, which requires the light green cell to be white to allow a path out, and then it creates a stripe that forces a black cell which cuts off the group again. Therefore the black cell in the 1 region must be on the right.

Now that we’ve figured that out, we’ve created a white stripe that will force the cell the purple arrow is pointing at to be black.

Then, the yellow cell will have to be black, because there are only three cells left in this region with a clue of 2, and two of them are orthogonally adjacent, so they can’t both be black.

Next, we see that this cell can’t be black, because it would isolate the white cells to the right.

So we’ll set it to white, and the final cell in the region can safely be blackened.

After filling that in, we had several un-clued regions, and most of the spaces still open in that long region with a clue of 2 at the top of the puzzle, so I looked for a square to test that would affect many other squares.

In the yellow-highlighted cell, I saw that if it were white, it would cause a cascade of reactions. First, it creates a white stripe over two regions (the purple arrow), which forces a black square (dark blue).

By filling in the white cells around that (light blue), we create another white stripe (the green arrow), forcing another black square (dark green).

Then, filling in the white cells for that space (light green), we create another white stripe (the orange arrow) which forces the dark purple square to be blackened.

That chain reaction would isolate the light blue cell (which was white, remember), at the middle of the top row. This isn’t allowed, so the yellow cell we started with must actually be black, not white.

Moving on, we have another opportunity to close off the white cells in the bottom half of the puzzle by blackening the dark blue square.

As we’ve seen over and over now, that forces the light blue cell to be white, and that white stripe requires a black cell above the orange arrow.

That isolates that whole group of white cells again, so once more time, the dark blue space actually has to be white. This will form a white stripe over two regions, so the cell just to its left will need to be black.

Once we’ve filled in the required white cells from that new black one, we now have a stripe across two regions again, which means the cell above the orange arrow must be black, and the cell to the left of that has to be white. Then that leaves only once cell in the region, which will have to be black to complete the clue.

And this is where I appreciate the story told by certain puzzles. After that space with the 2 in the very top left corner has turned us back a total of six times while we’ve been solving this puzzle, we now discover that it needed to be black this entire time.

Finally, we have to look in the other direction, where the yellow cell will need to be white in order to connect with the rest of the orthogonally contiguous white cells.

Then, the space below it will need to be blackened, because otherwise, you would form a long white stripe connecting three regions, as shown with the orange and blue arrows.

And there you have it!  The completed puzzle.

Similar Posts