Blog articleMethodology & analyticsEnvironmental & earth sciences

Constrained optimisation for reservoir scheduling: shuffled complex evolution with stochastic ranking

Shuffled complex evolution (SCE-UA) is a robust global optimiser from hydrology, but on its own it has no way to handle the constraints that define a reservoir schedule. Stochastic ranking supplies one. This article explains both methods from their original sources, shows how they fit together and sets out how to test and report the combination in a thesis.

What you will learn

  • Formulate reservoir scheduling as a constrained optimisation problem
  • Explain the steps of shuffled complex evolution and its competitive complex evolution routine
  • Explain how stochastic ranking balances objective value and constraint violation
  • Set and justify SCE-SR parameters for a problem of a given dimension
  • Design a fair benchmark and report the algorithm reproducibly

What you will unlearn

  • SCE is a nature-inspired metaheuristic.SCE combines simplex search, controlled random search, competitive evolution and shuffling; it was designed, not modelled on nature.
  • A penalty function is always enough for constraints.Penalty weights are hard to tune; ranking methods such as stochastic ranking avoid choosing a single weight.
  • One good run shows that an algorithm is better.Stochastic optimisers must be compared over many independent runs with appropriate statistical tests.

Skills you will practise

  • Formulating constrained problems
  • Shuffled complex evolution
  • Stochastic ranking
  • Parameter setting
  • Algorithm benchmarking
  • Reproducible reporting

Reservoir scheduling as a constrained problem

A reservoir schedule decides how much water to release in each period of a planning horizon. The decision variables are the releases (or the end-of-period storages), the objective might be to maximise hydropower generation or minimise water-supply deficits, and the constraints come from physics and policy: the water balance linking storage, inflow, release and spill; minimum and maximum storage; release limits set by turbines and outlets; minimum environmental flows; and a target storage at the end of the horizon. Multi-reservoir systems couple these constraints across sites, as in the studies of multi-reservoir operation for environmental water demand (Mao et al., 2016) and joint scheduling in complex river networks (Liu et al., 2017).

The result is a non-linear problem with many variables and a feasible region that can be narrow. Derivative-based methods struggle when the objective is non-smooth, for example when generation depends on turbine tables, so population-based global optimisers are widely used. Most of them, including SCE, were designed for problems with simple bounds; they need a separate method for general constraints (Hellwig & Beyer, 2019).

Shuffled complex evolution (SCE-UA)

SCE-UA was developed at the University of Arizona to calibrate conceptual rainfall-runoff models (Duan et al., 1992). Duan et al. (1993) describe it as combining deterministic and probabilistic search, clustering into complexes, systematic evolution of each complex and competitive evolution, and tested it against controlled random search and multistart simplex methods. The search inside each complex uses reflection and contraction steps from the Nelder-Mead simplex method (Nelder & Mead, 1965). Three decades of extensions and applications are reviewed by Rahnamay Naeini et al. (2019).

  1. Sample s points in the feasible bounds and evaluate them. With p complexes of m points, s = p × m.
  2. Rank the points from best to worst and deal them into p complexes, like cards, so each complex spans the range of quality.
  3. Evolve each complex with the competitive complex evolution (CCE) routine: choose q points as a sub-complex, with better-ranked points more likely to be chosen; compute the centroid of all but the worst; reflect the worst point through the centroid; if the new point is infeasible or no better, try a contraction; if that fails, replace the worst point with a random point. Repeat this α times per sub-complex and β times per complex.
  4. Shuffle: merge the complexes, re-rank and re-partition, so information passes between complexes.
  5. Stop when the population has converged or a budget of function evaluations is reached.

The selection probability gives the point ranked i among m a probability of 2(m + 1 − i) / [m(m + 1)], decreasing linearly from best to worst. Note that steps 1 and 3 only respect the variable bounds. A release schedule that breaks the water balance or the environmental flow is still "feasible" to SCE unless a constraint method is added.

Stochastic ranking

