# Optimisation models for the design of multiple self-consumption loops in semi-rural areas

Yohann Chasseray, Mathieu Besançon, Xavier Lorca, Eva Petitdemange

► To cite this version:

Yohann Chasseray, Mathieu Besançon, Xavier Lorca, Eva Petitdemange. Optimisation models for the design of multiple self-consumption loops in semi-rural areas. 2025. hal-04741974

HAL Id: hal-04741974

https://hal.science/hal-04741974v1

Preprint submitted on 8 Jul 2025

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
# Optimisation models for the design of multiple self-consumption loops in semi-rural areas

Yohann Chasseray$^{a,>*}$, Mathieu Besançon$^{b}$, Xavier Lorca$^{b}$, Éva Petitdemange$^{b}$

$^{a}$IRIT, Université de Toulouse, CNRS, Toulouse INP, INU Champollion, 118 Route de Narbonne, Toulouse, 31000, Occitanie, France

$^b$Université Grenoble Alpes, Inria, LIG, 621 avenue centrale, Saint-Martin-d'Hères, 38400, France

$^c$IMT Mines Albi, 1 allée des sciences, Campus Jarlard, Albi, 81000, France

## Abstract

Collective electricity self-consumption gains increasing interest in a context where localised consumption of energy is a lever of sustainable development. While easing energy distribution networks, collective self-consumption requires complementary prosumers' profiles. Before determining the proper energy exchanges happening between these prosumers, one must ensure their compatibility in the context of collective self-consumption. Motivated by real use cases from a solar power producer, this article proposes network flow-based linear models to solve both the design aspect of the problem and the attribution of distribution flows between the involved prosumers. Two main models are proposed, handling (i) single collective self-consumption loop creation and (ii) multiple loop creation. One of the objectives of this work is to provide models that can be applied at a strategic level which implies their extension to large time scale and large spatial scale. To do so, associated Benders and Dantzig-Wolfe decompositions are proposed to ensure model scalability along temporal and spatial dimensions. The proposed models are tested on realistic use cases to assess their performances.

**Keywords:** OR in energy, Mixed-integer linear programming, Benders decomposition, Dantzig-Wolfe decomposition, Smart grid

## Conflict of Interest

Yohann Chasseray declares that he has no conflict of interest. Mathieu Besançon declares that he has no conflict of interest. Xavier Lorca declares that he has no conflict of interest. Éva Petitdemange declares that she has no conflict of interest.

<footnote>*Corresponding author.</footnote>

<footnote>Email address: yohann.chasseray@irit.fr (Yohann Chasseray)</footnote>
# 1. Introduction

In a context where the impact of global warming and the increasing scarcity of the planet's resources are being felt more and more, the management of energy resources has become a central issue and one of the major challenges our societies are facing today. Achieving a sustainable global energy production system means introducing renewable energy into the energy mix. While the share of renewable energy sources in many production systems has increased in recent decades, their internal characteristics affect the way energy is distributed. The intermittency of renewable energy sources such as wind and solar means dealing with temporally and spatially variable energy sources. In particular, since external factors, most often meteorological influence them, the temporal variations can be quite unpredictable. This is especially true for photovoltaic and wind energy, for example.

Moreover, these sources have injection points that are much more decentralised and scattered across the territory than traditional sources such as nuclear or coal power plants. All these characteristics imply a degree of uncertainty which impacts national distribution networks.

All these changes force countries and energy providers to adapt their distribution schemes towards localised energy consumption. Localised consumption poses the question of a more globally decentralised energy system, as many undergoing benefits can be identified. First, achieving a localised network is a way to cut off transmission costs. In a localised network, power losses induced by long-distance transmission are minimised which would be in favour of energy efficiency (Kroposki, 2017). Reaching energy efficiency also supposes that the production of the network is tailored to the consumption of a considered area. Pleading for a decentralised network means that considered areas are revised to be local (Conejo and Sioshansi, 2018). As it would be easier to estimate energy needs on a local scale than on a global scale, decentralised production assures the efficiency of energy resource use. The proximity of generation and consumption sites also enhances grid stability. By reducing the risk of major disruptions, decentralisation then improves the resilience of the whole energy network (Mohamad et al., 2018). Resilience and efficiency of the network become particularly pertinent when considering the likelihood of a substantial increase in electricity consumption in the upcoming decades, not only in terms of overall volume but also in terms of variability in usage (electrical cars, buses, trains). As mentioned at the beginning of this section, the network is thought to integrate renewable energies. These energies are unevenly distributed across regions. Considering local networks ensures a more accurate estimation of the involvement of renewable sources in energy generation within each specific area allowing the consideration of each area specificity (Lund, 2009).

A common way to localise energy consumption is self-consumption, where produced energy is consumed onsite by the producer himself. Recent legislation (e.g. JO (2017) in France) extended self-consumption principles to collective self-consumption where producers and consumers remain locally positioned but can be represented by different legal entities. Despite this favourable context, some constraints (geographical and installed power restrictions) limit the formation of collective self-consumption operations. Besides these constraints, setting
up collective self-consumption requires different but complementary consumer and producer profiles to ensure mutual interest, resulting in few existing operations.

An overarching decision-making system would be necessary to facilitate the establishment of collective self-consumption communities including solar energy companies, other producing and consuming companies and individual dwellings. This system should consider technical, economical, and legal constraints and propose feasible and optimal loops. Such a system will also facilitate discussions on the potential profitability of various communities. This need for an integrated decision support system is notably formulated by Amarenco - a solar energy production company - and motivated as a real use-case our work to design optimal self-consumption loops.

In pursuit of this objective, we formulate the design of self-consumption loops as a mixed-integer linear optimisation problem. Given that the network design needs to encompass a significant time horizon and cover a relatively expansive area (spanning several cities), the proposed model has been extended with Benders and Dantzig-Wolfe decomposition techniques to address challenges on both large temporal and spatial scales.

The next section presents related work on individual and collective self-consumption optimisation with a focus on application-specific modelling choices and optimisation methods. Section 3 details the single-loop model (SLCpct) and multi-loop model (MLCpct) as well as their Dantzig-Wolfe (MLCol) and Benders (SLExt, MLColExt) decompositions. Section 4 details the creation process of realistic instances to apply the models. This section also defines operational indicators built out of model variables and parameters that can help evaluate proposed community designs. Section 5 presents results of the application of the models on priory defined realistic instances. The performance of the models is discussed, and insights regarding the application of the models in the context of the application are provided. Section 6 provides some perspectives regarding the developed models and their potential coupling with domain-related knowledge bases, leading to the conclusion and planned future works.

## 2. Related work

Despite the recent arrival of self-consumption legislation (e.g. JO (2017) in France) allowing different local actors to share a common photovoltaic production, several studies already got their interest focused on the simulation and optimisation of energy communities.

A literature review has been conducted under the criteria shown in Table 1, which describes two main aspects of previous studies, one being related to the size of the tackled problems and used methodology, and the other related to application-specific issues. In this systematic literature review, the objective was to find articles using optimisation techniques to ease the building of self-consumption operations that include several actors in a given community.

Table 2 summarizes the conducted literature review and compares our approach to some of the analysed articles. The presented articles are selected as they encompass one or several dimensions of our approach.
<table><caption>Table 1: Literature review evaluation criteria</caption><thead><tr><td>Criterion</td><td>Description</td></tr></thead><tbody><tr><td>Problem size</td><td>How many actors are considered? How are they dispatched on the territory?</td></tr><tr><td>Time range</td><td>What are the optimisation time periods and horizon?</td></tr><tr><td>Method</td><td>Which method, algorithm, or model are used to solve the optimisation/simulation problem?</td></tr><tr><td>Self-consumption</td><td>Is the collective aspect of self-consumption considered in the model?</td></tr><tr><td>Actors selection</td><td>Does the model include the selection of actors and installations?</td></tr><tr><td>Leg. constraints</td><td>Are some legal constraints integrated into the model?</td></tr></tbody></table>

<table><caption>Table 2: Comparison of analysed articles (NR: Not Relevant - NA: Not Available)</caption><thead><tr><th rowspan="2">Reference</th><th colspan="3">Size of the problem</th><th rowspan="2">Method</th><th rowspan="2">Actors selection</th></tr><tr><th>nb actors</th><th>time horizon</th><th>time range</th></tr></thead><tbody><tr><td>Al-Sorour et al. (2022)</td><td>6</td><td>4 months</td><td>10 min</td><td>MILP</td><td>Yes</td></tr><tr><td>Bahret and Eltrop (2021)</td><td>20</td><td>1 year</td><td>NA</td><td>MILP</td><td>No</td></tr><tr><td>Brusco et al. (2023)</td><td>41</td><td>NA</td><td>hour</td><td>MILP</td><td>No</td></tr><tr><td>Espadinha et al. (2023)</td><td>4</td><td>1 year</td><td>hour</td><td>Func minimisation</td><td>No</td></tr><tr><td>Gil Mena et al. (2023)</td><td>12</td><td>1 year</td><td>hour</td><td>Heuristic</td><td>No</td></tr><tr><td>Goitia-Zabaleta et al. (2023)</td><td>15</td><td>1 year</td><td>NA</td><td>MILP</td><td>No</td></tr><tr><td>Gullì et al. (2022)</td><td>4</td><td>1 year</td><td>hour</td><td>MILP</td><td>No</td></tr><tr><td>Luz and E Silva (2021)</td><td>2</td><td>NR</td><td>15 min</td><td>NA</td><td>No</td></tr><tr><td>Mustika et al. (2022a)</td><td>7</td><td>1 month</td><td>30 min</td><td>MINLP</td><td>No</td></tr><tr><td>Perger et al. (2021)</td><td>15</td><td>1 year</td><td>hour</td><td>MILP</td><td>No</td></tr><tr><td>Pinto et al. (2020)</td><td>50</td><td>NA</td><td>NA</td><td>MILP</td><td>No</td></tr><tr><td>Reis et al. (2022)</td><td>50</td><td>NA</td><td>min</td><td>MAS - Heurisitic</td><td>No</td></tr><tr><td>Sangaré et al. (2023)</td><td>7</td><td>1 day</td><td>30 min</td><td>MILP</td><td>No</td></tr><tr><td>Simoiu et al. (2021)</td><td>10</td><td>NA</td><td>hour</td><td>MILP</td><td>No</td></tr><tr><td>Stephant et al. (2021)</td><td>8</td><td>1 day</td><td>NA</td><td>Game Theory</td><td>No</td></tr><tr><td>Proposed model</td><td>100</td><td>6 months</td><td>hour</td><td>MILP - Benders Dantzig-Wolfe</td><td>Yes</td></tr></tbody></table>

## 2.1. Specific application context

Related lines of work show that electricity consumption optimisation is an active topic of interest. Despite some studies focusing on the specific cases of multi-energy communities, including gas, wind, and/or heat as energy sources (Bio Gassi and Baysal, 2022; Gullì et al., 2022; Pinto et al., 2020; Bokkisam et al., 2022; Bahret and Eltrop, 2021), most of the identified papers deal with solar energy only, as it represents the majority of current collective self-consumption projects.

A large majority of the previous work focuses on the management of self-consumption or collective self-consumption operations making the assumption that the actors of the loops are already defined and fixed. Mustika et al. (2022b) study the impact of the addition of a newcomer into an existing collective self-consumption loop. They propose a heuristic method to define which actor has the most impact on the self-consumption loop. Among studied articles, some only focus on individual self-consumption without considering multiple actors.
Some configurations, although technically considered collective self-consumption as they involve several households, remain in a middle ground between individual and collective self-consumption. Many articles, such as Gullì et al. (2022); Mustika et al. (2022a); Pasqui et al. (2023); Stephant et al. (2021) apply their model to a group of households being located in the same building or in the same neighbourhood, which can technically be defined as a collective self-consumption loop, but remains clearly limited geographically and in terms of number of individual actors. Geographically framed models fail to take into account the legal distance constraint that is inherent to collective self-consumption definition (Strepparava et al., 2022). More generally, regulatory constraints are rarely considered explicitly in optimisation models but are rather used as a criterion to assess found solutions (Pinto et al., 2020; Gribiss et al., 2023; Gil Mena et al., 2023).

