Physics-informed GNN for non-linear constrained optimization: PINCO, a solver for the AC-optimal power flow

## Abstract

Abstract The energy transition is driving the integration of large shares of intermittent power sources in the electric power grid. Therefore, addressing the AC optimal power flow (AC-OPF) effectively becomes increasingly essential.
The AC-OPF, which is a fundamental optimization problem in power systems, must be solved more frequently to ensure the safe and cost-effective operation of power systems. Due to its non-linear nature, AC-OPF is often solved in its linearized form, despite inherent inaccuracies. Non-linear solvers, such as the interior point method, are typically employed to solve the full OPF problem. However, these iterative methods may not converge for large systems and do not guarantee global optimality. This work explores a physics-informed graph neural network, PINCO, to solve the AC-OPF. We demonstrate that this method provides accurate solutions in a fraction of the computational time when compared to the established non-linear programming solvers. Remarkably, PINCO generalizes effectively across a diverse set of loading conditions in the power system. We show that our method can solve the AC-OPF without violating inequality constraints. Furthermore, it can function both as a solver and as a hybrid universal function approximator. Moreover, the approach can be easily adapted to different power systems with minimal adjustments to the hyperparameters, including systems with multiple generators at each bus. Overall, this work demonstrates an advancement in the field of power system optimization to tackle the challenges of the energy transition. The code and data utilized in this paper are available at https://anonymous.4open.science/r/opf_pinn_iclr-B83E/ .

## 1 Introduction

Power systems aim to ensure a reliable delivery of electricity to consumers. In a steady-state operation, power plants generate electric energy to meet the load demand while maintaining the voltage and frequency across the network within the required limits. The steady-state characteristic of the power system is described by the non-linear sinusoidal power flow equations, commonly known as the power flow (PF) problem. Additionally, by allocating electricity generation in a cost-effective manner throughout the day, the optimal power flow (OPF) problem is solved. This involves finding the most economical generation dispatch that satisfies the power flow equations and operational constraints. When no simplifications are made to the sinusoidal nature of the power flow equations, the problem is referred to as the alternating current optimal power flow problem (AC-OPF). The problem is used both in operation, being solved up to once every 5 minutes Nair et al. () and planning.

Given the nonlinearity of the power flow equation, this problem is inherently non-convex and is NP-hard Pineda et al. (). Traditionally, different approaches are used to solve the OPF. The easiest method is using a linear form of the power flow equation, called DC approximation, based on small-angle approximations. Using the DC power flow model brings well-known limitations Kile et al. (); Baker (), leading to sub-optimal solutions of the complete AC-OPF. Alternatively, convex relaxation techniques have been extensively examined Lavaei & Low (); Low (); Molzahn & Hiskens (). Currently, nonlinear programming methods such as the interior point method are established approaches to solving the OPF Zimmerman & Wang (). Nevertheless, these methods still face significant computational burdens and scalability challenges when applied to large-scale systems, limiting their utilization.

The limitations of traditional methods have driven researchers to explore alternative solutions using machine learning techniques. One of the first approaches to solving the power flow problem is presented by Donon et al. (). They introduce a graph neural network (GNN) solver for the AC power flow problem, employing a supervised learning approach. Their pioneering work utilized GNNs, a deep learning architecture beneficial for non-Euclidean data structures, like power grid datasets. Recent work Piloto et al. () exploring the use of Graph Neural Networks (GNNs) for power systems, particularly for optimal power flow (OPF), demonstrates that GNNs can be effectively trained in a supervised manner to address the computationally intensive security-constrained AC-OPF problem Capitanescu et al. (). These studies utilize supervised learning techniques to establish a mapping between loading conditions and AC-OPF solutions. However, a computational burden due to using a conventional solver to create the dataset is always involved. Furthermore, the conventional solver does not necessarily find the global optimum. With the advent of physics-informed neural networks (PINNs) Raissi et al. () and the subsequent growth of scientific machine learning, approaches that extend beyond pure data-driven learning have emerged. PINNs leverage physical laws to guide the training of neural networks, minimizing the need for labeled data. A comprehensive review of PINN applications in the power system domain is provided in Huang & Wang (). In Nellikkath & Chatzivasileiadis (), the authors presented a deep neural network trained using both data and physical equations, specifically incorporating the AC-OPF KKT conditions. The works of  Huang et al. () and  Chen et al. () propose deep neural networks for solving the AC-OPF without requiring labeled data, while also utilizing traditional methods to solve the nonlinear power flow equations. However, these approaches employ deep neural networks that lack the ability to generalize across different power grid topologies. Notably, Owerko et al. () combined GNNs with physics-informed learning to solve the AC-OPF in an unsupervised manner. This approach enables solutions to the non-convex AC-OPF without relying on other solvers, thus avoiding bias. Nevertheless, Owerko et al. () did not obtain OPF solutions without violating constraints, and they did not test their method on power systems with more than one generator per electrical bus.

To our knowledge, no existing method employs physics-informed neural networks (PINNs) in a fully end-to-end unsupervised manner without constraint violations that can compete with traditional solvers for solving the AC-OPF. Furthermore, we observe that previous works do not test the capability of such solvers in power systems where multiple generators per bus are present.

In this work, we tackle these research gaps, proposing PINCO. We developed a novel approach for the AC-OPF that combines GNNs and a variation of the conventional PINN paradigm that accounts for problems with hard constraints, named H-PINN Lu et al. (). PINCO allows for solving the AC-OPF without violations, and using GNN allows for easy adaptation to different power grid topologies and scalability. Furthermore, we provide a modeling approach dealing with multiple electricity generators per bus.
Finally, we evaluate our developed methodology’s computational efficiency and performance compared to established non-linear optimization solvers, demonstrating that this approach can compete with state-of-the-art solutions. In this work, we assess PINCO’s potential as a nonlinear programming solver and test the canonical ability of neural networks as universal function approximators. We argue that the primary advantage of our approach lies in its speed in providing feasible solutions and its ability to generalize to various inputs and power system topologies. We test our approach on the IEEE9, IEEE24, IEEE30, and IEEE118 bus systems, covering a wide range of power grid topologies.

In this work, we contribute to the research community as follows:

- •
We introduce an unsupervised physics-informed GNN architecture capable of solving the AC-OPF without inequality constraint violations.
- •
We prove its ability to act as a solver on a single loading condition and as a universal function approximator that can act as a solver on unseen loading conditions.
- •
We test a method that leverages scientific machine learning to solve constrained non-linear optimization problems.
- •
We show that our approach can be adapted to different power systems with minimal changes to the hyper-parameters, including power systems with multiple generators per bus.

The paper is structured as follows: Section 2 outlines the methodology; Section 3 introduces the experimental setting and evaluation metrics; Section 4 presents the results on benchmark IEEE bus systems; Section 5 presents the limitations of this study; Section 6 concludes with final remarks and discussion.

## 2 Methodology

In this section, we provide a detailed definition of the AC-OPF and introduce the two core components of our PINCO method: GNN and physics-informed neural networks with hard constraints.

### 2.1 The Optimal Power Flow problem

The Optimal Power Flow (OPF) problem is a crucial optimization challenge extensively applied in modern energy systems. It involves a network of electrical buses (i.e., connection points between power lines, where load or generators can be located), denoted by $N$, interconnected by $E$ branches, (i.e., power lines or transformers). Each bus may host one or more generators, which inject power into the system, and loads, which consume it. The objective of the OPF problem is to minimize the total generation cost while adhering to the system’s physical constraints. In this work, we address the full alternating current (AC) version of this model, which more accurately represents real-world grid conditions. Specifically, we consider a set of generator buses $N_{g}$ and load buses $N_{d}$.
The AC-OPF problem can be formulated as follows, where $C_{r}$ represents the cost associated with operating generator $r$:

$$ $\displaystyle\min_{P_{g,i},Q_{g,i},V_{i},\theta_{i}}$ $\displaystyle\sum_{r\in N_{g}}C_{r}(P_{g,r})\quad\forall r\in N_{g}$ (1) s.t. $\displaystyle h_{i}(P_{g,i},Q_{g,i},V_{i},\theta_{i},P_{d},Q_{d})=0\quad \forall h_{j}\in H$ $\displaystyle g_{j}(P_{g,i},Q_{g,i},V_{i},\theta_{i},P_{d},Q_{d})\leq 0\quad \forall g_{l}\in G$ $$

The equality constraints $H$ represent the nodal balance equations:

$$ $H=\bigcup_{i\in N}\left\{P_{g,i}-P_{d,i}-g_{i}^{sh}=\sum_{(ij)\in E}p_{ij} \right\}\cup\left\{Q_{g,i}-Q_{d,i}+b_{i}^{sh}=\sum_{(ij)\in E}q_{ij}\right\}$ (2) $$

Here, the active power demand and generation at bus $i$ are denoted by $P_{d,i}$ and $P_{g,i}$ (in MW), while the reactive power demand and generation are $Q_{d,i}$ and $Q_{g,i}$ (in MVAr). The active power $p_{ij}$ and reactive power $q_{ij}$ flowing between buses $i$ and $j$ are governed by the power flow equations:

$$ $\displaystyle p_{ij}$ $\displaystyle=g_{ij}(\tau_{ij}V_{i}^{2})-V_{i}V_{j}\left(b_{ij}\sin(\theta_{ij })+g_{ij}\cos(\theta_{ij})\right)$ $\displaystyle q_{ij}$ $\displaystyle=-(g_{ij}+\frac{Sh_{ij}}{2})(\tau_{ij}V_{i}^{2})-V_{i}V_{j}\left( g_{ij}\sin(\theta_{ij})-b_{ij}\cos(\theta_{ij})\right)$ (3) $$

Here, $V_{i}$ is the voltage magnitude at bus $i$ (in volts), and $\theta_{i}$ is the phase angle (in degrees), with the phase angle difference between buses $i$ and $j$ denoted by $\theta_{ij}$. The grid characteristics include the conductance $g_{ij}$ and susceptance $b_{ij}$ of the transmission lines, shunt admittances $Sh_{ij}$(^1^11Shunt admittance represents the admittance between a bus and ground in the power system.), and transformer tap ratios $\tau_{ij}$. In addition, shunt elements, such as capacitors or inductors, are represented by fixed admittances to the ground: $g_{i}^{sh}$ (MW consumed) and $b_{i}^{sh}$ (MVAr injected).

The inequality constraints on the generator limits, for active and reactive power at each bus, are defined as:

$$ $G_{P}=\bigcup_{r\in N_{g}}\left\{P_{G,\min}\leq P_{g}\leq P_{G,\max}\right\}, \quad G_{Q}=\bigcup_{r\in N_{g}}\left\{Q_{G,\min}\leq Q_{g}\leq Q_{G,\max}\right\}$ $$

Similarly, the inequality constraints on voltage magnitudes $G_{V}$ and branch thermal limits $G_{S}$ are:

$$ $G_{V}=\bigcup_{i\in N}\left\{V_{i,\min}\leq V_{i}\leq V_{i,\max}\right\},\quad G _{S}=\bigcup_{(ij)\in E}\left\{(p_{ij})^{2}+(q_{ij})^{2}\leq|S_{\max,ij}|\right\}$ $$

where $|S_{\max,ij}|$ represents the maximum allowable apparent power(^2^22Apparent power $S$ in an AC circuit is the product of the RMS voltage and the RMS current, expressed as $S=V\times I^{*}$, or in terms of magnitude as $|S|=\sqrt{P^{2}+Q^{2}}$, where $P$ is the real power and $Q$ is the reactive power.) transferred between buses $i$ and $j$.
Thus, the total inequality constraints $G$ are given by the union of the constraints defined above:

$$ $G=G_{P}\cup G_{Q}\cup G_{V}\cup G_{S}$ (4) $$

We implement the model using the MATPOWER Zimmerman et al. () package, which employs the MATPOWER Interior Point Solver (MIPS) Zimmerman & Wang () solver, currently one of the most widely-used solvers for AC-OPF.

### 2.2 Physics Informed Neural Networks with Hard Constraints

