Herein, a distributed switched control system is proposed which aims at frequency regulation and total generation cost minimization within a droop-based microgrid considering generator and line power constraints. The minimization is solved with Lagrange method and is achieved by realizing the equal incremental cost criterion via consensus algorithm. An online network reconfiguration is also proposed which bypasses a distributed generator when it violates the generation limits or gets disconnected, or when its corresponding line power flow exceeds its upper limit. It is mathematically probed that the proposed reconfiguration is a distributed online Kron reduction which leads to a new reduced data network; it preserves the existing spanning trees from cutting when a distributed generator is bypassed. Equilibrium analyses are conducted to show that the proposed switched system converges to the desired steady state. The stability of the system based on common quadratic the Lyapunov function is discussed. The effectiveness of the proposed controller for different case studies is verified by adapting it to a test microgrid system.