Other lines of work extend the diversity of analysed profiles to include other types of consumers, such as professional buildings (Wang et al., 2021; Goitia-Zabaleta et al., 2023), electric vehicle pools (Surmann et al., 2020; Piazza et al., 2023), a winery (Luz and E Silva, 2021) or a train station (Simoiu et al., 2021), showing the economical interest of collective self-consumption. Enlarging the diversity of profiles is in favour of collective self-consumption as diverse actors may present complementary consumption and production profiles.

Extending the breadth of considered actors also implies an extension of the considered area. In most cases, proposed algorithms and models are applied to an urban case study (Brusco et al., 2023; Goitia-Zabaleta et al., 2023; Gullì et al., 2022; Mustika et al., 2022a; Perger et al., 2021). Beyond revealing that rural or semi-rural self-consumption loop configurations are rarely considered in the conception of optimisation models, it also underlines the fact that most current self-consumption loops are essentially built in urban context thus limiting the range of actors that can be considered. If urban contexts may favour collective self-consumption as the density of consumers and prosumers is higher than in rural contexts, focusing on semi-rural contexts can also have some advantages, as the constraint of geographic contiguity can be revised by regulatory texts and open to new types of producers. Luz and E Silva (2021) showed for instance the benefits of creating an energy community between a rural winery and the nearby city.

Extending the range of considered actors also means that proposed models should adapt to a growing number of self-consumption participants. Despite extending the diversity of involved actors, some articles focus on larger problems, defining optimisation for more than 50 actors (Pinto et al., 2020; Reis et al., 2022; Böhringer et al., 2023; Luz et al., 2021).

In a nutshell, only few previous lines of work treat the problem on both a spatial dimension (large number of actors) and a temporal dimension (large time horizon and high number of time steps). Above all, the proposed approaches are mainly focused on flow repartition, and very few of them address the design aspect of collective self-consumption loops definition. Among them, Al-Sorour et al. (2022) proposes models that include the selection of peer-to-peer household pairs, ensuring that each household is involved in only one pairing. Since this approach involves actors selection, the design context differs as the pairing is determined through semi real-time forecasting (selection is conducted on a 2-day ahead forecast), and
the model's complexity lies in its consideration of storage facilities. Moreover, the pairing selection is applied to a predefined and relatively small group of actors (6 households), which minimizes solving time concerns that typically arise in larger territories, where the selection must be performed over a greater number of actors.

## 2.2. Modelling and solving approaches

Mainly, three optimisation approaches are used, which are (i) mixed-integer linear programming models, (ii) agent-based system models and (iii) heuristics or meta-heuristics optimisation algorithms. In articles such as Reis et al. (2022); Stephant et al. (2021); Surmann et al. (2020), agent-based models are mostly used to ensure that each participant of a self-consumption loop is making its choices independently from others and that the optimisation system is taking into account its preferences. Luz et al. (2021) adopts the point of view of device scheduling, each device having constraints concerning its use. Agent-based programming is used to model situations where actors do not have the information about other actors to decide a strategy. It allows a compromise between the research of a group of optimal solutions while keeping constraints on each individual's preferences. In energy-sharing communities, one of the issues is the privacy regarding participant data (production and load data). As optimising a community and its associated exchanges requires knowing each participant's consumption and production profile, some work (Bokkisam et al., 2022) focus on systems that guarantee anonymity while allowing the use of participant's information concerning their consumption and production.

In terms of practical application, most of the articles use theoretical or simulated data to represent realistic scenarios (Gil Mena et al., 2023; Gribiss et al., 2023; Luz et al., 2021). However, some of them are driven by a real use case involving local energy communities.

Heuristics and meta-heuristics methods are generally used to deal with larger problems in a reasonable amount of time. In the case of collective self-consumption optimisation two dimensions increase the size of problems, which are, the number of integrated producers, as well as the time horizon and time step considered. Wang et al. (2021) for instance, use a particle swarm algorithm to optimise storage and trading strategies within an energy community involving a large number of participants (10 professional buildings and 90 households). Gil Mena et al. (2023) used the JAYA heuristic algorithm on hourly data over a one-year horizon. Similarly, Heidari et al. (2021) used a genetic algorithm as the thermodynamic model used in their study is nonlinear, and becomes time-consuming for large time horizons.

Mixed-integer linear programming models, however, remain the more common methods used for collective self-consumption optimisation as the exchanges between actors can easily be modelled through linear flow-type constraints. Even though they remain less costly than non-linear models, linear programming is mostly applied to small problems, which rarely exceed 10 or 20 participants on large time horizons.

The problem of collective self-consumption has to be designed over several time steps and should be considered on a more global scale than the limited cases of already existing communities involving few participants. Despite the interest of linear programming models
for collective self-consumption optimisation due to their ease in modelling exchanges between
actors, they are usually applied to small-scale problems involving either a few participants
or a short time horizon. Addressing the complexity of collective self-consumption, however,
requires a broader perspective.

As highlighted in Table 2, our proposal fills the identified gap in the literature regarding
self-consumption loops in rural or semi-rural environments. In particular, the proposed multi-
loop model tends to address three aspects that have been overlooked in previous work, which
are:

* The integration of legal constraints directly in optimisation models when defining self-consumption loops.

* The inclusion of loop configuration in the optimisation problem, making it possible to build the optimal set of energy communities based on a given group of individual prosumers and their characteristics (consumption and production profile, geographical location).

* Model decompositions to scale to larger problems spatially and regarding time horizon. Very few work use both decompositions, as their combination highly complexifies problems. Thus, we provide in this article a simplification of the column generation problem that allows to extend the size of the models both regarding time dimension and spatial dimension.

### 3. Optimisation models

This section details the models that have been defined to find the optimal microgrid
configuration for a given list of prosumers. Two main models have been defined named single-
loop model and multi-loop model. These initial models may present a long solving time when
dealing with large instances. As illustrated in Figure 1, these limitations arise regarding two
dimensions which are (i) growing time scale, and (ii) growing geographical scale (inducing a
higher number of prosumers).

To tackle temporal scale limitations, a Benders decomposition is proposed, which splits
the problem formulation into two subproblems. The first one (master problem) resolves the
design aspect of the network in terms of member participation to self-consumption loops. The
second one (subproblem) adjusts energy exchanges between net producers and net prosumers.

The geographical scale dimension is approached using a Dantzig-Wolfe decomposition
where the column generation process is simplified through the generation of feasible loops
directly from the prosumer's neighbourhood graph topology, avoiding the branch-and-price
algorithm.

The combination of the two decompositions (Benders and Dantzig-Wolfe) on the multi-loop model is then used to scale the problem-solving capacities from small numbers of actors and short time horizon to larger problems in both dimensions.

From an application point of view, the design problem can be considered at an operational
level (day-to-day optimisation of self-consumption in a small neighbourhood). Our objective
though is to treat strategic network design problems, as collective self-consumption is planned
for several years, on potentially large territories. This changes the size of studied problems,
making it necessary to scale them in time and space through the presented decompositions.
The combination of the initial models with their decomposition led to the 5 following models,
also shown in Figure 1, whose performance is compared in Section 5:

*   **Single-loop compact model (SLCpct)** assumes that only one self-consumption loop is to be built and each actor can either join or stay apart from this self-consumption loop.

*   **Benders extended single-loop model (SLExt)** decomposes the single-loop model to allow large time scale problems to be solved in a reasonable amount of time.

*   **Multi-loop compact model (MLCpct)** extends the single-loop model by providing the possibility to build several self-consumption loops with an actor joining one or none of them.

*   **Generated cliques multi-loop model (MLCol)** decomposes the multi-loop model using Dantzig-Wolfe decomposition and a clique generation algorithm.

*   **Benders extended multi-loop model (MLColExt)** decomposes the Extended multi-loop model to allow large time-scale problem resolution for the Dantzig-Wolfe decomposition of the multi-loop model.

<figure><img src="image_2.png" /><figcaption>Figure 1: Objective and impact of solving approaches (Dantzig-Wolfe and Benders decomposition).</figcaption></figure>
<figure><img src="image_3.png" /><figcaption>Figure 2: Network flow model representation</figcaption></figure>

All the presented problems embed the time scale dimension and can include a stochastic aspect to reasoning on a set of possible scenarios.

## 3.1. Definitions and assumptions

To express the optimisation problem, we make the following assumptions:

**Assumption 3.1 (Fixed actors).** The list of potential members of the loops is known and fixed before the optimisation. Whether each actor belongs or not to the self-consumption loop is however still to be determined.

**Assumption 3.2 (External electricity pricing).** The electricity buying and selling cost outside the loop may vary over the actors and is proportional to the amount of bought or sold electricity. Details about price determination are given in Section 4.1.3.

**Assumption 3.3 (Prosumers actors).** Each actor is modelled as a prosumer. A producer can however have zero production as well as a consumer can have zero consumption. They are thus respectively depicted as direct consumers and direct producers.

**Assumption 3.4 (Consumption/production data).** The optimisation takes place over several time steps. For each time step and each scenario, the consumption and production are known for each actor. Consumption can be predicted from previous consumption data of an actor and production data can be evaluated through solar plant characteristics (installed power, panel orientation, panel tilt) and local environmental conditions (irradiation) based on the localisation of actors.

**Assumption 3.5 (Loop exclusivity).** Single-loop and multi-loop configurations can be considered. In the single loop scenario, an actor either participates in the loop or is excluded from the loop. In the multi-loop scenario, an actor can participate in one loop (only) among several loops or can be excluded from all of the loops.

Within the scope defined by the previous assumptions, we set the following optimisation parameters, which will help define the optimisation problem (See Figure 2):
• $\mathcal{A} = \{A_1, \dots, A_n\}$ all available actors that are potential members of a self-consumption loop.

• $C_1, \dots, C_n$ the net consumption of the available actors (when needed, absolute consumptions are expressed with $C_{\text{abs},i}$ expression).

• $P_1, \dots, P_n$ the net quantity of energy produced by each of the available actors (when needed, absolute productions are expressed with $P_{\text{abs},i}$ expression).

• $F_1, \dots, F_n$ the grid-sourced electricity cost for each available actor.

• $R_1, \dots, R_n$ the grid electricity selling price for each available actor.

• $\mathcal{L} = l_1, \dots, l_{n/2}$ the set of possible self-consumption loops having at least 2 actors each, given the n available actors.

• $D_{ij}$ is the geographical distance between two actors and $D_{\text{leg}}$ is the maximal legal geographical distance legally acceptable between two actors participating in the same self-consumption loop.

• $P_i^{\text{inst}}$ installed power of each actor and $P_{\text{leg}}^{\text{inst}}$ the installed power legal limit that should not be exceeded by the cumulative installed power of the members of a self-consumption loop.

**Definition 3.1 (Direct consumer).** An actor $A_i$ is called a direct consumer when $P_i = 0$

**Definition 3.2 (Direct producer).** An actor $A_i$ is called a direct producer when $C_i = 0$

For a natural number $n$, we use $[n] = \{1 \dots n\}$ and define the following decision variables:

• $x_i \in \{0, 1\}, i \in [n]$ the binary variables indicating that actor $i$ is a member of a self-consumption loop. When extending to multiple loops, those variables are indexed by the loop: $x_i^l$.

