Contingency Matrix Solver