Sudoku Solver

Expert+

BUG Type 3

When BUG cells' extras form a Naked Subset with other cells in a shared region, eliminate subset values from the region.

BUG Type 3 is an advanced "uniqueness" strategy that combines the BUG (Bivalue Universal Grave) pattern with Naked Subset logic. When BUG cells have different extra candidates that together form a Naked Subset with other cells in a shared region, we can eliminate those values from the rest of the region.

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

Interactive Example

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
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
7
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
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
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
1
1 2 3 4 5 6 7 8 9
2
1 2 3 4 5 6 7 8 9
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
2
1 2 3 4 5 6 7 8 9
8
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
6
1 2 3 4 5 6 7 8 9
3
1 2 3 4 5 6 7 8 9
4
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
7
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
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
5
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
1 2 3 4 5 6 7 8 9
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
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
8
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
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
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
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
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
6
1 2 3 4 5 6 7 8 9
7
1 2 3 4 5 6 7 8 9
1
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 3 pattern:

The Grid State: - Almost every unsolved cell has exactly 2 candidates (bivalue) - Multiple cells break the pattern by having 3+ candidates (BUG cells) - These BUG cells are in Row 6 (indices 46, 47, 48)

The Key Analysis:

  1. Identify BUG cells: Cells at indices 46, 47, 48 in Row 6 have extra candidates
  2. Identify extras: The combined extras from BUG cells include {4, 7}
  3. Find helper cell: Cell at index 45 in the same Row contains {4, 7}
  4. Form Naked Pair: BUG extras {4, 7} + helper cell {4, 7} = Naked Pair!
  5. Eliminate: Remove 4 and 7 from other cells in Row 6 (indices 49 and 52)

Result: Eliminate 4 and 7 from R6C5 (index 49) and R6C8 (index 52).

Understanding the Logic

The "Virtual Cell" Concept

Just like in Unique Loop Type 3, we treat the BUG cells' combined extras as a virtual cell:

  • BUG cell 1 has extra: 4
  • BUG cell 2 has extra: 7
  • Virtual cell contains: {4, 7}

This virtual cell can participate in Naked Subset logic!

How the Naked Subset Forms

Component Candidates Role
Virtual cell (BUG extras) {4, 7} Part of subset
Helper cell (index 45) {4, 7} Part of subset
Naked Pair {4, 7} 2 positions, 2 values

The logic: - At least one BUG cell MUST take an extra value (to break the BUG pattern) - Combined with the helper cell, values 4 and 7 are "locked" to these positions - Other cells in the row cannot have 4 or 7

Step-by-Step: How to Apply Type 3

  1. Check for near-BUG state: Are almost all unsolved cells bivalue?
  2. Find BUG cells: Which cells have 3+ candidates?
  3. Check for different extras: Do BUG cells have DIFFERENT extra candidates?
  4. Find shared region: Are BUG cells in the same row, column, or box?
  5. Combine extras: Union of all extras forms a "virtual cell"
  6. Find helper cells: Look for cells with only these values
  7. Form Naked Subset: Virtual cell + helpers = Naked Pair/Triple/Quad
  8. Eliminate: Remove subset values from other cells in the region

Type 3 vs Type 2

Aspect Type 2 Type 3
BUG cell extras Same value in all Different values
Elimination mechanism Common peers lose the shared extra Naked Subset eliminates from region
Helper cells needed No Yes (to complete the subset)
What's eliminated The shared extra All subset values

Type 2: Same extra → eliminate from common peers Type 3: Different extras → form subset → eliminate from region

Visual Pattern

``` Row 6: C1 C2 C3 C4 C5 C6 C7 C8 C9 ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ │{4,7}│ BUG │ BUG │ BUG │{..4,│ ... │ ... │{..4,│ ... │ │ (45)│ (46)│ (47)│ (48)│ 7..}│ │ │ 7..}│ │ │ │ +4 │ +7 │ ...│ (49)│ │ │ (52)│ │ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ ↑ ↑ ↑ ↑ ↓ ↓ │ └─────┴─────┘ │ │ │ │ │ │ Helper BUG cells Eliminate! Eliminate! Cell (extras: 4,7)
│ │ └─────┬─────┘ │ Naked Pair {4,7}

Virtual cell (BUG extras) + Helper = Naked Pair ∴ Other cells in Row 6 cannot have 4 or 7 ```

Common Subset Sizes

Subset Size Name Virtual Cell + Partners
2 Naked Pair Extras + 1 helper
3 Naked Triple Extras + 1-2 helpers
4 Naked Quad Extras + 2-3 helpers

The most common case is a Naked Pair, but larger subsets are possible depending on the extras and available helper cells.

Comparison with Other BUG Types

Type Condition Action
Type 1 1 BUG cell Solve the cell (eliminate non-extras)
Type 2 Multiple BUG cells, same extra Eliminate extra from common peers
Type 3 Multiple BUG cells, different extras Form Naked Subset, eliminate from region
Type 4 2 BUG cells, locked loop value Eliminate other loop value

When Type 3 Applies

Type 3 requires all conditions: - ✅ Multiple BUG cells (cells with 3+ candidates) - ✅ BUG cells have different extra candidates - ✅ BUG cells share a region (row, column, or box) - ✅ Helper cells exist that contain only the extra values - ✅ Virtual cell + helpers form a valid Naked Subset - ✅ Other cells in the region contain subset values (something to eliminate)

When Type 3 Doesn't Apply

  • Same extras: All BUG cells have the same extra → Use Type 2
  • Only 1 BUG cell: Use Type 1
  • No shared region: BUG cells in different rows/columns/boxes → Type 3 can't form
  • No helper cells: Can't complete a valid Naked Subset
  • Nothing to eliminate: Other cells don't contain subset values

Connection to Unique Loop Type 3

BUG Type 3 and Unique Loop Type 3 use identical logic:

Strategy Pattern Scope What Forms the Virtual Cell
Unique Loop Type 3 Specific loop (4-10 cells) Rescue cells' extras
BUG Type 3 Entire grid BUG cells' extras

Both combine uniqueness patterns with Naked Subset elimination!

The Mathematics Behind It

  1. BUG state = all cells bivalue + each value appears twice per region
  2. BUG state → multiple solutions → impossible
  3. BUG cells break the pattern with extra candidates
  4. At least one BUG cell must become its extra value
  5. Combined extras behave as a single cell for subset logic
  6. Naked Subset rules apply → other cells can't have those values

Tips for Beginners

  1. Learn prerequisites first:
  2. BUG Type 1 for understanding BUG patterns
  3. Naked Pair for subset logic
  4. Look for different extras: When BUG cells have different extras, think Type 3
  5. Identify shared region: BUG cells must be in the same row/column/box
  6. Find helpers: Look for cells containing only the extra values
  7. Apply subset logic: Once you have virtual cell + helpers, it's standard subset elimination

Why This Strategy Works

The uniqueness principle guarantees one and only one solution.

  1. The grid is almost in BUG state (all bivalue except BUG cells)
  2. BUG state would mean multiple solutions → impossible
  3. At least one BUG cell must become its extra (to break symmetry)
  4. The extras are therefore "locked" to the BUG cells
  5. Combined with helper cells, they form a Naked Subset
  6. Standard subset elimination applies to other cells in the region

It's the powerful intersection of BUG uniqueness logic and Naked Subset elimination.

Related Strategies

BUG Family

Unique Loop Family

Naked Subset Strategies

Unique Rectangle Family