• $e_{ij} \in [0, 1], (i, j) \in [n]^2, i \neq j$ the real variables indicating the amount of energy that each actor $i$ exchange with actor $j$ within a self-consumption loop. Self-consumed energy amounts ($e_{ii}$) are not represented as decision variables as they can be deduced afterwards (see section 3.2.1, individual self-consumption constraints paragraph).

• $f_1, f_2, \dots, f_n$ the amounts of energy supplied by the grid to each actor.

• $r_1, r_2, \dots, r_n$ the amounts of energy sold to the grid by each actor.

## 3.2. Initial single-loop network design and flow circulation problem

In the initial flow circulation problem the first constraints to be defined are Kirchhoff flow conservation constraints, which ensure flow circulation avoiding accumulation of the energy exchanged. For each actor, flow conservation is expressed through an equality constraint between the energy amount received by the actor and the energy amount given away by the
same actor. Received energy is the addition of energy received from other actors, energy produced by the actor and energy taken from the grid. Sent energy is the addition of energy given to other actors, energy consumed by the actor and energy sold to the grid. In the complete model presented below, this constraint is expressed with equation (1d).

The complete single-loop compact model provided as Model (1) (SLCpct) expresses the coupled problem of network design and flow repartition in a single-loop configuration, meaning that each prosumer either belongs to this loop or is not participating in collective self-consumption. The detail about each constraint and the objective function are given throughout section 3.2.1 to 3.2.5.

$$ \min_{x,e,r,f,z,y} \sum_{s \in S} \sum_{t \in T} \sum_{i \in [n]} p_s (F_i^{st} f_i^{st} - R_i^{st} r_i^{st}) \quad (1a) $$

$$ \text{s.t.} \quad e_{ij}^{st} \le x_i P_i^{st} \quad \forall (i,j) \in \mathcal{E}, s \in S, t \in T \quad (1b) $$

$$ e_{ij}^{st} \le x_j C_j^{st} \quad \forall (i,j) \in \mathcal{E}, s \in S, t \in T \quad (1c) $$

$$ \sum_{j \in \mathcal{N}_i} e_{ij}^{st} + r_i^{st} + C_i^{st} = \sum_{j \in \mathcal{N}_i} e_{ji}^{st} + f_i^{st} + P_i^{st} \quad \forall i \in [n], s \in S, t \in T \quad (1d) $$

$$ y_i^{st} \le x_i Q^{st} \quad \forall i \in [n], s \in S, t \in T \quad (1e) $$

$$ y_i^{st} \le r_i^{st} \quad \forall i \in [n], s \in S, t \in T \quad (1f) $$

$$ y_i^{st} \ge r_i^{st} - (1-x_i)Q^{st} \quad \forall i \in [n], s \in S, t \in T \quad (1g) $$

$$ \sum_{i \in [n]} y_i^{st} \le \sum_{i \in [n]} x_i(P_i^{st} - C_i^{st}) + M^{st}(1-z^{st}) \quad \forall s \in S, t \in T \quad (1h) $$

$$ y_i^{st} \le M^{st} z^{st} \quad \forall i \in [n], \forall s \in S, t \in T \quad (1i) $$

$$ \sum_{j \in \mathcal{N}_i} e_{ij}^{st} + r_i^{st} \le B_i^{st} \quad \forall i \in [n], s \in S, t \in T \quad (1j) $$

$$ x_i + x_j \le 1 \quad \forall (i,j) \notin \mathcal{E} \quad (1k) $$

$$ \sum_{i \in [n]} x_i P_i^{\text{inst}} \le P_{\text{leg}}^{\text{inst}} \quad (1l) $$

$$ z^{st} = 1 \Leftrightarrow \sum_{i \in [n]} x_i(P_i^{st} - C_i^{st}) \ge 0 \quad \forall s \in S, t \in T \quad (1m) $$

$$ x \in \{0,1\}^n, z \in \{0,1\}^{|S||T|} \quad (1n) $$

$$ e, r, f, y \ge 0. \quad (1o) $$

where $B_i^{st}$ is a bound on the maximum net production of actors, which can be set to (1) $P_{\text{abs},i}^{st}$ (absolute production of prosumer $i$) or (2) $\max\{P_i^{st} - C_i^{st}, 0\}$ (direct production of prosumer $i$) depending on whether individual self-consumption is forced (2) or not (1). $Q^{st} = \sum_{i \in [n]} \max\{P_i^{st} - C_i^{st}, 0\}$ and $M^{st} = \max\{\sum_{i \in [n]} P_i^{st}, \sum_{i \in [n]} C_i^{st}\}$ are big M constants used to ease the reading of the model.
### 3.2.1. Constraints from self-consumption applications

To stay in line with concrete self-consumption cases, additional constraints can be added to the model. Different constraints can be set depending on the type of self-consumption that one chooses to apply, based on the following definitions:

**Definition 3.3 (Self-consumption).** Self-consumption is defined at the scale of an actor. Self-consumed energy corresponds to energy that has been produced by an actor and which is consumed by this actor. Self-consumption of an actor does not imply that he takes part in a self-consumption loop. An actor $A_i$ maximises its self-consumption rate when $r_i + \sum_{j \in [n], j \neq i} e_{ij}$ is minimal.

**Definition 3.4 (Collective self-consumption).** Collective self-consumption is defined at the scale of a self-consumption loop. Collective self-consumed energy corresponds to the energy that has been produced by a member of the loop, and which is consumed within the loop. To do so, the produced energy can be consumed by the producer itself (self-consumption) or by another member of the loop. A loop maximises its collective self-consumption rate when $\sum_{i \in [n]} r_i$ is minimal.

**Individual self-consumption constraints.** Even though no legal requirement is considered concerning individual self-consumption, one forces the actors of a self-consumption loop to satisfy their consumption needs before exchanging energy with other actors or with the grid. To force the energy that is produced by an actor to be consumed by the same actor prosumers' production and consumption are expressed as net production and consumption, assuming that $e_{ii}$ are fixed either to $P_i$ if $P_i < C_i$ (net consumer) or to $C_i$ if $P_i > C_i$ (net producer). Individual self-consumption constraints are not related to whether or not an actor is a member of a collective self-consumption loop as even an excluded actor should consume a part of the energy they produce.

**Collective self-consumption constraints.** The interest of participating in collective self-consumption is to favour locally produced electricity instead of grid exchanges. Each net producer must then exchange electricity with other loop members when the loop is globally in need of electricity. Similarly, net consumers must favour electricity produced inside the loop instead of electricity from the grid. In Model (1), these constraints are expressed through Equations (1e) to (1i) and equivalence (1m).

**Limiting energy circulation through actors.** The total amount of energy distributed by an actor (collective self-consumption + energy sold to the grid) should not exceed the amount of produced energy. In Model (1), this constraint is expressed with equation (1j). Similarly to distributed energy, the total energy amount that is consumed (collective self-consumption and energy bought to the network) by an actor should not exceed the actor's consumption, which is expressed as follows:

$$ \sum_{k \in [n], k \neq i} e_{ki} + f_i \leq C_i, \forall i \in \{1, \dots, n\}. \qquad (2) $$
However, only one of the two sets of constraints is necessary for the complete problem as Kirchhoff constraints enforce the second one. To avoid duplicating constraints, Constraint (2) is thus removed from the final model.

*Actor exclusion constraints.* When actor *i* is excluded from the self-consumption loop, we have $x_i = 0$. As a consequence of its exclusion, an actor cannot exchange electricity with other actors. It means that $e_{ij}$ variables are subject to the value of $x_i$ and $x_j$ for each pair of actors, as depicted by Constraints (1b) and (1c) of Model (1).

### 3.2.2. Maximal total installed power of a self-consumption loop

To ensure that the loop respects the legal installed power restriction presented previously, Constraint (11) is set to prevent the global installed power from exceeding the legal criteria.

### 3.2.3. Neighbourhood graph and distance restriction

Legal distance constraints define a maximum geographical distance between two actors for them to be included in the same loop. These constraints can be represented in an undirected graph with all *n* actors as nodes, and edges between them only if they are closer to each other than the legal distance. A loop respecting the constraints will therefore correspond to a clique in that graph. These graphs correspond to intersection graphs of disks of identical diameters (equal to the maximum legal distance) in the plane and have been extensively studied. One noteworthy result is that maximal cliques in such graphs can be generated in polynomial time (Clark et al., 1990). Additionally, edges can be removed in preprocessing between two actors if the sum of the installed power production exceeds the allowed threshold (see Section 3.2.2).

We will denote by $\mathcal{E}$ the set of edges in the graph, and $\mathcal{N}_i$ the neighbours of node *i*. To cope with the legal restrictions concerning the geographical distance between each pair of actors participating in a self-consumption loop ($D_{ij} < D_{leg}$) equation (1k) refers to $\mathcal{E}$ to avoid non-neighbours to be part of the same collective self-consumption loop and define associated constraints.

### 3.2.4. Uncertainty in the production and consumption profiles

Renewable energy production and consumption are by nature uncertain and potentially highly correlated across actors and time steps. Furthermore, the contracts of certain actors with the grid may involve variations in the buying or selling prices, denoted as $F_i$ and $R_i$ respectively. These variations could be implemented through schemes such as time-of-use pricing or could involve uncertainties in prices, such as when actors participate in price-based demand response programs like peak shaving (Paterakis et al., 2017; Albadi and El-Saadany, 2008). We therefore consider ($R_i^t, F_i^t, C_i^t, P_i^t$) to be non-independent random vectors observed through a finite set of scenarios $\mathcal{S}$ with given associated probabilities $p_s$.

We model the problem as a two-stage stochastic program, with the loop membership decisions *x* taken at the first stage, and the flow variables at the second stage. A scenario *s* corresponds to a realisation of the uncertain parameters for all time steps, after which the loop operator can decide on the continuous flow variables *e*, *f*, *r* in an operational stage.
Importantly, the decisions taken at all time steps do not influence the state of the system, nor the decisions for the following time steps. This allows us to consider only these two design and operation stages, with the operation stage encompassing all time steps at once.

### 3.2.5. Objective function

In this optimisation problem, the objective is to find the best self-consumption loop from an economic point of view, that is to say, favouring exchanges between the grid and actors who have the most interesting prices (high selling prices, low buying prices)<fnref n="1" />:

$$f_{\text{obj}} = \sum_{i \in [n]} (F_i f_i - R_i r_i).$$

Fixed inclusion costs ($T_i$ adhesion costs of each actor $i$), as well as the price of the electricity within the loop ($r$), are not considered in the objective function, as they will be determined once the geometry of the loop and exchange happening inside the loop are set. Fixing $T$ after this first optimisation step to reach equity between actors involved in the self-consumption loop is evoked as a perspective of this work (Section 6). Despite balancing the benefits of the actors is left for future work, the proposed model assures a maximal global benefit and a non-zero benefit for each actor involved in the self-consumption loop.

### 3.3. Benders decomposition for larger time scales (SLExt)

We can notice that the model is structured in two parts, a choice of selected actors that form a feasible loop, and auxiliary binary variables on one hand, and a set of continuous flow decisions for each scenario and time step, which has a block-separable structure along these two dimensions.

We can use a Benders decomposition of the problem, expressing the flow optimality conditions as constraints on the $x$, $w$, and $z$ variables. Benders decomposition exploits the separation of variables between the binding variables which design the network and the continuous variables that are fully block-separable (see Rahmaniani et al. (2017) for a recent literature review of the Benders decomposition, applications and algorithms). We can note $\phi_{st} : \{0,1\}^n \times \{0,1\} \to \mathbb{R}$ the optimal value function of the problem given fixed values of $x$ and $z^{st}$. Model (1) is equivalent to:

$$\min_{x,z,\eta} \sum_{s \in S} \sum_{t \in T} p_s \eta_{st} \qquad (3a)$$

$$\text{s.t.} \quad \eta_{st} \ge \phi_{st}(x, z^{st}) \qquad \forall s \in S, t \in T \qquad (3b)$$

