Aging affects different photovoltaic (PV) modules in a PV array in a non-uniform way, thereby leading to non-uniform working conditions of the PV modules and resulting in variations in the power outputs of the PV array. In this paper, an algorithm is developed for optimising the electrical configuration of a PV array during the non-uniform aging processes amongst the PV modules. A new PV array reconfiguration method is proposed to maximize the power generation from non-uniformly aged PV arrays through rearrangements of the positions of the PV modules without having to replace the aged PV modules with new ones, thereby saving on maintenance costs. This reconfiguration strategy requires information about the electrical parameters of the PV modules in an array, so as to choose the optimal reconfiguration topology. In this algorithm, the PV modules are sorted iteratively in a hierarchy pattern to reduce the effect of mismatch due to the non-uniform aging processes amongst PV modules. Computer simulation and analysis have been carried out to evaluate the effectiveness of the proposed method for different sizes of non-uniform aged PV arrays (4 × 4, 10 × 10, and 100 × 10 arrays) with MATLAB. The results show an improvement in the power generation from a non-uniformly aged PV array and can be applied to any size of PV array.