# Fairness by design in shared-energy allocation problems

Zoé Fornier, Vincent Leclère, Pierre Pinson

► To cite this version:

Zoé Fornier, Vincent Leclère, Pierre Pinson. Fairness by design in shared-energy allocation problems. Computational Management Science, 2025, 22 (2), pp.11. 10.1007/s10287-025-00532-7. hal-04433116

HAL Id: hal-04433116

https://enpc.hal.science/hal-04433116v1

Submitted on 1 Feb 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Fairness by design in shared-energy allocation
problems

Zoé Fornier¹,²*, Vincent Leclère² and Pierre Pinson³,⁴,⁵

¹*METRON, France.

²CERMICS, France.

³Imperial College London, United Kingdom.

⁴Technical University of Denmark, Denmark.

⁵Halfspace, Denmark.

*Corresponding author(s). E-mail(s): zoe.fornier@enpc.fr;
Contributing authors: vincent.leclere@enpc.fr; p.pinson@imperial.ac.uk;

**Abstract**

This paper studies how to aggregate prosumers (or large consumers) and their collective decisions in electricity markets, with a focus on fairness. Fairness is essential for prosumers to participate in aggregation schemes. Some prosumers may not be able to access the energy market directly, even though it would be beneficial for them. Therefore, new companies offer to aggregate them and promise to treat them fairly. This leads to a *fair resource allocation* problem. We propose to use *acceptability constraints* to guarantee that each prosumer gains from the aggregation. Moreover, we aim to distribute the costs and benefits fairly, taking into account the multi-period and uncertain nature of the problem. Rather than using financial mechanisms to adjust for fairness issues, we focus on various objectives and constraints, within decision problems, that achieve *fairness by design*. We start from a simple single-period and deterministic model, and then generalize it to a dynamic and stochastic setting using, e.g., stochastic dominance constraints.

**Keywords:** Aggregation, Fairness, Stochastic Optimization, Prosumers
# 1 Introduction

Many domains, such as telecommunication networks, healthcare, disaster management, and energy-sharing systems, require fairness as a key criterion. However, fairness is not easy to define or implement, as it can have different meanings and implications in different contexts. However, mathematical models that address real-world problems should not ignore fairness, even if it adds complexity to the problem. In this paper, we investigate various methods to incorporate fairness in a multi-agent problem. Specifically, we apply fairness to the problem of aggregating prosumers, who are both energy producers and consumers, in the energy market.

We focus on electric energy management application, where the aggregation of prosumers is becoming more relevant due to the increasing number of prosumers. Renewable energy generation capacities are becoming more affordable and effective, as renewable energy investments are rising (19% in 2022, according to a report by International Renewable Energy Agency (2023) on global trends in renewable energy). This enables smaller prosumers, such as medium-sized industries, to invest in onsite energy generation and storage. However, prosumers are usually too small to access the electricity market directly, so some companies offer to aggregate them in the energy market.

Those aggregators can be external entities responsible for every prosumer energy transfers. In this case, there is a necessity to think of how the aggregation affects the participants to ensure a fair allocation of benefits. This is highlighted in a report (EUR-ELECTRIC, 2015) on designing fair and equitable market rules for demand response aggregation, published by the association representing the common interests of the European electricity industry, Euralectric. Indeed, there is a practical need to guarantee that each agent benefits from staying in the aggregation. Further, prosumers need to feel like they are not being disfavored compared to others, leading the aggregator to choose a solution with a fair allocation of benefits.

In the literature, one distinguishes two main approaches in handling fairness: solve the problem efficiently and then reallocate the benefits (Yang et al., 2021; Wang et al., 2019; Yang et al., 2023); or change the objective function in order to get a fair solution (Xinying Chen and Hooker, 2023). In the first approach, we model a multi-agent problem with a utilitarian objective i.e., we optimize the aggregated objectives of agents. Then, a protocol is implemented to reallocate the benefits among agents. For example, Shapley values (Shapley, 1952) evaluate the participation of each agent in the group and assess their fair share. The second approach prioritizes fair solutions through the modeling by changing the objective function. The two most studied objective functions are the minimax objective (Rawls, 1971) and the proportional objective (Nash, 1950). The first one optimizes the objective of the agents who is the least well-off in the group. The second one, derived from Nash's bargaining solution, optimizes the logarithm sum of agents' objectives.

However, these approaches present some limitations. On the one side, the proportional and minimax approaches focus merely on the objective function and not decisions. This can be a problem, as in some applications there can be different characteristics which are valuable. For example in an energy contract, both the flexibility and the volume of energy traded are important features. Thus, it is hard to take into
account both of them when the quality of a solution is determined by a single value. On the other hand, post-allocation distributions of benefits are not adapted to problems that are formulated over long periods of time, such as contracts in energy markets. Indeed, those approaches require to solve the whole problem before allocating costs. Then, it is impractical in most cases to expect each agent to wait until the problem's completion, which could span several months or years, to receive their fair share. Furthermore, given the inherent uncertainties linked to most problems, we also want our approach to hold in a stochastic framework. Then, fairness criteria must be redefined considering utility distributions and associated risks over time.

In this paper, we introduce various strategies for integrating fairness considerations into optimization problems. Our primary focus is what we refer to as *fairness-by-design*. Instead of relying on *ex post* redistribution, like in Game Theory (Shapley, 1952), we can establish a degree of fairness directly within the model. We present two key elements for achieving fair allocation in an aggregation. Firstly, we leverage traditional approaches, reviewed in Xinying Chen and Hooker (2023), involving objective functions such as the *utilitarian*, *proportional* and *minimax* objective functions. Secondly, what sets our approach apart is that we propose *acceptability constraints*. Those ensure that agents improve, in some predefined sense, their outcome within the aggregation. These constraints are extended to dynamic and stochastic settings, allowing for risk-averse and time-consistent guarantees. In comparison with Gutjahr et al. (2023), who propose a risk-averse stochastic bargaining game, our approach handles uncertainties through the objective function but also dominance constraints. This enables us to consider various aspects of the impact of uncertainties on the problem. As a result, our proposed model is well-suited for addressing inherent uncertainties within multistage stochastic programs, enhancing its practical applicability. Finally, we assess these different strategies on a toy model and provide a comprehensive analysis of the implications associated with each modeling choice.

The remainder of the paper is organized as follows. In section 2, we delve into definitions fairness and its integration into optimization models. We propose, in section 3, to model prosumers aggregation with acceptability constraints and a fair objective function. section 4 expands the notion of acceptability into the dynamic framework, while section 5 adapts acceptability and fairness to the stochastic framework.

## 2 Fairness: from conceptual aspects to applications

In this section, we give a general overview of how fairness is defined and modeled across the scientific literature, while making the link to our energy application. We first cover some definitions of fairness, before diving into the existing mathematical treatment of the subject.

First, we present two examples to illustrate the concepts introduced in this section.

**Example 1 (Multiportfolio management).** An advisor is in charge of *N* portfolios with individual interests across various assets. The aggregation of portfolios can be
modeled with the following optimization model:

$$ \text{Max}_{x} \sum_{i \in [N]} r_i(x_i) - c\left(\sum_{i \in [N]} x_i\right) \qquad (1a) $$

$$ x_i \in \mathcal{X}_i \qquad \forall i \in [N], \qquad (1b) $$

where $x_i$ are the trades of i, constrained to be in set $\mathcal{X}_i$, $r_i$ is the revenue function, and c the trading cost function.

**Example 2** (Shared Energy storage system (ESS) management). A manager is in charge of managing an ESS, in which M buildings have invested collaboratively. We model the aggregation of buildings with:

$$ \text{Min}_{x^j} \sum_{t \in [T]} \sum_{j \in [M]} c_t^j q_t^j \qquad (2a) $$

$$ p_t^j + \phi_t^j + q_t^j \geq d_t^j \qquad \forall t \in [T], \forall j \in [M] \qquad (2b) $$

$$ x_t^j := (p_t^j, \phi_t^j, q_t^j) \in \mathcal{X}_t^j \qquad \forall t \in [T], \forall j \in [M] \qquad (2c) $$

$$ \text{Soc}_t = \text{Soc}_{t-1} + \sum_{j \in [M]} \phi_t^j \qquad \forall t \in [T], \qquad (2d) $$

where a building j is modeled by $d_t^j$, its energy demand at time t; $p_t^j$, its the energy production at t; $q_t^j$, the quantity of energy bought from the grid at price $c_t^j$; and $\phi_t^j$ the quantity of energy charged from the ESS at t. All variables at t are constrained by set $\mathcal{X}_t^j$. Finally, $\text{Soc}_t$ is the quantity of energy in the shared battery at t, modeled with dynamic equations (2d).

In both those examples, to make all participants benefit from the aggregation, the aggregator must ensure fair treatment. In example 1, the advisor must guarantee equitable distribution of market costs among portfolios. In example 2, deciding how energy from the shared battery should be allocated is not straightforward: should access be proportional to each building's investments, based on energy needs, or should alternative criteria be considered?

## 2.1 Defining, modelling and accommodating fairness

In the Oxford Dictionary, fairness is defined as the quality of treating people equally or in a way that is reasonable. The definition is simple but subjective. Is treating people equally, regardless of any token of individuality, considered fair in society? Furthermore, what does it mean to be reasonable? Whatever take we have on fairness is necessarily subjective and context-dependent. We present here some notions of the philosophical approach to fairness (see Konow (2003) for a deeper analysis). We do not pretend to give a thorough description of the philosophical literature, but merely outline some concepts relevant to the following work.

When speaking of fairness, Konow (2003) distinguish fair processes from fair outcomes. In the first paradigm, fairness is evaluated not through the outcomes, but
through the treatment of each individual in the group that results in said outcomes. This concept is relevant in Machine Learning, for applications like granting or denying loans, bail or parole decisions... In such problems, the inherent biases in the data used for algorithm training can lead to unfair predictive outcomes. Hence, it becomes imperative to integrate fairness into the learning process and think of ways to assess fairness across different data populations. We refer to Jabbari et al. (2017); Caton and Haas (2020); Rychener et al. (2022) for more details on the way fairness can be addressed in machine learning.

On the other hand, the fair outcomes paradigm takes into consideration the individual outcomes and makes sure that everyone gets their fair share. This approach is favored in Game Theory where each individual (or player) is modeled with a utility function whose actual value depends on the actions of all players. For a given set of actions, we obtain a utility vector, denoted $u := (u_1, ..., u_n)$, representing every agent's utility $u_i$. A utility vector is then said to be fair if it satisfies a set of properties that might vary from one specific fairness definition to another. In example 1, the utility is the benefit of each agent, whereas in example 2 the utility is the energy costs of each building. In the remainder of this paper, we discuss fair outcomes approaches.

