XYZ-Wing

StrmCkr’s XYZ-Wing

Overview

The XYZ-Wing family is a fascinating group of Sudoku techniques that can be crucial for solving puzzles. In this level, we will explore StrmCkr’s XYZ-Wing along with its two special forms: the XY-Wing and the XYZ-Wing .

The naming of techniques in the XYZ-Wing family is based on the size n , representing the number of cells involved. When n = 3 , it is called an XYZ-Wing ; when n = 4 , it is a WXYZ-Wing , and so on.

StrmCkr’s WXYZ-Wing

StrmCkr’s WXYZ-Wing is a technique proposed by the Sudoku enthusiast StrmCkr. It acts as an extension of the XYZ-Wing . Mastering this technique will make understanding the XY-Wing and XYZ-Wing much easier.

Let’s examine the core principle of StrmCkr’s WXYZ-Wing with an example.

StrmCkr's WXYZ-Wing Example 1

Observe the 4 cells marked with green candidates, labeled {A7, F7, A9, B9} . These cells contain the candidates {1, 3, 5, 9} . This means we have exactly 4 distinct candidates across 4 cells. This setup resembles a Naked Set , except that the cells are not confined to a single region.

Position of candidate 1 in StrmCkr's WXYZ-Wing Example 1

Let’s analyze the distribution of these candidates. Candidate 1 appears only in Box 7 .

We say that candidate 1 is restricted within the cell set {A7, F7, A9, B9} , meaning the number 1 can be placed at most once among these cells.

Position of candidate 5 in StrmCkr's WXYZ-Wing Example 1

Candidate 5 appears only in Row 7 , so 5 is also restricted .

Position of candidate 9 in StrmCkr's WXYZ-Wing Example 1

Candidate 9 appears only in Box 7 , so 9 is likewise restricted .

Position of candidate 3 in StrmCkr's WXYZ-Wing Example 1

What about candidate 3 ? There is no single region that contains all instances of candidate 3 . Thus, 3 is unrestricted , meaning it could potentially be placed multiple times.

Now for the core logic:

These 4 cells must eventually contain 4 numbers. We know 1 , 5 , and 9 are restricted , meaning they can each be placed at most once. Therefore, the unrestricted candidate 3 must be placed at least once.

Why must 3 be placed at least once? Let’s prove it by contradiction. Suppose 3 is not placed at all. Then, these four cells would have to be filled by {1, 5, 9} . However, since these three numbers are restricted (max one occurrence each), they can fill at most three cells. This would leave one cell empty, rendering the puzzle unsolvable. Thus, our assumption is false, and 3 must be placed at least once.

Consequently, any cell that can see all cells containing candidate 3 in this set can have 3 eliminated from its candidates.

Cell B7 sees all cells containing candidate 3 , so the 3 in B7 can be eliminated.

Generalization

Generally, StrmCkr’s XYZ-Wing is defined as follows: In a set of n cells containing n distinct candidates, if n - 1 candidates are restricted and only 1 is unrestricted , the pattern is called a StrmCkr’s XYZ-Wing .

We usually denote this unrestricted candidate as Z . We can deduce that Z must be placed at least once within these n cells.

XYZ-Wing

The XYZ-Wing is a special case of StrmCkr’s XYZ-Wing where n = 3 .

Characteristics of XYZ-Wing

  1. A pivot cell containing candidates {X, Y, Z} .
  2. The pivot cell sees two other cells, containing candidates {X, Z} and {Y, Z} respectively.
  3. These 3 cells are not in the same region.

Let’s look at an example:

XYZ-Wing Example 1

Here, B5 is the pivot cell, while C4 and G5 are the other two cells.

Why is the XYZ-Wing a special case of StrmCkr’s XYZ-Wing ?

Observe this example. The 3 cells {B5, C4, G5} are not in the same region but share 3 candidates {1, 3, 5} . Among them, 1 and 3 are restricted , while 5 is unrestricted , fitting the definition of StrmCkr’s XYZ-Wing .

Therefore, 5 must appear at least once in these 3 cells.

Consequently, the 5 in cells A5 and C5 can be eliminated because they see all cells containing 5 .

XY-Wing

The XY-Wing is also a special case of StrmCkr’s XYZ-Wing where n = 3 .

