Sudoku Solver

Expert+

BUG Type 4

When a common value is locked to BUG cells in a shared region, eliminate other candidates from them.

BUG Type 4 is an advanced "uniqueness" strategy that combines the BUG (Bivalue Universal Grave) pattern with locked candidates logic. When exactly two BUG cells share a common value that is locked to them within a shared region, we know one of them MUST be that value—allowing us to eliminate their other candidates.

This strategy uses the fundamental Sudoku rule: every valid puzzle has exactly one unique solution.

Interactive Example

8
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
5
1 2 3 4 5 6 7 8 9
6
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
9
1 2 3 4 5 6 7 8 9
3
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
8
1 2 3 4 5 6 7 8 9
7
1 2 3 4 5 6 7 8 9
3
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
8
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
7
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
4
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
3
1 2 3 4 5 6 7 8 9
2
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
7
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
9
1 2 3 4 5 6 7 8 9
5
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
6
1 2 3 4 5 6 7 8 9
3
1 2 3 4 5 6 7 8 9
1
1 2 3 4 5 6 7 8 9
4
1 2 3 4 5 6 7 8 9
9
1 2 3 4 5 6 7 8 9
1
1 2 3 4 5 6 7 8 9
4
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
3
1 2 3 4 5 6 7 8 9
5
1 2 3 4 5 6 7 8 9
8
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
6
1 2 3 4 5 6 7 8 9
1
1 2 3 4 5 6 7 8 9
6
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
8
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
4
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
9
1 2 3 4 5 6 7 8 9
8
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
4
1 2 3 4 5 6 7 8 9
6
1 2 3 4 5 6 7 8 9
3
1 2 3 4 5 6 7 8 9

Click "Apply Logic" to see the strategy in action.

Real Example Walkthrough

In the example puzzle above, the solver identifies a BUG Type 4 pattern:

The Grid State: - Almost every unsolved cell has exactly 2 candidates (bivalue) - Two cells break the pattern by having 3+ candidates: - R8C5 (index 67): has candidates including 8 - R8C6 (index 68): has candidates including 8

The Key Analysis:

  1. Identify BUG cells: R8C5 and R8C6 both have 3 candidates
  2. Find shared region: Both cells are in Row 8
  3. Check for locked value: Where else can 8 appear in Row 8?
  4. Scanning Row 8: Value 8 appears ONLY in R8C5 and R8C6!
  5. Apply the logic: One of these cells MUST be 8 (standard Sudoku) + one MUST break BUG (uniqueness)
  6. Conclusion: One BUG cell will be 8, the other will be its extra value
  7. Eliminate: Neither cell can be their non-locked, non-extra values

Result: Eliminate other candidates from R8C5 and R8C6, leaving only the locked value (8) and their extras.

Understanding the Logic

What Makes Type 4 Special?

Type 4 uses two constraints simultaneously:

Constraint Source What It Tells Us
Locked Candidates Standard Sudoku One of {R8C5, R8C6} must be 8
BUG Breaking Uniqueness Rule One of {R8C5, R8C6} must be its extra

Since one cell takes 8 and one takes its extra, neither cell can be anything else!

The Double Lock

``` BUG Cell 1 (R8C5): {5, 7, 8} BUG Cell 2 (R8C6): {5, 7, 8}

Constraints: - One MUST be 8 (locked in Row 8) - One MUST be its "extra" (to break BUG)

If extras are 5 and 7: - Cell 1 = 8 → Cell 2 = 7 (its extra) ✓ - Cell 2 = 8 → Cell 1 = 5 (its extra) ✓

Either way, neither can be {5 if they're 8} or {7 if they're 8}... Actually, we can eliminate anything that's NOT (8 OR the extra)! ```

