Trial-and-error, which is also called brute-force method is the simplest unguided search or an unsystematic exploration of unknown.
It is not a coincidence that a generalized backtracking search procedures which traverse graphs (mazes) are recursive. It is natural given the structure of the environment or knowledge representation.
Guided by heuristics (hard-wired, generalized from the past experiences) backtracking search with adaptive pruning of the search-space is, perhaps, the best we could achieve in principle. It is important to understand than most of the time we are destined to do so-called random walk or mere aimless wandering, the way insects do.
A* search is a generalized implementation of these fundamental strategies.