Strategies of Hexakai


Introduction

If you're new to the game of Hexakai, welcome! The page on rules introduces this game and briefly describes how to play and how to use this app. If you already know how to play and are interested in learning strategies to help improve your gameplay, this is the page for you.

This page contains a collection of all of the strategies I've developed personally while creating and playing this game. These strategies have enabled me to conquer games of all sizes and difficulties, including the behemoth of Hexakai at ultra-difficult on the largest board size of 16. Nonetheless, I'm sure there are strategies not contained within these sections, so I encourage you to try and develop your own strategies, and if you do, I'd love to hear about it!

The Concept of Strands

All of the strategies are based on the concept of Hexakai strands. A strand is a collection of cells that forms either a full diagonal, or the full center row. Note that it does not include non-center rows.

Fundamental Strategies

The strategies outlined in this section are based on elementary concepts and apply to all levels of difficulty in the game. If you learn and apply these strategies, you should be able to beat every game rated easy and some games rated medium.

Single-Cell Strategy

If all but one cell in a strand have a cell assignment, you can directly infer the assignment for that last cell in the strand without the need to look at any other cell on the board. Determine which value is missing from that diagonal or row and assign it to that cell.

This is a close-up of a board of size 10, zoomed in on the center row. Try to determine the value of this cell using only what you see in this row of cells.

The missing value is . It can be challenging at first to read over a row or diagonal and memorize everything that’s there, or notice what isn’t there, depending on how you think about it. As you play and improve at the game, this process will become much faster and more automatic.

Single-Strand Strategy

Sometimes, when there are two, or even more than two, cells remaining, you can determine which cell, or cells, definitely can’t have one or more values, and from there, use the process of elimination to make definite assignments. Unlike the previous strategy, you will need to look at intersecting rows and diagonals to rule out possibilities. In some cases, you won’t be able to make any assignments just from this strategy. In others, you’ll be able to make one or more, but not all. Sometimes you can make all assignments. It all depends on the current state of the rest of the board.

This example uses a smaller version of a Hexakai board. I’ve used a game of size 5 instead of size 10 to make it easier to follow along. The range of cell values is to . Try to determine the values of the two missing cells marked with “X.”

The missing values, from top down, are and . We don’t have enough information from each diagonal or row individually to make assignments, but we can use intersecting diagonals to help us.

Let’s start by looking at the diagonal that has both X cells. We know that neither cell can be assigned values , , or , because other cells in that diagonal have those values. This leaves and . There isn’t enough information in this diagonal to know which cell gets which.

Now, let’s look at the diagonal that intersects the first X cell. This diagonal has a value of 4, which means that the X cell itself can’t be assigned . The only value remaining is , so we must assign a value of to that cell. That leaves a value of for the other cell.

Star Strategy

In most cases, the single-cell and single-strand strategies will not be sufficient to make definite assignments. You'll need to combine all of the information that is readily available in the intersecting diagonals and the intersecting row. For example, if you were to focus on a cell in the center of the board, then remove all cells that are not in its intersecting diagonals and row, the remaining cells will resemble the shape of a star. If enough cells are present, there's a good chance you'll have enough information to rule out all but one possibility.

Try to determine the values of the two missing cells marked with X. You already have enough information from the cell values present here to do so; you won’t need to solve any other part of the board first.

The missing value is . In that row, there are only three cells instead of five. Two of those have values and , which leaves three remaining possibilities: , , or . If you then look at the intersecting diagonal from the top left to the bottom right, you see it has and . These together leave only one possibility: .

Neither the row nor the diagonals, by themselves, would have been sufficient to give this information. However, by combining them, we were able to find the missing cell value.

Intermediate Strategies

The strategies outlined in this section are based on concepts that are more complex than those in the previous section. If you learn and apply these strategies, you should be able to beat every game rated medium, some rated difficult, and will even help you gain headway into some games rated ultra-difficult.

Cell Cluster Strategy

Every cell that isn’t on the border of the board touches six other cells. If an empty cell touches six cells that are already assigned, you can infer from those cells that there are only four remaining possibilities, just from that small region. You will likely be able to reduce this further by looking at the row and diagonals this cell intersects. Unlike other strategies, this one is focused more on the local cluster than on entire rows and diagonals as separate units.

In this example, we’ll focus on a board of size 5. Can you determine which value to assign to the X cell from what is in this board?

The value to assign is . The X cell is touching cells with values , , and , leaving only and as its possible values. In the diagonal down to the right, the is followed by a , leaving as the only remaining possibility. This is a simplified example on a small board, a board size where the size of a cluster is not much smaller than the size of the board itself, proportionally speaking. On more typical board sizes, such as 10, clusters may play a much more crucial role.

