This document presents a modified ant colony optimization (MACO) algorithm to solve the complex unit commitment (UC) problem in power systems, aimed at optimizing the generation of thermal units to minimize operational costs while adhering to constraints. It discusses the limitations of existing methods and proposes a new approach that employs pheromone matrices for better optimization and efficiency in generating power schedules for systems with multiple generators. The results demonstrate that MACO outperforms traditional methods in terms of economic dispatch and operational efficiency.