Manuscript Offprint
arXiv:2610.13495Hierarchical Graph Neural Network for Probabilistic Power Flow with Grid Topology Contingencies
This work has been accepted by IEEE Transactions on Industrial Informatics on 2026-09-09. Digital Object Identifier (DOI) by IEEE Transactions on Industrial Informatics: 10.1109/TII.2026.3734758.
Hierarchical Graph Neural Network for Probabilistic Power Flow with Grid Topology Contingencies
Jinbao Wang, Jun Liu, Shiliang Zhang, Xuehui Ma, Lin Yan, Haolin Liu, Sabita Maharjan
Abstract—Data-driven surrogates reduce the nonlinear solves required for probabilistic power flow (PPF), but models tied to a fixed bus–branch graph often generalize poorly when outages change electrical coupling. This paper proposes a topology-decomposition-driven hierarchical bidirectional graph neural network (TDD-HBGNN) for PPF under unseen topologies. For each realized topology, the network is decomposed into fundamental topological units (FTUs), dynamically homogeneous voltage clusters (DHVCs), and a core backbone sub-grid (CBSG), with equivalent-admittance representations preserving electrical ports between units. A sensitivity-based linear prior captures the first-order voltage-magnitude and phase-angle response, while the HBGNN learns topology-dependent nonlinear residuals. Impedance- and uncertainty-aware bottom-up aggregation condenses local perturbations, while mode-modulated top-down broadcasting restores system context at buses. We evaluate our approach on the IEEE 118-bus and Polish 2746-bus systems under unseen N-1 and N-2 contingencies against six baseline methods. Compared with these methods, TDD-HBGNN achieves 2.47–4.20-fold lower all-bus phase-angle errors and lower phase-angle errors in every held-out event. Its voltage-magnitude advantage is concentrated near the outaged branches, where paired error ratios reach 1.75–2.58 on the IEEE system and 1.87–1.97 in Polish N-2 events. All system-contingency-baseline comparisons favor TDD-HBGNN in joint voltage-angle error. Moreover, shared hierarchical operators keep the model size at 0.658 million parameters across both grids and yield 0.161–1.793 ms forward latency per probabilistic case. These results demonstrate system-wide angular accuracy, outage-local voltage accuracy, and parameter-efficient scaling across unseen topologies.
Index Terms—Hierarchical Bidirectional Graph Neural Network (HBGNN), topological decomposition, PPF, graph theory, uncertain topology
Data-driven methods have recently emerged as feasible tools for constructing fast power-flow approximations with nonlinear representation capacity. Deep surrogates replace repeated nonlinear solves with learned mappings from uncertain injections to system states or power-flow forecasts, substantially reducing the online cost of probabilistic and predictive analysis [4]–[6]. Physics-informed learning further regularizes these mappings with grid equations or operational constraints [7], [8]. Computational efficiency and physical regularization, however, do not by themselves ensure structural generalization. A topology-agnostic network encodes electrical coupling only through its training distribution; when a branch outage or reconfiguration changes the adjacency and admittance relations, the physical mapping changes without a corresponding change in the model's computation. Graph-based surrogates address this mismatch by coupling their propagation to the realized network structure [3], [9]–[12]. Yet accepting a different graph is not equivalent to generalizing to an unseen topology. Because the number of configurations grows combinatorially with the number of branches, exhaustive training remains infeasible, and successful transfer requires a model to preserve the electrical propagation mechanisms shared across configurations while adapting their interaction paths to the current grid.
Recent GNN-based power-flow models can be organized by the mechanism used to represent these interactions. Typed and topology-aware models expose component roles, line attributes, switch states, or the realized graph operator to message passing, thereby improving adaptation to heterogeneous or varying configurations [9], [10], [13]–[16]. Model-driven and physics-guided models instead derive propagation or training constraints from admittance relations, sensitivities, branch-current models, and power-flow equations, which improves physical consistency and reduces the burden on purely empirical fitting [3], [17], [18]. High-order filters and
Jinbao Wang, Jun Liu, Xuehui Ma, Lin Yan, Haolin Liu are with School of Automation and Information Engineering, Xi'an University of Technology, No.5 Jinhua South Road, Xi'an, 710048, Shaanxi, China. Shiliang Zhang (shilianz@ifi.uio.no) and Sabita Maharjan (sabita@ifi.uio.no) are with the Department of Informatics, University of Oslo, 0373 Oslo, Norway.
© 2026 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any current or future media, including reprinting/republishing this material for advertising or promotional purposes, creating new collective works, for resale or redistribution to servers or lists, or reuse of any copyrighted component of this work in other works.
recurrent or decentralized graph solvers enlarge the effective interaction range beyond immediate neighbors while retaining localized computation [19]–[22], whereas multi-fidelity residual learning uses a low-fidelity power-flow approximation to reduce the demand for high-fidelity training data [23]. Beyond solver learning, related power-system GNNs augment local propagation with higher-order node features, explicit network measures, or system-, zone-, and branch-level outputs to recover broader operating context [24]–[26]. These mechanisms address component heterogeneity, topology dependence, physical feasibility, propagation range, data efficiency, and system-level awareness. Most, however, still organize computation at a single bus–branch resolution. Repeated or high-order message passing can extend the receptive field, and graph-level summaries can inject global information, but neither explicitly separates contingency-local effects, regional aggregation, and system-wide feedback. Thus, the unresolved issue is not simply to propagate farther or impose more physics; it is to represent how a local topological perturbation is transformed across physically meaningful spatial scales.
This distinction also motivates the comparison and contradiction among the existing methods. Along the structural axis, a DNN provides a topology-agnostic global mapping, whereas a standard GNN, PowerFlowNet, and GNS progressively introduce bus-level graph propagation, higher-order aggregation, and iterative state updates [4], [13], [20], [21]. Along the physical axis, the MD-GCN and PG-GNN incorporate model-derived coupling or power-flow constraints into graph learning [3], [17]. This comparison separates the effects of graph structure, propagation range, iterative refinement, and embedded physics. None of these alternatives, however, explicitly reconstructs a changed grid as nested physical units or exchanges information bidirectionally between local units, regional aggregates, and the system backbone. The multiscale structural mechanism by which topology changes reshape stochastic power-flow mappings remains insufficiently investigated.
In summary, although existing data-driven PPF and power-flow models can fit grids with known or represented topologies, they do not explicitly characterize how topological perturbations systematically alter uncertainty-propagation paths and inter-nodal coupling strengths [27]. There remains a gap in representing the structural principles that govern these changes. Specifically, two critical research questions remain: (i) how do topological changes reshape stochastic power-flow mappings across local, regional, and system scales, and (ii) how can a structurally robust PPF propagation framework combine the dominant physical response with topology-dependent nonlinear corrections? These questions require a model whose propagation structure changes with the grid while preserving the physical mechanisms shared across configurations.
This paper addresses the insufficient topological generalization and poor structural adaptability of existing PPF models. To this end, we present a novel topology-decomposition-driven hierarchical bidirectional graph neural network (TDD-HBGNN) that sequentially decomposes the power grid into core backbone sub-grids (CBSGs), dynamically homogeneous voltage clusters (DHVCs), and fundamental topological units (FTUs). This decomposition follows fundamental electrical laws and is constrained by the physical grid structure. A sensitivity-based linearization establishes a physical baseline for the dominant power-flow response. The HBGNN then represents the grid through two complementary paths: (i) a bottom-up path that aggregates node features layer by layer through the FTUs and DHVCs to the CBSG, and (ii) a top-down path that broadcasts global contextual information back to individual nodes. Finally, the linearized baseline and the residual correction learned by the HBGNN jointly determine the bus-wise voltage-magnitude and phase-angle quantiles. Because the hierarchy and its propagation paths are reconstructed for the current grid, the model can generalize to previously unseen topological configurations. The main contributions are summarized as follows:
-
We propose an electrically constrained topology decomposition that partitions each grid configuration into FTUs, DHVCs, and a CBSG. It combines nodal electrical features with connectivity to form a physically meaningful multiscale representation of changing grid topologies.
-
We develop TDD–HBGNN, which aggregates information from nodes through FTUs and DHVCs to the CBSG, then broadcasts system-level context to nodes. Reconstructing the hierarchy for each configuration couples local topology changes with global conditions under previously unseen topologies.
-
We formulate PPF prediction as a sensitivity-based prior plus a topology-dependent nonlinear residual. The prior captures the dominant first-order response, while the HBGNN learns the residual to produce bus-wise voltage-magnitude and phase-angle quantiles.
II. PROBLEM FORMULATION AND FRAMEWORK OF THE PROPOSED METHOD
In this section, we formulate the problem in PPF, motivate the use of the topology-decomposition-driven HBGNN (TDD-HBGNN), and describe its architecture. We develop PPF based on the polar coordinate formulation of alternating current (AC) power flow.
where x denotes the vector of voltage angles and magnitudes at all buses except the slack bus, represents the vector of active and reactive nodal power injections, treated as random variables, and f denotes the AC power flow mapping.
We employ model-independent quantiles to represent the uncertain power injection. The quantile set for a power grid with q uncertain injection points at time step t takes the form
where denotes the overall quantile set at time , is the quantile set for the -th injection point, is the -th quantile value of the uncertain power at the -th injection point, and is the number of quantiles per injection point.
The nominal proportions for each satisfy the standard quantile ordering
The model operates per time step. Note that we omit the index t hereafter for brevity. The probabilistic outputs for voltage magnitude and phase angle at each bus follow separate quantile grids with and levels, respectively, where both are subsets of the L input quantile levels.
Existing data-driven methods use historical or simulated data to learn the mapping from power injection distributions to voltage states, as illustrated in Fig. 1a. However, when the network topology changes, the resulting mismatch between training and real-time data causes a marked decline in model performance, as shown in Fig. 1b. This limitation underscores the need to improve the topological adaptability of these methods and to strengthen their ability to generalize to out-of-distribution scenarios.

