  Training Neural Networks able to capture the topology changes of the power
grid is one of the significant challenges towards the adoption of machine
learning techniques for N-k security computations and a wide range of other
operations that involve grid reconfiguration. As the number of N-k scenarios
increases exponentially with increasing system size this renders such problems
extremely time-consuming to solve with traditional solvers. In this paper, we
combine Physics-Informed Neural Networks with both a Guided-Dropout (GD) Neural
Network (which associates dedicated neurons with specific line
connections/disconnections) and an edge-varrying Graph Neural Neural Network
(GNN) architecture to learn the setpoints for a grid that considers all
probable single-line reconfigurations (all critical N-1 scenarios) and
subsequently apply the trained models to N-k scenarios.We demonstrate how
incorporating the underlying physical equations for the network equations
within the training procedure of the GD and the GNN architectures, performs
with N-1, N-2, and N-3 case studies. Using the AC Power Flow as a guiding
application, we test our methods on the 14-bus, 30-bus, 57-bus, and 118-bus
systems. We find that these topology-aware NNs not only achieve the task of
contingency screening with satisfactory accuracy but do this at up to 1000
times faster than the Newton Raphson power flow solver. Moreover, our results
provide a comparison of the GD and GNN models in terms of accuracy and
computational speed and provide recommendations on their adoption for
contingency analysis of power systems.
