Learning anything encompasses the possibility of failing.
The possibility can’t be optimized away except by not starting.
If you aren’t doing something badly and inefficiently, you aren’t learning.
The first problem isn’t finding the best path (per the question). The first problem is to stop standing still.
Searching for the best path
is only pretending to learn.