Adaptive Network Response to Line Failures in Power Systems