Physics-Informed Neural Networks (PINNs) were first introduced in Raissi et al. () as a data-driven approach to solving problems governed by partial differential equations (PDEs). PINNs leverage automatic differentiation to compute high-order derivatives of the neural network, which is treated as the solution of a PDE, with respect to its inputs. Specifically, PINNs aim to learn the solution $u:I\times\Omega\subseteq\mathbb{R}^{m}\rightarrow\mathbb{R}^{n}$ of a differential problem $\mathcal{F}[u(\mathbf{x},t)]=0$ for $\mathbf{x}\in\Omega$ subject to suitable boundary and initial conditions, using a neural network $u_{\mathsf{NN}}$. The network is trained by minimizing the residuals $\mathcal{L}_{\mathcal{F}}$ associated with each equation in the differential problem. PINNs have been widely applied across various domains, including heat transfer problems Cai et al. (), fluid dynamics Cai et al. (), and power systems Misyris et al. (). Several variations of PINNs have been proposed to address issues such as structural instability Mai et al. (), improve accuracy Eshkofti & Hosseini (), or better approximate discontinuous solutions to hyperbolic equations De Ryck et al. ().

Physics-informed neural networks with hard constraints (hPINNs) were introduced in Lu et al. () to optimize an objective function $\mathcal{J}$ while incorporating equality constraints $h_{j}$, $\forall h_{j}\in H$ and inequality constraints $g_{l}$, $\forall g_{l}\in G$. This approach uses both the penalty method and the Augmented Lagrangian (AL) method. At each iteration $k$, it minimizes the loss function to identify the solution parameters $\mathbf{w}_{u}$:

$$ $\mathcal{L}^{k}(\mathbf{w}_{u}^{k})=\mathcal{J}(\mathbf{w}_{u}^{k})+\mu_{H}^{k }h(\mathbf{w}_{u}^{k})^{2}+\mu_{G}^{k}g(\mathbf{w}_{u}^{k})^{2}+\frac{1}{L} \sum\limits_{l=1}^{L}\lambda_{h_{l}}^{k}|h(\mathbf{w}_{u}^{k})|+\frac{1}{J} \sum\limits_{j=1}^{J}\lambda_{g_{j}}^{k}max(0,g(\mathbf{w}_{u}^{k}))$ (5) $$

where the adaptive coefficients $\mu_{G}^{k},\mu_{H}^{k}$ are increased by a factor $\beta$ at each step. The Lagrange multipliers $\lambda_{h_{l}}^{k},\lambda_{g_{j}}^{k}$ are updated based on the direction of the gradients $\nabla h_{j}$ and $\nabla g_{l}$ Lu et al. ().

### 2.3 Graph Neural Networks

GNN Scarselli et al. () are a class of machine learning models designed to process structured data. Since their introduction, they have been successfully applied in various domains, such as social networks Li et al. (), traffic networks Jiang & Luo (), and molecular dynamics Park et al. (). GNN can handle both graph-level and node-level tasks by updating the features of each node. In addition, they can apply a final learnable layer to aggregate the node features and make a prediction for the entire graph. Most GNN proposed in the literature share a common update mechanism known as message passing. As described in Gilmer et al. (), the message-passing update step in a GNN can be written as:

$$ $\mathbf{x}_{i}^{(k+1)}=\mathsf{COMBINE}^{(k+1)}\left(\mathbf{x}_{v}^{(k)}, \mathsf{AGGR}^{(k+1)}\left(\left\{\mathbf{x}_{u}^{(k)}\mid u\in\mathsf{ne}(i) \right\}\right)\right),\;0\leq k\leq K-1$ (6) $$

where $\mathbf{x}_{i}^{(k)}$ represents the features of node $i$ at iteration $k$, and $\{\mathsf{COMBINE}^{(k)}\}_{k=1,\dots,K}$ and $\{\mathsf{AGGR}^{(k)}\}_{k=1,\dots,K}$ are families of functions defined for each iteration up to depth $K$. Intuitively, the message-passing mechanism first collects information from the neighborhood of each node, denoted as $\mathsf{ne}(i)$, using the function $\mathsf{AGGR}^{(k)}$. The neighborhood $\mathsf{ne}(i)$ refers to the set of nodes connected to node $i$. The aggregated information is then combined with the existing information of node $i$ via $\mathsf{COMBINE}^{(k)}$. Finally, depending on the task, a $\mathsf{READOUT}$ function is applied.

GNN have been shown to be universal approximators for both graph-level and node-level tasks Azizian & Lelarge (); D’Inverno et al. (); Loukas (). We choose GNNs for our problem because they can effectively handle different topologies, in principle allowing a single model to be trained and applied across various power grids Varbella et al. (). GNN are also capable of adapting to variations in the topology itself, making them well-suited for the power system optimization Piloto et al. ().

### 2.4 Model Definition

The concepts and methods in Sections 2.2 and 2.3 are combined to solve the AC-OPF problem. We define the specific input and output structure in Section 3.1. Most importantly, each input sample is defined by $(P_{d},Q_{d})$, corresponding to a different loading condition of the power grid. The other grid parameters remaining constant are the generation limits, voltage limits, branch admittances, and branch thermal limits. The output at the $k$-th training iteration is denoted by $(P^{k}_{g},Q^{k}_{g},V^{k},\theta^{k})$.

Figure: Figure 1: Schematic of the PINCO method architecture. This diagram illustrates the input data (in red) and the output generated by the neural network (in green). The constant parameters specific to the power grid, as defined by the optimization problem in Section 2.1, are fed directly into the physics-informed loss function.
Refer to caption: extracted/5889696/figures/methodology/fig1ng.png

The original formulation of the AC-OPF can be included in a single expression, using Equation 5. This objective function is used as the loss function for the algorithm. By combining a GNN architecture with a physics-informed loss function, we develop a model for AC-OPF called PINCO that uses a Physics-Informed GNN for hard constraints.

## 3 Experiments on the IEEE benchmarks

The IEEE power system test cases are a widely recognized set of benchmarks frequently employed in power systems research. These test cases represent power grids with their respective characteristics and provide example demand scenarios. In this work, we apply our algorithm to the IEEE 9-bus, IEEE 24-bus, IEEE 30-bus, and IEEE 118-bus cases.

