Manuscript Offprint
arXiv:2610.40918Fast and Accurate Hydro Unit Commitment
Shaked Regev and Evan J. R. Brody
Oak Ridge National Laboratory
1 Bethel Valley Road
Oak Ridge, Tennessee, USA
Abstract—We introduce a fast novel algorithm to commit hydro-generators. We show that our algorithm can commit 56 generators for 200 days 10,000 times faster than Hexaly, the leading commercial solver for scheduling problems, without sacrificing solution quality. Our method can commit 1792 generators for an entire year in approximately 20 seconds on commodity hardware. Hexaly is unable to solve problems of this size in reasonable time. We attain this runtime improvement by introducing a greedy-heuristic tailored for hydro units. We provide a direction for a possible proof that the error our solver makes decreases with the problem size. This is supported by our experimental results. We prove that our solver's runtime scales log-linearly in the number of generators and time periods.
Index Terms—unit commitment, power systems, hydro generators, long term scheduling
I. INTRODUCTION
Hydropower is the main naturally replenishing, quickly dispatchable, and zero marginal cost generation source worldwide. Further, it can react quickly to respond to changing grid conditions and can start up with no supporting electricity, for example after a blackout [1]. Worldwide it accounts for about 14% of total electricity generation [2].
Co-optimizing hydro units with traditional, fuel-consuming units is essential to reduce generation costs while properly managing water levels. This is known as long term hydrothermal scheduling (LTHS) [3]. We focus on hydropower reservoirs, which are charged uncontrollably by rainfall and discharged controllably, subject to water balance constraints [4]. We defer pumped hydropower, which functions as a battery with controllable charging and discharging [5], to future work.
The main challenge in solving LTHS is that traditional units must be highly optimized over relatively short time scales to reduce costs. However, hydro units main cost is an opportunity cost, i.e. if they run now, they may not be able to run later. This means they must be optimized over long (typically yearly) time-horizons [3], [6].
Notice: This manuscript has been authored by UT-Battelle, LLC, under contract DE-AC05-00OR22725 with the US Department of Energy (DOE). The US government retains and the publisher, by accepting the article for publication, acknowledges that the US government retains a nonexclusive, paid-up, irrevocable, worldwide license to publish or reproduce the published form of this manuscript, or allow others to do so, for US government purposes. DOE will provide public access to these results of federally sponsored research in accordance with the DOE Public Access Plan (https://www.energy.gov/doe-public-access-plan). Research sponsored by the Laboratory Directed Research and Development Program of Oak Ridge National Laboratory, managed by UT-Battelle, LLC, for the US Department of Energy.
Existing work typically uses relatively slow LTHS solvers, which cannot run frequently. Therefore they require relatively accurate rainfall predictions or methods to deal with the inaccuracies of said predictions [7], [8]. This introduces a tradeoff between optimizing for low generation costs and meeting contingencies in the mean and allowing for sufficient slack to account for inevitable large deviations from predictions .
Instead, knowing that forecasts will frequently fluctuate, we focus on developing a very fast solver for committing hydro units, which can be rerun every 5 minutes without contributing substantially to the overall time to solve LTHS. Our solver can consider long term predictions, but is agile enough to adapt as they change. It is designed primarily for grids where hydropower accounts for a relatively small percentage of total electricity generation, such as the US, where it is about 6% [10]. The main contributions of this paper are:
• Introducing a fast, scalable log-linear algorithm for scheduling hydro units as an alternative to existing exponential ones.
• Showing that in all of our tests, our solvers produce solutions with identical objective values to a commercial solver in much less time. Our solutions are always feasible, with no constraint violations, and within tolerance of the lower bound on the optimum.
• Providing some analytical guarantees on the accuracy and runtime of our algorithms.
Some limitations on the scope of this study include:
-
Our grid model does not include transmission constraints. One can run our algorithm on a zonal level to set target production periods for the hydro units. Then one can add these targets to the objective function and solve a full alternating current optimal power flow (ACOPF) problem [11] to guarantee feasibility.
-
Our solver is not a general solution for all integer programs or scheduling problems.
The paper is organized as follows: Section II introduces our long-horizon planning hydro unit commitment (UC) problem formulation and algorithm. Section III explains the details of the data acquisition and simulation setup. Section IV compares our solver with the commercial solver Hexaly [12]. Section V summarizes our results and future research directions.
For example, in January-September 2026, rainfall was 8% lower on average in the US compared to the same period in 2025. Some states received less than 75% of 2026 rainfalls [9].
II. MATHEMATICAL FORMULATION
Frequency vs Marginal Cost and Demand (PJM Scale)
We now introduce a mathematical formulation for the problem of committing hydro units. This approach is intended to be used to commit hydro units before committing traditional units. This decoupling is justified because hydro units recharge by natural water flow and cannot indefinitely hoard water due to dam capacity. So as long units maintain high water levels long term, there is little opportunity cost.
Hydro units are fast ramping [13] and typically have a narrow efficient operation regime [14]. Here, we make the simplifying assumptions that hydro units can only be on at max capacity or off, the starting water levels are far away from 0 and the maximum dam capacity, and water evaporation rates are independent of water levels.
We denote by the amount of water projected to flow into reservoir over a certain time window . We denote by the water required for hydro unit to produce electricity in one time period. The number of time periods it can operate within window is . This reduces our problem to finding in which periods to operate each unit.
Hydro generators not being able to run all of the time (or even most of it) means they require optimizing over long-term, for example yearly, cycles. We therefore design a method to commit hydro generators based on shifting predicted demands. For this purpose, we introduce the notion of the marginal cost of the system.
The marginal cost of a UC of traditional generators is the cost difference to produce slightly more or less power. Consider a cost model unit 's production
where if the unit is off and 1 if it's on, is the power produced by the unit, and are cost coefficients. If , unit 's marginal cost is undefined (it cannot produce slightly more or slightly less power). If , the marginal cost of a unit with the production profile of Eq. (1) is its derivative with respect to , .
Each is limited between some maximum and minimum due to production and ramping capabilities. All on units not at the feasibility boundary must have the same marginal cost at the optimal solution. Otherwise, shifting one unit's production up and one down would reduce cost. We define the marginal cost of the system as for one such of these units .
We derive marginal costs from the solutions to a UC problem with traditional generators [15]. Fig. 1 shows how commonly certain demands coincide with certain marginal costs. A high demand always leads to high marginal costs and low demand always leads to low costs. There are small deviations in this trend due to periods that are less constrained by future generation requirements and “free” power from ramping generators.
Fig. 2 shows 1, 2, and 3 degree polynomial fits of the marginal cost to the demand, with their adjusted R-squared

Fig. 1. Histogram of the frequency of demand-marginal cost pairs (counts) at the PJM scale. Marginal cost and demand are highly positively correlated. All rows and columns have at most 3 adjacent nonzero boxes, most have 2. This shows that outliers do not deviate much.
. The difference between minimum and maximum demand to difference between minimum and maximum marginal cost further motivates a cubic fit. A 4th degree increased less than 0.1% and made no visual difference.

Fig. 2. Polynomial fits of marginal cost as a function of demand. Marginal cost and demand are highly positively correlated, with a few outliers. The degree 3 polynomial has the largest adjusted R-squared () and is visually most similar to the data. The relative scale of the axes also suggests a cubic fit. The linear term is always dominant and positive. This suggests it is almost always better to shift net demand from high demand periods to low demand periods with hydropower or storage.
The linear term is dominant in all the fits shown here. The linear term of the 4 degree fit has a non-dominant negative coefficient, a clear sign of over-fitting, based on visual inspection of the data.
This fit motivates the heuristic of using hydropower to prefer reducing demand from high demand periods over low demand periods. This is also known as load flattening or peak shaving. It also shows that even if pumped storage (or any other battery) does not retain energy perfectly, i.e. it can discharge a smaller amount than it charges, it can still be well worth-while to shift demand from low to high demand periods.
We define the demand remaining after hydro-generator commitment at time t optimized over T time periods as , where is the power hydro-generator i can produce. Smoothing out will lead to lower overall costs, because the marginal cost is highest when demand is highest. This leads to the following optimization problem:
In a production setting, one would supplement this solve with a fast full ACOPF solve [11], which could potentially change the commitments of the hydro units. This could be combined with new rainfall forecasts. Solving Eq. (2) exactly
Algorithm 1 Demand Balancing
Require: Capacities , maximum operating periods for ; demands for
1: Generated hydro-power at period
2: Initialize indexed max-heap with keys
3: used Tracks assignments
4: Re-index such that Improves numerical stability
5: for to do
6: placed
7: while placed < do
8:
9: if used then
10: Set and update
11: else
12: used
13: placed placed + 1,
14:
15: Update in
16: end if
17: end while
18: for to do
19: if then
20: Update in
21: end if
22: end for
23: end for
24: return
is NP-hard (see Theorem 2 in Appendix B). Algorithm 1 approximates a solution by “greedily” assigning a generator which still has remaining periods to the period with the highest remaining demand. This is equivalent to locally optimizing Eq. (2). Algorithm 1 runs in log-linear time (see Theorem 3 in Appendix B).
In the contiguous US, the median capacity factor is 36 – 39%, with large variance [17]. In the absence of more granular data, we assign different capacity factors between 28 and 47% to the generators to test Algorithm 1. This gives us a base set of 56 hydro-generators for PJM's demand. For our scaling experiments, we multiply the total demand by a factor N, and create N - 1 noisy copies of the generators to commit. The copies have a capacity that shifted up to from the original generator, and can operate up to periods within a 24 hour time window compared to the original generator.
Due to the long run times required for comparison over thousands of time periods at many different scales, we run Algorithm 1 and our comparisons on a particular dataset. We scale this dataset and perturb it randomly to ensure our method is robust. This is the limit of our scope.
IV. RESULTS
We compare our specialized solver for Eq. (2) to the commercial integer program solver Hexaly [12]. Hexaly specializes in general integer optimization scheduling problems with many constraints, such as Eq. (2).
Fig. 3 compares the relative differences between the solutions produced by Algorithm 1 and a full integer program solve with Hexaly with the lower bound on the optimum. Algorithm 1 consistently has a relative error below . Hexaly always produces solutions with a lower error than the tolerance. This was true even when we tested it with stricter tolerances. Hexaly reported timeout errors (even before it met the time limit) for problems larger than in Fig. 3.
Relative Error of Objective and Bound

Fig. 3. Algorithm 1 difference from the lower bound on the optimum compared to Hexaly integer program solver for committing 56 generators for different time horizons. Both solvers consistently produce solutions with objective deviations within tolerance of the lower bound.
Fig. 4 compares run times of Algorithm 1 and Hexaly. Algorithm 1 is 1000 times faster on the smallest problem we tested and this gap grew with the problem size.

Fig. 4. Algorithm 1 runtime compared to Hexaly integer program solver for committing 56 generators for different time horizons. Algorithm 1 gets much faster solutions, a gap that increases roughly linearly in the problem size. It was almost 10,000 times faster on the largest problem shown here.
Fig. 5 shows normalized , where is the number of generators. is normalized so that with 56 generators allocated over 7 days, .

Fig. 5. Algorithm 1's normalized objective and runtime varying the number of days and generators. Its performance is stable as the demand (and number of generators to supply it) increase and in optimizing over longer stretches. Its runtime increases linearly in the number of generators, and slightly faster than linearly in the number of days (or periods) as Theorem 3 guarantees.
Algorithm 1 retains accuracy in its objective and its run time scales almost linearly. It can commit 1792 generators for an entire year in 20 seconds. This problem is 60 times larger than the largest problem Hexaly could run. This is useful because rainfall follows yearly cycles. So it can easily run at 5-minute intervals to keep up with evolving demand prediction and dam water levels (which impact how many periods within the year they can operate). The run time is short enough such that an operator can rerun Algorithm 1 whenever demand or rainfall forecasts change.
V. CONCLUSIONS AND FURTHER WORK
We introduce an algorithm to commit many hydro-generators over many periods. We analytically prove that it scales log-linearly in the number of generators and periods. We argue that a bound on the solution's distance from optimality must become tighter as the problem grows. We verify our algorithm by checking its objective and its scaling in practice.
Our algorithm can commit 1792 generators in 5 minute periods for a year in less than 10 seconds. Its experimental scaling matches the analytical runtime analysis. This means that it is fast enough to rerun at 5 minute intervals when new rainfall predictions or new constraints come in on a American interconnect scale. It is almost 10,000 times faster than Hexaly on the largest problem Hexaly could solve, committing 56 generators over 200 days.
All solutions satisfy all constraints and are within relative tolerance of lower bounds on the optimum and within relative tolerance of solutions produced by Hexaly. This accuracy is substantially higher than our predicted analytical bound. Our algorithm retains accuracy at scales we tested.
In future research, we will incorporate transmission constraints in a subsequent solver step that enforces them strictly. The first step will incorporate the time constraints implicitly by adding a penalty to the objective function in the full ACOPF solve (the second step). Using the insights of Figs. 1 and 2, we will incorporate batteries, including hydro-storage.
ACKNOWLEDGEMENTS
We thank Slaven Peleš for his technical review. We thank Eve Tsybina and James Nutaro for helping write the proposal that funded this work.
APPENDIX A
ASYMPTOTIC OPTIMALITY
To bound Algorithm 1's distance from optimality, we define , the optimal solution to Eq. (2), and . For any time period , we define the error Algorithm 1 makes as . So , with .
Theorem 1. If , then .
Proof. Let the mean remaining demand be , where is the number of periods. is identical for and solutions produced by Algorithm 1 (or by any algorithm that assigns all units to their maximum number of periods).
It's intuitive that any error cannot exceed the largest generator capacity. Otherwise Algorithm 1 could simply place that generator differently at the corresponding time step. We were unable to show rigorously. We found solutions that meet this bound, but not ones that exceed it.
Using the Cauchy–Schwarz inequality,
The last line uses in Eq. (3).
We can rewrite the result of Theorem 1 as
Corollary 1. Under our assumptions and for our purposes, where load variation is much larger than the available hydropower ( ), Algorithm 1 produces nearly optimal solutions.
Allowing hydro units to produce at partial capacity is equivalent to increasing m and having fractional capacities .
Corollary 2. Theorem 1 and Corollary 1 hold even if our units can produce at partial capacity, because our proof makes no use of m and K does not increase. If the largest unit's production is split among periods (decreasing K), we get a constant factor improvement, with similar asymptotics.
APPENDIX B ASYMPTOTIC RUN TIME
Theorem 2. Solving Eq. (2) is NP-hard.
Proof. We reduce from the partition problem, which is NP-complete [18]. Given a vector , the partition problem asks whether there exists satisfying
Without loss of generality, take for all .
Given an instance of the partition problem Eq. (6), consider an instance of Eq. (2) where , there are generators, and for all . Set . For this instance of Eq. (2), OPT = 0 if and only if if and only if . This is possible if and only if there exists a set satisfying the condition of the partition problem (i.e., ).
Theorem 3. Algorithm 1 takes time, where n is the number of hydro units and T is the number of periods over which to optimize.
Proof. Lines 1–4, 24 run in time. The outer for loop (line 5) runs n times. The inner while loop on line 7 runs times, since it considers a different period on each iteration. The inner for loop (line 18) runs T times. All lines inside loops run in time, except lines 9 and 16, which run in [19]. Overall, Algorithm 1 runs in time.
REFERENCES
[1] D. Freyberg, D. Gragg, B. Schraeder, S. Poore, and S. Chang, "Understand hydropower," 2026. [Online]. Available: https://understand-energy.stanford.edu/news/understand-hydropower
[2] Low Carbon Power, “14% of global electricity is generated from Hydropower in 2025/2026,” 2026. [Online]. Available: https://lowcarbonpower.org/type/hydro
[3] V. L. de Matos, P. V. Larroyd, and E. C. Finardi, “Assessment of the long-term hydrothermal scheduling operation policies with alternative inflow modeling,” in 2014 Power Systems Computation Conference, 2014, pp. 1–7.
[4] E. C. Finardi and E. L. da Silva, “Solving the hydro unit commitment problem via dual decomposition and sequential quadratic programming,” IEEE Transactions on Power Systems, vol. 21, no. 2, p. 835 – 844, 2006.
[5] Y. Ji and H. Wei, “An approximate dynamic programming method for unit-based small hydropower scheduling,” Frontiers in Energy Research, vol. Volume 10 - 2022, 2022.
[6] P. V. Larroyd, V. L. de Matos, and E. C. Finardi, “Assessment of risk-averse policies for the long-term hydrothermal scheduling problem,” Energy Systems, vol. 8, no. 1, pp. 103–125, Feb. 2017.
[7] C. N. Chaves, T. F. da Silva, J. P. M. Gaspar, A. C. P. Martins, E. M. Soler, A. R. Balbo, and L. Nepomuceno, “Adaptive stochastic approach for solving long-term hydrothermal scheduling problems,” Applied Energy, vol. 378, p. 124730, 2025. [Online]. Available: https://www.sciencedirect.com/science/article/pii/S0306261924021135
[8] J. Wang, M. Yousefi, J. Rajasekharan, R. Arghandeh, and H. Farahmand, “Optimizing long-term hydrothermal scheduling with adaptive scenario fan selection and inflow prediction in the nordic region,” Energy and AI, vol. 24, p. 100701, 2026. [Online]. Available: https://www.sciencedirect.com/science/article/pii/S266546826000273
[9] NOAA, “Monthly climate reports,” 2026. [Online]. Available: https://www.ncei.noaa.gov/access/monitoring/monthly-report/national/202609
[10] U.S. Energy Information Administration, “Electricity in the united states,” 2026. [Online]. Available: https://www.eia.gov/energyexplainade/electricity/electricity-in-the-us.php
[11] E. J. R. Brody, C. Foltz, E. Tsybina, S. Peles, and S. Regev, “Fast relax-and-round unit commitment with transmission constraints,” 2026. [Online]. Available: https://arxiv.org/abs/2609.13480
[12] Hexaly, Hexaly Optimizer, 2026, accessed: 2026-07-22. [Online]. Available: https://www.hexaly.com/hexaly-optimizer
[13] S. Kincic et al., “Hydropower modeling gaps in planning and operational studies,” Pacific Northwest National Laboratory, Tech. Rep., 11 2022.
[14] J. Kong, I. Iliev, and H. I. Skjelbred, “Including lifetime hydraulic turbine cost into short-term hybrid scheduling of hydro and solar,” Energies, vol. 17, no. 21, p. 5246, 2024.
[15] S. Regev, E. J. R. Brody, C. Foltz, E. Tsybina, and S. Peles, “Fast relax-and-round unit commitment with economic horizons,” 2026. [Online]. Available: https://arxiv.org/abs/2603.15934
[16] EIA, “EIA form 860,” December 2024. [Online]. Available: https://www.eia.gov/electricity/data/eia860m/
[17] R. Uría-Martínez, M. M. Johnson, and R. Shan, “U.S. hydropower market report,” U.S. Department of Energy, Water Power Technologies Office, Oak Ridge, TN, Tech. Rep., 01 2021. [Online]. Available: https://www.energy.gov/sites/prod/files/2021/01/f82/us-hydropower-market-report-full-2021.pdf
[18] R. M. Karp, Reducibility among Combinatorial Problems. Boston, MA: Springer US, 1972, pp. 85–103.
[19] T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein, Introduction to Algorithms, Third Edition, 3rd ed. The MIT Press, 2009.