Stochastic ranking was proposed by Runarsson and Yao (2000) as a way to rank a population when both the objective and the total constraint violation matter, without choosing a penalty weight. It works like a bubble sort. In each sweep through the population, adjacent individuals are compared: if both are feasible, or with probability Pf, they are compared by objective value; otherwise they are compared by constraint violation. Sweeps repeat until no swaps occur or a set number is reached.

The probability Pf controls the balance. With Pf = 0 the ranking is driven entirely by violation until individuals are feasible; with Pf = 0.5 objective and violation have equal say. A value a little below 0.5, such as 0.45, keeps some pressure towards feasibility while letting promising infeasible points survive near the boundary, where reservoir optima often lie.

Combining them: SCE-SR

The combination is simple in principle: wherever SCE ranks or compares points, use stochastic ranking instead of the objective alone. That applies to the initial ranking and partition, to the ranking inside each sub-complex (which decides the worst point and the centroid) and to the acceptance test after reflection or contraction. The constraint violation is usually the sum of normalised violations of each constraint, so that a breach of the storage limit and a breach of the environmental flow are on comparable scales.

Flow chart of the shuffled complex evolution algorithm with stochastic ranking
Figure 1. Flow chart of SCE combined with stochastic ranking.
  1. 1Sample s points within bounds
  2. 2Evaluate objective and constraint violation
  3. 3Rank by stochastic ranking
  4. 4Partition into p complexes
  5. 5Evolve each complex (CCE with stochastic ranking)
  6. 6Shuffle complexes
  7. 7Converged? Stop or repeat
Figure 2. The SCE-SR procedure, redrawn.
SCE-SR parameters (values commonly attributed to Duan et al., 1994, and Runarsson and Yao, 2000)
ParameterMeaningCommonly used value
nNumber of decision variablesSet by the problem
mPoints per complex2n + 1
qPoints per sub-complexn + 1
αOffspring per sub-complex1
βEvolution steps per complex before shuffling2n + 1
pNumber of complexesChosen by the user; more complexes search more widely at greater cost
PfProbability of comparing by objectiveJust below 0.5, e.g. 0.45

Default values from Duan et al. (1994) are a starting point, not a result. Report the values you used and test sensitivity to p and Pf in particular.

Worked example (illustrative)

Consider a single reservoir scheduled monthly for one year to maximise hydropower subject to storage bounds, turbine limits, a minimum environmental flow and an end-of-year storage target. The decision variables are twelve releases, so n = 12, giving m = 25, q = 13 and β = 25. With p = 4 complexes the population is 100 points. Each candidate schedule is simulated through the water balance to obtain storages, generation and the violation of each constraint, normalised by its permitted range. Stochastic ranking with Pf = 0.45 orders the population, and the algorithm runs until improvement stalls or 50,000 evaluations are used. The researcher then repeats the run 30 times with different seeds and compares the distribution of final generation with a penalty-based SCE and a standard evolutionary algorithm.

Benchmarking and reporting

No optimiser is best on every problem (Wolpert & Macready, 1997), so a thesis must show that SCE-SR suits the problem at hand. Compare it with established methods on the same evaluation budget, over many independent runs, and use non-parametric tests to compare the results (Derrac et al., 2011). For constrained problems, report the proportion of runs that end feasible as well as the objective, since benchmarking practice for constrained optimisation has been criticised for weak and inconsistent reporting (Hellwig & Beyer, 2019). Justify the method by its mechanism rather than by a metaphor (Aranha et al., 2022), and share code, seeds and data so the results can be reproduced (Sandve et al., 2013). See choosing and benchmarking a metaheuristic and presenting code in a thesis.

SCE variants have also been used beyond hydrology, for example to extract solar cell model parameters (Gao et al., 2018).

Common mistakes

  • Applying SCE to a constrained schedule without any constraint-handling method.
  • Adding violations measured in different units without normalising them.
  • Reporting one run, or the best of many runs, instead of the distribution.
  • Comparing algorithms on different evaluation budgets.
  • Copying default parameters without testing sensitivity.
  • Describing results from another study without citing it.