Intuitively, fairness can be confused with Egalitarianism where a utility vector is said to be fair if all coordinates are equal, meaning that everyone gets the same share. For instance, the Gini coefficient (Gini, 1921) is a commonly used indicator to measure equality—mistaken for fairness— which evaluates how far a given distribution is from the equal distribution. Although it makes sense in some applications, it is impractical most of the time since people have unequal access to resources and different needs: Indeed, in example 2, if we consider equality through the quantity of energy given from the ESS, we would add constraints ensuring everyone gets the exact same amount of energy:

$$ \sum_{t=1}^{T} \phi_{t}^{j} = \sum_{t=1}^{T} \phi_{t}^{j'} \qquad \forall j \neq j' $$

We can see the limits of such modeling as it would provide too much energy to buildings with smaller energy consumption. Moreover, it is found to be unpopular in surveys (Konow (2003)), as people feel they get less than they should. Thus, equal resource (and opportunity) distribution does not address social inequality.

To counteract these side effects, the Need Principle aims at satisfying basic needs equally first and then focusing on efficiency. This is a trade-off between need and other distributive goals. In example 2, each building could decompose its energy demand $d_t^j$ into the minimum energy needed $n_t^j$ plus energy asked for comfort $s_t^j$. Then, additional constraints (3a) can be added to the aggregation model to ensure that everyone gets free energy to satisfy its needs:

$$ p_{t}^{j} + \phi_{t}^{j} + q_{t}^{j} \geq n_{t}^{j} + s_{t}^{j} \qquad \forall t \in [T], \forall j \in [M], $$

$$ p_{t}^{j} + \phi_{t}^{j} \geq n_{t}^{j} \qquad \forall t \in [T], \forall j \in [M]. $$
Then, depending on the energy available in the ESS and the energy produced by each building, the manager dispatches the energy to minimize the aggregated costs of energy bought to the grid. The Need Principle finds practical application in Euphemia (2016), an algorithm developed to optimize the orders to be executed on the European coupled electricity market. Euphemia pursues a dual objective: first, equitably distributing curtailment among areas where a portion of orders are unaccepted; and second, maximizing social welfare by optimizing the total market value in the Day-Ahead auction. The emphasis is on maximizing order acceptance for each area, and then the algorithm seeks an efficient solution.

A different approach was introduced by Rawls (1971): assuming that a group of individuals has no idea of their rank or situation in society, they will agree on a social contract aiming at maximizing the well-being of the least well-off. If the agents possess distinct characteristics, it might be difficult to compare them and ensure equitable treatment among them. This approach to fairness is often referred to as minimax fairness, as it amounts in mathematics to optimizing for the worst objective among agents. In example 1, the minimax aggregator is modeled as:

$$ \text{Max}_{x,t} \quad \min_{i} \{r_{i}(x_{i}) - t_{i}\} \qquad (3a) $$

$$ \text{s.t.} \quad x_i \in \mathcal{X}_i \qquad \forall i \in [N] \qquad (3b) $$

$$ \sum_{i \in [N]} t_i = c \left( \sum_{i \in [N]} x_i \right), \qquad (3c) $$

where $t_i$ represents what the aggregation charges portfolio i for trading. Then, (3c) ensures the sum of cost charged to portfolios equals to the trading cost of the aggregation. This amounts to having transfer variables in-between agents, which is proposed by Iancu and Trichakis (2014) to solve a multi-portfolio problem with fairness considerations. We avoid transfer variables in this paper, as they may raise privacy and trust concerns in practical application. Instead, we simplify the approach by designating the aggregator as the sole entity with complete information on the problem.

Now that we have presented some of the philosophical concepts that define the foundations of fairness, we discuss in the following mathematical ways to model and assess fairness.

## 2.2 Mathematical models of fairness

### 2.2.1 Notions of fair solutions

For more than a century, fairness or inequality has been widely discussed in the literature. The first fairness notion can be traced back to Pareto (2014): a utility vector is said to be Pareto optimal if there are no other accessible utility vector where an individual is better off without negatively impact another. Pareto optimality does not imply fairness in a solution, but guarantees a stability. This concept is also used when trying to find a balance between multiple objectives: traditionally in portfolio management to find a trade-off between a high expected revenue and low risk. Naturally,
it can be adapted to find a solution that is fair and efficient, see Little et al. (2022) and Kamani et al. (2021).

One of the main challenges facing fairness challenges is that of resource allocation among agents. This naturally falls into the scope of Game Theory. In a founding article (Nash, 1950), John Nash introduced the bargaining problem where two agents, allowed to bargain, try to maximize the sum of their utilities. As agents can cooperate, they must have an agreement on properties a utility vector, $u$, should satisfy. Nash proposed four axioms to constitute this agreement: *Pareto optimality*; *Symmetry*, applying the same permutation to two utility vectors does not change their order; *Independence of irrelevant alternatives*, if a utility vector is the optimal utility vector within the feasible set, it remains so if the set is reduced. *Scale invariance*: applying affine transformations to the utility vector does not change the social ranking. Then, he showed that, under a number of assumptions (among them, the set of feasible utility vectors must be convex and compact), there exists a unique utility vector satisfying those axioms. This unique utility vector is regarded in the literature as a viable option when seeking fairness. It has been demonstrated that under convexity of the feasible set, it can be obtained by maximizing the product of utilities (Nash (1953); Muthoo (1999)), and thus by maximizing a logarithmic sum of utilities:

$$ \max_{u \in \mathcal{U}} \sum_{i=1}^{N} \log(u_i - d_i), $$

where $u \in \mathcal{U}$ is a feasible utility vectors among $N$ players, and $d$ is called the *disagree-ment point*, which is the strategy decided by players if they cannot reach an agreement. This approach is referred to as *proportional fairness*. Some papers criticized the *Independence of irrelevant alternatives* for having undesirable side effects. To overcome those issues, Kalai and Smorodinsky (1975) proposed to replace it with a *monotonicity* axiom, resulting in another unique utility vector, and a slightly different vision on fairness.

In opposition to bargaining games, cooperative games study games where forming coalitions is allowed. In this theory, it is assumed that players can achieve superior outcomes by cooperating rather than working against each other. Players must establish their common interest and then work together to achieve it, which requires information exchanges. In Shapley (1952), Shapley studied a class of functions that evaluate players participation in a coalition. Considering a set of axioms (symmetry, efficiency and law of aggregation), Shapley showed that there exists a unique value function satisfying those axioms. He derived an explicit formula to compute the value of a player $i$ in a cooperative game with a set $N$ of players:

$$ \phi_i(v) = \sum_{S \subset N \setminus \{i\}} \binom{|N| - 1}{|S|}^{-1} (v(S \cup \{i\}) - v(S)), $$

where $v(S)$ gives the total expected sum of payoffs the cooperation $S$ can obtain. The values obtained $\{\phi_i(v)\}_{i \in N}$ are called Shapley values. They are considered as a
fair redistribution of gains in the group. However, they are very hard to compute in practice (as the size of the problem grows, those values are not computable).

### 2.2.2 Evaluating the fairness of outcomes

As we study fairness, we naturally look for ways to measure it. In Lan et al. (2010), the authors proposed a mathematical framework based on five axioms (continuity, homogeneity, saturation, partition and starvation) to define and evaluate fairness measures of utility vectors. They established a class of functions satisfying those axioms, which comprises various known measures on fairness, such as Atkinson's index, $\alpha$-fairness, Jain's index... Removing the axiom of homogeneity, this class is extended to measures looking for a trade-off between fairness and efficiency. Although a variety of indices exist, the Gini coefficient, mentioned before, is the most commonly used. For example, in a recent paper (Heylen et al., 2019) studying the fairness in power system reliability, the authors compared a Gini-based index to a variance-based index (similar to the standard deviation index).

When fairness is considered in the problem (through the objective or constraints), it comes at a price: a fair solution might not be the most efficient one. Indeed, many articles try to find a balance between efficiency (have the best objective possible) and fairness (have a fair solution). In Bertsimas et al. (2011), the authors established bounds on the price of fairness for two approaches (proportional fairness and minimax fairness) in resource allocation problems among self-interested players.

In this section, we referred to work that lay the foundations of fairness modeling in mathematics. For a more complete review, we refer to Xinying Chen and Hooker (2023) where the authors provided guidelines for readers to choose the appropriate definition and modeling of fairness. They went through the list of indicators and criteria that exist to measure and define fairness. However, they assumed that fairness can always be reflected through the social welfare function (which corresponds to utilities in Game Theory) of agents. This means that the well-being of different agents are comparable through a single value.

In the following section, we present some applications of aggregations and the way fairness is considered or evaluated.

## 2.3 Applications of fairness in the literature

In this article, we focus on an approach by-design, meaning that fairness is already accommodated in an optimization model. Although fairness is commonly recognized as crucial, in most articles the approach adopted derives from act utilitarianism: one should at every moment promote the greatest aggregate happiness, which consists in maximizing social welfare regardless of individual costs. For instance, in Xiao et al. (2020), the authors studied an aggregator in charge of multiple agents within a power system. They optimized the total revenue of the aggregation without considering the impact on each agent individually. In Moret and Pinson (2019), an aggregator of prosumers can focus on different indicators (import/export costs, exchange with the system operator, peak-shaving services...) to optimize its trades with the energy market, and the trades between prosumers. The indicator to focus on must be agreed
on by the prosumers. The authors gave a sensitive analysis on the parameters of the problem to determine what would increase the social acceptability of such an aggregation system. However, the model is utilitarian as it does not consider the distribution of costs among agents.

Other articles have proposed to first optimize the problem and then reallocate the costs or benefits. For example, some choose to model the aggregation as a coalitional game. This is the case of Freire et al. (2015), where the authors studied a risk-averse renewable-energy multi-portfolio problem. In order to get a fair and stable allocation of profits, they chose the Nucleolus approach which finds a vector utility that minimizes the incentive to leave the aggregation for the worst coalition. In particular, this solution is in the core of the game, meaning every players gains from staying in the grand coalition. Similarly, in Yang et al. (2021), the authors studied a group of buildings with solar generation that mutually invest in an ESS. The approach is to, first, optimize the problem formulated as a two-stage stochastic coalition game. Then, a fair reallocation of costs is determined by computing the nucleolus distribution which minimizes the minimal dissatisfaction of agents.

Some papers have handled fairness through benefit post-allocation schemes. For example in Yang et al. (2023), the authors studied the joint participation of wind farms with a shared energy storage. The solution is found by first solving a two-stage stochastic program, and then reallocating the lease cost among users in a proportional scheme. They chose to make a wind farm pay depending on its increase of revenue after using the energy storage leasing service. In Wang et al. (2019), the authors valued cooperation in their model, which is another way to look at cost redistribution. They considered an aggregator which participates in capacity and energy market for a number of energy users. In their model, the aggregator is not in charge of the users decisions but of the trades with the energy market, therefore he must incentive users to deviate from their optimal scheduling for minimizing total revenue. They proposed to solve an asymmetric Nash bargaining problem to determine the incentivizing costs.

Typically, fairness is dealt with through the objective function, or in a post-allocation scheme. However, some researchers proposed constraints to ensure fairness. For example in Argyris et al. (2022), the authors constrained the allocation feasibility set for a resource allocation problem. They introduced a welfare function dominance constraint: the admissible set of social welfare functions must dominate a referenced one. Then, with a utilitarian objective, a trade-off between fairness and efficiency is obtained. An alternative approach, proposed in Oh (2022), is to bound a fairness indicator. The authors studied the energy planning of multiple agents over a virtual energy storage system (VESS), where energy dispatch is managed by an aggregator. They introduced two fairness indicators depending on the energy allocation, and added constraints bounding them in a utilitarian model. Then, they compared the results with a minimax approach, where they optimize the minimal fairness indicator over agents.

In many cases, uncertainties are inherent to the problem. If multiple articles have dealt with uncertainties, they rarely have a stochastic take on fairness. For example, in both Yang et al. (2023) and Yang et al. (2021), the authors solved their problem with a two-stage program and then redistributed the costs fairly after uncertainty realization. Thus, there is no stochastic policy for fair redistribution. Other articles
accommodated risk-averse profiles to game theory approaches. In Gutjahr et al. (2023), the authors studied a risk-averse extension of the Bargaining Problem. They adapted Nash bargaining axioms to constrain the feasible utility vectors depending on the risk profile of players.

# 3 A shared-resource allocation problem in the context of a prosumer aggregator

We present here a general framework where an aggregator aggregates prosumers' needs (industrial prosumers, residential units, virtual power plants...) and makes transactions with the energy market for the collective. To make aggregation contracts attractive to prosumers, we encounter two distinct challenges: first, each prosumer needs to find the contract *acceptable*, ensuring that each agent derives substantial benefits from the aggregation; second, the decisions made by the aggregator, leading to benefits or losses for each prosumer, should be made fairly. Recall that, for practical reasons, we do not want money transfers to be made between agents.

In the following, section 3.1 formalize the setting, section 3.2 explore various objective functions modeling fair decisions, section 3.3 introduce acceptability constraints, and finally section 3.4 illustrate these notions on a toy model.

## 3.1 Prosumers and market structure

We denote by $x^i \in \mathcal{X}^i$ the set of state and decision variables modeling a prosumer $i$. The technical constraints of prosumer $i$ are represented through feasible set $\mathcal{X}^i$, while the market constraints on market exchanges $M^i x^i$, common to all prosumers, are represented with feasible set $\mathcal{M}$. Finally, each prosumer wants to optimize a cost function $L^i: \mathcal{X}^i \to \mathbb{R}$, yielding the model ($P^i$).

Note that model ($P^i$) can model problems in another context than prosumers. For example, in the case of portfolio management, $x^i$ would be the trades of agent $i$ over a number of assets, $\mathcal{X}^i$ the constraints on the trades, and $L^i$ the function computing revenue depending on the decided trades. In the community energy-storage problem, $x^i$ are the energy flows in-between each building, the battery and the network.

We now consider an aggregator in charge of $I$ agents, we denote $x := (x^i)_{i \in [I]}$. The aggregator in problem (4b), accesses the energy market as one, and its energy exchanges are the aggregated exchanges of prosumers $\sum_i M^i x^i$. Thus, the physical constraint of each prosumer are conserved (see (4b)); while the constraint on the market exchange are aggregated (see constraint (4c)). Finally, on one hand, constraint (4d) ensure that the cost of an agent $i$ is within an acceptable set $\mathcal{A}_\alpha^i$ set they have agreed on prior to optimization. On the other hand, $\mathcal{F}_I$ is the agent operator that computes the objective of the aggregator considering the $I$ objective functions of all prosumers. Depending of the choices of the acceptability sets $\mathcal{A}_\alpha^i$ and the agent operator $\mathcal{F}_I$, discussed respectively in section 3.2 and section 3.3, we obtain different approaches to the shared resource allocation problem.
$$ (P^i) \quad \text{Min}_{x^i} L^i(x^i) \quad (A) \quad \text{Min}_x \mathcal{F}_I((L^i(x^i))_{i \in [I]}) \quad (4a) $$

$$ \text{s.t.} \quad x^i \in \mathcal{X}^i \quad \text{s.t.} \quad x^i \in \mathcal{X}^i \quad \forall i \in [I] \quad (4b) $$

$$ M^i x^i \in \mathcal{M}. \quad \sum_{i \in [I]} M^i x^i \in \mathcal{M} \quad (4c) $$

$$ L^i(x^i) \in \mathcal{A}_{\alpha}^i \quad \forall i \in [I]. \quad (4d) $$

## 3.2 Fair cost aggregation

Assuming that all agents have agreed to participate in the aggregation (we discuss acceptability in section 3.3), we focus on the way the aggregator operates to allocate aggregation benefits among prosumers.

The most natural and efficient method is the so-called *utilitarian* approach:

$$ \mathcal{F}_I^U((L^i(x^i))_{i \in [I]}) = \sum_{i \in [I]} L^i(x^i). \quad (5a) $$

In this approach, the objective is to minimize total costs independently from the distribution of costs among prosumers: fairness is set aside. Indeed, in case of heterogeneity of the objective functions, all efforts of the aggregation are focused on minimizing the dominant objective function. A possibility, that falls out of the scope of this paper (see section 2.2), is to solve (A) and then reallocate resources with a fair scheme, or to put in place money transfers. We thus study alternative agent operators that ensure a fair allocation, for various fairness definitions.

First, we consider the proportional approach based on Nash bargaining solutions (see section 2.2). For this approach, we consider the set of reachable (dis)utilities $\mathcal{L} = \{(L^1(x^1), \dots, L^I(x^I) | x^i \in \mathcal{X}^i, \forall i \in [I], M^i x^i \in \mathcal{M}\}$, and set the optimal value of $(P^i), v^{i1}$, as the chosen disagreement point (see section 2.2). Then, Nash (1950) introduces a set of axioms that must respect a fair repartition of (dis)utilities, and show that if $\mathcal{L}$ is convex and compact, there exists a unique (dis)utility vector satisfying those axioms. Furthermore, it is proven that Nash's repartition is obtained by maximizing the sum of logarithmic utilities. For our problem it corresponds to using the agent operator:

$$ \mathcal{F}_I^P((L^i(x^i))_{i \in [I]}) := - \sum_{i \in [I]} \log(v^i - L^i(x^i)). \quad (5b) $$

Note that this approach tends to advantage smaller participants. Indeed, increasing a small cost improvement is preferred to increasing an already large cost improvement.

<footnote n="1">¹We implicitly assume here that either there is a unique solution, or that we have defined a way to select a solution among the set of optimal solutions.</footnote>
Finally, Rawls' theory of justice leads to the minimax approach favoring the least well-off. Here, the operator we obtain is:

$$ \mathcal{F}_I^{MM}((L^i(x^i))_{i \in [I]}) := \max_{i \in [I]} L^i(x^i). \qquad (5c) $$

This method may not be adequate for heterogeneous agents, as it only focuses on minimizing the costs of the most voluminous agent. To address this issue, we quantify the well-being of an agent by looking at the proportional savings he makes in the aggregation. Then, applying Rawls' principle we obtain the following agent operator:

$$ \mathcal{F}_I^{PMM}((L^i(x^i))_{i \in [I]}) := \max_{i \in [I]} \frac{v^i - L^i(x^i)}{v^i}. \qquad (5d) $$

Note that in a minimax approach, there are multiple solutions with different aggregated costs.

### 3.3 Acceptability constraints

Having established a way to split costs fairly, we must convince prosumers to be part of the aggregation. We consider that a contract cannot be deemed acceptable for a prosumer if they would be better off independently. We can go one step further, and require that, to find the contract acceptable, they benefit from it. We thus define the acceptability set $A_\alpha^i$ appearing in (4d) as follows:

$$ A_\alpha^i := \{ u^i, u^i \le \alpha v^i \}, \qquad (6) $$

where $\alpha \in (0, 1]$ is given. Acceptability sets are independent from one prosumer to another. Thus, the overall acceptability set is the cartesian product of all acceptability sets $A := A_\alpha^{i_1} \times \dots \times A_\alpha^{i_I}$.

**Remark 1.** In the minimax model with agent operator $\mathcal{F}_I^{PMM}$, the optimal solution is 1-acceptable. Indeed, if the agents don't take advantage of the aggregation, then $L^i(x^i) = v^i$ and we get a feasible 1- acceptable solution of optimal value 1. Further, if we consider the problem:

$$ \min_{\alpha} \alpha \qquad (7a) $$

$$ \text{s.t.} \quad x^i \in \mathcal{X}^i \qquad \forall i \in [I] \qquad (7b) $$

$$ \sum_{i \in [I]} M^i x^i \in \mathcal{M} \qquad (7c) $$

$$ L^i(x^i) \in A_\alpha^i \qquad \forall i \in [I], \qquad (7d) $$

it is equivalent to problem (A) with agent operator $\mathcal{F}_I^{PMM}$.

**Remark 2.** Note that our problem with the proportional operator necessarily yields a solution $(1 - \epsilon)$-acceptable, with $\epsilon > 0$. Indeed, if for agent $i$, $L^i(x^i) \ge v^i$, then $\log(v^i - L^i(x^i))$ is undefined.
For simplicity, in the rest of the paper, we assume $\alpha = 1$. We later discuss how to extend the acceptability constraint to a dynamic (see section 4.2) and stochastic framework (see section 5.3). Finally, combining different objective function with acceptability constraints, we observe on a small illustration their impact on the solution in the following section.

## 3.4 Illustration

We now illustrate in a small example the implications of each model proposed in this section. We consider a problem with four consumers ($I := \{1, 2, 3, 4\}$) and $T := 5$ stages. At each stage $t$, we must decide how much energy $q_{t,i}^{DA}$ (resp. $q_{t,i}^{B}$) to purchase from the day-ahead (resp. balancing) market for consumer $i$. Each consumer has bounds $[\underline{q}_i; \bar{q}_i]$ on its energy consumption, and a total consumption $Q_i$ to meet at the end of the horizon. To model the minimum volume requirement for the day-ahead market, we introduce binary variables $b_t^{DA}$ representing the decision to buy a day-ahead. The objective for consumer $i$ is to minimize its energy costs:

$$L^i(x^i) = \sum_{t=1}^{T} [p_t^{DA} q_{t,i}^{DA} + p_t^{B} q_{t,i}^{B}], \quad (8a)$$

where $p_t^{DA}$ (resp. $p_t^{B}$) is the price of energy at $t$ on the day-ahead (resp. balancing) market. We obtain the very simple aggregated model:

$$\text{Min}_x \quad \mathcal{F}_I((L^i(x^i))_{i \in [I]}) \qquad (8b)$$

$$\text{s.t.} \quad \underline{q}_i \le q_{t,i}^{DA} + q_{t,i}^{B} \le \bar{q}_i \qquad \forall t \in [T], \forall i \in [I] \quad (8c)$$

$$\sum_{t=1}^{T} (q_{t,i}^{DA} + q_{t,i}^{B}) \ge Q_i \qquad \forall i \in [I] \quad (8d)$$

$$\underline{q}_t^{DA} b_t^{DA} \le \sum_{i \in [I]} [q_{t,i}^{DA} + q_{t,i}^{DA}] \le M b_t^{DA} \qquad \forall t \in [T] \quad (8e)$$

$$b_t^{DA} \in \{0, 1\} \qquad \forall t \in [T], \quad (8f)$$

where $\mathcal{F}$ is the chosen agent operator for the aggregation. We solve this small problem with the utilitarian operator $\mathcal{F}_I^U$, with the minimax operator $\mathcal{F}_I^{PMM}$ and with the proportional operator $\mathcal{F}_I^P$. For all agent operator, we solve the problem with and without acceptability constraints.

We show on a small, made up, illustration how all these models can lead to different solutions. For the consumers parameters and market prices we use the data on tables 1 and 2. We observe the results on fig. 1 and table 3. First, it's worth noting that none of the consumers can individually access the day-ahead market. In the utilitarian solution, the primary focus lies in minimizing aggregated costs, making it optimal to always consistently access the day-ahead market as a group. To achieve this, consumer $A_1$ redistributes their energy load across the 5 time steps, incurring a higher individual
<table><caption>**Table 1** Prices on both markets</caption><thead><tr><th>t</th><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th></tr></thead><tbody><tr><th>p<sub>t</sub><sup>DA</sup></th><td>2</td><td>16</td><td>1</td><td>10</td><td>1</td></tr><tr><th>p<sub>t</sub><sup>B</sup></th><td>6</td><td>25</td><td>5</td><td>15</td><td>5</td></tr><tr><th>q<sub>t</sub><sup>DA</sup></th><td>11</td><td>11</td><td>11</td><td>11</td><td>11</td></tr></tbody></table>

<table><caption>**Table 2** Prosumers parameters</caption><thead><tr><th>i</th><th>1</th><th>2</th><th>3</th><th>4</th></tr></thead><tbody><tr><th>q&#773;<sub>i</sub></th><td>0</td><td>5</td><td>0</td><td>2</td></tr><tr><th>q&#773;<sub>i</sub></th><td>5</td><td>5</td><td>4</td><td>3</td></tr><tr><th>Q<sub>i</sub></th><td>10</td><td>25</td><td>8</td><td>15</td></tr></tbody></table>

cost (64% higher) than when acting independently. By adding acceptability constraints to the model, we observe that the aggregated costs of consumers does not change, but now the charge of helping big consumers is shared between $A_1$ and $A_3$, and one of them makes no savings in the aggregation.

<table><caption>**Table 3** Percentage of savings $\frac{v^i - L^i(x^i)}{v^i}$ made by $A_i$ in the corresponding model.</caption><thead><tr><th rowspan="2"></th><th colspan="4">Utilitarian</th><th colspan="4">Minimax</th><th colspan="4">Proportional</th></tr><tr><th>A1</th><th>A2</th><th>A3</th><th>A4</th><th>A1</th><th>A2</th><th>A3</th><th>A4</th><th>A1</th><th>A2</th><th>A3</th><th>A4</th></tr></thead><tbody><tr><th>None</th><td>-0.64</td><td>0.46</td><td>0.73</td><td>0.46</td><td>0.30</td><td>0.30</td><td>0.67</td><td>0.30</td><td>0.74</td><td>0.21</td><td>0.80</td><td>0.21</td></tr><tr><th>Average</th><td>0.48</td><td>0.37</td><td>0.0</td><td>0.37</td><td>0.30</td><td>0.30</td><td>0.67</td><td>0.30</td><td>0.74</td><td>0.21</td><td>0.79</td><td>0.21</td></tr></tbody></table>

Conversely, the proportional operator adopts a more bargaining-oriented approach, resulting in collaboration only during time slots when $A_1$ and $A_3$, more flexible and with lower consumption than $A_2$ and $A_4$, intend to consume. This leaves $A_2$ and $A_4$ (together they cannot access the day-ahead market either) to operate independently during other time slots, resulting in limited savings (21%) compared to the utilitarian approach. As noticed in remark 2, the solution is necessarily 1-acceptable. Therefore, the solution is the same with and without acceptability constraints. Moreover, the proportional solution yields the worst aggregated costs.

Lastly, the minimax approach finds a middle ground, where $A_1$ and $A_3$ assist $A_2$ and $A_4$ on most time steps but withdraws support on some occasions, allowing them to avoid expensive consumption. In this case, all consumers achieve similar proportional savings, amounting to approximately 30% compared to operating independently, at the exception of $A_3$ that can save up to 67%. This means that any solution where $A_3$ shifts its consumption to other time slots to help other access the day-ahead market, this would increase its costs to much, then $A_3$ would save less than 30%: this is not an optimal solution for the minimax approach. Again, adding acceptability constraints does not change the solution, as the minimax problem is innately 1-acceptable (see remark 1).

# 4 Fairness for long-term problems

In most use cases we can assume that the aggregation of prosumers is thought to stay in place over long periods. One of the challenges of this long-term setting is to incentivize prosumers not to leave the aggregation, which requires adjusting the acceptability constraints of the static case.
<figure><img src="image_2.png" /><figcaption>Fig. 1 We observe the result of the static Problem (8) with parameters given in tables 1 and 2. The columns correspond to the results of different models we solve. The first one is the non-aggregated model: we solve each ($P^i$) independently. Then, there are three groups of two columns, each group corresponding to a choice of agent operator ($\mathcal{F}_I^U, \mathcal{F}_I^{PMM}, \mathcal{F}_I^P$). Then, given an objective function, are the model, first without and then with, acceptability constraints $A_\alpha$. Each column is decomposed in 4 blocks corresponding to the cost incurred by each consumer $i$.</figcaption></figure>

## 4.1 Problem formulation

We consider a problem with $T$ stages corresponding to consecutive times where decisions are made. At each stage $t \in [T]$, prosumer $i$ makes a decision $x_t^i \in \mathcal{X}_t^i$, incurring a cost $L_t^i(x_t^i)$. Those stage-costs are then aggregated through a time operator $\mathcal{F}_T^i: \mathbb{R}^T \to \mathbb{R}$. Thus, the prosumer $i$'s problem reads:

$$ (P_T^i) := \min_{x_t^i} \mathcal{F}_T^i((L_t^i(x_1^i))_{t \in [T]}) \qquad (9a) $$

$$ \text{s.t.} \quad x_t^i \in \mathcal{X}_t^i \qquad \forall t \qquad (9b) $$

$$ M_t^i x_t^i \in \mathcal{M}_t \qquad \forall t. \qquad (9c) $$

A typical example of time-aggregator $\mathcal{F}_T^i$ is the (actualized) sum of stage costs i.e., dropping the dependence in $x_i$ for clarity's sake:

$$ \mathcal{F}_T^i((L_t)_{t \in [T]}) = \sum_{t \in [T]} r^t L_t, $$
for $r \in (0, 1]$. Alternatively, $\mathcal{F}_T^i$ can be defined as the maximum over stage costs. This might happen for energy markets where a prosumer aims at peak shaving i.e., minimizing peak electricity demand. Further, time-aggregation operators may vary among prosumers, who may express different sensitivity to time. In the remainder of the paper, for clarity's sake, we always consider the time-aggregator as the sum of stage-costs. Actualization rates are directly included in the definition of the stage-cost $L_t^i$.

We now write the aggregation problem within this framework. Note that we can cast the current multistage setting into the setting of section 3, by considering that we have $I \times T$ prosumers. Thus we need to define an operator $\mathcal{F}_{I \times T}$ that takes $\{L_t^i\}_{t \in [T], i \in [I]}$ as input.

However, in most settings, it is reasonable to assume that a prosumer remains consistent throughout the entire horizon. Consequently, the global aggregation operator $\mathcal{F}_{I \times T}$ can be modeled as aggregating over prosumers the aggregation over time of their stage-cost, i.e., $\mathcal{F}_{I \times T} = \mathcal{F}_I \odot \mathcal{F}_T$ where the $\odot$ notation stands for

$$ \mathcal{F}_I \odot \mathcal{F}_T ( (L_t^i)_{i \in [I], t \in [T]} ) = \mathcal{F}_I \left( \mathcal{F}_T^1 ( (L_t^1)_{t \in [T]} ) , \dots, \mathcal{F}_T^I ( (L_t^I)_{t \in [T]} ) \right). \quad (10) $$

Finally, we obtain the following model for the aggregation of prosumers in a dynamic framework:

$$ (A^T) := \min_{x_t^i} \mathcal{F}_I \odot \mathcal{F}_T \left( (L_t^i)_{i \in [I], t \in [T]} \right) \quad (11a) $$

$$ \text{s.t.} \quad x_t^i \in \mathcal{X}_t^i \qquad \forall t \quad (11b) $$

$$ \sum_{i \in I} M_t^i x_t^i \in \mathcal{M}_t \qquad \forall t \quad (11c) $$

$$ (L_t^i)_{t \in [T]} \in \mathcal{A}^i. \quad (11d) $$

Where we recall that we defined $\mathcal{F}_T$ as the sum, and suggest to choose $\mathcal{F}_I$ from $(\mathcal{F}_I^U, \mathcal{F}_I^P, \mathcal{F}_I^{PMM})$ (see section 3.2).

We have shown how to construct a fair objective function of the aggregated model $(A^T)$. However, we have yet to adapt the notion of acceptability to this long-term framework, which is discussed next.

## 4.2 Dynamic acceptability

In long-term problems, for the aggregation to be acceptable, prosumers should not be tempted to leave the aggregation in between stages. Therefore, we extend our notion of acceptability constraint in eq. (6), to a dynamic framework. First, denote $v_t^i := L_t^i(x_t^{i,*})$, the optimal independent cost of prosumer $i$ at stage $t$, where $x_t^{i,*}$ is the optimal solution of Problem (9).

The acceptability constraint eq. (6) consist in requiring, for each prosumer $i$, that its vector of costs $(L_t^i)_{t \in [T]}$ is less than $(v_t^i)_{t \in [T]}$. Unfortunately, there is no natural ordering of $\mathbb{R}^T$, and each (partial) order will define a different extension of the acceptability constraint (6). We present now a few interesting options.
Maybe the most intuitive choice is the component-wise order (induced by the positive orthant), i.e., comparing coordinate by coordinate. This results in the stage-wise acceptability constraint $\mathcal{A}_s$, which enforces that each agent benefits from the aggregation at each stage:

$$ \mathcal{A}_s^i = \{ (u_t^i)_{t \in [T]} \mid u_t^i \le v_t^i, \forall t \in [T] \}. \quad (12a) $$

As this approach might be too conservative for our model, we consider two other ordering.

First, we can relax the stage-wise acceptability by considering that at each stage $t$, each prosumer benefits from the aggregation if we consider its costs aggregated up to time $t$. This result in progressive acceptability constraint $\mathcal{A}_p^i$:

$$ \mathcal{A}_p^i = \{ (u_t^i)_{t \in [T]} \mid \sum_{\tau=1}^{t} u_{\tau}^i \le \sum_{\tau=1}^{t} v_{\tau}^i, \forall t \in [T] \}. \quad (12b) $$

Second, as in eq. (6), we ensure that each agent, aggregating its cost over the whole horizon, benefits from the aggregation. We thus consider average acceptability constraint:

$$ \mathcal{A}_a^i = \{ (u_t^i)_{t \in [T]} \mid \sum_{t=1}^{T} u_t^i \le \sum_{t=1}^{T} v_t^i \}. \quad (12c) $$

**Remark 3.** We have that $\mathcal{A}_s^i \subseteq \mathcal{A}_p^i \subseteq \mathcal{A}_a^i$. The acceptability constraint should be chosen as to strike a balance between aggregated cost efficiency (obtained with larger acceptability set), and incentive to stay in the aggregation (obtained with smaller acceptability set).

## 4.3 Numerical illustration

We take the same example as in section 3.4 and try out different combinations of operator $\mathcal{F}_{I \times T}$ and acceptability set $\mathcal{A}$. Figure 2 represent the distribution of prosumers’ costs for these different cases, while table 4, report their proportional savings.

We observe on fig. 2 that increasing acceptability constraints (from none, to average, progressive and finally stage-wise) protects each prosumer, especially small ones, but induce higher aggregated costs. For example, with a utilitarian operator and no acceptability constraints, $A_1$ pays 64% more in the aggregation than alone. This can be seen as a defect in the model, as $A_1$ would have no interest in participating in the aggregation, that can be corrected by enforcing average acceptability. Note that, in this case, $A_3$ pays the same cost whether he is in the aggregation or not.

On the other hand, choosing an agent operator reflecting fairness (like minimax or proportional) also tends to protect smaller prosumers. Indeed, the acceptability constraints are two distinct tools designed to protect agents’ self-interests in the aggregation. Consequently, if we can observe a change in solution when increasing
<figure><img src="image_3.png" /><figcaption>**Fig. 2** The columns correspond to the results of different models we solve. The first one is the independent model: we solve each ($P_T^i$) independently. Then, there are three groups of four columns, each group corresponds to a choice of agent operator ($\mathcal{F}^U, \mathcal{F}^{PMM}, \mathcal{F}^P$). Then, given an operator, we have the model first without then with different acceptability constraints ($A_a^i, A_p^i, A_s^i$). Each column is decomposed in 4 blocks corresponding to the share of each consumer $i$.</figcaption></figure>

<table><caption>**Table 4** Percentage of savings $\frac{v^i-L^i(x^i)}{v^i}$ achieved by $A_i$ in the corresponding model.</caption><thead><tr><th rowspan="2"></th><th colspan="4">Utilitarian</th><th colspan="4">Minimax</th><th colspan="4">Proportional</th></tr><tr><th>A1</th><th>A2</th><th>A3</th><th>A4</th><th>A1</th><th>A2</th><th>A3</th><th>A4</th><th>A1</th><th>A2</th><th>A3</th><th>A4</th></tr></thead><tbody><tr><th>None</th><td>-64%</td><td>46%</td><td>73%</td><td>46%</td><td>30%</td><td>30%</td><td>67%</td><td>30%</td><td>74%</td><td>21%</td><td>80%</td><td>21%</td></tr><tr><th>Average</th><td>48%</td><td>37%</td><td>0%</td><td>37%</td><td>30%</td><td>30%</td><td>67%</td><td>30%</td><td>74%</td><td>21%</td><td>79%</td><td>21%</td></tr><tr><th>Progressive</th><td>55%</td><td>23%</td><td>44%</td><td>23%</td><td>40%</td><td>23%</td><td>62%</td><td>23%</td><td>45%</td><td>23%</td><td>56%</td><td>23%</td></tr><tr><th>Stagewise</th><td>80%</td><td>14%</td><td>80%</td><td>14%</td><td>80%</td><td>14%</td><td>80%</td><td>14%</td><td>80%</td><td>14%</td><td>8%</td><td>14%</td></tr></tbody></table>

acceptability in those models, this is more impactful when utilizing a utilitarian operator. Indeed, in the utilitarian model, $A_2$ achieves savings ranging from 14% to 46% of his independent cost. In contrast, under the minimax approach, the savings range from 14% to 30%, and with the proportional approach, the savings fall between 14% and 21%.
# 5 Accommodating fairness to uncertainties with stochastic optimization

Problems with energy generation, especially from renewable sources, and prices on energy markets are inherently uncertain. Then, in addition to acceptability and fairness, we must tackle the challenge of handling uncertainties (while being fair about how we handle those). We want to address this issue by extending the problem presented in section 3 to a stochastic framework. To that end, we introduce random variable $\xi$, along with probability space $(\Omega, \mathcal{A}, \mathbb{P})$, which gathers all sources of uncertainties in the problem. For the sake of clarity, we assume that $\Omega$ is finite.

In the same way that we decomposed the problem in section 4 with $T$ time steps, we can decompose the problem here with $\Omega$ scenarios. Thus, there are similarities with the previous section. The main difference is that the set of time-step $\{1, \dots, T\}$ has a natural ordering, while the set of scenario $\Omega$ does not, which leads to discussing different partial orders on $\mathbb{R}^\Omega$ than on $\mathbb{R}^T$.

## 5.1 Static stochastic problem formulation

The problem at hand is naturally formulated as a multi-stage stochastic problem. For simplicity reasons, we first consider a 2-stage relaxation of the problem: in the first stage, here-and-now decisions must be made before knowing the noise's realization; in the second stage, once the noise's realization is revealed, recourse actions can be decided.

We first adapt the individual model ($P^i$) to a stochastic framework:

$$ (P^{i, \rho}) := \min_{\boldsymbol{x}^i(\boldsymbol{\xi})} \rho [L^i(\boldsymbol{x}^i(\boldsymbol{\xi}), \boldsymbol{\xi})] \quad (13a) $$

$$ \text{s.t} \quad \boldsymbol{x}^i(\boldsymbol{\xi}) \in \mathcal{X}^i \qquad \text{a.s.} \quad (13b) $$

$$ M^i \boldsymbol{x}^i(\boldsymbol{\xi}) \in \mathcal{M} \qquad \text{a.s.,} \quad (13c) $$

where $\rho$ is a (coherent) risk-measure i.e., a function which gives a deterministic cost equivalent to a random cost, reflecting the risk of a decision for prosumer $i$, see e.g., Artzner et al. (1999). The choice of $\rho$ depends on the attitude of $i$ towards risk. For example, the risk measure associated with a risk-neutral approach is the mathematical expectation $E_\xi$. Alternatively, a highly risk-averse profile will opt for the worst-case measure $\sup_\xi$. Another widely used risk measure is the Average Value at Risk (a.k.a Conditional Value at Risk, or expected shortfall, see Rockafellar et al. (2000)), or a convex combination of expectation and Average Value at Risk.

Now, we adapt the deterministic aggregation model (A). We fall upon the same challenge as in section 4. With multiple scenarios, we can consider that we have $I \times \Omega$ prosumers and we need to choose an operator $\mathcal{F}_{I \times \Omega} : \mathbb{R}^{I \times \Omega} \to \mathbb{R}$, leading to:

$$ (A^\rho) := \min_{\boldsymbol{x}} \mathcal{F}_{I \times \Omega} \left( (L^i(\boldsymbol{x}^i(\boldsymbol{\xi}), \boldsymbol{\xi}))_{i \in [I]} \right) \quad (14a) $$

$$ \text{s.t} \quad \boldsymbol{x}^i(\boldsymbol{\xi}) \in \mathcal{X}^i \qquad \forall i \in [I] \quad \text{a.s.} \quad (14b) $$
$$ \sum_{i \in [I]} M^i x^i(\xi) \in \mathcal{M} \qquad \text{a.s.} \qquad (14c) $$

$$ L^i(x^i(\xi), \xi) \in \mathcal{A}^i \qquad \forall i \in [I] \quad \text{a.s.} \qquad (14d) $$

We know risk measures and prosumers objectives. As in section 4.1, there are multiple possible choices for such operators. We can assume that this operator $\mathcal{F}_{I \times \Omega}$ results from the composition of two operators: an uncertainty-operator $\mathcal{F}_{\Omega}^i$ dealing with the scenarios, which can differ from one prosumer to another; and an agent operator $\mathcal{F}_I$, as defined in section 3.2. However, contrary to section 4, it is not clear if we should aggregate first with respect to uncertainty (meaning that a prosumer manages its own risk) or with respect to prosumers (meaning that the risks are shared). We next discuss reasonable modeling choices of aggregation operators, and acceptability constraints.

## 5.2 Stochastic objective

For the sake of conciseness, we are going to consider two possible uncertainty aggre- gator: a risk-neutral choice, where $\mathcal{F}_{\Omega}^i$ is the mathematical expectation $\mathbb{E}_{\xi}$, and a worst-case operator where $\mathcal{F}_{\Omega}^i$ is the supremum over the possible realization $\sup_{\xi}$. For the agent operator $\mathcal{F}_I$, which reflects the way to handle fairness, we consider either the utilitarian $\mathcal{F}_I^U$ or the proportional minimax $\mathcal{F}_I^{PMM}$ options (see section 3.3 for definitions).

We suggest four different compositions of $\mathcal{F}_{\Omega}^i$ and $\mathcal{F}_I$ to construct the aggregation operator $\mathcal{F}_{I \times \Omega}$. Again, for simplicity of notations, we write $\mathbf{L}^i$ instead of $L^i(x^i(\xi), \xi)$.

First, we introduce the risk-neutral and utilitarian operator $\mathcal{F}_{I \times \Omega}^{US}$ which aims at minimizing the aggregated expected costs of prosumers:

$$ \mathcal{F}_{I \times \Omega}^{US} ((\mathbf{L}^i)_{i \in [I]}) = \mathcal{F}_I^U \odot \mathbb{E}_{\Omega} ((\mathbf{L}^i)_{i \in [I]}) \qquad (15a) $$

$$ = \sum_{i=1}^{I} \sum_{\xi \in \Omega} \pi_{\xi} L^{i}(x^{i}(\xi), \xi). \qquad (15b) $$

Alternatively, considering a robust approach on uncertainties, we have the operator $\mathcal{F}_{I \times \Omega}^{UR}$ which minimizes the worst-case aggregated costs of prosumers:

$$ \mathcal{F}_{I \times \Omega}^{UR} ((\mathbf{L}^i)_{i \in [I]}) = \sup_{\xi \in \Omega} \odot \mathcal{F}_I^U ((\mathbf{L}^i)_{i \in [I]}) \qquad (16a) $$

$$ = \sup_{\xi \in \Omega} \left\{ \sum_{i=1}^{I} L^{i}(x^{i}(\xi), \xi) \right\}. \qquad (16b) $$

**Remark 4.** We claim that $\sup_{\xi \in \Omega} \odot \mathcal{F}_I^U$ makes more sense than $\mathcal{F}_I^U \odot \sup_{\xi \in \Omega}$ as the later aggregates prosumer's costs that may appear in different scenarios, which means optimizing for impossible costs realization.

On the other hand, we have $\sup_{\xi \in \Omega} \odot \mathcal{F}_I^U = \mathcal{F}_I^U \odot \sup_{\xi \in \Omega}$, by associativity of sums. Similarly, by associativity of supremum, we have $\sup_{\xi \in \Omega} \odot \mathcal{F}_I^{PMM} = \mathcal{F}_I^{PMM} \odot \sup_{\xi \in \Omega}$.
As the first two operators do not model fairness considerations into the model, we now look for a fair distribution, by using $\mathcal{F}_I^{PMM}$ to aggregate prosumers' costs. First, let $\boldsymbol{x}^{i,*}(\boldsymbol{\xi})$ be the<fnref n="2" /> optimal solution of $(P^{i,\rho})$, and denote $v_{\xi}^{i,\rho} := L^i(x^{i,*}(\boldsymbol{\xi}), \boldsymbol{\xi})$, the cost incurred by $i$ when operating alone under uncertainty realization $\boldsymbol{\xi}$. Finally, $\boldsymbol{v}^{i,\rho}$ is the random variable taking values $v_{\xi}^{i,\rho}$ for the respective realization $\boldsymbol{\xi}$.

In sections 3.4 and 4.3, we have shown that the proportional savings minimax approach is more adapted to our problem than the proportional approach. Thus, in a stochastic framework, we propose the operator $\mathcal{F}_{I \times \Omega}^{MS}$:

$$ \mathcal{F}_{I \times \Omega}^{MS}((\boldsymbol{L}^i)_{i \in [I]}) = \mathcal{F}_I^{PMM} \odot \mathbb{E}_{\xi}((\boldsymbol{L}^i)_{i \in [I]}) \quad (17a) $$

$$ = \max_{i \in [I]} \left\{ \frac{\mathbb{E}[\boldsymbol{v}^{i,\mathbb{E}}] - \sum_{\xi \in \Omega} \pi_{\xi} L^i(x^i(\boldsymbol{\xi}), \boldsymbol{\xi})}{\mathbb{E}[\boldsymbol{v}^{i,\mathbb{E}}]} \right\}. \quad (17b) $$

Finally, combining the robust and the proportional savings minimax approaches, we obtain the operator $\mathcal{F}_{I \times \Omega}^{MR}$ which focuses on the prosumer having the worst worst-case cost:

$$ \mathcal{F}_{I \times \Omega}^{MR}((\boldsymbol{L}^i)_{i \in [I]}) = \sup_{\boldsymbol{\xi} \in \Omega} \odot \mathcal{F}_I^{PMM}((\boldsymbol{L}^i)_{i \in [I]}) \quad (18a) $$

$$ = \sup_{\boldsymbol{\xi} \in \Omega} \left\{ \max_{i \in [I]} \left\{ \frac{v_{\xi}^{i,\mathbb{E}} - L^i(x^i(\boldsymbol{\xi}), \boldsymbol{\xi})}{v_{\xi}^{i,\mathbb{E}}} \right\} \right\}. \quad (18b) $$

**Remark 5.** Note that here, depending on the operator's choice, we could have a model with different risk-measure profiles for the prosumers.

Further, as already pointed out, other (coherent) risk measures uncertainty-aggregator could be used. Similarly, other agent-aggregators, as those presented in section 3.2 might be relevant as well.

We now turn to extending the acceptability constraint (6) to a stochastic setting.

## 5.3 Stochastic dominance constraints

As in section 4.2, to induce acceptability, we are requiring that, for each prosumer $i$, its random cost $L^i(\boldsymbol{x}^i(\boldsymbol{\xi}), \boldsymbol{\xi})$ is less than the random cost of the independent model $\boldsymbol{v}^{i,\mathbb{E}}$. Unfortunately, there is no natural ordering of random variable (or equivalently of $\mathbb{R}^\Omega$), and each (partial) order will define a different extension of the acceptability constraint (6).

We now present four acceptability constraints, using various ordering on the space of random variable, leveraging the theory of stochastic dominance (see Dentcheva and Ruszczynski (2003) for an introduction in the context of stochastic optimization). In this section, we give the mathematical expression of acceptability constraints, but mixed integer formulation can be found in appendix A.

<footnote n="2">²We assume uniqueness of a way of selecting an optimal solution, as in section 3)</footnote>
In a very conservative perspective, we consider the almost-sure order, comparing random variables scenario by scenario:

$$ \mathcal{A}_{a.s}^{i, \rho} := \{ \mathbf{u}^{i, \rho}, u_{\xi}^{i, \rho} \le v_{\xi}^{i, \rho}, \forall \xi \}. \qquad (19a) $$

We can relax the almost-sure ordering, by not requiring to benefit from the aggregation for all scenarios, but distributionally. For example, if we have two scenarios $\xi$ and $\zeta$, with same probability, we consider that it is acceptable to lose on $\xi$ if we do better on $\zeta$, that is such that $u_{\xi}^{i, \rho} \le v_{\eta}^{i, \rho}$ and $u_{\eta}^{i, \rho} \le v_{\xi}^{i, \rho}$. To formalize this approach, we turn to stochastic first-order dominance constraints (see Dentcheva and Ruszczynski (2003)), and leverage 1st order acceptability:

$$ \begin{aligned} \mathcal{A}_{(1)}^{i, \rho} &:= \{ \mathbf{u}^{i, \rho}, \mathbf{u}^{i, \rho} \preceq_{(1)} \mathbf{v}^{i, \rho} \} \qquad (19b) \\ &:= \{ \mathbf{u}^{i, \rho}, \mathbb{P}(\mathbf{u}^{i, \rho} > \eta) \le \mathbb{P}(\mathbf{v}^{i, \rho} > \eta), \quad \forall \eta \in \mathbb{R} \} \\ &:= \{ \mathbf{u}^{i, \rho}, \mathbb{E}[g(\mathbf{u}^{i, \rho})] \le \mathbb{E}[g(\mathbf{v}^{i, \rho})], \forall g: \mathbb{R} \to \mathbb{R}, \text{non-decreasing} \}. \end{aligned} $$

One downside of this acceptability constraint is that the modeling entails numerous binary variables, posing practical implementation challenges.

We can thus consider a relaxed, less risk-averse version of 1st order acceptability, relying on stochastic second-order dominance constraints, an known as increasing convex acceptability, which is equivalent to:

$$ \begin{aligned} \mathcal{A}_{(ic)}^{i, \rho} &:= \{ \mathbf{u}^{i, \rho}, \mathbf{u}^{i, \rho} \preceq_{(ic)} \mathbf{v}^{i, \rho} \} \qquad (19c) \\ &= \{ \mathbf{u}^{i, \rho}, \mathbb{E}[(\mathbf{u}^{i, \rho} - \eta)^+] \le \mathbb{E}[(\mathbf{v}^{i, \rho} - \eta)^+] \quad \forall \eta \in \mathbb{R} \} \\ &= \{ \mathbf{u}^{i, \rho}, \mathbb{E}[g(\mathbf{u}^{i, \rho})] \le \mathbb{E}[g(\mathbf{v}^{i, \rho})], \forall g: \mathbb{R} \to \mathbb{R}, \text{convex, non-decreasing} \}. \end{aligned} $$

Moreover, increasing convex acceptability is also easier to implement than 1st order acceptability (see appendix A).

Finally, the risk-neutral acceptability constraint simply compares two random variables through their expectation:

$$ \mathcal{A}_{\mathbb{E}}^{i, \rho} := \{ \mathbb{E}_{\mathbb{P}}[\mathbf{u}^{i, \rho}] \le \mathbb{E}_{\mathbb{P}}[\mathbf{v}^{i, \rho}] \}. \qquad (19d) $$

We can decide to use another convex risk measure instead of the expectation in the above constraint.

**Remark 6.** We have that $\mathcal{A}_{a.s}^{i, \rho} \subseteq \mathcal{A}_{(1)}^{i, \rho} \subseteq \mathcal{A}_{(ic)}^{i, \rho} \subseteq \mathcal{A}_{\mathbb{E}}^{i, \rho}$. Therefore, we get a range of solutions from the most to less constrained model.

## 5.4 Numerical illustration

We consider the stochastic version of the example presented in section 3.4, where balancing prices $\{p_t^B\}_{t \in [T]}$ are random variables with uniform, independent, distribution over $[0.35p_t^{DA}, 5p_t^{DA}]$. The problem can be formulated as a multi-stage program, where
day-ahead purchases are decided in the first stage 0, and then each stage corresponds to a time slot where we can buy energy on the balancing market at price $p_t^B$.

We are going to solve and discuss the sample average approximation of the two stage approximation of this problem. More precisely, we draw 50 prices scenario, and solve a two-stage program where the first stage decisions are the day-ahead purchases, and the second stage decisions are the balancing purchases from time slot 1 to T. We set $I = 4, T = 10$ and we draw $\Omega = 50$ scenarios of balancing prices. For the prosumers parameters and market prices we use the data on tables 2 and 5.

<table><caption>**Table 5** Prices on both markets</caption><thead><tr><th>t</th><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th><th>8</th><th>9</th><th>10</th></tr></thead><tbody><tr><th>p<sub>t</sub><sup>DA</sup></th><td>3</td><td>3</td><td>7</td><td>4</td><td>2</td><td>10</td><td>7</td><td>4</td><td>7.5</td><td>8</td></tr><tr><th>q<sub>t</sub><sup>DA</sup></th><td>12</td><td>12</td><td>12</td><td>12</td><td>12</td><td>12</td><td>12</td><td>12</td><td>12</td><td>12</td></tr></tbody></table>

<table><caption>**Table 6** Percentage of expected savings $\frac{\mathbb{E}[v^{i, \text{sup}}] - \mathbb{E}[L^i(\boldsymbol{x}^i(\boldsymbol{\xi}))]}{\mathbb{E}[v^{i, \text{sup}}]}$ made by $A_i$ and expected aggregated costs $\mathbb{E}[\mathcal{F}_I(L^1(\boldsymbol{x}^{i,*}(\boldsymbol{\xi}))_{i \in [I]})]$ in the corresponding model.</caption><thead><tr><th rowspan="2">Acceptability constraints</th><th colspan="5">Utilitarian Stochastic</th><th colspan="5">Minimax Proportional Stochastic</th></tr><tr><th>A<sub>1</sub></th><th>A<sub>2</sub></th><th>A<sub>3</sub></th><th>A<sub>4</sub></th><th>&oplus; A<sub>i</sub></th><th>A<sub>1</sub></th><th>A<sub>2</sub></th><th>A<sub>3</sub></th><th>A<sub>4</sub></th><th>&oplus; A<sub>i</sub></th></tr></thead><tbody><tr><td>None</td><td>2%</td><td>52%</td><td>-14%</td><td>52%</td><td>684</td><td>32%</td><td>36%</td><td>32%</td><td>32%</td><td>770</td></tr><tr><td>Expected</td><td>4%</td><td>51%</td><td>1%</td><td>48%</td><td>684</td><td>32%</td><td>36%</td><td>32%</td><td>32%</td><td>770</td></tr><tr><td>Increasing convex</td><td>22%</td><td>44%</td><td>25%</td><td>36%</td><td>721</td><td>32%</td><td>36%</td><td>32%</td><td>32%</td><td>770</td></tr><tr><td>First order</td><td>36%</td><td>24%</td><td>34%</td><td>18%</td><td>882</td><td>23%</td><td>21%</td><td>28%</td><td>19%</td><td>918</td></tr><tr><td>Almost sure</td><td>43%</td><td>17%</td><td>41%</td><td>14%</td><td>930</td><td>37%</td><td>17%</td><td>33%</td><td>16%</td><td>941</td></tr></tbody></table><table><thead><tr><th rowspan="2">Acceptability constraints</th><th colspan="5">Utilitarian Robust</th><th colspan="5">Minimax Proportional Robust</th></tr><tr><th>A<sub>1</sub></th><th>A<sub>2</sub></th><th>A<sub>3</sub></th><th>A<sub>4</sub></th><th>&oplus; A<sub>i</sub></th><th>A<sub>1</sub></th><th>A<sub>2</sub></th><th>A<sub>3</sub></th><th>A<sub>4</sub></th><th>&oplus; A<sub>i</sub></th></tr></thead><tbody><tr><td>None</td><td>-19%</td><td>53%</td><td>6%</td><td>49%</td><td>686</td><td>22%</td><td>48%</td><td>21%</td><td>38%</td><td>693</td></tr><tr><td>Expected</td><td>0%</td><td>51%</td><td>0%</td><td>48%</td><td>686</td><td>22%</td><td>48%</td><td>21%</td><td>38%</td><td>693</td></tr><tr><td>Increasing convex</td><td>22%</td><td>43%</td><td>25%</td><td>33%</td><td>738</td><td>29%</td><td>43%</td><td>29%</td><td>33%</td><td>720</td></tr><tr><td>First order</td><td>25%</td><td>22%</td><td>28%</td><td>15%</td><td>920</td><td>28%</td><td>26%</td><td>33%</td><td>18%</td><td>881</td></tr><tr><td>Almost sure</td><td>43%</td><td>17%</td><td>40%</td><td>14%</td><td>930</td><td>43%</td><td>17%</td><td>40%</td><td>14%</td><td>930</td></tr></tbody></table>

We solve the problem with different combinations of aggregation operators and acceptability sets, and can compare the impact of each combination on the solution. We read prosumers' expected percentage of savings with risk-neutral and worst-case approaches on table 6. Moreover, we can observe the distribution of prosumers' expected costs with a risk-neutral (resp. worst-case) approach on fig. 3 (resp. fig. 4).

Our first comment is that the problems, previously identified, from a utilitarian perspective with no acceptability constraints are still present in a stochastic framework. Indeed, both with the risk-neutral utilitarian $\mathcal{F}_{I \times \Omega}^{US}$ and worst-case utilitarian $\mathcal{F}_{I \times \Omega}^{UR}$
operators, we observe on table 6 that some prosumers can pay more in the aggregation compared to being alone ($A_3$ pays +14% in the stochastic approach, and $A_1$ pays +19% in the robust approach). This highlights the necessity for either acceptability constraints or an aggregation operator.

<figure><img src="image_4.png" /><figcaption>**Fig. 3** The columns correspond to the results of different models we solve, with a stochastic approach. The first one is the independent model: we solve each ($P^{i,E}$) independently. The second column corresponds to the problem solved with operator $\mathcal{F}_{I \times \Omega}^{US}$ without acceptability constraints. Then, the four following columns correspond to the same problem with increasingly strong acceptability ($\mathcal{A}_{\mathbb{E}}^{\mathbb{E}}$, $\mathcal{A}_{(ic)}^{\mathbb{E}}$, $\mathcal{A}_{(1)}^{\mathbb{E}}$, $\mathcal{A}_{a.s}^{\mathbb{E}}$). The following column is for the problem solved with operator $\mathcal{F}_{I \times \Omega}^{MS}$ without acceptability constraints, followed by four columns with different acceptability sets. Each column is decomposed in 4 blocks corresponding to the expected share $\mathbb{E}[L^i(\boldsymbol{x}^i(\boldsymbol{\xi}), \boldsymbol{\xi})]$ of each consumer $i$.</figcaption></figure>

If we choose a fair approach through the objective (operators $\mathcal{F}_{I \times \Omega}^{MS}$ and $\mathcal{F}_{I \times \Omega}^{MR}$), we guarantee a higher percentage of savings to all prosumers than in the utilitarian approach. For example, with no acceptability constraints, all prosumers save at least 32% of their costs in a risk-neutral approach, and 21% in a robust approach, compared to respectively -14% and -19% with the utilitarian approach. This comes at the price of efficiency, especially in the risk-neutral case, as the expected aggregated costs of the minimax approach is 13% higher than with the utilitarian approach. This remains true as the level of acceptability increases.

On the other side, when solving this problem with a utilitarian approach (operators $\mathcal{F}_{I \times \Omega}^{US}$ and $\mathcal{F}_{I \times \Omega}^{UR}$), we can increase the guaranteed percentage of savings by constraining more the acceptability. Indeed, with $\mathcal{F}_{I \times \Omega}^{US}$, all prosumers save at least from 1% with
expected acceptability to 22% with increasing convex acceptability, and with $\mathcal{F}_{I\times\Omega}^{UR}$,
it is from 0% to 22%. However, increasing the acceptability to first-order or almost-
sure does not improve this guarantee, as now the problem gets too constrained. For
example, with almost-sure acceptability, the choice of the operator on uncertainty is
inconsequential: the distribution of costs is the same with both operators $\mathcal{F}_{I\times\Omega}^{US}$ and
$\mathcal{F}_{I\times\Omega}^{UR}$. Notably, there exists a substantial gap between increasing-convex acceptability
and first-order acceptability. For example, with the minimax stochastic operator $\mathcal{F}_{I\times\Omega}^{MS}$,
the costs increases from 770 with increasing convex acceptability, to 918 with first-
order acceptability.

<figure><img src="image_5.png" /><figcaption>**Fig. 4** This figure can be read in the same manner as fig. 3, except that the two considered operators are $\mathcal{F}_{I\times\Omega}^{UR}$ and $\mathcal{F}_{I\times\Omega}^{MR}$.</figcaption></figure>

Thus, we obtain here a range of solutions with different balances between efficiency and fairness, but also different visions on risk. In this example, if we want to give the same guarantees to every prosumers, the natural choice would be operator $\mathcal{F}_{I\times\Omega}^{MS}$. However, if we want to opt for an approach less costly, the operators $\mathcal{F}_{I\times\Omega}^{US}$ and $\mathcal{F}_{I\times\Omega}^{UR}$ combined with increasing convex acceptability seem like reasonable options.

Conclusions

We have introduced, developed and analysed, a model for fair prosumer aggregation.
First, we discussed acceptability constraints to discourage prosumers from leaving
the aggregation. We then compared different choices of objective function (utilitarian, minimax and proportional). Through a stylized (and more easily interpretable) deterministic case study, we showed how different combinations of objectives and constraints influence solutions, emphasizing the importance of fairness and acceptability considerations. We then extended the model to dynamic and stochastic frameworks, aligning it with what we expect practical problems to be (i.e., decision-making most likely is for a sequence of time periods, under uncertainty). In this context, we adapt acceptability constraints to account for long-term horizons and uncertainties, and we showcase their impact on solutions using similar stylized instances. In our numerical example, it appears that the proportional min-max agent aggregator, with progressive acceptability constraint in the dynamic case (resp. increasing convex acceptability in the stochastic case), seems to be a good compromise between efficiency and fairness. Recall that the framework discussed here is not reduced to prosumer aggregation in energy markets only, and can be adapted to other aggregation problems in energy system management problems (e.g., virtual power plant, portfolio management in energy markets, ancillary service provision, etc.).

In future work, we plan to discuss the extension of the aggregation problem to a multistage stochastic program, thus having both extension discussed in this paper simultaneously. This will require to discuss possible aggregators $\mathcal{F}_{T \times \Omega \times I}$ over agent, time and uncertainty simultaneously. If we can easily assume a factorization of the form $\mathcal{F}_I \odot \mathcal{F}_{T \times \Omega}$, it would not be realistic to describe $\mathcal{F}_{T \times \Omega}$ as the composition of a time aggregator and an uncertainty aggregator. Indeed, such a factorization would not guarantee time-consistency of the problem, and might not even preserve non-anticipativity. Further, acceptability constraints need to be defined through the use of multivariate stochastic order (see Dentcheva and Ruszczyński (2009); Armbruster and Luedtke (2015); Dentcheva and Wolfhagen (2016)) whose mathematical programming representation are more involved.

## Statements and Declarations

The authors declare they have no financial interests.

## References

* International Renewable Energy Agency: Renewable power generation costs in 2021 (2023). https://www.irena.org/Publications/2023/Feb/Global-landscape-of-renewable-energy-finance-2023 Accessed 2023-12-05

* EURELECTRIC: Designing fair and equitable market rules for demand response aggregation (2015). https://cdn.eurelectric.org/media/1923/0310_missing-links_paper_final.ml-2015-030-0155-01-e-h-D4D245B0.pdf

* Yang, Y., Hu, G., Spanos, C.J.: Optimal sharing and fair cost allocation of community energy storage. IEEE Transactions on Smart Grid 12(5), 4185-4194 (2021)

* Wang, J., Zhong, H., Wu, C., Du, E., Xia, Q., Kang, C.: Incentivizing distributed
energy resource aggregation in energy and capacity markets: An energy sharing scheme and mechanism design. Applied Energy **252**, 113471 (2019)

Yang, X., Fan, L., Li, X., Meng, L.: Day-ahead and real-time market bidding and scheduling strategy for wind power participation based on shared energy storage. Electric Power Systems Research **214**, 108903 (2023)

Xinying Chen, V., Hooker, J.N.: A Guide to Formulating Equity and Fairness in an Optimization Model. Annals of Operations Research **326**, 581–619 (2023)

Shapley, L.S.: A value for n-person games. RAND Corporation (1952)

Rawls, J.: A theory of justice. The Belknap press of Harvard University Press (1971). Eleventh printing, 1981

Nash, J.F.: 4. The bargaining problem. In: Nasar, S. (ed.) The Essential John Nash, pp. 37–48. Princeton University Press, Princeton (1950)

Gutjahr, W.J., Kovacevic, R.M., Wozabal, D.: Risk-Averse Bargaining in a Stochastic Optimization Context. Manufacturing & Service Operations Management **25**(1), 323–340 (2023)

Konow, J.: Which Is the Fairest One of All? A Positive Analysis of Justice Theories. Journal of Economic Literature **41**(4), 1188–1239 (2003)

Jabbari, S., Joseph, M., Kearns, M., Morgenstern, J., Roth, A.: Fairness in reinforcement learning. In: International Conference on Machine Learning, pp. 1617–1626 (2017). PMLR

Caton, S., Haas, C.: Fairness in machine learning: A survey. ACM Computing Surveys (2020)

Rychener, Y., Taskesen, B., Kuhn, D.: Metrizing fairness. arXiv preprint arXiv:2205.15049 (2022)

Gini, C.: Measurement of inequality of incomes. The Economic Journal **31**(121), 124–125 (1921) https://academic.oup.com/ej/article-pdf/31/121/124/27606330/ej0124.pdf

EUPHEMIA Public Description PCR Market Coupling Algorithm (2016). https://www.nemo-committee.eu/assets/files/euphemia-public-description.pdf Accessed 2023-12-05

Iancu, D.A., Trichakis, N.: Fairness and Efficiency in Multiportfolio Optimization. Operations Research **62**(6), 1285–1301 (2014)

Pareto, V.: Manual of political economy: a critical and variorum edition. OUP Oxford (2014)
Little, C.O., Weylandt, M., Allen, G.I.: To the fairness frontier and beyond: Identifying, quantifying, and optimizing the fairness-accuracy pareto frontier. arXiv preprint arXiv:2206.00074 (2022)

Kamani, M.M., Forsati, R., Wang, J.Z., Mahdavi, M.: Pareto efficient fairness in supervised learning: From extraction to tracing. arXiv preprint arXiv:2104.01634 (2021)

Nash, J.: Two-Person Cooperative Games. Econometrica 21(1), 128 (1953)

Muthoo, A.: Bargaining theory with applications. Cambridge University Press (1999)

Kalai, E., Smorodinsky, M.: Other solutions to Nash's bargaining problem. Econometrica: Journal of the Econometric Society, 513-518 (1975)

Lan, T., Kao, D., Chiang, M., Sabharwal, A.: An axiomatic theory of fairness in network resource allocation. In: 2010 Proceedings IEEE INFOCOM, pp. 1-9 (2010)

Heylen, E., Ovaere, M., Proost, S., Deconinck, G., Van Hertem, D.: Fairness and inequality in power system reliability: Summarizing indices. Electric Power Systems Research 168, 313-323 (2019)

Bertsimas, D., Farias, V.F., Trichakis, N.: The Price of Fairness. Operations Research 59(1), 17-31 (2011)

Xiao, X., Wang, J., Lin, R., Hill, D.J., Kang, C.: Large-scale aggregation of prosumers toward strategic bidding in joint energy and regulation markets. Applied Energy 271, 115159 (2020)

Moret, F., Pinson, P.: Energy Collectives: A Community and Fairness Based Approach to Future Electricity Markets. IEEE Transactions on Power Systems 34(5), 3994-4004 (2019)

Freire, L., Street, A., Lima, D.A., Barroso, L.A.: A Hybrid MILP and Benders Decomposition Approach to Find the Nucleolus Quota Allocation for a Renewable Energy Portfolio. IEEE Transactions on Power Systems 30(6), 3265-3275 (2015)

Argyris, N., Karsu, Ö., Yavuz, M.: Fair resource allocation: Using welfare-based dominance constraints. European Journal of Operational Research 297(2), 560-578 (2022)

Oh, E.: Fair Virtual Energy Storage System Operation for Smart Energy Communities. Sustainability 14(15), 9413 (2022)

Artzner, P., Delbaen, F., Eber, J.-M., Heath, D.: Coherent measures of risk. Mathematical finance 9(3), 203-228 (1999)

Rockafellar, R.T., Uryasev, S., et al.: Optimization of conditional value-at-risk. Journal
of risk 2, 21–42 (2000)

Dentcheva, D., Ruszczynski, A.: Optimization with Stochastic Dominance Constraints. SIAM Journal on Optimization 14(2), 548–566 (2003)

Dentcheva, D., Ruszczyński, A.: Optimization with multivariate stochastic dominance constraints. Mathematical Programming 117(1-2), 111–127 (2009)

Armbruster, B., Luedtke, J.: Models and formulations for multivariate dominance-constrained stochastic programs. IIE Transactions 47(1), 1–14 (2015)

Dentcheva, D., Wolfhagen, E.: Two-stage optimization problems with multivariate stochastic order constraints. Mathematics of Operations Research 41(1), 1–22 (2016)

Gollmer, R., Neise, F., Schultz, R.: Stochastic Programs with First-Order Dominance Constraints Induced by Mixed-Integer Linear Recourse. SIAM Journal on Optimization 19(2), 552–571 (2008)

Carrión, M., Gotzes, U., Schultz, R.: Risk aversion for an electricity retailer with second-order stochastic dominance constraints. Computational Management Science 6(2), 233–250 (2009)
# A Modeling of stochastic dominance constraints

We present here practical formulas to implement the stochastic orders dominance constraints introduced in section 5.3. Those constraints establish a dominance between $v^{i,\rho}$, the random variable representing $i$ independent costs, and $u^{i,\rho}$, the random variable representing $i$ costs in the aggregation.

## A.1 First-order dominance constraint model

The first-order dominance constraints (19b) model is based on Gollmer et al. (2008). **Lemma 1.** In Problem ($A^\rho$), acceptability constraints $u^{i,\rho} \preceq_{(1)} v^{i,\rho}$ can be modeled with:

$$b_{\xi, \eta}^{i} \in \{0, 1\} \qquad \forall \eta \in [\Omega], \forall \xi \in \Omega \qquad (20a)$$

$$u_{\xi}^{i, \rho} - v_{\eta}^{i, \rho} \leq M b_{\xi, \eta}^{i} \qquad \forall \eta \in [\Omega], \forall \xi \in \Omega \qquad (20b)$$

$$\sum_{\xi=1}^{\Omega} \pi_{\xi} b_{\xi, \eta}^{i} \leq a_{\eta} \qquad \forall \eta \in [\Omega]. \qquad (20c)$$

We denote $a_\eta := \mathbb{P}(v^{i,\rho} > v_\eta^{i,\rho})$, which is a parameter for the aggregation problem.

*Proof.* As $\Omega$ is assumed to be finite, $v^{i,\rho}$ follows discrete distribution with realizations $v_\eta^{i,\rho}$ for $\eta \in \Omega$. Then,

$$\begin{array}{l} \mathbf{u}^{i, \rho} \preceq_{(1)} \mathbf{v}^{i, \rho} \iff \mathbb{P}(\mathbf{u}^{i, \rho} > \eta) \leq \mathbb{P}(\mathbf{v}^{i, \rho} > \eta) \quad \forall \eta \in \mathbb{R} \\ \phantom{\mathbf{u}^{i, \rho} \preceq_{(1)} \mathbf{v}^{i, \rho} \iff} \phantom{\mathbb{P}(\mathbf{u}^{i, \rho} > \eta) \leq} \mathbb{P}(\mathbf{u}^{i, \rho} > v_{\eta}^{i, \rho}) \leq \mathbb{P}(\mathbf{v}^{i, \rho} > v_{\eta}^{i, \rho}) \quad \forall \eta \in \Omega. \end{array}$$

Then, using $\mathbb{P}(\mathbf{X} > x) = \mathbb{E}[1_{\mathbf{X}>x}]$, and introducing binary variables $b_{\xi, \eta}^i = 1_{u_{\xi}^{i,\rho} > v_{\eta}^{i,\rho}}$, we get:

$$(\mathbb{P}(\mathbf{u}^{i, \rho} > v_{\eta}^{i, \rho}) \leq \mathbb{P}(\mathbf{v}^{i, \rho} > v_{\eta}^{i, \rho}) \iff \sum_{\xi=1}^{\Omega} \pi_{\xi} b_{\xi, \eta}^{i} \leq a_{\eta}) \quad \forall \eta \in \Omega.$$

To linearize the definition of $b_{\xi, \eta}^i$, we rely on big-M constraint:

$$b_{\xi, \eta}^{i} \in \{0, 1\} \qquad \forall \eta \in \Omega, \forall \xi \in \Omega$$

$$u_{\xi}^{i, \rho} - v_{\eta}^{i, \rho} \leq M b_{\xi, \eta}^{i} \qquad \forall \eta \in \Omega, \forall \xi \in \Omega.$$

□

## A.2 Increasing convex dominance constraint model

The increasing convex dominance constraints (19c), is based on Carrión et al. (2009).
**Lemma 2.** In problem $(A^\rho)$, the acceptability constraint $\mathbf{u}^{i,\rho} \preceq_{(ic)} \mathbf{v}^{i,\rho}$ can be modeled with:

$$s_{\xi,\eta}^i \geq 0 \qquad \forall \eta \in [\Omega], \forall \xi \in \Omega \qquad (21a)$$

$$s_{\xi,\eta}^i \geq u_{\xi}^{i,\rho} - v_{\eta}^{i,\rho} \qquad \forall \eta \in [\Omega], \forall \xi \in \Omega \qquad (21b)$$

$$\sum_{\xi=1}^{\Omega} \pi_{\xi} s_{\xi,\eta}^{i} \leq a_{\eta}^{ic} \qquad \forall \eta \in [\Omega]. \qquad (21c)$$

We denote $a_{\eta}^{ic} := \mathbb{E}[(\mathbf{v}^{i,\rho} - v_{\eta}^{i,\rho})^{+}]$.

*Proof.* As in appendix A.1, we know that $\mathbf{v}^{i,\rho}$ follows a discrete distribution with realizations $v_{\eta}^{i,\rho})$ for $\eta \in \Omega$. Then,

