Manuscript Offprint
arXiv:2611.03030A Cooperative Game-Theoretic Framework for Real-Time Deviation Settlement in Local Energy Communities
Angel M. González-Rueda, Iago Núñez Lugilde, Jose L. Crespo-Vazquez & Tarek Alskaif Senior Member, IEEE
Abstract—This paper proposes a cooperative game-theoretical framework for the financial settlement of real-time deviations in Community-Based Local Energy Markets (CB-LEMs). The real-time settlement process is modeled as a transferable-utility cooperative game, and the resulting Real-Time Local Energy Market (RTLEM) game is shown to be superadditive and balanced. We analyze two game-theoretical allocation mechanisms, the Shapley value and the nucleolus, and evaluate their efficiency, individual rationality, coalitional rationality, and temporal-aggregation properties. We subsequently compare these mechanisms with a settlement rule based on proportional imbalance responsibility. The three mechanisms are efficient and individually rational, but only the nucleolus is guaranteed to satisfy coalitional rationality for every RTLEM instance. The proposed framework is demonstrated using real-world data from a residential energy community in Amsterdam, showing the trade-offs among the three allocation mechanisms in terms of surplus distribution, coalitional stability, interpretability, and computational requirements.
Index terms– Cooperative game theory, local energy markets, financial settlement, Shapley value, nucleolus.
I. INTRODUCTION
Community-Based Local Energy Markets (CB-LEM) represent a promising model for supporting decentralized, renewable-based and user-centric energy systems [1]–[3]. In CB-LEMs, community members coordinate their Distributed Energy Resources (DERs) and electricity consumption, enabling the community to optimize its collective energy exchange and interact with the external electricity market at the Point of Common Coupling (PCC) through a representative entity. Indeed, the operational framework of these communities can inherently follow a two-stage market paradigm: a day-ahead (D-1) scheduling phase, where energy exchange commitments are established, and a real-time (RT) balancing phase, where physical injections and withdrawals inevitably deviate from the forecasted schedules due to the stochastic nature of renewable generation and electric demand [4].
Extensive research on LEM has focused on day-ahead (D-1) scheduling and market clearing, including the use of game-theoretic approaches for Peer-to-Peer (P2P) trading [5], the construction of consumer coalitions for cost savings [6], [7], and the design of incentive-compatible market operations [8]–[10]. Beyond day-ahead scheduling and market clearing, the allocation of costs and economic benefits among community members is essential for ensuring equitable participation and sustaining cooperation. Cooperative game-theoretic approaches have been investigated for allocating distribution network reinforcement costs among photovoltaic installations [11], distributing revenues from flexibility services among renewable energy community members [12], and designing online payoff allocation mechanisms for real-time energy markets [13]. The work in [14] proposed a dynamic net-metering mechanism for energy communities that guarantees individual and group rationality while aligning members' incentives with community welfare maximization. More related to imbalance settlement, the work in [15] investigated the cooperative allocation of imbalance costs and aggregation savings among electricity consumers managed by a common balance responsible party, comparing alternative allocation mechanisms under a two-price imbalance settlement scheme.
However, the ex-post financial settlement of real-time deviations between scheduled and realized energy exchanges within CB-LEMs, particularly the fair and coalitionally stable allocation of the resulting costs and benefits among community members, has received comparatively limited attention [16], [17]. Individual deviations may partially offset each other, reducing the community's net imbalance settlement costs and generating economic benefits through internal compensation. The fundamental challenge is therefore to distribute these benefits while accounting for members' contributions to collective deviation compensation and ensuring individual and coalitional rationality. Existing approaches include proportional settlement rules, such as the mechanism proposed in [18]. While such empirical mechanisms are intuitive and may ensure that individual community members are not worse off than settling independently (i.e., satisfying individual rationality), they treat the community as a homogeneous pool and do not fully capture the marginal contribution of each member to collective benefits. As this paper will demonstrate, such settlements can suffer from a structural vulnerability: they may lead to unstable cross-subsidies. Prosumers whose internal
Angel M. González-Rueda (Corresponding Author) is with MODESTYA Research Group, Centre for Mathematical Research and Technology of Galicia (CITMAga), Universidade de Santiago de Compostela, Spain (e-mail: angelmanuel.gonzalez.rueda@usc.es). Iago Núñez Lugilde is with CITMAga, and SiDOR Research Group, University of Vigo, Spain (e-mail: iago.nunez.lugilde@uvigo.gal). Jose L. Crespo-Vazquez is with University of Vigo, Spain (e-mail: jcrespo@uvigo.es). Tarek Alskaif is with the Information Technology Group, Wageningen University, The Netherlands (e-mail: tarek.alskaif@wur.nl).
This work is part of the R+D+I project grants PID2021-124030NB-C31, and PID2025-170122NB-C33 funded by MCIN/AEI/10.13039/501100011033/ and by "ERDF A way of making Europe"/EU. This research was also funded by Grupos de Referencia Competitiva ED431C-2021/24 from the Consellería de Cultura, Educación e Universidades, Xunta de Galicia.
deviations compensate each other may end up subsidizing the imbalance costs of other members with larger deviations. These allocations can violate core stability, creating economic incentives for some sub-coalitions to settle independently rather than remain within the community.
To ensure the long-term socio-economic sustainability of CB-LEMs, the deviation settlement mechanism must be robust against subgroup defection. To address this gap, this paper models the ex-post financial settlement process as a cooperative game, where the value of a coalition reflects its ability to internally balance real-time deviations. We analyze two well-established game-theoretical allocation rules, namely: the Shapley value and the nucleolus, and compare them with the proportional settlement rule proposed in [18], extending the latter to explicitly account for economic terms. By evaluating key axiomatic properties, our analysis reveals how these allocation mechanisms differ in their ability to ensure individual rationality, coalitional stability and equitable benefit sharing.
The main contributions of this work can be summarized as:
-
We formulate the ex-post financial settlement of real-time deviations in CB-LEMs as a cooperative game, addressing a gap in the literature where this ex-post settlement stage has received limited attention.
-
We establish key theoretical properties of the resulting cooperative game, ensuring that the settlement process is superadditive and balanced, guaranteeing the existence of coalitionally stable allocations. We further analyze the efficiency, individual rationality and coalitional rationality of the considered settlement rules.
-
We investigate three settlement mechanisms: the Shapley value, the nucleolus, and the proportional rule proposed in [18]. We demonstrate that the proportional rule and the Shapley value can violate core stability and lead to cross-subsidies, while the nucleolus provides a core-stable allocation for the formulated game.
-
We conduct an illustrative computational study to compare the settlement mechanisms in terms of economic benefit allocation and coalitional stability. We also discuss opportunities to reduce the computational burden of applying the Shapley value and nucleolus.
The remainder of this paper is organized as follows. Section II presents the CB-LEM framework and formulates the real-time deviation settlement problem. Section III describes the methodology where the cooperative game-theoretic formulation and the proportional rule are developed and the properties of the allocations are analyzed. Section IV presents the numerical evaluation study and discusses the comparative performance of the settlement mechanisms. Finally, Section V concludes the paper and outlines directions for future research.
this two-stage paradigm into three sequential chronological phases.
In the first phase, the D-1 clearing problem is solved. Regardless of the specific market clearing mechanism, whether it is a stochastic optimization model as in [18] or other P2P trading algorithm [2], each community member (typically pro-sumers) must decide the amount of power to exchange in the LEM. By the end of day D-1, this clearing process determines both the hourly energy price for internal transactions within the CB-LEM on day D, and the binding commitments of each member regarding the quantity of energy to be exchanged in every time slot.
In the second phase, during RT operation on day D, accurate information on actual solar Photovoltaic (PV) generation and demand becomes available. At this point, each community member operates their flexible assets (e.g., energy storage systems) and physical grid exchanges, aiming to adhere as closely as possible to the commitments made in D-1. However, due to the inherent stochasticity of renewable generation and user behavior, deviations inevitably arise between actual physical outcomes and day-ahead schedules.
Consequently, the community faces a collective imbalance at the PCC with the main grid. In the third and final phase, the Community Manager must perform the ex-post financial settlement, ensuring that the costs or revenues derived from this collective deviation are allocated among community members in a fair and efficient manner.
We now formally define the information available to the Community Manager for performing the settlement. Let denote the set of agents (i.e., community members), and the set of time slots.
- From the solution of the Day-Ahead clearing problem, the following information is available:
-
: power commitment in the LEM for agent at time . Since this represents an internal market exchange, the community commitments are perfectly balanced, satisfying .
-
: price in the CB-LEM at time .
- From the Real-Time operation, the following information is available:
-
: actual energy exchanged with the grid in real-time.
-
, : retail buying and selling prices at time . In practice, these prices satisfy , ensuring that trading energy within the community is always economically preferable to trading directly with the main grid.
It is important to highlight that the individual benefit/cost of agent at time according to the RT problem is given by:
where denotes the individual deviation of agent at time obtained in RT. Note that the first term is the revenue from surplus, the second one the cost due to deficit and the last one the commitment cost.
For any , and .
The Community Manager, having access to all this information, is responsible for performing the final economic settlement. Crucially, while agents are contractually bound to the community for the current operational day, an unfair settlement rule—such as one enforcing cross-subsidies among users—creates strong financial grievances. If members perceive that they could achieve better economic outcomes by operating independently or forming smaller private sub-coalitions, they will have incentives to leave the CB-LEM in the long term. Therefore, the settlement mechanism must not only balance the collective budget but also guarantee coalitional stability to ensure the sustained participation of all members.
Definition 1. Let be the set of agents, and the set of time slots. A settlement rule is a mapping
where denotes the monetary amount assigned to agent at time slot , given the information available to the Community Manager (including day-ahead commitments, real-time deviations, and market prices).
The total settlement for i over all time slots is given as:
A natural property for a settlement mechanism is that it must distribute all the benefits or losses among agents, so that the Community Manager does not generate any profit or loss. This ensures that the settlement fully reallocates the economic impact of deviations.
Property 1 (Efficient). Let be a settlement rule that assigns to each agent i an amount at time t. We say that the settlement rule is efficient at time t if:
where is the net power deviation of the community at time t.
While efficiency ensures that the total economic impact is fully allocated at the community level, it does not guarantee that individual agents benefit from the distribution proposed. To assess this aspect, we introduce a benchmark corresponding to the case where agents do not cooperate.
Property 2 (Individual Rationality). Let be a settlement rule that assigns to each agent i an amount at time t. We say that the settlement rule satisfies individual rationality if, for all ,
This property ensures that no agent receives a lower payoff than in the standalone scenario.
Individual rationality does not rule out profitable deviations by groups of agents. A coalition may be able to obtain a greater aggregate payoff by settling the deviations of its members separately from the remaining community. This motivates the following coalitional requirement. Given a coalition of agents , the aggregate deviations these players generate at the community level in a time instant are given by:
. Based on these deviations, the benefit/cost associated with the coalition is calculated as:
Property 3 (Coalitional Rationality). Let be a settlement rule that assigns to each agent i an amount at time t. We say that the settlement rule satisfies coalitional rationality if, for all ,
Coalitional rationality implies individual rationality by applying the condition to every singleton coalition .
III. METHODOLOGY
This section presents the cooperative game-theoretical methodology used to address the ex-post settlement of real-time deviations. We first formulate the Real-Time Local Energy Market (RTLEM) game and study its properties. We then introduce the Shapley value and the nucleolus as two point solutions of the cooperative game. These mechanisms are compared with a settlement rule based on proportional imbalance responsibility.
A cooperative game is a pair , where , the set of players, is a finite and nonempty subset of the natural numbers, and is the characteristic function, satisfying . A coalition is any element . In general, represents the maximum value that coalition can guarantee independently of the players in . For any and , let . We denote by the set of all cooperative games with as the set of players, and write instead of . For simplicity, we write instead of .
We say that an allocation is efficient for a game if . An allocation is individually rational if for all , meaning that each player receives at least as much as they could secure on their own. The set of all individually rational and efficient allocations is called the imputation set and is defined as . An allocation is stable if for all . This condition ensures that no coalition can unilaterally improve its outcome without the need for cooperation from other coalitions. The set of all stable allocations in the game is for all and is called the core of . A game is balanced if its core is nonempty.
A game is called additive if for all . Let . A game is said to be superadditive if whenever .
A point solution on is a function that assigns to each game a unique allocation vector of . Let be a point solution, if for every , then is said to be a stable solution. Given two games , if , then is said to be additive.
A. Modeling the Cooperative Game
In this section, we model the problem defined in Section II as a cooperative game. We study its properties and various definitions for allocating the cost or benefit generated by being part of the CB-LEM, where the set of players corresponds to the prosumers of the LEM, .
To approach this as a cooperative game, we need to define a characteristic function for any time instant , , which assigns to each coalition a value . For a given coalition , we define as the payoff that the members of coalition can obtain by jointly settling their aggregate real-time deviation, conditional on their previously determined day-ahead commitments and the market prices. Then, we can define the cooperative game associated with this situation, called Real-Time Local Energy Market (RTLEM) game.
Definition 2. Given a time instant , the RTLEM game is a cooperative game defined by , where is the set of prosumers (players) participating in the market and is the characteristic function that assigns to each coalition the aggregate payoff that the members of can obtain by jointly settling their realized deviations at time , conditional on the day-ahead commitments and market prices:
Note that, for each ,
Therefore, if the community's deviation is positive, corresponds to the profit obtained from selling the surplus to the retailer; and if it is negative, it corresponds to the cost associated with purchasing energy from the grid.
Now, we show some properties of the RTLEM game. First, we show that the game is superadditive. In a superadditive game, the union of two coalitions yields a higher total value than their separate actions, reinforcing the incentive to cooperate.
Theorem 1. The RTLEM game is superadditive for any time instant .
Proof. Let such that and . We prove that . On the one hand,
and, on the other hand,
Therefore,
We have to show that . If and , and the result is straightforward. So, assume that , , and . In such a case,
since . The remaining cases are analogous.
Next, we show that the game is balanced. In a balanced game, there always exists at least one stable allocation that no coalition has an incentive to block; in other words, the core is nonempty.
Theorem 2. The RTLEM game is a balanced game for any time instant .
Proof. Fix a time instant . According to the Bondareva–Shapley theorem [19], to prove balancedness, it is sufficient to prove that
for every balanced collection of nonnegative weights. Let be an arbitrary balanced collection such that for every and for every . Define the real-time deviation settlement function as
Using this notation, the characteristic function can be written as
We now evaluate the left-hand side of the Bondareva–Shapley condition,
(2)
We first consider the term associated with the day-ahead commitments. We have
Moreover, as the day-ahead LEM commitments are balanced,
We next consider the term associated with real-time deviations of (2). It is easy to show that, for any and , . Also, by the same sign-based argument used in Theorem 1, for any , . Therefore,
(4)
Substituting (3) and (4) into (2) gives
Using the definition of and the balanced day-ahead commitments, the value of the grand coalition is
Thus, from (5) and (6),
and we can conclude that is balanced.
Now we will prove that if all individual deviations in time have the same sign, then the RTLEM game is additive. In that case, the core is a singleton, .
Theorem 3. Given a time instant in which, for all , or , then the RTLEM game is additive.
Proof. Let and , we aim to show that if for all (the opposite case is analogous). In such a case, and for all and then, . Therefore, , , and
Finally, we define a game that models the end-of-day allocation by taking into account all the deviations that occurred throughout the day at each time instant .
Definition 3. The daily LEM game is a cooperative game defined by , where is the set of prosumers participating in the market and v is the characteristic function defined by
being the RTLEM game for time instant .
Since finite sums preserve superadditivity and balancedness, the daily LEM game is also superadditive and balanced. Furthermore, it is an additive game if all individual deviations in any time have the same sign, that is, if for all , is additive.
B. Settlement Allocation Methods
Now, we introduce three settlement rules. The Shapley value and the nucleolus are point solutions defined on the cooperative game, whereas the proportional rule is a data-driven allocation mechanism based on individual deviations and proportional responsibility factors.
1 ) Shapley value
We begin by defining the Shapley value. To do so, we introduce the concept of marginal contributions. Let be a cooperative game and be a permutation of the players in . The vector of marginal contributions associated with the order is defined as , where , and is the set of players preceding in the order .
Definition 4. The Shapley value [20] , is defined as the average of the marginal contribution vectors over all possible permutations of the players. Thus, the Shapley value of the game is given by:
where is the set of all permutations of N.
The Shapley value can be interpreted as follows: suppose players arrive in a random order, and each one receives their marginal contribution upon arrival. Then, the Shapley value is the expected marginal-contribution vector under this random arrival process. Note that, the Shapley value is a settlement rule which is efficient since, for each ,
Since the RTLEM game is superadditive, every marginal contribution of player i is at least . Consequently, the Shapley value is individually rational and belongs to the imputation set. Therefore, as a settlement rule, it satisfies individual rationality, but, as we will see in Section IV, it may fail coalitional rationality. Moreover, for any additive game , for any .
2 ) The nucleolus
Now, we continue with the definition of the nucleolus. The key concept behind this rule is the excess of a coalition. Let be a cooperative game, and let be an allocation, for any coalition , the excess of at is defined by . If , the coalition is dissatisfied, as its members could potentially achieve a better outcome by acting independently. Thus, the excess quantifies the “complaint” of coalition against the allocation . The larger the excess, the more dissatisfied the coalition. Note that, for every efficient allocation , . For a given allocation , we define the vector of excesses by , where the coalitions are ordered so that .
Definition 5. The nucleolus [21] of the game is the set of allocations in the imputation set that lexicographically minimize the vector of excesses:
, where denotes the lexicographic order.
If , the nucleolus exists and is unique. Similarly to the Shapley value, the nucleolus is efficient by construction. Moreover, because every RTLEM game is balanced, its nucleolus belongs to the core. Thus, no coalition can obtain a strictly greater aggregate payoff by leaving the grand coalition. Therefore, it satisfies coalitional rationality and, therefore, individual rationality. Also, for any additive game , for any .
3 ) Proportional rule
In addition to the two cooperative game-theoretical solutions, we consider the proportional rule as a practical benchmark. Unlike the Shapley value and the nucleolus, this mechanism is not defined as a point solution on the space of cooperative games. The rule is inspired by [18]. The idea is to allocate each prosumer's participation in the CB-LEM according to their individual deviation and the aggregate community deviation. The procedure consists of the following steps.
First, we compute the share of each agent's deviation with respect to the community total, distinguishing between positive and negative deviations. Formally, we define the coefficients:
Second, we calculate the net aggregate exchange of the community at each time step , . This net power deviation represents the community-level deviation to be settled. Each agent's participation in the CB-LEM is then adjusted proportionally to their share of this deviation, so that energy exchanged in the opposite direction to the community's overall deviation is fully assigned as LEM trading. This ensures that participation in the LEM always benefits the agents: at worst, each must compensate for their own deviation, while deviations from others may reduce the amount to be covered, thereby increasing the value of cooperation. The adjusted participation in the LEM for agent at time is thus:
Finally, this proportional energy distribution is translated into monetary terms, giving the following settlement rule.
Definition 6. The proportional rule for a time instant assigns to each :
where the assigned deviation is given by .
We now establish some key properties of the proposed rule. First, we show that this rule is efficient.
Theorem 4. The proportional rule is efficient.
Proof. Expanding the total cost and applying the market clearing condition yields:
By definition of the allocation rules, individual deviations share the same sign as the net community deviation . Because the responsibility coefficients and sum to 1 over , the aggregate deviation components simplify directly to . Substituting these identities into the expanded cost yields the claimed result.
The following result demonstrates that the proportional rule ensures that no agent obtains a lower payoff than they would by operating in isolation.
Theorem 5. The proportional rule satisfies individual rationality.
Proof. Assume without loss of generality that the net community deviation is positive . If , no aggregate deviation is assigned to any agent, and individual rationality follows directly from the assumed price ordering. We analyze the two possible cases for the deviation of an agent :
Case 1: The agent deviates in the opposite direction .
In this case, , so the LEM participation of agent i reduces to
Since , we have and . It follows that , so the LEM participation simplifies to
According to the proportional rule, the assigned payoff is therefore
On the other hand, the RT objective function of the agent is given by
We want to show that , so
Since by assumption and retail buying prices satisfy , the inequality holds.
The case with is analogous.
Case 2: The agent deviates in the same direction . The proof for this scenario follows a similar algebraic deduction and is omitted for brevity.
Although the proportional rule protects isolated individuals, the following theorem shows that it can violate the coalitional rationality property.
Theorem 6. The proportional rule may fail to satisfy coalitional rationality.
Proof. This result is illustrated in the numerical study in Section IV.
C. Computational aspects
While the cooperative game-theoretical framework proposed in this paper is general, the exact computation of the allocation methods may become challenging as the number of community members increases. Indeed, the exact computation of the Shapley value and the nucleolus generally requires processing an exponential number of coalitions, which may become prohibitive for large communities. By contrast, the proportional settlement rule can be computed directly from the individual deviations and the aggregate community imbalance, without enumerating all possible coalitions.
Nevertheless, the structure of the RTLEM game simplifies the computation of the three allocation methods in some cases. According to Theorem 3, if all individual deviations have the same sign at a time instant , the RTLEM game is additive. Moreover, it follows that the final LEM exchange assigned by the proportional settlement rule coincides with the day-ahead commitment: . As a result, the proportional rule assigns each agent its singleton worth . Hence, when all individual deviations have the same sign, the three allocation methods produce the same allocation: , for all . Their computation is therefore immediate.
The allocation methods also differ in their temporal-aggregation properties. The daily LEM game is defined as the sum of the time-specific RTLEM games. Since the Shapley value is additive across games, its daily allocation satisfies
Therefore, the same daily Shapley allocation can be obtained either by computing the Shapley value of the aggregated daily game or by summing the time-specific Shapley allocations. By contrast, the nucleolus is not additive across games. Consequently, computing the nucleolus of the daily LEM game and summing the nucleolus of the time-specific RTLEM games represent two different settlement procedures.
The proportional rule has substantially lower computational requirements. Unlike the Shapley value and the nucleolus, the computation of the proportional rule does not require enumerating the nonempty coalitions. Its computational cost grows linearly with the number of agents for each time instant. Since the proportional rule is defined from time-specific market data, its daily allocation could be obtained by summing the settlements computed separately for every time instant. Nevertheless, this temporal aggregation should not be interpreted as additivity in the cooperative game-theoretical sense.
IV. NUMERICAL EVALUATION AND DISCUSSIONS
To illustrate the proposed framework, we consider a real-world case study based on a residential neighborhood in Amsterdam, The Netherlands. The simulation relies on data from ten households, all of which act as prosumers, over the course of a single day. The dataset is adapted from [18], which provides detailed information about each prosumer, including their day-ahead commitments, real-time deviations, and the final allocation of energy exchanges in the LEM, accounting for both planned commitments and actual real-time trades. To compute the Shapley value and the nucleolus, we implemented these calculations using TUGLab [22].
We organize the numerical analysis into two settings. The first contains homogeneous deviations, with all prosumers deviating in the same direction. The second contains heterogeneous deviations, with both positive and negative individual deviations.
A. Homogeneous Deviations
We first consider a time instant at which all prosumers exhibit deviations of the same sign. In this case, the RTLEM game is additive (see Theorem 3), and the three settlement rules studied in this paper coincide. Thus, each prosumer receives the payoff
As an illustrative example, consider , for which Table I reports the relevant data. The corresponding prices are , , and .
| Prosumer | ||||
|---|---|---|---|---|
| 1 | 0.67 | 0.65 | -0.02 | 8.10 |
| 2 | -1.18 | -1.59 | -0.41 | -19.88 |
| 3 | 0.00 | -0.04 | -0.04 | -0.50 |
| 4 | -0.24 | -0.24 | 0.00 | -2.99 |
| 5 | 0.79 | 0.41 | -0.38 | 5.05 |
| 6 | 1.07 | 0.60 | -0.47 | 7.40 |
| 7 | -0.51 | -0.52 | -0.01 | -6.48 |
| 8 | -0.33 | -0.39 | -0.06 | -4.87 |
| 9 | 0.00 | -0.04 | -0.04 | -0.50 |
| 10 | -0.27 | -0.31 | -0.04 | -3.87 |
Table I: Data for the 10 prosumers participating in the LEM at time instant t = 2.
Since all deviations are negative, and for every . Therefore, the three settlement rules considered in this paper coincide and assign to each prosumer the payoff
B. Heterogeneous Deviations
We next analyze a time instant characterized by both positive and negative individual deviations. We consider, for example, the time instant , for which the data reported in Table II are obtained. The corresponding prices are , , and .
Since deviations have mixed signs, the game is non-additive and the three settlement rules can yield different allocations. As shown in Table II, the prosumers' deviations can be either positive or negative. The amount to be distributed is
Therefore, at this time, the community has enough energy to meet its own needs and has a surplus that can be sold to the grid. The resulting proceeds are then distributed among
| Prosumer | ||||
|---|---|---|---|---|
| 1 | -1.69 | -2.27 | -0.58 | -24.86 |
| 2 | 13.09 | 11.25 | -1.84 | 123.19 |
| 3 | 0.00 | 0.06 | 0.06 | 0.27 |
| 4 | -1.43 | 0.17 | 1.60 | -8.54 |
| 5 | -3.04 | -3.81 | -0.77 | -41.72 |
| 6 | 0.00 | 0.00 | 0.00 | 0.00 |
| 7 | -3.18 | -0.85 | 2.33 | -24.45 |
| 8 | -2.19 | -1.76 | 0.53 | -22.72 |
| 9 | 0.00 | -0.01 | -0.01 | -0.11 |
| 10 | -1.46 | -1.39 | 0.07 | -15.68 |
Table II: Data for the 10 prosumers participating in the LEM at time instant .
the prosumers. Table III shows the allocations obtained under the three settlement rules.²
| Prosumer | |||
|---|---|---|---|
| 1 | -22.62 | -21.08 | -24.86 |
| 2 | 130.46 | 135.16 | 123.19 |
| 3 | 0.39 | 0.28 | 0.56 |
| 4 | -5.88 | -8.54 | -1.29 |
| 5 | -38.80 | -36.73 | -41.72 |
| 6 | 0.02 | 0.01 | 0.02 |
| 7 | -20.02 | -24.45 | -13.87 |
| 8 | -21.77 | -22.72 | -20.33 |
| 9 | -0.09 | -0.06 | -0.11 |
| 10 | -15.54 | -15.67 | -15.36 |
Table III: Allocations proposed by the three settlement rules at time instant .
Although the three rules distribute the same aggregate payoff, they differ in how the cooperative surplus is allocated among prosumers. For allocation rule , the cooperative gain assigned to prosumer at time is defined as , where denotes the allocation under rule , and is the payoff that prosumer could obtain by settling independently. Figure 1 reports the cooperative gain received by each prosumer at . A value equal to zero indicates that the payoff from the rule matches exactly ; positive values show that the prosumer receives more than their stand-alone payoff; and no negative cooperative gains appear, indicating that all three allocation rules satisfy individual rationality in this instance. The Shapley value assigns a strictly positive cooperative gain to every prosumer in this instance. By contrast, the nucleolus and the proportional rule leave several prosumers exactly at their stand-alone payoff and concentrate a larger share of the cooperative surplus among a smaller group of participants.
To complement the analysis, we examine the distribution of cooperative gains throughout the day.³ The Shapley value assigns a strictly positive gain in 99.58% of the prosumer-time observations, compared with 70.83% for the proportional rule and 30.00% for the nucleolus. The corresponding medians are