The IEEE 9-bus system Zimmerman et al. (), being one of the smallest test cases, includes 3 generator units, 3 loads, and 9 buses, making it a simple yet useful case for foundational testing. The IEEE 24-bus case Texas A&M University Engineering () has 32 generator units, with some buses containing up to 6 generators. After applying the node-splitting model (as explained in Section 3.1), this effectively becomes a 56-bus system with transformers and parallel lines, making it a small but intricate system ideal for demonstrating the model’s robustness. The IEEE 30-bus system comprises 6 generator units, 41 transmission lines, and 4 transformers Christie (). The largest test system we use is the IEEE 118-bus system, with 19 generators and 186 transmission lines and transformers Texas A&M University Engineering ().

### 3.1 Dataset structure

We model the electrical grid as a graph, with a set of nodes $N$ corresponding to electrical buses, and edges $E$ to model the branches. The graph is defined as $G=(N,E,\textbf{N},\textbf{A})$. We call $\textbf{N}\in\mathbb{R}^{|N|\times t}$ the node feature matrix, with $|N|$ equal to the number of nodes and t to the number of features per node, and $\textbf{A}\in\mathbb{R}^{|N|\times|N|}$ is the adjacency matrix. The elements of A, $a_{ij}$, are equal to 1 if there is an edge from node i to node j, and zero otherwise. We predict Y $\in\mathbb{R}^{|N|\times f}$, the node output matrix; thus, a vector of $f$ element is predicted for each node in $N$.

Figure 2 illustrates the structure of a power grid with its features. The input node features are depicted in red, while the output node-level predictions are in green. The input features include active power demand ($P_{d}$), reactive power demand ($Q_{d}$), and node type. The output features vary depending on the node type. For example, if a certain variable is known (e.g., buses without generators don’t require predictions for generated power), we apply a masking process during training. These masked values are represented by grey cells. The predicted output quantities include active power generation ($P_{g}$), reactive power generation ($Q_{g}$), voltage magnitude ($V$), and voltage angle ($\theta$).

We propose a method to manage buses that have multiple generators. Since each generator is associated with a unique cost, distinguishing between them is essential. To address this, we add an additional node for each extra generator. These nodes are ’artificial,’ as they do not correspond to an actual bus on the grid. For example, a bus with two generators, as shown in Figure 2, would be split into two distinct nodes, each linked to its own generator and connected via artificial lines. The voltage magnitude and angle of these artificial nodes are set to match those of the original node. In total, there are four possible node types, encoded as categorical variables: (1) load bus without a generator, (2) bus without load or generators, (3) original generator bus, and (4) artificial generator bus.

Figure: Figure 2: Power grid model as graph. The input features assigned to each node are red, and the predicted quantities at the node level are green. The zoom visualizes how multiple generators per node are modeled; the grey node is the artificial node created to account for additional generators at the node.
Refer to caption: extracted/5889696/figures/methodology/dataset.png

### 3.2 Evaluation metrics

The proposed method is unsupervised, aiming to solve a non-convex optimization problem. Given that even advanced solvers, such as MIPS, offer no guarantee of optimality for such problems, it becomes crucial to consider alternative metrics for assessing the model’s performance. Two fundamental metrics are typically used: (1) the total cost of the solution, which reflects the objective function of the optimization problem, and (2) limit violations, indicating any inequality or equality constraint violations (see Section 2.1). In addition, we introduce a performance metric, which measures the total amount of power deficit in the system. Thus, we quantify the deviation from satisfaction of the equality constraints as follows:

$$ $eq_{loss}=\sum_{S\in\{P,Q\}}\sum_{i\in N}\sum_{ij\in E}|S_{i}^{gen}-S_{i}^{ load}-s_{ij}|$ (7) $$

This metric captures the power deficit at each node, adhering to the principle of energy conservation, and is commonly referred to as the system’s ”equality loss.” Notably, this value is always non-zero, even for state-of-the-art solvers like the MIPS solver, as solving the AC-OPF problem exactly is typically computationally challenging and infeasible for large systems.

### 3.3 Experimental settings

All model experiments are conducted on the CPU nodes of the ETH Euler clusters (2023) (). Details regarding the hyperparameters used in these experiments and their selection process are in A.1.

## 4 Results

In this section, we evaluate the PINCO method of the various IEEE benchmark power systems. First, we assess its performance as a solver for a single demand scenario in Section 4.1. Then, in Section 4.2, we test the method’s hybrid capability to generalize across multiple demands, demonstrating its role as a universal function approximator while simultaneously solving the optimization problem. Our approach consistently achieves solutions with zero inequality constraint violations, rendering the need for an inequality violation-based metric unnecessary.

### 4.1 PINCO as a solver for a single loading condition

We initially performed experiments on a single instance, using the default demand specified in IEEE benchmark cases. These tests aimed to evaluate the method’s potential as a viable alternative to traditional nonlinear optimization solvers. Specifically, they served as a proof of concept to assess whether the algorithm could produce solutions competitive with those generated by state-of-the-art solvers like MIPS, which was used as a reference benchmark.

Figure: Figure 3: Average differences between solutions from PINCO and the MIPS solver on a logarithmic scale. Phase angle ($\theta$) and voltage magnitude ($V$) differences are averaged across all nodes and normalized by their maximum values. Active ($P_{g}$) and reactive power ($Q_{g}$) differences are averaged at generator buses and normalized by total demand.
Refer to caption: extracted/5889696/figures/results/image.png

Figure 3 presents the average differences between the solutions obtained by PINCO and the MIPS solver, displayed on a logarithmic scale. The absolute differences in phase angle ($\theta$) and voltage magnitude ($V$) are averaged across all nodes and divided over the maximum $V$ and $\theta$ values. The absolute differences in active and reactive power ($P_{g}$ and $Q_{g}$) are averaged only at buses with generators and normalized over the total active and reactive demand. It is important to note that in the case of IEEE118, there is no reference node, i.e. slack bus, which allows for arbitrary shifts in phase angle between the model and solver. As a result, phase angle comparisons for this case were omitted. While the MIPS solver and our solution may differ, this does not imply that either is incorrect.

**Table 1: Test results for single input demand profile using the custom evaluation metrics as defined in section 3.2.**
| Power Grid | PINCO Equality Loss [MW] | MIPS Equality Loss [MW] | Rel Cost Difference [%] |
| --- | --- | --- | --- |
| IEEE9 | 0.003 | 0.002 | 1.10 |
| IEEE24 | 0.040 | 6.500 | 0.63 |
| IEEE30 | 0.018 | 0.015 | 4.90 |
| IEEE118 | 0.067 | 20.000 | 1.20 |