$$\begin{align*}
\mathbf{u}^{i,\rho} \preceq_{(ic)} \mathbf{v}^{i,\rho} &\iff \mathbb{E}[(\mathbf{u}^{i,\rho} - \eta)^+] \leq \mathbb{E}[(\mathbf{v}^{i,\rho} - \eta)^+] & \forall \eta \in \mathbb{R} \\
&\iff \mathbb{E}[(\mathbf{u}^{i,\rho} - v_{\eta}^{i,\rho})^+] \leq \mathbb{E}[(\mathbf{v}^{i,\rho} - v_{\eta}^{i,\rho})^+] & \forall \eta \in \Omega.
\end{align*}$$

We introduce positive variables $s_{\xi,\eta}^i = (u_{\xi}^{i,\rho} - v_{\eta}^{i,\rho})^+$, for $\eta \in \Omega$. Thus, we can model the increasing convex dominance constraints as:

$$\left( \mathbb{E}[(\mathbf{u}^{i,\rho} - v_{\eta}^{i,\rho})^+] \leq \mathbb{E}[(\mathbf{v}^{i,\rho} - v_{\eta}^{i,\rho})^+] \iff \sum_{\xi=1}^{\Omega} \pi_{\xi} s_{\xi,\eta}^{i} \leq a_{\eta}^{ic} \right) \quad \forall \eta \in [\Omega]. \quad \square$$