Reconfiguration of power networks based on graph-theoretic algorithms