Using drone swarms as a cost-effective combat method poses a serious threat to aerial security. Due to their fast targeting and area coverage characteristics, high power microwave (HPM) weapons hold a unique advantage in countering drone swarms, however this area has not been thoroughly researched. This paper focuses on the study of vehicle-mounted HPM anti-drone swarm scenarios. A problem model is constructed, including models for the motion state of the drone swarm, threat assessment, and the operational range of HPM weapons. An optimization problem for HPM position deployment is established with the degree of damage to our facilities and weapon operational efficiency as the optimization objectives. A combined algorithm based on genetic algorithms and dynamic programming is proposed for computational solution. Numerical simulation calculations demonstrate that the combination algorithm proposed in this paper significantly outperforms the original directed energy weapon deployment optimization algorithm in terms of computational efficiency. This provides a more efficient technical approach for future anti-UAV swarm operations.