Micro-electric discharge machining (Micro-EDM) is deployed for machining hard-to-machine materials, such as various grades of titanium alloys, heat-treated alloy steels, composites, tungsten carbides, and so forth. Mild steel is known for its easy machinability. However, conventional machining of mild steel can often lead to the built-up edge formation on the tool. There is a minimal focus on machining ductile materials using nonconventional machining processes. This is due to the rapid work hardening in cold forming conditions. In the present study, the aluminium alloy 6061 and mild steel AISI 304 were taken as a work piece. Input pulse on factors considered as three levels and orthogonal array utilized to optimize the EDM parameters. Numerical results confirm the influence of input parameters in the response. The highest MRR is obtained at Ton = 40 μs and Toff = 4 μs, and the least MRR is acquired at Ton = 20 μs and Toff = 3 μs. The fruit fly algorithm and the cockroach swarm algorithm were used to predict the optimal minimized MRR value. The experimental results show that the cockroach swarm algorithm was performing better than the fruit fly algorithm in the MRR minimization process.