A major difficulty in a search-based problem-solving process is the task of searching the potentially huge search space resulting from the exponential growth of states. State explosion rapidly occupies memory and increases computation time. Although various heuristic search algorithms have been developed to solve problems in a reasonable time, there is no efficient method to construct heuristic functions. In this work, we propose a method by which a neural network can be iteratively trained to form an efficient heuristic function. An adaptive heuristic search procedure is involved in the training iterations. This procedure reduces the evaluation values of the states that are involved in the currently known best solution paths. By doing so, the promising states are continuously moved forward. The adapted heuristic values are fed back to neural networks; thus, a well-trained network function can find the near-best solutions quickly. To demonstrate this method, we solved the fifteen-puzzle problem. Experimental results showed that the solutions obtained by our method were very close to the shortest path, and both the number of explored nodes and the search time were significantly reduced.