This strategy closely resembles the star strategy. I've included this as its own strategy because I find the mental model of the cluster gives a utility of its own. Thinking in terms of clustering can sometimes help you identify situations where it can be applied faster than thinking only in terms of the star strategy.

Value-Centric Counting Strategy

This strategy significantly diverges from the other strategies we discussed, as it focuses on a single value across the entire board, as opposed to focusing on single cells within single, or intersecting, rows and diagonals. To apply this strategy:

  1. Count how many times each value occurs on the board and note the value that occurs the most frequently.
  2. Pencil in possible assignments in every unassigned cell that could also be assigned the value, even if there are multiple possible values in each row or diagonal. If you’re playing a printed puzzle, mark these cells with an asterisk. If you’re playing on the Hexakai website or app, assign a color to these cells or use the pencil marking feature.
  3. Look at each diagonal and see if any of them have this value exactly once. Note that each cell belongs to two columns, so be sure to check in both directions. Also, check the center row to see if any values appear there exactly once.
  4. If you’ve identified any diagonals, or the center row, as having exactly one possible assignment for this value, you can definitively make the assignment, because each diagonal, and the center row, must have each value exactly once. Then, erase other possible values that are on intersecting rows or columns.
  5. Repeat steps 3 and 4 until you’ve identified all cells that have this value, or you can’t eliminate any more possibilities. In some cases, there’s enough to work with to fully coalesce until you find all cells on the board that should be assigned that value.

Let’s consider a real example. In the boards below, we’ll look at a board of size 10 that is rated ultra-difficult. In the board below, all cells that can possibly be assigned have been marked with an X.

On the board below, we’ve followed the crucial steps 3 and 4 above, making definite assignments in diagonals that have the possible assignment exactly once, removing Xs where assignments are no longer possible, and repeating them. I’ve left the unassigned s on the board below so you can see which cells were assigned and which ones were not. Try to follow along and see how each possibility was determined, then either eliminated or made definite.

In this example, we were able to find all remaining cells that have a value of . In some cases, you might not be able to eliminate all possibilities, and in some, you might not be able to eliminate any at all. It depends on the particular circumstances of the board you’re working on and the progress you’ve made so far.

Lonely Possibility Strategy

Consider a strand that whose cell possibilities are penciled in. If any possible values appears exactly once, the cell which has this possibility must have that assignment, even if other possibilities are penciled in. Despite the simplicity of this strategy, it can be difficult to spot when you can apply this, especially on larger boards. Use this strategy by penciling in all potential values for the cells within a strand, then check each possible value across the cells to see if any of them occur exactly once. If you find one, you can immediatley make the assignment.

Invariants

Before we dive into the advanced strategies, let's briefly discuss the game's invariants. An invariant is a property of the game that will always remain the same under all boards and difficulties. This section doesn't contain strategies, but pieces of information you can use to make decisions about which strategies to use or rule out potential bad assignments. If you ever find that an invariant is violated, you've made a bad assignment at some point during your game.

Small Row Invariant

The center row of a board of size 10 is the only row that has 10 cells. Every other row has fewer cells, which means that, unlike strands, every non-center row does not have enough cells to contain every possible value. The rows immediately above and below the center row will each be missing one value, followed by two, then three, etc., until we reach the top and bottom cell of the board, which will each be missing all but one value.

Value Count Invariant

On a board of size 10, each value - will appear exactly 10 times on the board. Generalizing this, in a game of size n, each value will appear exactly n times.

Non-Center Row Invariant

The center row is the only row that has enough cells to include each possible value. The row immediately above will miss exactly one value, as will the row immediately below. Each subsequent row will miss an additional value.

Strand Possibility Count Invariant

Consider a strand that whose cell possibilities are penciled in. The number of distinct pencil values across the strand must be greater than or equal to the number of cells yet to be assigned within that strand. If this invariant is ever violated, it would be impossible to assign values to every cell in the strand, as the possible assignments remaining would be consumed before all cells were assigned.

This invariant is useful as an indicator. If you ever find yourself in a state where this invariant is broken, you've already made a mistake somewhere on the board, one which necessarily leads to a contradiction. If you were to proceed with solving the board and assign each of the cells, you'd certainly find that one has no possible values remaining. Finding this via this invariant can save you a significant amount of time.

Cell Constraints Invariant