$$(1k) - (1n). \qquad (3c)$$

At an optimal solution, the variable $\eta_{st}$ will match the value of $\phi_{st}(x, z)$. The value of $\phi$ corresponds to the optimisation problem once the binary variables are fixed. This problem

<footnote n="1">¹The objective function takes all actors into account, without considering whether they belong to the self-consumption loop. This is used to include the trivial case where no actor belongs to the self-consumption loop, which would result in an objective value computed on loop members only to be equal to zero.</footnote>
is entirely decomposed along $(s, t)$, we, therefore, omit the two indices for clarity. The dual variable associated with each constraint is labelled on the right:

$$ \phi(x, z) = \min_{e,f,r,y} \sum_{i} F_{i}f_{i} - R_{i}r_{i} \qquad (4a) $$

$$ \text{s.t. } e_{ij} \le x_i P_i \qquad (\alpha_{ij}^p) \qquad (4b) $$

$$ e_{ij} \le x_j C_j \qquad (\alpha_{ij}^c) \qquad (4c) $$

$$ \sum_{j} e_{ij} + r_{i} - \sum_{j} e_{ji} - f_{i} = P_{i} - C_{i} \qquad (\pi_{i}) \qquad (4d) $$

$$ y_i \le x_i Q \qquad (\gamma_i) \qquad (4e) $$

$$ y_i - r_i \le 0 \qquad (\theta_i) \qquad (4f) $$

$$ y_i - r_i \ge -(1 - x_i)Q \qquad (\kappa_i) \qquad (4g) $$

$$ \sum_{i} y_i \le \sum_{i} x_i(P_i - C_i) + M(1 - z) \qquad (\nu) \qquad (4h) $$

$$ y_i \le Mz \qquad (\lambda_i) \qquad (4i) $$

$$ \sum_{j} e_{ij} + r_{i} \le B_{i} \qquad (\tau_{i}) \qquad (4j) $$

$$ e, f, r, y \ge 0. \qquad (4k) $$

The dual of Model (4) is:

$$ \begin{aligned} \max_{\alpha, \pi, \gamma, \theta, \kappa, \nu, \lambda, \tau} & \sum_{i,j \in \mathcal{E}} (\alpha_{ij}^p x_i P_i + \alpha_{ij}^c x_j C_j) + \\ & \sum_i \left( -(1-x_i)M\kappa_i + (P_i - C_i)\pi_i + Mz\lambda_i + B_i\tau_i + \right. \\ & \qquad \left. \gamma_i x_i Q \right) + \\ & \nu \left( \sum_i x_i (P_i - C_i) + (1-z)M \right) \end{aligned} \qquad (5a) $$

$$ \text{s.t.} \quad -\alpha_{ij}^p - \alpha_{ij}^c + \pi_j - \pi_i - \tau_i \ge 0 \qquad (e_{ij}) \qquad (5b) $$

$$ \kappa_i + \gamma_i + \gamma_i + \theta_i + \lambda_i + \nu \le 0 \qquad (y_i) \qquad (5c) $$

$$ -\kappa_i + \pi_i - \theta_i + \tau_i \le R_i \qquad (r_i) \qquad (5d) $$

$$ -\pi_i \le F_i \qquad (f_i) \qquad (5e) $$

$$ \alpha^p, \alpha^c, \gamma, \theta, \nu, \lambda, \tau \le 0, \kappa \ge 0. \qquad (5f) $$

Our problem is always bounded, given that the energy traded with the grid is bounded by the productions, and is always feasible, given that there always exists a baseline solution in which all actors trade with the grid only. This implies that $\phi_{st}(x, z)$ is finite for all $x$ and $z$ and that the primal and dual problems attain the same optimal value by the strong duality of linear problems.

The feasible region of Model (5) being independent of $x$ and $z$, we can replace Con-
straint (3b) with:

$$ \eta_{st} \geq \sum_{i,j \in \mathcal{E}} (\alpha_{ij}^p x_i P_i + \alpha_{ij}^c x_j C_j) + \sum_i - (1 - x_i) M \kappa_i + (P_i - C_i) \pi_i + M z \lambda_i + B_i \tau_i + \gamma_i x_i Q + \nu \left( \sum_i x_i (P_i - C_i) + (1 - z) M \right) \quad \forall (\alpha^p, \alpha^c, \pi, \gamma, \theta, \kappa, \nu, \lambda, \tau) \in \mathcal{V} \quad (B-CUT) $$

where $\mathcal{V}$ is the set of vertices of the dual feasible set (5b)-(5f). The cardinality of $\mathcal{V}$ grows exponentially with $n$, prohibiting the addition of all inequalities in (B-CUT), and motivating their generation on the fly to separate candidate solutions.

### 3.4. Introduction of multiple loops (MLCpct)

In this section, we extend the proposed model from a single loop in which actors can be included or not to multiple loops defined on the fly. This extension will be crucial to scale the proposed model in space, i.e. allowing the loop operator to build and operate multiple loops defined dynamically across a broad area and considering many actors simultaneously.

We define a compact representation of the model and propose an extended formulation based on a Dantzig-Wolfe decomposition. We claim the extended formulation can be solved directly and not through a branch-and-price algorithm, with a number of variables remaining small enough as the number of actors increases, and support that claim with the characteristics of potentially optimal loops.

The number of non-trivial loops is bounded above by $n/2$, we will denote $l \in \mathcal{L}$ the loop indices. The loop membership variables become:

$$ x_i^l = \begin{cases} 1 & \text{if actor } i \text{ is assigned loop } l \\ 0 & \text{otherwise.} \end{cases} $$

Aside of $x_i^l$ variables, some of the constraints defined in Section 3.2 evolve as soon as multiple loops are considered. The exclusion constraints (Constraints (1b) and (1c)) should be rewritten as follows, to ensure that two actors not being members of the same loop cannot exchange electricity:

$$ e_{ij} \leq \sum_{l \in \mathcal{L}} w_{ij}^l D_{i,j}, \forall (i,j) \in \{1, \dots, n\}^2, i \neq j, \quad (6) $$

where $D_{i,j} = \min(P_i, C_j)$. To define this constraint (Constraint (7l) in Model (7)), we introduced $w_{ij}^l$ which are binary variables linearising $x_i^l x_j^l$, expressing the membership of both actors $i$ and $j$ to loop $k$ and constraining the flow through (6). These $w_{ij}^l$ variables are subject
to:

$$w_{ij}^{l} \leq x_{i}^{l}, \forall (i, j) \in \{1, \dots, n\}^{2}, i \neq j, l \in \mathcal{L} \quad (\text{Constraint (7m) in Model (7)})$$

$$w_{ij}^{l} \leq x_{j}^{l}, \forall (i, j) \in \{1, \dots, n\}^{2}, i \neq j, l \in \mathcal{L} \quad (\text{Constraint (7n) in Model (7)})$$

Legal restriction constraints (Constraints (7h) and (7i)), collective self-consumption constraints (Constraints (7c) to (7g) and (7p)) and circulation constraint (Constraint (7j)) remain unchanged, and are now indexed by the loop $l$. Additionally, big M constraints are redefined to allow the $y_i^l$ variables to take any value when actor $i$ is included in loop $l$. These changes result in Model (7) which presents symmetries similar to other clustering problems, any permutation of the loop assignments being equivalent. Constraint (7o) reduces the number of symmetric solutions by enforcing solutions with several actors decreasing with the loop index. Constraint (7k) is added to ensure that each actor cannot belong to two different loops.

$$\min_{x,z,w,e,r,f,z,y} \sum_{s \in \mathcal{S}} \sum_{t \in \mathcal{T}} \sum_{i \in [n]} p_s (F_i^{st} f_i^{st} - R_i^{st} r_i^{st}) \quad (7a)$$

$$\text{s.t.} \quad \sum_{j \in \mathcal{N}_i} e_{ij}^{st} + r_i^{st} + C_i^{st} = \sum_{j \in \mathcal{N}_i} e_{ji}^{st} + f_i^{st} + P_i^{st} \quad \forall i \in [n], s \in \mathcal{S}, t \in \mathcal{T} \quad (7b)$$

$$y_{li}^{st} \leq x_{i}^{l} Q^{st} \quad \forall i \in [n], s \in \mathcal{S}, t \in \mathcal{T}, l \in \mathcal{L} \quad (7c)$$

$$y_{li}^{st} \leq r_i^{st} \quad \forall i \in [n], s \in \mathcal{S}, t \in \mathcal{T}, l \in \mathcal{L} \quad (7d)$$

$$y_{li}^{st} \geq r_i^{st} - (1 - x_i^l) Q^{st} \quad \forall i \in [n], s \in \mathcal{S}, t \in \mathcal{T}, l \in \mathcal{L} \quad (7e)$$

$$\sum_{i \in [n]} y_{li}^{st} \leq \sum_{i \in [n]} x_{i}^{l} (P_{i}^{st} - C_{i}^{st}) + M^{st} (1 - z_{l}^{st}) \quad \forall s \in \mathcal{S}, t \in \mathcal{T}, l \in \mathcal{L} \quad (7f)$$

$$y_{li}^{st} \leq M^{st} z_{l}^{st} \quad \forall i \in [n], \forall s \in \mathcal{S}, t \in \mathcal{T}, l \in \mathcal{L} \quad (7g)$$

$$\sum_{i \in [n]} x_i^l P_i^{\text{inst}} \leq P_{\text{leg}}^{\text{inst}} \quad \forall l \in \mathcal{L} \quad (7h)$$

$$x_i^l + x_j^l \leq 1 \quad \forall (i, j) \notin \mathcal{E}, l \in \mathcal{L} \quad (7i)$$

$$\sum_{j \in \mathcal{N}_i} e_{ij}^{st} + r_i^{st} \leq B_i^{st} \quad \forall i \in [n], s \in \mathcal{S}, t \in \mathcal{T} \quad (7j)$$

$$\sum_{l \in \mathcal{L}} x_i^l \leq 1 \quad \forall i \in [n] \quad (7k)$$

$$e_{ij}^{st} \leq \sum_{l \in \mathcal{L}} w_{ij}^{l} D_{ij}^{st} \quad \forall (i, j) \in \mathcal{E}, s \in \mathcal{S}, t \in \mathcal{T} \quad (7l)$$

$$w_{ij}^{l} \leq x_{i}^{l} \quad \forall (i, j) \in \mathcal{E}, \forall l \in \mathcal{L} \quad (7m)$$

$$w_{ij}^{l} \leq x_{j}^{l} \quad \forall (i, j) \in \mathcal{E}, \forall l \in \mathcal{L} \quad (7n)$$

$$\sum_{i \in [n]} x_i^l \geq \sum_{i \in [n]} x_i^{l+1} \quad \forall l \in 1...|\mathcal{L}| - 1 \quad (7o)$$

$$z_l^{st} = 1 \Leftrightarrow \sum_{i \in [n]} x_i^l (P_i^{st} - C_i^{st}) \geq 0 \quad \forall l \in \mathcal{L}, s \in \mathcal{S}, t \in \mathcal{T} \quad (7p)$$

$$x \in \{0, 1\}^{n|\mathcal{L}|}, z \in \{0, 1\}^{|\mathcal{L} \times \mathcal{S} \times \mathcal{T}|}, w \in \{0, 1\}^{|\mathcal{E} \times \mathcal{L}|} \quad (7q)$$

$$e, r, f, y \geq 0. \quad (7r)$$
### 3.5. Dantzig-Wolfe decomposition (MLCol)

The previous formulation is amenable to a Dantzig-Wolfe decomposition exploiting the structure of solutions to the knapsack Constraint (7h) under a loop maximality assumption.

