Enhancing scalability of peertopeer energy markets using adaptive segmentation method
 96 Downloads
Abstract
This paper proposes an adaptive segmentation method as a market clearing mechanism for peertopeer (P2P) energy trading scheme with large number of market players. In the proposed method, market players participate in the market by announcing their bids. In the first step, players are assigned to different segments based on their features, where the balanced kmeans clustering method is implemented to form segments. These segments are formed based on the similarity between players, where the amount of energy for trade and its corresponding price are considered as features of players. In the next step, a distributed method is employed to clear the market in each segment without any need to private information of players. The novelty of this paper relies on developing an adaptive algorithm for dividing large number of market players into multiple segments to enhance scalability of the P2P trading by reducing data exchange and communication overheads. The proposed approach can be used along with any distributed method for market clearing. In this paper, two different structures including communitybased market and decentralized bilateral trading market are used to demonstrate the efficacy of the proposed method. Simulation results show the beneficial properties of the proposed segmentation method.
Keywords
Energy trading Market segmentation Distributed optimization Peertopeer market Alternating direction method of multipliers1 Introduction
The rapid increase in the integration of distributed energy resources (DERs) into the power system along with deploying information and communication technologies (ICTs) has changed power system from a hierarchical structure to a deregulated system [1]. In the new power system, many consumers have been compelled to be more engaged of their energy consumption, which has changed them to prosumers who proactively manage their generation and demands. Prosumers with surplus energy could supply their energy to consumers with energy deficits to earn some benefit through energy trading. The current electricity market structure is still operating under conventional characteristics, without taking full advantage of local energy sharing [2]. Hence, new electricity market should be designed in a more consumercentric manner to incorporate prosumers into the energy market [3].
Consumercentric electricity markets enable players to trade energy directly in a peertopeer (P2P) environment. P2P trading is a novel proposal for operation of the new electricity markets, which engages prosumers in the market and contributes towards substantially increasing the percentage of renewable energy penetration into the current electricity grid [4]. Different market structures can be implemented for P2P energy trading such as communitybased market [5], and distributed bilateral trading market [6]. A comprehensive review of different market frameworks for local energy trading is presented in [7]. In the communitybased market, each player can share energy with other players and there is a virtual supervisory node to facilitate energy trading among prosumers. In this market, each player is a decision maker, and coordinator only generates a coordination signal to guarantee convergence among different players. On the other side, in the bilateral trading market, there is no coordinator and all players can negotiate directly to reach agreement on the price and amount of traded energy. Although these structures are different in the degree of centralization, in both cases market players can negotiate on energy trading, whether directly or through coordinator. Therefore, for proper implementation of P2P markets, an appropriate model of negotiation mechanism and market clearing should be designed.
In recent years, several methods have been proposed for designing market clearing and negotiation mechanism in P2P markets. These methods include dual decomposition [8], alternating direction method of multipliers (ADMM) [9], distributed consensusbased algorithms [10], and consensus + innovation methods [1, 6]. In all of these methods, the negotiation and market clearing algorithm is an iterative process, which needs to be executed iteratively to reach the optimal outcome. Due to the large number of players involved in the negotiation and the number of iterations needed, implementation of these methods may be challenging in practice. Hence, the interaction and negotiation mechanisms should be designed adequately. As the number of players in the consumercentric markets increases, the communication and computation overheads would be the main barriers in the realworld implementation of P2P markets. To enhance the scalability of the P2P market, the number of agents an algorithm deals with should be reduced. This decrease in the number of players can reduce the complexity of algorithm, as well as the computation and communication overheads [11].
Given this context, market segmentation can be applied to reduce the number of negotiating players in the P2P market to enhance scalability of these markets. Different clustering methods can be used for market segmentation to group similar players separately. Due to recent advances in the ICT, there has been a growing interest in the literature to employ data mining techniques such as clustering in energy sector. Authors in [12] use clustering to form virtual association of prosumers for smart energy trading, where prosumers in a cluster agree to operate together in the market as a single entity. In [13], different clustering methods are applied to form virtual microgrid through orchestrating prosumers to reduce total energy cost through the reduction of total relative forecasting inaccuracies. A geometric clustering is proposed in [14] to allocate local power exchange centres for local energy trading, where location is considered as the only feature for the clustering, and the demandsupply constraint is not included in the optimization problem for clustering.
This paper proposes an adaptive segmentation method for market clearing to enhance the scalability of P2P markets. In the proposed method, market players are clustered based on their features, and players in each segment negotiate separately to reach convergence on the price and amount of traded energy. The proposed method uses balanced kmeans clustering, to ensure the demandsupply constraint in each segment. Then the distributed algorithm for market clearing in each segment is presented, where ADMM method is employed to design the market clearing and negotiation process. At the third step, a quality of experience (QoE) index is defined based on the satisfaction of players to check if fairness of market can be increased by swapping players in different segments. The proposed method can be employed with any consumercentric market structure and different distributed optimization methods. Here, two different structures including communitybased and fully decentralized bilateral trading market have been considered for the market structure. The operation of the adaptive segmentation method is tested for different case studies.
2 Market structure
The considered market in this paper is a forward market, where players participate in the market for energy allocation for the next time slot. Also, the communication network among players is assumed to be connected, which means that there exists a path between any pair of players. Hence, the communication network may be totally different from the physical network. The proposed market clearing is developed as a deterministic clearing for a single market time, which can be extended for multiple time considering temporally binding constraints. Here the time unit is considered to be one hour, which allows using terms power and energy interchangeably.
3 Market clearing method
Consider a market composed of a set of N_{p} agents including active prosumers as sellers, and consumers as buyers. During each time interval, each market participant joins to the market for energy trading and tries to minimize its cost. The objective function is to clear the market with large number of players with fewer data exchange, while the privacy of players and the minimization of cost are considered in the clearing process. An adaptive segmentation method for market clearing is proposed, which has three main steps namely segmentation, market clearing in each segment, and resegmentation. The details of each step are given in the following.
3.1 Segmentation

