Path generation means generating a path or a set of paths so that the generated path meets specified properties or constraints. To our knowledge, generating a path with the performance evaluation value of the path within a given value interval has received scant attention. This paper subtly formulates the path generation problem as an optimization problem by designing a reasonable fitness function, adapts the Markov decision process with reward model into a weighted digraph by eliminating multiple edges and non-goal dead nodes, constructs the path by using a priority-based indirect coding scheme, and finally modifies the bat algorithm with heuristic to solve the optimization problem. Simulation experiments were carried out for different objective functions, population size, number of nodes, and interval ranges. Experimental results demonstrate the effectiveness and superiority of the proposed algorithm.