**Assumption 3.6 (Loop maximality).** An optimal solution exists such that all created loops are maximal, in the sense that for any actor i not included in any loop, it could not be added to any of them without removing another actor from the loop.

**Proposition 3.1.** Assumption 3.6 holds for Model (7).

*Proof.* Given a non-maximal solution, let us assume there exists an actor that could be included in a loop without removing another one. We can construct a solution in which this actor does not receive any net consumed power from the grid and sells any net produced power to the grid, thus not modifying the objective. □

**Proposition 3.1** holds because of the feasibility of a trivial solution where an actor could be included in a loop without contributing to internal flows. In practice, such an actor could be removed from the loop in a post-processing step without degrading the objective. This leads us to observe that an optimal solution can always be constructed by selecting a subset of maximal loops which do not overlap on any actor.

The number of potential loops could grow exponentially with the number of actors, and would therefore require a column generation approach to build new loops. We will rely on a spatial sparsity assumption, together with the optimality of maximal loops to motivate an extended formulation that eagerly generates all extended columns before branching.

Finding maximal loops corresponds to finding cliques in the graph of all actors with an edge between $i$ and $j$ if $d_{ij} \le d_{max}$. These cliques are not maximal since they also need to satisfy the installed capacity constraint.

Furthermore, each selected clique needs to contain at least one producer and one consumer to generate some inner flows, further reducing the number of potential clique candidates. Since there will typically be few producers compared to the number of consumers, we can construct cliques around each of the producers only. The procedure we propose is:

1. Generate all maximal cliques in the graph, starting to build them from net producers only,

2. If a clique respects the installed capacity, it can be used directly,

3. Otherwise, enumerate all maximal vertices of the 0-1 knapsack polytope selecting the producers of the clique, subject to the capacity constraint. Each vertex results in a combination of producers, and all consumers of the clique can be added to the loop.

We can adapt the clique generation algorithm to dynamically forbid adding nodes that would exceed the capacity, or generate all maximal loops from every clique by excluding actors until the capacity constraint is respected.
The extended model is described by a set $\mathcal{H}$ of maximal loops and binary variables $v_h$ capturing whether a loop is taken, with parameters $a_{hi}$:

$$a_{hi} = \begin{cases} 1 & \text{if loop } h \text{ contains actor } i \\ 0 & \text{otherwise.} \end{cases}$$

Furthermore, additional application-related constraints can directly be included in the loop, including, for instance, the fact that two coupled actors $(i, j) \in \mathcal{D}$ are both present or both absent from a loop:

$$a_i^h = a_j^h \quad \forall (i, j) \in \mathcal{D}, h \in \mathcal{H}.$$

The extended formulation of Model (7) is essentially captured by the new constraints:

$$\sum_{h \in \mathcal{H}} a_{hi} v_h \leq 1 \qquad \forall i \in [n] \qquad (8a)$$

$$e_{ij}^{st} \leq D_{ij}^{st} \sum_{h \in \mathcal{H}} v_h a_{hi} a_{hj} \qquad \forall (i, j) \in \mathcal{E}, s \in \mathcal{S}, t \in \mathcal{T} \qquad (8b)$$

$$e_{ij}^{st} \leq D_{ij}^{st} \sum_{h \in \mathcal{H}} v_h a_{hi} \qquad \forall (i, j) \in \mathcal{D}, s \in \mathcal{S}, t \in \mathcal{T}. \qquad (8c)$$

Constraint (8a) of the extended model corresponds to Constraint (7l) in the compact one. Constraint (8b) replaces the $w$ variables and associated auxiliary constraints of the compact model.

We define the index set $\mathcal{G}_h \subseteq \mathcal{S} \times \mathcal{T}$ as the set of tuples $(s, t)$ such that the loop $h$ is a net producer at scenario $s$ and time $t$. This fixed index set replaces the variable $z_l^{st}$ of the
compact model. $D_{ij}$ is defined as $\min(P_i, C_j)$, resulting in the following model:

$$ \min_{e,r,f,v} \sum_{s \in S} \sum_{t \in T} \sum_{i \in [n]} p_s (F_i^{st} f_i^{st} - R_i^{st} r_i^{st}) \quad (9a) $$

$$ \text{s.t.} \quad e_{ij}^{st} \le D_{ij}^{st} \sum_{h \in \mathcal{H}} v_h a_i^h a_j^h \quad \forall i, j \in \mathcal{E}, s \in S, t \in T \quad (9b) $$

$$ \sum_{j \in \mathcal{N}_i} e_{ij}^{st} + r_i^{st} + C_i^{st} = \sum_{j \in \mathcal{N}_i} e_{ji}^{st} + f_i^{st} + P_i^{st} \quad \forall i \in [n], s \in S, t \in T \quad (9c) $$

$$ r_i^{st} \le (1 - \sum_{h \notin \mathcal{G}_{st}} v_h a_i^h) Q^{st} \quad \forall i \in [n], s \in S, t \in T \quad (9d) $$

$$ \sum_{j \in \mathcal{N}_i} e_{ij} + r_i \le P_i \quad \forall i \in [n], s \in S, t \in T \quad (9e) $$

$$ \sum_{i \in [n]} r_i^{st} a_i^h \le \sum_{i \in [n]} a_i^h v_h (P_i^{st} - C_i^{st}) + Q^{st} (1 - v_h) \quad \forall s \in S, t \in T, h \in \mathcal{G}_{st} \quad (9f) $$

$$ \sum_{h \in \mathcal{H}} a_i^h v_h \le 1 \quad \forall i \in [n] \quad (9g) $$

$$ v \in \{0, 1\}^{|\mathcal{H}|} \quad (9h) $$

$$ e, r, f, y \ge 0. \quad (9i) $$

### 3.6. Benders decomposition of MLCol model (MLColExt)

Similarly to the decomposition operated on the single-loop model in Section 3.3, the extended version of the problem can be split into two subproblems, that can be efficiently solved using Benders' algorithm. As previously, the main problem solves the design aspect of the network, by setting the loops that should be selected for the collective self-consumption operation. One can keep the notation $\phi_{st} : \{0, 1\}^n \times \{0, 1\} \to \mathbb{R}$ the optimal value function of the problem given fixed values of $v, \eta_{st}$ to define this main model:

$$ \min_{v, \eta} \sum_{s \in S} \sum_{t \in T} p_s \eta_{st} \quad (10a) $$

$$ \text{s.t.} \quad \eta_{st} \ge \phi_{st}(v) \quad \forall s \in S, t \in T \quad (10b) $$

$$ \sum_{h \in \mathcal{H}} a_i^h v_h \le 1 \quad \forall i \in [n] \quad (10c) $$

$$ v \in \{0, 1\}^{|\mathcal{H}|}. \quad (10d) $$

The second problem, using solutions of the main problem as parameters, is then a continuous problem whose resolution should be possible in a reasonable amount of time as no binary variables are involved. We drop the indices $s$ and $t$ from the subproblem below, as it is fully separable along $S$ and $T$. The dual variable associated with each constraint is labelled on the right.
$$ \min_{e,r,f} \sum_{i \in [n]} (F_i f_i - R_i r_i) \qquad (11a) $$

$$ \text{s.t.} \quad e_{ij} \le D_{ij} \sum_{h \in \mathcal{H}} v_h a_i^h a_j^h \qquad \forall i \in [n] \quad (\alpha_{ij}) \qquad (11b) $$

$$ \sum_{j \in \mathcal{N}_i} e_{ij} + r_i - f_i - \sum_{j \in \mathcal{N}_i} e_{ji} = P_i - C_i \qquad \forall i \in [n] \quad (\pi_i) \qquad (11c) $$

$$ r_i \le (1 - \sum_{h \notin \mathcal{G}} v_h a_i^h) Q \qquad \forall i \in [n] \quad (\gamma_i) \qquad (11d) $$

$$ \sum_{i \in [n]} r_i a_i^h \le \sum_{i \in [n]} a_i^h v_h (P_i - C_i) + Q(1 - v_h) \qquad \forall i \in [n], h \in \mathcal{G} \quad (\nu_h) \qquad (11e) $$

$$ \sum_{j \in \mathcal{N}_i} e_{ij} + r_i \le P_i \qquad \forall i \in [n] \quad (\tau_i) \qquad (11f) $$

$$ e, r, f \ge 0. \qquad (11g) $$

### 3.6.1. Dual and cuts

Dualisation of Problem (11) gives the following model, whose objective value provides cuts that can be applied to the main model to refine the chosen design of collective self-consumption loops:

$$ \begin{aligned} \max_{\alpha, \pi, \gamma, \kappa, \nu, \tau} & \sum_{i,j \in \mathcal{E}} \alpha_{ij} D_{ij} \sum_{h \in \mathcal{H}} v_h a_i^h a_j^h + \\ & + \sum_{i \in [n]} \left( (P_i - C_i)\pi_i + P_i\tau_i + \gamma_i \left(1 - \sum_{h \notin \mathcal{G}} a_i^h v_h\right)Q \right) \\ & + \sum_{h \in \mathcal{G}} \nu_h \left( \sum_{i \in [n]} \left(a_i^h v_h (P_i - C_i)\right) + Q(1 - v_h) \right) \end{aligned} $$

$$ \text{s.t.} \quad \alpha_{ij} + \pi_i + \tau_i \le 0 \qquad (e_{ij}) $$

$$ \pi_i + \gamma_i + \tau_i + \sum_{h \in \mathcal{G}} a_i^h \nu_h \le -R_i \qquad (r_i) $$

$$ -\pi_i \le F_i \qquad (f_i) $$

$$ \alpha, \gamma, \nu, \tau \le 0, \kappa \ge 0. $$

These dual-induced cuts can be expressed as follows:

$$ \begin{aligned} \eta_{st} \ge & \sum_{i,j \in \mathcal{E}} \alpha_{ij} D_{ij} \sum_{h \in \mathcal{H}} v_h a_i^h a_j^h + \\ & + \sum_{i \in [n]} \left( (P_i - C_i)\pi_i + P_i\tau_i + \gamma_i \left(1 - \sum_{h \notin \mathcal{G}} a_i^h v_h\right)Q \right) \\ & + \sum_{h \in \mathcal{G}} \nu_h \left( \sum_{i \in [n]} \left(a_i^h v_h (P_i - C_i)\right) + Q(1 - v_h) \right) \quad \forall (\alpha, \pi, \gamma, \kappa, \nu, \tau) \in \mathcal{V}_{st}. \end{aligned} \qquad (\text{EXT-B-CUT}) $$
# 4. Application of the models

This section details the data and assumptions used to set up realistic instances and their corresponding consumption and production profiles. The method to generate these instances is designed to mimic real-case scenarios. These instances are then reused in a test protocol on operational-specific metrics, which is described in Section 4.2.

## 4.1. Generation of realistic instances

To apply the proposed model to realistic instances, localization, costs, production, and consumption data have been generated. Each actor is then represented as a prosumer, capable of both producing and consuming electricity.

### 4.1.1. Consumption load

Consumption profiles are estimated from reference datasets extracted from the Enedis<fnref n="2" /> Open Data platform (ENEDIS, 2023). Consumption loads are described with a 30-minute time step over a year (2022 is taken as the reference).

To generate a group of consumers, we divided this group into two consumption sub-groups, namely "Household" and "Pro: Professional." These categories echo the separation made by the Enedis Open Data platform, which provides an average profile of each category. The distribution of consumers in each category is manually determined based on the scenario chosen for simulation (see Section 4.2). All consumers in each category are then provided with a consumption profile that is normally distributed around the Enedis reference profile load corresponding to that category. To do so, a rolling window mean using a 3 steps window size is applied. Some variations are added to this averaged consumption using a uniform random variable and a variation factor of 30%.

### 4.1.2. Installations characteristics and production volume computing

Determining the actual production of an installation is complex as it depends on several parameters, some of which are meteorological. To calculate discretised production, irradiance data is computed based on solar position, installed power of the installation, inclination, and orientation.