(a)

(b)
Fig. 1: Challenges of traditional data-driven methods. (a) The data-driven framework. The left side indicates the model-driven approach. The right side indicates the data-driven method learning the distribution mapping from data. (b) The data-driven framework challenged by grid topology mismatch. In this case, a new model is adopted to fit the grid, whereas the data-driven branch cannot adapt to the changed mapping, resulting in reduced accuracy.
III. THE PROPOSED METHOD
The structural properties of power systems can be examined along two dimensions: electrical dynamics in the grid and topological configuration. From an operational standpoint, a power system represents an integrated system driven by a CBSG and multiple DHVCs. From a topological standpoint, it forms a complex network built upon FTUs such as series, parallel, and mesh connections. Guided by this dual perspective, we develop HBGNN to enable multi-scale information propagation across hierarchical levels, thereby fully exploiting both the intrinsic electrical dynamics and the topology of the power system.
A. Grid topological decomposition
By integrating network topology with historical input-output data, we first partition the entire system into a CBSG and multiple DHVCs. On this basis, we further decompose these components into minimal FTUs and linearize each unit, establishing a rigorous foundation for subsequent graph reconstruction and model training.
Let denote the power grid graph, where and represent the vertex and edge sets, respectively. For any subgraph , we write for the degree of vertex within , and for the pair of endpoints associated with edge . We define as the vertex set of the -th cluster obtained via spectral clustering.
We identify the CBSG by its highly stable voltage profiles and robust electrical support. To identify nodes with strong static voltage-support capability, we define the node weights as follows:
where is the short-circuit capacity at node , is the voltage-reactive power sensitivity, is a weighting coefficient, and is the betweenness centrality of node , defined as the fraction of all shortest paths between every pair of distinct nodes that pass through .
While these weights capture static voltage support, they do not reflect the grid’s dynamic behavior under varying injections. We introduce a causal relationship matrix based on Granger causality:
where quantifies the predictive influence of node i on node j based on voltage time series and is the electrical distance attenuation coefficient. We then derive the Net Causal Strength (NCS) as:
which distinguishes disturbance sources from sinks.
By integrating the node weights and the NCS, we identify as a connected subgraph:
where , are the weight and causality thresholds, denotes the nominal voltage level of bus , and is the minimum voltage level threshold for backbone membership.
With the CBSG identified, we divide the remaining power grid into multiple DHVCs whose behavior the backbone governs. To isolate local dynamics, we define the residual voltage conditioned on the backbone by subtracting the regression prediction from the non-backbone voltages:
where and are the backbone and non-backbone voltage matrices over historical snapshots, extracts the first principal components, and is a regularized regression coefficient matrix.
We construct the affinity matrix for clustering as:
where denotes the Pearson correlation between the residual voltage sequences, and are independent decay coefficients for the electrical impedance distance and the topological hop-count distance , respectively.
To ensure that the resulting clusters are both topologically connected and dynamically consistent, we partition the non-backbone vertices into clusters via spectral clustering on the affinity matrix :
where is the residual voltage submatrix of cluster and is the leading eigenvalue of its covariance matrix. The objective penalizes deviations from a low-rank structure within each cluster.
Using a graph-theoretic approach, we decompose the CBSG and DHVCs into FTUs while preserving their electrical characteristics. Table I summarizes the definitions.
We first label branches to establish priority and exclusion criteria. We shield low-impedance edges during decomposition to prevent electrically nonsensical structures:
where is the initial edge labeling function, is the tap ratio of edge , is its impedance, and is a small threshold. We use the label (switch) internally within the algorithm and exclude it from the final output.
We denote by the residual graph after removing all edges labeled T or SW, i.e., . Through degree and cut-set analysis, we identify bridges and series chains:
where each denotes a series chain in .
After we remove bridges and series chains, the residual graph decomposes into biconnected blocks. Let denote one such block. We classify each block in descending order of structural specificity:
where denotes the cycle graph on n vertices.
By applying (7) through (13), we transform the complex grid topology into a hierarchical tree of fundamental electrical structures. We then linearize each topological unit into:
where is the equivalent admittance matrix of the unit, is the set of boundary vertices connecting the unit to the rest of the network, and contains the internal parameters required for recovering nodal quantities from port-level solutions.
This hierarchical decomposition replicates the control architecture of the power system at the data level, endowing the model with a physical inductive bias. When the topology changes, local disturbances mainly affect neighboring nodes while global regulation follows the power flow laws transmitted through the backbone network.
B. Hierarchical bidirectional graph neural network
We design the hierarchical bidirectional graph neural network (HBGNN) to progressively compress the power grid into a four-level representation—nodes , FTUs , DHVCs , and CBSG —to capture interactions at multiple spatial scales. The feature dimensions at each level are , , , . We perform a bidirectional message-passing process in which bottom-up aggregation extracts global patterns and top-down broadcasting refines local representations. The model predicts voltage magnitude and phase angle quantiles simultaneously through a shared HBGNN backbone with separate output heads:
where and are the base-case voltage magnitudes and phase angles at the operating point, and are sensitivity matrices that we fit via least squares in the normalized space, and denote the HBGNN's nonlinear corrections. The architecture of HBGNN is shown in Fig. 2
TABLE I: Formal graph-theoretic definitions of fundamental circuit topologies
| Type | Symbol | Mathematical Definition |
|---|---|---|
| SERIES | Path with for all interior vertices | |
| PARALLEL | Edge set where all share the same vertex pair | |
| RING | Simple cycle with for every vertex on the cycle | |
| BRIDGE | Edge whose removal disconnects | |
| MESH | Irreducible subgraph that is neither series nor parallel | |
| TRANSFORMER | Edge with tap ratio | |
| TERMINAL | Singleton cluster vertex with an inter-cluster edge | |
| INTER-CLUSTER | Edge connecting and , |