Step-by-Step: How to Apply Type 4

  1. Check for near-BUG state: Are almost all unsolved cells bivalue?
  2. Find exactly 2 BUG cells: Which cells have 3+ candidates?
  3. Find shared region: Are both BUG cells in the same row, column, or box?
  4. Identify locked value: Is there a value that appears ONLY in these 2 cells within that region?
  5. Verify non-extra: The locked value must NOT be an extra (it's a common value)
  6. Eliminate: Remove everything except the locked value and the extras from both cells

Visual Pattern

``` Row 8: C1 C2 C3 C4 C5 C6 C7 C8 C9 ┌─────┬─────┬─────┬─────┬───────┬───────┬─────┬─────┬─────┐ │ 2 │ 4 │ 3 │ 6 │{5,7,8}│{5,7,8}│ 5 │ 9 │ 1 │ │filled│filled│filled│filled│ BUG │ BUG │filled│filled│filled│ └─────┴─────┴─────┴─────┴───────┴───────┴─────┴─────┴─────┘ ↑ ↑ └───────┘ Where can 8 go in Row 8? ONLY in these 2 cells!

Constraint 1: One of them MUST be 8 (locked) Constraint 2: One of them MUST be its extra (BUG breaking)

∴ One is 8, one is its extra ∴ Neither can be anything else ∴ Eliminate non-8, non-extra candidates ```

Comparison with Other BUG Types

Type BUG Cells Key Mechanism What's Eliminated
Type 1 1 Single cell must be extra Non-extras from that cell
Type 2 2+ Same extra Shared extra from common peers
Type 3 2+ Different extras + Naked Subset Subset values from region
Type 4 2 Locked common value Non-locked, non-extra values

Type 4 vs Unique Loop Type 4

BUG Type 4 and Unique Loop Type 4 share the same core logic:

Strategy Pattern Scope What's Locked
Unique Loop Type 4 Specific loop (4-10 cells) One loop value in rescue cells
BUG Type 4 Entire grid A common value in BUG cells

Both use locked candidates to determine that one cell must take a specific value!

When Type 4 Applies

Type 4 requires all conditions: - ✅ Exactly 2 BUG cells (cells with 3+ candidates) - ✅ Both cells share a region (row, column, or box) - ✅ A common value (not an extra) appears in both cells - ✅ This value is locked to these cells in the shared region - ✅ There are other candidates to eliminate (beyond locked + extras)

When Type 4 Doesn't Apply

  • Only 1 BUG cell: Use BUG Type 1
  • More than 2 BUG cells: Try Type 2 or Type 3
  • No shared region: BUG cells in different rows/columns/boxes
  • No locked value: The common value appears elsewhere in the region
  • Nothing to eliminate: Cells only have locked value + extras anyway

The Key Insight

The power of Type 4 comes from combining two independent logical chains:

  1. Sudoku Logic: Value 8 is locked → one cell must be 8
  2. Uniqueness Logic: Pattern would repeat → one cell must be its extra

Since these are different cells (one handles each constraint), both BUG cells are completely determined: - One becomes the locked value - One becomes its extra - Nothing else is possible

Common Misconceptions

"The locked value is an extra"

No! In Type 4, the locked value is a common value shared by both BUG cells—it's NOT an extra. The extras are the values that break the bivalue pattern.

"I eliminate the locked value"

No! We KEEP the locked value (one cell needs it). We eliminate other non-extra candidates.

"Both cells become the locked value"

Impossible! They're in the same region. Only one can be the locked value. The other becomes its extra.

Connection to Locked Candidates

Type 4 is essentially a combination:

Concept Role in Type 4
BUG Pattern Proves one cell must be its extra
Locked Candidates Proves one cell must be the locked value
Combined Each cell's value is determined (either locked or extra)

If you understand Intersection (Pointing) or basic locked candidate logic, Type 4 will feel familiar!

Tips for Beginners

  1. Look for exactly 2 BUG cells: Type 4 requires precisely 2, no more, no less
  2. Check shared region: Both must be in the same row, column, or box
  3. Scan for locked values: Is there a value that can ONLY go in these 2 cells?
  4. Distinguish locked from extras: The locked value appears twice normally; extras break the bivalue state
  5. Eliminate confidently: Everything except locked + extras is guaranteed impossible

Why This Strategy Works

The uniqueness principle guarantees one and only one solution.

  1. Grid is almost BUG state (all bivalue except 2 BUG cells)
  2. BUG state → multiple solutions → impossible
  3. One BUG cell must become its extra (breaking BUG)
  4. The locked value must go in one of the BUG cells (standard Sudoku)
  5. Therefore: one cell = locked value, other cell = extra
  6. Neither cell can be anything else

It's the elegant intersection of uniqueness logic and standard locked candidate logic.

Related Strategies

BUG Family

Unique Loop Family

Related Intersection Strategies

Unique Rectangle Family