Two exposition configurations are considered:

* Worst exposition (WC): Tilt angle fixed to 60° and panels facing North (0° azimuth)

* Best exposition (BC): Tilt angle fixed to 30° and panels facing South (180° azimuth)

To avoid longer computation runtimes, solar position information is computed on 10 km<fnref n="2" /> surface tiles and reused identically for each installation associated with this tile. This assumes that solar position variation along such a surface has a low impact on the installation production. Based on the installed power assigned to each producer, the production is generated for each time step using PVGIS-computed irradiance data.

<footnote n="2">²Enedis is a state-owned limited company managing and developing the electricity distribution network in France.</footnote>
### 4.1.3. Electricity pricing

The objective function defined in every proposed problem is subject to electricity pricing conditions. Table 3 and Table 4 report official buying costs (MTE, 2023) and French Energy Regulatory Commission selling prices (CRE, 2024) of the electricity for actors engaged in a self-consumption operation.

<table><caption>Table 3: Electricity selling prices considering self-consumption installed power (CRE, 2024)</caption><thead><tr><th>Installed power (kWc)</th><th>≤ 3kWc</th><th>≤ 3-9kWc</th><th>9-36kWc</th><th>≥ 36kWc</th><th>≥ 100kWc</th></tr></thead><tbody><tr><th>Selling price (c€/kWh)</th><td>13.39</td><td>13.39</td><td>14.58</td><td>12.68</td><td>13.12</td></tr></tbody></table>

<table><caption>Table 4: Electricity buying cost considering the client consumption subscription profile (MTE, 2023)</caption><thead><tr><th rowspan="2">Category</th><th colspan="2">≤ 36 kVA</th><th colspan="2">≥ 36kVA</th></tr><tr><th>Household</th><th>Pro</th><th>Pro</th><th>Pro</th></tr></thead><tbody><tr><th>Period</th><td>All year</td><td></td><td>Winter</td><td>Summer</td></tr><tr><th>Peak hours cost (c€/kWh)</th><td>20.4</td><td>19.84</td><td>27.26</td><td>13.63</td></tr><tr><th>Off-peak hours cost (c€/kWh)</th><td>15.13</td><td>16.07</td><td>15.16</td><td>7.58</td></tr></tbody></table>

### 4.1.4. Geographical distribution

One of the characteristics of the proposed model is its geographical dimension. To construct representative use cases, two types of geographical distributions have been defined:

* **Uniform distribution:** In this distribution, each installation is located uniformly, maintaining a global density of actors. This random distribution is achieved by utilizing a combination of uniform distributions along latitudes and longitudes.

* **Clustered distribution:** This distribution is used to allocate groups of installations, imitating how industrial installations are distributed in semi-rural territories. In our case, clusters are formed having between 4 and 6 actors each.

In the following generated instances, these distributions are consistently utilized to sample a group of actors with a global density parameter. Multiple distinct densities are employed to assess the impact of this parameter on discovered solutions.

## 4.2. Test protocol

The following test protocol has been established to validate the growing complexity of the defined optimisation problem. Two parameters are initially observed, namely, time horizon and the number of actors as they influence the initial number of variables defined in the problem. Other parameters of the initial configuration (named reference) are detailed in Table 5, which also describes other instances that are used to compare optimisation results for different configurations.

Based on Enedis consumption profiles, three prosumer profiles are defined, namely Household, Pro1 and Pro2 whose characteristics are described in Table 6. From these profiles,
<table><caption>Table 5: List of instances and their characteristics</caption><thead><tr><th>Scenario</th><th>Orientation</th><th>Tilt</th><th>Density</th><th>Installed power limit</th></tr></thead><tbody><tr><td>reference</td><td>180 (South)</td><td>30°</td><td>0.5 pros/km2</td><td>3 MWc</td></tr><tr><td>dens_0_1</td><td>180 (South)</td><td>30°</td><td>0.1 pros/km2</td><td>3 MWc</td></tr><tr><td>dens_2</td><td>180 (South)</td><td>30°</td><td>2 pros/km2</td><td>3 MWc</td></tr><tr><td>period_sum</td><td>180 (South)</td><td>30°</td><td>0.5 pros/km2</td><td>3 MWc</td></tr><tr><td>power_1000</td><td>180 (South)</td><td>30°</td><td>0.5 pros/km2</td><td>1 MWc</td></tr><tr><td>power_2000</td><td>180 (South)</td><td>30°</td><td>0.5 pros/km2</td><td>2 MWc</td></tr><tr><td>power_5000</td><td>180 (South)</td><td>30°</td><td>0.5 pros/km2</td><td>5 MWc</td></tr><tr><td>configWC</td><td>0 (North)</td><td>60°</td><td>0.5 pros/km2</td><td>3 MWc</td></tr></tbody></table>

a scenario has been defined, representing a distribution of the consumption profiles among generated actors (rate column). The objective of the defined scenario is to represent both the small producers that can be either dwellings (Household profile) or professional actors (Pro1 profile) and larger producers that are essentially professional actors (Pro2 profiles).

<table><caption>Table 6: Description of the prosumer profiles used in the base configuration</caption><thead><tr><th>Profile</th><th>Reference consumption profile</th><th>Installed power range</th><th>Rate</th></tr></thead><tbody><tr><td>Household</td><td>Household (P ≤ 36kVA)</td><td>0kW ≤ P ≤ 6kW</td><td>40%</td></tr><tr><td>Pro1</td><td>Pro (P ≤ 36kVA)</td><td>6kW ≤ P ≤ 12kW</td><td>40%</td></tr><tr><td>Pro2</td><td>Pro (P ≤ 36kVA)</td><td>1MW ≤ P ≤ 3MW</td><td>20%</td></tr></tbody></table>

Instances involving 10 actors and having the same configuration as the reference instance presented in 5 are also solved for different time horizons to evaluate how the models behave in solving larger problems. With the same objective, instances having several number of prosumers and a time horizon of 7 days are solved.

Table 7 indicates the different sizes - in terms of number of variables and constraints for all instances averaged on 100 replicates for each of them. All Gurobi generated instances are available as .lp files at Chasseray et al. (2025).

### 4.3. Evaluation metrics

Each model presented in Section 3 is applied to generated instances. Aside from objective value and solving time, results are analysed through several evaluation metrics defined below. These KPI are only used for a post optimisation analysis of the loops, as benefit balance within the loops is discussed but left for future work.

#### 4.3.1. Collective self-consumption and self-production rates

Self-consumption rate is defined as the ratio between the energy that is consumed within the collective self-consumption loop and the total amount of produced electricity within the loop. Self-production rate is defined as the ratio between the energy that is consumed within the collective self-consumption loop and the total amount of consumed electricity within the loop.
<table><caption>Table 7: Instances sizes (average computed on 100 replicates for each configuration and model)</caption><thead><tr><th rowspan="2">Configuration</th><th colspan="3">Constraints (×10<sup>3</sup>)</th><th colspan="3">Variables (×10<sup>3</sup>)</th><th colspan="3">Integer variables</th></tr><tr><th>MLCol</th><th>MLCpct</th><th>SLCpct</th><th>MLCol</th><th>MLCpct</th><th>SLCpct</th><th>MLCol</th><th>MLCpct</th><th>SLCpct</th></tr></thead><tbody><tr><td>reference</td><td>332</td><td>470</td><td>243</td><td>111</td><td>201</td><td>121</td><td>1198</td><td>6714</td><td>735</td></tr><tr><td>dens_0.1</td><td>154</td><td>445</td><td>184</td><td>80</td><td>173</td><td>92</td><td>375</td><td>6529</td><td>735</td></tr><tr><td>dens_2</td><td>574</td><td>521</td><td>335</td><td>156</td><td>249</td><td>167</td><td>2168</td><td>7367</td><td>735</td></tr><tr><td>period_sum</td><td>441</td><td>475</td><td>243</td><td>111</td><td>203</td><td>121</td><td>1198</td><td>6856</td><td>735</td></tr><tr><td>power_1000</td><td>127</td><td>475</td><td>243</td><td>110</td><td>203</td><td>121</td><td>831</td><td>6856</td><td>735</td></tr><tr><td>power_5000</td><td>431</td><td>475</td><td>243</td><td>111</td><td>203</td><td>121</td><td>1541</td><td>6856</td><td>735</td></tr><tr><td>configWC</td><td>226</td><td>475</td><td>243</td><td>110</td><td>203</td><td>121</td><td>1962</td><td>6856</td><td>735</td></tr><tr><td>10_act_1.d</td><td>5</td><td>8</td><td>5</td><td>2</td><td>4</td><td>2</td><td>386</td><td>500</td><td>34</td></tr><tr><td>10_act_10.d</td><td>45</td><td>73</td><td>47</td><td>21</td><td>34</td><td>23</td><td>386</td><td>1580</td><td>250</td></tr><tr><td>10_act_14.d</td><td>63</td><td>102</td><td>66</td><td>29</td><td>48</td><td>33</td><td>386</td><td>2060</td><td>346</td></tr><tr><td>10_act_30.d</td><td>138</td><td>218</td><td>140</td><td>62</td><td>102</td><td>70</td><td>386</td><td>3980</td><td>730</td></tr><tr><td>10_act_60.d</td><td>284</td><td>434</td><td>281</td><td>124</td><td>204</td><td>140</td><td>386</td><td>7580</td><td>1450</td></tr><tr><td>10_act_90.d</td><td>442</td><td>651</td><td>421</td><td>186</td><td>305</td><td>210</td><td>386</td><td>11180</td><td>2170</td></tr><tr><td>10_act_180.d</td><td>-</td><td>1301</td><td>843</td><td>-</td><td>610</td><td>419</td><td>-</td><td>21980</td><td>4330</td></tr><tr><td>10_act_270.d</td><td>-</td><td>1952</td><td>1264</td><td>-</td><td>914</td><td>629</td><td>-</td><td>32780</td><td>6490</td></tr><tr><td>10_act_360.d</td><td>-</td><td>2602</td><td>1686</td><td>-</td><td>1219</td><td>839</td><td>-</td><td>43580</td><td>8650</td></tr><tr><td>10_act_7.d</td><td>31</td><td>51</td><td>33</td><td>15</td><td>24</td><td>16</td><td>386</td><td>1220</td><td>178</td></tr><tr><td>15_act_7.d</td><td>38</td><td>106</td><td>44</td><td>20</td><td>41</td><td>22</td><td>421</td><td>2137</td><td>183</td></tr><tr><td>20_act_7.d</td><td>39</td><td>166</td><td>54</td><td>24</td><td>60</td><td>27</td><td>339</td><td>2860</td><td>188</td></tr><tr><td>30_act_7.d</td><td>56</td><td>354</td><td>80</td><td>35</td><td>115</td><td>40</td><td>462</td><td>5165</td><td>198</td></tr></tbody></table>

### 4.3.2. Number of proposed loops

The number of proposed loops indicates the number of collective self-consumption loops that have been formed and is computed using the decision variables' obtained values:

$$N_l = \sum_{h \in \mathcal{H}} v_h \qquad \text{for extended models} \qquad (12a)$$

$$N_l = \sum_{l \in \mathcal{L}} \delta_l \qquad \text{for compact models,} \qquad (12b)$$

where $\delta_l$ is defined as follows:

$$\delta_l = \begin{cases} 1 & \text{if } \sum_{i \in [n]} x_i^l > 0 \text{ (at least one prosumer selected in the loop)} \\ 0 & \text{otherwise.} \end{cases}$$

For clarity in the definition of later indicators, we only consider the case of the extended multiloop (MLColExt) model only. Nevertheless, the same indicators can also be built for compact multiloop models, indexing $x_i^l$ with $l \in \mathcal{L}$ and $i \in [n]$ instead of $v_h a_i^h$ ($h \in \mathcal{H}$).

