# OPF-Learn: An Open-Source Framework for Creating Representative AC Optimal Power Flow Datasets

arXiv: https://arxiv.org/abs/2111.01228 · HTML: https://mlsanity.com/paper/2111.01228/

## Key facts

- Cited by 18 papers in the map (data through 14 Oct 2026).
- Builds on 13 of its 27 references that are in the map.
- First posted on arXiv 1 Nov 2021.

## Builds on (most cited first, 13 of 13)

- [Predicting AC Optimal Power Flows: Combining Deep Learning and Lagrangian Dual Methods](https://mlsanity.com/paper/1909.10461/) (2019)
- [Learning Optimal Solutions for Extremely Fast AC Optimal Power Flow](https://mlsanity.com/paper/1910.01213/) (2019)
- [The Power Grid Library for Benchmarking AC Optimal Power Flow Algorithms](https://mlsanity.com/paper/1908.02788/) (2019)
- [JuMP: A Modeling Language for Mathematical Optimization](https://mlsanity.com/paper/1508.01982/) (2015)
- [PowerModels.jl: An Open-Source Framework for Exploring Power Flow Formulations](https://mlsanity.com/paper/1711.01728/) (2017)
- [Learning Warm-Start Points for AC Optimal Power Flow](https://mlsanity.com/paper/1905.08860/) (2019)
- [Learning to Solve the AC-OPF using Sensitivity-Informed Deep Neural Networks](https://mlsanity.com/paper/2103.14779/) (2021)
- [Smart-PGSim: Using Neural Network to Accelerate AC-OPF Power Grid Simulation](https://mlsanity.com/paper/2008.11827/) (2020)
- [DeepOPF-V: Solving AC-OPF Problems Efficiently](https://mlsanity.com/paper/2103.11793/) (2021)
- [High-Fidelity Machine Learning Approximations of Large-Scale Optimal Power Flow](https://mlsanity.com/paper/2006.16356/) (2020)
- [Efficient Creation of Datasets for Data-Driven Power System Applications](https://mlsanity.com/paper/1910.01794/) (2019)
- [Learning an Optimally Reduced Formulation of OPF through Meta-optimization](https://mlsanity.com/paper/1911.06784/) (2019)
- [AC-Feasibility on Tree Networks is NP-Hard](https://mlsanity.com/paper/1410.8253/) (2014)

## Built on by (most cited first, 18 of 18)

- [CANOS: A Fast and Scalable Neural AC-OPF Solver Robust To N-1 Perturbations](https://mlsanity.com/paper/2403.17660/) (2024)
- [OPFData: Large-scale datasets for AC optimal power flow with topological perturbations](https://mlsanity.com/paper/2406.07234/) (2024)
- [PGLearn -- An Open-Source Learning Toolkit for Optimal Power Flow](https://mlsanity.com/paper/2505.22825/) (2025)
- [Closing the Loop: A Framework for Trustworthy Machine Learning in Power Systems](https://mlsanity.com/paper/2203.07505/) (2022)
- [PFDelta: A Benchmark Dataset for Power Flow under Load, Generation, and Topology Variations](https://mlsanity.com/paper/2510.22048/) (2025)
- [Massively Digitized Power Grid: Opportunities and Challenges of Use-inspired AI](https://mlsanity.com/paper/2205.05180/) (2022)
- [Gradient-Enhanced Physics-Informed Neural Networks for Power Systems Operational Support](https://mlsanity.com/paper/2206.10579/) (2022)
- [GENCO - A Unified Neural Solver Embedded in a Development Framework for Steady-State Grid Analysis](https://mlsanity.com/paper/2608.09921/) (2026)
- [Optimal Power Flow Based on Physical-Model-Integrated Neural Network with Worth-Learning Data Generation](https://mlsanity.com/paper/2301.03766/) (2023)
- [gridfm-datakit-v1: A Python Library for Scalable and Realistic Power Flow and Optimal Power Flow Data Generation](https://mlsanity.com/paper/2512.14658/) (2025)
- [Constrained Diffusion Models for Synthesizing Representative Power Flow Datasets](https://mlsanity.com/paper/2506.11281/) (2025)
- [Beyond the Neural Fog: Interpretable Learning for AC Optimal Power Flow](https://mlsanity.com/paper/2408.05228/) (2024)
- [Partially-Supervised Neural Network Model For Quadratic Multiparametric Programming](https://mlsanity.com/paper/2506.05567/) (2025)
- [Revisiting Deep AC-OPF](https://mlsanity.com/paper/2509.00655/) (2025)
- [Exploring Variational Graph Autoencoders for Distribution Grid Data Generation](https://mlsanity.com/paper/2509.02469/) (2025)
- [Generating adversarial inputs for a graph neural network model of AC power flow](https://mlsanity.com/paper/2602.17975/) (2026)
- [Scalable Self-Supervised Learning for Multiphase AC-OPF in Distribution Systems with Topology Reconfiguration](https://mlsanity.com/paper/2608.25095/) (2026)
- [ML-OPF-Bench: Benchmarking Machine Learning for Optimal Power Flow](https://mlsanity.com/paper/2610.04307/) (2026)

## Abstract (arXiv)

Increasing levels of renewable generation motivate a growing interest in data-driven approaches for AC optimal power flow (AC OPF) to manage uncertainty; however, a lack of disciplined dataset creation and benchmarking prohibits useful comparison among approaches in the literature. To instill confidence, models must be able to reliably predict solutions across a wide range of operating conditions. This paper develops the OPF-Learn package for Julia and Python, which uses a computationally efficient approach to create representative datasets that span a wide spectrum of the AC OPF feasible region. Load profiles are uniformly sampled from a convex set that contains the AC OPF feasible set. For each infeasible point found, the convex set is reduced using infeasibility certificates, found by using properties of a relaxed formulation. The framework is shown to generate datasets that are more representative of the entire feasible space versus traditional techniques seen in the literature, improving machine learning model performance.