Figure 1: Cooperative gain assigned to each prosumer by the settlement rules at .
0.17, 0.025, and 0, respectively. Therefore, the Shapley value distributes positive gains across a substantially broader set of prosumer-time observations. By contrast, the zero median obtained for the nucleolus indicates that at least half of the observations receive no strictly positive gain beyond their stand-alone payoff.
To further illustrate the differences between the allocation methods, Figure 2 compares the distribution of the cooperative gains generated by the three rules. The Lorenz curve plots the cumulative proportion of total cooperative gains received by the cumulative proportion of prosumers, ordered by increasing gain. The diagonal represents an equal division of the aggregate cooperative surplus among all prosumers. In the considered instance, the Lorenz curve associated with the Shapley value lies closer to the equality line. The corresponding distribution of cooperative gains is therefore less concentrated than those generated by the nucleolus and the proportional rule. The Gini coefficient measures the area between the Lorenz curve and the diagonal line of equal distribution. A curve closer to the diagonal produces a lower Gini coefficient and represents a more even distribution of cooperative gains. At the time instant shown in Figure 2, the Gini coefficients are 0.57 for the Shapley value, 0.77 for the nucleolus, and 0.76 for the proportional rule.
To further assess how the surplus is distributed among prosumers, we compute the Gini coefficient of the gains generated by each allocation rule at every time instant with a strictly positive cooperative surplus. Averaging the time-specific coefficients over the analyzed day yields values of 0.63 for the Shapley value, 0.81 for the nucleolus, and 0.72 for the proportional rule. Moreover, the Shapley value produces the lowest Gini coefficient at every time instant, indicating that, throughout the analyzed day, it consistently distributes the surplus more evenly among prosumers than the other two mechanisms. By contrast, the relative performance of the nucleolus and the proportional rule varies over time: the nucleolus yields the lower Gini coefficient in some periods, whereas the proportional rule does so in others. These results reinforce
²Minor discrepancies between the displayed column totals and are due to rounding. All allocation rules are efficient when evaluated using unrounded values.
³Cooperative gains were rounded to five decimal places before being classified as strictly positive or zero, and we only consider time instants with heterogeneous deviations.