### 4.3.3. Fairness indicators

Two indicators representing the disparity of the benefit distribution are defined. The highest benefit indicator (13a) underlines the highest benefit realised among all actors reaching a collective self-consumption community. This benefit is computed relative to a situation where no loop has been defined (zero loop configuration). Conversely, the lowest benefit indicator (13b) underlines the lowest benefit realised among all actors proposed to reach a collective self-consumption loop.
$$ \text{Highest benefit:} \qquad \bar{b} = \max_{i \in [n]} \left( \sum_{s \in S} \sum_{t \in T} p_s (F_i^{st}(f_i^{st} - C_i^{st}) - R_i^{st}(r_i^{st} - P_i^{st})) \right) \qquad (13a) $$

$$ \text{Lowest benefit:} \qquad \underline{b} = \min_{i \in [n]} \left( \sum_{s \in S} \sum_{t \in T} p_s (F_i^{st}(f_i^{st} - C_i^{st}) - R_i^{st}(r_i^{st} - P_i^{st})) \right). \qquad (13b) $$

### 4.3.4. Average number of members and installed power per loop

The average number of loops

$$ N_{\text{mean}} = \frac{1}{N_l} \sum_{h \in \mathcal{H}} \sum_{i \in [n]} v_h a_i^h $$

can be put into perspective with the number of actors that are not participating in any loop, indicating how created loops include actors. Another indicator is the average installed power per loop, which underlines how complete loops are in terms of installed power:

$$ P_{\text{mean}} = \frac{1}{N_l} \sum_{h \in \mathcal{H}} \sum_{i \in [n]} v_h a_i^h P_i^{\text{inst}}. $$

This indicator should always be analysed in relation to the legal installed power limit set initially to solve the problem.

### 4.3.5. Total benefit realised through self-consumption

This indicator is obtained from realised benefits by each prosumer who is involved in a self-consumption loop relative to a zero loop configuration:

$$ \sum_{h \in \mathcal{H}} \sum_{i \in [n]} \sum_{s \in S} \sum_{t \in T} p_s v_h a_i^h (F_i^{st}(f_i^{st} - C_i^{st}) - R_i^{st}(r_i^{st} - P_i^{st})). \qquad (14) $$

## 5. Results and discussion

### 5.1. Scalability on the temporal and geographical dimensions

<figure><img src="image_4.png" /><figcaption>Figure 3: Evolution of resolution running time of compact and decomposed models</figcaption></figure>
As explained in the model presentation, extending the time horizon significantly increases the complexity of the problem, since each time step can influence whether or not an actor should be included in a collective self-consumption operation. Whether an actor belongs to or is excluded from a self-consumption operation is determined for the entire optimisation time horizon and cannot be changed from one time step to another. The existence of associated integer variables links each time step in the optimisation problem, and in the case of the compact formulation, requires all time steps to be solved within the same problem. The Benders extended reformulation allows for the extraction of integer variables and fixing them in the master problem, thereby enabling each time step of the sub-problem to be easily solvable independently. The increase in complexity over time horizon is the reason why a Benders decomposition of the model has been proposed. Figure 3a illustrates the evolution of the resolution time of the single-loop models for different time horizons, comparing the compact formulation with the extended formulation.

To assess variability, each scenario is represented with a set of 100 generated instances. This sampling covers variability in geographic distribution, prosumers' installed power, and consumption profiles. The compared computing time only considers the solving computing time and does not account for the time allocated to defining the problems (compact model, master problem, and sub-problems) or the time allocated to adding Benders cuts between the resolution of the master problem and sub-problems. When focusing on the standard deviation of each scenario, we observe significant variations in resolution time depending on consumption/production data and geographical distribution. However, for equivalent resolution time, the variability is fairly similar for extended and compact formulations.

It can be observed that a short time horizon is effectively handled by both compact and extended formulations. In many cases, the compact formulation performs even better than the extended formulation, as the single problem remains simple enough to be solved in less time than two separate problems. However, for larger time scales, the decomposed versions demonstrate better resolution times. This difference becomes more pronounced with larger time horizons, highlighting the benefits of using decomposed models. Figure 3a illustrates resolution times on relatively small instances (10 actors). Tests have also been conducted on larger instances, showing a similar increase in resolution time for the compact model, while the extended model maintains reasonable resolution times. These observations highlight the advantages of using a decomposed formulation for larger time horizons.

The number of actors is a parameter that should influence the design aspect of the problem. The proposed clique generation algorithm has been applied to several instances with different numbers of prosumers. To keep the number of generated cliques reasonable, the selected instances feature only clustered spatial distributions of actors. This clustered distribution is generated by randomly sampling *p* clusters across a square area, ensuring that the overall actor density is maintained. Clusters are generated to contain between 4 to 6 actors each, and the number of clusters is determined accordingly.

Figure 3b compares the computing time of the compact multi-loop model (MLCpct) with the reformulation that integrates clique generation (MLCol). Similar to the evaluation of
scalability in the temporal dimension, the computing time associated with the problem creation and addition of cuts are not considered in the comparison. The observations made previously regarding the time horizon dimension can equivalently be applied here for the number of actors. For a low number of actors, compact and reformulated models show similar performances. However, as the number of actors increases, the model involving prior clique generation outperforms the compact model. Tests conducted on larger instances (more than 30 actors) demonstrated that the compact formulation is unable to find an optimal solution in less than an hour, whereas clique generation drastically reduces the complexity of the problem and solving time.

Note that the method we propose through clique generation works well on realistic instances, specifically because their corresponding neighbourhood graph follows the sparsity assumption. We stress-tested the proposed formulation on complete graphs, observing a steep increase in memory requirements making the models intractable.

## 5.2. Root-node relaxation tightness

<figure><img src="image_5.png" /><figcaption>Figure 4: Root gap distribution by solving method across configurations (some outliers have been removed from the plots for clarity purpose)</figcaption></figure>

We analyse in this section the quality of the formulation through the root-node gap which provides a measure of how tight the different relaxations are. Figure 4 illustrates how the root-node gap evolves with respect to the time horizon and the number of considered prosumers for the different problem formulations. Focusing first on single-loop models, Figure 4b shows that increasing the number of prosumers results in smaller relative gaps, thus with linear relaxations that are tighter around integer solutions. Interestingly, as illustrated in Figure 4a, the root-node gap is maximal for ten prosumers between 14 and 30 days of horizing, with
shorter and longer horizons both resulting in smaller gaps and tight formulations, which leads
us to conjecture that longer planning horizons increases the contrast in the economic interest
to select actors, reducing the root-node fractionality.

Having a lower relative root gap however, does not imply that the problem can be solved in
a shorter time, as shows Figure 3a for the single loop formulation. Nevertheless, it indicates
that the resolution should be easier relatively to the size of the mixed-integer formulation
(number of variables and constraints).

This tendency does not hold for multiple-loop compact formulations. In these cases, the
root gap tends to increase with longer time horizons (greater than 30 days). The same
effect is particularly true when increasing the number of prosumers, especially from 20 to 30
prosumers, where a significant root gap difference is observed.

What remains noteworthy, though, is that the reformulated problem using clique enumer-
ation exhibits the opposite behavior. Similar to single-loop models, it exhibits a peak root
gap around 14 days of time horizon and decreases for larger time horizons.

Figure 4c and Figure 4d highlight the benefits of the clique generation formulation. This approach results in lower root gaps than the compact model once the number of prosumers becomes large (i.e., greater than 20). Furthermore, unlike the compact formulation, clique generation not only produces smaller root gaps but also tends to further reduce them as either the time horizon or the number of prosumers increases, hinting that our approaches will produce high-quality solutions and guarantees even without running a full branch-and-cut algorithm.

5.3. Solution sensitivity analysis

In addition to runtime performance, another important focus is on the solutions derived
from the multi-loop model from the application perspective. This entails evaluating the solu-
tions in terms of their cost effectiveness and assessing the influence of operational parameters
on proposed solutions.

5.3.1. Influence of the legal maximum installed power

One criterion that constrains the formation of collective self-consumption loops is the legal
maximum authorised installed power per loop. Sensitivity to this parameter can be important
to the operator defining the loops, since this legal requirement may change with legislation.

Figure 5a and 5c respectively illustrate the impact of this parameter on the average size of
the corresponding loops (in terms of installed power) and the benefit of the formed collective
self-consumption loops.

Unsurprisingly, the average installed power of created loops grows with the value of Pleg,
allowing the loops to reach larger installed power, which results in the model attempting to
maximise the size of the loops. However, Figure 5b shows that the number of actors per loop
is not significantly affected by the different Pleg configurations. This can be explained by the
fact that accepting a new large producer in the loop may result in the removal of another
actor, based on distance criteria for example.
<figure><img src="image_6.png" /><figcaption>Figure 5: Influence of the legal power on operational indicators</figcaption></figure>

Instances having an average installed power per loop that remains low even though not restricted by $P_{\text{leg}}$ can be explained by cases where all the large producer groups are concentrated in a single cluster. This results in a loop with one or two big producers, while other loops only contain actors with low installed power. This clustering effect can lead to instances where the distribution of actors across loops is uneven, causing some loops to have significantly higher installed power than others. One also observes the creation of loops with very small installed power when $P_{\text{leg}}$ is set to 1 MWc. This is primarily caused by the gap in installed power between 9 kWc and 1 MWc in the instances used. In this configuration, no created loop can contain any of the professional producers, resulting in loops only containing small producers and consequently having low installed power.

These observations, made on relatively small instances (15 actors), demonstrate how an optimisation tool based on the proposed model can be used to evaluate the viability of different types of production plants. By examining the impact of parameters such as the legal maximum authorised installed power ($P_{\text{leg}}$), decision-makers can gain insights into the optimal configuration.

### 5.3.2. Influence of actor density

Increasing the actor density favours the formation of larger collective self-consumption communities. Figure 6a illustrates a slight increase in the installed power of loops as clusters are brought closer together. This reflects the fact that separated clusters have a greater chance of being at a reasonable distance in denser configurations. This observation is confirmed by analyzing the average number of actors per loop in Figure 6b. Since larger loops ensure a greater amount of locally produced electricity, the overall gain realised is also directly affected by an increase in density, as shown in Figure 6c.
<figure><img src="image_7.png" /><figcaption>Figure 6: Influence of distribution density on operational indicators</figcaption></figure>

However, this increase in gain can be nuanced when considering the self-consumption rate. The increase in self-consumption rate is not as pronounced as for other indicators. This is because the self-consumption rate is influenced not only by the amount of locally produced electricity but also by the ability to consume this electricity. From Figure 6d, we can assume that most configurations, even though they allow for larger loops as density increases from 0.5 act/km² to 2 act/km², do not necessarily provide the corresponding consumption profiles to increase the self-consumption rate. However, this indicator could potentially be improved through the inclusion of more net consumers, which would raise the consumption potential.

In real-world applications, the density of actor distribution is not an actionable parameter but rather a result of the choice of considered candidates for self-consumption communities. Increasing the number of candidates should therefore be advantageous for economically profitable self-consumption communities, without necessarily guaranteeing an increase in collective self-consumption rates.

<figure><img src="image_8.png" /><figcaption>Figure 7: Root gap distribution by solving method along actors density</figcaption></figure>

Figure 7 shows the relative root gap for group of instances having different consumers
density. We observe that the compact formulation performs better for denser configurations, as having close actors is similar to relaxing the distance constraint, leading to an actors selection problem driven only by the benefit of loops and constrained by power constraint. This figure also shows that the formulation involving clique generation (MLCol) is not suited for denser problems, as having closer actors conducts to a high number of possible cliques, and a bigger number of variables. For sparse configurations however the clique generation performs better than the compact formulation, as many invalid actors combinations are not evaluated.

