A game-theoretic framework for contingency analysis in power systems