Abstract Drones flights have been investigated widely. In the presence of high density and complex missions, collision avoidance among swarm of drones and with environment obstacles becomes a challenging task and indispensable. This paper aims to enhance the optimality and rapidity of three dimensional IoD path generation by improving the particle swarm optimization (PSO) algorithm. The improvements include using chaos map logic to initialize the population of PSO. Also, adaptive mutation is utilized to balance local and global search. Then, the inactive particles are replaced by new fresh particles to push the solution toward global optimal. Furthermore, Monte Carlo simulation is carried out and the results are compared with slandered PSO and with recent work CIPSO. The results exhibit significant improvement in convergence speed as well as optimal solution which prove the ability of proposed method to generate safety path for IoD formation without collision with terrain obstacle and among drones.