Nowadays, robotic applications exist in various fields, including medical, industrial, and educational. The critical aspect of most of these applications is robot movement, where an efficient path-planning algorithm is required in order to guarantee a safe and cost-effective movement. The main goal of the path planning technique is to find the shortest possible path to the destination while avoiding the obstacles on the route. This study proposes a framework employing swarm intelligence optimization techniques based on an improved genetic algorithm and particle swarm optimization to obtain the optimum trajectory. The simulations are conducted using MATLAB R2022b. It is observed that the proposed particle swarm optimization achieves better accuracy of up to 99.5% and faster convergence time when compared with the genetic algorithm that attains 74.6% accuracy. The proposed optimized path planning algorithm is considerably advantageous, especially in realistic applications such as rescue robots and item delivery.