Characteristics of XY-Wing

  1. A pivot cell containing candidates {X, Y} .
  2. The pivot cell sees two other cells, containing candidates {X, Z} and {Y, Z} respectively.
  3. These 3 cells are not in the same region.

The only difference between an XYZ-Wing and an XY-Wing is that the pivot cell in an XY-Wing does not contain Z .

Let’s look at an example:

XY-Wing Example 1

Here, F2 is the pivot cell, while D1 and F8 are the other two cells.

We won’t detail why the XY-Wing is a special case of StrmCkr’s XYZ-Wing as it follows similar logic to the XYZ-Wing .

According to the logic of StrmCkr’s XYZ-Wing , the only unrestricted candidate 4 must be placed at least once in these 3 cells. This means either D1 or F8 must be 4 .

Therefore, the 4 in cells D8 and F3 , which can see both D1 and F8 , can be eliminated.

Obiwahn’s XYZ-Wing

Let’s learn Obiwahn’s XYZ-Wing with an example. Please ensure you have mastered StrmCkr’s XYZ-Wing.

Obiwahn’s XYZ-Wing is also known as Distributed Disjoint Subsets.

Obiwahn’s UVWXYZ-Wing

Obiwahn's UVWXYZ-Wing Example 1

In the cell set {G4, B5, I5, A6, H6, I6}, there are candidates {1, 3, 4, 5, 6, 8} (green candidates in the image).

This cell set is not in a single region, and the number of cells equals the number of candidates, which is 6.

Additionally, we observe that all these candidates are restricted.

This means each candidate must be placed exactly once (similar to Naked Set ).

Why?

Let’s prove it by contradiction. We know each of these candidates can be placed at most once. Suppose there is at least one candidate in {1, 3, 4, 5, 6, 8} that is not placed at all in the cell set {G4, B5, I5, A6, H6, I6}. Then, the other candidates can fill at most 5 cells, leaving 1 cell empty, which makes the puzzle unsolvable. Thus, the assumption is false, meaning each candidate must be placed at least once. Since each candidate can be placed at most once, each candidate must be placed exactly once.

Then, we can eliminate candidates one by one.

For example, candidate 1 appears in cells {G4, I5}. Therefore, candidate 1 in any cell that can see both of these cells can be eliminated, meaning the 1 in I4 can be eliminated.

The same applies to other candidates. The red candidates in the image represent all candidates that can be eliminated.

Theory of General XYZ-Wing (Optional)

Definition of General XYZ-Wing

Given a cell set CC which is not a subset of any single region, with candidate set SS, where C=S|C| = |S|. And there exists at most one candidate zz, zSz \in S, such that there are at least 2 cells in CC containing candidate zz that cannot see each other. This pattern is called a General XYZ-Wing.

This definition covers all cases including StrmCkr’s XYZ-Wing and Obiwahn’s XYZ-Wing.

Case 1: z Exists

Theorem 1: Given a cell set CC which is not a subset of any single region, with candidate set SS, where C=S|C| = |S|. There exists exactly one candidate zz, zSz \in S, such that there are at least 2 cells in CC containing candidate zz that cannot see each other. Then at least one cell in CC must contain zz.

This is the case of StrmCkr’s XYZ-Wing.

Proof: We know that cells containing other candidates can see each other, meaning other candidates can be placed at most once in CC.

Assume zz is not placed in CC.

Then we can place at most n1n-1 distinct numbers.

But we have nn cells to fill, so at least one cell cannot be filled with any number.

This contradicts the Sudoku rule that we must fill all cells.

Therefore, the candidate zz must be chosen in one of the cells.

Corollary 1: If a cell can see all cells in CC that contain candidate zz, then candidate zz in that cell can be eliminated.

Case 2: z Does Not Exist

Theorem 2: Given a cell set CC which is not a subset of any single region, with candidate set SS, where C=S|C| = |S|. There is no candidate zz, zSz \in S, such that there are at least 2 cells in CC containing candidate zz that cannot see each other. Then in CC, each number in SS is placed exactly once.

This is the case of Obiwahn’s XYZ-Wing.

Proof: Since we have nn cells and nn candidates, and each candidate can be placed at most once, each candidate must appear exactly once to fill all cells.

You may have noticed that this is very similar to a Naked Set.

Corollary 2: For each candidate siSs_i \in S, if a cell can see all cells in CC containing candidate sis_i, then candiate sis_i in that cell can be eliminated.