The paper presents a refined approach to the classical unit commitment problem using the Invasive Weed Optimization (IWO) algorithm, aimed at minimizing generation costs under various constraints. The authors compare the performance of IWO against the Particle Swarm Optimization (PSO) method in two case studies, highlighting cost reductions in both an 8-hour 4-unit system and a 24-hour 10-unit system. The results indicate that IWO not only converges to optimal solutions effectively but also demonstrates significant cost-saving advantages over existing methodologies.