UAV-assisted wireless communication is crucial for ensuring seamless connectivity and information exchange, particularly in emergency scenarios where timely communication can be a matter of life and death. This paper proposes a UAV-assisted wireless network for emergency applications, utilizing multiple cluster and relay UAVs in rural and semi-urban environments. Each cluster UAV serves the users within its assigned cluster, while the relay UAV facilitates information transfer between uncovered cluster UAVs and the central server. To achieve effective clustering, a medoid-based algorithm is employed for grouping ground users, and mean-shift clustering is utilized to determine the horizontal locations of multiple cluster UAVs. Furthermore, machine learning-inspired stochastic optimization algorithms are used to enhance the optimal path planning of relay UAVs. Monte Carlo simulations were performed to demonstrate the optimality and convergence of the proposed methods in terms of the aggregate of users served and the amount of power saved, which proved to outperform other algorithms in the literature.