Key takeaways

Your next step

Want to apply this to your own study?

  1. 1Tell us your topic, data and deadline
  2. 2A statistician reviews your work with you
  3. 3You get a plan and a quote
Quantitative analysis

References

  1. Aranha, C., Camacho Villalón, C. L., Campelo, F., Dorigo, M., Ruiz, R., Sevaux, M., Sörensen, K., & Stützle, T. (2022). Metaphor-based metaheuristics, a call for action: The elephant in the room. Swarm Intelligence, 16, 1–6. https://doi.org/10.1007/s11721-021-00202-9
  2. Derrac, J., García, S., Molina, D., & Herrera, F. (2011). A practical tutorial on the use of nonparametric statistical tests as a methodology for comparing evolutionary and swarm intelligence algorithms. Swarm and Evolutionary Computation, 1(1), 3–18. https://doi.org/10.1016/j.swevo.2011.02.002
  3. Duan, Q. Y., Gupta, V. K., & Sorooshian, S. (1993). Shuffled complex evolution approach for effective and efficient global minimization. Journal of Optimization Theory and Applications, 76(3), 501–521. https://doi.org/10.1007/BF00939380
  4. Duan, Q., Sorooshian, S., & Gupta, V. (1992). Effective and efficient global optimization for conceptual rainfall-runoff models. Water Resources Research, 28(4), 1015–1031. https://doi.org/10.1029/91WR02985
  5. Duan, Q., Sorooshian, S., & Gupta, V. K. (1994). Optimal use of the SCE-UA global optimization method for calibrating watershed models. Journal of Hydrology, 158(3–4), 265–284. https://doi.org/10.1016/0022-1694(94)90057-4
  6. Gao, X., Cui, Y., Hu, J., Xu, G., Wang, Z., Qu, J., & Wang, H. (2018). Parameter extraction of solar cell models using improved shuffled complex evolution algorithm. Energy Conversion and Management, 157, 460–479. https://linkinghub.elsevier.com/retrieve/pii/S0196890417311858
  7. Hellwig, M., & Beyer, H.-G. (2019). Benchmarking evolutionary algorithms for single objective real-valued constrained optimization: A critical review. Swarm and Evolutionary Computation, 44, 927–944. https://doi.org/10.1016/j.swevo.2018.10.002
  8. Liu, Q., Fang, G., Sun, H., & Wu, X. (2017). Joint optimization scheduling for water conservancy projects in complex river networks. Water Science and Engineering, 10(1), 43–52. https://linkinghub.elsevier.com/retrieve/pii/S1674237017300303
  9. Mao, J., Zhang, P., Dai, L., Dai, H., & Hu, T. (2016). Optimal operation of a multi-reservoir system for environmental water demand of a river-connected lake. Hydrology Research, 47(S1), 206–224. https://iwaponline.com/hr/article/47/S1/206/1812/Optimal-operation-of-a-multireservoir-system-for
  10. Nelder, J. A., & Mead, R. (1965). A simplex method for function minimization. The Computer Journal, 7(4), 308–313. https://doi.org/10.1093/comjnl/7.4.308
  11. Rahnamay Naeini, M., Analui, B., Gupta, H. V., Duan, Q., & Sorooshian, S. (2019). Three decades of the shuffled complex evolution (SCE-UA) optimization algorithm: Review and applications. Scientia Iranica, 26(4A), 2015–2031. https://doi.org/10.24200/sci.2019.21500
  12. Runarsson, T. P., & Yao, X. (2000). Stochastic ranking for constrained evolutionary optimization. IEEE Transactions on Evolutionary Computation, 4(3), 284–294. https://doi.org/10.1109/4235.873238
  13. Sandve, G. K., Nekrutenko, A., Taylor, J., & Hovig, E. (2013). Ten simple rules for reproducible computational research. PLoS Computational Biology, 9(10), e1003285. https://doi.org/10.1371/journal.pcbi.1003285
  14. Wolpert, D. H., & Macready, W. G. (1997). No free lunch theorems for optimization. IEEE Transactions on Evolutionary Computation, 1(1), 67–82. https://doi.org/10.1109/4235.585893