efta :singleres provides a more comprehensive comparison by presenting the equality losses for both methods, with our model’s results listed under ’PINCO equality loss’ and the MIPS results under ’MIPS equality loss.’ In all cases, the cost differences are positive, indicating that our method consistently yields solutions that are slightly more expensive than MIPS.

For the simpler IEEE9 and IEEE30 cases, the model is able to produce solutions with similar equality losses and costs, meaning it finds physically feasible solutions, though they may be suboptimal in terms of cost. In the more complex IEEE24 and IEEE118 cases, it is noteworthy that the equality loss for MIPS is unexpectedly high. This highlights a key challenge in non-convex optimization: the solution is heavily influenced by the objective function’s formulation. The MIPS solver tends to focus on minimizing costs, even if that results in higher equality losses, especially when navigating a complex solution space. Conversely, our method prioritizes respecting equality constraints and finds solutions that are physically more accurate, while slightly more costly, i.e., 0.6% for IEEE24 and 1.2% for IEEE118.

### 4.2 PINCO as universal function approximator on multiple loading conditions

After evaluating PINCO’s performance as a solver, we proceeded to test its ability to function as a universal function approximator, capable of generalizing to unseen demand conditions while solving the problem directly without the need for labeled data.
For a given reference loading condition, the active and reactive power demands are sampled from a uniform distribution around 90% and 110% of their reference values. For each experiment, we generate 500 input demand samples. Therefore, the dataset for multiple loading conditions consists of W attributed graphs, denoted as $\mathcal{G}={G_{1},G_{2},\ldots,G_{W}}$, with each graph representing a different power grid loading condition. For all cases, the training, validation, and test datasets were created from a common set of generated inputs, which were then split respectively into 80%, 10%, and 10%. To evaluate PINCO’s generalization capability in addressing the AC-OPF under unseen loading conditions, we assess its performance on the test set and compare the results with those obtained from MIPS, utilizing the metrics detailed in Section 3.2.

**Table 2: Results for multiple loading conditions on the test set.**
| Power Grid | PINCO Equality Loss [MW] | MIPS Equality Loss [MW] | Cost Difference [%] |
| --- | --- | --- | --- |
| IEEE9 | 0.030 | 0.001 | 0.010 |
| IEEE24 | 4.300 | 6.500 | 0.880 |
| IEEE30 | 0.690 | 0.020 | 0.800 |
| IEEE118 | 16.000 | 20.000 | 1.100 |

Table 2 shows that our method produces solutions that are comparable to those of the MIPS solver. While the equality loss is higher by an order of magnitude for simpler cases like IEEE9 and IEEE30, PINCO achieves better equality losses for the more complex IEEE24 and IEEE118 cases, as seen also in the previous Section 4.1. Across all test cases, the model’s solutions exhibit only around a 0.8% increase in cost compared to the solver’s solution. Moreover, even in instances where PINCO underperforms, it offers a valuable trade-off due to its significant improvements in inference times (see Figure 4), which were obtained using the same setup. Our method in the inference phase is two orders of magnitude faster than MIPS.

Figure: Figure 4: MIPS and PINCO inference times in logarithmic scale, tested using the same conditions on the same device (2023) ().
Refer to caption: extracted/5889696/figures/results/inference_times_3.png

## 5 Limitations

Despite its strengths, the PINCO method exhibits some limitations. While inference is highly efficient, training the model remains computationally expensive, which can be a barrier to broader application. Depending on the grid size, the training can last from 10 to 24 hours. Additionally, when the model is trained on multiple demand scenarios, its ability to respect equality constraints requires further refinement to improve overall performance.
Another challenge is hyperparameter tuning. While we achieved results with minimal tuning (refer to A.1), the impact of hyperparameters warrants further investigation. Addressing these limitations will be crucial in fully leveraging the potential of PINCO for power grid optimization tasks.

## 6 Conclusions

In this study, we develop a physics-informed graph neural network-based method, namely PINCO. We evaluate the performance of the PINCO method to solve an optimization problem with hard constraints, i.e., the AC-OPF. We assessed its capability as a solver for a single-demand scenario and observed that it generalizes well to multiple demands. Thus, showcasing its role as a universal function approximator that solves optimization problems.

The method is tested on multiple IEEE benchmark systems, representing different grid topologies and sizes, with a focus on grids containing multiple generators. Across all tests, the PINCO demonstrates zero inequality constraint violations, highlighting its effectiveness in handling hard constraints. When applied as a solver, the PINCO provides solutions comparable to traditional solvers for the IEEE 9-bus and IEEE 30-bus systems. Moreover, it outperforms traditional solvers in reducing equality constraint violations for the more complex IEEE 24-bus and IEEE 118-bus systems, though this comes at a marginal cost increase of only 0.6% and 1.2%, respectively.

In scenarios where the PINCO is tested on multiple demands, its generalization performance for unseen loading conditions shows a slight deterioration in the equality constraint violations, while the associated costs remain comparable to traditional methods. However, the method’s computational advantage in the inference phase, being two orders of magnitude faster than traditional solvers, makes it a highly competitive alternative. Future work will focus on scaling the method to larger grids with more realistic loading conditions and addressing the N-1 AC-OPF problem in an unsupervised manner.

## Appendix A Appendix

### A.1 Hyperparameters

We report here all the hyperparameters used for the experiments. In Table 3, we present the hyperparameters for the experiments where a single loading condition is concerned. In this case, the architecture included 5 TransformerConv Shi et al. () layers followed by two linear layers with tahnshrink (^3^33$\text{Tanhshrink}(x)=x-\tanh(x)$) activation function. The hidden dimension is set to 24, with 4 attention heads in the transformer layer.

**Table 3: Experimental set up for experiments where the method is used as a solver, i.e. a single loading condition is considered. Hyperparameters and training conditions are reported**
| Power grid | Case9 | Case24 | Case30 | Case118 |
| --- | --- | --- | --- | --- |
| $\mu_{g}$ | 0.001 | 0.001 | 0.001 | 0.001 |
| $\mu_{h}$ | 0.1 | 0.1 | 0.1 | 0.1 |
| $\beta_{g}$ | 1.00002 | 1.00002 | 1.00002 | 1.00002 |
| $\beta_{h}$ | 1.00003 | 1.00003 | 1.00003 | 1.00003 |
| Epochs | 200000 | 200000 | 200000 | 200000 |
| Learning rate | 0.0005 | 0.0005 | 0.0005 | 0.0005 |
| $\gamma$ | 0.9995 | 0.9995 | 0.9995 | 0.9995 |