Step 1: Assign initial values to \(x_{j}\) and \(\rho_{j}\) variables.

Step 2: Fix the values of \(x_{j}\) and \(\rho_{j}\) variables and solve for \(y_{ij}\) variables.

Step 3: Fix the \(y_{ij}\) variables and solve for \(x_{j}\) and \(\rho_{j}\) variables.
The iteration between Steps 2 and 3 of this algorithm continues until the clustering obtained in Step 2 does not change in two consecutive iterations. A notable advantage of kmeans algorithm is that the subproblems of Steps 2 and 3 have closedform solutions. Given a fixed set of centres, the optimal assignment is obtained by assigning each point to the closest centre. As stated before, the optimal centres for each given clustering are located at the centroids of the clusters.
Theorem 1
BAP is strongly NPhard.
Proof
This complexity result is proved by a polynomial reduction from 3partition, which is known to be NPcomplete [17]. The 3partition problem can be described as follows: given \(B \in \varvec{Z}^{ + }\) and 3p elements with weights \(w_{i}\) such that \(B/4 \le w_{i} \le B/2\), how these elements can be partitioned into p sets such that the sum of weights in each partition equals B? An instance of BAP can be created from an instance of 3partition by substituting \(N_{\text{p}}\) with 3p, \(N_{\text{c}}\) with p, \(d_{ij}\) with 0, \(\bar{X}_{i}\) with \(w_{i}\), and both \(\underset{\raise0.3em\hbox{$\smash{\scriptscriptstyle}$}}{\theta }\) and \(\bar{\theta }\) with B.
The BAP can be solved as integer linear programming problem using existing solvers. However, the cost of solving an integer program at each iteration of the algorithm can be prohibitive. An alternative method is to use a local search method for solving this problem. Local search methods often produce highquality solutions within reasonable times. The local search methods repeatedly move from one solution to another neighbouring solution in order to gradually improve the solution quality. This requires frequent evaluation of quality of neighbouring solutions, which in turn poses implementation challenges. These challenges have motivated development of constraintbased local search (CBLS) frameworks [18]. In CBLS frameworks, the problem and search strategy are specified in a high level language, which is later translated into efficient algorithms and carefully designed data structures. In this paper, OscaR.cbls is used to implement the local search method for solving BAP [19].
3.2 Market clearing in each segment for communitybased market
3.3 Market clearing in each segment for bilateral trading market
3.4 Resegmentation
From (29) and (33), it can be expressed that for players with \(x_{i} > 0\), higher values of SI show lower values of \(\beta_{i}\), and players with \(x_{i} < 0\) have higher SI when they have higher \(\beta_{i}\). Therefore, to increase price in a segment, a seller with higher SI (lower \(\beta_{i}\)) should be swapped with a seller with lower SI (higher \(\beta_{i}\)). Increasing price in the segment with the lowest QoE will increase the satisfaction level of players and reduce the difference between QoE in different segments. The algorithm for resegmentation is summarized in Algorithm 3. In this algorithm, in the segment with the highest clearing price, seller with the highest SI will be transferred to the segment with the lowest price (to reduce price in this segment and increase QoE). Also, in the segment with the lowest clearing price, buyer with the highest SI will be transferred to the segment with the lowest price (to increase clearing price and increase QoE in the segment). This swapping is repeated till standard deviation of QoE (\(\sigma_{\text{QoE}}\)) in different segments is decreasing.
In the bilateral trading, as each transaction has a unique price, instead of \(\lambda_{j}\) in (29), the average price of different transactions of players in segment j can be used. The rest of algorithm would be the same as resegmentation in the communitybased market.
3.5 Scalability analysis
Also, the structural complexity depends on the computation and communication time, and for communitybased market and bilateral trading market, it can be expressed as \(O\left( {N_{\text{p}} } \right)\) and \(O\left( {W_{i} } \right)\), respectively. As the algorithmic complexity and structural complexity are both related to the number of agents, reducing this number can reduce the time complexity of the algorithm. Since the proposed segmentation method can reduce number of trading agents, it can be verified that this method enhances the scalability of the P2P markets.
4 Case studies
4.1 Simulation setup
The proposed segmentation method is tested for a market with 100 players (55 sellers and 45 buyers). As the cost function parameters of market players are dependent on their preferences, these parameters are randomly generated, where \(\alpha_{i} \in \left( {0,1} \right)\) and \(\beta_{i} \in \left[ {2, 7} \right]\) if player i is a seller, and \(\beta_{i} \in \left[ {7, 15} \right]\) if player i is a buyer [25]. The minimum and maximum capacity of each player is randomly chosen to have \(\underset{\raise0.3em\hbox{$\smash{\scriptscriptstyle}$}}{X}_{i} \in \left[ {0, 8} \right]\;{\text{kWh}}\) and \(\bar{X}_{i} \in \left[ {0, 8} \right]\;{\text{kWh}}\), respectively. The stopping criteria in both structures are set to \(0.001\) for all segments and all players. Also, tuning parameter of all players for their local constraints is set to \(\xi_{i} = 0.001\). All case studies are performed on a computer with an Intel Core i7 processor running at 2.60 GHz using 16 GB of RAM.
4.2 Performance evaluation
Performance evaluation of segmentation method
Market  Method  Traded energy (kWh)  No. of signals  Computation time (s)  QoE 

