An optimal reconfiguration algorithm for distribution network is proposed. According to the common ground in different topological structures of distribution networks, a division rule is drafted: the whole solution space of distribution network reconfiguration is divided into feasible subspaces and infeasible subspaces, infeasible subspaces are deleted, meanwhile the optimal solutions in feasible subspaces are found out by local search algorithm, then the network losses are calculated one after another and calculation results are compared to find out global optimal solution. Using the proposed algorithm, the optimal solution for reconfiguration of distribution network can be achieved determinately and number of candidate solutions by which the network losses are calculated can be evidently reduced, thus the calculation efficiency can meet actual requirement. This conclusion is verified by calculation results of PG&E 69-bus system and IEEE 33-bus system.