A constraint is a limitation of possible assignments a cell can receive. Each cell on the board is constrained by other cells according to the rules of the game (i.e., no rows or diagonals can have duplicate values). Conversely, each cell constrains a number of other cells. Understanding the number of constraints each cell has and imposes will help you utilize the intermediate and advanced strategies more effectively and complete the board faster.

Not all cells are constrained equally, and not all cells constrain equally. However, each cell constrains and is constrained by the same number of cells. In a board of size 10, the topmost cell and bottommost cells each constrain (and are constrained by) 18 other cells, nine in each diagonal it belongs to. In the next row, down and up respectively, each cell constrains 19 other cells, 18 from the diagonals and one more for the other cell in its row. Each cell in each subsequent row contains one more cell than the previous. In the center row, each cell constrains 27 other cells, 18 for its intersecting diagonals, and another 9 for the other cells in the center row.

Generalizing this, for a game of size n, the top and bottom cells constrain 2n-2 cells, incrementing by one in each row approaching the center, and cells in the center row constrain 3n-3 cells. This property always holds, regardless of game size, difficulty, number of hidden cells, etc.

When a cell is assigned, none of the cells it constrains can receive that value. For example, if I assign a value of to the top cell, none of the cells on the top left or top right strand can have an assignment of without violating the rules of the game. If that were on a board of size 10, that assignment would have eliminated 18 possibilities. However, if we were to assign that value in the center board, 27 possibilities would have been eliminated. Therefore, assigning values closer to the center of the board generally has a bigger impact on the rest of the board. This is a good rule-of-thumb, but doesn't always hold, as its overall effectiveness will depend on the particulars of the board in question.

Advanced Strategies

The strategies outlined in this section are based on concepts that continue to build upon previous strategies. These apply to boards rated difficult and ultra-difficult. If you learn and apply these strategies, you should be able to beat every game of Hexakai you encounter, so long as you are diligent in your approach and disciplined in your execution.

Strand Possibility Symmetry Strategy

Consider a strand that whose cell possibilities are penciled in. If two cells share the same two possibilities, no other cell in that strand can have either of those two values as possibilities. This is the case because, between those two cells, one must receive the first value and the other must receive the second, so no matter how they are assigned, no other cell in the strand can receive any of those values. This can be generalized to triplets, quadruplets, etc. If n cells share the same n possibilities, no other cell in that strand can have any of those n possible values.

You can apply this strategy by penciling in all possible values for every cell in a strand, then look for matching cells that have the same n possibilities. If you find any, you can immediately remove those possibilities from every other cell.

Constraint-Centric Value Elimination Strategy

This strategy is an extension of the value-centric counting strategy. Instead of determining which value to work on based solely on how frequently it occurs, you will also factor in which rows and diagonals are nearly completed, count the number of occurrences of the missing values within the row or diagonal you’re focusing on, and make a decision as to whether or not to focus on the value that occurs most overall or focus on one of the missing values within that row or diagonal. In some cases, this can save time over the value-centric counting strategy, and in other cases, it can work well when the value-centric counting won’t work at all.

In the board below, if you count the number of occurrences of each value in the left board, you’ll find that appears most often. If we were to use the normal value-centric counting strategy, we would immediately proceed with that value and would most likely be able to determine most assignments. However, in this example, we're going to mark off possible assignments of instead.

Notice that the diagonal that starts on the top cell and moves down to the left (i.e., the first cell has a value of and the last has a value of ), there already exists a cell with an assignment of . Furthermore, that diagonal only has three cells with no assignments. Those three cells will be more constrained by this diagonal and their intersecting diagonals and rows, so we might be able to make assignments for values that appear less frequently on the board within those cells. If so, that would be completing a major step towards finishing the board. is one of the potential missing values, so we've marked off our board with Xs to indicate potential assignments of s instead.

The missing values in that diagonal are , , and . Of those, the value appears most frequently on the board, so we can proceed with that instead, in the hopes of at least making a definite assignment within that diagonal. In the right board, I’ve added possible assignments of as Xs to all cells on the board that could potentially have that value. Notice that there is only one cell in the top left diagonal that has a possible value of . Since no other values in that cell can have an assignment of , we can immediately set this value, propagate that in its intersecting diagonal, and continue to coalesce.

The board below shows the definite assignments for the remaining cells that have a value of . In this case, we were able to find all remaining cells, but more importantly for this strategy, we were able to assign one of the three empty cells in the top left diagonal, allowing us to continue by re-applying this strategy, or by using different strategies, for the remaining two cells.

This strategy combines the global approach of value-centric counting with the local approaches of single-cell, single-strand, cell cluster, and other strategies previously discussed. It can be very helpful in situations where these strategies alone are not sufficient.