Fig. 2: Architecture of HBGNN that illustrates the bidirectional hierarchical information exchange between Nodes, FTUs, DHVCs, and CBSG levels, and the quantile prediction module with linearization baseline.
- Bottom-up aggregation: At the node level (), we propagate messages along transmission edges via dual-pathway gated message passing with admittance weighting:
We then pool features upward via three physics-guided operators—impedance-weighted attention for node-to-topology, -aware attention for topology-to-cluster, and mean aggregation for cluster-to-backbone:
where is the attention score, is the impedance associated with the node-to-topology mapping, and is the aggregated uncertainty at the topological level.
- Top-down broadcasting: The global context is sent back via two complementary pathways. The hierarchical unpooling progressively maps features from level to :
In parallel, the mode-modulated broadcasting lets each node selectively aggregate backbone signals based on its mode affinity:
where is the mode projection vector of backbone node , and projects backbone features to the node feature space.
We fuse the two pathways via a gating mechanism:
After bidirectional rounds, each node obtains a refined feature vector for quantile prediction.
- Quantile prediction and loss function: To guarantee , we apply a monotone quantile construction via cumulative softplus increments independently to both and :
(21) where . We combine the HBGNN residuals with the linearization baselines to obtain the final outputs: and .
We integrate the pinball losses with physics-informed constraints to form the total loss:
where penalizes deviation from the linearization baseline under small perturbations, enforces Kirchhoff's current law via the admittance matrix, and
constrains phase angles to the power-angle sensitivity relation, where denotes the set of injection buses, is the median quantile prediction, and is the -th row of the sensitivity matrix. We set the warmup coefficients as and , where is the training epoch and is the warmup period.
IV. CASE STUDY: RESULTS AND DISCUSSION
A. Evaluation design and statistical protocol
The test systems are the IEEE 118-bus (bus_118) and Polish 2746-bus (bus_2746) systems. The PV inputs comprise 3,328 sets of 11-quantile forecasts from a PV power station at City University of Hong Kong during the summer of 2022 [28]. PV penetration ranges from 10–95% and 5–30%, respectively. For each PV node, we draw and linearly interpolate the piecewise quantile function at u, yielding the forecast-implied marginal distribution without imposing a parametric form. Each forecast is used to generate 1,000 PV realizations, which are then evaluated using AC power flow, whose empirical bus-wise V and quantiles form the targets. Loads and scheduled non-PV generation remain fixed at their base-case values. In our case study, an N-1 event removes one in-service branch, whereas an N-2 event removes two simultaneously. We would like to note that load uncertainty, generator redispatch, and cascading failures are outside the scope of this study.
After excluding nonconvergent contingencies, we split mutually exclusive outage events into train/validation/test sets at an 8:1:1 ratio. The retained data contain 98/113 N–1/N–2 events for bus_118 and 230/88 for bus_2746. Cases are aggregated within events before event-level inference, preventing events with more retained cases from dominating the statistical summaries. All models share the partitions, targets, normalization, and evaluation code. Our experiments use Python 3.8.20 and PyTorch 2.4.1 on an i9-13900K workstation with 64 GB RAM and an RTX 4080 SUPER GPU.
Unless stated otherwise, learned models use hidden width 64 and AdamW with batch size 64, initial learning rate , weight decay , validation-based learning-rate reduction, and early stopping within 2,000 epochs. Table II summarizes the evaluated methods.
The six baselines span dense, conventional graph, high-order, recurrent, model-driven, and spectral alternatives. They share the pinball objective and monotone heads, whereas TDD–HBGNN additionally uses linear-consistency and network-physics terms. Spatial diagnostics use MD-GCN for bus_118 and DNN for bus_2746 as stored global references. All-method analyses retain all six baselines.
Let for output , event with cases, case , bus , and quantile . For bus scope ,
(24)
We use trapezoidal integration on the nonuniform grids. Thus, measures average error across the stored distribution, whereas measures the two endpoint-quantile errors rather than empirical coverage. Topology-induced displacement is the analogous case-wise distance between the contingency and base-topology target functions under the same operating condition. The paired ratio favors TDD-HBGNN when it exceeds one. We report its median, win rate , and 95% interval from 20,000 paired event-bootstrap replicates. Our ablations add one-sided paired Wilcoxon tests with Holm correction.
B. Topology generalization and residual structure
Figure 3 summarizes the results on unseen outage topologies within two graph hops of the outage and across the full network. The local scope tests sensitivity to changed power-transfer paths, whereas the global scope reveals whether local improvements persist after averaging over many weakly affected buses.
Near outages, the result is stable across metrics and contingency orders. On bus_118, local V ratios span 1.75–2.58 with 91–100% event wins, while ratios span 3.23–4.54 with TDD–HBGNN winning every event. Under N–2, mean errors are versus p.u. for V and versus for . On bus_2746 N–2, the local V and ratios are 1.97/1.87 and 3.97/3.49. The consistency between and endpoint errors indicates that the local advantage is not restricted to a single quantile.
The full-network panel defines the boundary. Angle ratios remain 2.47–4.20 and favor TDD–HBGNN in every event, but all-bus V is near parity on bus_118 and favors DNN on bus_2746: ratios are 0.50/0.64 under N–1 and 0.42/0.48 under N–2. The local median ratio for bus_2746 under N–1 is 1.15 with interval [0.89, 1.79], while its equal-event mean slightly favors DNN. Thus, the evidence supports system-wide angular and localized voltage accuracy, not universal all-bus V superiority.
The mean–median reversal is driven by a few large penalties. For event 81–126, local is versus
TABLE II: Configuration of the evaluated methods. All methods use separate monotone quantile heads.
| Method | Model class | Main configuration | Structural/physical information |
|---|---|---|---|
| TDD-HBGNN | Hierarchical GNN | 2 bidirectional rounds; 3 heads and 3 modes | Node-FTU-DHVC-CBSG hierarchy; impedance gating and sensitivity residual |
| DNN [5] | Dense network | 4 layers; 256 internal units | Flattened PV input; no topology or physical prior |
| GNN [14] | Edge-conditioned GNN | 6 layers; 64-dimensional states | Branch features (r, x, |z|); no sensitivity prior |
| PowerFlowNet [20] | TAGConv | 6 layers; polynomial order K = 3 | Normalized high-order topology propagation |
| GNS [21] | Recurrent GNN | 6 message/update steps; GRU update | Branch-conditioned iterative propagation |
| MD-GCN [3] | Model-driven GCN | 6 layers; widths 64-256; 4 feature steps | Admittance-derived G/B operators |
| PG-GNN [17] | Chebyshev GNN | 3 layers; order K = 4; widths 64-512 | Normalized graph-Laplacian propagation |
Reference / TDD-HBGNN ratio (>1 favors TDD-HBGNN)

