| 1 | Calculate in-degree | - | [ ] | [A:0, B:1, C:1, D:2, E:1, F:0] | [] | Graph: A->B, A->C, B->D, C->D, D->E |
| 2 | Initialize queue with zero in-degree nodes | - | [A, F] | [A:0, B:1, C:1, D:2, E:1, F:0] | [] | Queue contains nodes with no incoming edges: A, F |
| 3 | Pop from queue | A | [F] | [A:0, B:1, C:1, D:2, E:1, F:0] | [A] | Remove A, process neighbors B and C |
| 4 | Decrease in-degree of B | - | [F] | [A:0, B:0, C:1, D:2, E:1, F:0] | [A] | B in-degree decreased from 1 to 0 |
| 5 | Decrease in-degree of C | - | [F] | [A:0, B:0, C:0, D:2, E:1, F:0] | [A] | C in-degree decreased from 1 to 0 |
| 6 | Add B and C to queue | - | [F, B, C] | [A:0, B:0, C:0, D:2, E:1, F:0] | [A] | B and C added to queue as their in-degree is zero |
| 7 | Pop from queue | F | [B, C] | [A:0, B:0, C:0, D:2, E:1, F:0] | [A, F] | Remove F, no neighbors to process |
| 8 | Pop from queue | B | [C] | [A:0, B:0, C:0, D:2, E:1, F:0] | [A, F, B] | Remove B, process neighbor D |
| 9 | Decrease in-degree of D | - | [C] | [A:0, B:0, C:0, D:1, E:1, F:0] | [A, F, B] | D in-degree decreased from 2 to 1 |
| 10 | Pop from queue | C | [] | [A:0, B:0, C:0, D:1, E:1, F:0] | [A, F, B, C] | Remove C, process neighbor D |
| 11 | Decrease in-degree of D | - | [] | [A:0, B:0, C:0, D:0, E:1, F:0] | [A, F, B, C] | D in-degree decreased from 1 to 0 |
| 12 | Add D to queue | - | [D] | [A:0, B:0, C:0, D:0, E:1, F:0] | [A, F, B, C] | D added to queue as in-degree is zero |
| 13 | Pop from queue | D | [] | [A:0, B:0, C:0, D:0, E:1, F:0] | [A, F, B, C, D] | Remove D, process neighbor E |
| 14 | Decrease in-degree of E | - | [] | [A:0, B:0, C:0, D:0, E:0, F:0] | [A, F, B, C, D] | E in-degree decreased from 1 to 0 |
| 15 | Add E to queue | - | [E] | [A:0, B:0, C:0, D:0, E:0, F:0] | [A, F, B, C, D] | E added to queue as in-degree is zero |
| 16 | Pop from queue | E | [] | [A:0, B:0, C:0, D:0, E:0, F:0] | [A, F, B, C, D, E] | Remove E, no neighbors to process |
| 17 | Check if all nodes processed | - | [] | [A:0, B:0, C:0, D:0, E:0, F:0] | [A, F, B, C, D, E] | All nodes processed, topological order complete |