Partial shading of a photovoltaic (PV) array is the condition under which different modules in the array experience different irradiance levels. Mismatch power loss is the unfortunate problem caused by partial shading phenomenon. To relieve the entire PV system from this issue, reconfiguring the PV modules of the considered PV array is proposed as a favorable solution to disperse the shadow regularly. Therefore, particle swarm optimization (PSO) is introduced in this paper, aiming to provide the optimal reconfiguration pattern of the switching matrix to maximize the generated power from the PV array. Then, a method is proposed to minimize the number of switching actions, thereby reducing the cost in the process of PV array reconfiguration. In this method, the physical location of the modules remains unchanged, while its electrical connections are altered. To verify the proposed method, a 5×5 PV array is established in MATLAB/SIMULINK. The effectiveness of proposed PSO technique is evaluated via performance analysis based on power generation and switching action saving.