Cell: median ratio / event win rate; bold frame: 95% bootstrap CI excludes 1
| bus_118 N-1 | 1.75 91% | 1.93 100% | 4.04 100% | 3.23 100% |
| bus_118 N-2 | 2.58 100% | 2.37 100% | 4.54 100% | 3.62 100% |
| bus_2746 N-1 | 1.15 52% | 1.10 61% | 2.74 100% | 3.59 100% |
| bus_2746 N-2 | 1.97 80% | 1.87 80% | 3.97 100% | 3.49 100% |
(a) Within two graph hops.
| bus_118 N-1 | 0.95 27% | 0.88 9% | 2.64 100% | 2.47 100% |
| bus_118 N-2 | 1.02 58% | 1.02 67% | 3.03 100% | 2.63 100% |
| bus_2746 N-1 | 0.50 0% | 0.64 0% | 3.39 100% | 4.20 100% |
| bus_2746 N-2 | 0.42 0% | 0.48 0% | 2.79 100% | 2.98 100% |
(b) All buses.
Fig. 3: Accuracy under unseen topologies. The cells provide the median reference/TDD-HBGNN ratio and TDD-HBGNN win rate, bold frames mark 95% intervals excluding one. The references are MD-GCN for bus_118 and DNN for bus_2746.
p.u. for TDD-HBGNN and DNN. Removing it reverses the mean ordering. The median therefore represents typical event ordering, whereas the mean remains sensitive to rare losses. Distance-decayed DHVC affinities concentrate learned corrections near disturbances, while the baseline and physics losses provide a broad angular response. This interpretation is tested by ablation, and spatial comparison alone does not establish causality.
We perform spatial attribution over the complete eligible population. Within each held-out event and output, bus-wise error and topology-induced displacement are normalized to unit mass. The Joint share is the average of the normalized V and shares while Joint enrichment is their geometric mean. The analysis covers all 118/2,746 buses, all 11/12 and 23/10 held-out N-1/N-2 events, all 186/3,279 in-service physical branches, and all 15 predefined regional groups in each system. The 235 branches already out of service in the Polish base case have zero contribution. For each physical branch, endpoint-bus shares are divided equally among active incident branches, preserving unit mass. Figure 4 retains the full bus and outage-event populations and labels only the leading contributors.
The exhaustive ranking reveals a localized hotspot in bus_118. Buses 82, 83, and 96 and physical branches 82–83, 83–84, and 82–96 lead their respective rankings. The leading five and ten buses contribute 27.93% and 42.47% of Joint error, while the corresponding branch shares are 18.63% and
- Backbone ▲ Boundary ● Interior ■ N-1 □ N-2 ● Region ○ V→J→θ ● Size = share