Triangular Elimination Strategy

This strategy is an extension of the value-centric counting strategy that adds an additional step that focuses purely on the relationships between possible assignments. If a diagonal, or the center row has exactly two possible assignments of a given value, it may be possible to eliminate other possible values in cells that lie in the intersection of the two diagonals that intersect each cell in the original diagonal / center row.

Consider this board of size 10 in ultra-difficulty-mode. Here, I’ve already marked all cells that can possibly have an assignment of with Xs, and one with Z. There are a few ways we can proceed here, so we’ll focus on the Z cell to demonstrate the triangular elimination strategy.

A triangle can be formed from the Z cell by selecting the cell that is two to the left, then the cell that is two to the bottom right (that is, the bottom left of the Z cell). The two X cells are the only two in their diagonal that can be assigned a value of . If we were to set a definite assignment of on the Z cell, it would be impossible to assign any of the other two cells in that triangle, which would make it impossible for that diagonal to have a value of . Therefore, we can eliminate the Z cell as a candidate cell for the value .

In this case, once we eliminate that cell, there is only one other cell in that diagonal, so we can assign that remaining cell and coalesce from there. In some cases, triangular elimination can coalesce into other triangular eliminations. As you use this strategy, you will begin to be able to naturally visualize the triangles and find the 3rd corners.

You can also use this strategy without explicitly marking all cells which can potentially receive any given value. If you already know that a particular diagonal only has two cells which can possibly be assigned the value, you can remove the possibility from any of the other two cells that can be used to form a triangle with the two cells in the diagonal.

Heuristic Tentative Assignment Strategy

In some rare cases, you may find that you have no way to assign any cell values with certainty, even when using the strategies above. You may have one or more cells that you’ve narrowed down to only having two possible values, or you may have discovered that a certain diagonal or middle row has exactly two cells that can receive an assignment of a particular value, but you can’t do anything to narrow it down further.

If you find yourself in this situation, you will need to choose which cell to assign based on a heuristic, a type of strategy based on your mental models of the game you’re currently playing as well as the nature of the game itself.

These are the heuristics I most commonly apply:

If a tentative cell assignment is incorrect, you are guaranteed to eventually reach a contradiction, a scenario in which you have no valid assignments remaining for one or more cells. As soon as this situation arises, you’ll know that the value of the cell you’ve tentatively assigned was incorrect. You’ll need to go back and undo subsequent assignments, but the good news is that you’ll have confirmed the assignment is incorrect, and every subsequent possible assignment in that scenario becomes more likely, or if there is only one remaining, becomes a certainty.

Note that on boards of larger sizes and difficulties, especially on boards beyond size 12, the heuristic tentative assignment strategy has a much smaller chance of having enough of an impact to arrive at a contradiction if the assignment is incorrect, or proceed with solving the rest of the board if it is correct. You might be tempted to proceed by making a second, third, fourth tentative assignment, but I would recommend avoiding this approach. Every time you make a tentative assignment, you introduce a branch, and the number of branches increases geometrically as you add tentative assignments to boards that already have tentative assignments, and the chances that you're on the correct branch diminishes accordingly. If you encounter a situation where a tentative assignment is inconclusive, try other assignments on that cell, or try the value you assigned elsewhere in the row or strand. In general, it's far better to use a single tentative assignment in conjunction with other strategies than to make nested tentative assignments.

Heuristic Possibility Elimination Strategy

This strategy is similar to the heuristic tentative assignment strategy, but its goal is to eliminate possibilities, not to make definite assignments. Instead of making a tentative assignment in the hopes that the value you've selected is correct, make a tentative assignment to a cell that you believe is likely to lead to a contradiction. If it fails to do so, then it's either the case that you've actually assigned the correct value, or you will eventually reach a state of ambiguity, where you cannot proceed without making a second tentative assignment, which is inadvisable with this strategy as well as the previous. If this happens, undo the tentative assignment and continue with other tentative assignments or other strategies.

This strategy provides a slow-but-sure way of chipping away at possibilities and making progress toward solving the board, so long as it is used in conjunction with the previous strategies discussed. I made extensive use of this strategy while working on the behemoth.

Similarities to Sudoku

The fundamental strategies, and some of the other strategies discussed here, are analogous to some Sudoku strategies. Others are not. For example, the triangular elimination strategy has no analog in Sudoku because Sudoku has a single column constraint instead of two diagonal constraints. However, if you're a Sudoku player, you may be able to adopt strategies that don't precisely fit into Hexakai by making small alterations, or by using them as mental models to find patterns even if they don't quite conform to the unique gameplay of Hexakai.