https://www.toolshero.com/problem-solving/5-whys-analysis/No, you have it exactly backwards. Five whys is explicitly depth first search. It was originally employed by Toyota Motors, and the key to actually getting at what the actual causes of issues were. This allowed Japan to avoid entire classes of defect due to their acceptance and implementations of the teachings of W. Edwards Demmings. It never made the leap to the United States, because doing things right is such a foreign concept over here, where management would gasp at the concept of a single worker shutting down the entire factory upon detecting a problem, whereas in Japan, the andon was key to getting issues that would compromise the Quality of the end product addressed.
It's:
I have a problem,
Why? Because of this other thing.
Why? What causes other thing?
The other thing is dependent on yet another thing and that thing.
Are those things a problem? If so, why?
Iterate until done.
The "Five" aspect came into play in that after a certain number of "Why's", it was often the case that the fact it took so many Why's to get to the root cause, that the complexity itself constituted it's own type of defect.
I might need to revisit the book I first read of it in, believe it was titled "Elegance" or some such.
EDIT: Found it.
In Pursuit of Elegance: Why the Best Ideas Have Something Missing by Matthew E. May
EDIT2: Nope, false alarm. Drat it, I will find that reference.
It's in this library somewhere... In the meantime, forget it; maybe I'm hallucinating it, because clearly I haven't refreshed it in a while, and the old wetware has taken a hell of a beating over the last couple years.