Challenge on BFS Queue

Here’s the queue step-by-step. The letters become lower-case as they are explored.
A (Starting node)
aBG (A finds B and G)
abGC (B finds C, A already having been found)
abgCH (G finds H, A and C having already been found)
abgcHED (C finds E and D, B and G already having been found)
abgchEDL (H finds L, G and D having already been found)
abgcheDLF (E finds F, C already having been found)
abgchedLFM (D finds M; C, F, and H already having been found)
abgchedlFM (L finds nothing new)
abgchedlfMIK (F finds I and K; E and D having already been found)
abgchedlfmIK (M finds nothing new)
abgchedlfmiKZ (I finds Z, F having already been found)

The goal node is found. Z came from I, I from F, F from E, E from C, C from B, and B from A.

Reversing the breadcrumb trail gives us the path ABCEFIZ.

Privacy & Terms