(a) bus_118.

(b) bus_2746.
Fig. 4: Residual-error attribution over the complete eligible population. axes show response and error enrichment, and marker area indicates Joint error share. Numbered bus markers and labeled regional markers identify leading contributors. Values below lie on the displayed boundary.
30.63%. The region at least six hops from the outages carries 54.24% of the error, with error and response enrichments of 1.276 and 0.338. In contrast, bus_2746 is more diffuse. Its leading five and ten bus shares are 5.73% and 10.10%, and its corresponding branch shares are 5.67% and 9.72%. The remote-region error and response enrichments are 1.013 and 0.970. Joint response-error correlations are 0.826/0.725 for bus_118 and 0.950/0.947 for bus_2746 under N-1/N-2. Thus, physical displacement closely tracks the spatial error allocation in the larger grid, whereas the smaller grid contains remote residual hotspots that displacement magnitude alone cannot explain.
The results in Figure 5 indicate whether event averages conceal concentrated bus errors, while showing that all buses are retained in the pointwise comparison, and population results remain primary. For bus_118, TDD-HBGNN reduces MAE from p.u./0.704° to p.u./0.0619°. Although only 45.8% of buses improve in , the 95th-percentile and maximum errors fall by factors of 5.87 and 3.72. The attention and uncertainty-aware pooling direct corrections toward strongly coupled residuals, reducing concentrated errors without requiring every bus to improve. On bus_2746, 58.9%/99.3% of buses improve in .

AC target, V (p.u.)

AC target, V (p.u.)
(a) bus_118.
(b) bus_2746.
Fig. 5: Signed median-quantile bus errors in held-out cases.

(a) bus_118.

(b) bus_2746 zoom.
Fig. 6: Controlled physical-response and error ratios. Small symbols are matched events; large paths connect median V, Joint, and . Open summaries have 95% intervals crossing one.
C. Controlled scaling and all-baseline advantage
This experiment controls for physical response and operating conditions when comparing contingency orders. We verify disjoint event folders, use identical scenario indices, and pair N-1/N-2 events by minimum-cost matching on median and P95 topology-induced displacement, weighting the median twice. This is a minimum-discrepancy diagnostic, not equal-severity or causal matching. For matched pair p, let be method m's mean case-level error over cases shared by order k. We define
Values above one indicate larger N–2 error. Joint is an equal-weight log-ratio summary rather than a training objective, so the V and components remain visible.
Figure 6 compares the matched physical-response ratios with the corresponding N–2/N–1 error ratios for both systems. On bus_118, paired N–2 displacement rises by factors of 4.32 for V and 2.68 for , while TDD–HBGNN error ratios are

(a) Controlled advantage.
(b) Cross-system scaling.
Fig. 7: Two-output ratio maps. Panel (a) uses event-median baseline/TDD–HBGNN ratios and panel (b) uses bus_2746/bus_118 ratios. Joint is the geometric mean of the V and ratios. Black centers mark Joint 95% intervals excluding one.
0.83/1.05/0.94 for V/ /Joint. The Joint interval [0.86, 1.01] includes parity, so easier pairs do not explain the lower N–2 point estimate. Both ratios are near parity on bus_2746. A larger physical response therefore need not enlarge the residual when the reconstructed units, ports, and equivalent admittances remain compatible with the changed paths.
The results show that scaling behavior is method-dependent. DNN and PowerFlowNet errors increase on bus_118, whereas MD-GCN and PowerFlowNet errors increase on bus_2746. Several graph models remain near parity. TDD-HBGNN combines an admittance-weighted path with a learned path, retaining first-order network response while allocating nonlinear capacity to topology-dependent residuals. Contingency order is thus neither a direct severity scale nor a universal measure of learning difficulty.
All 24 summaries in Fig. 7(a) lie above Joint parity with intervals excluding one. The smallest advantage, DNN on bus_2746 N–2, combines a V ratio of 0.41 with a ratio of 2.83, yielding Joint 1.09 [1.06, 1.13]. On bus_118, Joint ratios span 1.54–61.5 for N–1 and 1.68–60.2 for N–2. PowerFlowNet exhibits the same voltage–angle tradeoff on bus_2746, but its Joint ratios remain 1.88/2.31. The sensitivity baseline and stabilize the broad angular response, whereas V depends more strongly on the learned residual. These results support lower joint error, not component-wise dominance.
Fig. 7(b) examines cross-system scaling at common penetration. For TDD–HBGNN, the bus_2746/bus_118 ratios are 1.24/0.55/0.82 under N–1 and 1.30/0.49/0.80 under N–2 for V/ /Joint. Across the evaluated methods, the Joint cross-system ratios fall below parity for DNN, GNN, and PowerFlowNet but exceed parity for GNS, MD-GCN, and PG-GNN. This change in direction across methods shows that the observed scaling behavior is method dependent. Although HBGNN reuses fixed-dimensional hierarchical operators across grids, results from only two systems cannot establish a universal relationship between grid size and prediction error.
TDD-HBGNN anchor ● Baseline median + ratio 95% CI Shading: TDD-HBGNN better

(a) bus_118: worst local 25%.
(b) bus_2746: all local buses.
Fig. 8: Voltage-tail error at selected N–2/P95 coordinates. Axes show median event-level P95 error and paired baseline/TDD–HBGNN ratio, and whiskers are event-bootstrap 95% intervals.
A complementary test evaluates severe local conditions. Within two hops of an outage, each method's bus-wise errors are ranked per case, the worst retained fraction is averaged, and the P95 is taken across cases within each event. Figure 8 retains the worst 25% of local buses for bus_118 and all local buses for bus_2746. It shows the median event-level P95 error and median paired baseline/TDD-HBGNN ratio at N-2 settings whose bootstrap lower bound exceeds one for every baseline.
TDD–HBGNN’s median error is p.u. on bus_118 versus for the baselines, and paired ratios span 2.39–9.66. On bus_2746, it is versus , with ratios 2.05–12.76. The linear term supplies first-order response, impedance pooling collects local residuals, and top-down broadcasting restores CBSG context.
D. Finite-grid alignment and selective reliability
This experiment tests whether predicted quantiles reach their intended positions and whether a validation-trained score ranks high-error cases without test targets. We obtain the reached probability by piecewise-linear inversion with endpoint clipping. averages it over buses and cases within event . The event descriptors, in percentage points, are
measures endpoint-mass error and the largest interior displacement. These are finite-grid alignment diagnostics, not observation-based calibration measures.
Figure 9 reports all baseline–output coordinates for one selected contingency order per system. On bus_118 N–2, 16 of 24 coordinate medians exceed one, but eight favor a baseline and no V endpoint is robustly favorable on both descriptors. GNN and GNS trade endpoint ratios of 7.85 and 3.84 for interior ratios of 0.87 and 0.82. On bus_2746 N–1, 19 coordinates robustly favor TDD–HBGNN, yet several reversals remain. TDD–HBGNN's central V masses are only 43.77%,

