# Cost-optimal p2p-trade in a community of households

I’m trying to solve the following problem and I’ve been working on it for a long time already:

I want to optimize electricity-costs in a smart grid. There’s producer and consumer households in the grid. Trades are just possible in between producer and consumer households. The smart grid consists of 200 households.

The Trading price of a household-pair is something like that:

Electricity price = price – possible price reduction (equation 1)

Where price is a constant and possible price reduction depends on parameters for each household-trading pair.

That means optimizing the electricity price (eq. 1) is possible by maximizing possible price reduction. I want to optimize the electricity price for the community and not from a single household perspective.

I defined the possible price reduction function for a household-pair as:

P(Ci,Pi) = x * value1 + value2 + value3

Pi = producer household
Ci = consumer household


As for x=1 value 2 and value 3 are mostlikely really small. The variable kind of depend on each other.

Value 1 Value 1 is the same for every possible household pair. But x depends on the distance (d) of the households Pi and Ci.

If d < 10 km:
x = 1

If d> 10 km:
X = 0


Value 2 Value 2 depends on the difference of the price zones of the household pair. So for each possible pair value 2 will be different. The price zone important for value 2 will be called zone A.

So value 2 for the Pair (P1,C1) would be:

Value2 =zoneA(P1)-zoneA(C1)

Zone1 depends on the location of the households.

Value 3 Value 3 also depends on the households price zones. It depends on a different price zones which we’ll call zone B.

So value 3 for the Pair (P1,C1) would be:

Value3 =zoneB(P1)-zoneB(C1)

Zone 3 also depends on the location of the households.

At the moment I’m looking at the problem as a transport problem for bipartite graph case. Interpreting households as nodes of a graph and individual price functions in between households as edges.

I want to compare different useful algorithms, pick the best fitting one and implement that in python.

How would you guys interpret the problem and what are your suggestions for useful algorithms for that case?

• Hi EILI, welcome! The following are actual questions to help you formulate the problem clearly: What are $C_1,C_2$ ? What do you mean by "premises"? Why price - cost still gives the price? Dec 8, 2020 at 12:44
• Oh sorry I made a mistake (c1,c2) should be (p1,c2). Where Ci are Costumer households and Pi are Producer Households
– ElLl
Dec 8, 2020 at 15:11
• By premises I mean that whether a reduction element could be used or not depends on the individual household trading pair. There’s a basic price which I call price and there is the possibility to reduce this price with what I call the reduction function.
– ElLl
Dec 8, 2020 at 15:15
• Hmm a paper which deals with a similar topic is “an optimal p2p energy trading model for smart homes in the smart grid" by Thomas Kunz, Muhammad raisul alam and Marc St-Hilaire
– ElLl
Dec 9, 2020 at 9:41
• Another paper is "incentive mechanisms to enable fair-renewable energy trade in smart-grids" by wang, Zhang and Li
– ElLl
Dec 9, 2020 at 9:49