Run BFS with queue rows pinned in order. This is a small deterministic example, not solver engineering.

Example

Run BFS with queue rows pinned in order.

highlighted = computed this step

Step 1 — BFS row

Compute the highlighted combinatorics value.

dequeue, queue, seen(A, (B, C), (A, B, C))\begin{array}{c|c}\text{dequeue, queue, seen}&\hlmath{\text{(A, (B, C), (A, B, C))}}\end{array}

Step 2 — BFS row

Compute the highlighted combinatorics value.

dequeue, queue, seen(B, (C, D), (A, B, C, D))\begin{array}{c|c}\text{dequeue, queue, seen}&\hlmath{\text{(B, (C, D), (A, B, C, D))}}\end{array}

Step 3 — BFS row

Compute the highlighted combinatorics value.

dequeue, queue, seen(C, (D, E), (A, B, C, D, E))\begin{array}{c|c}\text{dequeue, queue, seen}&\hlmath{\text{(C, (D, E), (A, B, C, D, E))}}\end{array}

Step 4 — BFS row

Compute the highlighted combinatorics value.

dequeue, queue, seen(D, (E), (A, B, C, D, E))\begin{array}{c|c}\text{dequeue, queue, seen}&\hlmath{\text{(D, (E), (A, B, C, D, E))}}\end{array}

Step 5 — BFS row

Compute the highlighted combinatorics value.

dequeue, queue, seen(E, (empty), (A, B, C, D, E))\begin{array}{c|c}\text{dequeue, queue, seen}&\hlmath{\text{(E, (empty), (A, B, C, D, E))}}\end{array}
combinatorics-search Every row is intentionally ordered and pinned to the lesson specification.