Figure 2: Lorenz curves of the cooperative gains under the settlement rules at .
the previous finding that the Shapley value distributes positive gains across a broader set of prosumer-time observations.
Now, we study the effects of the property of coalitional rationality. We compute, for every coalition , the coalitional gain . A negative value indicates that coalition could obtain a greater aggregate payoff by settling separately and therefore identifies a violation of coalitional rationality. Figure 3 presents a boxplot of the distribution of these gains for the three allocation rules at . The nucleolus is the only rule that satisfies coalitional rationality for every coalition in this instance. Thus, no coalition receives less than its stand-alone worth. Some coalitions receive exactly their stand-alone worth, as reflected by the zero median coalitional gain. For the proportional rule, some coalitions exhibit negative gains and therefore have incentives to deviate. On the other hand, the median Shapley value is greater than zero, so most coalitions improve their allocation.

Figure 3: Boxplot of the distribution of coalitional gains over all coalitions under the settlement rules at .
The day-wide analysis also reveals an important distinction
between benefiting most coalitions and satisfying coalitional rationality. In the time instants with heterogeneous deviations, approximately 80% of the coalitions receive, under the Shapley value, an allocation greater than or equal to . Moreover, its median coalitional gain is positive and equal to 0.44, which means that at least half of the coalitions obtain a strictly positive benefit from participating in the grand coalition. However, the Shapley allocation lies outside the core at every heterogeneous-deviation time instant, since at least one coalition always receives less than . The proportional rule also fails to satisfy coalitional rationality during the analyzed day: 68% of the coalition-time observations receive an allocation greater than or equal to their coalition worth. Its median coalitional gain is zero, indicating that the center of its distribution lies on the boundary between coalitional gains and losses. By contrast, the nucleolus produces no negative coalitional gains and therefore satisfies coalitional rationality at every time instant. Its median gain is also zero; however, since all nucleolus gains are nonnegative, this result indicates that at least half of the coalitions receive exactly their stand-alone worth rather than a strict participation gain.
An additional distinction between the three methods lies in the additivity of the Shapley value. Since it is additive, if the final goal is to compute the total allocation throughout the day, we can apply it directly to the daily LEM game. In this case, the resulting allocation coincides with the sum of the allocations computed at each time instant of the RTLEM games, which avoids the need to compute both the daily Shapley value and the collection of time-specific Shapley values separately. In contrast, the nucleolus is not additive in general, and the daily allocation of the proportional rule is obtained by summing the settlements computed separately for each time instant. Table IV confirms the additivity of the Shapley value compared with the nucleolus.
| Prosumer | |||
|---|---|---|---|
| 1 | 235.32 | 236.51 | 240.52 |
| 2 | 39.08 | 44.11 | 49.15 |
| 3 | 374.35 | 374.23 | 370.79 |
| 4 | 254.77 | 248.75 | 242.95 |
| 5 | -80.33 | -80.33 | -85.23 |
| 6 | 262.85 | 261.08 | 260.59 |
| 7 | -131.56 | -143.19 | -153.51 |
| 8 | 96.51 | 91.68 | 96.81 |
| 9 | 163.71 | 176.46 | 182.30 |
| 10 | -1120.17 | -1114.79 | -1109.85 |
Table IV: Comparison between time-aggregated and directly computed daily Shapley and nucleolus allocations.
C. Discussion and Practical Implications
From an implementation perspective, the choice of a settlement rule involves a trade-off between interpretability, distributional objectives, coalitional stability, and computational effort. The proportional rule can be explained through individual deviations and proportional responsibility, making it comparatively transparent. However, although it is efficient and individually rational, it may fail to satisfy coalitional rationality.
The Shapley value implements a contribution-based allocation principle by rewarding prosumers according to their expected marginal contributions across all possible coalition-formation orders. This interpretation may be appealing when the community wishes to recognize each participant's contribution to the cooperative surplus. Besides, the Shapley value produces the most even distribution of cooperative gains: it assigns strictly positive gains to a broader proportion of prosumer-time observations and yields the lowest Gini coefficient at every time instant. Moreover, its additivity across games provides an important implementation advantage: the daily Shapley allocation can be computed directly from the aggregated daily game, without having to compute a separate Shapley allocation at every time instant. Nevertheless, the Shapley value is not guaranteed to belong to the core.
The nucleolus follows a different principle. It selects a coalitionally stable allocation by lexicographically minimizing coalition excesses. Since every RTLEM game is balanced, the nucleolus belongs to the core and therefore guarantees coalitional rationality. Among the three mechanisms considered, it is the only rule with this guarantee for every RTLEM instance.
Accordingly, no rule dominates the others under all criteria. The proportional rule prioritizes simplicity and interpretability. The Shapley value provides temporal-aggregation consistency, and produces the broadest and least concentrated distribution of cooperative gains in the analyzed data. The nucleolus prioritizes coalitional stability and is the only rule with a general core-membership guarantee.
V. CONCLUSIONS
This paper introduced a cooperative game-theoretical framework for financial settlements in CB-LEMs. By modeling the settlement process as a cooperative game, we compared different settlement rules, including the proportional rule, the Shapley value and the nucleolus of the RTLEM game. The analysis leads to several key conclusions. First, the RTLEM game is balanced, which guarantees the existence of coalitionally stable allocations and ensures that the nucleolus belongs to the core. The Shapley value remains efficient and individually rational, but, because the RTLEM game is not necessarily convex, the Shapley value is not guaranteed to satisfy coalitional rationality. Second, while the proportional rule is computationally simple, it may fail to align coalitional incentives with community goals, whereas the nucleolus provides a more robust foundation for sustainable participation. Finally, from a computational point of view, the exact computation of the Shapley value and nucleolus may become challenging as community size increases, although additivity properties can simplify temporal aggregation. The case study based on a residential energy community in Amsterdam illustrated the practical implications of the proposed framework, showing how different allocation rules impact the distribution of costs and benefits under real-world conditions. In future work, we aim to explore the application of sampling algorithms and parallel computation to extend our framework to larger communities.
REFERENCES
[1] T. Sousa, T. Soares, P. Pinson, F. Moret, T. Baroche, and E. Sorin, "Peer-to-peer and community-based markets: A comprehensive review," Renewable and Sustainable Energy Reviews, vol. 104, pp. 367–378, 2019.
[2] G. van Leeuwen, T. AlSkaf, M. Gibescu, and W. van Sark, “An integrated blockchain-based energy management platform with bilateral trading for microgrid communities,” Applied Energy, vol. 263, p. 114613, 2020.
[3] J. Faraji, F. Vallée, and Z. De Grève, “A preference-informed energy sharing framework for a renewable energy community,” IEEE Transactions on Energy Markets, Policy and Regulation, vol. 2, no. 4, pp. 503–518, 2024.
[4] L. R. Visser, T. A. AlSkaf, A. Khurram, J. Kleissl, and W. Van Sark, “Probabilistic solar power forecasting: An economic and technical evaluation of an optimal market bidding strategy,” Applied Energy, vol. 370, p. 123573, 2024.
[5] W. Tushar, T. K. Saha, C. Yuen, D. Smith, and H. V. Poor, “Peer-to-peer trading in electricity networks: An overview,” IEEE Transactions on Smart Grid, vol. 11, no. 4, pp. 3185–3200, 2020.
[6] L. Han, T. Morstyn, and M. McCulloch, “Constructing prosumer coalitions for energy cost savings using cooperative game theory,” in 2018 power systems computation conference (PSCC). IEEE, 2018, pp. 1–7.
[7] A. A. Raja and S. Grammatico, “Bilateral peer-to-peer energy trading via coalitional games,” IEEE Transactions on Industrial Informatics, vol. 19, no. 5, pp. 6814–6824, 2023.
[8] W. Tushar, T. K. Saha, C. Yuen, P. Liddell, R. Bean, and H. V. Poor, “Peer-to-peer energy trading with sustainable user participation: A game theoretic approach,” IEEE Access, vol. 6, pp. 62932–62943, 2018.
[9] L. Mitridati, J. Kazempour, and P. Pinson, “Design and game-theoretic analysis of community-based market mechanisms in heat and electricity systems,” Omega, vol. 99, p. 102177, 2021.
[10] Z. Guo, P. Pinson, S. Chen, Q. Yang, and Z. Yang, “Online optimization for real-time peer-to-peer electricity market mechanisms,” IEEE Transactions on smart grid, vol. 12, no. 5, pp. 4151–4163, 2021.
[11] H. Park and R. K. Gupta, “Game-theoretic fair cost allocation of distribution network upgrade costs for solar integration,” in 2026 International Conference on Smart Energy Systems and Technologies (SEST). IEEE, 2026, pp. 1–6.
[12] J. Faraji, A. Sanjab, F. Vallée, and Z. De Grève, “An innovative framework for heterogeneous renewable energy communities providing flexibility services in distribution networks,” IEEE Transactions on Energy Markets, Policy and Regulation, 2026.
[13] A. A. Raja and S. Grammatico, “Online coalitional games for real-time payoff distribution with applications to energy markets,” IEEE Transactions on Energy Markets, Policy and Regulation, vol. 1, no. 2, pp. 97–106, 2023.
[14] A. S. Alahmed and L. Tong, “Dynamic net metering for energy communities,” IEEE Transactions on Energy Markets, Policy and Regulation, vol. 2, no. 3, pp. 289–300, 2024.
[15] A. W. Eriksen and J. Kazempour, “Sharing the gains of aggregation: Cooperative imbalance cost allocation,” arXiv preprint arXiv:2609.39398, 2026.
[16] F. Moret and P. Pinson, “Energy Collectives: a Community and Fairness based Approach to Future Electricity Markets,” IEEE Transactions on Power Systems, pp. 1–11, 2018.
[17] J. Villar, R. J. Bessa, and M. Matos, “Flexibility products and markets: Literature review,” Electric Power Systems Research, vol. 154, pp. 329–340, 2018.
[18] J. L. Crespo-Vazquez, T. AlSkaf, A. M. Gonzalez-Rueda, and M. Gibescu, “A community-based energy market design using decentralized decision-making under uncertainty,” IEEE Transactions on Smart Grid, vol. 12, no. 2, pp. 1782–1793, 2020.
[19] O. N. Bondareva, “Some applications of linear programming methods to the theory of cooperative games,” Problemy Kibernet, vol. 10, p. 119, 1963.
[20] L. S. Shapley, “A value for n-person games,” Contribution to the Theory of Games, vol. 2, 1953.
[21] D. Schmeidler, “The nucleolus of a characteristic function game,” SIAM Journal on applied mathematics, vol. 17, no. 6, pp. 1163–1170, 1969.
[22] Álvaro de Prado Saborido, M. Ángel Mirás Calvo, I. Núñez Lugilde, C. Quinteiro Sandomingo, and E. Sánchez Rodríguez, TUGLab: A Laboratory for TU Games, 2025, r package version 0.0.1. [Online]. Available: https://CRAN.R-project.org/package=TUGLab