(a) bus_118, N-2.
(b) bus_2746, N-1.
Fig. 9: Finite-grid alignment ratios. Axes are baseline/TDD–HBGNN endpoint and interior errors, and whiskers are event-bootstrap 95% intervals. Circles/triangles denote , and filled points have both intervals above one.
43.26%, 72.59%, and 72.54%, far from 90%. Its monotone head enforces quantile order, but the unconstrained sum of positive increments determines endpoint span. Pinball, linear-consistency, and network-physics losses do not directly enforce empirical coverage. Lower physical-unit error therefore does not establish voltage calibration.
The endpoints separate more consistently. On bus_118, DNN, PowerFlowNet, and MD-GCN are worse on both descriptors, whereas GNN and GNS exchange endpoint error for smaller interior residual. On bus_2746, DNN reaches 0.40/3.42, while GNN, GNS, and PG-GNN combine endpoint ratios 21.58/21.51/16.51 with interior ratios 0.55/0.41/0.16. The baseline and constrain angular response, but increment sums and their allocation govern endpoint span and interior shape separately. The observed reversals therefore represent distinct failure modes.
For selective reliability, a TDD–HBGNN pass yields corrected quantiles and a linear reference . The physics risk head uses interval width, correction magnitude, corrected-to-linear width disagreement, curvature, and input deviation. A generic head omits the two physics-comparison features. Candidates are selected by event-grouped fivefold cross-validation on validation events and frozen before testing:
where is a rank index, not a correctness probability.
The realized tail error is the case-wise error averaged over buses. Specifically, Spearman's measures its monotone agreement with the risk score. nAUSE divides the area between score-based and oracle rejection curves by the random-oracle area. Zero denotes oracle, one random, and values above one worse-than-random ranking. Worst-decile lift measures score/error top-decile overlap relative to random overlap. The 50% retained-error gain is , comparing retained TDD-HBGNN error with the best unscreened error among all seven methods. These metrics distinguish ranking quality from the absolute benefit of selective rejection.
TDD-HBGNN DNN GNN PFNet GNS MD-GCN PG-GNN
V ▲ θ — N-1 (solid) --- N-2 (dashed)

(a) bus_118.
(b) bus_2746.
Fig. 10: Reliability–utility map. Vertical position is 1 – nAUSE, and horizontal position is the 50% retained-error gain. Marker area indicates worst-decile lift, and arrows progress from raw width to generic and physics risk heads.
Figure 10 compares the reliability–utility trade-offs of raw interval width, the generic risk head, and the physics risk head. From the figure, raw width yields and nAUSE = 0.70–1.05. The physics head raises to 0.438–0.877, lowers nAUSE to 0.118–0.573, and gives 3.92–7.05-fold worst-decile lift. Width measures propagated uncertainty but not necessarily approximation error. Correction magnitude measures reliance on the nonlinear path; width disagreement detects departures from first-order spread; curvature detects uneven increments; and input deviation measures departure from validation support. A validation-fixed 90th-percentile score threshold flags 7.0–11.0% of unseen cases and recalls 34.0–72.8% of cases above the validation 90th-percentile tail-error threshold. Both and nAUSE improve in seven of eight settings.
For the bus_2746 N-2 voltage exception, physics augmentation changes from 0.519 to 0.438 and nAUSE from 0.390 to 0.494, while lift changes from 3.70 to 3.65. A large nonlinear correction can be the correct response to topology redistribution. Treating it only as a risk indicator can therefore create false positives.
E. Component evidence and deployment boundary
This section presents an ablation study to determine which components contribute to local and system-wide accuracy. We configure this test as follows. Linear only removes the learned correction, No linear prior removes the prior, MLP removes graph structure and the prior, Flat graph removes hierarchy, Bottom-up only removes top-down propagation, and One propagation round reduces two bidirectional rounds to one. All variants use the same held-out bus_118 events and targets. Figure 11 reports accuracy effects, and Table III reports computational profiles.
Removing either half of the prior-correction structure is costly. Linear only gives median ratios of 2.18–5.99, while No linear prior gives 1.66–12.04. The former retains the sensitivity response but cannot represent higher-order topology-
N-1, V ○ N-1, θ ■ N-2, V □ N-2, θ