In Table 4, we report the ones for multiple loading conditions. In this case, the architecture is the same as the one used for a single loading condition, but 8 TransformerConv layers are employed. A batch size of 20 is used for these experiments.

**Table 4: Experimental set up for experiments where the method is used as a universal function approximator, i.e., 500 loading conditions are considered. Hyperparameters and training conditions are reported**
| Power grid | Case9 | Case24 | Case30 | Case118 |
| --- | --- | --- | --- | --- |
| $\mu_{g}$ | 0.001 | 0.001 | 0.001 | 0.001 |
| $\mu_{h}$ | 0.2 | 0.1 | 0.1 | 0.1 |
| $\beta_{g}$ | 1.00002 | 1.00002 | 1.00002 | 1.00002 |
| $\beta_{h}$ | 1.00003 | 1.00005 | 1.00005 | 1.00005 |
| Epochs | 160000 | 160000 | 160000 | 160000 |
| Learning rate | 0.0005 | 0.0005 | 0.0006 | 0.0005 |
| $\gamma$ | 0.9995 | 0.9995 | 0.9995 | 0.9996 |

The models are trained using an initial learning rate, as shown in Tables 3 and 4, with an exponential learning rate schedule that reduces the learning rate by a factor, $\gamma$, every ten epochs. While the initial learning rate does not significantly impact the training results, selecting a small value for $\gamma$ can slow down the learning process, causing the optimizer to prematurely converge to a local minimum. The hyperparameters related to the h-PINN method Lu et al. (), such as $\mu_{g}$, $\mu_{h}$, $\beta_{g}$, and $\beta_{h}$, were chosen through a grid search, centered around the values suggested in the original paper.

## Peer Reviews

confidence: 4
contribution: 1
initial_rating: 3
presentation: 1
questions: — If the model is completely unsupervised, why are only 500 demand samples used?

— What are the specifications of the computing hardware cluster (ETH Euler Clusters), and how long are the models trained?

— How does the model shown in Figure 1 differ from existing PINN models? If it does not differ, appropriate citations should be provided.

— In the abstract, the authors highlight the limitation of interior-point methods in achieving global optimality. While this is correct due to the NP-hard nature of ACOPF, how does the current method address this limitation?

--The authors mention that the MIPS equality loss reaches up to 20 MW in case of 118-Bus system Table 2. What does this imply?  Does it mean that MIPS is unable to find a feasible solution? In general, interior point methods yield feasible but potentially suboptimal solutions. Authors should clarify and explain the reasons behind high loss via MIPS, and under what conditions MIPS is failing to converge to any feasible solution.
soundness: 1
strengths: -- Attempting to solve a very relevant problem in the form of ACOPF.
-- Idea of using PINNs and GNN together is a strength.
summary: The paper presents a GNN-based approach to address the ACOPF problem, with the primary aim of reducing the computation time required by traditional interior-point solvers to enable faster ACOPF solutions. It leverages a physics-informed loss function incorporating penalties for both equality and inequality constraints. The grid model is represented as a graph, having real and reactive power demand, along with node type as inputs. Experimental results are provided, comparing the proposed approach with the MIPS solver across both single and multiple load scenarios.
weaknesses: — The authors’ claim of being the first to use a PINN for solving the ACOPF problem must be clarified against the various existing works [1]-[2]. There are several works already using PINNs, in both supervised and unsupervised learning settings. There exists a substantial body of work under end-to-end learning that relates to this area, for example: [1]-[2].

— The issue mentioned above seems to stem from an incomplete literature review. For example, [1] presents a survey on end-to-end learning methods for constrained optimization, the general class of optimization problems to which ACOPF belongs. Many works listed there use PINNs in either supervised or unsupervised fashions. Additionally, several key references such as [2]-[4] are not discussed in the paper. Furthermore, the use of GNNs for the ACOPF problem is also not a unique contribution, as noted by the authors themselves. Authors should clearly discuss the limitations of these works and highlight how their work differs from them and provide advantages. 

— Experimental studies: The results presented are limited in terms of the number of experiments and comparative analysis. No comparisons are made to existing ML methods.   Authors must compare the results with various ML methods. For example, the cost difference with the proposed method is significantly higher than that achieved by various ML methods for ACOPF.



[1] Kotary, James, Ferdinando Fioretto, Pascal van Hentenryck, and Bryan Wilder. "End-to-End Constrained Optimization Learning: A Survey." In 30th International Joint Conference on Artificial Intelligence, IJCAI 2021, pp. 4475-4482. International Joint Conferences on Artificial Intelligence, 2021.
[2] Seonho Park and Pascal Van Hentenryck. Self-supervised primal-dual learning for constrained optimization. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 37, pp. 4052–4060, 2023.
[3] Ferdinando Fioretto, Terrence WK Mak, and Pascal Van Hentenryck. Predicting ac optimal power flows: Combining deep learning and lagrangian dual methods. In Proceedings of the AAAI conference on artificial intelligence, volume 34, pp. 630–637, 2020.
[4] Priya Donti, David Rolnick, and J Zico Kolter. Dc3: A learning method for optimization with hard constraints. In International Conference on Learning Representations, 2021.

---

confidence: 4
contribution: 2
initial_rating: 5
presentation: 4
questions: - Could the authors elaborate on the ML-specific challenges encountered when modeling more than one generator per electrical bus? Is there a fundamental challenge that has prevented past approaches from addressing such cases, or is this simply a modeling choice that the authors address by introducing artificial nodes?

- When solving the IEEE 118-bus problem, any node can be designated as the reference node by including the reference bus angle as an equality constraint in the OPF optimization problem. Could the authors clarify why phase angle comparisons are not included in their evaluation?

