Sudoku Solver

Expert+

BUG Type 2

When multiple BUG cells share the same extra candidate, eliminate it from cells that see all of them.

BUG Type 2 is an advanced "uniqueness" strategy that extends BUG Type 1 to handle multiple BUG cells. When several cells break the bivalue pattern and they all share the same extra candidate, we can eliminate that candidate from any cell that sees ALL of them.

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

Interactive Example

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
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
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
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
1
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
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
3
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
8
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
6
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
5
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
7
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
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
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
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
2
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
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
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
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
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

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

Real Example Walkthrough

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

The Grid State: - Almost every unsolved cell has exactly 2 candidates (bivalue) - Two cells have 3 candidates each, breaking the bivalue pattern: - R8C3 (index 65): has candidates including 4 as extra - R9C8 (index 79): has candidates including 4 as extra

The Key Analysis:

  1. Identify BUG cells: R8C3 and R9C8 both have 3 candidates instead of 2
  2. Check for shared extra: Both cells have 4 as their extra candidate!
  3. Find common peers: Which cells can see BOTH R8C3 and R9C8?
  4. R9C3 can see R8C3 (same column) and R9C8 (same row)
  5. Apply the logic: At least ONE of {R8C3, R9C8} must be 4 to prevent the BUG
  6. Eliminate: Since one of them must be 4, R9C3 cannot be 4

Result: Eliminate 4 from R9C3.

What Is a BUG (Bivalue Universal Grave)?

A BUG (Bivalue Universal Grave) is a deadly grid state where: - Every unsolved cell has exactly 2 candidates - Every candidate appears exactly 2 times in each region

This creates multiple valid solutions, which is impossible in a proper Sudoku.

For more background on BUG, see BUG Type 1 (BUG+1).

Type 2: Multiple Cells, Same Extra

BUG Type 2 applies when: - The grid is almost in BUG state - Multiple cells (2 or more) break the pattern by having 3+ candidates - All these cells share the same extra candidate

The Logic

Since a BUG state is impossible: - At least ONE of the BUG cells must become the extra value (to break the pattern) - The extra value will appear in one of these cells - Any cell that sees ALL BUG cells cannot contain the extra value

It's similar to Unique Loop Type 2, but for the entire grid rather than a specific loop.

Step-by-Step: How to Apply Type 2

  1. Check for near-BUG state: Are almost all unsolved cells bivalue (2 candidates)?
  2. Find BUG cells: Which cells have 3+ candidates?
  3. Identify shared extra: Do ALL BUG cells share the same extra candidate?
  4. Find common peers: Which cells can see ALL BUG cells?
  5. Eliminate: Remove the shared extra from any common peer that contains it

Visual Pattern

``` Column 3 Column 8 ↓ ↓ ┌─────┐ ┌─────┐ Row 8 → │R8C3 │ │ │ │{x,y,│ │ │ │ 4 }←──────BUG cell (extra = 4) └─────┘ └─────┘ │ │ Same │ Column ↓ ┌─────┐ ┌─────┐ Row 9 → │R9C3 │ ← ← ← ← →│R9C8 │ │{..4}│ Same Row │{a,b,│ │ ↑ │ │ 4 }←──────BUG cell (extra = 4) └──┬──┘ └─────┘ │ Eliminate!

R9C3 sees BOTH BUG cells: - R8C3 via Column 3 - R9C8 via Row 9

One of {R8C3, R9C8} MUST be 4 ∴ R9C3 cannot be 4 ```

Comparison with BUG Type 1

Aspect Type 1 Type 2
BUG cells Exactly 1 2 or more
Extra candidates Can be multiple Must be the same in all BUG cells
Elimination target The BUG cell Common peers of all BUG cells
What's eliminated Other candidates (keep extras) The shared extra value

Type 1 logic: The single BUG cell must BE the extra Type 2 logic: ONE of the BUG cells must be the extra → peers can't have it

Finding Common Peers

A common peer is a cell that shares a row, column, or box with every BUG cell.

In our example: - R8C3 is in Row 8, Column 3, Box 7 - R9C8 is in Row 9, Column 8, Box 9

R9C3 sees both: - R8C3 via Column 3 ✓ - R9C8 via Row 9 ✓

Any cell at the intersection of the BUG cells' rows, columns, or boxes is a potential target.

Common Misconceptions

"All BUG cells must be in the same region"

No! BUG cells can be anywhere in the grid. What matters is that they share the same extra AND have common peers.

"I eliminate FROM the BUG cells"

No! In Type 2, we eliminate from the common peers. The BUG cells keep their extra because one of them needs it!

"The extra must appear 3 times in all regions"

Not necessarily. The extra just needs to be the candidate that makes each BUG cell trivalue instead of bivalue. It may have different distribution in different regions.

When Type 2 Applies

Type 2 requires all conditions: - ✅ Multiple cells with 3+ candidates (BUG cells) - ✅ All BUG cells share the same extra candidate - ✅ There exist common peers that see ALL BUG cells - ✅ At least one common peer contains the extra value

When Type 2 Doesn't Apply

  • Only 1 BUG cell: Use BUG Type 1 instead
  • Different extras: BUG cells have different extra values → Try Type 3 or Type 4
  • No common peers: No cell sees all BUG cells → No elimination possible
  • Common peers lack the extra: Nothing to eliminate

Connection to Unique Loop Type 2

BUG Type 2 and Unique Loop Type 2 use the same logic:

Strategy Pattern Scope What Prevents Deadly Pattern
Unique Loop Type 2 Specific loop (4-10 cells) Rescue cells with same extra
BUG Type 2 Entire grid BUG cells with same extra

Both eliminate the shared extra from common peers!

The Mathematical Foundation

The BUG state is proven to be impossible because: 1. If every cell has exactly 2 candidates 2. And every candidate appears exactly twice per region 3. Then you could swap candidates throughout the grid 4. Creating multiple valid solutions

The extra candidate in BUG cells breaks this symmetry. With multiple BUG cells sharing the same extra, at least one MUST take that value to maintain a unique solution.

Tips for Beginners

  1. Learn Type 1 first: BUG+1 is simpler and more common
  2. Look for trivalue cells: In a near-finished puzzle, cells with 3 candidates stand out
  3. Compare extras: Check if BUG cells share the same extra value
  4. Map common peers: Draw lines from each BUG cell to find intersections
  5. Trust the logic: BUG eliminations are 100% reliable when the pattern matches

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 value
  4. The extra value IS going to one of those cells
  5. Any cell seeing ALL BUG cells cannot also have the extra
  6. It would conflict with whichever BUG cell becomes the extra

Related Strategies

BUG Family

Unique Loop Family

Unique Rectangle Family