How to cite this article

Choose your referencing style, then copy. Check your university's or journal's guide for local variations.

PhD Research Lab Academy. (2020, January 28). Constrained optimisation for reservoir scheduling: shuffled complex evolution with stochastic ranking. PhD Research Lab. https://www.phdassistance.com/blog/dissertation-algorithm-development-tips-for-developing-shuffled-complex-evolution-combined-with-stochastic-ranking-for-reservoir-scheduling/

PhD Research Lab Academy. “Constrained Optimisation for Reservoir Scheduling: Shuffled Complex Evolution with Stochastic Ranking.” PhD Research Lab, 28 Jan. 2020, www.phdassistance.com/blog/dissertation-algorithm-development-tips-for-developing-shuffled-complex-evolution-combined-with-stochastic-ranking-for-reservoir-scheduling. Accessed [access date].

PhD Research Lab Academy (2020) Constrained optimisation for reservoir scheduling: shuffled complex evolution with stochastic ranking. PhD Research Lab. Available at: https://www.phdassistance.com/blog/dissertation-algorithm-development-tips-for-developing-shuffled-complex-evolution-combined-with-stochastic-ranking-for-reservoir-scheduling/ (Accessed: [access date]).

PhD Research Lab Academy. “Constrained Optimisation for Reservoir Scheduling: Shuffled Complex Evolution with Stochastic Ranking.” PhD Research Lab. January 28, 2020. https://www.phdassistance.com/blog/dissertation-algorithm-development-tips-for-developing-shuffled-complex-evolution-combined-with-stochastic-ranking-for-reservoir-scheduling.

PhD Research Lab Academy, ‘Constrained Optimisation for Reservoir Scheduling: Shuffled Complex Evolution with Stochastic Ranking’ (PhD Research Lab, 28 January 2020) <https://www.phdassistance.com/blog/dissertation-algorithm-development-tips-for-developing-shuffled-complex-evolution-combined-with-stochastic-ranking-for-reservoir-scheduling> accessed [access date].

PhD Research Lab Academy. Constrained optimisation for reservoir scheduling: shuffled complex evolution with stochastic ranking [Internet]. PhD Research Lab; 2020 Jan 28 [cited [access date]]. Available from: https://www.phdassistance.com/blog/dissertation-algorithm-development-tips-for-developing-shuffled-complex-evolution-combined-with-stochastic-ranking-for-reservoir-scheduling/

PhD Research Lab Academy, “Constrained optimisation for reservoir scheduling: shuffled complex evolution with stochastic ranking,” PhD Research Lab, Jan. 28, 2020. [Online]. Available: https://www.phdassistance.com/blog/dissertation-algorithm-development-tips-for-developing-shuffled-complex-evolution-combined-with-stochastic-ranking-for-reservoir-scheduling. [Accessed: [access date]].

@online{dissertation_algorithm_development_tips_for_developing_shuffled_complex_evolution_combined_with_stochastic_ranking_for_reservoir_scheduling_2020,
  author = {{PhD Research Lab Academy}},
  title = {{Constrained optimisation for reservoir scheduling: shuffled complex evolution with stochastic ranking}},
  organization = {PhD Research Lab},
  date = {2020-01-28},
  url = {https://www.phdassistance.com/blog/dissertation-algorithm-development-tips-for-developing-shuffled-complex-evolution-combined-with-stochastic-ranking-for-reservoir-scheduling},
  urldate = {[access date]}
}

This article is for learning. Use it to understand the method and cite the original sources above in your own work; do not copy or submit it as your own.

Constrained optimisation for reservoir schedulingNeed help applying it to your study?
Quantitative analysis