Solving the Unit Commitment problem is an important step in optimally dispatching the available generation and involves two stages—deciding which generators to commit, and then deciding their power output (economic dispatch). The Unit Commitment problem is a mixed-integer combinational optimization problem that traditional optimization techniques struggle to solve, and metaheuristic techniques are better suited. Dragonfly algorithm (DA) and particle swarm optimization (PSO) are two such metaheuristic techniques, and recently a hybrid (DA-PSO), to make use of the best features of both, has been proposed. The original DA-PSO optimization is unable to solve the Unit Commitment problem because this is a mixed-integer optimization problem. However, this paper proposes a new and improved DA-PSO optimization (referred to as iDA-PSO) for solving the unit commitment and economic dispatch problems. The iDA-PSO employs a sigmoid function to find the optimal on/off status of units, which is the mixed-integer part of obtaining the Unit Commitment problem. To verify the effectiveness of the iDA-PSO approach, it was tested on four different-sized systems (5-unit, 6-unit, 10-unit, and 26-unit systems). The unit commitment, generation schedule, total generation cost, and time were compared with those obtained by other algorithms in the literature. The simulation results show iDA-PSO is a promising technique and is superior to many other algorithms in the literature.