Abstract
This paper introduces an enhanced algorithm for computing generalized Nash equilibria for multiple player nonlinear games, which degenerates in a gradient algorithm for single player games (i.e., optimization problems) or potential games (i.e., equivalent to minimizing the respective potential function), based on the Rosen gradient algorithm. Analytical examples show that it has similar theoretical guarantees of finding a generalized Nash equilibrium when compared to the relaxation algorithm, while numerical examples show that it is faster. Furthermore, the proposed algorithm is as fast as, but more stable than, the Rosen gradient algorithm, especially when dealing with constraints and non-convex games. The algorithm is applied to an electricity market game representing the current electricity market model in Brazil.
1. Introduction
The energy sector in many countries around the world has been reformed since the end of the 1980s [1,2]. It changed from a centralized, monopolistic sector to one that stimulates competition, with an open market that gencos (and often consumers) can make bids for energy prices and negotiate future energy contracts. The energy spot price is then defined by the market operator (and/or system operator) using the marginal unit dispatched price, considering the bids and transmission constraints [3].
The change in the energy markets also created challenges for healthy market operation. While the move from regulated energy amounts and prices gave gencos the freedom to define better business strategies, it also gave larger companies the possibility to manipulate prices and exert market power [1,4,5,6]. Furthermore, a more open market tends to require shorter time bids [7].
The Brazilian electric sector reforms started in 1996 [8], and now it works in a mix of regulated and open markets. The open market allows gencos and consumers to negotiate contracts directly, and has spot prices calculated from audited costs and future prices of water (as hydroelectric power plants are the main source of energy), using a complex chain of models. There are proposals for moving the market to a bid-based model that would allow generators to make bids, declaring the price and quantity curves they are offering for each time slot [8,9].
The use of game theory as a tool to study competitive energy markets is well established [1,10]. As the electricity markets usually derived from an integrated, monopolistic and state-owned company, the analyses usually focus on oligopolist competitive game models [10], particularly looking for Nash equilibrium strategies and their relationships to marginal cost curves. In this sense, Nash equilibrium analysis can be used by market participants to define best bid strategies and by regulatory agencies to evaluate market power.
A Nash equilibrium is defined by
where are the player variables (i.e., strategy), is the objective function of player v, are the variables of player v and denotes all variables except the ones of player v. The Nash equilibrium concept can be extended to concurrent constrained optimization problems, as defined further in this paper.
The first known use of the Nash equilibrium concept dates back to 1838. However, it was named after John Nash in 1950 who proved its existence for continuous convex objectives relative to player own variables and nonempty convex compact feasible sets [11]. Rosen has proved extra conditions on continuously differentiable convex games in order to guarantee uniqueness of a Nash equilibrium [12]. Facchinei et al., have analyzed the existence of a Nash equilibrium for pseudo-convex objective functions relatively to player own variables in terms of variational inequalities on compact convex feasible sets [13].
The Best Response Dynamics (BRD) is a straightforward algorithm to find a Nash equilibrium where at each iteration a different player optimizes its own strategy looking only to its own objective, while fixing other player strategies. It enjoys theoretical guarantees of convergence to a Nash equilibrium only in special cases, including potential games [14], aggregative games [15], acyclic games [16] and quasi-acyclic games [17,18].
Rosen has proposed a gradient algorithm with guaranteed convergence and optimality for games satisfying certain convex conditions [12], which introduces the concept of normalized Nash equilibrium for constrained games and also the fundamental idea for the search direction of this paper.
The relaxation algorithm considers the optimization of Nikaido–Isoda [19] function at each iteration, which is built from player objective functions, so that the next player strategies lies in the segment connecting the previous iteration point and the Nikaido–Isoda function solution. It enjoys theoretical guarantees of convergence to a Nash equilibrium for games with weakly convex–concave Nikaido–Isoda functions [20,21] respecting a few extra conditions, which is a broader class of games than BRD and Rosen gradient algorithm can cope with with theoretical guarantees.
This paper proposes and analyzes an enhanced algorithm based on a line search along a composition of objective function gradients of players as search direction at each iteration, without the need of an optimization on player variables at each iteration as in the relaxation method. The result is a faster and more stable algorithm, especially in games of many variables. This algorithm has already been used, but not analyzed in depth [22].
2. The Gradient Algorithm
2.1. Fundamental Idea
The fundamental idea of the proposed algorithm is to follow the vector field composed of a negatively weighted gradient of each player objective
until it eventually stops at a Nash equilibrium. Let denote the unit vector towards a non-null . Then, the algorithm can be defined by the iterative update
where the step length is
where controls the change direction threshold to follow the vector field ( for no direction change).
The search direction (4) is the same as proposed by Rosen [12]. However, the step length (6) is different (i.e., it is not the one that minimizes ) and behaves better in practice).
Notice that for single player games (i.e., optimization problems) and , this algorithm degenerates into the classical gradient descent algorithm [23]. Furthermore, if , and the vector field (4) is conservative, i.e., the game is potential [14], then the algorithm also degenerates into the classical gradient descent algorithm for minimizing the associated potential function.
2.2. Algorithm Analysis
The convergence of the algorithm depends on the following concept of attractor and basin of attraction.
Definition 1
(Attractor and basin of attraction). Let represent time and be a function which specifies the dynamics of the system, so that is the initial state of the system and is the result of the evolution of this state after t units of time. An attractor of a dynamic system is characterized by the following three conditions:
- 1.
- If then , ;
- 2.
- There exists a neighborhood of , called the basin of attraction of , such that for any open neighborhood of there is a positive constant T such that , and ;
- 3.
- There is no non-empty subset of having the first two properties.
Indeed, the iterative update (5) with a step length (6) can be seen as a dynamic system , where t is the iteration k and x define the player variables. When , the dynamic system can be visualized by the vector field given by (4). Convergence and optimality proofs for the proposed algorithm are given next.
Theorem 1
Proof.
Theorem 2
Proof.
If the attractor is a single fixed point, then because otherwise the respective dynamic system would continue moving. This defines a necessary optimality condition for each player, i.e., a Nash equilibrium. □
For pseudo-convex (i.e., objective functions are pseudo-convex to respective player own variables) unconstrained games, the condition also becomes sufficient for Nash equilibria. Indeed, if pseudo-convexity is proven for a game and the proposed algorithm converges to a single point, then it is a Nash equilibrium. Furthermore, for finite pseudo-convex potential games, the proposed algorithm converges to a Nash equilibrium just like a classical gradient algorithm converges to the minimum of finite pseudo-convex optimization problems. For convex games, the proposed enhanced gradient algorithm converges to the Nash equilibrium just like Rosen gradient algorithm because is reduced after each iteration k for a small enough .
2.3. Examples for Convergence Analysis
Consider a 2-player game where one player controls the price that it will sell a product and the other player controls the amount of the product it will buy. Both players are penalized for rising their control variables squared by a factor . The game of maximum gain of player 1 and minimum expenses of player 2 can be written as
for , so that each objective function is convex relative to respective player variable.
The best response curves are given by
so that it has a unique Nash equilibrium at
The iterative update (5) with step length (6) converges to the Nash equilibrium of the game (7) and (8) whenever
given by where and . Furthermore, it converges at maximum rate for
given by , where and . Notice that , .
Hence, even for convex games with a unique Nash equilibrium, the iterative update (5) may not converge if is large enough. Furthermore, a large convergent step length may lead to a slower convergence, just like a small step length. Indeed, even the relaxation algorithm [20] only converges to the Nash equilibrium of the game (7) and (8) for specific fixed step lengths. For , the game becomes linear (i.e., objective functions are linear to respective player own variables), and there is still a Nash equilibrium at , but both algorithms cannot find it starting from somewhere else.
An interesting example of a non-convex game is
whose attractor is the circle
for all , except at the origin , where , but it is not a Nash equilibrium. Indeed, this game has no Nash equilibrium. The proposed algorithm will never stop for this game, being trapped in the circular attractor, unless the starting point is the origin, where it stops immediately because of a necessary optimality condition that is not sufficient.
3. Generalized Nash Equilibrium
A generalized Nash equilibrium is defined by
where is the feasible set of player v as a function of other player variables .
Consider the joint constraints
where is the feasible set for joint constraint functions .
3.1. Generalized Gradient Algorithm
The generalized algorithm can be defined by the iterative update
where the step length is
starting from a feasible point .
Define the directions
where
is the active set of constraints. Then, the unit search direction must lie inside the cone in order to walk at least locally in the direction of the vector field while reducing the constraint function values. A good choice is a direction d so that not only , but also , and [24]. A direction in this intersection can be found by the linear optimization problem,
where defines a weight for each director. These weights allow us to obtain directions closer to , which improves the convergence rate and also reduces divergent behaviors of the algorithm (as seen for Problems (7) and (8)). A weight w relative to four times the ones for activating nonlinear constraints and 4000 times the ones for activating linear constraints is typical for a good performance in practice. The solution of this linear problem defines the search direction,
if , otherwise the algorithm stops.
3.2. Generalized Gradient Algorithm Analysis
The primal cone of directions , , , is introduced in the formulation (25)–(29) only to lead to a better (i.e., more centralized) search direction. The following lemma proves that its intersection with a dual nonempty cone is also always nonempty.
Lemma 1
(cone intersection). If then so that .
Proof.
Suppose the direction d can be written as . If it belongs to the cone , then must exist a , such that
which can be interpreted as if exists a strictly supporting hyperplane at the origin to the cone whose normal belongs to . Because is a convex set contained in an open halfspace intersection (i.e., ), the origin lies in the boundary of the closure of , the existence of w is guaranteed by the supporting hyperplane theorem for convex sets. □
The proofs of convergence and optimality of the proposed algorithm to find a generalized Nash equilibrium are given next.
Theorem 3
Proof.
The linear programming provides a direction , , , such that if . Because of Lemma 1, it is sufficient to consider a direction d such that , since in this case d can always be written as , , . When there is a direction d that satisfies , then there exists an infinitesimal step towards d that does not violate any constraint and still has a component on vector field . Hence, the algorithm converges to an attractor of vector field (4) constrained to for by construction. □
Theorem 4
(Generalized optimality). Every fixed point attractor of the vector field (4) constrained to satisfies the variational constraint , , where is a ball of infinitesimal radius around . Furthermore, every solution to the variational inequality , , for a closed convex set and the vector field in (4) is also a generalized Nash equilibrium for all of the game (17)–(19), with constraints respecting (20) and objective functions continuously differentiable in x and pseudo-convex in .
Proof.
Every fixed point attractor of constrained to is characterized when there is no feasible direction to step towards by definition, so that mathematically leads to , , which is equivalent to , .
Every point that satisfies the variational inequality is called normalized Nash equilibrium [12] or variational equilibrium [25], which are the type of equilibrium that the proposed gradient algorithm is able to find. Every normalized Nash equilibrium is a generalized Nash equilibrium, but the converse is not true in general [13]. The following example illustrates this fact.
3.3. An Example with Infinite Generalized Nash Equilibria
Consider the two-player game [13],
whose best response curves are given by
so that the generalized Nash equilibria are
Considering that is infeasible so that for all feasible points, the variational inequality , , holds true for only when , for , so that
so that, because and by definition of the vector field (4), only the Nash equilibria
can be found by the proposed algorithm, leaving two generalized Nash equilibria out of reach: and . However, if no positive weights were associated with , only a single generalized Nash equilibria could be found: , the one where .
3.4. A Numerical Example: Internet Game
Consider the extended internet switching p-player symmetrical game [26]
which has Nash equilibria at points satisfying
which is unique when .
Figure 1 shows the typical convergence of the proposed enhanced gradient algorithm (EGNE) for compared to the relaxation algorithm (RNE) for a fixed step of , Rosen gradient algorithm (GNE), and BRD algorithm (BRD), measured by number of function evaluations. Notice that EGNE, GNE, and BRD are typically one order of magnitude faster than RNE for . As the number of players increases, or the number of variables increases, this difference becomes even greater as shown in Figure 2 and Figure 3, respectively. This is because relaxation algorithm solves an optimization problem every iteration, while the proposed algorithm and GNE only performs a line search, and BRD solves an optimization problem with less variables. Notice also that the relaxation algorithm (RNE) becomes unstable for .
Figure 1.
Convergence of proposed Enhanced Gradient Algorithm (EGNE) for and (EGNE), relaxation algorithm for a fixed step of (RNE), Rosen gradient algorithm for (GNE), and the BRD algorithm (BRD), for game (41) with , , and .
Figure 2.
Average computational cost of 30 solutions of game (41) with proposed enhanced gradient algorithm for and (EGNE), relaxation algorithm for a fixed step of (RNE), Rosen gradient algorithm for (GNE), and BRD algorithm (BRD), for an increasing number of players p starting from a random feasible point , , with , and . The stop criterion is to move closer than a Euclidean distance of to the know Nash equilibrium.
Figure 3.
Average computational cost of 30 solutions of game (41) with proposed enhanced gradient algorithm for and (EGNE), relaxation algorithm for a fixed step of (RNE), Rosen gradient algorithm for (GNE), and BRD algorithm (BRD), for an increasing number of variables n starting from a random feasible point , , with , and . The stop criterion is to move closer than a Euclidean distance of to the known Nash equilibrium.
4. Energy Market Application
The current Brazilian electric sector is mainly powered by hydroelectric plants, that are dispatched centrally by the system operator, that calculates the water future cost of each to estimate the energy spot prices. As the generation of hydroelectric power plants are strongly affected by water inflow, which depends on the rain regime and upstream hydroelectric plant generation, there is a compulsory financial hedge mechanism to share the hydrological risk of all hydroelectric power plants. In this mechanism, called energy reallocation mechanism, the generation of all hydroelectric power plants is bundled together and each plant payment is proportional to its physical guarantee (PG) that is prefixed for commercialization and does not depend on its actual generation [22].
In this context, each genco v can seasonalize their hydroelectric plants PG along months , where T is the number of periods ( in this paper for real seasonalization game), as long as its yearly average PG is unchanged. This opens possibility to each genco to seasonalize strategically in order to maximize its own total income along periods t, which will be modulated by a generation scaling factor, i.e., the ratio between the actual generation and the amount of PG allocated by all players in each period t. The Nash equilibrium of the seasonalization non-cooperative game with p-player can be formulated by [22]:
where the income of each player v in each period t is given by
where is the duration of period t, is the spot price of period t in sub-market m, is the sub-market where player v is located, s is the reduction ratio, and is the generation scaling factor for a flat seasonalization so that a negative income means a worse income than a reference flat seasonalization. Considering and , , the objective function of each player is smooth and pseudo-convex over the feasible domain. The linear constraint functions tend to be activated as the players maximize their income, which is especially difficult to handle, and makes them a challenging test for the constraint handling proposed in this paper.
Figure 4 shows a typical convergence for the seasonalization 4-player game considering one player per sub-market (i.e., ) and year 2020 input data given by , , , , , , , and the parameters given in Table 1. Table 2 shows the respective Nash equilibrium obtained by the proposed algorithm. The maximum variable variation for the proposed enhanced gradient algorithm in 5 runs starting from random points was about , while for the relaxation algorithm was about and the Rosen gradient algorithm was . The proposed enhanced gradient algorithm convergence is about six times faster than the relaxation algorithm, and a bit faster than the Rosen gradient algorithm.
Figure 4.
Typical convergence for the seasonalization game using the proposed gradient algorithm for and (EGNE) the relaxation method for a fixed step of (RNE), and Rosen gradient algorithm for (GNE), compared to EGNE solution.
Table 1.
Seasonalization game parameters.
Table 2.
Nash equilibrium for seasonalization game.
Figure 5 shows how the EGNE algorithm scales with an increasing number of players for , , , , , , and .
Figure 5.
Average computational cost of 30 solutions of seasonalization game with proposed enhanced gradient algorithm for and (EGNE), for an increasing number of players p starting from a random feasible point , .
5. Conclusions
This paper proposes an enhanced gradient algorithm to find a generalized Nash equilibrium with joint constraints that seems to have similar convergence and optimality behavior when compared to the state-of-the-art relaxation method, but it is typically about one order of magnitude faster in practice. A promising future application is to open or semi-open electricity market game formulations, where the players make price offers and the consumers or system-market operators define which player will actually generate energy. Furthermore, further details can be added to the electricity market game formulation, e.g., control mechanisms to assert proper operation or prevent spurious behavior under any scenario.
The convergence and optimality guarantees of the proposed algorithm are based on the concept of attractor. Future developments in vector field conditions for existence and uniqueness of fixed point attractors can improve the ability to give theoretical guarantees to find a Nash equilibrium for specific game instances.
Author Contributions
Conceptualization, A.C.L.; Methodology, A.C.L.; Software, A.C.L.; Validation, F.F.G.S.; Formal analysis, A.C.L.; Investigation, A.C.L.; Resources, F.F.G.S.; Data curation, F.F.G.S.; Writing—original draft, A.C.L.; Writing—review & editing, F.A.C.P.; Supervision, F.F.G.S., D.A.G.V. and R.R.S.; Project administration, F.F.G.S.; Funding acquisition, D.A.G.V. All authors have read and agreed to the published version of the manuscript.
Funding
This work was supported by an R&D ANEEL project by CEMIG, CAPES, CNPq and FAPEMIG, Brazil.
Data Availability Statement
The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.
Conflicts of Interest
Author Adriano C. Lisboa was employed by the company Gaia. Authors Adriano C. Lisboa, Douglas A. G. Vieira and Felipe A. C. Pereira were employed by the company ENACOM. Author Fellipe F. G. Santos was employed by the company Companhia Energética de Minas Gerais S.A. Authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.
References
- Green, R.J.; Newbery, D.M. Competition in the British Electricity Spot Market. J. Political Econ. 1992, 100, 929–953. [Google Scholar] [CrossRef]
- Carvalho, M.; Pedroso, J.P.; Saraiva, J. Electricity day-ahead markets: Computation of Nash equilibria. J. Ind. Manag. Optim. 2015, 11, 985–998. [Google Scholar] [CrossRef]
- PJM. PJM Manual 11: Energy & Ancillary Services Market Operations; PJM: Norristown, PA, USA, 2024. [Google Scholar]
- Marshall, L.; Bruce, A.; MacGill, I. Assessing wholesale competition in the Australian National Electricity Market. Energy Policy 2021, 149, 112066. [Google Scholar] [CrossRef]
- Hao, Y.; Vand, B.; Delgado, B.M.; Baldi, S. Market Manipulation in Stock and Power Markets: A Study of Indicator-Based Monitoring and Regulatory Challenges. Energies 2023, 16, 1894. [Google Scholar] [CrossRef]
- Yu, L.; Wang, P.; Chen, Z.; Li, D.; Li, N.; Cherkaoui, R. Finding Nash equilibrium based on reinforcement learning for bidding strategy and distributed algorithm for ISO in imperfect electricity market. Appl. Energy 2023, 350, 121704. [Google Scholar] [CrossRef]
- Wu, C.; Gu, W.; Yi, Z.; Lin, C.; Long, H. Non-cooperative differential game and feedback Nash equilibrium analysis for real-time electricity markets. Int. J. Electr. Power Energy Syst. 2023, 144, 108561. [Google Scholar] [CrossRef]
- Ribeiro, L.; Street, A.; Valladão, D.; Freire, A.C.; Barroso, L. Technical and economical aspects of wholesale electricity markets: An international comparison and main contributions for improvements in Brazil. Electr. Power Syst. Res. 2023, 220, 109364. [Google Scholar] [CrossRef]
- PSR. Propostas de Metodologias Para a Formação de Preços por Oferta No Brasil, Entregável 3: Proposta de Desenho de Mecanismo Conceitual; Technical Report; PSR: Rio de Janeiro, Braizl, 2021. [Google Scholar]
- Lin, X.; Wang, B.; Xiang, Z.; Zheng, Y. A review of market power-mitigation mechanisms in electricity markets. Energy Convers. Econ. 2022, 3, 304–318. [Google Scholar] [CrossRef]
- Nash, J.F. Equilibrium points in n-person games. Proc. Natl. Acad. Sci. USA 1950, 36, 48–49. [Google Scholar] [CrossRef] [PubMed]
- Rosen, J. Existence and uniqueness of equilibrium points for concave n-person games. Econometrica 1965, 33, 520–534. [Google Scholar] [CrossRef]
- Facchinei, F.; Fischer, A.; Piccialli, V. On generalized Nash games and variational inequalities. Oper. Res. Lett. 2007, 35, 159–164. [Google Scholar] [CrossRef]
- Monderer, D.; Shapley, L.S. Potential games. Games Econ. Behav. 1996, 14, 124–143. [Google Scholar] [CrossRef]
- Dindos, M.; Mezzetti, C. Better-reply dynamics and global convergence to Nash equilibrium in aggregative games. Games Econ. Behav. 2006, 54, 261–292. [Google Scholar] [CrossRef]
- Fabrikant, A.; Jaggard, A.D.; Schapira, M. On the structure of weakly acyclic games. Theory Comput. Syst. 2013, 53, 107–122. [Google Scholar] [CrossRef]
- Friedman, J.W.; Mezzetti, C. Learning in games by random sampling. J. Econ. Theory 2001, 98, 55–84. [Google Scholar] [CrossRef]
- Takahashi, S.; Yamamori, T. The pure Nash equilibrium property and the quasi-acyclic condition. Econ. Bull. 2002, 3, 1–6. [Google Scholar]
- Hukuhane, N.; Kazuo, I. Note on noncooperative convex games. Pac. J. Math. 1955, 5, 807–815. [Google Scholar]
- Uryas’ev, S.; Rubinstein, R.Y. On relaxation algorithm in computation of noncooperative equilibria. IEEE Trans. Autom. Control 1994, 39, 1263–1267. [Google Scholar] [CrossRef]
- Krawczyk, J.B.; Uryas’ev, S. Relaxation algorithms to find Nash equilibria with economic applications. Environ. Model. Assess. 2000, 5, 63–73. [Google Scholar] [CrossRef]
- dos Santos, F.F.G.; de Castro Lobato, M.V.; Vieira, D.A.G.; Lisboa, A.C.; Saldanha, R.R. A Nash equilibrium approach to the Brazilian seasonalization of energy certificates. Energies 2022, 15, 2156. [Google Scholar] [CrossRef]
- Lemaréchal, C. Cauchy and the gradient method. Doc. Math. Extra 2012, 251, 10. [Google Scholar]
- Vieira, D.A.G.; Takashi, R.H.C.; Saldanha, R.R. Multicriteria optimization with a multiobjective golden section line search. Math. Program. 2012, 131, 131–161. [Google Scholar] [CrossRef]
- Facchinei, F.; Kanzow, C. Generalized Nash equilibrium problems. Q. J. Oper. Res. 2007, 5, 173–210. [Google Scholar] [CrossRef]
- Kesselman, A.; Leonardi, S.; Bonifaci, V. Game-theoretic analysis of internet switching with selfish users. Notes Comput. Sci. 2005, 3828, 236–245. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).