- The comparisons in Figure 3 could benefit from additional context. While the differences between the MIPS solver and the proposed solution are shown, it’s not immediately clear how these absolute differences inform the effectiveness of the model, given that the OPF objective is primarily centered on minimizing generator operating costs. Could the authors clarify the purpose of Figure 3 and what specific insights they intended to convey through these comparisons?

- To enhance interpretability, it might be useful to include visualizations that track the evolution of equality loss and relative cost differences throughout training. This could provide more relevant insights into how well the model aligns with the OPF objective over time.

- As noted in the weaknesses, the current formulation focuses on a *single* fixed network topology for each power system case. However, in real-world applications, system operators often encounter dynamic topologies due to changes in operational conditions. Formulating the OPF learning problem to accommodate time-varying grid topologies is more relevant and such a formulation would also give rise to ML modeling challenges that could inspire innovative techniques tailored to real-world needs, potentially making a stronger contribution to both the ML and power systems communities.
soundness: 3
strengths: - The paper is clear in its exposition and is well-structured that makes the contributions and methodology easy to follow.
- Prior work is clearly acknowledged, and the authors effectively situate their approach within the existing body of research
- The authors make effective use of established methodologies to tackle the AC-OPF problem through an unsupervised learning approach with a focus on ensuring feasible AC-OPF solutions
- Experimental results do highlight feasible AC-OPF solutions quantified via the Equality Loss at the expense of slightly higher cost difference (which is inevitable given the data-driven model).
- The authors also showcase the additional benefits such as faster inference times
summary: - This paper introduces PINCO, a physics-informed graph neural network (GNN) designed to approximate solutions for the frequently employed Alternating Current Optimal Power Flow (AC-OPF) problem in power transmission networks. By leveraging existing independent tools like physics-informed NNs and GNNs, PINCO distinguishes itself from prior approaches by better adhering to the inequality constraints of the AC-OPF problem, thereby enhancing solution feasibility in a data-driven framework.
weaknesses: - *Novelty*: The novelty of this approach appears limited, as it primarily relies on well-established tools like GNNs and PINNs. The work could further benefit from clearer differentiation that goes beyond simply combining existing frameworks. For e.g., did the authors explore architectural modifications to the GNN tailored to the characteristics of power transmission networks, or a customized optimization technique designed for AC-OPF? This could significantly enhance the paper’s originality within the ML domain.

- *Scope*: The current approach also presents practical concerns in real-world applications. In practice, power system operators frequently adjust network topology due to maintenance, unplanned outages, and other operational needs, leading to variations in the grid adjacency matrix for a *given* power system test case. Based on the paper’s description, the proposed model would need re-training from scratch for each such new grid adjacency matrix, which presents a notable limitation. Did the authors explore methods to make their model more adaptable to changing topologies for a given test case (even if the cost of the OPF solution is relatively high)? Developing a more flexible framework that can accommodate such variations within a single model would make the approach far more practical than showcasing the performance results across multiple IEEE benchmark systems.

---

confidence: 5
contribution: 2
initial_rating: 1
presentation: 3
questions: There has been a lot of work on ACOPF (some are cited in the paper). The authors should compare against some of these, in addition to standard solvers. 
What happens when the problem is infeasible? Presumably the neural network would still output something, but would one be able to tell that there is actually no solution?
soundness: 2
strengths: - ACOPF is an important problem in grid operations. 
- The paper is easy to read, and the results seem correct.
summary: This paper considers a physics-informed graph neural network, PINCO, to solve the AC-OPF problem. Using standard test cases, it shows that proposed method is faster than standard nonlinear solvers. Some generalization properties are discussed.
weaknesses: - In my opinion the main weakness of the paper is that the result isn't that good. In the sense that the main goal of the paper is to find feasible solutions, and I don't think that goal is accomplished.
- In Figure 3, the violations of $P, \theta, Q,$ and $V$ are shown. But the violations can be pretty large, especially for $Q$ and $V$. One of the reasons ACOPF is ran is to handle the V/Q constraints, and having a 10% error is not great. 
- Table 2 reports the "equality constraint" violations when the input load scenarios changes. But this violation can be 16 MW, which is again not a small number. I don't think operators would be likely to accept these types of violations. Although the nonlinear solver can be slow, but the problem can be resolved when the load changes. 
- The approaches in the paper is based on generic methods, and can be applied to any constrained optimization problem. It would be good to see if there is anything special about the ACOPF when applying the method.

---

confidence: 4
contribution: 2
initial_rating: 3
presentation: 3
questions: Q1. Any specific design in the GNN+PINN architecture?
Q2. Solvers using GNNs or PINNs shall be included as baselines to show the usefulness of having both in a single architecture.
Q3. It is not clear why the proposed PINCO would improve upon the PINNs with hard constraints approach? This shall be clarified as well as evidenced using numerical comparison against a number of benchmark test systems.
Q4. Physics-informed GNN based power system state estimation (PSSE) was among the first use of NN architecure for power systems and they shall be discussed as a motivation of using deep learning for power systems.
soundness: 3
strengths: + A new model combining the GNNs and PINNs for solving AC-OPF
+ Promising numerical performance relative to MIPS solver
summary: This paper presents PINCO, a neural architecture for solving the AC-OPF problem. PINCO is a combination of GNN + PINNs with hard constraints. Numerical tests show the usefulness of the proposed model.
weaknesses: - Both GNNs and PINNs have been used for solving AC-OPF, and the paper directly combines the two without much novel design in the architecture.
- Insufficient comparison against other numerical solvers for AC-OPF of distribution systems including e.g., using GNNs, PINNs, SDP relaxation and SOCP relaxation, and linear-OPF initialized Newton-Raphson method in terms of performance.

---

confidence: 5
contribution: 1
initial_rating: 1
presentation: 1
questions: In the absence of a fundamentally new architecture or training scheme, to be accepted, this paper should:
* conduct numerical experiments on systems with at least 10,000 buses...
* ... with a more realistic data distribution than independently perturbing individual loads;
* demonstrate the proposed architecture's ability to handle varying topologies;
* achieve training times of at most 8hrs (this is the kind of timeline that would be needed for practical applications);
* achieve low constraint violation (in the order of $10^{-4}$ relative violation) and optimality gap (no more than $0.1$% worse than Ipopt);