5.4. Influence of exposition and period of the year

<figure><img src="image_9.png" /><figcaption>Figure 8: Influence of exposition on operational indicators</figcaption></figure>

Solar panel exposure directly impacts production volumes as it influences the production yield of plants. Even though the best configurations logically favour better economic gain (see Figure 8c), dealing with different expositions may result in changes in operational indicators. In the worst exposition case, the total production amount is lower than consumption needs, whereas it is higher with the best exposition configuration. This results in an inversion in terms of self-production rate and self-consumption rate, as Figure 8a and 8b demonstrate.

This highlights the fact that the self-consumption indicator is not always in line with the economic objective, which is computed relative to the production volumes. Guiding the optimisation through the economic objective is therefore a way to balance this effect, taking into account both self-consumption and self-production indicators. By optimising based on economic objectives and under the assumption that surplus selling prices are lower than electricity costs, decision-makers can ensure that decisions align with both financial goals and sustainability targets.

The previously mentioned inversion is not observed when the changes in production come from considering two different periods of the year (see Figure 9a and 9b). This can be explained by the fact that the period of the year has less impact on production than the panel exposition. When production can be divided by 10 due to poor exposition, the ratio between summer and winter is less than 2. In the presented instances, this means that in both summer and winter periods, production volume exceeds consumption volume. Still, considering the summer period seems to be more in favour of self-production than self-consumption.

Realised gain is also more subject to variation during the summer period (see Figure 9c), as the producers with the largest installed power and their geographic placement have a
<figure><img src="image_10.png" /><figcaption>Figure 9: Influence of the period of the year on operational indicators</figcaption></figure>

greater influence during the summer than during winter. This makes the positioning and capacity of larger producers more critical for maximizing overall gain when considering summer production peaks.

**6. Conclusion and future work**

In this article, we presented various mixed-integer linear programming models to optimise the design of collective self-consumption communities. We first proposed models for the optimisation of the design addressing one (SLCpct) or multiple (MLCpct) loop problems. The interest of the presented models lies in their ability to address both the production flow distribution problem and the design aspect in a single model, as the design aspect of the model is rarely tackled in related work. To manage the complexity arising from this coupling, we proposed decomposition methods, demonstrating their effectiveness through tests on different types of instances. To cope with spatially growing multiple communities problems (inducing a higher number of prosumers) we proposed a Dantzig-Wolfe decomposed model (MLCol) and a dedicated algorithm for the enumeration of feasible loops leveraging the spatial sparsity of actors, avoiding the use of a branch-and-price algorithm. To make the models actionable on large time horizons - which is needed in the design task - we proposed a Benders decomposition of SLCpct and MLCol models leading to models that keep reasonable solving time on large time horizons (SLExt and MLColExt).

Perspective for future work include an enhanced version of the Benders algorithm to select specific cuts and speed up the solving process, and to determine a fair distribution of loop benefits after the design to provide decision-makers with a pricing policy. A third identified perspective is the addition of storage facilities in the models.

Overall, the article, powered by presented contributions, provides comprehensive insights into the optimisation of collective self-consumption communities, considering both technical and operational aspects. We conducted a performance-oriented analysis on instances of various sizes and also performed a sensitivity analysis on operational parameters, showing how these models can support decision-making and help understand solar plant installation contexts' influence on self-consumption loop design.
# 7. Acknowledgment

We would like to thank Amarenco for providing us with their self-consumption business model and fine-grained data which offered a basis for this work and a motivating use case.

# 8. Compliance with Ethical Standards

## 8.1. *Funding*

This study was founded by the French Ministry of Economy, Finance and Industrial and Digital Sovereignty through a *France Relance* project.

## 8.2. *Ethical approval*

This article does not contain any studies with human participants or animals performed by any of the authors.

# References

Al-Sorour, A., Fazeli, M., Monfared, M., Fahmy, A., Searle, J. R., and Lewis, R. P. (2022). Enhancing PV Self-consumption within an Energy Community using MILP-based P2P Trading. *IEEE Access*, pages 1–1.

Albadi, M. H. and El-Saadany, E. F. (2008). A summary of demand response in electricity markets. *Electric Power Systems Research*, 78(11):1989–1996.

Bahret, C. and Eltrop, L. (2021). Cost-optimized heat and power supply for residential buildings: The cost-reducing effect of forming smart energy neighborhoods. *Energies*, 14(16).

Bio Gassi, K. and Baysal, M. (2022). Analysis of a linear programming-based decision-making model for microgrid energy management systems with renewable sources. *International Journal of Energy Research*, 46(6):7495–7518. eprint: https://onlinelibrary.wiley.com/doi/pdf/10.1002/er.7656.

Bokkisam, H. R., Singh, S., Acharya, R. M., and Selvan, M. (2022). Blockchain-based peer-to-peer transactive energy system for community microgrid with demand response management. *CSEE Journal of Power and Energy Systems*, 8(1):198–211.

Brusco, G., Menniti, D., Pinnarelli, A., and Sorrentino, N. (2023). Renewable Energy Community with distributed storage optimization to provide energy sharing and additional ancillary services. *Sustainable Energy, Grids and Networks*, 36:101173.

Böhringer, M., Kharrat, A., and Hanson, J. (2023). Benefits of Monthly Storage Rates in Shared Storage for Energetic Communities. *Electronics (Switzerland)*, 12(10).

Chasseray, Y., Besançon, M., Lorca, X., and Petitdemange, E. (2025). MILP instances and associated data for the self-consumption loops actor selection problem.

Clark, B. N., Colbourn, C. J., and Johnson, D. S. (1990). Unit disk graphs. *Discrete mathematics*, 86(1-3):165–177.

Conejo, A. J. and Sioshansi, R. (2018). Rethinking restructured electricity market design: Lessons learned and future needs. *International Journal of Electrical Power & Energy Systems*, 98:520–530.

CRE (2024). Arrêtés tarifaires photovoltaïques en métropole.
ENEDIS (2023). Enedis open data platform : Consumption aggregates at half hour time step. Accessed April 2023.

Espadinha, J., Baptista, P., and Neves, D. (2023). Assessing P2P energy markets contribution for 2050 decarbonization goals. *Sustainable Cities and Society*, 92.

Gil Mena, A. J., Nasimba Medina, V. F., Bouakkaz, A., and Haddad, S. (2023). Analysis and optimisation of collective self-consumption in residential buildings in Spain. *Energy and Buildings*, 283.

Goitia-Zabaleta, N., Milo, A., Gaztañaga, H., and Fernandez, E. (2023). Two-stage centralised management of Local Energy Market for prosumers integration in a community-based P2P. *Applied Energy*, 348.

Gribiss, H., Aghelinejad, M. M., and Yalaoui, F. (2023). Configuration selection for renewable energy community using mcdm methods. *Energies*, 16(6).

Gullì, F., Lazzeroni, P., Lorenti, G., Mariuzzo, I., Moraglio, F., and Repetto, M. (2022). Recoupled: A simulation tool for renewable energy communities coupling electric and thermal energies. *Economics and Policy of Energy and the Environment*, (2):49–60.

Heidari, M., Parra, D., and Patel, M. K. (2021). Physical design, techno-economic analysis and optimization of distributed compressed air energy storage for renewable energy integration. *Journal of Energy Storage*, 35.

JO (2017). Décret n° 2017-676 du 28 avril 2017 relatif à l'autoconsommation d'électricité. 2017-676. Accessed April 2023, https://www.legifrance.gouv.fr/jorf/id/JORFTEXT000034517272,26-01-2024.

Kroposki, B. (2017). Integrating high levels of variable renewable energy into electric power systems. *Journal of Modern Power Systems and Clean Energy*, 5(6):831–837.

Lund, P. D. (2009). Effects of energy policies on industry expansion in renewable energy. *Renewable energy*, 34(1):53–64.

Luz, G. P., Brito, M., Sousa, J., and Vieira, S. (2021). Coordinating shiftable loads for collective photovoltaic self-consumption: A multi-agent approach. *Energy*, 229.

Luz, G. P. and E Silva, R. A. (2021). Modeling energy communities with collective photovoltaic self-consumption: Synergies between a small city and a winery in Portugal. *Energies*, 14(2).

Mohamad, F., Teh, J., Lai, C.-M., and Chen, L.-R. (2018). Development of energy storage systems for power network reliability: A review. *Energies*, 11(9):2278.

MTE (2023). Arrêtés du 28 et 30 juillet 2023 relatif aux tarifs réglementés de vente de l'électricité. Technical report, Ministère de la transition énergétique.

Mustika, A. D., Rigo-Mariani, R., Debusschere, V., and Pachurka, A. (2022a). New Members Selection for the Expansion of Energy Communities. *Sustainability (Switzerland)*, 14(18).

Mustika, A. D., Rigo-Mariani, R., Debusschere, V., and Pachurka, A. (2022b). A two-stage management strategy for the optimal operation and billing in an energy community with collective self-consumption. *Applied Energy*, 310.

Pasqui, M., Felice, A., Messagie, M., Coosemans, T., Bastianello, T. T., Baldi, D., Lubello, P., and Carcasci, C. (2023). A new smart batteries management for Renewable Energy Communities. *Sustainable Energy, Grids and Networks*, 34.

Paterakis, N. G., Erdinç, O., and Catalão, J. P. (2017). An overview of demand response: Key-elements and international experience. *Renewable and Sustainable Energy Reviews*, 69(July 2016):871–891.
Perger, T., Wachter, L., Fleischhacker, A., and Auer, H. (2021). PV sharing in local communities: Peer-to-peer trading under consideration of the prosumers' willingness-to-pay. *Sustainable Cities and Society*, 66.

Piazza, G., Bracco, S., Delfino, F., Somma, M. D., and Graditi, G. (2023). Impact of electric mobility on the design of renewable energy collective self-consumers. *Sustainable Energy, Grids and Networks*, 33.

Pinto, E. S., Serra, L. M., and Lázaro, A. (2020). Optimization of the design of polygeneration systems for the residential sector under different self-consumption regulations. *International Journal of Energy Research*, 44(14):11248–11273.

Rahmaniani, R., Crainic, T. G., Gendreau, M., and Rei, W. (2017). The Benders decomposition algorithm: A literature review. *European Journal of Operational Research*, 259(3):801–817.

Reis, I. F., Gonçalves, I., Lopes, M. A., and Antunes, C. H. (2022). Collective self-consumption in multi-tenancy buildings–To what extent do consumers’ goals influence the energy system’s performance? *Sustainable Cities and Society*, 80.

Sangaré, M., Bourreau, E., Fortz, B., Pachurka, A., and Poss, M. (2023). Loads scheduling for demand response in energy communities. *Computers and Operations Research*, 160.

Simoiu, M. S., Fagarasan, I., Ploix, S., and Calofir, V. (2021). Sizing and management of an energy system for a metropolitan station with storage and related district energy community. *Energies*, 14(18).

Stephant, M., Abbes, D., Hassam-Ouari, K., Labrunie, A., and Robyns, B. (2021). Distributed optimization of energy profiles to improve photovoltaic self-consumption on a local energy community. *Simulation Modelling Practice and Theory*, 108.

Strepparava, D., Rosato, F., Nespoli, L., and Medici, V. (2022). Privacy and auditability in the local energy market of an energy community with homomorphic encryption. *Energies*, 15(15).

Surmann, A., Walia, R., and Kohrs, R. (2020). Agent-based bidirectional charging algorithms for battery electric vehicles in renewable energy communities. *Energy Informatics*, 3(1):19.

Wang, Z., Yu, X., Mu, Y., Jia, H., Jiang, Q., and Wang, X. (2021). Peer-to-Peer energy trading strategy for energy balance service provider (EBSP) considering market elasticity in community microgrid. *Applied Energy*, 303.