Communitybased  Segmented  130.04  1600000  64.90  0.76 
Communitybased  Unsegmented  133.37  2400000  452.12  0.76 
Bilateral trading  Segmented  130.59  5124  8.30  0.75 
Bilateral trading  Unsegmented  133.37  6905  12.45  0.75 
4.3 Scalability analysis: impact of number of segments and players
5 Conclusion
In this paper, an adaptive segmentation method is proposed to enhance scalability of the P2P markets. The proposed method uses kmeans clustering to group players to different segments based on the similarity among them, where market in each segment can be cleared separately. This method is implemented for two different market structures including communitybased market and decentralized bilateral market and clearing algorithms for both structures are presented. Also, to make the segmentation method adaptive, a third step is considered to increase market fairness by increasing QoE of players. Results from case studies show that the proposed algorithm can enhance scalability of P2P markets by reducing computation time and number of signals for market clearing. This decrease in the bilateral market is more significant, since the number of trading partners of each player has a substantial impact on the computation time and number of signals.
Future research needs to be performed to incorporate additional features in the proposed segmentation method, such as geometric segmentation to incorporate transmission losses. Furthermore, the determination of number of segments for each market would be another possible topic for future works.
References
 [1]Hug G, Kar S, Wu C (2015) Consensus + innovations approach for distributed multiagent coordination in a microgrid. IEEE Trans Smart Grid 6(4):1893–1903CrossRefGoogle Scholar
 [2]Eid C, Bollinger LA, Koirala B et al (2016) Market integration of local energy systems: is local energy management compatible with European regulation for retail competition? Energy 114:913–922CrossRefGoogle Scholar
 [3]Peck ME, Wagman D (2017) Energy trading for fun and profit buy your neighbor’s rooftop solar power or sell your ownit’ll all be on a blockchain. IEEE Spectr 54(10):56–61CrossRefGoogle Scholar
 [4]Ambrosio R (2016) Transactive energy systems. IEEE Electr Mag 4(4):4–7CrossRefGoogle Scholar
 [5]Parag Y, Sovacool BK (2016) Electricity market design for the prosumer era. Nat Energy 1:16032CrossRefGoogle Scholar
 [6]Sorin E, Bobo L, Pinson P (2019) Consensusbased approach to peertopeer electricity markets with product differentiation. IEEE Trans Power Syst 34(2):994–1004Google Scholar
 [7]Khorasany M, Mishra Y, Ledwich G (2018) Market framework for local energy trading: a review of potential designs and market clearing approaches. IET Gener Transm Distrib 12(22):5899–5908CrossRefGoogle Scholar
 [8]Olivares DE, Cañizares CA, Kazerani M (2014) A centralized energy management system for isolated microgrids. IEEE Trans Smart Grid 5(4):1864–1875CrossRefGoogle Scholar
 [9]Morstyn T, Hredzak B, Agelidis VG (2018) Control strategies for microgrids with distributed energy storage systems: an overview. IEEE Trans Smart Grid 9(4):3652–3666CrossRefGoogle Scholar
 [10]Dagdougui H, Sacile R (2014) Decentralized control of the power flows in a network of smart microgrids modeled as a team of cooperative agents. IEEE Trans Control Systems Technol 22(2):510–519CrossRefGoogle Scholar
 [11]Moret F, Baroche T, Sorin E et al (2018) Negotiation algorithms for peertopeer electricity markets: computational properties. In: Proceedings of 2018 power systems computation conference, Dublin, Ireland, 11–15 June 2018, pp 1–7Google Scholar
 [12]Doulamis ND, Doulamis AD, Varvarigos E (2018) Virtual associations of prosumers for smart energy networks under a renewable split market. IEEE Trans Smart Grid 9(6):6069–6083CrossRefGoogle Scholar
 [13]Vergados DJ, Mamounakis I, Makris P et al (2016) Prosumer clustering into virtual microgrids for cost reduction in renewable energy trading markets. Sustain Energy Grids Netw 7:90–103CrossRefGoogle Scholar
 [14]Park L, Jeong S, Kim J et al (2019) Joint geometric unsupervised learning and truthful auction for local energy market. IEEE Trans Ind Electron 66(2):1499–1508CrossRefGoogle Scholar
 [15]Aloise D, Hansen P, Liberti L (2012) An improved column generation algorithm for minimum sumofsquares clustering. Math Program 131(1):195–220MathSciNetCrossRefGoogle Scholar
 [16]Aloise D, Deshpande A, Hansen P et al (2009) NPhardness of Euclidean sumofsquares clustering. Mach Learn 75(2):245–248CrossRefGoogle Scholar
 [17]Garey MR, Johnson DS (1990) Computers and intractability: a guide to the theory of NPcompleteness. W. H. Freeman & Co., New YorkzbMATHGoogle Scholar
 [18]Hentenryck PV, Michel L (2009) Constraintbased local search. MIT Press, CambridgezbMATHGoogle Scholar
 [19]Constrained based local search, Oscar library. https://bitbucket.org/oscarlib/oscar. Accessed 1 February 2018
 [20]Zhu M, Martinez S (2012) On distributed convex optimization under inequality and equality constraints. IEEE Trans Autom Control 57(1):151–164MathSciNetCrossRefGoogle Scholar
 [21]Khorasany M, Mishra Y, Ledwich G (2018) Distributed market clearing approach for local energy trading in transactive market. In: Proceedings of IEEE PES general meeting, Portland, USA, 5–8 August 2018, pp 1–5Google Scholar
 [22]Nedic A, Ozdaglar A, Parrilo PA (2010) Constrained consensus and optimization in multiagent networks. IEEE Trans Autom Control 55(4):922–938MathSciNetCrossRefGoogle Scholar
 [23]Zhang B, Yong R, Li M et al (2017) A hybrid trust evaluation framework for ecommerce in online social network: a factor enrichment perspective. IEEE Access 5:7080–7096CrossRefGoogle Scholar
 [24]Hoßfeld T, SkorinKapov L, Heegaard PE et al (2017) Definition of QoE fairness in shared systems. IEEE Commun Lett 21(1):184–187CrossRefGoogle Scholar
 [25]RahbariAsr N, Ojha U, Zhang Z et al (2014) Incremental welfare consensus algorithm for cooperative distributed generation/demand response in smart grid. IEEE Trans Smart Grid 5(6):2836–2845CrossRefGoogle Scholar
Copyright information
Open AccessThis article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.