Simultaneous adjustment of all cutter locations in a tool path using meta-heuristic algorithms provides a systematic approach to reducing machining errors in 5-axis flank machining of ruled surfaces. However, these algorithms experienced unsatisfactory quality of optimal solutions and lengthy search time in high-dimensional search space. To solve these problems, we propose an iterative optimization scheme that progressively simplifies solution space by sampling techniques. Akaike information criterion (AIC) is used to screen significant factors from sampling data. An electromagnetism-like mechanism (EM) algorithm searches through a simplified solution space constructed only using these factors. An iteration process consisting of such sampling, screening, and searching steps repeats several times until final optimal solutions are obtained. Test results of representative surfaces validate the effectiveness of the proposed scheme. Both solution quality and search efficiency are improved comparing to those produced by previous studies. This work enhances the practicality of optimization-driven tool path planning in 5-axis flank machining.