Most existing studies on distribution network reconfiguration (DNRC) are predominantly based on a fixed initial topology and optimize switch operations to achieve various objectives, without considering the flexible allocation of backup lines. This paper proposes a novel problem of optimizing the reconfiguration capability of distribution networks (DNs) by considering the expansion of power lines under resource constraints. The reconfiguration capability reflects the ability of a DN to respond to uncertainties and disturbances by adjusting its topology. A novel metric based on the number of spanning trees is proposed to quantify the reconfiguration capability of a DN. Moreover, an optimization model is formulated to maximize the reconfiguration capability of a DN subject to resource constraints on line expansions. To solve this model efficiently, a multifactorial evolutionary algorithm (MFEA) is developed, which can optimize multiple tasks with different expansion line quantities simultaneously by exploiting knowledge transfer across tasks. The proposed metric, model, and algorithm are validated on two case studies using the IEEE 33-bus and 70-bus test systems, and the results show their effectiveness and superiority over existing methods.