(a) Within two graph hops.
(b) All buses.
Fig. 11: Component ablation on bus_118. Small symbols indicate events, large symbols and segments represent the median and IQR ( for N-1/N-2). Ratios are calculated by variant/TDD-HBGNN, and tests are one-sided paired Wilcoxon with Holm correction.
dependent residuals. The latter forces the nonlinear network to learn both the dominant first-order mapping and its correction. Flat graph, Bottom-up only, and One propagation round yield 1.46–3.70, 2.67–5.93, and 2.84–7.80. We observe that all of them remain significant after Holm correction ( ). MLP's global ratios are 1.10 and 1.02 and are not significant, but its N-2 local ratio is 1.56, angle ratios exceed 2.18, and voltage-tail ratios exceed 1.39. The advantage therefore lies in angular, tail, and outage-neighborhood behavior rather than every all-bus voltage average.
The structural variants identify the required information path. Flattening removes node–FTU–DHVC–CBSG compression and weighted pooling, leaving node-level propagation to recover long-range dependence. Bottom-up-only propagation forms a system summary but cannot return it through hierarchical unpooling and broadcasting. One round broadcasts the initial summary once, whereas a second round re-aggregates globally corrected node states and closes the local–global feedback loop. Their degradation supports both multiscale compression and repeated bidirectional exchange.
Table III shows that TDD–HBGNN retains 0.658 million parameters across both grids, whereas DNN grows from 2.150 to 45.723 million but remains faster in batch inference. The fixed parameter count follows from shared fixed-width hierarchical operators and does not imply constant training cost, because the larger grid requires more unit evaluations and activation memory. TDD–HBGNN training takes 2.220/0.665 h on bus_118 and 2.46/2.96 h on bus_2746. The variation reflects event counts, per-epoch cost, and early stopping. The MCS times correspond to 1,068/1,080 and 1,890/1,914 ms per case, making TDD–HBGNN times faster. Note that the one-solve AC-PF values represent only the deterministic MCS kernel, not an equivalent probabilistic output.
TABLE III: Measured computational resources, training time, and non-ML wall-clock benchmarks.
| Method or solver | Test system | Online wall time (ms/case) | Peak PyTorch memory (MB) | Parameters (million) | Training time (h) |
|---|---|---|---|---|---|
| TDD-HBGNN | bus_118 | 0.163 / 0.161 | 94.1 / 94.9 | 0.658 / 0.658 | 2.220 / 0.665 |
| bus_2746 | 1.793 / 1.770 | 1440.9 / 1403.7 | 0.658 / 0.658 | 2.46 / 2.96 | |
| DNN | bus_118 | 0.041 / 0.041 | 48.0 / 48.0 | 2.150 / 2.150 | 1.242 / 0.397 |
| bus_2746 | 0.498 / 0.434 | 869.1 / 868.6 | 45.723 / 45.723 | 2.019 / 0.982 | |
| GNN | bus_118 | 0.069 / 0.067 | 52.3 / 52.2 | 0.194 / 0.194 | 0.937 / 0.946 |
| bus_2746 | 0.952 / 0.887 | 749.7 / 747.0 | 0.194 / 0.194 | 2.836 / 0.752 | |
| GNS | bus_118 | 0.072 / 0.093 | 57.3 / 57.4 | 0.081 / 0.081 | 1.217 / 2.256 |
| bus_2746 | 0.956 / 0.906 | 835.1 / 805.6 | 0.081 / 0.081 | 6.509 / 3.359 | |
| MD-GCN | bus_118 | 0.167 / 0.160 | 353.4 / 393.4 | 10.930 / 10.930 | 2.114 / 0.671 |
| bus_2746 | 6.643 / 3.944 | 3513.8 / 3083.5 | 10.930 / 10.930 | 217.567 / 47.537 | |
| PG-GNN | bus_118 | 0.087 / 0.139 | 158.7 / 416.9 | 3.058 / 12.211 | 0.842 / 2.555 |
| bus_2746 | 1.585 / 1.789 | 2422.3 / 2044.4 | 3.058 / 3.058 | 11.477 / 8.041 | |
| PowerFlowNet | bus_118 | 0.100 / 0.091 | 46.6 / 46.7 | 0.143 / 0.143 | 2.404 / 2.764 |
| bus_2746 | 0.951 / 0.969 | 569.7 / 540.2 | 0.143 / 0.143 | 11.903 / 6.131 | |
| AC-PF (one solve) | bus_118 | 15.095 / 15.108 | - | - | - |
| bus_2746 | 26.107 / 26.179 | - | - | - | |
| MCS-PPF (1000 samples) | bus_118 | 1,068 / 1,080 | - | - | - |
| bus_2746 | 1,890 / 1,914 | - | - | - |
Notes: Entries are N-1 / N-2. Learned-model time is batch forward latency excluding data loading, host-device transfer, and post-processing. AC-PF entries are worker-measured mean solve times. MCS-PPF entries are end-to-end event times divided by 1000 cases, and each case uses 1000 AC-PF samples and 16 workers. Memory is process-local, and “-” means not applicable.
These results support amortized screening, with high-risk cases routed to AC power flow or full probabilistic analysis.
V. CONCLUSION
This paper developed TDD-HBGNN for PPF under changing grid topologies. The method separates transferable physical structure from topology-dependent nonlinear learning. For each topology, it reconstructs FTUs, DHVCs, and a CBSG and preserves electrical ports through equivalent-admittance representations. A sensitivity prior captures the dominant first-order voltage and angle response, leaving the HBGNN to learn the nonlinear residual. Impedance- and uncertainty-aware bottom-up pooling aggregates local perturbations, while mode-modulated top-down broadcasting returns system context to buses. Two exchange rounds close the local–global feedback loop. Shared fixed-width operators process the reconstructed hierarchy instead of flattened system-specific vectors, allowing the architecture to accommodate different grid sizes and within-system unseen contingencies.
Tests on the IEEE 118-bus and Polish 2746-bus systems validate these advantages. Under unseen N-1 and N-2 contingencies, TDD-HBGNN achieves all-bus phase-angle ratios of 2.47–4.20 against the strongest benchmarks. All 24 system-contingency-baseline summaries favor TDD-HBGNN in joint voltage-angle error. Our exhaustive attribution identifies a localized hotspot on the IEEE system, where the leading ten buses and physical branches contribute 42.47% and 30.63% of Joint error, and the remote region has error enrichment of 1.276 despite response enrichment of 0.338. The corresponding Polish contributions are 10.10% and 9.72%, while its remote-region error and response enrichments remain near parity. These associations localize error accumulation but do not establish causal branch effects. The ablation analysis shows that removing the prior or learned correction, flattening the hierarchy, suppressing top-down propagation, or using a single exchange round increases by median factors of 1.46–12.04, linking the gains to the prior–residual formulation and repeated hierarchical exchange.
Future work should extend the sensitivity prior to strongly nonlinear and unbalanced regimes and incorporate uncertainty from loads and non-PV dispatch. The quantile heads and validation-trained risk scores require topology-aware calibration, out-of-distribution detection, adaptive thresholds, and verified physical-solver fallback. Genuine zero-shot transfer should also be tested on related utility networks while keeping the learned hierarchical operators fixed.
REFERENCES
[1] V. Singh, T. Moger, and D. Jena, “Probabilistic load flow for wind integrated power system considering node power uncertainties and random branch outages,” IEEE Transactions on Sustainable Energy, vol. 14, no. 1, pp. 482–489, 2023.
[2] X. Fu, “Statistical machine learning model for capacitor planning considering uncertainties in photovoltaic power,” Protection and Control of Modern Power Systems, vol. 7, p. 5, 2022.
[3] M. Gao, J. Yu, Z. Yang, and J. Zhao, “Physics embedded graph convolution neural network for power flow calculation considering uncertain injections and topology,” IEEE Transactions on Neural Networks and Learning Systems, vol. 35, no. 11, pp. 15467–15478, 2024.
[4] H. Xiao, W. Pei, L. Wu, L. Ma, T. Ma, and W. Hua, “A novel deep learning based probabilistic power flow method for multi-microgrids distribution system with incomplete network information,” Applied Energy, vol. 335, p. 120716, 2023.
[5] F. Gao, Z. Xu, and L. Yin, “Bayesian deep neural networks for spatio-temporal probabilistic optimal power flow with multi-source renewable energy,” Applied Energy, vol. 353, p. 122106, 2024.
[6] D. Beinert, C. J. Holzhüter, J. Thomas, and S. Vogt, “Power flow forecasts at transmission grid nodes using graph neural networks,” Energy and AI, vol. 14, p. 100262, 2023.
[7] B. Huang and J. Wang, “Applications of physics-informed neural networks in power systems—a review,” IEEE Transactions on Power Systems, vol. 38, no. 1, pp. 572–588, 2023.
[8] R. Nellikkath and S. Chatzivasileiadis, “Physics-informed neural networks for AC optimal power flow,” Electric Power Systems Research, vol. 212, p. 108412, 2022.
[9] S. Liu, C. Wu, and H. Zhu, “Topology-aware graph neural networks for learning feasible and adaptive AC-OPF solutions,” IEEE Transactions on Power Systems, vol. 38, no. 6, pp. 5660–5670, 2023.
[10] M. Yang, G. Qiu, J. Liu, Y. Liu, T. Liu, Z. Tang, L. Ding, Y. Shui, and K. Liu, “Topology-transferable physics-guided graph neural network for real-time optimal power flow,” IEEE Transactions on Industrial Informatics, vol. 20, no. 9, pp. 10857–10872, 2024.
[11] A. Yaniv, P. Kumar, and Y. Beck, “Towards adoption of GNNs for power flow applications in distribution systems,” Electric Power Systems Research, vol. 216, p. 109005, 2023.
[12] S. de Jongh, “Physics-informed geometric deep learning for inference tasks in power systems,” Electric Power Systems Research, vol. 211, p. 108362, 2022.
[13] T. B. Lopez-Garcia and J. A. Domínguez-Navarro, “Power flow analysis via typed graph neural networks,” Engineering Applications of Artificial Intelligence, vol. 117, p. 105567, 2023.
[14] —, “Optimal power flow with physics-informed typed graph neural networks,” IEEE Transactions on Power Systems, vol. 40, no. 1, pp. 381–393, 2025.
[15] J. Authier, R. Haider, A. Annaswamy, and F. Dörfler, “Physics-informed graph neural network for dynamic reconfiguration of power systems,” Electric Power Systems Research, vol. 235, p. 110817, 2024.
[16] M. Gao, J. Yu, Z. Yang, and J. Zhao, “A physics-guided graph convolution neural network for optimal power flow,” IEEE Transactions on Power Systems, vol. 39, no. 1, pp. 380–390, 2024.
[17] M. Yang, G. Qiu, T. Liu, J. Liu, K. Liu, and Y. Li, “Probabilistic power flow based on physics-guided graph neural networks,” Electric Power Systems Research, vol. 235, p. 110864, 2024.
[18] Q.-H. Ngo, B. L. H. Nguyen, T. V. Vu, J. Zhang, and T. Ngo, “Physics-informed graphical neural network for power system state estimation,” Applied Energy, vol. 358, p. 122602, 2024.
[19] Y. Chen, R. A. Jacob, Y. R. Gel, J. Zhang, and H. V. Poor, “Learning power grid outages with higher-order topological neural networks,” IEEE Transactions on Power Systems, vol. 39, no. 1, pp. 720–732, 2024.
[20] N. Lin, S. Orfanoudakis, N. Ordonez Cardenas, J. S. Giraldo, and P. P. Vergara, “PowerFlowNet: Power flow approximation using message passing graph neural networks,” International Journal of Electrical Power & Energy Systems, vol. 160, p. 110112, 2024.
[21] B. Donon, R. Clément, B. Donnot, A. Marot, I. Guyon, and M. Schoenauer, “Neural networks for power flow: Graph neural solver,” Electric Power Systems Research, vol. 189, p. 106547, 2020.
[22] J. B. Hansen, S. N. Anfinsen, and F. M. Bianchi, “Power flow balancing with decentralized graph neural networks,” IEEE Transactions on Power Systems, vol. 38, no. 3, pp. 2423–2433, 2023.
[23] M. Taghizadeh, K. Khayambashi, M. A. Hasnat, and N. Alemazkoor, "Multi-fidelity graph neural networks for efficient power flow analysis under high-dimensional demand and renewable generation uncertainty," Electric Power Systems Research, vol. 237, p. 111014, 2024.
[24] Q. Chen, S. Bu, H. Wang, and C. Lei, “Real-time multi-stability risk assessment and visualization of power systems: A graph neural network-based method,” IEEE Transactions on Power Systems, vol. 40, no. 4, pp. 2955–2968, 2025.
[25] Y. Zhang, P. M. Karve, and S. Mahadevan, “Graph neural networks for power grid operational risk assessment under evolving unit commitment,” Applied Energy, vol. 380, p. 124793, 2025.
[26] J. Zhu, C. Nauck, M. Lindner, L. He, P. S. Yu, K.-R. Müller, J. Kurths, and F. Hellmann, “Network measure-enriched GNNs: A new framework for power grid stability prediction,” IEEE Transactions on Knowledge and Data Engineering, vol. 38, no. 1, pp. 518–531, 2026.
[27] P. Zhang, Z. Wu, and Y. Yu, “Power system intelligent computing: Scientific paradigm and research framework,” CSEE Journal of Power and Energy Systems, vol. 12, no. 2, pp. 563–574, 2026.
[28] J. Wang, J. Liu, X. Ma, S. Zhang, C. Yang, and B. An, “Ultra-short-term solar power forecasting by deep learning and data reconstruction,” Solar Energy, vol. 315, p. 114749, 2026.