The A* algorithm is widely used in the field of path planning for autonomous mobile robots. However, A* is a simple algorithm that cannot avoid moving obstacles. One of our research directions is to realize dynamic obstacle avoidance, which is based on A* algorithm. At the same time, we found that the A* algorithm is computationally inefficient. In contrast, the emerging nature-inspired algorithm outperforms the classical algorithm because of the reduced computational overhead. The nature-inspired algorithm is one of the most common heuristic algorithms. We reproduce a near-optimal algorithm that considers a single UGV approximate optimal path planning algorithm for obstacle avoidance in static environments. The algorithm uses two heuristic values, hence the name H2A (double heuristic algorithm). Our goal is to try to be able to avoid two moving obstacles at a time, the performance of the proposed algorithm is compared with the performance of the A* algorithm.