It should be noted that each of the above bullet has been addressed in the literature, at least individually.
For instance, there exist works that scale to 10,000-bus systems, works that consider more realistic data distributions, works that achieve low constraint violations, etc...
soundness: 2
strengths: The proposed methodologies has two positive aspects
* it uses a graph-based architecture, which supports changes in grid topology (however this capability was not demonstrated)
* it uses a self-supervised training scheme that does not require the (expensive) use of an optimization solver to generate data

However, neither of these are new, and the paper suffers from multiple limitations (see below).
summary: This paper presents a graph neural network architecture for solving AC Optimal Power Flow models.
The paper describes a physics-informed loss for training the model in a self-supervised manner, and conducts numerical experiments on systems with up to 118 buses.
weaknesses: Limitations of the methodologies / experiments:

* The paper incorrectly states that previous works do not handle multiple generators per bus.
  * _Confidence-Aware Graph Neural Networks for Learning Reliability Assessment Commitments_ (https://doi.org/10.1109/TPWRS.2023.3298735) consider graph neural network architectures for unit-commitment problems, and present an encoder-based mechanism for handling multiple generators per bus
  * _CANOS: A Fast and Scalable Neural AC-OPF Solver Robust To N-1 Perturbations_ (https://arxiv.org/abs/2403.17660) does support such features:
    _We also use artificial edges to connect the subnodes to their respective bus (these do not model any physical equipment)._
  * It should be noted that handling multiple generators at a single bus is not a hard task, as they can easily be aggregated into a single generator; an aggregated solution can then be disaggregated in closed-form.

* I believe the augmented Lagrangian in Eq. (5) is incorrect, specifically the term $\mu_{k} g_{j}(w_{u}^{k})^2$.
  Assuming inequality constraints are of the form $g(w) \leq 0$, this quadratic term effectively drives all inequality constraints towards being binding (i.e. $g(w) = 0$), which is not theoretically sound.

* The paper argues that the use of a graph neural network supports changes in the grid topology, but does not present experiments that corroborate this claim

* The paper claims that the proposed model can achieve "zero violation of inequality constraints." This is not a substantial achievement, given that said inequality constraints are either simple variable bounds (which can be enforced via a bounded activation function) or simple l2 norm constraint (which can also be enforced by a simple scheme). The complexity of AC-OPF is in satisfying _both_ equality and inequality constraints. It is straightforward to enforced either set of constraints separately (i.e. only equality or only inequality constraints).

* Numerical experiments consider AC-OPF instances on systems with up to 118 buses. This is 100x smaller than real-life instances, which comprise (at least) in the order of 10,000 buses. 

  It should be noted that several works have trained ML models to predict AC-OPF with systems of that scale:
  * _Spatial Network Decomposition for Fast and Scalable AC-OPF Learning_ (https://doi.org/10.1109/TPWRS.2021.3124726)
  * _Compact optimization learning for AC Optimal Power Flow_ (https://arxiv.org/abs/2301.08840): up to 30,000 buses
  * _CANOS: A Fast and Scalable Neural AC-OPF Solver Robust To N-1 Perturbations_ (https://arxiv.org/abs/2403.17660): up to 10,000 buses, and also uses graph neural network architectures

* Training times appear to be very large (10 to 24 hours as reported in Section 5). Given that the paper only considers very small artificial systems, it is not clear that the proposed scheme would scale to real-life systems. A reasonable target would be at most 6-8hrs of training time on a systems with about 10,000 buses.

* Numerical experiments do not compare against any existing ML methodology for AC-OPF problems.

Issues about the paper:
* Not all notations are properly defined. For instance, the formalism of equality and inequality constraints is not defined before the Augmented Lagrangian presented in Eq. (5). Similarly, this equation uses a parameter $w^{k}_{u}$ that is not defined.
* the paper does not present the data distribution used to train the model. It should be noted that generating data by perturbing individual loads independently is not realistic, as it leads to a very narrow variability in total demand.

  Note that there are open-source datasets and data generators for AC-OPF problems, e.g.:
  * OPFData (https://arxiv.org/html/2406.07234v1) is an open-source dataset of AC-OPF instances and their solutions
  * OPFGenerator (https://github.com/AI4OPT/OPFGenerator) is an open-source instance generator for various OPF formulations

* In addition to the comments, above, the paper sometimes makes misleading claims. For instance, at lines 88-89, it is stated that "INCO allows for solving the AC-OPF **without violations**." This claim is not substantiated by the results reported in Section 4 (Tables 1 and 2).

Meta-review: This paper addresses the challenges of integrating intermittent renewable energy sources, by enhancing the Alternating Current Optimal Power Flow (AC-OPF) process. AC-OPF is a fundamental optimization problem in power systems that ensures safe and cost-effective grid operation. While traditionally solved using linearized approximations or non-linear solvers like the interior point method, these approaches face limitations, such as inaccuracies, convergence issues for large systems, and lack of global optimality.

The paper introduces PINCO, a physics-informed graph neural network (GNN) framework designed to solve AC-OPF efficiently. PINCO models the power grid as a graph, incorporating real and reactive power demand along with node types as inputs. It employs a physics-informed loss function that enforces equality and inequality constraints, enabling the method to produce accurate and feasible solutions. Unlike traditional methods, PINCO achieves results in a fraction of the computational time, generalizes effectively across diverse loading conditions, and handles multiple generators per bus with minimal adjustments to hyperparameters.

Experimental results demonstrate that PINCO outperforms traditional solvers, such as the MIPS solver, in both single and multiple load scenarios. It functions as both a solver and a hybrid universal function approximator, ensuring compliance with inequality constraints while maintaining adaptability to various power systems. Overall, PINCO addresses the critical need for scalable, fast, and accurate solutions to AC-OPF, paving the way for better management of power grids in the context of the energy transition. It highlights the potential of machine learning, particularly GNNs, in optimizing complex, non-linear power system challenges.

The reviewers raise several major issues, the most important of which is the lack of a thorough and fair review of the existing literature. This leaves the paper's contribution unclear, given the existing literature. Furthermore, the reviewers criticize the novelty, the level of empirical evidence, and the actual improvements brought about by the proposed PINCO approach. Collectively, the concerns significantly outweigh the merits of the paper. 

The authors are encouraged to consider the reviewers' comments to improve the contribution and presentation of the paper.

Decision: Reject